/* The deck page: one serif column, ruled rows, nothing else. */
@font-face { font-family: "ET Book"; src: url("fonts/et-book-roman-old-style-figures.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "ET Book"; src: url("fonts/et-book-display-italic-old-style-figures.woff") format("woff"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "ET Book"; src: url("fonts/et-book-bold-line-figures.woff") format("woff"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "ET Lining"; src: url("fonts/et-book-roman-line-figures.woff") format("woff"); font-display: swap; }
:root { --paper: #fdfdfb; --ink: #1b2430; --soft: #303a46; --muted: #5d6672; --rule: #dfe3e6; --accent: #1f5f8b;
  --serif: "ET Book", Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif; --lining: "ET Lining", Palatino, Georgia, serif; color-scheme: light; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 19px/1.5 var(--serif); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
a { color: inherit; text-decoration: none; }
a:hover, .label:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.page { max-width: 694px; margin: 0 auto; padding: 48px 24px 96px; }
.label { font-family: var(--lining); font-size: 13px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.masthead { padding-bottom: 8px; }
h1 { margin: 56px 0 0; font-size: clamp(44px, 8vw, 56px); line-height: 1.05; font-weight: 700; letter-spacing: -.01em; }
.subtitle { margin: 10px 0 0; font-size: 23px; line-height: 1.35; color: var(--soft); }
.bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; margin: 30px 0 0; }
.bar p { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 22px; }
.bar a, .foot a, .foot button { padding: 8px 0; margin: -8px 0; }
.section { margin-top: 64px; scroll-margin-top: 20px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
h2 { margin: 0; font-size: 25px; line-height: 1.2; font-weight: 700; }
.ts { font-family: var(--lining); font-size: 15.5px; color: var(--muted); padding: 10px 0 10px 12px; margin: -10px 0; }
.cards { list-style: none; margin: 0; padding: 0; }
.card { border-bottom: 1px solid var(--rule); }
.row { display: grid; grid-template-columns: 24px minmax(0, 1fr) 20px; gap: 14px; align-items: baseline; padding: 15px 0; cursor: pointer; }
.n { font-family: var(--lining); font-size: 14.5px; color: var(--muted); text-align: right; }
.q { font-size: 20.5px; line-height: 1.38; text-wrap: pretty; }
.q p { margin: 0; }
.q code, .a-body code { font: .84em ui-monospace, Consolas, monospace; }
.mark::before { content: "+"; font-size: 21px; line-height: 1; color: var(--muted); }
.card.open .mark::before { content: "–"; }
.row:hover .mark::before { color: var(--accent); }
.back-wrap { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows .2s ease-out, visibility .2s; }
.card.open .back-wrap { grid-template-rows: 1fr; visibility: visible; }
.face.back { min-height: 0; overflow: hidden; }
.a-in { margin: 2px 34px 24px 38px; padding-left: 18px; border-left: 1px solid var(--accent); }
.a-body, .review-a { color: var(--soft); font-size: 19px; line-height: 1.5; }
.a-body p, .review-a p { margin: 0; }
.a-body p + p, .a-body ol + p, .a-body ul + p, .a-body p + ol, .a-body p + ul,
.review-a p + p, .review-a ol + p, .review-a p + ol { margin-top: 10px; }
.a-body ol, .a-body ul, .review-a ol, .review-a ul { margin: 0; padding-left: 1.2em; }
.card-tools { display: flex; gap: 18px; margin-top: 8px; font-size: 16px; font-style: italic; color: var(--muted); }
.card-tools > * { padding: 8px 0; }
.card-tools > *:hover, .card.starred .star { color: var(--accent); }
.fig { margin: 18px 0 4px; max-width: 460px; }
.fig svg { display: block; padding: 10px; border: 1px solid var(--rule); border-radius: 4px; }
.fig figcaption { margin-top: 6px; color: var(--muted); font-size: 16px; font-style: italic; line-height: 1.35; }
.fig-nav { display: flex; gap: 14px; align-items: center; margin-top: 6px; font-size: 16px; color: var(--muted); }
.fig-nav button { min-height: 36px; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.foot { margin-top: 72px; color: var(--muted); font-size: 16.5px; }
.foot p { margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 4px 22px; align-items: baseline; }
.foot button, .foot p > a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule); }
.review { position: fixed; inset: 0; z-index: 10; overflow-y: auto; background: var(--paper); }
.review-inner { max-width: 694px; min-height: 100%; margin: 0 auto; padding: 32px 24px 0; display: flex; flex-direction: column; }
.review-top { display: flex; justify-content: space-between; gap: 18px; align-items: baseline; }
.review p { margin: 0; }
.review-note { min-height: 28px; color: var(--muted); font-style: italic; font-size: 16.5px; }
.review-section { margin-top: 56px !important; font-style: italic; color: var(--muted); }
.review-q { margin-top: 10px; font-size: clamp(25px, 5vw, 31px); line-height: 1.3; }
.review-a { margin-top: 24px; padding-left: 18px; border-left: 1px solid var(--accent); }
.review-links { margin-top: 16px !important; color: var(--muted); font-size: 16px; }
.review-undo { margin-top: 18px !important; }
.review-actions { position: sticky; bottom: 0; margin-top: auto !important; padding: 18px 0 28px; display: flex; gap: 12px; background: var(--paper); }
.btn { flex: 1; min-height: 48px; padding: 8px 16px; border: 1px solid var(--ink); text-align: center; }
.btn:hover { background: var(--ink); color: var(--paper); }
.plain-btn { min-height: 40px; color: var(--muted); }
.editor { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(30, 30, 25, .4); overflow-y: auto; }
.editor-card { width: min(620px, 100%); padding: 24px; background: var(--paper); }
.editor-card label { display: block; margin-top: 14px; color: var(--muted); }
.editor-card textarea { display: block; width: 100%; margin-top: 4px; padding: 10px; border: 1px solid #cfccbd; background: #fff; font: inherit; color: var(--ink); resize: vertical; }
.editor-actions { display: flex; flex-wrap: wrap; gap: 12px 20px; justify-content: flex-end; align-items: center; margin: 18px 0 0; }
.editor-actions .btn { flex: none; }
@media (max-width: 600px) {
  .page { padding: 28px 18px 72px; } h1 { margin-top: 36px; } .section { margin-top: 52px; }
  .row { grid-template-columns: 16px minmax(0, 1fr) 16px; gap: 12px; } .a-in { margin: 2px 8px 22px 28px; padding-left: 14px; }
  kbd { display: none; }
}
kbd { font: 12px var(--lining); color: inherit; opacity: .6; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .back-wrap { grid-template-rows: 1fr; visibility: visible; } .mark, .card-tools, .foot, .bar { display: none; } }
.theme-toggle { cursor: pointer; }
.card-img { margin: 18px 0 4px; max-width: 460px; }
.card-img img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 4px; background: #f8f7f4; }
.img-credit { margin: 6px 0 0; color: var(--muted); font-size: 15px; line-height: 1.4; }
.img-src { margin-left: 6px; text-decoration: underline; text-underline-offset: 3px; }
.further { margin-top: 56px; padding-top: 12px; border-top: 1px solid var(--rule); }
.further h2 { margin: 0; }
.further-list { margin: 12px 0 0; padding-left: 1.2em; color: var(--soft); }
.fig svg { background: #fdfdfb; }
:root[data-theme="dark"] {
  --paper: #151413; --ink: #ecebe6; --soft: #d8d6cf; --muted: #a8a39a; --rule: #3a3834; --accent: #7eb8e8;
  color-scheme: dark;
}
:root[data-theme="dark"] .fig svg,
:root[data-theme="dark"] .card-img img { background: #f8f7f4; }
:root[data-theme="dark"] .editor { background: rgba(0, 0, 0, .55); }
:root[data-theme="dark"] .editor-card textarea { background: #242220; border-color: #4a4744; color: var(--ink); }

/* ---- v1: card styles, notes view, your notes, tour ---- */
.fmt { display: inline-block; margin-right: 10px; padding: 1px 8px; border-radius: 999px; font-family: var(--lining); font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; vertical-align: 3px; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.f-lesson .fmt { color: #9a6a00; border-color: color-mix(in srgb, #c98a00 50%, transparent); }
:root[data-theme="dark"] .f-lesson .fmt { color: #e6b450; }
.f-fact .q, .f-lesson .q { font-style: normal; }
.views { display: inline-flex; gap: 0; border: 1px solid var(--rule); border-radius: 999px; overflow: hidden; }
.view-btn { padding: 3px 12px !important; margin: 0 !important; }
.view-btn.on { background: var(--ink); color: var(--paper); }
.sec-notes { display: none; margin: 14px 0 4px; padding: 12px 16px; border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.sec-notes .label { margin: 0 0 4px; }
.sec-notes ul { margin: 0; padding-left: 1.1em; color: var(--soft); font-size: 18px; }
.sec-notes li + li { margin-top: 4px; }
.view-notes .sec-notes { display: block; }
.view-notes .back-wrap { grid-template-rows: 1fr; visibility: visible; transition: none; }
.view-notes .row { cursor: default; }
.view-notes .mark { visibility: hidden; }
.view-notes .q { font-weight: 700; }
.my-note { margin: 12px 0 0; padding: 10px 14px; border: 1px dashed var(--rule); border-radius: 6px; }
.my-note .label { margin: 0 0 2px; }
.my-note-text { color: var(--soft); font-size: 17px; }
.my-note-text p { margin: 0; }
.review-mine { margin-top: 12px !important; font-size: 17px; color: var(--soft); }
.tour { position: fixed; z-index: 30; width: min(360px, calc(100vw - 24px)); padding: 16px 18px 12px; background: var(--paper); border: 1px solid var(--ink); border-radius: 10px; box-shadow: 0 16px 40px -18px rgba(0,0,0,.45); }
.tour.docked { left: 12px !important; right: 12px; bottom: 12px; top: auto !important; width: auto; }
.tour p { margin: 0; }
.tour-step { color: var(--muted); }
.tour-title { margin-top: 4px !important; font-size: 21px; font-weight: 700; line-height: 1.25; }
.tour-body { margin-top: 6px !important; color: var(--soft); font-size: 17px; line-height: 1.45; }
.tour-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px !important; }
.tour-next { min-height: 40px; padding: 0 16px; border-radius: 6px; background: var(--ink); color: var(--paper); font-size: 16px; text-align: center; }
.tour-next:disabled { background: none; color: var(--muted); border: 1px dashed var(--rule); cursor: default; }
.tour-target { position: relative; z-index: 25; outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 6px; animation: tour-pulse 1.6s ease-in-out infinite; }
@keyframes tour-pulse { 50% { outline-color: color-mix(in srgb, var(--accent) 35%, transparent); } }
@media print { .tour, .views, .note-btn { display: none !important; } .sec-notes { display: block; } }

.review-finished { margin: 12px 0 8px; }
.review-finished .done-msg { margin: 0 0 10px; font-style: italic; color: var(--muted); }

/* ---- QA fixes: dialogs hide the tour, shortcuts sheet ---- */
.dialog-open .tour { display: none !important; }
.dialog-open .tour-target { animation: none; outline: none; }
.keys-card { width: min(440px, 100%); }
.keys-list { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin: 16px 0 0; align-items: baseline; }
.keys-list dt { white-space: nowrap; }
.keys-list dd { margin: 0; color: var(--soft); font-size: 17px; }
.keys-list kbd { display: inline-block; min-width: 24px; padding: 1px 7px; border: 1px solid var(--rule); border-bottom-width: 2px; border-radius: 5px; text-align: center; opacity: 1; font-size: 13px; }
/* the speaker's words under a revealed review card */
.review-said { margin-top: 18px !important; padding-left: 16px; border-left: 2px solid var(--rule); font-style: italic; color: var(--soft); }
.said-label { display: block; margin-bottom: 2px; font-family: var(--lining); font-style: normal; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---------- toolbar: Review is the main action; downloads and theme sit quietly on the side */
.bar { align-items: center; }
.bar .bar-main { gap: 10px 14px; }
.review-pill { padding: 7px 14px !important; margin: 0 !important; border: 1px solid var(--ink); border-radius: 999px; color: var(--ink); }
.review-pill:hover { background: var(--ink); color: var(--paper); }
.bar .bar-more { gap: 4px 18px; }

/* ---------- continue where you left off */
.resume { margin: 22px 0 0; display: flex; align-items: center; gap: 8px; }
.resume a { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: center;
  padding: 12px 16px; border: 1px solid var(--rule); border-left: 3px solid var(--accent); border-radius: 10px; color: var(--ink); }
.resume-k { grid-column: 1; }
#resume-what { grid-column: 1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.35; margin-top: 4px; }
.resume a > span[aria-hidden] { grid-column: 2; grid-row: 1 / span 2; color: var(--accent); font-size: 20px; }
.resume a:hover { border-color: var(--accent); }
.resume-k { font-family: var(--lining); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-right: 4px; }
.resume-x { padding: 8px 10px; font-size: 22px; line-height: 1; color: var(--muted); }

/* ---------- phones: bigger tap targets, one tidy toolbar, a thumb-reach dock once the header scrolls away */
.dock { display: none; }
@media (max-width: 600px) {
  .bar { flex-direction: column; align-items: stretch; gap: 14px; }
  .bar .bar-main { flex-wrap: nowrap; gap: 10px; }
  .bar .bar-main .review-pill { flex: 1; min-width: 0; text-align: center; white-space: nowrap; padding: 11px 8px !important; font-size: 13px; letter-spacing: .05em; }
  .bar .bar-main .views { flex: none; }
  .bar .bar-main .views .view-btn { padding: 10px 13px !important; font-size: 13px; }
  .bar .bar-more { flex-wrap: nowrap; overflow-x: auto; gap: 0; margin: 0 -18px; padding: 0 18px; scrollbar-width: none; }
  .bar .bar-more::-webkit-scrollbar { display: none; }
  .bar .bar-more > * { flex: none; padding: 10px 16px 10px 0 !important; margin: 0 !important; }
  .dock { display: flex; position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 6; gap: 8px; padding: 8px;
    border: 1px solid var(--rule); border-radius: 16px; background: color-mix(in srgb, var(--paper) 88%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 12px 30px -12px rgba(0,0,0,.6);
    transform: translateY(140%); transition: transform .25s ease; }
  body.bar-away .dock { transform: none; }
  body.dialog-open .dock { transform: translateY(140%); }
  .dock button { min-height: 46px; border-radius: 11px; text-align: center; font-family: var(--lining); font-size: 14px; letter-spacing: .06em; text-transform: uppercase; }
  .dock-review { flex: 1; background: var(--ink); color: var(--paper); }
  .dock-btn { padding: 0 16px; border: 1px solid var(--rule); color: var(--ink); }
  .page { padding-bottom: 110px; }
}
@media print { .dock, .resume { display: none !important; } }
