
/* Shared workspace sizing and interaction states. */
:root {
  --workspace-nav-width:232px;
  --workspace-gutter:clamp(24px,3.1vw,54px);
  --ui-ease:cubic-bezier(.22,.75,.3,1);
  --field-border:color-mix(in srgb,var(--muted) 36%,var(--border));
}
.app>main.page {
  width:calc(100% - var(--workspace-nav-width));
  margin-inline-start:var(--workspace-nav-width);
  padding:28px var(--workspace-gutter) 52px;
  min-inline-size:0;
}
.topbar.studio-sidebar {
  width:var(--workspace-nav-width);
  background:var(--surface);
  padding:22px 15px 16px;
}
.studio-brand { min-height:56px; padding:0 12px 16px; }
.studio-sidebar nav { align-content:start; gap:4px; }
.studio-sidebar .nav-section-label,.studio-sidebar .teacher-tools-label {
  margin:14px 12px 4px;
  font-size:11px;
  font-weight:700;
  color:var(--muted);
  letter-spacing:.05em;
}
.studio-sidebar .nav-caption,.studio-sidebar .sidebar-note { display:none; }
.studio-sidebar nav .navlink { min-height:44px; padding:8px 11px; gap:10px; line-height:1.25; font-size:14px; transform:none; }
.studio-sidebar nav .navlink :is(.nav-full-label,.nav-compact-label) { min-width:0; }
.studio-sidebar .nav-symbol { display:grid; place-items:center; width:24px; height:24px; flex:0 0 24px; }
.studio-sidebar .nav-symbol .ft-icon { width:20px; height:20px; }
.studio-sidebar .nav-compact-label { display:none; }
.studio-sidebar .studio-mode-switch { margin:17px 0 12px; display:flex; }
.studio-sidebar .mode-option { min-height:38px; }
.studio-sidebar .sidebar-tools { padding:9px 4px; }
.studio-sidebar .sidebar-tool { min-height:42px; justify-content:center; }
.studio-sidebar .sidebar-tool .ft-icon { width:18px; height:18px; }
.sidebar-tool>span:first-child { display:grid; place-items:center; min-width:20px; }
.studio-user { min-height:52px; padding:10px 5px 0; }
.workspace-top { margin-bottom:19px; padding-block-end:15px; }
.workspace-top,.welcome-row { min-width:0; flex-wrap:wrap; }

body:is(.in-exam,.focus-session,.reading-focus) .studio-sidebar { display:none!important; }
body:is(.in-exam,.focus-session,.reading-focus) .app>main.page { margin:0; width:100%; max-width:none; }
body:is(.in-exam,.focus-session) .app>main.page { padding:0; }
body.teacher-manager-open { overflow:hidden; }
body:has(.studio-sidebar .ft-chat-launch) #app>.ft-msg-launch,
body:is(.in-exam,.focus-session,.reading-focus) #app>.ft-msg-launch { display:none; }
body:is(.in-exam,.focus-session,.reading-focus) .ft-chat-popup { display:none; }

:where(.word-library-page,.word-practice-page,.subject-workspace,.reading-workspace,[data-route="settings"],.admin-shell) :is(h1,h2,h3,p,td) { overflow-wrap:anywhere; }
:where(.word-library-page,.word-practice-page,.subject-workspace,.reading-workspace,[data-route="settings"],.admin-shell) :is(button,a,input,select,textarea):focus-visible {
  outline:2px solid var(--accent);
  outline-offset:2px;
}
:where(.word-toolbar,.review-controls,.school-login,.school-profile,.admin-toolbar,.school-dialog,.group-session,.reading-picker) :is(input:not([type=checkbox]):not([type=range]),select,textarea) {
  min-width:0;
  min-height:44px;
  color:var(--text);
  border:1px solid var(--field-border);
  border-radius:10px;
  background:var(--surface);
  font-size:15px;
}
:where(.word-toolbar,.review-controls,.school-login,.school-profile,.admin-toolbar,.school-dialog,.reading-picker) :is(input,select,textarea):focus {
  border-color:var(--accent);
}
:where(.word-toolbar,.review-controls,.school-login,.admin-toolbar) input::placeholder { color:var(--muted); opacity:.92; }
.text-button { color:var(--accent-strong); min-height:38px; padding:5px 2px; font:inherit; font-weight:700; text-underline-offset:4px; }
.text-button:hover { text-decoration:underline; }
.btn .ft-icon { width:18px; height:18px; }
.btn { transition:background-color .16s ease,border-color .16s ease,color .16s ease,box-shadow .18s var(--ui-ease); }

