:root {
  --ink: #1a1716;
  --brass: #968863;
  --paper: #eae8df;
  --signal: #b12627;
  --sand: #d5cdaa;
  --white: #fffefa;
  --muted: #655f59;
  --line: 2px solid var(--ink);
  --shadow: 8px 8px 0 rgba(26, 23, 22, 0.12);
  font-family: "Montserrat", "Poppins", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(rgba(26, 23, 22, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(26, 23, 22, 0.035) 1px, transparent 1px), var(--paper);
  background-size: 24px 24px;
}
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; }
.skip-link { position: fixed; top: .75rem; left: .75rem; z-index: 20; padding: .75rem 1rem; color: var(--white); background: var(--ink); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.login-shell { width: min(1180px, calc(100% - 2rem)); min-height: 100vh; margin: 0 auto; display: grid; grid-template-rows: auto 1fr auto; }
.brand-bar, footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.5rem 0; font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.wordmark { display: inline-flex; align-items: center; gap: .75rem; color: inherit; text-decoration: none; font-size: .95rem; font-weight: 800; letter-spacing: .16em; }
.wordmark-mark { display: grid; width: 2.25rem; height: 2.25rem; place-items: center; border: var(--line); color: var(--paper); background: var(--ink); font-size: 1.1rem; }
.edition, footer { color: var(--muted); }
.machine { position: relative; align-self: center; width: min(100%, 560px); margin: 0 auto; padding: 2rem 0; }
.machine-part { position: relative; border: var(--line); background: var(--white); box-shadow: var(--shadow); }
.core-card { min-height: 460px; padding: clamp(2rem, 4vw, 3.5rem); display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; background: radial-gradient(circle at 82% 18%, rgba(213, 205, 170, .8), transparent 24%), var(--white); }
.core-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: .5rem; background: var(--signal); }
.eyebrow { color: var(--signal); font-size: .72rem; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.core-copy { position: relative; z-index: 2; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 9ch; margin-bottom: 1.5rem; font-size: clamp(2.4rem, 5vw, 4.4rem); line-height: .98; letter-spacing: -.06em; }
.core-copy p { max-width: 42rem; margin-bottom: 0; color: var(--muted); font-size: 1rem; line-height: 1.75; }
.core-index { position: absolute; right: 1.5rem; bottom: -1.5rem; color: rgba(26, 23, 22, .07); font-size: 9rem; font-weight: 800; line-height: 1; }
.access-card { padding: clamp(1.5rem, 4vw, 3rem); }
.access-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.access-heading h1, .session-panel h2 { max-width: none; margin: .55rem 0 0; font-size: clamp(1.65rem, 5vw, 2.35rem); line-height: 1.1; letter-spacing: -.04em; }
#login-form { display: grid; gap: 1rem; }
.field-card { min-height: 7rem; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; padding: 1rem 1.1rem; box-shadow: 4px 4px 0 rgba(26, 23, 22, .09); cursor: text; transition: transform 160ms ease, box-shadow 160ms ease; }
.field-card:focus-within { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--sand); }
.field-number { align-self: stretch; display: grid; min-width: 2.5rem; place-items: center; border-right: 1px solid var(--sand); color: var(--brass); font-size: .78rem; font-weight: 800; }
.field-body, .password-control { min-width: 0; }
.field-label { display: block; margin-bottom: .45rem; font-size: .75rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
input { width: 100%; border: 0; padding: .25rem 0; color: var(--ink); background: transparent; font-size: 1rem; }
input::placeholder { color: #8b857f; }
input:focus { outline: 0; }
.password-control { display: flex; align-items: center; gap: .5rem; }
.text-button { border: 0; padding: .35rem; color: var(--signal); background: transparent; font-size: .78rem; font-weight: 800; cursor: pointer; }
.form-message { min-height: 1.4rem; margin: 0; color: var(--signal); font-size: .86rem; font-weight: 600; line-height: 1.5; }
.form-message.success { color: #3f6746; }
.submit-button, .secondary-button { min-height: 3.75rem; border: var(--line); padding: 0 1.25rem; display: inline-flex; align-items: center; justify-content: space-between; gap: 1rem; font-weight: 800; cursor: pointer; transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease; }
.submit-button { color: var(--white); background: var(--signal); box-shadow: 5px 5px 0 var(--ink); }
.submit-button:hover:not(:disabled) { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); }
.submit-button:disabled { cursor: wait; opacity: .65; }
.secondary-button { color: var(--ink); background: var(--paper); }
.session-panel { min-height: 20rem; display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; padding: 2rem; border: var(--line); background: var(--sand); }
.session-panel[hidden] { display: none; }
.session-panel p { margin-top: 1rem; line-height: 1.6; }
.principle-card { min-height: 9rem; padding: 1.5rem 5.5rem 1.5rem 1.5rem; align-self: start; background: var(--sand); }
.principle-card p { margin: .75rem 0 0; font-size: 1.05rem; font-weight: 700; line-height: 1.5; }
.gear { display: grid; place-items: center; border: var(--line); border-radius: 50%; color: var(--ink); background: var(--paper); cursor: pointer; }
.gear span { display: block; line-height: 1; }
.gear-main { position: absolute; top: 2rem; right: 2rem; width: 5.5rem; height: 5.5rem; font-size: 4.6rem; }
.gear-small { flex: 0 0 auto; width: 3.2rem; height: 3.2rem; font-size: 2.55rem; }
.gear-field { border: 0; background: transparent; font-size: 2.2rem; }
.machine.is-running .gear span, .machine-part:hover .gear span, .gear:hover span, .gear:focus-visible span { animation: gear-turn 1.8s linear infinite; }
.machine.is-running .gear-reverse span, .machine-part:hover .gear-reverse span, .gear-reverse:hover span { animation-name: gear-turn-reverse; }
.connector { position: absolute; z-index: -1; height: 2px; background: var(--ink); transform-origin: left center; }
.connector::before, .connector::after { content: ""; position: absolute; top: 50%; width: .55rem; height: .55rem; border: 2px solid var(--ink); border-radius: 50%; background: var(--paper); transform: translateY(-50%); }
.connector::before { left: -.3rem; }
.connector::after { right: -.3rem; }
.connector-left { top: 53%; left: 34%; width: 24%; transform: rotate(-8deg); }
.connector-right { right: 36%; bottom: 17%; width: 20%; transform: rotate(8deg); }
footer { border-top: 1px solid rgba(26, 23, 22, .28); }
footer a { color: inherit; }
.catalog { align-self: center; padding: 2rem 0; }
.catalog-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; margin-bottom: 2rem; }
.catalog-heading h1 { max-width: none; margin: .55rem 0 0; font-size: clamp(2rem, 5vw, 3.7rem); }
.account-actions { display: flex; align-items: center; gap: 1rem; }
.account-name { font-size: .82rem; font-weight: 700; }
.compact-button { min-height: 2.8rem; padding: 0 1rem; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 360px)); gap: 1.5rem; }
.course-card { min-height: 220px; display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: 1fr auto; align-items: center; gap: 1.25rem; padding: 1.75rem; color: var(--ink); text-decoration: none; overflow: hidden; transition: transform 160ms ease, box-shadow 160ms ease; background: radial-gradient(circle at 78% 25%, rgba(213, 205, 170, .75), transparent 30%), var(--white); }
.course-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: .45rem; background: var(--signal); }
.course-card:hover { transform: translate(-3px, -3px); box-shadow: 12px 12px 0 rgba(26, 23, 22, .16); }
.course-card:hover .gear span { animation: gear-turn 1.8s linear infinite; }
.course-number { align-self: start; color: var(--brass); font-size: .78rem; font-weight: 800; }
.course-content strong { display: block; margin-top: .55rem; font-size: clamp(2.8rem, 8vw, 4.5rem); line-height: 1; letter-spacing: -.06em; }
.course-arrow { grid-column: 1 / -1; justify-self: end; color: var(--signal); font-size: 2rem; font-weight: 800; }
.cho-hub { align-self: center; padding: 2rem 0 3rem; }
.cho-heading { margin-bottom: 2rem; }
.cho-heading h1 { max-width: none; margin: .4rem 0 0; font-size: clamp(3.5rem, 9vw, 7rem); }
.module-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.module-card { min-height: 330px; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr auto auto; gap: 1.2rem; padding: 1.5rem; color: var(--ink); text-decoration: none; overflow: hidden; transition: transform 160ms ease, box-shadow 160ms ease; }
.module-card:nth-child(2) { background: var(--sand); }
.module-card:hover { transform: translate(-3px, -3px); box-shadow: 12px 12px 0 rgba(26, 23, 22, .16); }
.module-card:hover .gear span { animation: gear-turn 1.8s linear infinite; }
.module-card:hover .gear-reverse span { animation-name: gear-turn-reverse; }
.module-number { color: var(--brass); font-size: .78rem; font-weight: 800; }
.module-card strong { grid-column: 1 / -1; align-self: end; font-size: clamp(1.65rem, 3.2vw, 2.5rem); line-height: 1; letter-spacing: -.05em; }
.module-card p { grid-column: 1 / -1; min-height: 4.5rem; margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.55; }
.module-arrow { grid-column: 2; color: var(--signal); font-size: 1.8rem; font-weight: 800; }
@keyframes gear-turn { to { transform: rotate(360deg); } }
@keyframes gear-turn-reverse { to { transform: rotate(-360deg); } }

