:root {
  color-scheme: light dark;
  --line: #8885;
  --soft: #8822;
  --muted: light-dark(#595959, #a0a0a0);
  --player-bg: #1e1e1e;
  --player-text: #e8e8e8;
  --hl-bg: light-dark(#fff4c2, #4a3f00);
  --marker-text: light-dark(#7a4b00, #ffd36b);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { font-family: system-ui, sans-serif; line-height: 1.45; max-width: 54rem; margin: 2rem auto 4rem; padding: 0 1rem; }
h1 { margin-bottom: 0.25rem; }
.lede { margin-top: 0; font-size: 1.15rem; }
.nav { font-size: 14px; }
.note { font-size: 13px; color: var(--muted); }
.btn { font: inherit; padding: 5px 14px; border: 1px solid var(--line); border-radius: 6px; background: Canvas; color: inherit; cursor: pointer; }
.btn:disabled { cursor: not-allowed; color: var(--muted); }
.viewswitch { display: inline-flex; margin: 0.5rem 0 1rem; }
.viewswitch .btn { border-radius: 0; }
.viewswitch .btn:first-child { border-radius: 6px 0 0 6px; }
.viewswitch .btn:last-child { border-radius: 0 6px 6px 0; border-left: 0; }
.viewswitch .btn[aria-pressed="true"] { background: CanvasText; color: Canvas; }
code { font-family: ui-monospace, Menlo, monospace; font-size: 0.92em; }

/* The browser frame. */
.browser { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; overflow: clip; }
.chrome { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--soft); border-bottom: 1px solid var(--line); }
.nav-dot { color: var(--muted); }
.address { flex: 1; min-width: 0; padding: 4px 12px; border-radius: 999px; background: Canvas; border: 1px solid var(--line); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sparkle { font: inherit; font-size: 18px; line-height: 1; padding: 4px 9px; border: 1px solid var(--line); border-radius: 8px; background: Canvas; color: inherit; cursor: pointer; }
.sparkle[aria-expanded="true"] { background: CanvasText; color: Canvas; }
.viewport { position: relative; overflow: hidden; overflow: clip; min-height: 30rem; display: flex; flex-direction: column; }

.article { padding: 1.25rem 1.5rem 2rem; flex: 1; }
.article h2 { margin-top: 0; }
.art-section { border-left: 4px solid transparent; padding: 0.4rem 0.9rem; margin: 0.5rem 0; border-radius: 4px; }
.art-section.current { background: var(--hl-bg); border-left-color: var(--marker-text); }
.art-section h3 { display: inline; margin: 0; font-size: 1.05rem; }
.marker { margin-left: 0.6rem; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--marker-text); }
.art-section p { margin: 0.3rem 0; }
.jump { font: inherit; font-size: 12px; padding: 2px 8px; margin-top: 0.3rem; border: 1px solid var(--line); border-radius: 6px; background: Canvas; color: inherit; cursor: pointer; }
.fees { border-collapse: collapse; margin: 0.5rem 0; font-size: 14px; }
.fees th, .fees td { text-align: left; border-bottom: 1px solid var(--line); padding: 4px 24px 4px 0; }
.fees td:last-child, .fees th:last-child { text-align: right; padding-right: 0; }
.fees tfoot th { border-bottom: 0; }

/* The drawer slides in from the right and is inert while closed. */
.drawer { position: absolute; z-index: 2; top: 0; right: 0; bottom: 0; width: min(18rem, 90%); padding: 1rem; background: Canvas; border-left: 1px solid var(--line); box-shadow: -6px 0 18px #0003; transform: translateX(100%); visibility: hidden; transition: transform 0.25s ease, visibility 0s linear 0.25s; }
.drawer.open { transform: none; visibility: visible; transition: transform 0.25s ease; }
.drawer h2 { margin: 0 0 0.75rem; font-size: 1rem; }
.modes { display: grid; gap: 8px; }
.mode-btn { display: block; width: 100%; text-align: left; font: inherit; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: Canvas; color: inherit; cursor: pointer; }
.mode-btn:disabled { cursor: not-allowed; color: var(--muted); }
.mode-name { display: block; font-weight: 600; }
.mode-note { display: block; font-size: 12px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) {
  .drawer, .drawer.open { transition: none; }
}

/* The podcast player sticks to the bottom of the frame. */
.player { position: sticky; bottom: 0; z-index: 1; padding: 12px 16px; background: var(--player-bg); color: var(--player-text); display: grid; gap: 10px; }
.player:focus { outline: 2px solid var(--player-text); outline-offset: -4px; }
.caption { margin: 0; min-height: 2.9em; font-size: 14px; }
.controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.player button { font: inherit; font-size: 13px; padding: 4px 12px; border: 1px solid var(--player-text); border-radius: 6px; background: transparent; color: var(--player-text); cursor: pointer; }
.player button:disabled { opacity: 0.55; cursor: not-allowed; }
.player button:hover:not(:disabled), .player button:focus-visible { background: #ffffff22; }
.progress { flex: 1; min-width: 6rem; height: 6px; border-radius: 3px; background: #ffffff33; overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: var(--player-text); }
.player .linklike { border: 0; padding: 0; text-decoration: underline; }
.player-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; }

/* The developer view: one card per mode. */
.dev-intro { max-width: 40rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1rem; }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.card h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0 0 0.5rem; font-size: 1.05rem; }
.tag { font-size: 12px; font-weight: 400; color: var(--muted); }
.card dl { margin: 0; display: grid; gap: 8px; }
.card dt { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
.card dd { margin: 0; }
.chip { display: inline-block; margin: 0 6px 4px 0; padding: 2px 8px; border: 1px solid var(--line); border-radius: 6px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.chip small { font-family: system-ui, sans-serif; color: var(--muted); }
.card .btn { margin-top: 10px; font-size: 13px; }

.prose h2 { margin-top: 2rem; }
table { border-collapse: collapse; margin: 0.75rem 0; font-size: 14px; }
th, td { text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); padding: 6px 12px 6px 0; }
