:root {
  --paper: #efe8d5;
  --paper-light: #fbf7ec;
  --paper-deep: #dfd3b8;
  --ink: #17211d;
  --ink-soft: #4b554f;
  --moss: #294e3f;
  --moss-light: #dce4d8;
  --vermilion: #b83b2c;
  --sun: #e6b34d;
  --line: rgba(23, 33, 29, 0.2);
  --serif: Iowan Old Style, Palatino Linotype, Book Antiqua, Palatino, Georgia, serif;
  --sans: Avenir Next, Avenir, Gill Sans, Trebuchet MS, sans-serif;
  --mono: SFMono-Regular, Consolas, Liberation Mono, monospace;
  --shadow: 7px 8px 0 rgba(23, 33, 29, 0.11);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(23, 33, 29, 0.025) 1px, transparent 1px) 0 0 / 100% 32px,
    var(--paper);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.58;
}
a { color: var(--moss); text-underline-offset: 0.18em; }
a:hover { color: var(--vermilion); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--vermilion); outline-offset: 3px; }

.skip-link {
  position: fixed; left: 1rem; top: -5rem; z-index: 100;
  padding: 0.7rem 1rem; color: white; background: var(--ink);
}
.skip-link:focus { top: 1rem; }

.site-header {
  min-height: 78px;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto minmax(230px, 1fr);
  align-items: center;
  gap: 2rem;
  padding: 0.8rem clamp(1rem, 4vw, 4rem);
  border-bottom: 2px solid var(--ink);
  background: rgba(239, 232, 213, 0.96);
}
.brand { display: inline-flex; align-items: center; gap: 0.7rem; color: var(--ink); text-decoration: none; font-size: 1.12rem; font-weight: 700; letter-spacing: 0.025em; }
.brand em { color: var(--vermilion); font-weight: 500; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; color: var(--paper); background: var(--ink); border-radius: 50% 44% 48% 42%; font-family: var(--serif); font-size: 1.3rem; }
.primary-nav, .account-actions { display: flex; align-items: center; gap: 1.15rem; font-family: var(--sans); font-size: 0.82rem; font-weight: 650; }
.primary-nav a, .account-actions a { color: var(--ink); text-decoration: none; }
.primary-nav a[aria-current="page"] { border-bottom: 3px solid var(--vermilion); }
.account-actions { justify-self: end; }
.account-actions form { margin: 0; }
.account-profile-link { display: inline-flex; align-items: center; gap: 0.38rem; }
.account-profile-icon { width: 1rem; height: 1rem; color: var(--moss); }
.text-button { padding: 0; border: 0; color: var(--moss); background: transparent; cursor: pointer; font-family: var(--sans); font-size: 0.82rem; font-weight: 650; text-decoration: underline; text-underline-offset: 0.18em; }

.page-shell { width: min(1180px, calc(100% - 2rem)); min-height: calc(100vh - 180px); margin: 0 auto; padding: clamp(2.4rem, 6vw, 5.5rem) 0; }
.site-footer { display: flex; justify-content: space-between; gap: 2rem; padding: 1.2rem clamp(1rem, 4vw, 4rem); border-top: 1px solid var(--ink); color: var(--ink-soft); font-family: var(--sans); font-size: 0.72rem; }
.site-footer p { margin: 0; }
.eyebrow, .folio { margin: 0 0 0.65rem; color: var(--vermilion); font-family: var(--mono); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
h1, h2, h3 { margin-top: 0; line-height: 1.04; }
h1 { max-width: 850px; margin-bottom: 0.7rem; font-size: clamp(2.35rem, 6vw, 5.4rem); font-weight: 500; letter-spacing: -0.045em; }
h2 { font-size: clamp(1.45rem, 3vw, 2.25rem); font-weight: 560; letter-spacing: -0.025em; }
h3 { font-size: 1.3rem; }

.button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; padding: 0.72rem 1.05rem; border: 1px solid var(--ink); border-radius: 0; box-shadow: none; cursor: pointer; font-family: var(--sans); font-size: 0.78rem; font-weight: 750; letter-spacing: 0.035em; text-decoration: none; }
.button-primary { color: var(--paper-light); background: var(--ink); }
.button-primary:hover { color: white; background: var(--moss); }
.button-secondary { color: var(--ink); background: var(--paper-light); }
.button-secondary:hover { color: var(--ink); background: var(--sun); }
.button-danger { color: white; border-color: var(--vermilion); background: var(--vermilion); }
.danger-link { color: var(--vermilion); font-weight: 700; }
.quiet-link { font-family: var(--sans); font-size: 0.82rem; }
.small-print { color: var(--ink-soft); font-family: var(--sans); font-size: 0.76rem; }

.message-stack { position: fixed; right: 1rem; top: 92px; z-index: 20; width: min(420px, calc(100% - 2rem)); }
.message { padding: 0.9rem 1rem; border: 1px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); background: var(--paper-light); font-family: var(--sans); font-size: 0.85rem; }
.message-success { border-left: 7px solid var(--moss); }
.message-error { border-left: 7px solid var(--vermilion); }

.login-layout { min-height: 610px; display: grid; grid-template-columns: 1.2fr minmax(340px, 0.8fr); border: 1px solid var(--ink); box-shadow: var(--shadow); background: var(--paper-light); }
.login-intro { position: relative; overflow: hidden; padding: clamp(2rem, 7vw, 6rem); color: var(--paper-light); background: var(--moss); }
.login-intro::after { content: "F"; position: absolute; right: -0.04em; bottom: -0.31em; color: rgba(239, 232, 213, 0.08); font-size: clamp(18rem, 40vw, 34rem); line-height: 1; }
.login-intro .eyebrow { color: var(--sun); }
.login-intro h1 { position: relative; z-index: 1; max-width: 680px; }
.login-intro > p { position: relative; z-index: 1; max-width: 650px; font-size: 1.18rem; }
.privacy-seal { position: absolute; left: clamp(2rem, 7vw, 6rem); bottom: 3rem; z-index: 1; display: flex; align-items: center; gap: 0.9rem; }
.privacy-seal > span { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid var(--sun); border-radius: 50%; color: var(--sun); }
.privacy-seal p { margin: 0; font-family: var(--sans); font-size: 0.78rem; }
.login-card { align-self: center; padding: clamp(2rem, 5vw, 4.5rem); }
.login-card h2 { margin-bottom: 0.4rem; }

