:root {
  --ink: #18332d;
  --muted: #6b7975;
  --green: #245f4e;
  --green-2: #3f806b;
  --green-soft: #e4eee9;
  --cream: #f3f1e9;
  --paper: #fffdf8;
  --yellow: #f5c95b;
  --coral: #e67e62;
  --line: #dfe4df;
  --shadow: 0 18px 55px rgba(27, 59, 50, 0.1);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--cream); }
body { margin: 0; min-height: 100vh; color: var(--ink); font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; background: var(--cream); }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
a { color: var(--green); }
.hidden { display: none !important; }
.student-mode .guardian-only { display: none !important; }
.student-mode .sidebar nav { grid-template-columns: 1fr; }
.ambient { position: fixed; border-radius: 50%; filter: blur(1px); pointer-events: none; z-index: 0; }
.ambient-one { width: 440px; height: 440px; left: -190px; top: -190px; background: rgba(245, 201, 91, .25); }
.ambient-two { width: 520px; height: 520px; right: -260px; bottom: -250px; background: rgba(63, 128, 107, .14); }

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 45px; height: 45px; border-radius: 14px; background: var(--green); color: #fff; font-weight: 800; box-shadow: 0 9px 18px rgba(36, 95, 78, .22); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 20px; letter-spacing: .08em; }
.brand small { margin-top: 1px; color: var(--muted); font-size: 11px; letter-spacing: .12em; }
.brand.compact .brand-mark { width: 39px; height: 39px; border-radius: 12px; }
.brand.compact strong { font-size: 17px; }

