
  /* Student study mode: only learning identity, context and learning actions stay visible. */
  .app-header{background:linear-gradient(180deg,#12332b 0%,#0f2923 100%)!important;border-bottom:2px solid var(--marigold)!important;box-shadow:0 2px 10px rgba(0,0,0,.14)!important;}
  .app-header .header-main{min-height:76px!important;padding:6px 20px!important;gap:10px!important;}
  .app-header .brand{gap:9px!important;}
  .app-header .brand-emblem{width:62px!important;height:62px!important;flex:0 0 62px!important;overflow:visible!important;}
  .app-header .brand-icon{width:62px!important;height:62px!important;object-fit:contain!important;object-position:center!important;}
  .app-header h1{font-size:1.28rem!important;line-height:1!important;}
  .app-header .sub{font-size:.64rem!important;margin:0!important;letter-spacing:.025em!important;color:#cfe0d8!important;}
  .header-course{display:none!important;}
  .app-header .adult-header-entry{display:none!important;}
  body.student-study-active .app-header .header-actions{display:none!important;}
  body:not(.student-study-active) .app-header .header-actions{display:flex!important;}

  .breadcrumb.active{display:flex!important;background:#15382f!important;border-bottom:1px solid rgba(255,255,255,.11)!important;padding:9px 20px!important;gap:14px!important;min-height:56px!important;align-items:center!important;}
  .study-context{display:flex!important;align-items:center!important;gap:10px!important;min-width:0!important;flex:1!important;}
  .study-topic-wrap{display:flex;flex-direction:column;min-width:0;gap:2px;}
  .study-course-context{font:650 .64rem/1.2 var(--font-ui);color:#a9c2b4;text-transform:uppercase;letter-spacing:.06em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  .breadcrumb .tag{font:700 .9rem/1.35 var(--font-ui)!important;color:#fff7e4!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
  .study-switches{display:flex!important;align-items:center;gap:6px!important;flex:0 0 auto;}
  .chapter-change,.context-change{border:1px solid rgba(239,191,98,.5)!important;background:rgba(232,163,61,.08)!important;color:#f2c46e!important;font:700 .68rem var(--font-ui)!important;border-radius:999px!important;padding:7px 10px!important;min-height:34px;cursor:pointer;white-space:nowrap;}
  .chapter-change:hover,.context-change:hover{background:rgba(232,163,61,.19)!important;border-color:#efbf62!important;}
  .breadcrumb .nav-group{display:flex!important;gap:5px!important;margin-left:auto!important;}
  .breadcrumb .nav-btn{border-radius:999px!important;min-height:36px!important;padding:7px 13px!important;font-size:.72rem!important;background:rgba(255,255,255,.055)!important;}
  .breadcrumb .nav-btn#conceptBtn,.breadcrumb .nav-btn#practiceBtn{display:inline-flex!important;}
  .breadcrumb .nav-step{display:none!important;}
  .study-label,.breadcrumb button.exit{display:none!important;}

  /* Technical / governance UI never appears in the learner's chapter picker. */
  .chapter-picker-context{padding:12px 18px 4px;font:650 .76rem/1.45 var(--font-ui);color:#665f53;}
  #modalOverlay .modal{max-width:620px;}
  #modalOverlay .modal-head h2{font-size:1.12rem;}
  #modalOverlay .chapter-list{padding-top:4px;}
  #modalOverlay .status-badge{display:none!important;}
  #modalOverlay .chapter-list button{min-height:48px;padding:10px 14px;border-radius:11px;text-align:left;}
  #modalOverlay .chapter-list button .num{color:#9a7a37;font-weight:750;min-width:28px;}

  /* Adult controls are a separate context, not student chrome. */
  #preferencesOverlay{padding:14px!important;}
  #preferencesOverlay .preferences-modal{
    max-width:660px!important;
    max-height:calc(100dvh - 28px)!important;
    overflow:hidden!important;
  }
  #preferencesOverlay .preferences-modal>.modal-head,
  #preferencesOverlay .preferences-modal>.adult-tabs{flex:0 0 auto!important;}
  #preferencesTitle::after{content:' · not part of student study mode';font:500 .65rem var(--font-ui);color:#877c68;margin-left:6px;}
  .adult-tabs{display:flex;gap:6px;padding:12px 18px 0;border-bottom:1px solid var(--rule);overflow:auto;}
  .adult-tab{border:0;background:transparent;color:#6d6557;border-bottom:3px solid transparent;padding:9px 11px;font:700 .73rem var(--font-ui);white-space:nowrap;cursor:pointer;}
  .adult-tab.active{color:#234d40;border-bottom-color:var(--marigold);}
  #preferencesOverlay .preferences-body{
    display:block!important;
    flex:1 1 auto!important;
    min-height:0!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    overscroll-behavior:contain;
    scrollbar-gutter:stable;
    -webkit-overflow-scrolling:touch;
    padding:15px 18px max(24px,env(safe-area-inset-bottom))!important;
  }
  .pref-section[data-adult-pane]{display:none;}
  .pref-section[data-adult-pane].active{display:block;}
  .adult-entry{margin-top:10px!important;background:transparent!important;box-shadow:none!important;color:#657067!important;border:0!important;text-decoration:underline;text-underline-offset:3px;font-size:.72rem!important;padding:7px!important;}
  .adult-entry:hover{transform:none!important;filter:none!important;color:#234d40!important;}
  #closePreferences{display:grid;place-items:center;width:42px;height:42px;margin:-8px -10px -8px auto;border-radius:50%;touch-action:manipulation;}
  #closePreferences:hover{background:rgba(255,255,255,.1);}
  #closePreferences:focus-visible{outline:3px solid #efbf62;outline-offset:2px;}
  .trust-architecture-panel{margin:10px 0 12px;border:1px solid #d5c9b4;border-radius:12px;background:#fffdf8;color:#3d443f;font-size:.76rem;line-height:1.55;}
  .trust-summary{padding:12px;}
  .trust-summary>strong{display:block;color:#234d40;font-size:.86rem;}
  .trust-summary p{margin:5px 0 9px;}
  .trust-counts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin:9px 0;}
  .trust-counts span{display:flex;flex-direction:column;padding:7px 8px;border:1px solid #e2dacb;border-radius:8px;background:#f8f3e9;color:#665f53;}
  .trust-counts strong{font-size:1rem;color:#263b34;}
  .trust-route{display:grid;gap:5px;margin:10px 0;padding:10px;border-left:4px solid #d98c20;background:#f6f0e4;border-radius:7px;}
  .trust-route>span{overflow-wrap:anywhere;}
  .trust-metrics{display:grid;grid-template-columns:1fr 1fr;gap:6px;}
  .trust-metric{display:flex;justify-content:space-between;gap:8px;padding:6px 8px;background:#fff;border:1px solid #e2dacb;border-radius:7px;}
  .trust-state{justify-self:start;padding:3px 7px;border-radius:999px;background:#ece6d9;text-transform:capitalize;font-weight:750;}
  .trust-state.trust-released{background:#e0f0e5;color:#205b39;}
  .trust-state.trust-source-gap,.trust-state.trust-release-integrity-failure{background:#f7e4de;color:#7b3529;}
  .trust-weight-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin:8px 0;}
  .trust-weight-grid>div{display:flex;flex-direction:column;padding:8px;border:1px solid #e2dacb;border-radius:8px;background:#fff;}
  .trust-boundary{color:#70685b;font-size:.71rem;}

  /* Remove non-learning chrome from active study. */
  .app-footer{
    display:block!important;
    flex:0 0 auto;
    text-align:center;
    padding:6px 12px calc(6px + env(safe-area-inset-bottom));
    font:500 .61rem/1.25 var(--font-ui);
    color:#91a89d;
    background:#102c25;
    border-top:1px solid rgba(232,163,61,.22);
    letter-spacing:.01em;
  }
  .timer-bar:not(.exam-active){display:none!important;}
  body.student-study-active .curriculum-chip,
  body.student-study-active .question-academic-meta{display:none!important;}

  .page-wrap{padding-bottom:26px!important;}
  #chat{max-width:980px;margin:0 auto;}

  .study-home-card{
    width:min(720px,calc(100% - 24px));
    margin:clamp(36px,9vh,88px) auto 24px;
    padding:clamp(22px,4vw,34px);
    border:1px solid #ded5c2;
    border-radius:18px;
    background:rgba(255,253,248,.97);
    box-shadow:0 10px 28px rgba(40,48,43,.08);
    text-align:center;
  }
  .study-home-card h2{margin:0 0 9px;font:750 clamp(1.25rem,2.5vw,1.65rem)/1.2 var(--font-display);color:#263b34;}
  .study-home-card p{margin:0 auto 18px;max-width:560px;color:#675f52;line-height:1.6;font-size:.9rem;}
  .study-home-course{display:inline-block;margin-bottom:10px;font-size:.72rem;font-weight:750;color:#786541;letter-spacing:.02em;}
  .study-home-primary{border:0;border-radius:999px;padding:11px 20px;min-height:44px;background:#d98c20;color:#20170a;font-weight:800;font-size:.88rem;cursor:pointer;box-shadow:0 4px 12px rgba(183,113,15,.16);}
  .study-home-primary:hover{filter:brightness(1.04);}
  .study-home-actions{display:flex;justify-content:center;gap:9px;flex-wrap:wrap;}
  .study-home-secondary{border:1px solid #cfc5b2;border-radius:999px;padding:10px 18px;min-height:44px;background:#fffdf8;color:#40564e;font-weight:750;font-size:.82rem;cursor:pointer;}
  .study-home-secondary:hover{background:#f5f0e5;}
  body[data-learning-band="early"] .study-home-card{max-width:620px;margin-top:clamp(28px,7vh,64px);padding:28px 22px;}
  body[data-learning-band="early"] .study-home-card h2{font-size:1.55rem;}
  body[data-learning-band="early"] .study-home-card p{font-size:1rem;}
  body[data-learning-band="early"] .study-home-primary{min-height:52px;padding:13px 24px;font-size:1rem;}
  @media(max-width:560px){
    .study-home-card{width:calc(100% - 20px);margin-top:28px;padding:22px 17px;border-radius:16px;}
    .study-home-card p{font-size:.84rem;}
    .app-footer{font-size:.57rem;padding-top:5px;padding-bottom:calc(5px + env(safe-area-inset-bottom));}
  }

  @media(max-width:760px){
    .app-header .header-main{min-height:66px!important;padding:5px 10px!important;}
    .app-header .brand-emblem{width:52px!important;height:52px!important;flex-basis:52px!important;}
    .app-header .brand-icon{width:52px!important;height:52px!important;}
    .app-header h1{font-size:1.03rem!important;}
    .app-header .sub{font-size:.55rem!important;}
    .breadcrumb.active{padding:8px 10px!important;gap:8px!important;align-items:stretch!important;flex-direction:column!important;}
    .study-context{width:100%!important;gap:6px!important;}
    .study-topic-wrap{flex:1;}
    .breadcrumb .tag{font-size:.82rem!important;}
    .study-course-context{font-size:.59rem;}
    .study-switches{gap:5px!important;}
    .chapter-change,.context-change{font-size:.62rem!important;padding:6px 8px!important;min-height:32px!important;}
    .breadcrumb .nav-group{width:100%!important;display:grid!important;grid-template-columns:1fr 1fr!important;margin:0!important;}
    .breadcrumb .nav-btn{width:100%;justify-content:center;min-height:38px!important;}
    #modalOverlay .modal{width:min(96vw,620px);}
    #modalOverlay .chapter-list button{font-size:.82rem;}
    #preferencesOverlay{padding:8px!important;}
    #preferencesOverlay .preferences-modal{max-height:calc(100dvh - 16px)!important;}
    .adult-tabs{padding-left:12px;padding-right:12px;}
    #preferencesTitle::after{display:none;}
  }

  @media(max-width:520px){
    body:not(.student-study-active) .app-header .header-actions button{width:auto!important;min-width:40px!important;padding:7px 8px!important;}
    body:not(.student-study-active) .app-header .header-actions button span{display:none!important;}
    .study-context{flex-wrap:wrap!important;}
    .study-switches{width:100%!important;}
    .chapter-change,.context-change{flex:1!important;justify-content:center!important;}
    .study-home-actions{display:grid;grid-template-columns:1fr;width:100%;}
    .study-home-primary,.study-home-secondary{width:100%;}
    .trust-counts,.trust-weight-grid{grid-template-columns:1fr 1fr;}
  }
