:root {
  --blue: #0e1e20;
  --blue-dark: #1b363b;
  --lime: #d4f770;
  --lime-dark: #c7e85a;
  --ink: #0e1e20;
  --muted: #616160;
  --line: #ded8cd;
  --canvas: #f8f5ee;
  --paper: #fffdf8;
  --green: #2e6b4b;
  --panel-shadow: 0 2px 4px rgb(14 30 32 / 7%);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Satoshi", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }

.brand { display: flex; align-items: center; gap: 6px; min-width: 0; color: inherit; text-decoration: none; }
.opus-logo { display: block; width: 111px; height: 31px; }

.content { min-height: 100vh; padding: 27px 24px 56px; }
.content-frame { width: min(100%, 704px); margin: 0 auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 44px; }
.site-link { color: var(--muted); font-size: 12px; text-decoration: none; }
.site-link:hover { color: var(--ink); }
.page-header { display: flex; align-items: flex-start; min-height: 42px; }
.inline-back { border: 0; background: transparent; color: #717988; }
.inline-back:hover { color: var(--ink); }
.page-title { text-align: left; }
.page-header > div:last-child { flex: 1; }
.page-title h1 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -.04em; line-height: 1.05; }
.page-title p { margin: 4px 0 0; color: #7d8492; font-size: 12px; }

.panel { border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: var(--panel-shadow); }
.a-player-guide { margin-top: 30px; padding: 28px 30px; border-radius: 16px; background: var(--blue); color: var(--canvas); }
.eyebrow { margin: 0 0 10px; color: var(--lime); font-size: 11px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.a-player-guide h2 { margin: 0; color: var(--canvas); font-size: 24px; letter-spacing: -.04em; }
.a-player-guide p { max-width: 640px; margin: 12px 0 0; color: #e8e1d5; line-height: 1.55; }
.guide-example { margin-top: 21px; padding: 15px 17px; border: 1px solid rgb(212 247 112 / 28%); border-radius: 11px; background: var(--blue-dark); }
.guide-example strong { color: var(--lime); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.guide-example p { margin-top: 6px; color: var(--canvas); }
.a-player-guide .guide-footnote { margin-top: 19px; color: #c0b5a1; font-size: 12px; }
.setup-panel, .question-panel { margin-top: 24px; padding: 32px; }
.setup-panel h2 { margin: 0; font-size: 19px; letter-spacing: -.035em; }
.panel-lede { margin: 7px 0 30px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px 16px; }
.field, .notes-field { display: grid; gap: 8px; color: #283044; font-size: 13px; font-weight: 500; }
.field b { color: #d94b58; }
.field small, .notes-field small { color: #8c92a0; font-weight: 400; }
.field input, .field select, .notes-field textarea { width: 100%; border: 1px solid #cfc8bb; border-radius: 9px; background: var(--paper); color: var(--ink); outline: 0; transition: border-color 120ms ease, box-shadow 120ms ease; }
.field input, .field select { height: 42px; padding: 0 14px; }
.field input::placeholder, .notes-field textarea::placeholder { color: #a8adb8; }
.field input:focus, .field select:focus, .notes-field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgb(212 247 112 / 32%); }
.panel-actions { display: flex; justify-content: flex-end; margin-top: 24px; }
.primary-button, .secondary-button { min-height: 41px; padding: 0 18px; border-radius: 7px; font-weight: 700; }
.primary-button { border: 1px solid var(--lime); background: var(--lime); color: var(--blue); }
.primary-button:hover:not(:disabled) { border-color: var(--lime-dark); background: var(--lime-dark); }
.primary-button:disabled { border-color: #b9c898; background: #b9c898; color: #f8f5ee; }
.primary-button span { margin-left: 12px; font-size: 20px; vertical-align: -1px; }
.secondary-button { border: 1px solid #d7d9e1; background: #fff; color: #4a5263; }
.secondary-button:hover { background: #f7f8fb; }

.question-panel { padding: 22px 32px 33px; }
.progress-head { display: flex; justify-content: space-between; color: #89909f; font-size: 12px; }
.progress-track { height: 6px; margin-top: 8px; overflow: hidden; border-radius: 99px; background: #ded8cd; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--lime); }
.prompt-card { margin-top: 26px; padding: 26px 24px 25px; border: 1px solid #e6dfd2; border-radius: 14px; background: #fbfaf5; }
.prompt-card h2 { margin: 0; font-size: 17px; line-height: 1.35; letter-spacing: -.025em; }
.prompt-card p { margin: 17px 0 0; color: #707785; font-size: 14px; line-height: 1.6; }
.answer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 25px; }
.answer-button { min-height: 48px; padding: 12px 14px; border: 2px solid #d7d0c2; border-radius: 7px; background: var(--paper); color: #364346; font-weight: 700; }
.answer-button:hover, .answer-button:focus-visible { border-color: var(--blue); color: var(--blue); outline: 0; }
.inline-back { margin-top: 22px; padding: 0; }

.review-panel { margin-top: 50px; padding: 32px; }
.score-panel { padding: 31px 24px 25px; text-align: center; }
.person-summary { display: grid; justify-items: center; gap: 3px; }
.person-avatar { color: #a8adb8; font-size: 30px; line-height: 1; }
.person-summary strong { font-size: 17px; }
.person-summary > span:last-child { color: #616160; font-size: 13px; }
.gpa { margin-top: 25px; color: var(--green); font-size: 64px; font-weight: 700; letter-spacing: -.06em; line-height: 1; }
.gpa-label { margin: 6px 0 18px; color: #9a9eaa; font-size: 13px; }
.grade-badges { display: flex; justify-content: center; gap: 8px; }
.grade-badge { padding: 6px 12px; border-radius: 99px; background: #e9f9a8; color: #264a2f; font-size: 13px; font-weight: 700; }
.grade-badge.secondary { background: #eee8dc; color: #364346; font-weight: 500; }
.grade-badge.grade-b { background: #f2dfbb; color: #71501d; }
.grade-badge.grade-c { background: #ffe1e1; color: #9a3e43; }
.callout { margin-top: 22px; padding: 17px 18px 18px; border: 1px solid #e1e4e9; border-radius: 12px; background: #f8fafb; color: #242a34; }
.callout strong { font-size: 14px; }
.callout p { margin: 8px 0 0; color: #646b77; font-size: 13px; line-height: 1.55; }
.breakdown-section { margin-top: 30px; }
.breakdown-section h2 { margin: 0 0 15px; font-size: 14px; }
.breakdown-list { overflow: hidden; border: 1px solid #e6dfd2; border-radius: 11px; background: var(--paper); }
.breakdown-row { min-height: 44px; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid #eee8dc; color: #616160; font-size: 13px; }
.breakdown-row:last-child { border-bottom: 0; }
.breakdown-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-pill { flex: 0 0 auto; padding: 5px 10px; border-radius: 99px; background: #e9f9a8; color: #315c36; font-size: 12px; }
.score-pill.score-b { background: #f2dfbb; color: #71501d; }
.score-pill.score-c { background: #ffe8e8; color: #9b4a4a; }
.notes-field { margin-top: 24px; }
.notes-field textarea { min-height: 86px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.review-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 20px; }
.history-panel { margin-top: 24px; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: var(--panel-shadow); }
.empty-history { color: var(--muted); }
.history-panel h2 { margin: 0; font-size: 17px; letter-spacing: -.03em; }
.empty-history p { margin: 8px 0 0; }
.history-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.history-heading > span { color: var(--muted); font-size: 12px; }
.history-list { margin-top: 14px; border: 1px solid #e6dfd2; border-radius: 11px; overflow: hidden; }
.history-row { min-height: 64px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid #eee8dc; }
.history-row:last-child { border-bottom: 0; }
.history-person { min-width: 0; display: grid; gap: 3px; }
.history-person strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-person span { color: var(--muted); font-size: 12px; }
.history-result { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; color: var(--muted); font-size: 12px; }
.history-result > span:first-child { color: var(--green); font-size: 15px; font-weight: 700; }
.history-open { padding: 5px 8px; border: 0; border-radius: 6px; background: var(--lime); color: var(--blue); font-size: 12px; font-weight: 700; }
.history-open:hover { background: var(--lime-dark); }

.toast { position: fixed; top: 18px; right: 20px; z-index: 20; padding: 12px 15px; border: 1px solid #d9d0c1; border-radius: 9px; background: var(--paper); box-shadow: 0 8px 28px rgb(14 30 32 / 16%); color: #273b3d; }

@media (max-width: 620px) {
  .content { padding: 20px 14px 100px; }
  .content-frame { width: 100%; }
  .topbar { margin-bottom: 34px; }
  .page-header { gap: 8px; }
  .page-title h1 { font-size: 19px; }
  .a-player-guide { margin-top: 26px; padding: 22px 18px 24px; }
  .a-player-guide h2 { font-size: 21px; }
  .setup-panel, .question-panel { margin-top: 20px; padding: 22px 18px 24px; }
  .form-grid, .answer-grid { grid-template-columns: 1fr; }
  .form-grid { gap: 14px; }
  .panel-actions { margin-top: 20px; }
  .primary-button { width: 100%; }
  .question-panel .answer-button { min-height: 45px; }
  .prompt-card { padding: 20px 17px; }
  .review-panel { margin-top: 34px; padding: 18px; }
  .score-panel { padding-inline: 16px; }
  .breakdown-row { align-items: flex-start; padding-inline: 12px; }
  .breakdown-row > span { white-space: normal; }
  .review-actions { flex-direction: column-reverse; }
  .secondary-button { width: 100%; }
  .history-panel { padding: 18px; }
  .history-heading { display: grid; gap: 4px; }
  .history-row { align-items: flex-start; padding: 12px; }
  .history-result { flex-wrap: wrap; justify-content: flex-end; }
}
