/* Phase 6.4 real-device feedback pass. Mobile-only unless explicitly marked. */

.tc-settings-footer a{display:flex;align-items:center;justify-content:center;width:100%;min-height:48px;padding:12px 18px;border-radius:12px;background:var(--tc-red,#e8242c);color:#fff!important;font-weight:800;text-decoration:none;box-sizing:border-box}

@media (max-width: 860px){
  .theorycampus-app,.tc-shell,.tc-main,.tc-content{max-width:100%;min-width:0}
  .tc-content{overflow-x:hidden}

  /* Management cards and checkboxes */
  .tc-card,.tc-settings-card,.tc-manage-form,.tc-student-card,.tc-organisation-tile,.tc-club-card{min-width:0;box-sizing:border-box}
  .tc-check{display:grid!important;grid-template-columns:28px minmax(0,1fr);align-items:start;gap:10px;width:100%;padding:12px 0;line-height:1.35}
  .tc-check input[type="checkbox"]{width:22px!important;height:22px!important;min-width:22px;margin:0!important;align-self:start}
  fieldset .tc-check,.tc-manage-form fieldset label{min-width:0}
  .tc-manage-form{gap:16px}
  .tc-manage-form>label,.tc-manage-form>fieldset{width:100%;min-width:0}

  /* Students / club manager: designed mobile cards */
  .tc-student-grid,.tc-club-grid,.tc-organisation-grid{grid-template-columns:1fr!important;gap:14px!important}
  .tc-student-table{display:grid!important;gap:12px!important;width:100%!important;min-width:0!important;background:transparent!important;border:0!important}
  .tc-student-table__head{display:none!important}
  .tc-student-row{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;grid-template-areas:"student student" "belt status" "activity progress" "view view"!important;gap:14px 12px!important;width:100%!important;min-width:0!important;padding:16px!important;border:1px solid #e3e7ea!important;border-radius:16px!important;background:#fff!important;box-shadow:0 6px 18px rgba(27,33,39,.05)!important;align-items:start!important}
  .tc-student-row>span{display:block!important;min-width:0!important}
  .tc-student-row>span:nth-child(1){grid-area:student;padding-bottom:13px;border-bottom:1px solid #edf0f2}
  .tc-student-row>span:nth-child(2){grid-area:belt}
  .tc-student-row>span:nth-child(3){grid-area:status}
  .tc-student-row>span:nth-child(4){grid-area:activity}
  .tc-student-row>span:nth-child(5){grid-area:progress}
  .tc-student-row>span:nth-child(6){grid-area:view;padding-top:2px}
  .tc-student-row>span:nth-child(2)::before,.tc-student-row>span:nth-child(3)::before,.tc-student-row>span:nth-child(4)::before,.tc-student-row>span:nth-child(5)::before{display:block;margin-bottom:5px;font-size:9px;font-weight:900;letter-spacing:.11em;text-transform:uppercase;color:#8a9298}
  .tc-student-row>span:nth-child(2)::before{content:"Belt"}
  .tc-student-row>span:nth-child(3)::before{content:"Status"}
  .tc-student-row>span:nth-child(4)::before{content:"Activity"}
  .tc-student-row>span:nth-child(5)::before{content:"Progress"}
  .tc-student-name{display:flex!important;align-items:center!important;gap:11px!important;min-width:0}
  .tc-student-name>b{display:grid!important;place-items:center!important;width:42px!important;height:42px!important;min-width:42px!important;border-radius:50%!important;background:var(--tc-red,#e8242c)!important;color:#fff!important;font-size:12px!important}
  .tc-student-name>span{display:grid!important;gap:2px!important;min-width:0!important}
  .tc-student-name strong{font-size:15px!important;line-height:1.2!important;overflow-wrap:anywhere}
  .tc-student-name small{font-size:11px!important;color:#737b82!important}
  .tc-student-row>span:nth-child(2){font-size:13px;font-weight:800;color:#292526}
  .tc-student-row>span:nth-child(4)>strong,.tc-student-row>span:nth-child(5)>strong{display:block;font-size:13px!important;line-height:1.25}
  .tc-student-row>span:nth-child(4)>small,.tc-student-row>span:nth-child(5)>small{display:block;margin-top:3px;font-size:10px!important;color:#7b8389!important;line-height:1.3}
  .tc-student-row .tc-status-pill{display:inline-flex!important;width:max-content!important;max-width:100%;margin:0!important}
  .tc-student-row .tc-table-link{display:flex!important;align-items:center!important;justify-content:center!important;width:100%!important;min-height:42px!important;border-radius:10px!important;background:var(--tc-red,#e8242c)!important;color:#fff!important;text-decoration:none!important;font-weight:900!important;font-size:12px!important}
  .tc-student-card,.tc-club-student,.tc-person-card{padding:16px!important}
  .tc-student-card__meta,.tc-student-card__stats,.tc-student-row__meta{gap:10px!important;flex-wrap:wrap}

  /* Dashboard health tile */
  .tc-manager-hero .tc-health-card,.tc-manager-hero .tc-health,.tc-manager-hero [class*="health"],.tc-dashboard [class*="club-health"]{width:100%!important;max-width:none!important;box-sizing:border-box}

  /* Community reward readability/alignment */
  .tc-community-challenge .tc-phase56-reward,.tc-weekly-challenge .tc-phase56-reward,.tc-weekly-card .tc-phase56-reward{background:var(--tc-red,#e8242c)!important;color:#fff!important;border-color:var(--tc-red,#e8242c)!important;padding:14px 16px!important}
  .tc-community-challenge .tc-phase56-reward>span,.tc-community-challenge .tc-phase56-reward>strong,.tc-community-challenge .tc-phase56-reward>small,.tc-weekly-challenge .tc-phase56-reward>span,.tc-weekly-challenge .tc-phase56-reward>strong,.tc-weekly-challenge .tc-phase56-reward>small,.tc-weekly-card .tc-phase56-reward>span,.tc-weekly-card .tc-phase56-reward>strong,.tc-weekly-card .tc-phase56-reward>small{color:#fff!important}
  .tc-community-challenge .tc-phase56-reward>span,.tc-weekly-challenge .tc-phase56-reward>span,.tc-weekly-card .tc-phase56-reward>span{font-weight:900!important}
  .tc-weekly-challenge [class*="reward"],.tc-weekly-card [class*="reward"]{background:var(--tc-red,#e8242c)!important;color:#fff!important;border-color:var(--tc-red,#e8242c)!important}
  .tc-weekly-challenge [class*="reward"] *,.tc-weekly-card [class*="reward"] *{color:#fff!important}
  .tc-community-result__reward,.tc-community-event [class*="reward"],.tc-community-event [class*="goal"]{display:flex!important;align-items:center!important;gap:10px;min-height:48px;box-sizing:border-box}

  /* Notifications must stay inside viewport */
  .tc-notification-layout{display:block!important;width:100%!important;min-width:0!important}
  .tc-notification-layout>*{width:100%!important;min-width:0!important;box-sizing:border-box}
  .tc-notification-list,.tc-notification-item{width:100%!important;min-width:0!important;box-sizing:border-box}
  .tc-notification-item{grid-template-columns:34px minmax(0,1fr)!important;overflow:hidden}
  .tc-notification-item p,.tc-notification-item strong,.tc-notification-item small{min-width:0;overflow-wrap:anywhere;word-break:break-word}
  .tc-notification-filters,.tc-community-notification-filters{display:flex;gap:8px;overflow-x:auto;padding-bottom:4px;max-width:100%}
  .tc-notification-filters>* ,.tc-community-notification-filters>*{flex:0 0 auto}

  /* Settings Centre becomes one selector + one workspace */
  .tc-settings-centre__layout{display:block!important}
  .tc-settings-nav{display:none!important}
  .tc-mobile-settings-picker{display:block!important;margin:0 0 14px;padding:14px;border-radius:14px;background:#fff;border:1px solid rgba(40,36,37,.12)}
  .tc-mobile-settings-picker label{display:block;font-size:11px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;margin-bottom:7px}
  .tc-mobile-settings-picker select{width:100%;min-height:48px;font-size:16px;border-radius:10px;padding:0 38px 0 12px}
  .tc-settings-workspace,.tc-settings-workspace>.tc-card{width:100%!important;min-width:0!important;box-sizing:border-box}
  .tc-settings-workspace>.tc-card{padding:18px!important}
  .tc-colour-fields{grid-template-columns:1fr!important}
  .tc-settings-footer{padding:14px 0 24px!important}

  /* Club page polish */
  .tc-club-life-card,.tc-club-class-card,[class*="club-class"]{min-width:0;box-sizing:border-box}
  .tc-club-class-card,[class*="club-class-card"]{padding:18px!important}
  .tc-club-class-card dl,.tc-club-class-card [class*="details"]{grid-template-columns:1fr!important;gap:8px!important}

  /* History trims */
  .tc-phase64-hidden-history{display:none!important}
  .tc-phase64-history-actions{display:flex;justify-content:center;padding:16px 0 4px}
  .tc-phase64-history-actions button,.tc-phase64-history-actions a{width:100%;min-height:44px;border:0;border-radius:10px;background:#282425;color:#fff;font-weight:800;padding:10px 14px;text-align:center;text-decoration:none;box-sizing:border-box}

  /* Student profile mobile rebuild */
  .tc-profile-hero{display:grid!important;grid-template-columns:72px minmax(0,1fr)!important;grid-template-areas:"avatar identity" "stats stats"!important;gap:14px 16px!important;align-items:center!important;padding:22px!important;border-radius:22px!important;min-height:0!important}
  .tc-profile-hero>.tc-profile-avatar{grid-area:avatar;width:68px!important;height:68px!important;min-width:68px!important;font-size:22px!important}
  .tc-profile-hero>div:not(.tc-profile-level):not(.tc-profile-avatar){grid-area:identity;min-width:0!important}
  .tc-profile-hero .tc-eyebrow{display:block;margin-bottom:5px;font-size:10px!important;letter-spacing:.12em}
  .tc-profile-hero h1{font-size:clamp(34px,10vw,46px)!important;line-height:.92!important;overflow-wrap:normal!important;word-break:normal!important;margin:0 0 8px!important}
  .tc-profile-hero p{margin:0!important;font-size:13px!important;line-height:1.35!important;color:#fff!important;opacity:.9}
  .tc-profile-level{grid-area:stats!important;margin:0!important;width:100%!important;display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important;text-align:left!important;padding-top:14px!important;border-top:1px solid rgba(255,255,255,.16)!important}
  .tc-profile-level span,.tc-profile-level strong{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:8px!important;margin:0!important;padding:10px 12px!important;border-radius:12px!important;background:rgba(255,255,255,.08)!important;color:#fff!important;min-width:0!important}
  .tc-profile-level span{font-size:10px!important;font-weight:800!important;letter-spacing:.06em!important}
  .tc-profile-level strong{font-size:16px!important;line-height:1.1!important}
  .tc-profile-grid{gap:14px!important;margin-top:14px!important}
  .tc-profile-grid>.tc-card{padding:20px!important;border-radius:18px!important;min-height:0!important}
  .tc-profile-grid>.tc-card h2{font-size:28px!important;margin:9px 0 8px!important}
  .tc-profile-grid>.tc-card p{margin:8px 0!important;font-size:14px!important;line-height:1.45!important}
  .tc-profile-grid .tc-stat-grid{gap:8px!important}
  .tc-profile-grid .tc-stat-grid>div{padding:12px 8px!important;border-radius:12px!important}
  .tc-profile-grid .tc-stat-grid strong{font-size:28px!important}
  .tc-profile-grid .tc-stat-grid span{font-size:11px!important;line-height:1.2!important}
  .tc-promotion-card form{display:grid!important;gap:10px!important;margin-top:14px!important}
  .tc-promotion-card label{display:grid!important;gap:7px!important;font-size:13px!important;font-weight:800!important}
  .tc-promotion-card textarea{width:100%!important;min-height:88px!important;max-height:140px!important;padding:11px 12px!important;font-size:16px!important;line-height:1.4!important;border-radius:10px!important;box-sizing:border-box!important}
  .tc-promotion-card .tc-button{width:100%!important;min-height:48px!important;padding:10px 14px!important;font-size:13px!important}
  .tc-profile-grid>.tc-card:last-child{padding:18px 20px!important}
  .tc-profile-grid>.tc-card:last-child h2{margin-bottom:5px!important}
  .tc-profile-grid>.tc-card:last-child p{margin:0!important}

  /* Profile journey breathing room */
  .tc-progress-history,.tc-journey-milestones,.tc-progress-milestones{gap:14px!important}
  .tc-progress-history>*,.tc-journey-milestones>*,.tc-progress-milestones>*{padding:18px!important}
  .tc-progress-month,.tc-this-month,[class*="month-stats"]{gap:10px!important}
  .tc-progress-month>*,.tc-this-month>*,[class*="month-stats"]>*{padding:14px 10px!important;min-width:0}

  /* Dojang uses the room as the hero, controls stay reachable. */
  body.tc-page:has(.tc-dojang) .tc-content,body.tc-page:has([class*="dojang-room"]) .tc-content{padding-left:8px!important;padding-right:8px!important}
  .tc-dojang-stage,.tc-dojang-room,[class*="dojang-room-stage"]{width:100%!important;max-width:none!important}
  .tc-dojang-toolbar,.tc-dojang-hud{max-width:100%!important}
  .tc-dojang-editor,[class*="dojang-editor-panel"]{max-height:min(58dvh,520px);overflow:auto;overscroll-behavior:contain}

  /* Shop / collection must fit phone width */
  .tc-dojang-shop,.tc-shop-shell,.tc-shop-page,[class*="shop-catalog"]{width:100%!important;max-width:100%!important;min-width:0!important;box-sizing:border-box;overflow-x:hidden!important}
  .tc-dojang-shop header,.tc-shop-header,[class*="shop-hero"]{display:grid!important;grid-template-columns:1fr!important;gap:12px!important}
  .tc-shop-tabs,.tc-shop-filters,[class*="shop-tabs"],[class*="shop-filter"]{display:flex!important;max-width:100%!important;overflow-x:auto!important;gap:8px!important;padding-bottom:5px}
  .tc-shop-tabs>* ,.tc-shop-filters>* ,[class*="shop-tabs"]>* ,[class*="shop-filter"]>*{flex:0 0 auto!important}
  .tc-shop-grid,[class*="shop-grid"]{grid-template-columns:1fr!important;gap:14px!important;width:100%!important}
  .tc-shop-card,[class*="shop-card"]{width:100%!important;min-width:0!important;box-sizing:border-box}

  /* Games: maximise playable viewport without touching game mechanics. */
  body.tc-page[data-game],body.tc-page:has([data-game]),body.tc-page:has([class*="game-stage"]){overflow-x:hidden}
  [data-game] .tc-game-stage,[data-game] [class*="game-shell"],.tc-game-stage,[class*="game-stage"]{width:100%!important;max-width:none!important;min-width:0!important;box-sizing:border-box}
  .tc-game-stage, [class*="game-stage"]{min-height:calc(100dvh - 150px)}
  .tc-game-question,.tc-game-answers,[class*="game-question"],[class*="game-answer"]{max-width:100%!important;min-width:0!important}
  .tc-coin-climb [class*="climb"],.tc-coin-climb [class*="ladder"],[data-game="coin-climb"] [class*="climb"],[data-game="coin-climb"] [class*="ladder"]{display:block!important;visibility:visible!important;max-height:26dvh;overflow:auto}
  .tc-path-of-truth [class*="path"],[data-game="path-of-truth"] [class*="path"]{display:block!important;visibility:visible!important;max-height:22dvh;overflow:auto}
  .tc-sudden-death,.tc-survival,.tc-belt-test,[data-game="sudden-death"],[data-game="survival"],[data-game="belt-test"]{max-width:100%!important;min-width:0!important}
}

@media (min-width:861px){.tc-mobile-settings-picker{display:none!important}}