.stacked-form, .paper-form { display: grid; gap: 1rem; margin-top: 2rem; }
.field { display: grid; gap: 0.35rem; }
.field label { font-family: var(--sans); font-size: 0.78rem; font-weight: 750; letter-spacing: 0.02em; }
.field input:not([type="checkbox"]), .field textarea, .field select { width: 100%; min-height: 48px; padding: 0.7rem 0.75rem; border: 1px solid var(--ink); border-radius: 0; color: var(--ink); background: #fffdf7; }
.field textarea { min-height: 55vh; resize: vertical; line-height: 1.65; }
.field-help, .field-error-text { margin: 0; font-family: var(--sans); font-size: 0.72rem; }
.field-help { color: var(--ink-soft); }
.field-error input, .field-error textarea, .field-error select { border: 2px solid var(--vermilion); }
.field-error-text { color: #861f16; font-weight: 700; }
.field-checkbox { grid-template-columns: 24px 1fr; align-items: start; }
.field-checkbox input { width: 20px; height: 20px; margin: 0.12rem 0 0; accent-color: var(--moss); }
.field-checkbox .field-help, .field-checkbox .field-error-text { grid-column: 2; }
.error-summary { padding: 0.9rem 1rem; border-left: 6px solid var(--vermilion); color: #641b15; background: #f5ddd5; font-family: var(--sans); font-size: 0.82rem; }
.error-summary p { margin: 0.3rem 0 0; }

.home-hero, .page-heading, .document-header { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 3.5rem; }
.home-hero p:last-child, .page-heading > div > p:last-child { max-width: 700px; margin-bottom: 0; font-size: 1.08rem; }
.morning-coach-note { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 1.25rem; align-items: start; margin: -1.75rem 0 3.5rem; padding: 1.2rem; border: 1px solid var(--ink); border-left: 6px solid var(--vermilion); background: linear-gradient(90deg, rgba(197, 78, 50, 0.11), transparent 42%), var(--paper-light); box-shadow: 5px 6px 0 rgba(23, 33, 29, 0.08); }
.morning-coach-stamp { padding-top: 0.22rem; color: var(--vermilion); font-family: var(--mono); font-size: 0.65rem; font-weight: 800; letter-spacing: 0.08em; line-height: 1.45; text-transform: uppercase; }
.morning-coach-note h2 { margin: 0; font-family: var(--serif); font-size: 1.45rem; }
.morning-coach-note p { max-width: 760px; margin: 0.45rem 0 0; color: var(--ink-soft); line-height: 1.55; }
.morning-coach-note .morning-coach-question { padding-left: 0.7rem; border-left: 2px solid var(--ink); color: var(--ink); font-family: var(--serif); }
.morning-coach-note ul { display: grid; gap: 0.32rem; margin: 0.85rem 0 0; padding-left: 1.1rem; color: var(--ink-soft); font-size: 0.9rem; }
.morning-coach-note li small { display: block; margin-top: 0.18rem; color: var(--ink-soft); line-height: 1.45; }
.morning-coach-note li a { display: inline-block; margin-top: 0.2rem; font-size: 0.78rem; font-weight: 700; }
.morning-coach-note .button { align-self: center; white-space: nowrap; }
.desk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 1.5rem; margin-bottom: 5rem; }
.desk-card { min-height: 330px; display: flex; flex-direction: column; justify-content: space-between; padding: 1.4rem; border: 1px solid var(--ink); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; transition: transform 180ms ease, box-shadow 180ms ease; }
.desk-card:hover { transform: translate(-3px, -3px); box-shadow: 11px 12px 0 rgba(23, 33, 29, 0.14); color: var(--ink); }
.desk-index { align-self: flex-end; font-family: var(--mono); font-size: 0.75rem; }
.desk-card h2 { max-width: 500px; font-size: clamp(2rem, 4vw, 3.8rem); }
.desk-card p:not(.eyebrow) { max-width: 500px; }
.desk-card strong { color: var(--vermilion); font-family: var(--sans); font-size: 0.82rem; }
.notebook-card { background: var(--paper-light); }
.fieldwork-card { color: var(--paper-light); background: var(--moss); }
.fieldwork-card:hover { color: white; }
.fieldwork-card .eyebrow, .fieldwork-card strong { color: var(--sun); }
.reference-card { background: var(--moss-light); }
.reference-card .eyebrow, .reference-card strong { color: var(--vermilion); }
.coach-card { color: var(--paper-light); background: var(--vermilion); }
.coach-card:hover { color: white; }
.coach-card .eyebrow, .coach-card strong { color: var(--sun); }
.bookshelf-heading { margin-bottom: 2rem; }
.bookshelf-intro { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 4rem; padding: clamp(1.4rem, 4vw, 2.5rem); border: 1px solid var(--ink); background: var(--moss-light); }
.bookshelf-intro h2 { max-width: 600px; margin-bottom: 0.7rem; }
.bookshelf-intro p:last-child { max-width: 680px; margin-bottom: 0; }
.bookshelf-actions { display: grid; justify-items: start; gap: 0.85rem; flex: 0 0 auto; }
.reference-section { margin-bottom: 4.5rem; }
.resource-count { color: var(--ink-soft); font-family: var(--mono); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.reference-table-wrap { overflow-x: auto; border: 1px solid var(--ink); background: var(--paper-light); }
.reference-table { width: 100%; min-width: 860px; border-collapse: collapse; text-align: left; }
.reference-table th, .reference-table td { padding: 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.reference-table thead th { color: var(--paper-light); background: var(--ink); font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.055em; text-transform: uppercase; }
.reference-table tbody > tr:last-child th, .reference-table tbody > tr:last-child td { border-bottom: 0; }
.reference-table tbody > tr:hover { background: rgba(220, 228, 216, 0.42); }
.reference-table td:first-child { width: 3rem; color: var(--vermilion); font-family: var(--mono); font-weight: 700; }
.reference-table tbody th { min-width: 250px; font-size: 1rem; font-weight: 700; }
.topic-chip { display: inline-block; margin: 0 0.25rem 0.3rem 0; padding: 0.18rem 0.42rem; border: 1px solid var(--line); color: var(--moss); background: var(--moss-light); font-family: var(--sans); font-size: 0.68rem; font-weight: 700; }
.resource-list { display: flex; flex-wrap: wrap; gap: 0.42rem 0.9rem; margin: 0; padding: 0; list-style: none; font-family: var(--sans); font-size: 0.77rem; font-weight: 650; }
.reference-boundary { max-width: 850px; margin: -0.35rem 0 1.5rem; padding: 0.9rem 1rem; border-left: 6px solid var(--vermilion); background: #f5ddd5; font-family: var(--sans); font-size: 0.84rem; }
.assignment-shelf { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 1.2rem; }
.assignment-reference-card { display: flex; flex-direction: column; gap: 0.9rem; padding: 1.35rem; border: 1px solid var(--ink); box-shadow: 5px 6px 0 rgba(23, 33, 29, 0.1); background: var(--paper-light); }
.assignment-reference-card h3, .assignment-reference-card p, .assignment-reference-card .resource-list { margin: 0; }
.assignment-reference-card h3 { font-size: 1.35rem; }
.assignment-reference-card > p:not(.eyebrow) { color: var(--ink-soft); font-size: 0.92rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }

.document-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; }
.document-card { position: relative; min-height: 230px; display: grid; grid-template-columns: 44px 1fr; border: 1px solid var(--ink); box-shadow: 5px 6px 0 rgba(23, 33, 29, 0.1); background: var(--paper-light); }
.document-card.is-pinned { border-top: 5px solid var(--sun); }
.subject-tab { display: flex; align-items: center; justify-content: center; padding: 0.6rem 0; border-right: 1px solid var(--line); color: var(--moss); background: var(--moss-light); font-family: var(--mono); font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; writing-mode: vertical-rl; transform: rotate(180deg); }
.document-card-copy { min-width: 0; padding: 1.35rem; }
.document-card h2 { margin: 0.35rem 0 0.7rem; font-size: 1.65rem; }
.document-card h2 a { color: var(--ink); text-decoration: none; }
.document-card h2, .document-card p { overflow-wrap: anywhere; }
.document-card p { color: var(--ink-soft); }
.document-card small { color: var(--ink-soft); font-family: var(--mono); font-size: 0.68rem; }
.status-stamp { display: inline-flex; padding: 0.2rem 0.45rem; border: 1px solid currentColor; color: var(--vermilion); font-family: var(--mono); font-size: 0.62rem; font-weight: 750; letter-spacing: 0.09em; text-transform: uppercase; }
.empty-state { padding: 4rem 2rem; border: 1px dashed var(--ink); text-align: center; background: rgba(251, 247, 236, 0.55); }
.empty-state > span { color: var(--vermilion); font-size: 2.4rem; }
.empty-state h2, .empty-state h3 { margin: 0.5rem 0; }
.empty-state p { max-width: 560px; margin: 0.7rem auto 1.4rem; }

.compact-heading { align-items: center; }
.compact-heading h1 { font-size: clamp(2.3rem, 5vw, 4.5rem); }
.filter-bar { display: grid; grid-template-columns: minmax(220px, 2fr) minmax(160px, 1fr) auto auto; align-items: end; gap: 1rem; margin-bottom: 2rem; padding: 1rem; border: 1px solid var(--line); background: rgba(251, 247, 236, 0.7); }
.compact-field { gap: 0.2rem; }
.trash-link { margin-top: 2rem; text-align: right; font-family: var(--sans); font-size: 0.8rem; }

.editor-form { display: grid; grid-template-columns: minmax(230px, 0.42fr) minmax(0, 1.58fr); gap: 1.5rem; align-items: start; }
.editor-meta { position: sticky; top: 1rem; display: grid; gap: 1.15rem; padding: 1.2rem; border: 1px solid var(--ink); background: var(--paper-light); }
.privacy-note { padding-top: 1rem; border-top: 1px solid var(--line); color: var(--ink-soft); font-family: var(--sans); font-size: 0.74rem; }
.privacy-note p { margin-bottom: 0; }
.writing-sheet { padding: 1.3rem; border: 1px solid var(--ink); box-shadow: var(--shadow); background: repeating-linear-gradient(#fffdf7, #fffdf7 31px, #d9e1dc 32px); }
.writing-sheet .field > label { color: var(--vermilion); font-family: var(--mono); text-transform: uppercase; }
.writing-sheet textarea { border: 0; outline: 0; background: rgba(255,255,255,0.58); font-family: var(--serif); font-size: 1.08rem; }
.editor-actions, .action-row, .revision-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.editor-actions { justify-content: space-between; padding-top: 1rem; border-top: 1px solid var(--line); }

.document-view { width: min(940px, 100%); margin: 0 auto; }
.document-header { align-items: center; padding-bottom: 1.5rem; border-bottom: 3px double var(--ink); }
.document-header h1 { font-size: clamp(2.6rem, 7vw, 5.8rem); }
.writing-body { min-height: 420px; padding: clamp(1.5rem, 6vw, 4.5rem); border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: repeating-linear-gradient(#fffdf7, #fffdf7 31px, #d9e1dc 32px); font-size: 1.08rem; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
.document-footer, .revision-actions { display: flex; justify-content: space-between; gap: 1rem; padding-top: 1.3rem; border-top: 1px solid var(--ink); font-family: var(--sans); font-size: 0.8rem; }
.historical-view .writing-body { opacity: 0.88; }

.revision-list { display: grid; gap: 1rem; padding: 0; list-style: none; }
.revision-list li { display: grid; grid-template-columns: 80px 1fr auto; gap: 1.3rem; align-items: start; padding: 1.2rem; border: 1px solid var(--ink); background: var(--paper-light); }
.revision-number { width: 64px; height: 64px; display: grid; place-items: center; border: 1px solid var(--vermilion); border-radius: 50%; color: var(--vermilion); font-family: var(--mono); }
.revision-list h2 { margin-bottom: 0.2rem; font-size: 1.35rem; }
.revision-list h2 a { color: var(--ink); }
.revision-list p { margin: 0.2rem 0; }
.revision-excerpt { color: var(--ink-soft); }

.confirm-panel, .narrow-page { width: min(720px, 100%); margin: 2rem auto; padding: clamp(1.5rem, 6vw, 4rem); border: 1px solid var(--ink); box-shadow: var(--shadow); background: var(--paper-light); }
.confirm-panel h1, .narrow-page h1 { font-size: clamp(2.25rem, 6vw, 4.5rem); }
.confirm-panel .action-row { margin-top: 2rem; }
.destructive-panel { border-top: 10px solid var(--vermilion); }
.trash-list { display: grid; gap: 1rem; }
.trash-list article { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.2rem; border: 1px solid var(--ink); background: var(--paper-light); }
.trash-list h2 { margin-bottom: 0.3rem; }
.trash-list p { margin: 0; }
.settings-grid { display: grid; grid-template-columns: 1fr 0.78fr; gap: 1.5rem; align-items: start; }
.paper-form, .account-panel { padding: clamp(1.2rem, 4vw, 2.2rem); border: 1px solid var(--ink); background: var(--paper-light); }
.account-panel { border-top: 7px solid var(--moss); }
.account-panel hr { margin: 2rem 0; border: 0; border-top: 1px solid var(--line); }

/* Authenticated AI coach */
.coach-heading { align-items: start; }
.coach-heading > div { max-width: 880px; }
.coach-layout { display: grid; grid-template-columns: minmax(300px, 0.7fr) minmax(0, 1.3fr); gap: 1.5rem; align-items: start; }
.coach-context-panel, .coach-chat-panel { border: 1px solid var(--ink); background: var(--paper-light); }
.coach-context-panel { padding: clamp(1.25rem, 3vw, 2.2rem); }
.coach-context-panel > div > h2 { margin-bottom: 0.6rem; }
.coach-context-panel > div > p:last-child { color: var(--ink-soft); font-size: 0.9rem; }
.coach-context-form { margin-top: 1.25rem; padding: 0; border: 0; background: transparent; }
.coach-context-form .field textarea { min-height: 110px; }
.coach-checkin-history { margin-top: 2.2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.coach-checkin-history h2 { margin-bottom: 0.9rem; font-size: 1.35rem; }
.coach-checkin-history ol { display: grid; gap: 0.9rem; margin: 0; padding: 0; list-style: none; }
.coach-checkin-history li { padding-left: 0.85rem; border-left: 3px solid var(--sun); }
.coach-checkin-history time { color: var(--ink-soft); font-family: var(--mono); font-size: 0.68rem; font-weight: 700; }
.coach-checkin-history p { margin: 0.28rem 0 0; font-size: 0.88rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.coach-chat-panel { min-width: 0; overflow: hidden; box-shadow: var(--shadow); }
.coach-chat-intro { display: flex; align-items: end; justify-content: space-between; gap: 1.5rem; padding: clamp(1.25rem, 3vw, 2.2rem); color: var(--paper-light); background: var(--moss); }
.coach-chat-intro .eyebrow { color: var(--sun); }
.coach-chat-intro h2 { margin-bottom: 0; }
.coach-chat-intro > p { max-width: 280px; margin: 0; font-family: var(--sans); font-size: 0.78rem; line-height: 1.5; }
.coach-chat-shell { min-height: 680px; padding: 0.8rem; background: #fffdf7; }
.coach-chat-shell openai-chatkit { display: block; width: 100%; min-height: 620px; }
.coach-chat-shell > .small-print { margin: 0.7rem 0 0; color: var(--ink-soft); }
.coach-unavailable { margin: 1rem; padding: clamp(2rem, 6vw, 5rem) clamp(1.25rem, 5vw, 3.5rem); border: 1px dashed var(--ink); background: rgba(220, 228, 216, 0.45); }
.coach-unavailable h2 { margin-bottom: 0.7rem; }
.coach-unavailable p:not(.eyebrow) { max-width: 650px; color: var(--ink-soft); }
.coach-unavailable code { padding: 0.15rem 0.28rem; color: var(--ink); background: var(--paper); font-family: var(--mono); font-size: 0.8em; }

/* Mock interview room: an original, quiet studio treatment for the live lane. */
.mock-interview-room { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr); margin: 0 0 1.5rem; border: 1px solid var(--ink); background: #1c2924; color: var(--paper-light); box-shadow: var(--shadow); overflow: hidden; }
.mock-interview-stage { position: relative; display: flex; min-height: 540px; flex-direction: column; align-items: center; justify-content: space-between; padding: clamp(1rem, 3vw, 2rem); background: radial-gradient(circle at 50% 38%, rgba(210, 180, 85, 0.14), transparent 24rem), linear-gradient(155deg, #18231f 0%, #263831 100%); }
.mock-interview-stage::after { position: absolute; inset: auto 0 0; height: 30%; background: linear-gradient(0deg, rgba(8, 12, 10, 0.48), transparent); content: ""; pointer-events: none; }
.mock-interview-stage-bar, .mock-interview-controls, .mock-interview-voice-status, .mock-interview-disclosure { position: relative; z-index: 1; }
.mock-interview-stage-bar { display: flex; width: 100%; align-items: center; justify-content: space-between; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.09em; text-transform: uppercase; }
.mock-interview-status { display: inline-flex; align-items: center; gap: 0.45rem; color: #e7eddf; }
.mock-interview-status i { display: block; width: 0.48rem; height: 0.48rem; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 4px rgba(224, 186, 82, 0.12); }
.mock-interview-status.is-live i { background: #f58362; box-shadow: 0 0 0 4px rgba(245, 131, 98, 0.14); animation: interview-pulse 1.7s ease-in-out infinite; }
.mock-interview-timer { color: var(--sun); }
.interviewer-avatar { position: relative; z-index: 1; display: flex; width: min(100%, 300px); flex-direction: column; align-items: center; justify-content: center; margin: 1rem 0 0; text-align: center; }
.interviewer-avatar-halo { position: absolute; top: 7%; width: 218px; height: 218px; border: 1px solid rgba(227, 204, 132, 0.35); border-radius: 50%; box-shadow: 0 0 0 18px rgba(227, 204, 132, 0.04), 0 0 70px rgba(227, 204, 132, 0.13); }
.interviewer-avatar svg { position: relative; width: 220px; height: 220px; overflow: visible; }
.avatar-face { fill: #d7b990; stroke: #efd6a9; stroke-width: 2; }
.avatar-hair { fill: #26332d; stroke: #91a28c; stroke-width: 1.5; }
.avatar-eye { fill: #1c2924; }
.avatar-mouth { fill: none; stroke: #684c43; stroke-linecap: round; stroke-width: 3; }
.avatar-collar { fill: none; stroke: #d6c981; stroke-linecap: round; stroke-width: 4; }
.interviewer-avatar p { margin: -0.2rem 0 0.25rem; color: var(--paper-light); font-family: var(--serif); font-size: 1.35rem; }
.interviewer-avatar small { color: #c2d0c1; font-family: var(--mono); font-size: 0.63rem; letter-spacing: 0.05em; text-transform: uppercase; }
.interviewer-avatar.is-speaking .interviewer-avatar-halo { border-color: rgba(245, 131, 98, 0.75); box-shadow: 0 0 0 18px rgba(245, 131, 98, 0.06), 0 0 90px rgba(245, 131, 98, 0.28); animation: interview-pulse 1.2s ease-in-out infinite; }
.interviewer-avatar.is-speaking .avatar-mouth { animation: interviewer-mouth 0.35s ease-in-out infinite alternate; }
.mock-interview-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.65rem; }
.mock-interview-controls .button-primary { border-color: var(--sun); color: #222a23; background: var(--sun); }
.mock-interview-controls .button-primary:hover { border-color: #f1d17b; background: #f1d17b; }
.mock-interview-controls .button-secondary { border-color: rgba(235, 239, 226, 0.5); color: var(--paper-light); background: transparent; }
.mock-interview-controls .button-secondary:hover { border-color: var(--paper-light); background: rgba(255, 255, 255, 0.08); }
.mock-interview-voice-status { max-width: 430px; margin: 0.7rem 0 0; color: #d6e0d4; font-family: var(--sans); font-size: 0.82rem; line-height: 1.45; text-align: center; }
.mock-interview-disclosure { max-width: 450px; margin: 0; color: #aebcae; font-family: var(--mono); font-size: 0.61rem; line-height: 1.4; text-align: center; }
.mock-interview-brief { display: flex; min-height: 540px; flex-direction: column; padding: clamp(1.4rem, 4vw, 2.6rem); color: var(--ink); background: var(--paper-light); }
.mock-interview-brief .eyebrow { color: var(--vermilion); }
.mock-interview-brief h2 { max-width: 420px; margin: 0.2rem 0 0.7rem; font-size: clamp(1.8rem, 4vw, 3rem); line-height: 0.98; }
.mock-interview-brief > p:not(.eyebrow) { max-width: 470px; color: var(--ink-soft); line-height: 1.55; }
.mock-interview-loop { display: grid; gap: 1rem; margin: 1.4rem 0 1.4rem; padding: 0; list-style: none; }
.mock-interview-loop li { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 0.8rem; padding-top: 0.9rem; border-top: 1px solid var(--line); font-size: 0.8rem; }
.mock-interview-loop strong { color: var(--moss); font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.07em; text-transform: uppercase; }
.mock-interview-loop span { color: var(--ink-soft); line-height: 1.45; }
.mock-interview-score-strip { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: auto; }
.mock-interview-score-strip span { padding: 0.35rem 0.48rem; border: 1px solid var(--line); color: var(--ink-soft); font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.04em; text-transform: uppercase; }
.mock-interview-live-transcript { margin-top: 1.4rem; padding: 0.9rem; border-left: 3px solid var(--sun); background: #f5ebc9; }
.mock-interview-live-transcript .eyebrow { margin-bottom: 0.35rem; color: #765a1f; }
.mock-interview-live-transcript p:last-child { margin: 0; color: #484431; font-family: var(--serif); font-size: 0.95rem; line-height: 1.42; }
.mock-interview-room > audio { display: none; }
@keyframes interview-pulse { 0%, 100% { opacity: 0.75; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes interviewer-mouth { from { transform: scaleX(0.72); } to { transform: scaleX(1.1); } }

/* Personal study desk */
.accent-moss { --topic-accent: var(--moss); --topic-tint: #dce4d8; }
.accent-vermilion { --topic-accent: var(--vermilion); --topic-tint: #f0d8d0; }
.accent-sun { --topic-accent: #9b6c14; --topic-tint: #f5e6ba; }
.accent-ink { --topic-accent: var(--ink); --topic-tint: #d9ddd9; }

.today-desk { margin: 0 0 5rem; padding: 2rem 0 0; border-top: 3px double var(--ink); }
.today-heading { align-items: start; }
.today-heading > div:first-child { max-width: 700px; }
.today-heading h2 { margin-bottom: 0.45rem; }
.today-heading p:last-child { margin: 0; color: var(--ink-soft); }
.heading-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.45rem 1.1rem; font-family: var(--sans); font-size: 0.78rem; font-weight: 700; }

.plan-summary { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--ink); border-bottom: 0; background: var(--paper-light); }
.plan-summary > div { min-height: 84px; display: flex; flex-direction: column; justify-content: center; padding: 0.85rem 1rem; border-right: 1px solid var(--line); font-family: var(--sans); font-size: 0.68rem; letter-spacing: 0.055em; text-transform: uppercase; }
.plan-summary > div:last-child { border-right: 0; }
.summary-number { color: var(--moss); font-family: var(--serif); font-size: 1.7rem; font-weight: 650; line-height: 1; letter-spacing: -0.03em; }
.daily-progress { width: 100%; height: 9px; display: block; border: 0; border-radius: 0; color: var(--vermilion); background: var(--paper-deep); accent-color: var(--vermilion); }
.daily-progress::-webkit-progress-bar { background: var(--paper-deep); }
.daily-progress::-webkit-progress-value { background: var(--vermilion); }
.daily-progress::-moz-progress-bar { background: var(--vermilion); }

.section-route { display: grid; gap: 1.6rem; margin-top: 1.5rem; }
.study-section { position: relative; display: grid; grid-template-columns: minmax(210px, 0.34fr) minmax(0, 1fr); border: 1px solid var(--ink); border-top: 8px solid var(--topic-accent, var(--moss)); box-shadow: 6px 7px 0 rgba(23, 33, 29, 0.1); background: var(--paper-light); }
.study-section::before { content: ""; position: absolute; width: 56px; height: 18px; top: -26px; left: 18px; border: 1px solid var(--ink); border-bottom: 0; background: var(--topic-accent, var(--moss)); }
.study-section-header { padding: 1.45rem; border-right: 1px solid var(--line); background: var(--topic-tint, var(--moss-light)); }
.study-section-header h3 { margin-bottom: 0.7rem; font-size: clamp(1.5rem, 3vw, 2.35rem); }
.study-section-header h3 a { color: var(--ink); text-decoration: none; }
.study-section-header h3 a:hover { color: var(--topic-accent, var(--vermilion)); text-decoration: underline; }
.study-section-header p:not(.folio) { color: var(--ink-soft); font-size: 0.92rem; }
.section-time { display: inline-flex; margin-top: 1rem; padding: 0.2rem 0.45rem; border: 1px solid var(--topic-accent, var(--moss)); color: var(--topic-accent, var(--moss)); font-family: var(--mono); font-size: 0.64rem; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }
.assignment-stack { min-width: 0; display: grid; }
.assignment-card { min-width: 0; padding: 1.35rem 1.5rem; border-bottom: 1px solid var(--line); background: #fffdf7; }
.assignment-card:last-child { border-bottom: 0; }
.assignment-card.status-completed { box-shadow: inset 5px 0 0 var(--moss); }
.assignment-card.status-blocked { box-shadow: inset 5px 0 0 var(--vermilion); }
.assignment-card-header { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.assignment-card h3 { margin: 0; font-size: clamp(1.28rem, 2.5vw, 1.75rem); }
.assignment-card-actions { display: flex; align-items: center; justify-content: flex-end; gap: 0.6rem; flex: 0 0 auto; }
.assignment-complete-form { margin: 0; }
.assignment-complete-form label { display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer; color: var(--moss); font-family: var(--sans); font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; }
.assignment-complete-form input[type="checkbox"], .horizon-task-check input[type="checkbox"] { width: 1.05rem; height: 1.05rem; accent-color: var(--moss); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.assignment-kicker { display: flex; gap: 0.5rem; margin: 0 0 0.35rem; color: var(--vermilion); font-family: var(--mono); font-size: 0.65rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.completion-mark { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--moss); border-radius: 50%; color: var(--moss); font-family: var(--sans); font-weight: 800; }
.assignment-instructions { margin: 1rem 0; color: var(--ink-soft); overflow-wrap: anywhere; }

.material-stack { display: grid; margin: 1rem 0; border-top: 1px solid var(--line); }
.material-row { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; align-items: start; gap: 0.8rem; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.material-kind { display: inline-flex; width: max-content; max-width: 100%; padding: 0.16rem 0.35rem; color: var(--paper-light); background: var(--moss); font-family: var(--mono); font-size: 0.58rem; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }
.material-row a { color: var(--ink); font-weight: 650; overflow-wrap: anywhere; }
.material-row p { margin: 0.25rem 0 0; color: var(--ink-soft); font-size: 0.82rem; }
.material-row small, .library-item small { white-space: nowrap; color: var(--ink-soft); font-family: var(--mono); font-size: 0.63rem; }

.progress-drawer { margin-top: 1.05rem; border: 1px solid var(--line); background: rgba(239, 232, 213, 0.42); }
.progress-drawer summary { min-height: 46px; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.65rem 0.8rem; cursor: pointer; color: var(--moss); font-family: var(--sans); font-size: 0.76rem; font-weight: 750; list-style: none; }
.progress-drawer summary::-webkit-details-marker { display: none; }
.progress-drawer summary::after { content: "+"; color: var(--vermilion); font-family: var(--mono); font-size: 1.1rem; }
.progress-drawer[open] summary::after { content: "−"; }
.progress-drawer summary small { margin-left: auto; color: var(--ink-soft); font-family: var(--mono); font-size: 0.61rem; font-weight: 500; }
.progress-form { display: grid; gap: 0.9rem; padding: 1rem; border-top: 1px solid var(--line); background: var(--paper-light); }
.progress-form-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.progress-form .field textarea { min-height: 100px; resize: vertical; }
.progress-form .field textarea[name$="-blocker"] { min-height: 72px; }
.progress-form .button { justify-self: start; }
.plan-empty-state { margin-top: 0; }
.empty-actions { justify-content: center; }

/* A small field ledger for study that happened outside the scheduled route. */
.extra-study-ledger { margin-top: 3.6rem; padding-top: 2rem; border-top: 3px double var(--ink); }
.extra-study-heading { display: flex; align-items: end; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.35rem; }
.extra-study-heading > div { max-width: 730px; }
.extra-study-heading h2 { margin-bottom: 0.45rem; }
.extra-study-heading p:last-child { margin-bottom: 0; color: var(--ink-soft); }
.extra-study-count { flex: 0 0 auto; padding: 0.34rem 0.55rem; border: 1px solid var(--moss); color: var(--moss); background: var(--moss-light); font-family: var(--mono); font-size: 0.64rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; }
.extra-study-drawer { border: 1px solid var(--ink); background: var(--paper-light); }
.extra-study-drawer summary { min-height: 62px; display: flex; align-items: center; gap: 1rem; padding: 0.8rem 1rem; cursor: pointer; list-style: none; color: var(--ink); font-family: var(--sans); font-size: 0.84rem; font-weight: 800; }
.extra-study-drawer summary::-webkit-details-marker { display: none; }
.extra-study-drawer summary::before { content: "+"; width: 1.35rem; height: 1.35rem; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--vermilion); color: var(--vermilion); font-family: var(--mono); font-size: 1.08rem; font-weight: 500; line-height: 1; }
.extra-study-drawer[open] summary::before { content: "−"; }
.extra-study-drawer summary small { margin-left: auto; color: var(--ink-soft); font-family: var(--mono); font-size: 0.61rem; font-weight: 500; text-align: right; }
.extra-study-drawer-body { padding: 1.25rem; border-top: 1px solid var(--line); background: repeating-linear-gradient(#fffdf7, #fffdf7 31px, #d9e1dc 32px); }
.extra-study-form { display: grid; gap: 1rem; }
.extra-study-form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(130px, 0.56fr) minmax(118px, 0.3fr); gap: 1rem; }
.extra-study-title-field, .extra-study-source-field, .extra-study-takeaway-field { grid-column: 1 / -1; }
.extra-study-form .field textarea { min-height: 120px; background: rgba(255, 253, 247, 0.8); }
.extra-study-actions { display: flex; align-items: center; gap: 1.15rem; flex-wrap: wrap; padding-top: 0.95rem; border-top: 1px solid var(--line); }
.extra-study-actions p { max-width: 520px; margin: 0; color: var(--ink-soft); font-family: var(--sans); font-size: 0.72rem; line-height: 1.5; }
.extra-study-history { margin-top: 1.35rem; }
.extra-study-history-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 0.7rem; }
.extra-study-history-heading h3 { margin: 0; font-size: 1.03rem; }
.extra-study-history-heading span { color: var(--ink-soft); font-family: var(--mono); font-size: 0.62rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.extra-study-log-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border: 1px solid var(--ink); background: var(--paper-light); }
.extra-study-log-entry { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 1rem; padding: 1rem; border-bottom: 1px solid var(--line); }
.extra-study-log-entry:last-child { border-bottom: 0; }
.extra-study-log-mark { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--moss); color: var(--moss); font-family: var(--mono); font-size: 0.64rem; font-weight: 800; }
.extra-study-log-copy { min-width: 0; }
.extra-study-log-meta { display: flex; flex-wrap: wrap; gap: 0.35rem 0.65rem; margin: 0 0 0.25rem; color: var(--vermilion); font-family: var(--mono); font-size: 0.61rem; font-weight: 700; letter-spacing: 0.055em; text-transform: uppercase; }
.extra-study-log-meta span + span::before, .extra-study-log-meta time:not(:first-child)::before { content: "·"; margin-right: 0.65rem; color: var(--ink-soft); }
.extra-study-log-copy h4 { margin: 0; font-size: 1.15rem; line-height: 1.2; overflow-wrap: anywhere; }
.extra-study-source { display: inline-block; margin-top: 0.3rem; font-family: var(--sans); font-size: 0.76rem; font-weight: 750; overflow-wrap: anywhere; }
.extra-study-takeaway { margin: 0.55rem 0 0; color: var(--ink-soft); overflow-wrap: anywhere; }
.extra-study-empty { margin: 0; padding: 0.95rem 1rem; border-left: 5px solid var(--sun); background: rgba(230, 179, 77, 0.18); color: var(--ink-soft); font-family: var(--sans); font-size: 0.82rem; line-height: 1.55; }

.study-plan-heading { margin-bottom: 2rem; }
.date-navigator { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; margin-bottom: 1.6rem; padding: 0.65rem 0.8rem; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); font-family: var(--mono); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.date-navigator > :last-child { justify-self: end; }
.today-link { grid-column: 2; color: var(--vermilion); }
.plan-view-tabs { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: -0.65rem 0 1.15rem; }
.plan-view-tabs a { padding: 0.45rem 0.7rem; border: 1px solid var(--line); color: var(--ink-soft); background: var(--paper-light); font-family: var(--mono); font-size: 0.67rem; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; }
.plan-view-tabs a:hover, .plan-view-tabs a[aria-current="page"] { border-color: var(--moss); color: var(--paper-light); background: var(--moss); }
.horizon-navigator { margin-bottom: 1.3rem; }
.plan-horizon { margin-top: 0.5rem; }
.horizon-route { display: grid; gap: 1.2rem; margin-top: 1.5rem; }
.horizon-day { border: 1px solid var(--ink); background: var(--paper-light); box-shadow: 4px 5px 0 rgba(23, 33, 29, 0.08); }
.horizon-day.is-today { border-top: 7px solid var(--vermilion); }
.horizon-day.is-complete { border-top-color: var(--moss); }
.horizon-day-header { display: flex; align-items: end; justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); background: var(--moss-light); }
.horizon-day-header h2 { margin: 0.25rem 0 0; font-size: clamp(1.35rem, 3vw, 2rem); }
.horizon-day-header > span { color: var(--ink-soft); font-family: var(--mono); font-size: 0.65rem; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; text-align: right; }
.horizon-track { border-bottom: 1px solid var(--line); }
.horizon-track:last-child { border-bottom: 0; }
.horizon-track-heading { padding: 0.9rem 1.2rem 0.3rem; }
.horizon-track-heading h3 { margin: 0.2rem 0 0; font-size: 1.08rem; }
.horizon-task-list { display: grid; }
.horizon-task { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: start; gap: 0.75rem; padding: 0.9rem 1.2rem; border-top: 1px solid rgba(23, 33, 29, 0.1); background: #fffdf7; }
.horizon-task.is-complete { background: rgba(220, 228, 216, 0.42); }
.horizon-task-check { padding-top: 0.1rem; }
.horizon-task-check form { margin: 0; }
.horizon-check-mark { display: grid; place-items: center; width: 1.35rem; height: 1.35rem; border: 1px solid var(--moss); border-radius: 50%; color: var(--moss); font-weight: 800; }
.horizon-task-copy { min-width: 0; }
.horizon-task-copy h4 { margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
.horizon-task-copy > p:not(.horizon-task-meta) { margin: 0.25rem 0 0; color: var(--ink-soft); font-size: 0.8rem; line-height: 1.45; }
.horizon-task-meta { margin: 0.18rem 0 0; color: var(--vermilion); font-family: var(--mono); font-size: 0.6rem; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; }
.horizon-materials { display: flex; flex-wrap: wrap; gap: 0.35rem 0.8rem; margin-top: 0.4rem; font-size: 0.72rem; }
.horizon-materials a, .horizon-materials span { color: var(--ink); font-weight: 650; }
.horizon-task-day-link { align-self: start; color: var(--moss); font-family: var(--mono); font-size: 0.62rem; font-weight: 750; white-space: nowrap; }

.notebook-desk { margin: 0 0 4.5rem; padding: 2rem 0 0; border-top: 3px double var(--ink); }
.notebook-heading { align-items: end; }
.notebook-heading > div { max-width: 760px; }
.notebook-heading p:last-child { margin-bottom: 0; color: var(--ink-soft); }
.notebook-shelf { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.study-notebook { position: relative; min-width: 0; border: 1px solid var(--ink); border-top: 8px solid var(--topic-accent, var(--moss)); box-shadow: 5px 6px 0 rgba(23, 33, 29, 0.1); background: var(--paper-light); }
.study-notebook::before { content: ""; position: absolute; z-index: 1; top: -26px; left: 15px; width: 78px; height: 18px; border: 1px solid var(--ink); border-bottom: 0; background: var(--topic-accent, var(--moss)); pointer-events: none; }
.study-notebook summary { min-height: 138px; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 1rem; padding: 1.1rem 1rem 1.15rem 0; cursor: pointer; list-style: none; }
.study-notebook summary::-webkit-details-marker { display: none; }
.study-notebook summary::after { content: "+"; align-self: start; justify-self: end; color: var(--vermilion); font-family: var(--mono); font-size: 1.35rem; line-height: 1; }
.study-notebook[open] summary::after { content: "−"; }
.study-notebook summary:focus-visible { outline: 3px solid var(--vermilion); outline-offset: -3px; }
.notebook-tab { grid-row: 1 / span 2; display: grid; place-items: center; min-height: 100%; padding: 0.7rem 0; border-right: 1px solid var(--line); color: var(--topic-accent, var(--moss)); background: var(--topic-tint, var(--moss-light)); font-family: var(--mono); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; writing-mode: vertical-rl; transform: rotate(180deg); }
.notebook-summary-copy { min-width: 0; display: grid; align-content: center; gap: 0.27rem; }
.notebook-summary-copy .folio { margin: 0; color: var(--topic-accent, var(--moss)); font-size: 0.59rem; }
.notebook-summary-copy strong { overflow-wrap: anywhere; color: var(--ink); font-family: var(--serif); font-size: clamp(1.3rem, 2.5vw, 1.8rem); line-height: 0.97; }
.notebook-summary-copy small { color: var(--ink-soft); font-family: var(--sans); font-size: 0.72rem; }
.notebook-state { grid-column: 2; width: max-content; max-width: 100%; padding: 0.16rem 0.35rem; border: 1px solid var(--topic-accent, var(--moss)); color: var(--topic-accent, var(--moss)); font-family: var(--mono); font-size: 0.58rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.notebook-page { display: grid; gap: 1rem; padding: 1.1rem 1.2rem 1.25rem; border-top: 1px solid var(--line); background: repeating-linear-gradient(#fffdf7, #fffdf7 31px, #d9e1dc 32px); }
.notebook-page p { margin: 0; color: var(--ink-soft); font-size: 0.9rem; line-height: 1.6; }
.notebook-page form { display: contents; }
.notebook-page .button { justify-self: start; }
.notebook-page .quiet-link { justify-self: start; font-size: 0.78rem; }
.notebook-today { padding: 0.7rem; border-left: 4px solid var(--topic-accent, var(--moss)); background: rgba(255, 253, 247, 0.82); }
.notebook-note { font-size: 0.8rem !important; font-style: italic; }
.focus-badge { width: max-content; padding: 0.25rem 0.45rem; color: var(--paper-light); background: var(--topic-accent, var(--moss)); font-family: var(--mono); font-size: 0.62rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.core-notebook { box-shadow: 7px 8px 0 rgba(23, 33, 29, 0.14); }

/* Study Plan overview: the map stays calm while Today carries the detail. */
.study-plan-overview-heading { margin-bottom: 3.5rem; }
.study-plan-overview-heading > div { max-width: 820px; }
.study-plan-outline, .study-plan-route { margin-bottom: 4.5rem; }
.study-plan-topic-list { display: grid; gap: 1.25rem; }
.study-plan-topic { border: 1px solid var(--ink); border-top: 8px solid var(--topic-accent, var(--moss)); box-shadow: 5px 6px 0 rgba(23, 33, 29, 0.1); background: var(--paper-light); }
.study-plan-topic summary { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 1rem; align-items: center; min-height: 104px; padding: 1rem 1.2rem 1rem 0; cursor: pointer; list-style: none; }
.study-plan-topic summary::-webkit-details-marker { display: none; }
.study-plan-topic summary::after { content: "+"; align-self: start; justify-self: end; color: var(--vermilion); font-family: var(--mono); font-size: 1.35rem; line-height: 1; }
.study-plan-topic[open] summary::after { content: "−"; }
.study-plan-topic summary:focus-visible { outline: 3px solid var(--vermilion); outline-offset: -3px; }
.study-plan-topic-index { grid-row: 1 / span 3; display: grid; place-items: center; height: 100%; border-right: 1px solid var(--line); color: var(--topic-accent, var(--moss)); background: var(--topic-tint, var(--moss-light)); font-family: var(--mono); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.08em; }
.study-plan-topic summary > span:nth-child(2) { display: grid; gap: 0.25rem; }
.study-plan-topic summary .folio { color: var(--topic-accent, var(--moss)); }
.study-plan-topic summary strong { color: var(--ink); font-family: var(--serif); font-size: clamp(1.35rem, 2.8vw, 2rem); line-height: 1; }
.study-plan-topic summary small { color: var(--ink-soft); font-family: var(--sans); font-size: 0.74rem; }
.study-plan-topic-body { padding: 1.25rem 1.4rem 1.45rem; border-top: 1px solid var(--line); background: repeating-linear-gradient(#fffdf7, #fffdf7 31px, #d9e1dc 32px); }
.study-plan-topic-description { max-width: 760px; margin: 0 0 1.2rem; color: var(--ink-soft); }
.study-plan-class-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 1rem; }
.study-plan-class-card { display: flex; flex-direction: column; gap: 0.65rem; min-width: 0; padding: 1.1rem; border: 1px solid var(--ink); background: var(--paper-light); box-shadow: 3px 4px 0 rgba(23, 33, 29, 0.08); }
.study-plan-class-card h3, .study-plan-class-card p { margin: 0; }
.study-plan-class-card h3 { font-size: 1.35rem; }
.study-plan-class-card > p:not(.study-plan-class-title) { color: var(--ink-soft); font-size: 0.82rem; line-height: 1.45; }
.study-plan-class-card-topline, .study-plan-class-meta, .study-plan-class-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem 0.8rem; }
.study-plan-class-card-topline { justify-content: space-between; color: var(--ink-soft); font-family: var(--mono); font-size: 0.61rem; text-transform: uppercase; }
.study-plan-class-title { color: var(--ink-soft); font-family: var(--sans); font-size: 0.78rem; font-weight: 650; }
.study-plan-class-meta { margin-top: auto; color: var(--ink-soft); font-family: var(--mono); font-size: 0.61rem; }
.study-plan-class-actions { padding-top: 0.65rem; border-top: 1px solid var(--line); }
.study-plan-class-actions .quiet-link { font-size: 0.72rem; }
.study-plan-route-list { display: grid; gap: 0.8rem; margin: 0; padding: 0; list-style: none; }
.study-plan-route-item { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 1rem; align-items: center; padding: 1rem 1.2rem 1rem 0; border: 1px solid var(--ink); border-left: 7px solid var(--topic-accent, var(--moss)); background: var(--paper-light); }
.study-plan-route-number { display: grid; place-items: center; height: 100%; color: var(--topic-accent, var(--moss)); font-family: var(--mono); font-size: 0.76rem; font-weight: 800; }
.study-plan-route-item h3 { margin: 0.2rem 0 0.25rem; font-size: 1.15rem; }
.study-plan-route-item h3 a { color: var(--ink); }
.study-plan-route-item p:not(.folio):not(.study-plan-route-meta) { margin: 0; color: var(--ink-soft); font-size: 0.81rem; }
.study-plan-route-meta { margin: 0.45rem 0 0; color: var(--vermilion); font-family: var(--mono); font-size: 0.61rem; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; }
.study-plan-route-item > .quiet-link { white-space: nowrap; font-size: 0.72rem; }

.topic-shelf { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.topic-folder { position: relative; min-height: 270px; display: grid; grid-template-columns: 54px 1fr; border: 1px solid var(--ink); border-top: 8px solid var(--topic-accent, var(--moss)); box-shadow: var(--shadow); color: var(--ink); background: var(--paper-light); text-decoration: none; transition: transform 180ms ease, box-shadow 180ms ease; }
.topic-folder::before { content: ""; position: absolute; top: -27px; left: 18px; width: 75px; height: 19px; border: 1px solid var(--ink); border-bottom: 0; background: var(--topic-accent, var(--moss)); }
.topic-folder:hover { transform: translate(-3px, -3px); box-shadow: 11px 12px 0 rgba(23, 33, 29, 0.14); color: var(--ink); }
.topic-folder-tab { display: grid; place-items: center; border-right: 1px solid var(--line); color: var(--topic-accent, var(--moss)); background: var(--topic-tint, var(--moss-light)); font-family: var(--mono); font-size: 0.7rem; font-weight: 750; writing-mode: vertical-rl; transform: rotate(180deg); }
.topic-folder > div { align-self: end; padding: 1.4rem; }
.topic-folder h2 { margin: 0.2rem 0 0.7rem; font-size: clamp(1.8rem, 4vw, 3.2rem); overflow-wrap: anywhere; }
.topic-folder p:not(.folio) { color: var(--ink-soft); }
.topic-folder strong { color: var(--topic-accent, var(--vermilion)); font-family: var(--sans); font-size: 0.76rem; }

.topic-header { display: flex; justify-content: space-between; align-items: end; gap: 2rem; margin: -1rem 0 4rem; padding: clamp(1.5rem, 5vw, 3.5rem); border: 1px solid var(--ink); border-top: 10px solid var(--topic-accent, var(--moss)); box-shadow: var(--shadow); background: var(--topic-tint, var(--moss-light)); }
.topic-header > div:first-child { max-width: 800px; }
.topic-header h1 { margin-bottom: 0.8rem; }
.topic-header p:last-child { max-width: 700px; margin-bottom: 0; }
.topic-header-actions { display: grid; justify-items: end; gap: 1rem; }
.material-library, .assignment-history { margin-bottom: 4.5rem; }
.material-library .section-heading > span { font-family: var(--mono); font-size: 0.68rem; text-transform: uppercase; }
.library-list { border: 1px solid var(--ink); background: var(--paper-light); }
.library-item { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; align-items: start; gap: 1rem; padding: 1.15rem; border-bottom: 1px solid var(--line); }
.library-item:last-child { border-bottom: 0; }
.library-item h3 { margin-bottom: 0.25rem; font-size: 1.16rem; }
.library-item h3 a { color: var(--ink); }
.library-item p { margin: 0; color: var(--ink-soft); font-size: 0.9rem; }
.history-stack { border: 1px solid var(--ink); background: var(--paper-light); }
.history-date { padding: 0.5rem 1.5rem; border-top: 5px solid var(--moss); border-bottom: 1px solid var(--line); color: var(--moss); background: var(--moss-light); font-family: var(--mono); font-size: 0.66rem; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }
.history-date:first-child { border-top: 0; }
.compact-empty { padding: 2rem; }
.compact-empty p { margin-bottom: 0.7rem; }

/* Study cards: a physical tray of prompts, deliberately separate from writing notebooks. */
.card-tray-card { position: relative; overflow: hidden; color: var(--ink); background: var(--sun); }
.card-tray-card::before { content: "RECALL"; position: absolute; right: -0.42rem; top: 1.1rem; color: rgba(23, 33, 29, 0.14); font-family: var(--mono); font-size: clamp(2.4rem, 6vw, 5rem); font-weight: 800; letter-spacing: -0.08em; transform: rotate(90deg); transform-origin: top right; }
.card-tray-card .eyebrow, .card-tray-card strong { color: var(--ink); }
.card-collection-heading { align-items: end; margin-bottom: 2.2rem; }
.card-collection-heading > div { max-width: 790px; }
.card-collection-heading p:last-child { max-width: 750px; margin-bottom: 0; color: var(--ink-soft); }
.card-collection-guide { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(310px, 0.75fr); gap: clamp(1.5rem, 5vw, 4rem); margin-bottom: 4.5rem; padding: clamp(1.4rem, 4vw, 2.7rem); border: 1px solid var(--ink); border-left: 10px solid var(--sun); background: var(--paper-light); box-shadow: 6px 7px 0 rgba(23, 33, 29, 0.08); }
.card-collection-guide h2 { max-width: 700px; margin-bottom: 0.65rem; }
.card-collection-guide p:last-child { max-width: 710px; margin-bottom: 0; color: var(--ink-soft); }
.card-rhythm { display: grid; align-content: center; gap: 0; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.card-rhythm li { display: grid; grid-template-columns: 2.5rem 1fr; gap: 0.75rem; align-items: baseline; padding: 0.75rem 0; border-bottom: 1px solid var(--line); font-family: var(--sans); font-size: 0.82rem; font-weight: 700; }
.card-rhythm span { color: var(--vermilion); font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.06em; }
.card-collection { margin-bottom: 4.5rem; }
.deck-tray { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 285px), 1fr)); gap: 1.35rem; }
.deck-slip { position: relative; min-height: 360px; display: flex; flex-direction: column; padding: 1.25rem; border: 1px solid var(--ink); border-top: 8px solid var(--moss); box-shadow: 7px 8px 0 rgba(23, 33, 29, 0.11); background: #fffdf7; transition: transform 180ms ease, box-shadow 180ms ease; }
.deck-slip::before { content: ""; position: absolute; top: 0.9rem; right: 1rem; width: 42px; height: 14px; border: 1px solid rgba(23, 33, 29, 0.33); border-radius: 50%; opacity: 0.5; }
.deck-slip:hover { transform: translate(-3px, -3px) rotate(-0.35deg); box-shadow: 11px 12px 0 rgba(23, 33, 29, 0.15); }
.deck-slip.has-due-cards { border-top-color: var(--vermilion); }
.deck-slip-topline { display: flex; align-items: start; justify-content: space-between; gap: 1rem; padding-right: 3.8rem; }
.deck-index { color: var(--ink-soft); font-family: var(--mono); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; }
.due-stamp, .rest-stamp { display: inline-flex; max-width: 100%; padding: 0.2rem 0.4rem; border: 1px solid currentColor; font-family: var(--mono); font-size: 0.61rem; font-weight: 800; letter-spacing: 0.08em; line-height: 1.1; text-transform: uppercase; }
.due-stamp { color: var(--vermilion); background: #f7e2dc; }
.rest-stamp { color: var(--moss); background: var(--moss-light); }
.deck-slip-copy { flex: 1 1 auto; padding: 1.6rem 0 1.3rem; }
.deck-slip-copy .eyebrow { margin-bottom: 0.5rem; }
.deck-slip-copy h3 { margin-bottom: 0.65rem; font-size: clamp(1.65rem, 3vw, 2.35rem); }
.deck-slip-copy h3 a { color: var(--ink); text-decoration: none; }
.deck-slip-copy h3 a:hover { color: var(--vermilion); text-decoration: underline; }
.deck-slip-copy p:not(.eyebrow) { margin: 0; color: var(--ink-soft); font-size: 0.93rem; }
.deck-empty-description { font-style: italic; }
.deck-counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0; border: 1px solid var(--line); }
.deck-counts > div { min-width: 0; padding: 0.5rem 0.45rem; border-right: 1px solid var(--line); }
.deck-counts > div:last-child { border-right: 0; }
.deck-counts dt { color: var(--ink-soft); font-family: var(--mono); font-size: 0.57rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.deck-counts dd { margin: 0.1rem 0 0; color: var(--moss); font-family: var(--serif); font-size: 1.42rem; font-weight: 700; line-height: 1; }
.deck-slip.has-due-cards .deck-counts > div:first-child dd { color: var(--vermilion); }
.deck-slip-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.85rem; padding-top: 1.2rem; }
.deck-slip-actions .button { min-height: 40px; padding: 0.58rem 0.8rem; font-size: 0.7rem; }
.deck-slip-actions .quiet-link { font-size: 0.73rem; }
.card-empty-state { border-style: solid; border-top: 8px solid var(--sun); }
.starter-deck-panel { display: flex; align-items: center; justify-content: space-between; gap: 2rem; margin-top: -1rem; padding: clamp(1.35rem, 4vw, 2.5rem); border: 1px solid var(--ink); border-left: 10px solid var(--vermilion); background: #f5ddd5; }
.starter-deck-panel > div { max-width: 720px; }
.starter-deck-panel h2 { margin-bottom: 0.55rem; }
.starter-deck-panel p:last-child { margin-bottom: 0; color: #5d2a23; }
.starter-deck-panel form { flex: 0 0 auto; margin: 0; }

.deck-form-layout { display: grid; grid-template-columns: minmax(210px, 0.45fr) minmax(0, 1.15fr); gap: 1.5rem; align-items: start; width: min(970px, 100%); margin: 2rem auto 0; }
.card-form-margin { min-height: 250px; padding: 1.35rem; border: 1px solid var(--ink); border-top: 8px solid var(--sun); background: var(--moss-light); }
.card-form-margin h2 { margin-bottom: 0.8rem; font-size: clamp(1.55rem, 3vw, 2.25rem); }
.card-form-margin p:not(.eyebrow) { margin-bottom: 0; color: var(--ink-soft); font-size: 0.93rem; }
.deck-writing-form, .card-writing-form { margin-top: 0; box-shadow: var(--shadow); }
.card-writing-form .field textarea { min-height: 180px; }
.card-writing-form .field textarea[name$="front"] { min-height: 115px; }
.card-form-layout .card-writing-form { min-height: 100%; }

.deck-header { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; padding: clamp(1.5rem, 5vw, 3.5rem); border: 1px solid var(--ink); border-top: 10px solid var(--moss); box-shadow: var(--shadow); background: var(--moss-light); }
.deck-header > div:first-child { max-width: 790px; }
.deck-header h1 { margin-bottom: 0.8rem; }
.deck-header p:last-child { max-width: 720px; margin-bottom: 0; color: var(--ink-soft); }
.deck-header-actions { display: grid; justify-items: end; gap: 0.8rem; flex: 0 0 auto; }
.deck-ledger { display: grid; grid-template-columns: repeat(3, 1fr) minmax(150px, auto); margin-bottom: 4.5rem; border: 1px solid var(--ink); background: var(--paper-light); }
.deck-ledger > div { min-height: 112px; display: flex; flex-direction: column; justify-content: center; padding: 0.9rem 1.1rem; border-right: 1px solid var(--line); }
.deck-ledger > div:last-child { border-right: 0; }
.deck-ledger span, .deck-ledger small { font-family: var(--mono); font-size: 0.61rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; }
.deck-ledger span, .deck-ledger small { color: var(--ink-soft); }
.deck-ledger strong { margin: 0.18rem 0; color: var(--moss); font-family: var(--serif); font-size: 2.2rem; line-height: 1; }
.deck-ledger > div:first-child strong { color: var(--vermilion); }
.deck-ledger-action { align-items: center; justify-content: center; background: var(--paper-deep); font-family: var(--sans); font-size: 0.75rem; font-weight: 750; }
.deck-workbench, .card-catalog { margin-bottom: 4.5rem; }
.deck-workbench-grid { display: grid; grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1.58fr); gap: 1.5rem; align-items: start; }
.card-writing-margin { min-height: 100%; }
.card-writing-margin .quiet-link { display: inline-block; margin-top: 1.1rem; }

.card-import-export { margin-bottom: 4.5rem; border: 1px solid var(--ink); background: var(--paper-light); }
.card-import-export details > summary { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; padding: 1.25rem 1.35rem; cursor: pointer; list-style: none; }
.card-import-export details > summary::-webkit-details-marker { display: none; }
.card-import-export details > summary .eyebrow { display: block; margin-bottom: 0.28rem; }
.card-import-export details > summary strong { display: block; font-size: clamp(1.15rem, 2.5vw, 1.55rem); line-height: 1.1; }
.details-marker { color: var(--vermilion); font-family: var(--mono); font-size: 1.7rem; line-height: 1; }
.card-import-export details[open] .details-marker { transform: rotate(45deg); }
.import-export-body { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.92fr); gap: 1.5rem; padding: 1.5rem; border-top: 1px solid var(--line); background: repeating-linear-gradient(#fffdf7, #fffdf7 31px, #d9e1dc 32px); }
.import-export-note { padding: 0.6rem 0.5rem; }
.import-export-note h3 { margin-bottom: 0.6rem; font-size: 1.5rem; }
.import-export-note p { max-width: 650px; color: var(--ink-soft); font-size: 0.92rem; }
.import-export-note .button { margin-top: 0.35rem; }
.import-form-wrap { padding: 1.25rem; border: 1px solid var(--ink); background: rgba(251, 247, 236, 0.93); }
.import-cards-form { margin: 0; padding: 0; border: 0; background: transparent; }
.import-cards-form .field input[type="file"] { padding: 0.5rem; font-family: var(--sans); font-size: 0.78rem; }
.import-cards-form .button { justify-self: start; }

.card-index-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border: 1px solid var(--ink); background: var(--paper-light); }
.card-index-item { display: grid; grid-template-columns: 72px minmax(0, 1fr) minmax(100px, auto); gap: 1.2rem; align-items: start; padding: 1.2rem; border-bottom: 1px solid var(--line); }
.card-index-item:last-child { border-bottom: 0; }
.card-index-item:hover { background: rgba(220, 228, 216, 0.42); }
.card-index-item.is-suspended { opacity: 0.64; background: rgba(239, 232, 213, 0.64); }
.card-index-number { display: inline-grid; place-items: center; min-height: 36px; padding: 0.35rem; border: 1px solid var(--moss); color: var(--moss); font-family: var(--mono); font-size: 0.65rem; font-weight: 750; }
.card-index-copy h3 { margin: 0 0 0.5rem; color: var(--ink); font-size: 1.15rem; line-height: 1.35; }
.card-index-copy p { margin: 0; color: var(--ink-soft); font-size: 0.91rem; line-height: 1.55; }
.card-tags { display: inline-block; max-width: 100%; margin-top: 0.75rem; padding: 0.18rem 0.4rem; border: 1px solid var(--line); color: var(--moss); background: var(--moss-light); font-family: var(--mono); font-size: 0.62rem; font-weight: 700; letter-spacing: 0.04em; overflow-wrap: anywhere; }
.card-index-actions { display: grid; justify-items: end; gap: 0.75rem; min-width: 0; padding-top: 0.2rem; }
.card-index-actions .quiet-link { font-size: 0.76rem; white-space: nowrap; }

.review-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; width: min(950px, 100%); margin: 0 auto 2rem; }
.review-heading > div:first-child { max-width: 675px; }
.review-heading h1 { margin-bottom: 0.65rem; }
.review-heading p:last-child { margin-bottom: 0; color: var(--ink-soft); }
.review-queue-count { min-width: 145px; display: grid; justify-items: end; padding: 1rem 0 0.35rem; border-top: 4px solid var(--vermilion); color: var(--ink); }
.review-queue-count span, .review-queue-count small { color: var(--ink-soft); font-family: var(--mono); font-size: 0.62rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; }
.review-queue-count strong { color: var(--vermilion); font-size: 3.3rem; line-height: 0.92; }
.review-tray { width: min(900px, 100%); margin: 0 auto; padding: clamp(1.2rem, 4vw, 2.5rem); border: 1px solid var(--ink); border-top: 9px solid var(--ink); box-shadow: var(--shadow); background: #c9b99d; }
.review-context { display: flex; align-items: center; justify-content: space-between; gap: 0.7rem 1rem; flex-wrap: wrap; padding: 0 0 1rem; }
.review-context > p { width: 100%; margin: 0; color: #3e453f; font-family: var(--sans); font-size: 0.75rem; }
.review-state { display: inline-flex; padding: 0.2rem 0.42rem; color: var(--paper-light); background: var(--moss); font-family: var(--mono); font-size: 0.62rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.review-context .card-tags { margin: 0; background: rgba(251, 247, 236, 0.7); }
.review-flashcard { position: relative; min-height: 370px; perspective: 1400px; }
.flashcard-sheet { min-height: 370px; transition: transform 460ms cubic-bezier(.2,.72,.25,1); transform-style: preserve-3d; }
.flashcard-face { min-height: 370px; display: flex; flex-direction: column; padding: clamp(1.45rem, 5vw, 3.25rem); border: 1px solid var(--ink); background: #fffdf7; }
.flashcard-front { border-top: 12px solid var(--sun); }
.flashcard-back { border-top: 12px solid var(--moss); background: #edf2e8; }
.flashcard-side-label { margin: 0 0 auto; color: var(--vermilion); font-family: var(--mono); font-size: 0.65rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.flashcard-back .flashcard-side-label { color: var(--moss); }
.flashcard-copy { display: grid; align-content: center; flex: 1 1 auto; min-width: 0; padding: 1.6rem 0; overflow-wrap: anywhere; }
.flashcard-copy p { max-width: 720px; margin: 0; font-size: clamp(1.4rem, 3vw, 2.3rem); line-height: 1.26; overflow-wrap: anywhere; }
.flashcard-corner { align-self: end; color: rgba(23, 33, 29, 0.13); font-family: var(--serif); font-size: 4rem; font-weight: 700; line-height: 0.65; }
.review-reveal-row { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; padding: 1.25rem 0 0.2rem; }
.review-reveal-row p { max-width: 450px; margin: 0; color: #3e453f; font-family: var(--sans); font-size: 0.76rem; }
.flip-card-button { flex: 0 0 auto; }
kbd { display: inline-block; min-width: 1.45em; padding: 0.08rem 0.25rem; border: 1px solid currentColor; border-radius: 2px; font-family: var(--mono); font-size: 0.68em; font-weight: 700; line-height: 1.2; text-align: center; }
.rating-controls { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid rgba(23, 33, 29, 0.35); }
.rating-prompt { margin: 0 0 0.7rem; color: #3e453f; font-family: var(--sans); font-size: 0.78rem; font-weight: 750; }
.rating-buttons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.65rem; }
.rating-button { min-height: 92px; display: grid; align-content: center; justify-items: center; gap: 0.15rem; padding: 0.55rem; border: 1px solid var(--ink); color: var(--ink); background: #fffdf7; cursor: pointer; font-family: var(--sans); transition: transform 150ms ease, color 150ms ease, background 150ms ease; }
.rating-button:hover:not(:disabled) { transform: translateY(-2px); }
.rating-button:disabled { cursor: not-allowed; opacity: 0.5; }
.rating-button > span { font-size: 0.88rem; font-weight: 800; }
.rating-button small { color: var(--ink-soft); font-family: var(--sans); font-size: 0.65rem; }
.rating-button kbd { margin-bottom: 0.12rem; }
.rating-again { border-top: 6px solid var(--vermilion); }
.rating-hard { border-top: 6px solid #b87822; }
.rating-good { border-top: 6px solid var(--moss); }
.rating-easy { border-top: 6px solid #5683a3; }
.rating-again:hover:not(:disabled) { color: white; background: var(--vermilion); }
.rating-hard:hover:not(:disabled) { background: #f2dfb4; }
.rating-good:hover:not(:disabled) { color: white; background: var(--moss); }
.rating-easy:hover:not(:disabled) { color: white; background: #5683a3; }
.rating-help { margin: 0.85rem 0 0; color: #3e453f; font-family: var(--sans); font-size: 0.69rem; }
.review-empty-state { width: min(780px, 100%); margin: 0 auto; border-style: solid; border-top: 8px solid var(--sun); }

/* Progressive enhancement: no-JS readers see both sides and working rating controls. */
.js .review-flashcard { height: clamp(330px, 52vh, 520px); min-height: 0; }
.js .review-flashcard .flashcard-sheet { position: relative; height: 100%; min-height: 0; }
.js .review-flashcard .flashcard-face { position: absolute; inset: 0; width: 100%; min-height: 0; overflow: auto; overscroll-behavior: contain; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.js .review-flashcard .flashcard-back { transform: rotateY(180deg); }
.js .review-flashcard.is-revealed .flashcard-sheet { transform: rotateY(180deg); }

@media (max-width: 900px) {
  .site-header { grid-template-columns: 1fr auto; }
  .primary-nav { grid-column: 1 / -1; grid-row: 2; justify-content: center; padding-top: 0.7rem; border-top: 1px solid var(--line); }
  .login-layout { grid-template-columns: 1fr; }
  .login-intro { min-height: 390px; }
  .privacy-seal { position: relative; left: auto; bottom: auto; margin-top: 2rem; }
  .desk-grid, .document-grid, .settings-grid { grid-template-columns: 1fr; }
  .editor-form { grid-template-columns: 1fr; }
  .editor-meta { position: static; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .study-section { grid-template-columns: 1fr; }
  .study-section-header { border-right: 0; border-bottom: 1px solid var(--line); }
  .notebook-shelf { grid-template-columns: 1fr; }
  .topic-shelf { grid-template-columns: 1fr; }
  .bookshelf-intro { align-items: flex-start; flex-direction: column; }
  .card-collection-guide, .deck-form-layout, .deck-workbench-grid, .import-export-body { grid-template-columns: 1fr; }
  .deck-header, .review-heading { align-items: flex-start; flex-direction: column; }
  .deck-header-actions { justify-items: start; }
  .deck-ledger { grid-template-columns: repeat(3, 1fr); }
  .deck-ledger-action { grid-column: 1 / -1; min-height: 58px !important; }
  .review-queue-count { justify-items: start; }
  .extra-study-heading { align-items: flex-start; flex-direction: column; }
  .coach-layout { grid-template-columns: 1fr; }
  .coach-chat-intro { align-items: flex-start; flex-direction: column; }
  .coach-chat-intro > p { max-width: 600px; }
  .mock-interview-room { grid-template-columns: 1fr; }
  .mock-interview-stage, .mock-interview-brief { min-height: 0; }
  .mock-interview-stage { min-height: 500px; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .site-header { display: flex; flex-wrap: wrap; gap: 0.8rem; }
  .brand { flex: 1 0 100%; }
  .primary-nav { order: 3; width: 100%; justify-content: flex-start; overflow-x: auto; }
  .account-actions { width: 100%; justify-content: space-between; }
  .page-shell { width: min(100% - 1rem, 1180px); padding: 2rem 0; }
  .site-footer { flex-direction: column; }
  .home-hero, .page-heading, .document-header, .section-heading, .trash-list article { align-items: flex-start; flex-direction: column; }
  .morning-coach-note { grid-template-columns: 1fr; margin-top: -1.5rem; }
  .desk-card { min-height: 290px; }
  .filter-bar { grid-template-columns: 1fr; }
  .revision-list li { grid-template-columns: 60px 1fr; }
  .revision-list .status-stamp { grid-column: 2; }
  .writing-body { padding: 1.3rem 1rem; }
  .editor-actions { position: sticky; bottom: 0; margin: 0 -1.3rem -1.3rem; padding: 0.8rem 1rem max(0.8rem, env(safe-area-inset-bottom)); background: var(--paper-light); }
  .button { min-height: 48px; }
  .plan-summary { grid-template-columns: 1fr 1fr; }
  .plan-summary > div:nth-child(2) { border-right: 0; }
  .plan-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .study-section { box-shadow: 4px 5px 0 rgba(23, 33, 29, 0.1); }
  .assignment-card { padding: 1.1rem 0.9rem; }
  .material-row, .library-item { grid-template-columns: 1fr auto; }
  .material-row .material-kind, .library-item .material-kind { grid-column: 1 / -1; }
  .progress-form-meta { grid-template-columns: 1fr; }
  .progress-drawer summary { align-items: flex-start; }
  .progress-drawer summary small { display: none; }
  .extra-study-ledger { margin-top: 2.8rem; }
  .extra-study-drawer summary { align-items: flex-start; }
  .extra-study-drawer summary small { display: none; }
  .extra-study-drawer-body { padding: 1rem; }
  .extra-study-form-grid { grid-template-columns: 1fr; }
  .extra-study-log-entry { grid-template-columns: 38px minmax(0, 1fr); gap: 0.75rem; padding: 0.9rem; }
  .extra-study-log-mark { width: 30px; height: 30px; }
  .date-navigator { gap: 0.5rem; }
  .notebook-heading { align-items: flex-start; }
  .study-notebook summary { min-height: 118px; }
  .study-plan-route-item { grid-template-columns: 40px minmax(0, 1fr); gap: 0.75rem; padding-right: 0.9rem; }
  .study-plan-route-item > .quiet-link { grid-column: 2; }
  .topic-folder { grid-template-columns: 42px 1fr; }
  .topic-header { align-items: flex-start; flex-direction: column; margin-top: 0; }
  .topic-header-actions { justify-items: start; }
  .card-collection-heading { align-items: flex-start; }
  .card-collection-guide { margin-bottom: 3.5rem; }
  .starter-deck-panel, .review-reveal-row { align-items: flex-start; flex-direction: column; }
  .starter-deck-panel form { width: 100%; }
  .starter-deck-panel form .button { width: 100%; }
  .deck-slip { min-height: 330px; }
  .deck-ledger { grid-template-columns: 1fr 1fr; }
  .deck-ledger > div:nth-child(2) { border-right: 0; }
  .deck-ledger > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .deck-ledger > div:nth-child(3) { border-right: 1px solid var(--line); }
  .deck-ledger-action { grid-column: auto; }
  .horizon-day-header { align-items: flex-start; flex-direction: column; }
  .horizon-day-header > span { text-align: left; }
  .horizon-task { grid-template-columns: 30px minmax(0, 1fr); }
  .horizon-task-day-link { grid-column: 2; }
  .card-index-item { grid-template-columns: 52px minmax(0, 1fr); gap: 0.85rem; padding: 1rem; }
  .card-index-actions { grid-column: 2; justify-items: start; padding-top: 0; }
  .review-heading { margin-bottom: 1.4rem; }
  .review-tray { padding: 1rem; box-shadow: 5px 6px 0 rgba(23, 33, 29, 0.11); }
  .review-flashcard, .flashcard-sheet, .flashcard-face { min-height: 330px; }
  .js .review-flashcard { height: clamp(310px, 52vh, 430px); }
  .js .review-flashcard .flashcard-sheet { min-height: 0; }
  .rating-buttons { grid-template-columns: 1fr 1fr; }
  .rating-button { min-height: 78px; }
  .coach-chat-shell { min-height: 560px; }
  .coach-chat-shell openai-chatkit { min-height: 510px; }
  .mock-interview-stage { min-height: 460px; padding: 1rem; }
  .interviewer-avatar svg { width: 190px; height: 190px; }
  .interviewer-avatar-halo { width: 188px; height: 188px; }
  .mock-interview-loop li { grid-template-columns: 1fr; gap: 0.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

@media print {
  body { background: white; color: black; }
  .site-header, .site-footer, .no-print, .message-stack { display: none !important; }
  .page-shell { width: 100%; padding: 0; }
  .document-view { width: 100%; }
  .writing-body { min-height: 0; padding: 1rem 0; border: 0; background: white; }
  .document-header { margin-bottom: 1rem; }
}
