:root {
  color-scheme: light;
  --paper: #faf9f5;
  --sidebar: #f3f2eb;
  --canvas: #fffefa;
  --text: #222c23;
  --muted: #626a60;
  --line: #e4e2d8;
  --green: #2c4935;
  --green-dark: #203729;
  --moss: #e6eddf;
  --clay: #f5e8de;
  --lilac: #eeebf3;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", system-ui, sans-serif;
  --rail: 246px;
  --reading: 872px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body, #app { min-height: 100%; margin: 0; }
body { background: var(--paper); color: var(--text); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { color: inherit; font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
a { color: var(--green); }
svg { vertical-align: middle; flex: none; }
img { display: block; max-width: 100%; }
p, h1, h2, h3 { margin: 0; }
p { color: var(--muted); }
h1, h2, h3 { color: var(--text); }
h1, .section-heading h2, .subhead h2, .settings-panel h2, .empty h3, .dialog h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -.035em; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #42624a; outline-offset: 4px; }
.sr-only, .skip-link:not(:focus) { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; z-index: 10; inset: 8px auto auto 8px; padding: 9px 15px; background: var(--canvas); }

.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); height: 100vh; height: 100dvh; }
.sidebar { min-height: 0; padding: 24px 17px 18px; display: flex; flex-direction: column; background: var(--sidebar); border-right: 1px solid var(--line); }
.wordmark { display: flex; gap: 11px; align-items: center; border: 0; background: transparent; text-align: left; padding: 0 5px; align-self: flex-start; }
.wordmark > span { font: 1.27rem/1.04 var(--serif); letter-spacing: -.055em; white-space: nowrap; }
.wordmark small { display: block; margin-top: 5px; color: var(--muted); font: 11px/1.2 var(--sans); letter-spacing: .01em; }
.mark { border-radius: 10px; flex: none; }
.new-chat { display: flex; align-items: center; gap: 9px; margin: 31px 0 23px; min-height: 44px; padding: 0 13px; border: 1px solid #ced8c9; border-radius: 10px; color: var(--green); background: #e9eee4; font-size: 13px; font-weight: 650; text-align: left; }
.new-chat:hover { background: #dce8d7; }
.sidebar nav { display: grid; gap: 4px; }
.nav-link, .thread { display: flex; align-items: center; gap: 10px; min-height: 43px; width: 100%; border: 0; border-radius: 8px; padding: 0 12px; background: transparent; color: #525d50; text-align: left; font-size: 13px; }
.nav-link:hover, .thread:hover { background: #e9ebe2; }
.nav-link.selected, .thread.selected { background: #e5e9df; color: var(--green-dark); font-weight: 680; }
.new-dot { margin-left: auto; height: 7px; width: 7px; border-radius: 50%; background: #719072; }
.thread-list { margin: 22px 4px 0; padding-top: 21px; border-top: 1px solid #dfdfd4; flex: 1; overflow: auto; min-height: 0; }
.thread-list h2 { margin: 0 8px 10px; color: #686f64; font-size: 10px; font-weight: 730; letter-spacing: .13em; }
.thread-list p { margin: 0 8px; font-size: 12px; line-height: 1.55; }
.thread { font-size: 12px; min-height: 36px; padding: 0 8px; }
.thread > span { text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.side-footer { padding-top: 9px; }
.side-footer .nav-link { margin-bottom: 10px; }
.signature { display: flex; align-items: center; gap: 6px; color: #78584b; font: italic 14px/1.4 var(--serif); }
.side-footer .signature { border-top: 1px solid #dfdfd4; padding: 15px 11px 1px; }
.signature svg { color: #9b6f60; }
.scrim, .mobile-menu { display: none !important; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: flex; align-items: center; gap: 12px; flex: 0 0 66px; padding: 0 32px; border-bottom: 1px solid var(--line); background: var(--paper); }
.top-title { font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 13px; margin-left: auto; flex: none; }
.private { display: inline-flex; gap: 5px; align-items: center; color: #52634e; padding: 5px 9px; border: 1px solid #e1e7db; border-radius: 30px; background: #eef0e9; font-size: 11px; font-weight: 600; }
.avatar { border: 1px solid #e9dcd0; background: #f1e8df; color: #6d5041; width: 33px; height: 33px; border-radius: 50%; font: 600 14px var(--serif); }
.avatar:hover { background: #ead8c9; }
.scroll-area { flex: 1; overflow: auto; overscroll-behavior-y: contain; min-height: 0; }
.wrap { width: min(var(--reading), calc(100% - 68px)); margin-inline: auto; }
.home-content { padding: 35px 0 24px; }
.hero { min-height: 294px; border-radius: 18px; background: #ede9da; border: 1px solid #e9e4d5; overflow: hidden; position: relative; display: flex; isolation: isolate; }
.hero-art { position: absolute; inset: 0 0 0 34%; z-index: -1; background: url('/desk.webp') center / cover no-repeat; }
.hero-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #ede9da 0%, rgba(237,233,218,.95) 7%, rgba(237,233,218,.35) 28%, transparent 52%); }
.hero-copy { padding: 32px 39px 34px; max-width: 470px; width: 60%; align-self: center; }
.date-line, .eyebrow { display: inline-flex; align-items: center; gap: 6px; text-transform: uppercase; color: #4b604b; font-size: 10px; font-weight: 730; letter-spacing: .12em; }
.date-line > svg { color: #667b55; }
.hero h1 { font-size: clamp(45px, 5vw, 72px); line-height: .98; letter-spacing: -.072em; margin: 15px 0 15px; }
.hero h1 em { color: #53674a; font-weight: 400; }
.hero p { max-width: 318px; font-size: 13px; line-height: 1.58; color: #485244; }
.hero-note { display: inline-flex; align-items: center; gap: 5px; margin-top: 11px; color: #765449; font: italic 14px/1.3 var(--serif); }
.starts { margin-top: 27px; }
.section-heading, .split { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.section-heading h2 { font-size: 27px; line-height: 1.15; }
.text-link, .inline-button { display: inline-flex; align-items: center; gap: 5px; border: none; background: none; color: var(--green); padding: 3px 0; text-decoration: none; font-size: 13px; font-weight: 650; }
.text-link:hover, .inline-button:hover { text-decoration: underline; }
.text-link:disabled { text-decoration: none; }
.start-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.start-card { display: flex; flex-direction: column; align-items: flex-start; text-align: left; border: 1px solid var(--line); border-radius: 13px; background: var(--canvas); padding: 13px 15px 14px; min-height: 119px; position: relative; transition: background .18s ease, transform .18s ease, border-color .18s ease; }
.start-card:hover { background: #fff; border-color: #cbd5c7; transform: translateY(-2px); }
.start-card strong { margin-top: 9px; font-size: 14px; font-weight: 680; }
.card-detail { margin-top: 2px; color: var(--muted); font-size: 11px; }
.card-arrow { color: #637361; position: absolute; top: 15px; right: 14px; }
.card-icon { display: inline-grid; place-items: center; flex: none; width: 37px; height: 37px; border-radius: 9px; }
.card-icon.moss { color: #466246; background: var(--moss); }
.card-icon.clay { color: #8b5f4c; background: var(--clay); }
.card-icon.lilac { color: #685677; background: var(--lilac); }

.compose-dock { width: min(var(--reading), calc(100% - 68px)); margin: 0 auto; flex: none; padding: 8px 0 max(12px, env(safe-area-inset-bottom)); }
.composer { display: flex; flex-direction: column; padding: 12px 12px 8px 15px; border: 1px solid #dedfd4; border-radius: 16px; background: var(--canvas); box-shadow: 0 5px 22px #3539290a; }
.composer:focus-within { border-color: #a5b2a1; }
.composer textarea { min-height: 30px; max-height: 126px; width: 100%; resize: vertical; background: transparent; padding: 2px 2px 3px; border: 0; outline: none; line-height: 1.5; }
.composer textarea::placeholder { color: #626e60; }
.compose-actions { min-height: 34px; display: flex; justify-content: space-between; align-items: center; }
.compose-tools { display: flex; align-items: center; gap: 7px; min-width: 0; }
.compose-tools .attach-button { width: 40px; height: 40px; background: #eaf0e6; border-radius: 10px; }
.compose-tools .attach-button:hover:not(:disabled) { background: #dce8d7; }
.reasoning-picker { display: inline-grid; place-items: center; min-height: 40px; flex: none; position: relative; }
.reasoning-face { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 7px; border: 1px solid #e2e9de; border-radius: 20px; color: #415643; background: #f0f4ed; font-size: 11px; font-weight: 650; }
.reasoning-face svg:first-child { color: #6a8064; }
.reasoning-picker select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.reasoning-picker:hover .reasoning-face { background: #e6eee2; }
.reasoning-picker:focus-within .reasoning-face { outline: 2px solid #42624a; outline-offset: 3px; }
.reasoning-picker:has(select:disabled) .reasoning-face { opacity: .65; }
.reasoning-picker select:disabled { cursor: default; }
.attachment-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; list-style: none; min-width: 0; }
.attachment-list.draft-files { flex-wrap: nowrap; overflow-x: auto; padding: 4px 4px 8px; margin: 0 -4px 4px; scrollbar-width: thin; }
.attachment-chip { display: flex; align-items: center; max-width: min(100%, 235px); min-width: 0; border-radius: 9px; border: 1px solid #d9e2d5; background: #f0f4ed; }
.draft-files .attachment-chip { flex: 0 0 auto; max-width: min(88%, 235px); }
.attachment-label { display: flex; align-items: center; flex: 1; min-width: 0; padding: 5px 7px; gap: 7px; color: var(--green-dark); text-decoration: none; }
a.attachment-label:hover { text-decoration: underline; }
.attachment-label span { min-width: 0; }
.attachment-label strong, .attachment-label small { display: block; }
.attachment-label strong { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-label small { font-size: 10px; color: var(--muted); }
.attachment-control { display: grid; place-items: center; flex: none; width: 32px; min-height: 36px; color: var(--green); border: 0; border-radius: 8px; background: none; }
.attachment-control:hover { background: #dee9db; }
.send { display: grid; place-items: center; width: 37px; height: 37px; color: #fff; padding: 0; border: 0; border-radius: 11px; background: var(--green); }
.send:hover:not(:disabled) { background: var(--green-dark); }
.send:disabled { opacity: 1; color: #667b66; background: #e4e9df; }
.compose-foot { text-align: center; color: #636d60; font-size: 11px; margin-top: 7px; }
.compose-foot .inline-button { font-size: 11px; }
.conversation { max-width: 760px; padding-block: 24px 17px; display: flex; flex-direction: column; gap: 22px; min-height: 100%; }
.chat-area + .compose-dock { max-width: 760px; }
.conversation-empty { display: grid; justify-items: center; text-align: center; align-content: center; flex: 1; padding-block: 20px 32px; }
.conversation-empty h1, .page-intro h1, .practice-done h1, .access h1 { font-size: clamp(38px, 5vw, 51px); line-height: 1.03; }
.conversation-empty h1 { margin: 15px 0 9px; }
.conversation-empty p { max-width: 350px; }
.big-mark, .small-mark { display: inline-grid; place-items: center; flex: none; color: var(--green); background: #e5ebdf; border-radius: 15px; width: 54px; height: 54px; }
.small-mark { width: 27px; height: 27px; border-radius: 8px; }
.prompt-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-start; }
.conversation-empty .prompt-chips, .practice-done .prompt-chips { margin-top: 20px; justify-content: center; }
.chip { padding: 7px 11px; min-height: 36px; border: 1px solid var(--line); background: var(--canvas); border-radius: 100px; color: var(--green); font-size: 12px; font-weight: 650; }
.chip:hover, .chip.active { background: #e8ede4; border-color: #d5dfd2; }
.message { display: flex; flex-direction: column; gap: 6px; max-width: 100%; }
.message.user { align-self: flex-end; background: #e9eee5; border-radius: 16px 16px 4px 16px; padding: 10px 14px; max-width: min(86%, 550px); }
.message-text { color: #283026; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.message.assistant .message-text { padding-left: 35px; }
.message.assistant .attachment-list { margin-left: 35px; }
.message-by { display: inline-flex; gap: 8px; align-items: center; color: var(--green); font-size: 12px; font-weight: 700; }
.thinking { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; }
.thinking i { border-radius: 50%; background: #87967d; height: 5px; width: 5px; animation: pulse 1s infinite alternate; }
.thinking i:nth-child(2) { animation-delay: .16s; }
.thinking i:nth-child(3) { animation-delay: .32s; margin-right: 6px; }
@keyframes pulse { to { opacity: .35; } }
.memory-inline { display: flex; align-items: center; align-self: flex-start; gap: 7px; background: var(--lilac); padding: 5px 9px; border-radius: 9px; font-size: 12px; }

.page-content { padding: 35px 0 45px; }
.page-intro { margin-bottom: 23px; }
.page-intro h1 { margin: 5px 0 9px; }
.page-intro p { max-width: 550px; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 17px; }
.tab { padding: 9px 15px 11px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-size: 13px; font-weight: 660; }
.tab.active { color: var(--green); border-bottom-color: var(--green); }
.tab:hover { color: var(--green); }
.study-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); margin-bottom: 13px; font-size: 12px; }
.switch { display: flex; gap: 5px; }
.drill-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.panel { border: 1px solid var(--line); border-radius: 13px; background: var(--canvas); }
.drill-card { display: flex; align-items: flex-start; gap: 11px; padding: 15px; }
.drill-card > div { flex: 1; min-width: 0; }
.drill-card .eyebrow, .memory-card .eyebrow, .revision-card .eyebrow { font-size: 9px; letter-spacing: .08em; }
.drill-card h3, .revision-card h3, .study-ai h3 { font: 400 21px/1.12 var(--serif); letter-spacing: -.045em; margin: 3px 0 5px; }
.drill-card p, .study-ai p, .revision-card p { font-size: 13px; }
.meta { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); margin-top: 8px; }
.icon-button { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--green); flex: none; padding: 0; }
.icon-button:hover, .icon-button.bordered { background: #eef1e9; border-color: #e5e8dd; }
.icon-button.bordered:hover { background: #dfe8db; }
.study-ai { padding: 17px; margin-top: 13px; display: flex; gap: 12px; }
.study-ai .prompt-chips { margin-top: 10px; }
.exam-details { margin-top: 13px; padding: 12px 16px; }
summary { cursor: pointer; color: var(--green); font-size: 14px; font-weight: 670; }
.exam-details p, .exam-details dl { margin: 7px 0; }
.exam-details dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.exam-details dt { color: var(--muted); }
dd { margin: 0; }
.exam-details .text-link { margin-right: 12px; }
.subhead { margin: 13px 0 12px; }
.subhead h2, .settings-panel h2 { font-size: 24px; }
.subhead p { font-size: 13px; }
.split h2 { margin: 0; }
.empty { display: grid; justify-items: center; text-align: center; gap: 9px; padding: 31px 18px; }
.empty h3 { font-size: 23px; }
.empty p { max-width: 420px; }
.empty .button { margin-top: 4px; }
.revision-card, .memory-card { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 16px; margin-bottom: 9px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 7px 12px; border: 1px solid transparent; border-radius: 8px; font-size: 13px; font-weight: 650; white-space: nowrap; }
.primary { background: var(--green); color: #fff; }
.primary:hover:not(:disabled) { background: var(--green-dark); }
.secondary { background: #f0f2eb; border-color: #e2e7db; color: var(--green); }
.secondary:hover:not(:disabled) { background: #e1eadd; }
.button.small { min-height: 34px; font-size: 12px; }
.button.destructive { color: #fff; background: #7a4438; }
.danger { color: #874a3d; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); }
tbody tr:last-child > * { border-bottom: 0; }
thead th { color: var(--green); background: #f2f4ee; }
tbody th { font-weight: 550; }
.activity { padding-inline: 14px; }
.activity > div { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.activity > div:last-child { border: 0; }
.activity > div > span:last-child { color: var(--muted); font-size: 12px; margin-left: auto; }
.activity strong { font-weight: 650; font-size: 13px; }
.activity p { font-size: 12px; }

.practice-page { max-width: 740px; }
.practice-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 15px; font-size: 12px; color: var(--green); font-weight: 650; }
.practice-meta > span:last-child { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.compact { margin-bottom: 14px; }
.passage, .question { padding: 15px 17px; margin-bottom: 12px; }
.passage { background: #f1f2e9; }
.passage p { margin-top: 8px; font-size: 14px; line-height: 1.7; color: #384435; white-space: pre-line; }
.question h2 { font: 400 23px/1.2 var(--serif); margin: 5px 0 12px; letter-spacing: -.025em; }
.options { display: grid; gap: 7px; }
.option { display: flex; align-items: center; gap: 9px; background: var(--canvas); border: 1px solid #e1e0d6; border-radius: 9px; padding: 8px 9px; min-height: 43px; text-align: left; font-size: 13px; }
.option > span { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 6px; background: #edeee7; color: #536254; font-weight: 650; font-size: 11px; }
.option:hover:not(:disabled), .option.chosen, .option.correct { background: #eaf0e5; border-color: #b5c7ae; }
.option:disabled { opacity: .74; }
.option.correct, .option.wrong { opacity: 1; }
.option.wrong { background: #f9ede7; border-color: #e0b9a8; }
.question-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.answer-buttons { display: flex; gap: 6px; }
.feedback { padding: 10px 12px; margin-top: 12px; background: #f8eee6; border-radius: 8px; }
.feedback.positive { background: #eaf1e5; }
.feedback p { font-size: 13px; margin: 3px 0; color: #444a40; }
.feedback small { color: var(--muted); }
.practice-done { margin-top: 13px; }

.privacy-note { display: flex; align-items: flex-start; gap: 11px; padding: 14px; background: #eef1e8; }
.privacy-note > svg { color: var(--green); margin-top: 2px; }
.privacy-note div { flex: 1; }
.privacy-note p { font-size: 13px; margin-top: 2px; }
.memory-card p { color: var(--text); margin: 4px 0; overflow-wrap: anywhere; }
.memory-actions { display: flex; align-items: center; gap: 5px; flex: none; }
.settings-panel { padding: 15px 18px; margin-bottom: 13px; }
.settings-panel h2, .settings-panel p { margin-bottom: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
label { display: grid; gap: 4px; font-size: 13px; font-weight: 650; }
input:not([type="checkbox"]), select, textarea[name="text"] { min-width: 0; width: 100%; border: 1px solid #deddcf; border-radius: 8px; background: #fffefb; padding: 8px 9px; color: var(--text); min-height: 40px; font-weight: 400; }
textarea[name="text"] { resize: vertical; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 13px 0; margin: 8px 0 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
.switch-row small { display: block; color: var(--muted); font-weight: 400; margin-top: 2px; }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--green); }
.connection { display: flex; gap: 6px; align-items: center; color: var(--green); font-size: 13px; font-weight: 650; margin-bottom: 7px; }
.connection i { height: 8px; width: 8px; background: #638265; border-radius: 50%; }
.connection i.off { background: #b48552; }
.key-form { display: flex; align-items: end; gap: 10px; margin-bottom: 3px; }
.key-form label { flex: 1; }
.key-links { display: flex; flex-wrap: wrap; gap: 5px 16px; margin-top: 6px; }
.settings-panel small, .muted { color: var(--muted); }
.settings-foot { margin: 8px 0; font-size: 12px; }

.access, .boot { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 22px; background: radial-gradient(ellipse at 50% 30%, #f5eee0, var(--paper) 60%); }
.access-panel { width: min(100%, 410px); padding: 28px; box-shadow: 0 15px 50px #333b2310; }
.access-panel .mark { margin-bottom: 15px; }
.access-panel p { margin: 9px 0 15px; }
.access form, .dialog form { display: grid; gap: 11px; }
.access form button, .dialog form button { justify-self: start; margin-top: 3px; }
.access .signature { margin-top: 18px; }
.dialog { width: min(430px, calc(100% - 35px)); border: 1px solid var(--line); border-radius: 14px; padding: 17px; background: var(--canvas); box-shadow: 0 14px 48px #172b2255; }
.dialog::backdrop { background: #18291d60; }
.dialog-header, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dialog h2 { font-size: 25px; }
.dialog p, .dialog form { margin-top: 7px; }
.dialog-actions { justify-content: flex-end; margin-top: 16px; }
.toast { position: fixed; z-index: 12; bottom: max(18px, env(safe-area-inset-bottom)); left: calc(50% + var(--rail) / 2); transform: translateX(-50%); width: max-content; max-width: calc(100% - 30px); padding: 10px 14px; border-radius: 9px; background: var(--green-dark); color: white; box-shadow: 0 5px 20px #0002; font-size: 13px; text-align: center; pointer-events: none; }

@media (max-width: 940px) {
  :root { --rail: 211px; }
  .wrap, .compose-dock { width: calc(100% - 44px); }
  .hero { min-height: 263px; }
  .hero-copy { padding-left: 27px; }
  .hero-art { inset-inline-start: 30%; }
}

@media (max-width: 720px) {
  :root { --rail: 0px; }
  .shell { display: block; }
  .main { height: 100%; }
  .sidebar { display: none; }
  .sidebar.open { display: flex; position: fixed; width: min(278px, calc(100% - 55px)); inset: 0 auto 0 0; z-index: 7; padding-top: max(22px, env(safe-area-inset-top)); padding-bottom: max(20px, env(safe-area-inset-bottom)); box-shadow: 10px 0 35px #21332326; }
  .scrim { display: block !important; position: fixed; inset: 0; border: 0; z-index: 6; background: #1b271c56; }
  .mobile-menu { display: inline-grid !important; margin-left: -6px; }
  .topbar { flex-basis: max(55px, calc(55px + env(safe-area-inset-top))); padding: env(safe-area-inset-top) 17px 0; gap: 4px; }
  .top-actions { gap: 8px; }
  .top-title { font-size: 14px; }
  .wrap, .compose-dock { width: calc(100% - 32px); }
  .home-content { padding-top: 15px; padding-bottom: 13px; }
  .hero { min-height: 242px; border-radius: 14px; }
  .hero-copy { padding: 22px 18px; width: 67%; }
  .hero h1 { font-size: clamp(40px, 7.5vw, 56px); }
  .hero-art { inset-inline-start: 31%; background-position: 55% center; }
  .hero-art::after { background: linear-gradient(90deg, #ede9da, rgba(237,233,218,.67) 19%, transparent 57%); }
  .starts { margin-top: 17px; }
  .section-heading { margin-bottom: 8px; }
  .section-heading h2 { font-size: 23px; }
  .start-grid { gap: 7px; }
  .start-card { padding: 9px; min-height: 109px; border-radius: 10px; }
  .start-card strong { font-size: 12px; line-height: 1.25; }
  .card-detail { line-height: 1.35; }
  .card-arrow { top: 9px; right: 7px; }
  .card-arrow svg { width: 14px; height: 14px; }
  .card-icon { width: 33px; height: 33px; }
  .compose-dock { padding-top: 7px; }
  .composer { border-radius: 13px; padding: 8px 9px 6px 10px; }
  .composer textarea { font-size: 16px; padding-top: 1px; }
  .compose-tools .attach-button { width: 44px; height: 44px; }
  .reasoning-picker { min-height: 44px; }
  .send { width: 36px; height: 36px; }
  .page-content { padding-top: 23px; }
  .page-intro { margin-bottom: 16px; }
  .drill-grid { grid-template-columns: 1fr; }
  .key-form input { font-size: 16px; }
  .option { min-height: 45px; }
}

@media (max-width: 405px) {
  .hero { min-height: 220px; }
  .hero h1 { font-size: 41px; }
  .hero-copy { width: 70%; }
  .hero p { font-size: 12px; }
  .private { padding: 4px 7px; }
  .start-card { min-height: 100px; }
  .card-detail { font-size: 10px; }
  .card-arrow { display: none; }
  .memory-card { flex-wrap: wrap; gap: 5px; }
  .memory-actions { margin-left: auto; }
  .question-actions .button { padding-inline: 7px; }
  th, td { padding-inline: 7px; font-size: 12px; }
}

@media (max-width: 355px) {
  .hero h1 { font-size: 35px; }
  .hero-copy { width: 78%; }
  .private { display: none; }
  .start-card { padding: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

.scroll-area { scrollbar-width: thin; scrollbar-gutter: stable both-edges; scrollbar-color: #c5cabe transparent; }
@media (min-width: 721px) and (max-height: 770px) {
  .home-content { padding-top: 26px; padding-bottom: 8px; }
  .hero { min-height: 275px; }
  .hero-copy { padding-block: 22px; }
  .starts { margin-top: 23px; }
}
@media (max-width: 720px) {
  .scroll-area { scrollbar-gutter: auto; }
  .hero-copy { width: 83%; }
  .hero h1 { margin-top: 12px; }
  .hero p { max-width: 215px; }
  .hero-art { inset-inline-start: 30%; background-position: 27% center; }
  .hero-art::after { background: linear-gradient(90deg, #ede9da 0%, rgba(237,233,218,.93) 23%, rgba(237,233,218,.35) 66%, transparent 89%); }
  .start-grid { grid-template-columns: 1fr; gap: 7px; }
  .start-card { display: grid; grid-template-columns: 36px minmax(0, 1fr) 18px; grid-template-rows: auto auto; column-gap: 10px; align-content: center; min-height: 60px; padding: 8px 11px; }
  .start-card .card-icon { grid-row: 1 / 3; align-self: center; }
  .start-card strong { grid-column: 2; grid-row: 1; align-self: end; margin-top: 0; font-size: 13px; }
  .start-card .card-detail { grid-column: 2; grid-row: 2; font-size: 11px; }
  .start-card .card-arrow { display: block; grid-column: 3; grid-row: 1 / 3; align-self: center; position: static; }
  .sidebar .nav-link { min-height: 44px; }
}
