:root { color-scheme: dark; --bg: #101918; --panel: #172220; --line: #34443c; --text: #e7e9dd; --muted: #a4b3aa; --mint: #bbd5a8; --gold: #d1b982; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-synthesis: none; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(ellipse at 90% 5%, #33473535, transparent 40%), var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a, button, input, select { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 4px; }
[hidden] { display: none !important; }
p { line-height: 1.7; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-weight: 400; }
h1 { font: 56px/1.14 Georgia, serif; letter-spacing: -1.8px; margin-bottom: 24px; }
h1 em, h2 em { color: var(--mint); font-weight: 400; }
h2 { font: 27px/1.25 Georgia, serif; }
h3 { font: 23px/1.3 Georgia, serif; }
.skip-link { position: fixed; z-index: 10; left: 12px; top: 12px; transform: translateY(-180%); padding: 14px; background: var(--mint); color: var(--bg); }
.skip-link:focus { transform: translateY(0); }
.site-header, .page, .site-footer { width: min(1200px, 100%); margin-inline: auto; padding-inline: 40px; }
.site-header { min-height: 90px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.brand { font: 23px Georgia, serif; display: flex; align-items: center; gap: 12px; }
.brand > span { font-size: 36px; color: var(--gold); }
.account-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 22px; font-size: 12px; color: var(--muted); }
.username { max-width: 160px; overflow-wrap: anywhere; color: var(--mint); }
.page { flex: 1; padding-bottom: 64px; }
.tabs { display: flex; flex-wrap: wrap; gap: 28px; border-bottom: 1px solid var(--line); font-size: 12px; }
.tabs a { padding-block: 22px; border-bottom: 2px solid transparent; color: var(--muted); }
.tabs a[aria-current] { border-color: var(--mint); color: var(--mint); }
.tabs .add-link { margin-left: auto; color: var(--mint); }
.hero { padding-block: 64px 52px; display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.eyebrow { color: var(--gold); font-size: 10px; font-weight: 600; letter-spacing: 2px; margin-bottom: 22px; }
.intro { color: var(--muted); font-size: 15px; line-height: 1.8; max-width: 570px; }
.hero-note { min-width: 235px; padding: 28px; border: 1px solid var(--line); border-radius: 3px 32px 3px 3px; background: #bbd5a805; display: flex; flex-direction: column; }
.hero-note .eyebrow { margin-bottom: 8px; }
.hero-note strong { font: 84px/1.2 Georgia, serif; color: var(--mint); }
.hero-note > span:not(.eyebrow) { font: 18px Georgia, serif; margin-top: 8px; }
.hero-note small { font-size: 10px; color: var(--muted); margin-top: 24px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.section-heading h2 { margin: 0; }
.section-heading > span { font-size: 9px; letter-spacing: 1.4px; color: var(--muted); }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.mode-card { display: flex; align-items: flex-start; gap: 20px; padding: 27px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); transition: border-color .15s ease, background .15s ease; }
.mode-card:hover { border-color: var(--mint); background: #1c2b24; }
.mode-number { font: italic 28px Georgia, serif; color: var(--gold); }
.mode-card h3 { font-size: 22px; margin-bottom: 10px; }
.mode-card p { font-size: 12px; color: var(--muted); margin: 0; }
.arrow { color: var(--mint); font-size: 22px; margin-left: auto; }
.collection { margin-top: 54px; }
.count { font: 12px -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; vertical-align: middle; color: var(--muted); margin-left: 10px; }
.inline-link { color: var(--mint); font-size: 12px; text-decoration: underline; text-underline-offset: 4px; }
.filters { display: flex; align-items: flex-end; gap: 14px; padding-bottom: 26px; }
.field { margin-bottom: 20px; min-width: 0; }
.field label { display: block; font-size: 12px; margin-bottom: 9px; color: var(--text); }
input, select { width: 100%; min-height: 44px; padding: 11px 13px; background: #101918; color: var(--text); border: 1px solid #536158; border-radius: 5px; font-size: 14px; }
input::placeholder { color: #94a298; opacity: 1; }
input[aria-invalid] { border-color: #e0a19a; }
.autocomplete { position: relative; }
.suggestions-popup { position: absolute; z-index: 5; top: calc(100% + 6px); inset-inline: 0; padding: 4px; border: 1px solid var(--line); border-radius: 5px; background: var(--bg); box-shadow: 0 8px 24px #0006; }
.suggestions-popup .help-text { margin: 6px 8px; }
.suggestions { margin: 0; padding: 0; list-style: none; max-height: 224px; overflow-y: auto; }
.suggestions [role="option"] { display: flex; align-items: center; min-height: 44px; padding: 10px; border-radius: 3px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; cursor: pointer; }
.suggestions [role="option"]:hover, .suggestions [aria-selected="true"] { background: #bbd5a81c; color: var(--mint); }
.filters .field { margin: 0; }
.search-field { flex: 1; }
.filters > .inline-link { align-self: center; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 18px; padding: 13px 20px; min-height: 44px; border: 1px solid var(--mint); border-radius: 5px; color: var(--bg); background: var(--mint); font-size: 12px; font-weight: 600; text-align: center; line-height: 1.4; }
.button:hover { filter: brightness(1.08); }
.button.secondary { color: var(--mint); background: transparent; border-color: #536158; }
.button.small { padding: 10px 15px; }
.button.danger { background: #e0a19a; border-color: #e0a19a; }
.text-button { border: 0; background: none; color: var(--muted); padding: 12px 0; font-size: 12px; }
.text-button:hover, .account-nav a:hover, .card-actions a:hover { color: var(--mint); }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.memory-card { min-width: 0; padding: 24px; border: 1px solid var(--line); background: #17222075; border-radius: 8px; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 25px; }
.badge { display: inline-flex; border: 1px solid #c4ad764a; padding: 5px 9px; color: var(--gold); background: #c4ad7608; font-size: 10px; border-radius: 4px; }
.badge.person { color: var(--mint); border-color: #bbd5a83d; background: #bbd5a808; }
.card-id { font-size: 10px; color: var(--muted); }
.card-date { font: 30px/1.25 Georgia, serif; color: var(--mint); margin-bottom: 6px; }
.date-caption { color: var(--muted); font-size: 10px; margin-bottom: 23px; }
.memory-card h3 { margin-bottom: 8px; }
.card-author { color: var(--muted); font-size: 12px; margin-bottom: 0; }
.card-actions { margin-top: auto; padding-top: 24px; display: flex; flex-wrap: wrap; gap: 16px; font-size: 11px; color: var(--muted); }
.library-note { font-size: 12px; color: var(--muted); margin-top: 26px; }
.library-note a { color: var(--mint); text-decoration: underline; text-underline-offset: 3px; }
.pagination { display: flex; justify-content: center; gap: 22px; align-items: center; font-size: 12px; margin-top: 24px; }
.empty-state { grid-column: 1 / -1; text-align: center; padding: 36px; color: var(--muted); }
.empty-state h2, .empty-state h3 { color: var(--text); }
.form-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 70px; align-items: start; padding-top: 64px; }
.form-intro h1 { font-size: 52px; }
.panel { padding: 32px; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; min-width: 0; }
.panel h2 { margin-bottom: 26px; }
.note { border-top: 1px solid var(--line); margin-top: 38px; padding-top: 28px; }
.note h2 { font-size: 24px; }
.note p { font-size: 13px; color: var(--muted); }
.note strong { font-weight: 500; color: var(--text); }
.help-text { color: var(--muted); font-size: 11px; line-height: 1.7; margin-top: 8px; margin-bottom: 0; }
.help-text ul { padding-left: 18px; }
.errorlist { color: #f2b4ab; font-size: 12px; padding-left: 20px; line-height: 1.6; }
.messages { border-left: 2px solid var(--mint); padding: 12px 20px; margin-top: 24px; background: var(--panel); color: var(--mint); font-size: 13px; overflow-wrap: anywhere; }
.messages p { margin: 0; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 22px; margin-top: 24px; }
.narrow { max-width: 640px; margin: 50px auto 0; }
.narrow h1 { font-size: 35px; }
.quiz-heading { text-align: center; margin-top: 52px; }
.quiz-heading h1 { font-size: 44px; }
.quiz-heading .intro { margin-inline: auto; }
.quiz-filter { display: flex; gap: 12px; align-items: center; justify-content: center; margin-block: 26px; }
.quiz-filter label { font-size: 12px; color: var(--muted); }
.quiz-filter select { width: auto; }
.quiz-panel { width: min(650px, 100%); margin: 0 auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.quiz-progress { display: flex; justify-content: space-between; padding: 18px 28px; font-size: 10px; letter-spacing: 1px; color: var(--muted); }
progress { display: block; width: 100%; height: 3px; border: 0; background: var(--line); color: var(--mint); }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--mint); }
progress::-moz-progress-bar { background: var(--mint); }
.question { text-align: center; padding: 35px 30px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.question .eyebrow { margin: 20px 0 14px; font-size: 9px; }
.question h2 { font-size: 37px; margin-bottom: 0; }
.answer-form { padding: 30px; }
.correction { margin: 28px 30px 0; padding: 24px; border: 1px solid #c4ad7666; background: #c4ad7608; border-radius: 6px; overflow-wrap: anywhere; }
.correction.correct { border-color: #bbd5a870; background: #bbd5a808; }
.correction h3 { font: 15px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: var(--gold); margin-bottom: 20px; }
.correction.correct h3 { color: var(--mint); }
.correction .answer-title { font: 25px/1.3 Georgia, serif; margin-bottom: 8px; }
.correction > p:not(.answer-title) { font-size: 14px; color: var(--muted); }
.answer-checks { padding: 0; list-style: none; margin: 22px 0; }
.answer-checks li { border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 12px 0; font-size: 12px; line-height: 1.7; }
.check-label { color: var(--muted); }
.wrong-answer { display: block; color: #f2b4ab; margin-bottom: 4px; }
.quiz-actions { padding: 25px 30px 30px; }
.restart-form { text-align: center; margin-top: 18px; }
.complete { text-align: center; }
.complete .score-large { font: 88px Georgia, serif; color: var(--mint); margin: 32px 0 0; }
.score-large span { font-size: 35px; color: var(--muted); }
.complete > p:not(.score-large):not(.eyebrow) { color: var(--muted); font-size: 13px; }
.complete .button { margin-block: 22px; }
.complete > a { display: block; }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 90px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
@media (max-width: 950px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-note { min-width: 205px; }
  .hero h1 { font-size: 45px; }
  .mode-card { padding: 22px; gap: 14px; }
  .form-layout { gap: 32px; }
  .form-intro h1 { font-size: 43px; }
}
@media (max-width: 650px) {
  .site-header, .page, .site-footer { padding-inline: 20px; }
  .site-header { padding-block: 17px; min-height: 80px; flex-wrap: wrap; gap: 8px; }
  .brand { font-size: 21px; }
  .account-nav { gap: 18px; font-size: 11px; }
  .tabs { gap: 0 20px; justify-content: space-between; }
  .tabs a { padding-block: 16px; font-size: 11px; }
  .tabs .add-link { margin-left: 0; }
  .hero { padding-block: 40px 28px; }
  .hero h1 { font-size: 40px; }
  .hero-note { display: none; }
  .intro { font-size: 14px; }
  .eyebrow { font-size: 9px; }
  .section-heading { align-items: flex-start; flex-wrap: wrap; gap: 12px; }
  .section-heading h2 { font-size: 24px; }
  .mode-grid, .card-grid, .form-layout { grid-template-columns: 1fr; }
  .mode-card { padding: 22px; }
  .collection { margin-top: 38px; }
  .filters { flex-wrap: wrap; gap: 12px; }
  .filters > .field { width: 100%; flex: auto; }
  .card-date { font-size: 34px; }
  .memory-card { padding: 24px; }
  .card-top { margin-bottom: 20px; }
  .form-layout { padding-top: 38px; gap: 24px; }
  .form-intro h1 { font-size: 42px; }
  .note { margin-top: 24px; padding-top: 20px; }
  .panel { padding: 24px; }
  .quiz-heading { margin-top: 36px; }
  .quiz-heading h1 { font-size: 36px; }
  .quiz-filter { gap: 8px; }
  .quiz-filter select { max-width: 160px; }
  .quiz-progress { padding: 17px 20px; font-size: 9px; }
  .question { padding: 28px 20px; }
  .question h2 { font-size: 32px; }
  .answer-form, .quiz-actions { padding: 24px 20px; }
  .form-actions { align-items: stretch; gap: 14px; }
  .form-actions .button { width: 100%; }
  .correction { margin: 20px 20px 0; padding: 20px; }
  .correction h3 { font-size: 14px; }
  .answer-checks li { grid-template-columns: 1fr; gap: 3px; }
  .narrow { margin-top: 32px; }
  .site-footer { padding-block: 24px; align-items: flex-start; flex-direction: column; gap: 15px; }
}
@media (prefers-reduced-motion: reduce) { .mode-card { transition: none; } }