.auth-shell { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(520px, 1.08fr) minmax(460px, .92fr); position: relative; z-index: 1; }
.brand-story { min-height: 100vh; min-height: 100dvh; padding: 54px clamp(40px, 8vw, 120px); display: flex; flex-direction: column; justify-content: space-between; background: var(--green); color: #fff; clip-path: polygon(0 0, 100% 0, 94% 100%, 0 100%); }
.brand-story .brand { color: #fff; }
.brand-story .brand-mark { color: var(--green); background: var(--yellow); }
.brand-story .brand small { color: rgba(255,255,255,.65); }
.auth-mobile-label { display: none; }
.story-copy { max-width: 680px; padding: 40px 0; }
.eyebrow { display: inline-block; color: var(--green-2); font-size: 12px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.brand-story .eyebrow { color: var(--yellow); }
.story-copy h1 { margin: 22px 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(44px, 5.6vw, 78px); line-height: 1.13; font-weight: 600; letter-spacing: -.035em; }
.story-copy p { max-width: 590px; margin: 0; font-size: 18px; line-height: 1.9; color: rgba(255,255,255,.75); }
.trust-row { display: flex; flex-wrap: wrap; gap: 12px; }
.trust-row span { padding: 9px 14px; border: 1px solid rgba(255,255,255,.18); border-radius: 99px; color: rgba(255,255,255,.78); font-size: 12px; }
.trust-row span::before { content: "✓"; margin-right: 7px; color: var(--yellow); }
.auth-panel { display: grid; place-items: center; padding: 54px clamp(28px, 5vw, 76px); }
.auth-card { width: min(468px, 100%); padding: 42px; border: 1px solid rgba(255,255,255,.92); border-radius: 30px; background: rgba(255,253,248,.92); backdrop-filter: blur(16px); box-shadow: 0 24px 72px rgba(27,59,50,.13); }
.auth-heading { margin-bottom: 26px; }
.auth-heading > span { color: var(--green-2); font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.auth-heading h1 { margin: 10px 0 8px; font: 600 34px/1.2 Georgia, "Songti SC", serif; letter-spacing: -.025em; }
.auth-heading p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.tab-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; margin-bottom: 26px; border-radius: 14px; background: #ebece6; }
.tab { min-height: 44px; padding: 10px 8px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; }
.tab.active { background: var(--paper); color: var(--ink); font-weight: 700; box-shadow: 0 3px 10px rgba(0,0,0,.06); }
label { display: block; margin-bottom: 19px; color: #43534f; font-size: 13px; font-weight: 700; }
input, textarea, select { width: 100%; margin-top: 8px; padding: 14px 15px; color: var(--ink); border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.8); outline: none; transition: border .2s, box-shadow .2s; }
input:focus, textarea:focus, select:focus { border-color: var(--green-2); box-shadow: 0 0 0 4px rgba(63,128,107,.1); }
textarea { resize: vertical; line-height: 1.7; }
.form-field { margin-bottom: 19px; }
.form-field > label { margin-bottom: 8px; }
.form-field input { min-height: 52px; margin-top: 0; background: #fff; }
.password-field { position: relative; }
.password-field input { padding-right: 66px; }
.password-field button { position: absolute; top: 50%; right: 8px; min-width: 48px; min-height: 38px; padding: 0 8px; border: 0; border-radius: 9px; transform: translateY(-50%); background: transparent; color: var(--green); cursor: pointer; font-size: 12px; font-weight: 750; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; font-weight: 500; line-height: 1.55; }
.check input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--green); }
.consent-fields { padding: 5px 0 12px; }
.primary, .secondary, .danger, .icon-button, .text-button { border: 0; border-radius: 13px; cursor: pointer; font-weight: 750; transition: transform .15s, opacity .15s, box-shadow .15s; }
.primary { padding: 13px 18px; color: #fff; background: var(--green); box-shadow: 0 8px 18px rgba(36,95,78,.2); }
.primary:hover, .secondary:hover { transform: translateY(-1px); }
.primary:disabled, .secondary:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.wide { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; }
.auth-submit { min-height: 52px; justify-content: space-between; padding-inline: 22px; font-size: 15px; }
.auth-submit b { font-size: 19px; font-weight: 500; }
.form-note { margin: 18px 0 0; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.6; }
.auth-security { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 20px 0 0; padding-top: 18px; border-top: 1px solid #ebeeea; color: #83908c; text-align: center; font-size: 10px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); grid-template-rows: 72px minmax(0, 1fr); position: relative; z-index: 1; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(255,253,248,.88); backdrop-filter: blur(14px); z-index: 10; }
.top-actions { display: flex; align-items: center; gap: 18px; }
.service-state { color: var(--muted); font-size: 12px; }
.service-state i, .coach-head i { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #62a77f; box-shadow: 0 0 0 4px rgba(98,167,127,.12); }
.icon-button { padding: 9px 13px; background: var(--green-soft); color: var(--green); font-size: 12px; }
.sidebar { display: flex; flex-direction: column; justify-content: space-between; padding: 28px 18px 22px; border-right: 1px solid var(--line); background: rgba(255,253,248,.64); }
.sidebar nav { display: grid; gap: 8px; }
.nav-item { display: flex; gap: 13px; align-items: center; width: 100%; padding: 13px 15px; border: 0; border-radius: 13px; background: transparent; color: var(--muted); text-align: left; cursor: pointer; font-size: 14px; }
.nav-item span { width: 21px; color: #91a09b; text-align: center; }
.nav-item.active { background: var(--green); color: #fff; box-shadow: 0 10px 24px rgba(36,95,78,.16); }
.nav-item.active span { color: var(--yellow); }
.sidebar-foot { padding: 16px 10px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.6; word-break: break-all; }
.sidebar-foot p { margin: 0 0 12px; }
.main-content { min-width: 0; padding: clamp(24px, 3vw, 44px); overflow: auto; }
.page { display: none; max-width: 1400px; margin: 0 auto; }
.page.active { display: block; animation: appear .25s ease-out; }
@keyframes appear { from { opacity: 0; transform: translateY(5px); } }
.page-heading { min-height: 72px; margin-bottom: 28px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.page-heading h2 { margin: 8px 0 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(27px, 3vw, 39px); font-weight: 600; letter-spacing: -.02em; }
.student-switch { min-width: 210px; }
.student-switch label { margin: 0; font-size: 11px; color: var(--muted); }
.student-switch select { margin-top: 6px; padding: 10px 34px 10px 12px; background: var(--paper); }
.workspace-grid { display: grid; grid-template-columns: minmax(310px, .8fr) minmax(430px, 1.2fr); gap: 22px; align-items: stretch; }
.panel { border: 1px solid rgba(213,220,215,.9); border-radius: var(--radius); background: rgba(255,253,248,.88); box-shadow: 0 14px 40px rgba(39,69,60,.06); }
.question-panel { padding: 25px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.panel-title > div { display: flex; align-items: center; gap: 10px; }
.panel-title h3 { margin: 0; font-size: 17px; }
.step { color: var(--coral); font-family: Georgia, serif; font-size: 13px; font-weight: 800; }
.soft-badge { padding: 7px 10px; border-radius: 99px; background: var(--green-soft); color: var(--green); font-size: 10px; font-weight: 750; }
.input-mode { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 15px; border-radius: 11px; background: #edeee9; }
.mode { min-height: 36px; padding: 7px 12px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; font-size: 11px; }
.mode.active { color: var(--green); background: #fff; font-weight: 750; }
.photo-mode span { margin-right: 5px; color: var(--green-2); }
#question-text { min-height: 150px; margin: 0; background: #fff; }
.char-count { margin: -27px 11px 17px 0; color: #a1aaa7; text-align: right; font-size: 10px; pointer-events: none; }
.upload-zone { min-height: 180px; display: grid; place-items: center; align-content: center; gap: 8px; position: relative; margin-bottom: 17px; border: 1px dashed #aebeb7; border-radius: 14px; background: var(--green-soft); color: var(--muted); text-align: center; }
.upload-zone input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.upload-zone strong { color: var(--ink); font-size: 13px; }
.upload-zone span { font-size: 10px; }
.upload-icon { color: var(--green); font-size: 34px; }
.form-row { display: grid; grid-template-columns: 1.6fr .9fr; gap: 12px; }
.form-row label { margin-bottom: 13px; font-size: 11px; }
.form-row select { padding: 11px 12px; }
.guardian-option { margin: 2px 0 18px; color: var(--muted); font-size: 11px; }
.guardian-option summary { cursor: pointer; }
.guardian-option input { margin-top: 10px; padding: 11px 12px; }
.coach-panel { min-height: 590px; display: flex; flex-direction: column; overflow: hidden; }
.coach-head { display: flex; align-items: center; gap: 11px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.coach-avatar { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 13px; background: var(--yellow); color: var(--green); font-weight: 900; }
.coach-head h3 { margin: 0 0 3px; font-size: 14px; }
.coach-head span { color: var(--muted); font-size: 10px; }
.coach-head .text-button { margin-left: auto; }
.text-button { padding: 8px; color: var(--green); background: transparent; font-size: 11px; }
.chat { flex: 1; min-height: 330px; max-height: 520px; padding: 24px; overflow-y: auto; background: linear-gradient(180deg, rgba(228,238,233,.32), rgba(255,253,248,.1)); }
.chat > h3, .chat > p { text-align: center; }
.chat > h3 { margin: 12px 0 8px; font-family: Georgia, "Songti SC", serif; font-size: 21px; }
.chat > p { max-width: 390px; margin: auto; color: var(--muted); font-size: 12px; line-height: 1.7; }
.welcome-orbit { display: grid; place-items: center; width: 65px; height: 65px; margin: 55px auto 0; border: 1px solid rgba(36,95,78,.18); border-radius: 50%; }
.welcome-orbit span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--green); color: var(--yellow); }
.message { max-width: 82%; margin-bottom: 16px; animation: appear .2s ease-out; }
.message .bubble { padding: 13px 15px; border-radius: 16px; font-size: 13px; line-height: 1.75; white-space: pre-wrap; }
.message small { display: block; margin: 5px 7px 0; color: #99a29f; font-size: 9px; }
.message.assistant .bubble { border: 1px solid var(--line); border-top-left-radius: 4px; background: #fff; }
.message.user { margin-left: auto; }
.message.user .bubble { border-top-right-radius: 4px; background: var(--green); color: #fff; }
.message.user small { text-align: right; }
.thinking { display: flex; gap: 4px; align-items: center; color: var(--muted); font-size: 11px; }
.thinking i { width: 5px; height: 5px; border-radius: 50%; background: var(--green-2); animation: pulse 1s infinite alternate; }
.thinking i:nth-child(2) { animation-delay: .2s; }.thinking i:nth-child(3) { animation-delay: .4s; }
@keyframes pulse { to { transform: translateY(-4px); opacity: .35; } }
.composer { padding: 15px; border-top: 1px solid var(--line); background: var(--paper); }
.composer textarea { min-height: 48px; max-height: 100px; margin: 0 0 10px; padding: 12px; resize: none; }
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.secondary { padding: 10px 12px; background: var(--green-soft); color: var(--green); font-size: 11px; }
.answer-group { display: flex; gap: 7px; min-width: 50%; }
.answer-group input { margin: 0; padding: 9px 11px; font-size: 12px; }
.answer-group .primary { padding: 9px 14px; font-size: 11px; box-shadow: none; }
.empty-card { padding: 60px 25px; border: 1px dashed #aebeb7; border-radius: var(--radius); background: rgba(255,253,248,.68); text-align: center; }
.empty-card h3 { margin: 15px 0 7px; }.empty-card p { margin: 0 0 20px; color: var(--muted); font-size: 13px; }
.empty-icon { display: grid; place-items: center; width: 58px; height: 58px; margin: auto; border-radius: 18px; background: var(--green-soft); color: var(--green); font-size: 28px; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 22px; }
.stat { padding: 23px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); }
.stat span, .stat small { display: block; color: var(--muted); font-size: 11px; }.stat strong { display: block; margin: 11px 0 6px; font-family: Georgia, serif; font-size: 38px; font-weight: 500; }
.progress-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 22px; }.progress-grid > .panel { padding: 24px; }
.mastery-item { display: grid; grid-template-columns: 110px 1fr 42px; align-items: center; gap: 14px; padding: 13px 0; border-top: 1px solid #edf0ed; font-size: 12px; }
.mastery-bar { width: 100%; height: 8px; border: 0; border-radius: 99px; background: #e7ebe8; overflow: hidden; appearance: none; }.mastery-bar::-webkit-progress-bar { background: #e7ebe8; border-radius: 99px; }.mastery-bar::-webkit-progress-value { background: var(--green-2); border-radius: 99px; }.mastery-bar::-moz-progress-bar { background: var(--green-2); border-radius: 99px; }
.mastery-item b { color: var(--green); text-align: right; }.review-item { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid #edf0ed; }.review-date { min-width: 48px; padding: 7px; border-radius: 10px; background: var(--green-soft); color: var(--green); text-align: center; font-size: 10px; font-weight: 800; }.review-item p { margin: 0; font-size: 12px; }.review-item small { color: var(--muted); }
.student-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }.student-card { padding: 24px; }.student-card .avatar { display: grid; place-items: center; width: 49px; height: 49px; margin-bottom: 17px; border-radius: 16px; background: var(--yellow); color: var(--green); font-weight: 900; }.student-card h3 { margin: 0 0 7px; }.student-card p { margin: 0; color: var(--muted); font-size: 12px; }.student-card-actions { display: flex; align-items: center; gap: 12px; margin-top: 20px; }.student-delete { border: 0; background: transparent; color: #a54430; cursor: pointer; font-size: 11px; font-weight: 750; }
.error-list { display: grid; gap: 10px; }.error-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 13px; background: var(--green-soft); color: var(--green); font-size: 12px; }.error-item b { color: var(--coral); }
.legal-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }.legal-grid .panel { padding: 26px; }.legal-icon { color: var(--coral); font-family: Georgia, serif; font-weight: 800; }.legal-grid h3 { margin: 18px 0 9px; }.legal-grid p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }.danger-zone { border-color: rgba(230,126,98,.35); }.danger { margin-top: 20px; padding: 10px 13px; background: #f8e4df; color: #a54430; font-size: 11px; }
.security-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

dialog { width: min(500px, calc(100vw - 28px)); padding: 0; border: 0; border-radius: 25px; color: var(--ink); background: var(--paper); box-shadow: 0 30px 90px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(18,43,36,.48); backdrop-filter: blur(5px); }
dialog form { padding: 28px; }.dialog-head { display: flex; justify-content: space-between; margin-bottom: 23px; }.dialog-head h2 { margin: 7px 0 0; font-family: Georgia, "Songti SC", serif; }.close { width: 34px; height: 34px; border: 0; border-radius: 50%; background: #eceeea; cursor: pointer; font-size: 21px; }.consent-box { padding: 13px; border-radius: 12px; background: var(--green-soft); font-size: 11px; }
.policy-copy { margin: -4px 0 18px; color: var(--muted); line-height: 1.75; }
.policy-alternatives { display: flex; justify-content: space-between; gap: 15px; margin-top: 17px; }
.danger-text { color: #9a4434; }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: 380px; padding: 13px 17px; border-radius: 13px; color: #fff; background: var(--ink); box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s; z-index: 100; font-size: 12px; }.toast.show { opacity: 1; transform: none; }.toast.error { background: #9a4434; }
.document-body { padding: 42px 20px; background: var(--cream); }.document { width: min(780px, 100%); margin: auto; padding: clamp(28px, 6vw, 70px); border: 1px solid var(--line); border-radius: 28px; background: var(--paper); box-shadow: var(--shadow); }.document > .eyebrow { margin-top: 55px; }.document h1 { margin: 10px 0 30px; font: 600 clamp(36px, 6vw, 58px)/1.15 Georgia, "Songti SC", serif; }.document h2 { margin: 32px 0 8px; font-size: 18px; }.document p { color: #52635e; font-size: 14px; line-height: 1.95; }.document-foot { margin-top: 45px; padding-top: 20px; border-top: 1px solid var(--line); }

@media (max-width: 980px) {
  .auth-shell { grid-template-columns: 1fr; align-content: start; }
  .brand-story { min-height: 96px; padding: 24px 28px; flex-direction: row; align-items: center; clip-path: none; }
  .story-copy, .trust-row { display: none; }
  .auth-mobile-label { display: inline-flex; padding: 7px 12px; border: 1px solid rgba(255,255,255,.24); border-radius: 99px; color: rgba(255,255,255,.8); font-size: 11px; font-weight: 750; }
  .auth-panel { padding: 36px 20px 60px; }
  .app-shell { grid-template-columns: 80px minmax(0,1fr); }.sidebar { padding: 24px 10px; }.nav-item { justify-content: center; padding: 13px 8px; font-size: 0; }.nav-item span { font-size: 18px; }.sidebar-foot { display: none; }.workspace-grid, .progress-grid { grid-template-columns: 1fr; }.coach-panel { min-height: 540px; }
}
@media (max-width: 640px) {
  .auth-shell { background: var(--paper); }
  .brand-story { min-height: calc(82px + env(safe-area-inset-top)); padding: calc(18px + env(safe-area-inset-top)) 20px 16px; }
  .brand-story .brand-mark { width: 42px; height: 42px; }
  .brand-story .brand strong { font-size: 18px; }
  .auth-panel { place-items: start center; padding: 26px 20px calc(38px + env(safe-area-inset-bottom)); background: var(--paper); }
  .auth-card { width: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; backdrop-filter: none; box-shadow: none; }
  .auth-heading { margin-bottom: 24px; }
  .auth-heading h1 { margin-top: 8px; font-size: 31px; }
  .auth-heading p { font-size: 13px; }
  .tab-list { margin-bottom: 24px; }
  .form-field input { min-height: 54px; font-size: 16px; }
  .auth-submit { min-height: 54px; }
  .auth-security { margin-top: 22px; }
  .app-shell { display: block; padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
  .topbar { height: calc(64px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 15px 0; position: sticky; top: 0; }
  .topbar .brand small { display: none; }
  .service-state { display: none; }
  .sidebar { position: fixed; z-index: 20; bottom: 0; left: 0; right: 0; height: calc(66px + env(safe-area-inset-bottom)); display: block; padding: 7px 8px env(safe-area-inset-bottom); border: 0; border-top: 1px solid var(--line); background: rgba(255,253,248,.96); backdrop-filter: blur(15px); }
  .sidebar nav { grid-template-columns: repeat(4, 1fr); }
  .nav-item { display: grid; gap: 2px; min-height: 50px; padding: 5px 2px; font-size: 10px; text-align: center; }
  .nav-item span { width: auto; font-size: 15px; }
  .main-content { padding: 20px 14px; overflow: visible; }
  .page-heading { min-height: 0; margin-bottom: 20px; align-items: flex-start; flex-direction: column; gap: 14px; }
  .page-heading h2 { font-size: 28px; line-height: 1.25; }
  .student-switch { width: 100%; }
  .student-switch select, .form-row select { min-height: 48px; font-size: 16px; }
  .workspace-grid { display: block; }
  .question-panel { padding: 18px; margin-bottom: 16px; border-radius: 20px; }
  .input-mode { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .mode { min-height: 44px; font-size: 13px; }
  #question-text { min-height: 170px; font-size: 16px; }
  .upload-zone { min-height: 220px; padding: 20px; }
  .upload-zone strong { font-size: 15px; }
  .upload-zone span { max-width: 260px; font-size: 11px; line-height: 1.6; }
  .coach-panel { min-height: 520px; border-radius: 20px; }
  .chat { min-height: 300px; padding: 18px; }
  .message { max-width: 90%; }
  .message .bubble { font-size: 14px; }
  .composer textarea, .answer-group input { font-size: 16px; }
  .composer-actions { align-items: stretch; flex-direction: column; }
  .answer-group { min-width: 100%; }
  .answer-group .primary, .secondary { min-height: 44px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat:last-child { grid-column: 1/-1; }
  .legal-grid { grid-template-columns: 1fr; }
  .student-card-actions { align-items: stretch; flex-direction: column; }
  .student-card-actions button { min-height: 44px; }
  dialog { width: 100%; max-width: none; margin: auto 0 0; border-radius: 24px 24px 0 0; }
  dialog form { padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); }
  dialog input, dialog select { min-height: 50px; font-size: 16px; }
  .toast { right: 14px; bottom: calc(78px + env(safe-area-inset-bottom)); left: 14px; max-width: none; text-align: center; }
  .top-actions { gap: 8px; }
}