@media (max-width: 520px) {
  .login-shell { width: min(100% - 1rem, 1180px); }
  .edition, footer span:last-child { display: none; }
  .brand-bar { padding: 1rem 0; }
  .machine { gap: 1rem; padding: .5rem 0 1.5rem; }
  .access-card { padding: 1.25rem; }
  .field-card { grid-template-columns: auto minmax(0, 1fr); }
  .gear-field { display: none; }
  .catalog { padding: .5rem 0 1.5rem; }
  .catalog-heading { align-items: flex-start; flex-direction: column; margin-bottom: 1.25rem; }
  .account-actions { width: 100%; justify-content: space-between; }
  .course-grid { grid-template-columns: 1fr; }
  .course-card { min-height: 190px; }
  .cho-hub { padding: .5rem 0 1.5rem; }
  .module-grid { grid-template-columns: 1fr; }
  .module-card { min-height: 260px; }
  .brand-bar .account-name { display: none; }
}

@media (min-width: 521px) and (max-width: 900px) {
  .module-grid { grid-template-columns: 1fr; }
  .module-card { min-height: 240px; }
}

.analysis-page { padding: 2rem 0 4rem; }
.analysis-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.analysis-heading h1 { max-width: none; margin: .4rem 0 0; font-size: clamp(3rem, 7vw, 5.5rem); }
.back-link { color: var(--ink); font-size: .82rem; font-weight: 800; }
.exam-selector { display: grid; grid-template-columns: minmax(220px, .65fr) 1.35fr; gap: 2rem; padding: 1.5rem; }
.exam-selector h2, .report-card h2 { margin: .45rem 0 .65rem; font-size: clamp(1.45rem, 3vw, 2rem); letter-spacing: -.04em; }
.exam-selector p { margin: 0; color: var(--muted); line-height: 1.5; }
.exam-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.exam-option { display: flex; align-items: center; gap: .8rem; min-height: 4.3rem; padding: .8rem; border: 1px solid var(--ink); background: var(--paper); cursor: pointer; }
.exam-option input { flex: 0 0 auto; width: 1.25rem; height: 1.25rem; accent-color: var(--signal); }
.exam-option span { display: grid; gap: .15rem; }
.exam-option small { color: var(--muted); }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 1.5rem 0; }
.summary-card { min-height: 130px; display: flex; flex-direction: column; justify-content: space-between; padding: 1.15rem; }
.summary-card strong { color: var(--signal); font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: -.06em; }
.summary-card span { font-size: .78rem; font-weight: 700; line-height: 1.4; text-transform: uppercase; }
.analysis-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 1.25rem; margin-bottom: 1.25rem; }
.report-card { padding: clamp(1.25rem, 3vw, 2rem); margin-bottom: 1.25rem; }
.priority-card { background: var(--sand); }
.bar-list { display: grid; gap: 1.15rem; margin-top: 1.5rem; }
.bar-row > div:first-child { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .45rem; font-size: .78rem; }
.bar-row span { color: var(--muted); }
.bar-track { height: .7rem; border: 1px solid var(--ink); background: var(--paper); }
.bar-track span { display: block; height: 100%; background: var(--signal); }
.priority-list { margin: 1.25rem 0 0; padding: 0; list-style: none; }
.priority-list li { display: flex; gap: .8rem; padding: .9rem 0; border-top: 1px solid rgba(26, 23, 22, .25); }
.priority-list li > span { color: var(--signal); font-weight: 800; }
.priority-list div { display: grid; gap: .2rem; }
.priority-list small { color: var(--muted); line-height: 1.35; }
.report-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.source-label { max-width: 22rem; color: var(--muted); font-size: .72rem; font-weight: 700; text-align: right; }
.syllabus-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 1.25rem; }
.syllabus-grid article { padding: 1rem; border: 1px solid var(--ink); background: var(--paper); }
.syllabus-grid h3, .recommendation-grid h3 { margin: 0 0 .8rem; font-size: 1rem; }
.syllabus-grid ol { margin: 0; padding: 0; list-style: none; }
.syllabus-grid li { display: flex; justify-content: space-between; gap: .75rem; padding: .55rem 0; border-top: 1px solid var(--sand); font-size: .78rem; line-height: 1.35; }
.syllabus-grid li strong { color: var(--signal); }
.item-button { width: 100%; display: flex; justify-content: space-between; gap: .75rem; border: 0; padding: .2rem 0; color: var(--ink); background: transparent; text-align: left; cursor: pointer; }
.item-button:hover span, .item-button:focus-visible span { color: var(--signal); text-decoration: underline; }
.item-detail { scroll-margin-top: 1rem; background: var(--paper); }
.item-detail[hidden] { display: none; }
.detail-message { margin: .5rem 0 1.5rem; color: var(--muted); line-height: 1.5; }
.study-suggestions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.study-suggestions article { min-height: 170px; padding: 1rem; border: 1px solid var(--ink); background: var(--white); }
.study-suggestions h3 { margin: .6rem 0; font-size: 1rem; line-height: 1.35; }
.study-suggestions p, .study-suggestions a { color: var(--muted); font-size: .8rem; line-height: 1.5; }
.question-list { display: grid; gap: 1rem; }
.question-card { border: 1px solid var(--ink); background: var(--white); }
.question-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1rem; border-bottom: 1px solid var(--sand); }
.question-heading span { max-width: 60%; color: var(--muted); font-size: .75rem; text-align: right; }
.question-text { margin: 0; padding: 1.25rem; overflow-x: auto; white-space: pre-wrap; color: var(--ink); font: 500 .9rem/1.65 "Montserrat", sans-serif; }
.study-settings { display: grid; grid-template-columns: 1.3fr repeat(3, minmax(130px, .55fr)); gap: 1rem; align-items: end; padding: 1.5rem; }
.study-settings h2 { margin: .4rem 0 .5rem; font-size: 1.65rem; }
.study-settings p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.study-settings label { display: grid; gap: .45rem; font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.study-settings input, .study-settings select { min-height: 3rem; border: 1px solid var(--ink); padding: .65rem; background: var(--paper); }
.study-settings .submit-button { grid-column: 2 / -1; }
.plan-title { margin: 1.75rem 0 1rem; }
.plan-title h2 { margin: .4rem 0 0; font-size: clamp(1.5rem, 3vw, 2.2rem); }
.allocation-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.allocation-card { min-height: 180px; display: grid; grid-template-columns: 1fr auto; gap: .5rem; padding: 1.1rem; }
.allocation-card > span { color: var(--brass); font-size: .75rem; font-weight: 800; }
.allocation-card strong { grid-column: 1 / -1; align-self: end; font-size: 1rem; }
.allocation-card b { grid-column: 1 / -1; color: var(--signal); font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.06em; }
.allocation-card small { color: var(--muted); }
.weekly-schedule { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .75rem; margin-top: 1.25rem; }
.weekly-schedule article { min-height: 180px; padding: 1rem; border: 1px solid var(--ink); background: var(--paper); }
.weekly-schedule article > span { color: var(--brass); font-size: .72rem; font-weight: 800; }
.weekly-schedule h3 { margin: 1.4rem 0 .8rem; }
.weekly-schedule p { margin: .45rem 0; color: var(--muted); font-size: .75rem; line-height: 1.45; }
.weekly-schedule p strong { color: var(--ink); }
.cycle-phases { display: grid; gap: .7rem; margin-top: 1rem; }
.cycle-phases article { display: grid; grid-template-columns: minmax(110px, .55fr) 1fr; gap: .25rem 1rem; padding-top: .7rem; border-top: 1px solid var(--sand); }
.cycle-phases span { grid-row: span 2; color: var(--signal); font-size: .75rem; font-weight: 800; }
.cycle-phases p { margin: 0; color: var(--muted); font-size: .78rem; }
.study-focus { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 1.25rem; }
.study-focus article { padding: 1rem; border: 1px solid var(--ink); background: var(--paper); }
.study-focus h3 { margin: 0 0 .8rem; }
.study-focus ol { margin: 0 0 1rem; padding: 0; list-style: none; }
.study-focus li { display: flex; justify-content: space-between; gap: .8rem; padding: .55rem 0; border-top: 1px solid var(--sand); font-size: .76rem; }
.study-focus li strong { color: var(--signal); white-space: nowrap; }
.study-focus a { color: var(--ink); font-size: .76rem; font-weight: 800; }
.recommendations { background: var(--ink); color: var(--white); }
.recommendation-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: 1.5rem; }
.recommendation-grid article { min-height: 210px; padding: 1rem; border: 1px solid var(--brass); }
.recommendation-grid p { color: var(--sand); font-size: .82rem; line-height: 1.55; }
.recommendation-grid a { color: var(--white); font-size: .78rem; font-weight: 800; }
.recommendation-index { display: block; margin-bottom: 2rem; color: var(--brass); font-size: .75rem; font-weight: 800; }
.simulation-setup { display: grid; grid-template-columns: .8fr 1.2fr; gap: 2rem; padding: clamp(1.25rem, 3vw, 2rem); margin-bottom: 1.5rem; }
.simulation-setup h2 { margin: .45rem 0 .8rem; font-size: clamp(1.5rem, 3vw, 2.2rem); }
.simulation-setup p { color: var(--muted); line-height: 1.55; }
.simulation-setup form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.simulation-setup label { display: grid; gap: .45rem; font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.simulation-setup select { min-height: 3.2rem; border: 1px solid var(--ink); padding: .65rem; background: var(--paper); }
.simulation-setup .submit-button { grid-column: 1 / -1; }
.simulation-progress { position: sticky; top: .5rem; z-index: 10; padding: 1rem; margin-bottom: 1.25rem; }
.simulation-progress > div:first-child { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .6rem; font-size: .78rem; }
.simulation-questions { display: grid; gap: 1.25rem; }
.simulation-question { overflow: hidden; }
.question-context { display: grid; gap: .25rem; padding: 1rem 1.25rem 0; }
.question-context span { color: var(--signal); font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.question-context small { color: var(--muted); }
.simulation-question fieldset { display: grid; grid-template-columns: repeat(4, 1fr); gap: .65rem; margin: 0; padding: 1.25rem; border: 0; border-top: 1px solid var(--sand); }
.simulation-question legend { padding-top: 1rem; font-size: .75rem; font-weight: 800; }
.simulation-question fieldset label { display: flex; align-items: center; justify-content: center; min-height: 3.25rem; border: 1px solid var(--ink); background: var(--paper); cursor: pointer; }
.simulation-question fieldset input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.simulation-question fieldset label:has(input:checked) { color: var(--white); background: var(--signal); }
.simulation-finish { width: min(100%, 420px); margin: 1rem 0 2rem auto; }
.result-summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: clamp(1.5rem, 4vw, 2.5rem); margin-bottom: 1.5rem; background: var(--sand); }
.result-summary h2 { margin: .5rem 0 0; font-size: clamp(2rem, 5vw, 3.5rem); }
.result-summary p { margin: .3rem 0 0; }
.result-summary > strong { color: var(--signal); font-size: clamp(3rem, 9vw, 7rem); letter-spacing: -.08em; }
.correction-card.correct { border-left: .5rem solid #3f6746; }
.correction-card.incorrect { border-left: .5rem solid var(--signal); }
.answer-review { display: grid; grid-template-columns: repeat(2, auto) 1fr; gap: 1rem; padding: 1rem 1.25rem; border-top: 1px solid var(--sand); font-size: .8rem; }
.answer-review small { color: var(--muted); text-align: right; }
.simulation-history { margin-top: 1.25rem; }
.history-row { width: 100%; display: grid; grid-template-columns: 120px 80px 1fr; align-items: center; gap: 1rem; border: 0; border-top: 1px solid var(--sand); padding: .8rem 0; color: var(--ink); background: transparent; text-align: left; cursor: pointer; }
.history-row > span:first-child { display: flex; align-items: baseline; gap: .6rem; }
.history-row strong { color: var(--signal); font-size: 1.25rem; }
.history-row small { color: var(--muted); }
.resolution-action { display: flex; justify-content: flex-end; padding: 0 1.25rem 1.25rem; }
.resolution-action button:disabled { cursor: wait; opacity: .65; }
.resolution-dialog { width: min(720px, calc(100% - 1rem)); max-height: calc(100vh - 2rem); border: var(--line); padding: clamp(1.25rem, 4vw, 2rem); color: var(--ink); background: var(--white); box-shadow: 12px 12px 0 rgba(26,23,22,.3); }
.resolution-dialog::backdrop { background: rgba(26,23,22,.72); }
.resolution-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.resolution-heading h2 { margin: .45rem 0 0; font-size: clamp(1.5rem, 4vw, 2.2rem); }
.resolution-alert { padding: 1rem; margin-bottom: 1.25rem; border: 2px solid; }
.resolution-alert p { margin: .4rem 0 0; font-size: .85rem; line-height: 1.5; }
.resolution-alert.agrees { border-color: #3f6746; background: #edf4ed; }
.resolution-alert.warning { border-color: var(--brass); background: var(--paper); }
.resolution-alert.diverges { border-color: var(--signal); background: #f8e8e5; }
.resolution-content ol { display: grid; gap: .75rem; padding-left: 1.4rem; line-height: 1.55; }
.resolution-content h3 { margin: 1.5rem 0 .5rem; }
.resolution-content p { line-height: 1.6; }
.resolution-content small, .resolution-caveat { color: var(--muted); }
.support-text { margin: 1rem 1.25rem 0; border: 1px solid var(--brass); background: var(--paper); }
.support-text summary { padding: .85rem 1rem; color: var(--signal); font-size: .76rem; font-weight: 800; cursor: pointer; }
.support-text pre { max-height: 55vh; margin: 0; padding: 1rem; overflow: auto; border-top: 1px solid var(--sand); white-space: pre-wrap; font: 500 .86rem/1.65 "Montserrat", sans-serif; }
.resolution-source { margin: .75rem 0 1.25rem; border: 1px solid var(--brass); background: var(--paper); }
.resolution-source > strong, .resolution-source > small { display: block; padding: .75rem 1rem 0; }
.resolution-source > strong { color: var(--signal); }
.resolution-source > small { color: var(--muted); line-height: 1.45; }
.resolution-source blockquote { margin: .75rem 0 0; padding: 1rem; border-top: 1px solid var(--sand); font-size: .84rem; line-height: 1.65; white-space: pre-wrap; }
.resolution-analysis-label { margin-top: 1.5rem; }

@media (max-width: 900px) {
  .summary-grid, .recommendation-grid { grid-template-columns: repeat(2, 1fr); }
  .analysis-grid, .exam-selector { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .analysis-page { padding: .5rem 0 2rem; }
  .analysis-heading { align-items: flex-start; flex-direction: column; }
  .exam-options, .summary-grid, .syllabus-grid, .recommendation-grid { grid-template-columns: 1fr; }
  .summary-card { min-height: 105px; }
  .report-heading { display: block; }
  .source-label { display: block; margin-top: .5rem; text-align: left; }
  .study-suggestions { grid-template-columns: 1fr; }
  .question-heading { display: grid; }
  .question-heading span { max-width: none; text-align: left; }
  .study-settings, .allocation-grid, .study-focus { grid-template-columns: 1fr; }
  .study-settings .submit-button { grid-column: auto; }
  .plan-title { display: grid; }
  .simulation-setup, .simulation-setup form { grid-template-columns: 1fr; }
  .simulation-setup .submit-button { grid-column: auto; }
  .simulation-question fieldset { grid-template-columns: repeat(2, 1fr); }
  .result-summary { align-items: flex-start; }
  .answer-review { grid-template-columns: 1fr 1fr; }
  .answer-review small { grid-column: 1 / -1; text-align: left; }
  .history-row { grid-template-columns: 1fr auto; }
  .history-row > span:last-child { grid-column: 1 / -1; }
  .resolution-heading { display: grid; }
  .resolution-heading .text-button { justify-self: start; }
}

@media (min-width: 521px) and (max-width: 980px) {
  .study-settings { grid-template-columns: repeat(3, 1fr); }
  .study-settings > div { grid-column: 1 / -1; }
  .allocation-grid { grid-template-columns: repeat(2, 1fr); }
}

@media print {
  .brand-bar, footer, .study-settings, .back-link, #print-plan { display: none !important; }
  body { background: white; }
  .login-shell { width: 100%; }
  .machine-part { box-shadow: none; break-inside: avoid; }
}

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