/* Entry screen and accessible form controls. */
.role-entrance {
  grid-template-columns:minmax(310px,.82fr) minmax(0,1.18fr);
  grid-template-rows:minmax(100dvh,auto);
}
.role-entrance-content { align-items:stretch; padding:clamp(24px,4.5vw,76px); }
.role-entrance-content>:is(.school-role-tabs,.school-login,.role-entrance-brand,h1,p) { max-width:510px; width:100%; margin-inline:auto; }
.role-entrance-content>h1,.role-entrance-content>p { margin-inline:auto; }
.role-entrance-brand { padding:0; gap:11px; }
.school-role-tabs { margin-block:26px 18px; border:1px solid var(--border); }
.school-role-tabs button { min-width:0; min-height:44px; font-size:14px; }
.school-role-tabs button[data-auth-role="teacher"][aria-pressed=true] { color:#2b4d68; }
.school-role-tabs button[data-auth-role="admin"][aria-pressed=true] { color:#5d3e57; }
.school-login>.input,.school-password>input { min-height:48px; font-size:16px; padding-inline:13px; }
.school-password>input { padding-inline-end:90px; }
.school-password>[data-show-password] {
  display:inline-flex; align-items:center; gap:5px; min-width:72px; justify-content:center;
  border-radius:7px; font-size:13px;
}
.school-password>[data-show-password]:hover { background:var(--accent-soft); }
.school-password .ft-icon { width:17px; height:17px; }
.school-login [type=submit] { min-height:48px; }
.role-film { min-width:0; padding:clamp(18px,3.5vw,60px); }
.role-film-frame { border-radius:14px; }
.modal-back { padding:max(16px,env(safe-area-inset-top)) 16px max(16px,env(safe-area-inset-bottom)); }
.modal-back>.modal {
  width:min(100%,540px); max-height:calc(100dvh - 32px); margin:0;
  overflow:auto; overscroll-behavior:contain;
}
.modal .acts,.school-dialog footer { flex-wrap:wrap; gap:9px; }
.modal .acts .btn,.school-dialog :is(.btn,[data-cancel]) { min-height:44px; }
.school-dialog form { min-width:0; }
.school-dialog textarea { width:100%; padding:10px 12px; resize:vertical; }
.school-profile { padding:0; width:min(100%,520px); }
.school-profile label { font-size:14px; }
.school-profile input { padding-inline:12px; }

/* Home keeps the dashboard within reach of the introduction cards. */
.studio-home .welcome-row { margin-bottom:20px; }
.studio-home .studio-cinema { margin-block:0 22px; }
.studio-home .studio-cinema:empty { display:none; }
.studio-home .reference-card { min-height:278px; padding:26px 34px 62px; align-items:center; gap:24px; }
.studio-home .reference-card-copy h3 { font-size:clamp(26px,3.1vw,42px); line-height:1.14; margin-block:10px; }
.studio-home .reference-card-copy p { max-width:38ch; margin-block:5px 14px; line-height:1.55; }
.studio-home .reference-controls { left:34px; right:27px; bottom:10px; }
.reference-controls .reference-dots { display:flex; align-items:center; min-width:0; }
.reference-controls .reference-dots button { min-height:36px; }
.reference-controls .icon-btn { width:42px; height:42px; }
.reference-cards { transition:transform .5s var(--ui-ease); }
.studio-home .cb-dashboard { padding:24px; border-radius:16px; }
.studio-home .cb-dash-top { margin-bottom:16px; flex-wrap:wrap; gap:10px; }
.studio-home .cb-metrics { grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.studio-home .cb-metric { min-height:90px; padding:14px 16px; gap:7px; position:relative; }
.studio-home .cb-metric b { position:static; font-size:30px; }
.studio-home .cb-metric span { position:static; line-height:1.3; font-weight:700; }
.studio-home .cb-metric::after { display:none; }
.cb-assignment-row .cb-task-mark { display:grid; place-items:center; flex:0 0 40px; width:40px; height:40px; border-radius:10px; }
.cb-task-mark .ft-icon,.history-type .ft-icon { width:19px; height:19px; }
.cb-task-copy,.cb-task-copy b,.cb-task-copy span { min-width:0; overflow-wrap:anywhere; }
.cb-assignment-row .btn,.home-resume-row .btn { min-height:42px; }

/* Catalogs and review. */
.library-heading { display:flex; align-items:end; justify-content:space-between; flex-wrap:wrap; gap:12px; margin:0 0 17px; }
.library-heading .eyebrow { font-weight:750; letter-spacing:.12em; }
.library-heading h1 { margin:6px 0 7px; font:800 clamp(29px,3.2vw,43px)/1.16 var(--font); letter-spacing:-.04em; }
.library-heading .desc { margin:0; font-size:15px; line-height:1.6; }
.library-heading>.btn { min-height:42px; }
.word-filter-panel {
  display:grid; gap:12px; padding:17px; border:1px solid var(--border);
  border-radius:15px; background:var(--surface);
}
.word-bank-tabs,.word-level-tabs { display:grid; gap:7px; }
.word-bank-tabs { grid-template-columns:repeat(2,minmax(0,1fr)); }
.word-level-tabs { grid-template-columns:repeat(4,minmax(0,1fr)); }
.word-level-tabs[hidden] { display:none; }
.word-bank-tabs button,.word-level-tabs button {
  display:flex; align-items:center; justify-content:space-between; gap:4px;
  border:1px solid var(--border); background:var(--surface-alt); color:var(--text);
  border-radius:9px; min-width:0; padding:8px 10px; min-height:42px; font-weight:700;
}
.word-bank-tabs button { min-height:50px; padding:10px 14px; font-size:16px; }
.word-level-tabs button { justify-content:center; gap:7px; font-size:14px; }
.word-bank-tabs button small,.word-level-tabs button small { color:var(--muted); font-size:12px; white-space:nowrap; }
.word-bank-tabs button.selected,.word-level-tabs button.selected {
  color:var(--accent-strong); background:var(--accent-soft); border-color:var(--accent); box-shadow:inset 0 0 0 1px var(--accent);
}
.word-bank-tabs button:disabled,.word-level-tabs button:disabled { opacity:.6; cursor:default; }
.word-toolbar {
  display:grid; align-items:end; gap:10px; grid-template-columns:minmax(0,2fr) repeat(2,minmax(132px,1fr));
}
.word-toolbar>label { display:grid; min-width:0; gap:6px; color:var(--muted); font-size:13px; font-weight:700; line-height:1.35; }
.word-toolbar :is(input,select) { display:block; width:100%; padding:8px 12px; font-weight:500; }
.word-toolbar .field-with-icon { display:block; position:relative; min-width:0; }
.field-with-icon .ft-icon { position:absolute; z-index:1; width:17px; height:17px; left:12px; top:50%; color:var(--muted); transform:translateY(-50%); }
.word-toolbar .field-with-icon input { padding-inline-start:37px; }
.word-list-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:7px 0 5px; min-height:43px; color:var(--muted); font-size:14px; }
.word-library-page .toc { grid-template-columns:repeat(auto-fit,minmax(min(100%,218px),1fr)); gap:12px; }
.word-library-page .toc-card { min-height:148px; padding:16px; transform:none; transition:background .16s ease,border-color .16s ease,box-shadow .18s var(--ui-ease); }
.word-library-page .toc-card .ti { margin-block:6px 8px; font-size:17px; letter-spacing:0; line-height:1.4; }
.word-library-page .toc-card:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.word-library-page .toc>.empty { grid-column:1/-1; margin:0; border:1px solid var(--border); border-radius:12px; padding:24px 16px; }
.word-load-more { display:block; margin:20px auto 0; min-height:44px; }
.word-load-more[hidden],.word-list-head button[hidden] { display:none; }
.review-controls { padding:14px; }
.review-controls :is(select,input[type=search]) { max-width:100%; }
.review-toolbar .seg,.review-toolbar-secondary { min-width:0; flex-wrap:wrap; }
.review-toolbar .seg button,.review-toolbar-secondary label { min-height:40px; }
.review-toolbar-secondary label { display:flex; align-items:center; gap:6px; }
.review-heading h1 { font-size:clamp(28px,3vw,40px); }
.review-card { min-width:0; }
.review-card h3,.review-card-tools,.review-note { overflow-wrap:anywhere; }
.review-card-tools .btn,.review-launch-actions .btn { min-height:42px; }
.review-comparison { margin-block:14px; }
.review-result-tools .btn { min-height:44px; }

body:not(.in-exam) .word-practice-page .practice-head {
  display:flex; flex-wrap:wrap; gap:9px; align-items:center; margin:0 0 15px;
}
.word-practice-page .practice-head .btn { min-height:42px; }
.word-practice-page .practice-head .btn .ft-icon { margin-inline-end:5px; }
body:not(.in-exam) .word-practice-page .passage { font-size:clamp(20px,1.6vw,25px); line-height:2.05; padding:clamp(16px,3vw,38px); }
.word-practice-page .hud { flex-wrap:wrap; gap:9px; }
.word-practice-page .hud .btn { min-height:44px; }
.word-practice-page #resultWrap { scroll-margin-top:16px; }
#resultWrap .result-list { padding:0; border:1px solid var(--border); border-radius:11px; overflow:hidden; }
#resultWrap .result-answer-labels,#resultWrap .result-list .row {
  display:grid; grid-template-columns:42px 48px minmax(0,1fr) minmax(0,1fr); gap:9px;
  align-items:center; padding-inline:12px;
}
#resultWrap .result-answer-labels { padding-block:9px; background:var(--surface-alt); font-size:12px; color:var(--muted); font-weight:750; }
#resultWrap .result-list .row { min-height:44px; font-size:15px; overflow-wrap:anywhere; }
#resultWrap .result-list .row .yours,#resultWrap .result-list .row .right { min-width:0; white-space:normal; }

/* Reading and writing keep their material and response in logical document order. */
main:is(.subject-workspace,.reading-workspace) { min-width:0; }
.subject-workspace .subject-hero { padding:clamp(20px,3vw,37px); margin-bottom:clamp(22px,3vw,34px); border-radius:16px; }
.subject-section-head :is(h2,p) { overflow-wrap:anywhere; }
.reading-type { align-items:stretch; }
.reading-type button { min-height:42px; }
.reading-picker :is(input,select,.btn) { min-height:44px; }
.reading-library .reading-card { min-height:132px; }
.reading-exam-layout:not(.ft-mock-fill)>:is(.reading-passage,.reading-question),.write-shell>* { min-width:0; }
.reading-option { text-align:start; }
.reading-passage img { max-width:100%; height:auto; object-fit:contain; }
.reading-navigation .btn { min-height:44px; }
.reading-navigation { flex-wrap:wrap; gap:8px; }
.write-shell :is(.write-prompt,.write-editor) { min-inline-size:0; }
.write-shell .write-editor textarea { min-height:270px; width:100%; }
.write-bar,.write-hud { gap:8px; flex-wrap:wrap; }
.write-bar .btn,.write-hud .btn { min-height:42px; }
.writing-mode-tabs { max-width:100%; flex-wrap:wrap; }
.writing-mode-tabs button { min-height:44px; }
.wset-list,.wset,.wq-grid,.group-grid { min-width:0; }
.wset .wslider { width:min(100%,30rem); min-height:34px; }
:is(.set-list,.wset-list)>.set-row,.wset-row { min-width:0; }
:is(.set-list,.school-profile) .btn { min-height:44px; }
.group-grid { grid-template-columns:repeat(auto-fit,minmax(min(100%,250px),1fr)); }
.group-card-actions .btn,.group-deadline .btn { min-height:40px; }
#app>.ft-msg { max-height:calc(100dvh - 24px); }
.ft-msg textarea { min-width:0; }
.admin-session { flex-wrap:wrap; }
.admin-shell :is(.admin-users,.admin-table-wrap,.admin-toolbar) { min-width:0; }
.admin-table-wrap { overscroll-behavior-inline:contain; }

@media (min-width:901px) {
  .write-shell { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (min-width:1200px) {
  :root { --workspace-nav-width:244px; }
}
@media (min-width:901px) and (max-width:1060px) {
  :root { --workspace-nav-width:208px; --workspace-gutter:24px; }
  .topbar.studio-sidebar { padding-inline:11px; }
  .studio-sidebar nav .navlink { padding-inline:9px; gap:8px; }
}
@media (max-width:900px) {
  :root { --workspace-nav-width:0px; --workspace-gutter:clamp(14px,3.5vw,25px); }
  .app>main.page { width:100%; margin:0; padding:21px var(--workspace-gutter) 38px; min-height:0; }
  .topbar.studio-sidebar {
    position:sticky; inset:0 auto auto; display:grid; align-items:center;
    grid-template-columns:minmax(0,1fr) auto auto; grid-template-rows:auto auto;
    column-gap:8px; row-gap:7px; padding:max(6px,env(safe-area-inset-top)) var(--workspace-gutter) 6px;
    width:100%; height:auto; max-height:none; overflow:visible;
    border-right:0; border-bottom:1px solid var(--border);
  }
  .studio-sidebar .studio-brand { grid-column:1; grid-row:1; margin:0; padding:0; gap:8px; min-height:44px; min-width:0; }
  .studio-sidebar .studio-logo { letter-spacing:-2px; font-size:32px; }
  .studio-sidebar .studio-brand strong { font-size:15px; white-space:nowrap; }
  .studio-sidebar .studio-brand small,.studio-sidebar .studio-user,.studio-sidebar .nav-caption,
  .studio-sidebar .nav-section-label,.studio-sidebar .teacher-tools-label { display:none; }
  .studio-sidebar .studio-mode-switch { grid-column:2; grid-row:1; margin:0; padding:2px; white-space:nowrap; }
  .studio-sidebar .mode-option { min-height:38px; padding:3px 7px; }
  .studio-sidebar .sidebar-tools { display:flex; flex-wrap:nowrap; grid-column:3; grid-row:1; border:0; margin:0; padding:0; gap:3px; }
  .studio-sidebar .sidebar-tool { width:44px; height:44px; padding:0; }
  .studio-sidebar .sidebar-tool>span:nth-child(n+2) { display:none; }
  .studio-sidebar nav {
    grid-column:1/-1; grid-row:2; display:grid; grid-template-columns:repeat(4,minmax(0,1fr));
    gap:4px; width:100%; min-width:0; padding:0; overflow:visible;
  }
  .studio-sidebar nav .navlink {
    position:relative; display:flex; flex-direction:row; justify-content:center; gap:5px;
    padding:5px 3px; min-height:44px; min-width:0; font-size:12px; text-align:center; white-space:nowrap;
  }
  .studio-sidebar nav .navlink .nav-symbol { flex:0 0 21px; width:21px; height:21px; }
  .studio-sidebar nav .navlink .ft-icon { width:18px; height:18px; }
  .studio-sidebar .nav-full-label,.studio-sidebar .navlink small { display:none; }
  .studio-sidebar .nav-compact-label { display:inline; }
  .studio-sidebar nav .navlink .chat-unread:not([hidden]) { position:absolute; top:1px; right:2px; min-width:16px; height:16px; margin:0; }
  .workspace-top { display:none; }
  .role-entrance { grid-template-columns:1fr; grid-template-rows:auto auto; align-content:start; }
  .role-entrance-content { padding:clamp(20px,5vw,45px); }
  .role-entrance-brand { margin-bottom:22px; }
  .role-film { align-self:start; padding:clamp(15px,3vw,25px); }
  .role-film-frame { max-width:650px; }
  .reading-exam-layout:not(.ft-mock-fill):not(.ft-exam-content) { grid-template-columns:minmax(0,1fr); }
  .reading-exam-layout:not(.ft-mock-fill):not(.ft-exam-content)>:is(.reading-passage,.reading-question) { height:auto; max-height:none; overflow:visible; }
  .write-shell { grid-template-columns:minmax(0,1fr); }
  .write-shell .write-prompt { max-height:none; overflow:visible; }
  .word-practice-page #resultWrap { scroll-margin-top:160px; }
}
@media (max-width:620px) {
  .studio-home .welcome-row>div { min-width:0; }
  .studio-home .welcome-row h1 { font-size:28px; }
  .studio-home .reference-card { padding:21px 19px 62px; min-height:238px; grid-template-columns:minmax(0,1fr); gap:0; }
  .studio-home .reference-card-copy h3 { font-size:26px; }
  .studio-home .reference-card-copy p { font-size:14px; }
  .studio-home .reference-controls { left:18px; right:14px; bottom:7px; }
  .studio-home .preview-visual { display:none; }
  .studio-home .cb-dashboard { padding:15px; }
  .studio-home .cb-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .studio-home .cb-metric { padding:11px 13px; min-height:74px; }
  .studio-home .cb-metric b { font-size:25px; }
  .word-filter-panel { padding:12px; }
  .word-toolbar { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .word-search-field { grid-column:1/-1; }
  .word-toolbar :is(input,select),.review-controls :is(input,select),.school-dialog :is(input,select,textarea),.ft-msg textarea { font-size:16px; }
  .word-level-tabs button { flex-direction:column; gap:2px; padding-inline:4px; line-height:1.18; min-height:44px; font-size:13px; }
  .word-bank-tabs button { font-size:14px; padding-inline:8px; }
  .word-bank-tabs button small { font-size:11px; }
  .word-library-page .toc { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .word-library-page .toc-card { padding:12px 10px; min-height:125px; }
  .word-library-page .toc-card .ti { font-size:16px; overflow-wrap:anywhere; }
  .review-toolbar-primary,.review-toolbar-secondary { display:flex; flex-wrap:wrap; align-items:stretch; }
  .review-toolbar-secondary label { min-width:min(100%,140px); }
  .review-card-tools .btn { flex:1; }
  #resultWrap .result-answer-labels,#resultWrap .result-list .row { padding-inline:8px; grid-template-columns:30px 34px minmax(0,1fr) minmax(0,1fr); gap:6px; }
  #resultWrap .result-list .row { font-size:14px; }
  .reading-type { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
  .reading-type button { padding-inline:6px; min-width:0; }
  .reading-library { grid-template-columns:repeat(auto-fit,minmax(min(100%,145px),1fr)); gap:8px; }
  .reading-library .reading-card { min-height:118px; padding:13px; }
  .reading-exam-layout:not(.ft-mock-fill) .reading-options .reading-option { min-height:48px; }
  .reading-exam-layout:not(.ft-mock-fill) .reading-navigation .btn { min-width:88px; }
  /* FT_MOBILE_EXAM_TOOLBAR_V1 */
  body.reading-focus .ft-exam-top{display:grid;grid-template-columns:minmax(0,1fr);gap:10px;padding:10px;}
  body.reading-focus .ft-exam-identity{display:grid;grid-template-columns:minmax(0,1fr) auto;width:100%;gap:6px 10px;}
  body.reading-focus .ft-exam-identity>strong{grid-column:1/-1;margin:0;white-space:normal;}
  body.reading-focus .ft-exam-identity>b{justify-self:start;}
  body.reading-focus .ft-exam-top nav{width:100%;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px;min-width:0;}
  body.reading-focus .ft-exam-top nav button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:48px;min-width:0;padding:7px 2px;font-size:11px;line-height:1.2;letter-spacing:0;white-space:nowrap;}
  body.reading-focus .ft-exam-top nav button .exam-control-label{margin:0;}
  body.reading-focus .ft-exam-top nav button svg{width:17px;height:17px;flex:none;}
  body.reading-focus .ft-exam-top nav [data-next]{min-width:0;}body.reading-focus .ft-exam-top nav [data-next] svg{order:-1;}
  .ft-exam-status { padding-inline:8px; gap:5px; }
  .ft-exam-status>div:first-child>span { padding-inline-start:5px; }
  .ft-exam-content.ft-mock-fill { min-height:calc(100dvh - 135px); padding-inline:13px; gap:15px; }
  .ft-exam-content.ft-mock-fill h1 { padding-block-start:20px; font-size:22px; }
  .ft-exam-content.ft-mock-fill .reading-passage { align-self:start; padding-block:8px; }
  .ft-exam-content .ft-inline-passage { line-height:1.7; }
  #app>.ft-msg { inset:auto 8px max(8px,env(safe-area-inset-bottom)); width:auto; height:min(680px,calc(100dvh - 16px)); }
  .admin-stat { gap:7px; min-height:70px; padding:13px; }
  .admin-toolbar input,.admin-toolbar select { font-size:16px; }
  .admin-dialog .admin-dialog-actions { flex-wrap:wrap; }
}
@media (max-width:370px) {
  .topbar.studio-sidebar { padding-inline:8px; column-gap:4px; }
  .studio-sidebar .studio-brand strong { font-size:13px; }
  .studio-sidebar .studio-brand { gap:5px; }
  .studio-sidebar nav .navlink { gap:2px; font-size:11px; }
  .studio-sidebar nav .navlink .nav-symbol { flex-basis:18px; width:18px; }
  .studio-sidebar nav .navlink .ft-icon { width:15px; height:15px; }
  .word-library-page .toc { grid-template-columns:minmax(0,1fr); }
}
@media (orientation:landscape) and (max-height:510px) and (max-width:900px) {
  body:not(.teacher-manager-open) .topbar.studio-sidebar { position:relative; }
}
@media (pointer:coarse) {
  :where(main.page,.role-entrance,.school-dialog,.admin-shell) :is(.btn,select) { min-height:44px; }
  .role-film .auth-background-start { min-height:44px; }
}
@media (prefers-reduced-motion:reduce) {
  .reference-cards,.word-library-page .toc-card { transition:none; }
}
html.reduce-motion :is(.reference-cards,.word-library-page .toc-card) { transition:none; }
@media print { .topbar.studio-sidebar { display:none!important; } }
/* Native text controls retain focus and the phone keyboard while the cells repaint. */
.word-practice-page input.word-blank-input {
  position:absolute; inset:0; z-index:1; width:100%; height:100%; min-height:0; min-width:0;
  margin:0; padding:0; border:0; border-radius:4px; background:transparent;
  color:transparent; caret-color:transparent; outline:0; box-shadow:none; font-size:16px;
  cursor:text; -webkit-text-fill-color:transparent;
}
.word-practice-page input.word-blank-input:focus { outline:0; box-shadow:none; }
.word-practice-page input.word-blank-input::selection { background:transparent; }
.word-practice-page .blank:focus-within { outline:2px solid var(--accent); outline-offset:2px; }
.word-practice-page .blank.wrong .ans { white-space:normal; }
.word-practice-page .blank.wrong:has(.ans) { flex-wrap:wrap; max-width:100%; }
body:is(.in-exam,.focus-session,.reading-focus) #app>.ft-msg { display:none; }
.studio-home .cb-dashboard .cb-metrics { display:grid; }
.studio-home .cb-dashboard .cb-metric {
  display:flex; flex-direction:column; align-items:flex-start; justify-content:space-between;
  text-align:start; background:var(--surface-alt); border:1px solid var(--border);
}
.studio-home .cb-dashboard .cb-metric:first-child { background:var(--accent-strong); border-color:var(--accent-strong); }
.studio-home .cb-dashboard .cb-metric:not(:first-child) b { color:var(--text); }
.studio-home .cb-dashboard .cb-metric:not(:first-child) span { color:var(--muted); }
.studio-home .reference-carousel { min-height:0; }
.studio-home .reference-card-link { min-height:44px; }
.word-library-page .word-level-tabs { margin:0; }
.word-practice-page .result { padding-bottom:16px; }
.word-practice-page .result-list .row .ys,.word-practice-page .result-list .row .right { white-space:normal; }
@media (max-width:620px) {
  .studio-home .reference-card { min-height:235px; }
  .studio-home .cb-dashboard .cb-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); margin:0 0 13px; }
  .studio-home .cb-dashboard .cb-metric { min-height:65px; gap:4px; }
  .word-practice-page .practice-head { margin-bottom:10px; }
  #resultWrap .result-list .row { padding-block:12px; }
}
.history-table-wrap { min-width:0; width:100%; overflow-x:auto; overscroll-behavior-inline:contain; }
@media (max-width:620px) {
  .history-table-wrap .hist-table { min-width:510px; }
  .history-table-wrap .hist-table :is(td,th) { padding-inline:11px; }
  .history-table-wrap .hist-table .btn { min-height:40px; }
}
.studio-sidebar .studio-brand>span:nth-child(2) { white-space:nowrap; }
.studio-sidebar .studio-brand small { letter-spacing:.12em; }
.write-jump { display:none; }
@media (max-width:900px) {
  .write-shell .write-q { height:auto; max-height:none; overflow:visible; }
  .write-shell .write-jump { display:flex; width:fit-content; min-height:44px; margin:0 0 13px auto; }
  .write-shell .write-editor { scroll-margin-top:165px; }
  .write-shell .write-ta { min-height:280px; font-size:17px; }
  body:is(.focus-session,.in-exam) .write-shell .write-editor { scroll-margin-top:16px; }
}
.reading-catalog-controls {
  display:grid; grid-template-columns:minmax(0,1fr) minmax(130px,.6fr);
  max-width:640px; margin:13px 0 8px; gap:10px;
}
.reading-catalog-controls label { display:grid; gap:5px; min-width:0; color:var(--muted); font-size:13px; font-weight:700; }
.reading-catalog-controls :is(input,select) {
  width:100%; min-width:0; min-height:44px; padding:7px 11px;
  border:1px solid var(--field-border); border-radius:9px;
  background:var(--surface); color:var(--text); font-weight:500; font-size:16px;
}
.reading-catalog-meta { display:flex; flex-wrap:wrap; justify-content:space-between; gap:4px 13px; margin:9px 0; color:var(--muted); font-size:13px; }
.reading-library-page .reading-card { transition:background .16s ease,border-color .16s ease; }
.reading-library-page .reading-card-meta { letter-spacing:.02em; }
.reading-library-page .reading-card small { color:var(--accent-strong); }
.reading-library-page .reading-card strong { line-height:1.3; }
@media (pointer:coarse) {
  .studio-sidebar nav .navlink:not(.active):not(.is-current):hover { background:transparent; color:var(--muted); }
}
@media (max-width:620px) {
  .admin-header .admin-session { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; }
  .admin-header .admin-session>span { grid-column:1/-1; grid-row:1; }
  .admin-header .admin-session .btn { min-height:44px; padding-inline:4px; }
  .admin-users table,.admin-users tbody { display:block; width:100%; min-width:0; }
  .admin-users thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  .admin-users .admin-account-row {
    display:grid; grid-template-columns:repeat(2,minmax(0,1fr));
    position:relative; gap:3px; padding:10px 13px; border-bottom:1px solid var(--border);
  }
  .admin-account-row td { padding:5px 0; border:0; min-width:0; white-space:normal; overflow-wrap:anywhere; }
  .admin-account-row td[data-column]::before {
    content:attr(data-column); display:block; margin-bottom:2px; color:var(--muted); font:650 12px/1.3 var(--font);
  }
  .admin-account-row td:nth-child(2) { grid-row:2; }
  .admin-account-row td:first-child,.admin-account-row td:last-child { grid-column:1/-1; }
  .admin-account-row td .btn { min-height:44px; }
  .admin-users .admin-empty { padding:13px 0; }
}
@media (max-width:900px) {
  .reading-exam-layout:not(.ft-exam-content)>.reading-question { scroll-margin-top:164px; }
  body.reading-focus .reading-exam-layout:not(.ft-exam-content)>.reading-question { scroll-margin-top:12px; }
}
@media (max-width:620px) {
  .admin-shell .admin-header>.admin-session { display:grid; gap:7px; }
  .ord-nav>button,.ord-hud .btn,.ord-stage .ord-tile { min-height:44px; }
  .ord-nav { gap:5px; }
}
.admin-pages { display:flex; flex-wrap:wrap; align-items:center; gap:7px; padding:10px 14px; color:var(--muted); border-top:1px solid var(--border); }
.admin-pages[hidden] { display:none; }
.admin-pages>span { flex:1 1 auto; font-size:13px; }
.admin-pages>.btn { min-height:44px; }

/* Resource controls share one layout in the teacher and administrator workspaces. */
.resource-editor .transfer-intro { padding:18px 20px; gap:14px; }
.resource-editor .transfer-intro h2 { font-size:clamp(21px,2.4vw,29px); margin:5px 0; letter-spacing:-.02em; }
.resource-editor .transfer-intro p { line-height:1.5; margin:0; }
.resource-editor .transfer-total { min-width:0; padding:10px 11px; }
.resource-editor .resource-scope,.resource-editor .transfer-filters { gap:10px; padding:13px; }
.resource-editor :is(.resource-scope label,.transfer-filters label,.resource-options label,.resource-range label) {
  min-width:0; display:grid; gap:5px; align-content:end; font-size:13px;
}
.resource-editor :is(select,input:not([type=checkbox])) {
  box-sizing:border-box; width:100%; min-width:0; min-height:44px; border-radius:8px; font-size:15px; color:var(--resource-ink);
}
.resource-editor :is(.resource-scope,.transfer-filters,.resource-save,.resource-range) .btn { min-height:44px; padding-inline:10px; white-space:normal; }
.resource-editor .resource-save {
  position:static; flex-direction:row; gap:10px 14px; flex-wrap:wrap;
  align-items:center; padding:10px 13px; margin:0; background:var(--resource-soft);
  box-shadow:none; z-index:auto;
}
.resource-editor .resource-save>div:first-child { min-width:0; }
.resource-editor .resource-save>div:nth-child(2) { display:flex; gap:6px; justify-content:flex-start; flex-wrap:wrap; }
.resource-editor .resource-save span { display:block; font-size:13px; }
.resource-editor .transfer-board { min-width:0; grid-template-columns:repeat(2,minmax(0,1fr)); gap:13px; }
.resource-editor .transfer-lane { min-width:0; overflow:hidden; }
.resource-editor .transfer-lane-head { align-items:stretch; padding:13px; gap:8px; flex-wrap:wrap; }
.resource-editor .transfer-lane-head h3 { margin:0 0 5px; font-size:19px; line-height:1.35; }
.resource-editor .transfer-lane-head .btn { min-height:38px; align-self:start; }
.resource-editor .transfer-lane-tools { gap:6px 8px; padding:8px; flex-wrap:wrap; }
.resource-editor .transfer-lane-tools .btn { margin-left:auto; min-height:36px; }
.resource-editor .transfer-tree { height:clamp(270px,48dvh,474px); padding:6px; }
.resource-editor :is(.transfer-group-head,.transfer-leaf) { gap:5px; padding:6px; min-width:0; }
.resource-editor :is(.transfer-group-head,.transfer-leaf) .transfer-move { min-height:37px; padding:4px 7px; white-space:normal; }
.resource-editor .transfer-group-children { padding-inline-start:clamp(5px,1vw,13px); }
.resource-editor .transfer-leaf-copy { min-width:0; overflow-wrap:anywhere; }
.resource-editor .transfer-leaf-copy strong,.resource-editor .transfer-leaf-copy span { overflow-wrap:anywhere; }
.resource-editor .transfer-expand { flex:0 0 28px; width:28px; min-height:34px; }
.resource-editor .transfer-drop-hint,.resource-editor .transfer-help { line-height:1.5; }
.resource-editor .transfer-preview-table { max-width:100%; overflow:auto; }
@media (max-width:720px) {
  .resource-editor .transfer-board { grid-template-columns:minmax(0,1fr); }
  .resource-editor .transfer-tree { height:auto; min-height:155px; max-height:min(390px,50dvh); overscroll-behavior:contain; }
  .resource-editor .transfer-intro,.resource-editor .resource-scope,.resource-editor .transfer-filters {
    min-width:0; margin-inline:0; padding:12px;
  }
  .resource-editor .resource-scope,.resource-editor .transfer-filters { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .resource-editor .transfer-search { grid-column:auto; }
  .resource-editor .resource-range { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .resource-editor .resource-range :is(input,label) { grid-column:1/-1; }
  .resource-editor .transfer-drop-hint,.resource-editor .transfer-grip { display:none; }
  .resource-editor .transfer-lane-head { flex-direction:row; align-items:start; }
  .resource-editor .transfer-lane-head>div { flex:1 1 155px; }
  .resource-editor .transfer-lane-head>.btn { align-self:flex-start; }
  .resource-editor :is(select,input:not([type=checkbox])) { font-size:16px; }
}
@media (pointer:coarse) {
  .resource-editor :is(.transfer-lane-head,.transfer-lane-tools,.transfer-tree) .btn,
  .resource-editor :is(.transfer-expand,.transfer-move) { min-height:44px; }
  .resource-editor .transfer-grip,.resource-editor .transfer-drop-hint { display:none; }
}
.resource-editor .transfer-intro { margin:0 0 10px; padding:8px 2px; }
.resource-editor .resource-notice { padding:5px 2px; min-height:0; }
.resource-editor .transfer-filters { margin:0 0 8px; padding-block:8px; }
.resource-editor .resource-save { margin-block-end:9px; }
.resource-editor .resource-save>.resource-jump { display:none; }
@media (max-width:720px) {
  .resource-editor .transfer-intro { gap:8px; }
  .resource-editor .transfer-intro p { font-size:13px; }
  .resource-editor .transfer-total { display:flex; align-items:baseline; gap:4px; padding:3px; white-space:nowrap; }
  .resource-editor .transfer-total strong { font-size:21px; }
  .resource-editor .resource-save .btn { font-size:13px; }
  .resource-editor .resource-save>.resource-jump { display:flex; flex-wrap:wrap; gap:6px; }
  .resource-editor .transfer-tree:has(>.transfer-empty) { min-height:108px; }
  .resource-editor .transfer-empty { padding:12px; }
  .resource-editor .transfer-empty svg { display:none; }
}

/* Use an explicit box for native selects, including WebKit controls. */
:is(.word-toolbar,.review-controls,.reading-catalog-controls,.reading-setup,.resource-editor,.admin-toolbar,.admin-dialog,.school-dialog,.shell,.dialog) select {
  -webkit-appearance:none; appearance:none;
  height:44px; min-height:44px; box-sizing:border-box;
  padding-inline:10px 29px; background-color:var(--surface,var(--card,#fff));
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23445452' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 10px center; background-size:12px 8px;
  line-height:normal;
}
@media (max-width:900px) {
  :is(.word-toolbar,.review-controls,.reading-catalog-controls,.reading-setup,.resource-editor,.admin-toolbar,.admin-dialog,.school-dialog,.shell,.dialog) select { font-size:16px; }
}
:is(.word-toolbar,.review-controls,.resource-editor,.admin-toolbar,.shell) select:disabled { opacity:.66; }
