/* Source Serif 4 (Adobe, SIL Open Font License: /static/fonts/OFL.txt),
   self-hosted and Latin only, the same files as thevishalkumar.com. Cambria and
   Georgia stand in until it loads, or if it can't. */
@font-face {
  font-family: "Source Serif 4"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url("/static/fonts/source-serif-4-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4"; font-style: italic; font-weight: 200 900; font-display: swap;
  src: url("/static/fonts/source-serif-4-latin-wght-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Colours: the same palette as thevishalkumar.com (warm paper, ink, rust). */
:root {
  --bg: #f5efe4; --surface: #fbf7ef; --text: #1b1714; --muted: #5c544c; --line: #e0d6c5;
  --accent: #b93d0b; --accent-ink: #fffaf3; --ok: #2d794c; --err: #b91c1c;
  /* One typeface for the whole site, text, headings and controls alike. */
  --font: "Source Serif 4", Cambria, Georgia, "Noto Serif", serif;
  --serif: var(--font);
  --display: var(--font);
  color-scheme: light dark;
}
:root[data-theme="day"] { color-scheme: light; }
:root[data-theme="night"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="day"]) { --bg: #12100e; --surface: #1b1815; --text: #f1ebe2; --muted: #b3aaa0; --line: #2f2a25;
          --accent: #ff8a4c; --accent-ink: #1a0f08;
          --ok: #5cc98a; --err: #f87171; }
}
:root[data-theme="night"] { --bg: #12100e; --surface: #1b1815; --text: #f1ebe2; --muted: #b3aaa0; --line: #2f2a25;
          --accent: #ff8a4c; --accent-ink: #1a0f08;
          --ok: #5cc98a; --err: #f87171; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 var(--font); overflow-wrap: break-word; }
/* Long URLs, inline code and unbroken words wrap instead of widening the page on phones. */
.prose a, .prose :not(pre) > code, .post-title a, .summary { overflow-wrap: anywhere; }
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.wrap { width: min(960px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(720px, 100% - 32px); }
.top { border-bottom: 1px solid var(--line); background: var(--surface); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.nav nav { display: flex; align-items: center; gap: 16px; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.brand span { color: var(--accent); }
main { padding: 40px 0; min-height: 60vh; }
h1 { line-height: 1.2; margin: 0 0 .5em; font-size: clamp(1.6rem, 1.1rem + 2.6vw, 2.25rem); hyphens: auto; }
.hero { padding: 48px 0; }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 60ch; }
/* The hidden attribute always hides, even on elements whose class sets a display (.btn, flex rows). */
[hidden] { display: none !important; }
.btn { display: inline-block; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--accent);
       background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.danger { background: transparent; border-color: var(--err); color: var(--err); }
/* One hover for every button, in every colour: filled ones shade a little
   toward the page, outlined ones take a faint tint of their own colour. */
.btn { transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
.btn:hover { background: color-mix(in srgb, var(--accent) 88%, var(--bg)); border-color: var(--accent); }
.btn.ghost:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.btn.danger:hover { background: color-mix(in srgb, var(--err) 12%, transparent); border-color: var(--err); color: var(--err); }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }
.linkish { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
form.inline { display: inline; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px; }
.form { max-width: 460px; margin-inline: auto; }
label { display: block; margin-bottom: 16px; font-weight: 600; }
input, textarea { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border-radius: 8px;
                  border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-weight: 400; }
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .95rem; line-height: 1.5; }
textarea[name=summary] { font-family: var(--font); }
.addr { display: flex; align-items: center; gap: 6px; }
.addr span { color: var(--muted); font-weight: 400; white-space: nowrap; }
.hint { color: var(--muted); font-weight: 400; font-size: .9rem; }
.error { color: var(--err); font-weight: 600; }
.ok { color: var(--ok); font-weight: 600; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.posts { width: 100%; border-collapse: collapse; }
.posts th, .posts td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.posts td:first-child { overflow-wrap: anywhere; } /* long titles wrap instead of widening the table */
@media (max-width: 560px) { .posts th:nth-child(3), .posts td:nth-child(3) { display: none; } } /* no room for the date on phones */
.hint a { display: inline-block; padding: 3px 0; } /* comfortable tap targets */
.badge { font-size: .8rem; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); }
.badge.published { color: var(--ok); border-color: var(--ok); }
.empty { color: var(--muted); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.danger { margin-top: 32px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.foot { color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); padding: 24px 0 40px; }

/* Public blog */
.blog-head { margin-bottom: 32px; }
.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.post-list time, .post time { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.prose { font: 1.15rem/1.75 var(--serif); }
.prose img { max-width: 100%; height: auto; }
/* Diagrams: drawn light and dark when the post is saved; CSS shows the one that fits. */
.prose figure.diagram { margin: 1.5em 0; overflow-x: auto; }
/* Wide diagrams keep a readable size on phones and scroll sideways instead of shrinking. */
.prose figure.diagram img { display: block; margin-inline: auto; max-width: max(100%, 560px); }
.prose figure.diagram .diagram-dark { display: none; }
.prose figure.diagram details { margin-top: 6px; font-size: .9rem; color: var(--muted); }
.theme-ink .prose figure.diagram .diagram-light { display: none; }
.theme-ink .prose figure.diagram .diagram-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="day"]) .prose figure.diagram .diagram-light { display: none; }
  :root:not([data-theme="day"]) .prose figure.diagram .diagram-dark { display: block; }
}
:root[data-theme="night"] .prose figure.diagram .diagram-light { display: none; }
:root[data-theme="night"] .prose figure.diagram .diagram-dark { display: block; }
.prose pre { overflow-x: auto; padding: 14px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); font-size: .9rem; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
.prose blockquote { margin: 0; padding-left: 16px; border-left: 3px solid var(--line); color: var(--muted); }
.prose table { border-collapse: collapse; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 6px 10px; }

/* Publishing */
.wide { max-width: 640px; }
.themes { border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin: 0 0 16px; }
.theme-opt { display: inline-flex; align-items: center; gap: 6px; margin-right: 18px; font-weight: 400; text-transform: capitalize; }
.theme-opt input { width: auto; margin: 0; }
.revisions { margin-top: 32px; }
.revisions h2 { font-size: 1.1rem; }
.revisions ul { padding-left: 18px; color: var(--muted); }
.post-list .post-link { font-weight: 600; }
.summary { margin: 4px 0 0; color: var(--muted); font-size: .95rem; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 28px 0 0; }
.tags a { display: inline-block; font-size: .9rem; text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; line-height: 1.3; }

/* Blog themes. "paper" is the default look defined above. */
.theme-ink { --bg: #0f1115; --surface: #161a21; --text: #e6e8ec; --muted: #9aa3b2; --line: #262c36; --accent: #7cc4ff; --accent-ink: #0f1115; --ok: #4ade80; --err: #f87171; }
.theme-ink .prose { font-family: var(--font); }
.theme-mono { --bg: #ffffff; --surface: #f6f6f6; --text: #111111; --muted: #555555; --line: #dddddd; --accent: #111111; --accent-ink: #ffffff; }
.theme-mono, .theme-mono .prose { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.theme-mono .prose { font-size: 1rem; line-height: 1.7; }
.theme-forest { --bg: #f4f7f2; --surface: #e9efe5; --text: #1d2a1f; --muted: #56655a; --line: #cfdacb; --accent: #2b7040; --accent-ink: #ffffff; }
.theme-sunset { --bg: #fff8f1; --surface: #fdeedf; --text: #2b1d16; --muted: #7a5f50; --line: #f0d6c0; --accent: #a8441a; --accent-ink: #ffffff; }
.theme-ocean { --bg: #f3f8fa; --surface: #e6f0f4; --text: #102a33; --muted: #4f6872; --line: #c9dde5; --accent: #0e6e8c; --accent-ink: #ffffff; }
.theme-plum { --bg: #faf6fb; --surface: #f1e8f4; --text: #2a1830; --muted: #6d5876; --line: #e0cfe6; --accent: #7b3f8f; --accent-ink: #ffffff; }
.theme-sand { --bg: #f8f4ea; --surface: #efe7d6; --text: #2c2416; --muted: #6e6250; --line: #ddd0b6; --accent: #74561f; --accent-ink: #ffffff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="day"]) .theme-forest { --bg: #121a14; --surface: #18231b; --text: #e3ece4; --muted: #9db3a2; --line: #26362a; --accent: #6fcf8e; --accent-ink: #0f1712; }
  :root:not([data-theme="day"]) .theme-sunset { --bg: #1b1310; --surface: #241914; --text: #f3e6dc; --muted: #c2a593; --line: #3a2a21; --accent: #ff9a5c; --accent-ink: #1b1310; }
  :root:not([data-theme="day"]) .theme-ocean { --bg: #0d171b; --surface: #132228; --text: #e2eff3; --muted: #94b1bc; --line: #213840; --accent: #5cc8e6; --accent-ink: #0d171b; }
  :root:not([data-theme="day"]) .theme-plum { --bg: #17111a; --surface: #211826; --text: #f1e6f4; --muted: #b9a2c2; --line: #352840; --accent: #d39be6; --accent-ink: #17111a; }
  :root:not([data-theme="day"]) .theme-sand { --bg: #17140e; --surface: #211c13; --text: #f1e9d8; --muted: #bba98a; --line: #362e20; --accent: #e0b866; --accent-ink: #17140e; }
}
:root[data-theme="night"] .theme-forest { --bg: #121a14; --surface: #18231b; --text: #e3ece4; --muted: #9db3a2; --line: #26362a; --accent: #6fcf8e; --accent-ink: #0f1712; }
:root[data-theme="night"] .theme-sunset { --bg: #1b1310; --surface: #241914; --text: #f3e6dc; --muted: #c2a593; --line: #3a2a21; --accent: #ff9a5c; --accent-ink: #1b1310; }
:root[data-theme="night"] .theme-ocean { --bg: #0d171b; --surface: #132228; --text: #e2eff3; --muted: #94b1bc; --line: #213840; --accent: #5cc8e6; --accent-ink: #0d171b; }
:root[data-theme="night"] .theme-plum { --bg: #17111a; --surface: #211826; --text: #f1e6f4; --muted: #b9a2c2; --line: #352840; --accent: #d39be6; --accent-ink: #17111a; }
:root[data-theme="night"] .theme-sand { --bg: #17140e; --surface: #211c13; --text: #f1e9d8; --muted: #bba98a; --line: #362e20; --accent: #e0b866; --accent-ink: #17140e; }
/* Branding: icon and tagline in the blog header; swatches in settings. */
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-icon { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; }
.brand-wrap { display: flex; flex-direction: column; min-width: 0; }
.tagline { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
.icon-preview { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line); }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1px solid #0003; }
.swatch-paper { background: #b93d0b; } .swatch-ink { background: #0f1115; } .swatch-mono { background: #111111; }
.swatch-forest { background: #2b7040; } .swatch-sunset { background: #a8441a; }
.swatch-ocean { background: #0e6e8c; } .swatch-plum { background: #7b3f8f; } .swatch-sand { background: #74561f; }
input.color { width: 48px; height: 32px; padding: 0; vertical-align: middle; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="day"]) .theme-mono { --bg: #111111; --surface: #1a1a1a; --text: #eeeeee; --muted: #aaaaaa; --line: #333333; --accent: #eeeeee; --accent-ink: #111111; }
}
:root[data-theme="night"] .theme-mono { --bg: #111111; --surface: #1a1a1a; --text: #eeeeee; --muted: #aaaaaa; --line: #333333; --accent: #eeeeee; --accent-ink: #111111; }

/* Discovery */
.skip:focus { position: static; width: auto; height: auto; clip: auto; padding: 8px; }
.crumbs ol { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: .9rem; }
.crumbs li + li::before { content: "›"; margin-right: 6px; }
/* The current page (often a long post title) stays on one line. */
.crumbs li[aria-current] { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.byline { margin-top: -.25em; }
.post-title { font-size: 1.05rem; margin: 0; }
.share { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .95rem; }
.share ul { display: flex; flex-wrap: wrap; gap: 12px; list-style: none; padding: 0; margin: 0; }
.author { margin-bottom: 20px; }
.author-name { font-weight: 700; color: var(--text); margin-bottom: 4px; }
.author-links { display: flex; flex-wrap: wrap; gap: 12px; list-style: none; padding: 0; margin: 8px 0 0; }

/* Engagement */
.reactions { display: flex; align-items: center; gap: 12px; margin-top: 24px; }
.comments { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); }
.comments h2 { font-size: 1.2rem; }
.comment-list { list-style: none; padding: 0; margin: 0 0 24px; }
.comment { padding: 12px 0; border-bottom: 1px solid var(--line); }
.comment .hint { margin: 0 0 4px; }
.comment-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 6px; }
.comment-form textarea { font-family: var(--font); }
.reader-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: baseline; margin-bottom: 8px; }
.follow-tag form { display: inline; }
.follow-tag a, .follow-tag .linkish { display: inline-block; padding: 4px 2px; } /* comfortable tap targets */

/* Platform admin */
.admin-section { margin-bottom: 24px; }
.admin-section h2 { margin-top: 0; font-size: 1.25rem; }
.admin-section h3 { font-size: 1.05rem; margin-top: 24px; }
.provider-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 20px; }
.provider-tabs a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; }
.provider-tabs a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
/* Visitors pages */
.visit-totals { display: flex; flex-wrap: wrap; gap: 12px 32px; margin: 8px 0 12px; }
.visit-totals dt { color: var(--muted); font-size: .9rem; }
.visit-totals dd { margin: 0; font-size: 1.6rem; font-weight: 700; }
.visit-chart { display: block; width: 100%; height: 140px; margin-top: 16px; fill: var(--accent); }
.visit-chart rect:hover { opacity: .7; }
.visit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 20px; margin-top: 20px; }
.visit-table { width: 100%; border-collapse: collapse; }
.visit-table td, .visit-table th { padding: 5px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.visit-table td:first-child { overflow-wrap: anywhere; }
.visit-table .num { text-align: right; font-variant-numeric: tabular-nums; width: 4em; }
.visit-table .bar { width: 30%; }
.visit-table meter { width: 100%; }
.visit-table a[aria-current] { font-weight: 700; }
select { display: block; margin-top: 6px; padding: 10px 40px 10px 12px; border-radius: 8px; border: 1px solid var(--line); background-color: var(--bg); color: var(--text); font: inherit; }
/* Our own arrow, drawn in the text colour with room to breathe: the browser's
   sits flush against the right border and ignores padding. */
select { -webkit-appearance: none; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 19px center, right 14px center; background-size: 5px 5px; background-repeat: no-repeat; }
.webhook, .totp-key code { word-break: break-all; }
.totp-key code { font-size: 1.15rem; letter-spacing: .05em; }
.totp-qr { margin: 12px 0; }
.totp-qr .qr { display: block; width: 100%; max-width: 220px; height: auto; border-radius: 4px; }
.codes { columns: 2; list-style: none; padding: 0; font-size: 1.1rem; }
.dns, .audit { padding-left: 18px; }
.dns code, .audit { overflow-wrap: anywhere; }
.inline-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.inline-form label { margin: 0; flex: 1 1 240px; }

/* Accounts and legal pages */
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .95rem; }
label.check input { width: auto; margin: 4px 0 0; flex: none; }
.notice { border: 1px solid var(--accent); border-radius: 10px; padding: 12px 16px; margin-bottom: 24px; }
.notice p { margin: 0 0 4px; }
#data { margin-top: 24px; }
#data h3 { margin-top: 28px; color: var(--err); font-size: 1.05rem; }
.legal { max-width: 72ch; margin-inline: auto; }
.legal h2 { font-size: 1.2rem; margin-top: 1.8em; }
.legal table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; font-size: .95rem; }
.legal th, .legal td { text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); padding: 8px 10px; }
.reader-delete { margin: 8px 0; font-size: .9rem; }
.reader-delete summary { cursor: pointer; color: var(--muted); }
.reader-delete form { margin-top: 10px; }

/* Fonts: system stacks only (no web fonts are loaded). Declared after the
   themes so a chosen font overrides the theme's own. */
.font-sans, .font-sans .prose { font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
.font-serif, .font-serif .prose { font-family: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif; }
.font-oldstyle, .font-oldstyle .prose { font-family: "Iowan Old Style", "Palatino Linotype", "URW Palladio L", P052, "Book Antiqua", serif; }
.font-humanist, .font-humanist .prose { font-family: Seravek, "Gill Sans Nova", Ubuntu, Calibri, "DejaVu Sans", source-sans-pro, sans-serif; }
.font-rounded, .font-rounded .prose { font-family: ui-rounded, "Hiragino Maru Gothic ProN", Quicksand, Comfortaa, Manjari, "Arial Rounded MT", "Arial Rounded MT Bold", Calibri, sans-serif; }
.font-slab, .font-slab .prose { font-family: Rockwell, "Rockwell Nova", "Roboto Slab", "DejaVu Serif", "Sitka Small", serif; }
.font-mono, .font-mono .prose { font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace; }
.font-mono .prose { font-size: 1rem; line-height: 1.7; }
.font-opt { text-transform: none; }

/* Reading time in listings; listen controls (shown only when the browser can speak). */
.post-meta { margin: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; color: var(--muted); font-size: .9rem; white-space: nowrap; }
.listen { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 4px 0 20px; }
.listen select { padding: 0 40px 0 14px; border-radius: 12px; font-family: var(--ui, inherit); }
/* One row, one height: every control and the "Part 1 of 73" line are 44px tall in the same type size. */
.listen .btn, .listen select, .listen-part { box-sizing: border-box; height: 44px; margin: 0; line-height: 1; font-size: .95rem; }
.listen .btn { padding: 0 16px; border-radius: 12px; }
.listen-part { display: inline-flex; align-items: center; }
/* Listen, Pause and Resume share one grid cell, so the button keeps the width of the longest and only the word changes. */
.listen-play { display: inline-grid; align-items: center; justify-items: center; }
.listen-play > span { grid-area: 1 / 1; white-space: nowrap; }
.listen-play > span.off { visibility: hidden; }
.listen .listen-icon { width: 44px; padding: 0; }
.listen .btn:disabled, .listen-float .btn:disabled { opacity: .4; cursor: default; background: transparent; }
.prose .speaking, h1.speaking { background: color-mix(in srgb, var(--accent) 14%, transparent); border-radius: 4px; }

/* Archive hub and listings. */
.blog .top nav a { color: var(--text); text-decoration: none; font-weight: 600; }
.blog .top nav a:hover { color: var(--accent); }
.archive section { margin: 0 0 32px; }
.archive h3 { margin: 16px 0 6px; font-size: 1rem; color: var(--muted); }
.archive-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.archive-list.tree { display: block; }
.archive-list.tree > li { margin: 6px 0; }
.archive-list.tree ul { list-style: none; padding-left: 18px; margin: 4px 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.archive-list .count { color: var(--muted); font-size: .85rem; }
.archive-list .count::before { content: "("; } .archive-list .count::after { content: ")"; }
.post-meta a { color: var(--muted); }
.more-archive { margin-top: 28px; color: var(--muted); }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 28px; }
.pager a[rel="next"] { margin-left: auto; }
/* Dashboard: categories and authors. */
.organise { margin: 28px 0; }
.org-list { list-style: none; padding: 0; margin: 0 0 12px; }
.org-list .org-list { padding-left: 24px; }
.org-list li { margin: 8px 0; }
.org-row { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.org-row input { width: auto; min-width: 12ch; }
.org-add { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.org-add label { flex: 1 1 200px; }
.org-delete { margin-top: 6px; }
.org-delete summary { color: var(--err); cursor: pointer; display: inline-block; padding: 3px 0; font-size: .9rem; }
.org-delete form { margin-top: 8px; }
.editor-row { display: flex; flex-wrap: wrap; gap: 16px; }
.editor-row label { flex: 1 1 220px; }

/* Author photo, About page and the platform blog's sign-up links */
.photo-preview { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }
.author.with-photo { display: flex; gap: 16px; align-items: flex-start; }
.author-photo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); display: block; }
.author-photo-link { flex: none; }
.author-name a { color: inherit; text-decoration: none; }
.author-name a:hover { color: var(--accent); }
.about { display: flex; gap: 24px; align-items: flex-start; margin: 8px 0 32px; }
.about-photo { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); flex: none; }
.about-name { margin: 4px 0 8px; }
.about-blog { margin: 32px 0; }
.about-more { margin: 24px 0; }
.btn.small { padding: 6px 12px; font-size: .9rem; }
.blog .top nav a.btn { color: var(--accent-ink); }
/* The header's other links get a pale background on hover; the button keeps its
   own filled look, shaded a little toward the page so every colour shows it. */
.blog .top nav a.btn:hover { color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 88%, var(--bg)); border-color: var(--accent); }
@media (max-width: 560px) {
  .about { flex-direction: column; gap: 16px; }
  .about-photo { width: 120px; height: 120px; }
}

/* Calendar */
.cal { width: 100%; border-collapse: collapse; table-layout: fixed; text-align: center; font-size: .85rem; }
.cal th { color: var(--muted); font-weight: 600; padding: 2px 0; }
.cal td { padding: 2px; color: var(--muted); }
.cal td a { display: block; padding: 6px 0; font-weight: 700; color: var(--accent-ink); background: var(--accent); border-radius: 6px; text-decoration: none; }
.cal td.today { outline: 1px solid var(--line); border-radius: 6px; }
.cal-nav { display: flex; justify-content: space-between; margin: 6px 0 0; font-size: .85rem; }
.cal-nav a[rel="next"] { margin-left: auto; }

/* Search */
.search-form { display: flex; gap: 8px; margin: 0 0 24px; }
.search-form input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.search-form.big input { padding: 10px 12px; font-size: 1.05rem; }

/* Series and related posts */
.series { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 32px 0; }
.series a { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; text-decoration: none; }
.series .series-next { grid-column: 2; text-align: right; }
.related { margin: 32px 0; }
.related h2 { font-size: 1.15rem; }
.related ul { list-style: none; padding: 0; }
.related li { margin: 0 0 14px; }
@media (max-width: 560px) {
  .series { grid-template-columns: 1fr; }
  .series .series-next { grid-column: 1; }
}

.badge.scheduled { color: var(--accent); border-color: var(--accent); }
.schedule { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 0 0 16px; }
.schedule input[type="datetime-local"] { max-width: 260px; }
.share-preview { width: 240px; height: auto; max-width: 100%; border-radius: 8px; border: 1px solid var(--line); }

/* ---- Reading-first blog design ----
   One calm column, whitespace instead of boxes, the post as the page. */
.blog { font-size: 18px; }
.blog .narrow { width: min(700px, 100% - 40px); }
.blog main { padding: 48px 0 64px; }
.blog .top { background: var(--bg); border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); position: sticky; top: 0; z-index: 5; }
.blog .nav { min-height: 64px; flex-wrap: nowrap; }
.blog .brand { display: inline-flex; align-items: center; gap: 10px; font-size: 1.1rem; letter-spacing: -.01em; }
.blog .brand span { color: var(--text); }
.brand-icon { width: 32px; height: 32px; border-radius: 8px; }
.blog .top nav { gap: 6px; flex-wrap: nowrap; }
.blog .top nav > a, .look summary { padding: 6px 10px; border-radius: 8px; color: var(--muted); font-weight: 500; font-size: .95rem; text-decoration: none; }
.blog .top nav > a:hover, .look summary:hover, .look[open] summary { color: var(--text); background: var(--surface); }
.blog .top nav a.btn { color: var(--accent-ink); margin-left: 4px; }
.btn.small { padding: 7px 14px; font-size: .9rem; }

/* Look menu: day, night or auto, and a colour (no JavaScript: links set a cookie). */
.look { position: relative; }
.look summary { list-style: none; cursor: pointer; }
.look summary::-webkit-details-marker { display: none; }
.look-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 230px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 16px 40px -20px rgb(0 0 0 / .45); }
.look-h { margin: 0 0 6px; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.look-h + .seg { margin-bottom: 14px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.seg a { flex: 1; text-align: center; padding: 4px 0; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: .9rem; }
.seg a[aria-current] { background: var(--accent); color: var(--accent-ink); }
.colours { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; }
.colours a { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: .9rem; text-transform: capitalize; }
.colours a:hover { background: var(--bg); }
.colours a[aria-current] { font-weight: 700; }
.colours a[aria-current]::after { content: "✓"; margin-left: auto; color: var(--accent); }
.look-reset { margin: 10px 0 0; font-size: .85rem; }

/* Home: intro, one search, topic pills, a featured post, then the list. */
.intro-h { font-size: clamp(2rem, 1.2rem + 3.4vw, 3rem); letter-spacing: -.02em; margin-bottom: .35em; }
.blog .lede { font-size: 1.15rem; line-height: 1.6; }
.blog-head { margin-bottom: 28px; }
.search-form { display: flex; gap: 8px; margin: 0 0 22px; }
.search-form input { flex: 1; min-width: 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; }
.search-form .btn { border-radius: 999px; }
.pills { list-style: none; margin: 0 0 44px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pills a { display: inline-flex; gap: 6px; align-items: baseline; padding: 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: .92rem; }
.pills a:hover { border-color: var(--accent); color: var(--accent); }
.pills .count { color: var(--muted); font-size: .8rem; }
.eyebrow { margin: 0 0 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.eyebrow a { color: var(--accent); text-decoration: none; }
.featured { padding: 0 0 36px; margin-bottom: 36px; border-bottom: 1px solid var(--line); }
.featured h2 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2rem); line-height: 1.25; letter-spacing: -.015em; margin: 0 0 10px; }
.featured h2 a, .post-title a { color: var(--text); text-decoration: none; }
.featured h2 a:hover, .post-title a:hover { color: var(--accent); }
.featured .summary { font-size: 1.05rem; }
.meta { margin: 8px 0 0; color: var(--muted); font-size: .88rem; }
.meta a { color: var(--muted); }
.section-h { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px; }
.post-list li { display: block; padding: 22px 0; border-bottom: 0; }
.post-list li + li { border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.post-title { font-size: 1.25rem; line-height: 1.35; letter-spacing: -.01em; }
.post-list .post-link { font-weight: 650; }
.summary { font-size: .98rem; line-height: 1.55; margin-top: 6px; }
.more-archive a { font-weight: 600; text-decoration: none; }

/* Calendar box on the archive and month/day pages. */
.cal-box { max-width: 320px; margin: 0 0 32px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; }
/* A padded box sets its own inner spacing: the first and last child add no margin to it. */
.card > :first-child, .themes > :first-child, .cal-box > :first-child { margin-top: 0; }
.card > :last-child, .themes > :last-child, .cal-box > :last-child { margin-bottom: 0; }

/* Post page */
.post h1 { font-size: clamp(1.9rem, 1.2rem + 2.8vw, 2.7rem); letter-spacing: -.02em; line-height: 1.15; }
.prose { font-size: 1.2rem; line-height: 1.8; }
.prose h2 { margin-top: 2em; letter-spacing: -.01em; }
.tags a { border: 0; background: var(--surface); }
.share { border-top: 0; padding-top: 0; }
.author { margin: 40px 0; padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.author .eyebrow { margin-bottom: 2px; }
.author-name { font-size: 1.1rem; margin: 0 0 4px; }
.author-bio { margin: 0; color: var(--muted); font-size: .95rem; }
.series a { border: 0; background: var(--surface); }
.crumbs { font-size: .85rem; }

/* Footer: one quiet line to follow, one for the small print. */
.blog .foot { border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); padding: 28px 0 48px; }
.foot-follow { margin: 0 0 6px; }
.foot-legal { margin: 0; font-size: .82rem; }

@media (max-width: 640px) {
  .blog .nav-label, .nav-quiet { display: none; }
  .blog .brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } /* the owl is the logo */
  .blog .nav { gap: 8px; }
  .blog .top nav { gap: 0; }
  .blog .top nav > a, .look summary { padding: 6px 6px; font-size: .9rem; }
  .blog .top nav a.btn { padding: 6px 10px; }
  .look-menu { right: -60px; }
  .blog main { padding-top: 32px; }
}

/* ---- Publication design (after Substack, Ghost and Medium) ---- */
/* Type: Source Serif 4 for everything (see :root). A writer's chosen font
   still wins. */
.blog { --read: var(--serif);
        --ui: var(--font);
        font-family: var(--read); }
.blog .prose { font-family: var(--read); }
.blog .meta, .blog .hint, .blog .eyebrow, .blog .tabs, .blog .list-tabs, .blog .btn, .blog .look-menu, .blog .crumbs,
.blog .byline-meta, .blog .section-h, .blog .foot, .blog .pills, .blog input, .blog .share, .blog .reactions { font-family: var(--ui); }

/* Header: logo left, actions right, then a row of section tabs. */
.blog .top { position: static; }
.blog .nav { min-height: 60px; }
.actions-nav { display: flex; align-items: center; gap: 4px; }
.icon-link { font-size: 1.25rem; line-height: 1; }
.look summary { font-family: var(--read); font-weight: 600; }
.tabs { border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.tabs-row { display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.tabs-row::-webkit-scrollbar { display: none; }
.tabs a { padding: 12px 0; color: var(--muted); text-decoration: none; font-size: .9rem; border-bottom: 2px solid transparent; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--text); }
.tabs .tab-cta { margin-left: auto; color: var(--accent); }

/* Welcome block on the home page. */
.welcome { text-align: center; max-width: 560px; margin: 8px auto 48px; }
.welcome-icon { width: 72px; height: 72px; border-radius: 16px; margin-bottom: 12px; }
.welcome h1 { font-size: clamp(2.1rem, 1.4rem + 3vw, 3rem); letter-spacing: -.02em; margin-bottom: .2em; }
.welcome-tag { font-size: 1.25rem; margin: 0 0 6px; }
.welcome-desc { color: var(--muted); margin: 0 0 22px; }
.subscribe-inline { display: flex; gap: 8px; max-width: 440px; margin: 0 auto 8px; }
.subscribe-inline input { flex: 1; min-width: 0; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font-size: 1rem; }

/* Covers: an uploaded picture, or the topic's own tile. */
.thumb { display: block; border-radius: 10px; object-fit: cover; }
.thumb.small { width: 120px; height: 80px; }
.thumb.big { width: 100%; aspect-ratio: 16 / 8; }
.topic-cover { position: relative; overflow: hidden; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--c1), var(--c2)); }
.topic-cover::after { content: ""; position: absolute; inset: 0; opacity: .18;
  background: radial-gradient(circle at 80% 20%, #fff 0 18%, transparent 19%), radial-gradient(circle at 15% 85%, #fff 0 10%, transparent 11%); }
.topic-cover .mark { font: 700 1.6rem/1 var(--read); letter-spacing: .02em; position: relative; z-index: 1; }
.thumb.big .mark { font-size: clamp(3rem, 2rem + 5vw, 5.5rem); }
.topic-cover .cover-name { position: absolute; left: 16px; bottom: 12px; z-index: 1; font: 600 .8rem/1 var(--ui); text-transform: uppercase; letter-spacing: .1em; opacity: .9; }
.tone-0 { --c1: #1e3a5f; --c2: #3f7cac; } .tone-1 { --c1: #6b2d5c; --c2: #b65d8c; }
.tone-2 { --c1: #1f5135; --c2: #4f9a6a; } .tone-3 { --c1: #8a3b12; --c2: #d9822b; }
.tone-4 { --c1: #2d2a6e; --c2: #6c63c7; } .tone-5 { --c1: #0f4c5c; --c2: #2a9d8f; }
.tone-6 { --c1: #5c2a1e; --c2: #b5523b; } .tone-7 { --c1: #3b3b3b; --c2: #7a7a7a; }

/* Featured (newest) post. */
.featured { border-bottom: 0; padding-bottom: 8px; margin-bottom: 28px; }
.featured-cover { display: block; margin-bottom: 18px; }
.featured h2 { font-size: clamp(1.6rem, 1.1rem + 2vw, 2.2rem); }

/* Latest / Top tabs, then rows with a thumbnail on the right. */
.list-tabs { display: flex; gap: 6px; margin: 0 0 6px; border-bottom: 1px solid var(--line); }
.list-tabs a { padding: 8px 12px; color: var(--muted); text-decoration: none; font-size: .9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.list-tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--text); font-weight: 600; }
.post-list .row { display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; padding: 22px 0; }
.row-text { min-width: 0; flex: 1; }
.row-thumb { flex: none; }
.post-title { font-size: 1.3rem; }
.post-title a { color: var(--text); text-decoration: none; }
.post-title a:hover { color: var(--accent); }

/* Topics page: a block per topic, cover beside its newest posts. */
.series-block { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; padding: 28px 0; border-top: 1px solid var(--line); }
.series-cover .thumb.big { aspect-ratio: 1; }
.series-body h2 { margin: 0 0 4px; font-size: 1.6rem; }
.series-body h2 a { color: var(--text); text-decoration: none; }
.series-list { list-style: none; padding: 0; margin: 12px 0; }
.series-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.series-list a { color: var(--text); text-decoration: none; }
.series-list a:hover { color: var(--accent); }
.series-all { font-family: var(--ui); font-weight: 600; text-decoration: none; font-size: .95rem; }
.browse-h { margin-top: 40px; }

/* Post page: subtitle and a byline row with the author's photo. */
.post-sub { font-size: 1.3rem; line-height: 1.45; color: var(--muted); margin: 0 0 20px; }
.byline-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; margin-bottom: 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.byline-photo { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; display: block; }
.byline-name { margin: 0; font-family: var(--ui); font-weight: 600; font-size: .95rem; }
.byline-name a { color: var(--text); text-decoration: none; }
.byline-name .follow { color: var(--accent); font-weight: 500; }
.byline-meta { margin: 2px 0 0; color: var(--muted); font-size: .85rem; }
.post-cover { display: block; width: 100%; border-radius: 12px; margin: 16px 0 8px; }

@media (max-width: 640px) {
  .thumb.small { width: 84px; height: 64px; }
  .post-title { font-size: 1.12rem; }
  .post-list .summary { display: none; }
  .series-block { grid-template-columns: 1fr; gap: 14px; }
  .series-cover .thumb.big { aspect-ratio: 16 / 7; }
  .subscribe-inline { flex-direction: column; }
}
.featured-cover, .row-thumb, .series-cover { text-decoration: none; }
.icon-link { display: inline-flex; align-items: center; }
.series-list .hint { white-space: nowrap; }

/* Start here: a card per topic on the home page */
.start-here { margin: 8px 0 40px; }
.start-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.start-head .section-h { margin: 0; }
.start-head .search-form { margin: 0; flex: 1 1 280px; max-width: 460px; }
.start-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.start-card { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); border-radius: 12px; padding: 0 0 14px; overflow: hidden; background: var(--surface); }
.start-card > *:not(.start-cover) { margin-left: 14px; margin-right: 14px; }
.start-cover { display: block; }
.start-cover .thumb { width: 100%; height: 110px; border-radius: 0; }
.start-card h3 { margin: 6px 14px 0; font-size: 1.1rem; }
.start-card h3 a { text-decoration: none; }
.start-card .hint { margin-top: 0; margin-bottom: 0; }
.start-first { display: flex; flex-direction: column; gap: 2px; text-decoration: none; font-weight: 600; line-height: 1.35; }
.start-first .hint { font-weight: 400; }
.start-links { margin: auto 14px 0; font-size: .9rem; }
.start-more { margin: 16px 0 0; }

/* A topic read as a series */
.order-switch { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.order-switch a { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; text-decoration: none; font-size: .9rem; }
.order-switch a[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.part-label { margin: 0 0 2px; font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.part-line { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: .9rem; }
.part-line a { text-decoration: none; font-weight: 600; }
.part-line progress { flex: 1; max-width: 180px; height: 6px; accent-color: var(--accent); }

/* Browse all: calendar, months, topics and tags side by side */
.jump { margin: 8px 0 0; font-size: .95rem; }
.browse-grid { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 28px; align-items: start; margin-bottom: 36px; }
.browse-grid .archive { margin: 0; }
@media (max-width: 700px) { .browse-grid { grid-template-columns: minmax(0, 1fr); } }
.start-cover, .start-cover * { text-decoration: none; }
img.thumb { display: block; object-fit: cover; }
.org-cover summary { cursor: pointer; }

/* Every cover is 1200x630 (photos and drawn ones alike). Show it in that
   shape everywhere, so nothing is cropped out of context. */
.thumb, .thumb.big, .series-cover .thumb.big, .start-cover .thumb { aspect-ratio: 1200 / 630; height: auto; }
.thumb.small { width: 128px; height: auto; }
.start-cover .thumb { width: 100%; }
@media (max-width: 640px) {
  .thumb.small { width: 104px; }
  .series-cover .thumb.big { aspect-ratio: 1200 / 630; }
}

/* Callouts: a quote block in a post reads as a highlighted note
   ("Remember this", "Case file" notes), not as faded text. */
.blog .prose blockquote { margin: 28px 0; padding: 16px 20px; border: 0; border-left: 4px solid var(--accent);
  background: var(--surface); border-radius: 0 12px 12px 0; color: var(--text); }
.blog .prose blockquote > :first-child { margin-top: 0; }
.blog .prose blockquote > :last-child { margin-bottom: 0; }
.blog .prose blockquote strong:first-child { color: var(--accent); }
.blog .prose table { margin: 20px 0; font-size: .95em; }
.blog .prose th { background: var(--surface); text-align: left; }
.blog .prose blockquote thead { display: none; }

/* Diagrams: an Expand button, and a full-screen viewer with zoom and pan
   (static/viewer.js; without it diagrams scroll as before). */
.prose figure.diagram { position: relative; }
.diagram-expand { position: sticky; left: 100%; float: right; margin: 0 0 6px 8px; padding: 4px 10px; font: 600 .8rem/1.4 var(--ui, system-ui, sans-serif);
  color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.diagram-expand:hover, .diagram-expand:focus-visible { border-color: var(--accent); color: var(--accent); }
.prose figure.diagram img.zoomable { cursor: zoom-in; }
.dv { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: #fff; color: #1c1917; display: none; flex-direction: column; overflow: hidden; }
.dv[open] { display: flex; }
.dv.dv-dark { background: #111; color: #f5f5f4; }
.dv::backdrop { background: rgba(0, 0, 0, .6); }
.dv-bar { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; border-bottom: 1px solid rgba(127, 127, 127, .3);
  font: 600 .9rem/1 var(--ui, system-ui, sans-serif); }
.dv-btn { min-width: 44px; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid rgba(127, 127, 127, .45);
  background: transparent; color: inherit; font: inherit; font-size: 1.05rem; cursor: pointer; }
.dv-btn:hover, .dv-btn:focus-visible { border-color: #d9822b; color: #d9822b; }
.dv-close { margin-left: 12px; }
.dv-level { min-width: 52px; text-align: center; font-variant-numeric: tabular-nums; }
.dv-stage { position: relative; flex: 1; overflow: hidden; touch-action: none; cursor: grab; }
.dv-stage:active { cursor: grabbing; }
.dv-img { position: absolute; top: 0; left: 0; max-width: none; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; }
.dv-hint { margin: 0; padding: 8px; text-align: center; font: .8rem/1.3 var(--ui, system-ui, sans-serif); opacity: .7; }
@media (max-width: 560px) { .dv-hint { display: none; } }

/* Wide pages: home, Browse all, topic, tag, month and search listings use
   the whole width on large screens; posts keep the reading column. */
.blog .wrap { width: min(1200px, 100% - 48px); }
.blog .narrow { width: min(700px, 100% - 40px); }
.blog .wide-page { width: min(1200px, 100% - 48px); }
@media (min-width: 900px) {
  .wide-page .blog-head { max-width: 760px; }
  .wide-page .welcome { max-width: 640px; }
  /* The newest post: a big cover beside its title. */
  .wide-page .featured { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); column-gap: 36px; align-items: center; }
  .wide-page .featured-cover { grid-row: 1 / span 5; margin: 0; }
  .wide-page .featured > :not(.featured-cover) { grid-column: 2; }
  /* Posts as cards with their picture on top. */
  .wide-page .post-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px 24px; }
  .wide-page .post-list li, .wide-page .post-list li + li { border: 0; padding: 0; }
  .wide-page .post-list .row { display: flex; flex-direction: column; gap: 12px; padding: 0; }
  .wide-page .post-list .row-thumb { order: -1; align-self: stretch; }
  .wide-page .post-list .thumb.small { width: 100%; border-radius: 12px; }
  .wide-page .post-list .post-title { font-size: 1.15rem; line-height: 1.35; }
  .wide-page .post-list .summary { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  /* Topics four across on Home, two blocks across on Browse all. */
  .wide-page .start-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .wide-page .series-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
  .wide-page .series-grid .series-block { grid-template-columns: 200px minmax(0, 1fr); }
  .wide-page .browse-grid { grid-template-columns: 300px minmax(0, 1fr); }
  .wide-page .browse-grid .archive { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px 32px; }
}
@media (min-width: 900px) and (max-width: 1100px) {
  .wide-page .series-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Inline forms (subscribe, search): the input and its button are one unit,
   the same height and the same corners, everywhere. */
.blog .search-form, .blog .subscribe-inline { display: flex; align-items: stretch; gap: 8px; }
.blog .search-form input, .blog .subscribe-inline input { box-sizing: border-box; height: 44px; margin: 0; padding: 0 14px; border-radius: 12px; line-height: normal; }
.blog .search-form .btn, .blog .subscribe-inline .btn { box-sizing: border-box; height: 44px; margin: 0; padding: 0 18px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; line-height: 1; font-size: .95rem; }
.blog .search-form.big input, .blog .search-form.big .btn, .blog .subscribe-inline input, .blog .subscribe-inline .btn { height: 48px; }

/* The home welcome on large screens: one compact band (owl and name on the
   left, subscribe on the right) so the posts start above the fold, even at
   the 125-150% zoom many Windows laptops use. */
@media (min-width: 900px) {
  .wide-page .welcome { max-width: none; margin: 0 0 28px; text-align: left;
    display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(320px, 420px);
    grid-template-areas: "icon title form" "icon tag form" "icon desc hint";
    column-gap: 20px; align-items: center; padding: 20px 24px;
    border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
  .wide-page .welcome-icon { grid-area: icon; width: 64px; height: 64px; margin: 0; align-self: center; }
  .wide-page .welcome h1 { grid-area: title; font-size: 2rem; margin: 0; align-self: end; }
  .wide-page .welcome-tag { grid-area: tag; font-size: 1.05rem; margin: 0; }
  .wide-page .welcome-desc { grid-area: desc; margin: 0; align-self: start; }
  .wide-page .welcome .subscribe-inline { grid-area: form; margin: 0; align-self: end; }
  .wide-page .welcome .hint { grid-area: hint; margin: 6px 0 0; align-self: start; }
  .wide-page .blog-head:has(.welcome) { max-width: none; margin-bottom: 0; }
}

/* Touch screens: every control in the header and menus is at least 44px
   tall, so it can be hit with a thumb. */
@media (max-width: 700px), (pointer: coarse) {
  .top .brand, .actions-nav .icon-link, .actions-nav .btn.small, .look summary,
  .look-menu .seg a, .look-menu .colours a { min-height: 44px; display: inline-flex; align-items: center; }
  .actions-nav .icon-link, .look summary { min-width: 44px; justify-content: center; }
  .crumbs a { display: inline-block; padding: 13px 0; margin: -13px 0; }
}

/* Section tabs: Home and Browse all fixed on the left, "Start your own
   blog" fixed on the right, the topics scrolling between them. */
.tabs-row { align-items: stretch; overflow: visible; gap: 0; }
.tabs-fixed { display: flex; gap: 22px; flex: none; padding-right: 22px; }
.tabs-scroll { display: flex; gap: 22px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; white-space: nowrap; scroll-behavior: smooth; }
.tabs-scroll::-webkit-scrollbar { display: none; }
.tabs-scroll.fade-l { mask-image: linear-gradient(to right, transparent, #000 32px); }
.tabs-scroll.fade-r { mask-image: linear-gradient(to left, transparent, #000 32px); }
.tabs-scroll.fade-l.fade-r { mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent); }
.tabs .tab-cta { flex: none; margin-left: 0; padding-left: 22px; }
.tabs a { flex: none; }
.tabs-arrow { flex: none; align-self: center; width: 30px; height: 30px; margin: 0 4px; padding: 0; border: 1px solid var(--line); border-radius: 50%;
  background: var(--surface); color: var(--text); font-size: 1.1rem; line-height: 1; cursor: pointer; }
.tabs-arrow:hover { border-color: var(--muted); }
@media (max-width: 700px) {
  .tabs-fixed { gap: 16px; padding-right: 14px; }
  .tabs-scroll { gap: 16px; }
  .tabs .tab-cta { padding-left: 14px; }
  .tabs-arrow { display: none; }
}
.cta-short { display: none; }
@media (max-width: 700px) { .cta-long { display: none; } .cta-short { display: inline; } }
@media (max-width: 560px) {
  .blog .subscribe-inline input, .blog .subscribe-inline .btn { flex: none; }
}
@media (max-width: 700px), (pointer: coarse) {
  .order-switch a { min-height: 44px; display: inline-flex; align-items: center; }
}

/* Headings keep a 600 weight; numbers line up in tables and stats. Form
   controls use the page font instead of the browser's default sans. */
h1, h2, h3, .brand, .post-title, .welcome h1, .start-card h3 { font-family: var(--display); font-weight: 600; }
table, .meta, .hint, .cal, time { font-variant-numeric: tabular-nums lining-nums; }
button, input, select { font-family: inherit; }

/* Menus open above everything in the header, including the section tabs
   (whose fade gives them a layer of their own). */
.look-menu { z-index: 30; }
@media (max-width: 700px), (pointer: coarse) { .look-menu .seg a { justify-content: center; } }

/* Policy tables on phones: each row becomes a small card, every cell
   labelled, instead of a table that scrolls sideways. */
@media (max-width: 600px) {
  .legal table, .legal tbody, .legal tr, .legal td { display: block; width: 100%; overflow: visible; }
  .legal thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .legal tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .legal td { border: 0; padding: 2px 0; }
  .legal td::before { content: attr(data-label); display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
}

/* Images carry their real size (1200x630) so the page doesn't jump while they
   load; the CSS width wins and the height follows the picture. */
.post-cover { height: auto; aspect-ratio: 1200 / 630; }

/* The Search check in the post editor and its summary on the dashboard. */
.search-check { margin: 28px 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.search-check h2 { margin: 0 0 4px; font-size: 1.15rem; }
.search-check ul { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.search-check li { display: flex; gap: 10px; align-items: baseline; line-height: 1.5; }
.search-check li > span[aria-hidden] { flex: none; width: 1.4em; height: 1.4em; display: inline-grid; place-items: center; border-radius: 50%; font-size: .8rem; font-weight: 700; }
.search-check .ok-item > span[aria-hidden] { color: var(--ok); }
.search-check .fix-item > span[aria-hidden] { background: var(--accent); color: var(--accent-ink); }
.search-check .note-item > span[aria-hidden] { border: 1px solid var(--line); color: var(--muted); font-style: italic; }
.search-check .ok-item { color: var(--muted); }
.search-ok { color: var(--ok); white-space: nowrap; }

/* ---- Coloured code (GitHub's palettes, made by chroma; class names start with hl-) ---- */
.prose pre .hl-k { color: #cf222e }
.prose pre .hl-kc { color: #cf222e }
.prose pre .hl-kd { color: #cf222e }
.prose pre .hl-kn { color: #cf222e }
.prose pre .hl-kp { color: #cf222e }
.prose pre .hl-kr { color: #cf222e }
.prose pre .hl-kt { color: #cf222e }
.prose pre .hl-na { color: #1f2328 }
.prose pre .hl-nc { color: #1f2328 }
.prose pre .hl-no { color: #0550ae }
.prose pre .hl-nd { color: #0550ae }
.prose pre .hl-ni { color: #6639ba }
.prose pre .hl-nl { color: #990000; font-weight: bold }
.prose pre .hl-nn { color: #24292e }
.prose pre .hl-nx { color: #1f2328 }
.prose pre .hl-nt { color: #0550ae }
.prose pre .hl-nb { color: #6639ba }
.prose pre .hl-bp { color: #6a737d }
.prose pre .hl-nv { color: #953800 }
.prose pre .hl-vc { color: #953800 }
.prose pre .hl-vg { color: #953800 }
.prose pre .hl-vi { color: #953800 }
.prose pre .hl-vm { color: #953800 }
.prose pre .hl-nf { color: #6639ba }
.prose pre .hl-fm { color: #6639ba }
.prose pre .hl-s { color: #0a3069 }
.prose pre .hl-sa { color: #0a3069 }
.prose pre .hl-sb { color: #0a3069 }
.prose pre .hl-sc { color: #0a3069 }
.prose pre .hl-dl { color: #0a3069 }
.prose pre .hl-sd { color: #0a3069 }
.prose pre .hl-s2 { color: #0a3069 }
.prose pre .hl-se { color: #0a3069 }
.prose pre .hl-sh { color: #0a3069 }
.prose pre .hl-si { color: #0a3069 }
.prose pre .hl-sx { color: #0a3069 }
.prose pre .hl-sr { color: #0a3069 }
.prose pre .hl-s1 { color: #0a3069 }
.prose pre .hl-ss { color: #032f62 }
.prose pre .hl-m { color: #0550ae }
.prose pre .hl-mb { color: #0550ae }
.prose pre .hl-mf { color: #0550ae }
.prose pre .hl-mh { color: #0550ae }
.prose pre .hl-mi { color: #0550ae }
.prose pre .hl-il { color: #0550ae }
.prose pre .hl-mo { color: #0550ae }
.prose pre .hl-o { color: #0550ae }
.prose pre .hl-ow { color: #0550ae }
.prose pre .hl-or { color: #0550ae }
.prose pre .hl-p { color: #1f2328 }
.prose pre .hl-c { color: #57606a }
.prose pre .hl-ch { color: #57606a }
.prose pre .hl-cm { color: #57606a }
.prose pre .hl-c1 { color: #57606a }
.prose pre .hl-cs { color: #57606a }
.prose pre .hl-cp { color: #57606a }
.prose pre .hl-cpf { color: #57606a }
.prose pre .hl-gd { color: #82071e }
.prose pre .hl-ge { color: #1f2328 }
.prose pre .hl-gi { color: #116329 }
.prose pre .hl-go { color: #1f2328 }
.prose pre .hl-gl { text-decoration: underline }
.prose pre .hl-w { color: #ffffff }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="day"]) .prose pre .hl-bp { color: inherit }
  :root:not([data-theme="day"]) .prose pre .hl-na { color: inherit }
  :root:not([data-theme="day"]) .prose pre .hl-nb { color: inherit }
  :root:not([data-theme="day"]) .prose pre .hl-nx { color: inherit }
  :root:not([data-theme="day"]) .prose pre .hl-p { color: inherit }
  :root:not([data-theme="day"]) .prose pre .hl-k { color: #ff7b72 }
  :root:not([data-theme="day"]) .prose pre .hl-kc { color: #79c0ff }
  :root:not([data-theme="day"]) .prose pre .hl-kd { color: #ff7b72 }
  :root:not([data-theme="day"]) .prose pre .hl-kn { color: #ff7b72 }
  :root:not([data-theme="day"]) .prose pre .hl-kp { color: #79c0ff }
  :root:not([data-theme="day"]) .prose pre .hl-kr { color: #ff7b72 }
  :root:not([data-theme="day"]) .prose pre .hl-kt { color: #ff7b72 }
  :root:not([data-theme="day"]) .prose pre .hl-nc { color: #f0883e; font-weight: bold }
  :root:not([data-theme="day"]) .prose pre .hl-no { color: #79c0ff; font-weight: bold }
  :root:not([data-theme="day"]) .prose pre .hl-nd { color: #d2a8ff; font-weight: bold }
  :root:not([data-theme="day"]) .prose pre .hl-ni { color: #ffa657 }
  :root:not([data-theme="day"]) .prose pre .hl-ne { color: #f0883e; font-weight: bold }
  :root:not([data-theme="day"]) .prose pre .hl-nl { color: #79c0ff; font-weight: bold }
  :root:not([data-theme="day"]) .prose pre .hl-nn { color: #ff7b72 }
  :root:not([data-theme="day"]) .prose pre .hl-py { color: #79c0ff }
  :root:not([data-theme="day"]) .prose pre .hl-nt { color: #7ee787 }
  :root:not([data-theme="day"]) .prose pre .hl-nv { color: #79c0ff }
  :root:not([data-theme="day"]) .prose pre .hl-vc { color: #79c0ff }
  :root:not([data-theme="day"]) .prose pre .hl-vg { color: #79c0ff }
  :root:not([data-theme="day"]) .prose pre .hl-vi { color: #79c0ff }
  :root:not([data-theme="day"]) .prose pre .hl-vm { color: #79c0ff }
  :root:not([data-theme="day"]) .prose pre .hl-nf { color: #d2a8ff; font-weight: bold }
  :root:not([data-theme="day"]) .prose pre .hl-fm { color: #d2a8ff; font-weight: bold }
  :root:not([data-theme="day"]) .prose pre .hl-l { color: #a5d6ff }
  :root:not([data-theme="day"]) .prose pre .hl-ld { color: #79c0ff }
  :root:not([data-theme="day"]) .prose pre .hl-s { color: #a5d6ff }
  :root:not([data-theme="day"]) .prose pre .hl-sa { color: #79c0ff }
  :root:not([data-theme="day"]) .prose pre .hl-sb { color: #a5d6ff }
  :root:not([data-theme="day"]) .prose pre .hl-sc { color: #a5d6ff }
  :root:not([data-theme="day"]) .prose pre .hl-dl { color: #79c0ff }
  :root:not([data-theme="day"]) .prose pre .hl-sd { color: #a5d6ff }
  :root:not([data-theme="day"]) .prose pre .hl-s2 { color: #a5d6ff }
  :root:not([data-theme="day"]) .prose pre .hl-se { color: #79c0ff }
  :root:not([data-theme="day"]) .prose pre .hl-sh { color: #79c0ff }
  :root:not([data-theme="day"]) .prose pre .hl-si { color: #a5d6ff }
  :root:not([data-theme="day"]) .prose pre .hl-sx { color: #a5d6ff }
  :root:not([data-theme="day"]) .prose pre .hl-sr { color: #79c0ff }
  :root:not([data-theme="day"]) .prose pre .hl-s1 { color: #a5d6ff }
  :root:not([data-theme="day"]) .prose pre .hl-ss { color: #a5d6ff }
  :root:not([data-theme="day"]) .prose pre .hl-m { color: #a5d6ff }
  :root:not([data-theme="day"]) .prose pre .hl-mb { color: #a5d6ff }
  :root:not([data-theme="day"]) .prose pre .hl-mf { color: #a5d6ff }
  :root:not([data-theme="day"]) .prose pre .hl-mh { color: #a5d6ff }
  :root:not([data-theme="day"]) .prose pre .hl-mi { color: #a5d6ff }
  :root:not([data-theme="day"]) .prose pre .hl-il { color: #a5d6ff }
  :root:not([data-theme="day"]) .prose pre .hl-mo { color: #a5d6ff }
  :root:not([data-theme="day"]) .prose pre .hl-o { color: #ff7b72; font-weight: bold }
  :root:not([data-theme="day"]) .prose pre .hl-ow { color: #ff7b72; font-weight: bold }
  :root:not([data-theme="day"]) .prose pre .hl-or { color: #ff7b72; font-weight: bold }
  :root:not([data-theme="day"]) .prose pre .hl-c { color: #8b949e; font-style: italic }
  :root:not([data-theme="day"]) .prose pre .hl-ch { color: #8b949e; font-style: italic }
  :root:not([data-theme="day"]) .prose pre .hl-cm { color: #8b949e; font-style: italic }
  :root:not([data-theme="day"]) .prose pre .hl-c1 { color: #8b949e; font-style: italic }
  :root:not([data-theme="day"]) .prose pre .hl-cs { color: #8b949e; font-weight: bold; font-style: italic }
  :root:not([data-theme="day"]) .prose pre .hl-cp { color: #8b949e; font-weight: bold; font-style: italic }
  :root:not([data-theme="day"]) .prose pre .hl-cpf { color: #8b949e; font-weight: bold; font-style: italic }
  :root:not([data-theme="day"]) .prose pre .hl-gd { color: #ffa198 }
  :root:not([data-theme="day"]) .prose pre .hl-ge { font-style: italic }
  :root:not([data-theme="day"]) .prose pre .hl-gr { color: #ffa198 }
  :root:not([data-theme="day"]) .prose pre .hl-gh { color: #79c0ff; font-weight: bold }
  :root:not([data-theme="day"]) .prose pre .hl-gi { color: #56d364 }
  :root:not([data-theme="day"]) .prose pre .hl-go { color: #8b949e }
  :root:not([data-theme="day"]) .prose pre .hl-gp { color: #8b949e }
  :root:not([data-theme="day"]) .prose pre .hl-gs { font-weight: bold }
  :root:not([data-theme="day"]) .prose pre .hl-gu { color: #79c0ff }
  :root:not([data-theme="day"]) .prose pre .hl-gt { color: #ff7b72 }
  :root:not([data-theme="day"]) .prose pre .hl-gl { text-decoration: underline }
  :root:not([data-theme="day"]) .prose pre .hl-w { color: #6e7681 }
}
:root[data-theme="night"] .prose pre .hl-k { color: #ff7b72 }
:root[data-theme="night"] .prose pre .hl-kc { color: #79c0ff }
:root[data-theme="night"] .prose pre .hl-kd { color: #ff7b72 }
:root[data-theme="night"] .prose pre .hl-kn { color: #ff7b72 }
:root[data-theme="night"] .prose pre .hl-kp { color: #79c0ff }
:root[data-theme="night"] .prose pre .hl-kr { color: #ff7b72 }
:root[data-theme="night"] .prose pre .hl-kt { color: #ff7b72 }
:root[data-theme="night"] .prose pre .hl-nc { color: #f0883e; font-weight: bold }
:root[data-theme="night"] .prose pre .hl-no { color: #79c0ff; font-weight: bold }
:root[data-theme="night"] .prose pre .hl-nd { color: #d2a8ff; font-weight: bold }
:root[data-theme="night"] .prose pre .hl-ni { color: #ffa657 }
:root[data-theme="night"] .prose pre .hl-ne { color: #f0883e; font-weight: bold }
:root[data-theme="night"] .prose pre .hl-nl { color: #79c0ff; font-weight: bold }
:root[data-theme="night"] .prose pre .hl-nn { color: #ff7b72 }
:root[data-theme="night"] .prose pre .hl-py { color: #79c0ff }
:root[data-theme="night"] .prose pre .hl-nt { color: #7ee787 }
:root[data-theme="night"] .prose pre .hl-nv { color: #79c0ff }
:root[data-theme="night"] .prose pre .hl-vc { color: #79c0ff }
:root[data-theme="night"] .prose pre .hl-vg { color: #79c0ff }
:root[data-theme="night"] .prose pre .hl-vi { color: #79c0ff }
:root[data-theme="night"] .prose pre .hl-vm { color: #79c0ff }
:root[data-theme="night"] .prose pre .hl-nf { color: #d2a8ff; font-weight: bold }
:root[data-theme="night"] .prose pre .hl-fm { color: #d2a8ff; font-weight: bold }
:root[data-theme="night"] .prose pre .hl-l { color: #a5d6ff }
:root[data-theme="night"] .prose pre .hl-ld { color: #79c0ff }
:root[data-theme="night"] .prose pre .hl-s { color: #a5d6ff }
:root[data-theme="night"] .prose pre .hl-sa { color: #79c0ff }
:root[data-theme="night"] .prose pre .hl-sb { color: #a5d6ff }
:root[data-theme="night"] .prose pre .hl-sc { color: #a5d6ff }
:root[data-theme="night"] .prose pre .hl-dl { color: #79c0ff }
:root[data-theme="night"] .prose pre .hl-sd { color: #a5d6ff }
:root[data-theme="night"] .prose pre .hl-s2 { color: #a5d6ff }
:root[data-theme="night"] .prose pre .hl-se { color: #79c0ff }
:root[data-theme="night"] .prose pre .hl-sh { color: #79c0ff }
:root[data-theme="night"] .prose pre .hl-si { color: #a5d6ff }
:root[data-theme="night"] .prose pre .hl-sx { color: #a5d6ff }
:root[data-theme="night"] .prose pre .hl-sr { color: #79c0ff }
:root[data-theme="night"] .prose pre .hl-s1 { color: #a5d6ff }
:root[data-theme="night"] .prose pre .hl-ss { color: #a5d6ff }
:root[data-theme="night"] .prose pre .hl-m { color: #a5d6ff }
:root[data-theme="night"] .prose pre .hl-mb { color: #a5d6ff }
:root[data-theme="night"] .prose pre .hl-mf { color: #a5d6ff }
:root[data-theme="night"] .prose pre .hl-mh { color: #a5d6ff }
:root[data-theme="night"] .prose pre .hl-mi { color: #a5d6ff }
:root[data-theme="night"] .prose pre .hl-il { color: #a5d6ff }
:root[data-theme="night"] .prose pre .hl-mo { color: #a5d6ff }
:root[data-theme="night"] .prose pre .hl-o { color: #ff7b72; font-weight: bold }
:root[data-theme="night"] .prose pre .hl-ow { color: #ff7b72; font-weight: bold }
:root[data-theme="night"] .prose pre .hl-or { color: #ff7b72; font-weight: bold }
:root[data-theme="night"] .prose pre .hl-c { color: #8b949e; font-style: italic }
:root[data-theme="night"] .prose pre .hl-ch { color: #8b949e; font-style: italic }
:root[data-theme="night"] .prose pre .hl-cm { color: #8b949e; font-style: italic }
:root[data-theme="night"] .prose pre .hl-c1 { color: #8b949e; font-style: italic }
:root[data-theme="night"] .prose pre .hl-cs { color: #8b949e; font-weight: bold; font-style: italic }
:root[data-theme="night"] .prose pre .hl-cp { color: #8b949e; font-weight: bold; font-style: italic }
:root[data-theme="night"] .prose pre .hl-cpf { color: #8b949e; font-weight: bold; font-style: italic }
:root[data-theme="night"] .prose pre .hl-gd { color: #ffa198 }
:root[data-theme="night"] .prose pre .hl-ge { font-style: italic }
:root[data-theme="night"] .prose pre .hl-gr { color: #ffa198 }
:root[data-theme="night"] .prose pre .hl-gh { color: #79c0ff; font-weight: bold }
:root[data-theme="night"] .prose pre .hl-gi { color: #56d364 }
:root[data-theme="night"] .prose pre .hl-go { color: #8b949e }
:root[data-theme="night"] .prose pre .hl-gp { color: #8b949e }
:root[data-theme="night"] .prose pre .hl-gs { font-weight: bold }
:root[data-theme="night"] .prose pre .hl-gu { color: #79c0ff }
:root[data-theme="night"] .prose pre .hl-gt { color: #ff7b72 }
:root[data-theme="night"] .prose pre .hl-gl { text-decoration: underline }
:root[data-theme="night"] .prose pre .hl-w { color: #6e7681 }
:root[data-theme="night"] .prose pre .hl-bp { color: inherit }
:root[data-theme="night"] .prose pre .hl-na { color: inherit }
:root[data-theme="night"] .prose pre .hl-nb { color: inherit }
:root[data-theme="night"] .prose pre .hl-nx { color: inherit }
:root[data-theme="night"] .prose pre .hl-p { color: inherit }

/* ---- Post reading aids ---- */
/* Links to sections: a "#" after each heading, shown on hover or focus
   where there is a mouse, always (faint) on touch screens. */
.prose :is(h1, h2, h3, h4, h5, h6) { scroll-margin-top: 16px; }
.heading-anchor { margin-left: .3em; color: var(--muted); text-decoration: none; font-weight: 400; opacity: .35; }
@media (hover: hover) {
  .heading-anchor { opacity: 0; }
  .prose :is(h1, h2, h3, h4, h5, h6):hover .heading-anchor { opacity: .7; }
}
.heading-anchor:focus-visible, .heading-anchor:hover { opacity: 1; color: var(--accent); }

/* Contents list for long posts (built from the post's headings). */
.toc { margin: 0 0 24px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font: .95rem/1.5 var(--ui, system-ui, sans-serif); }
.toc summary { cursor: pointer; font-weight: 600; }
.toc ol { margin: 8px 0 4px; padding-left: 1.3em; }
.toc ol ol { margin: 2px 0; }
.toc li { margin: 3px 0; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* Note boxes: > [!NOTE], [!TIP], [!IMPORTANT], [!WARNING], [!CAUTION]. */
.prose blockquote.callout { --c: #2f6fdd; margin: 1.4em 0; padding: 8px 16px; border-left: 4px solid var(--c); border-radius: 0 8px 8px 0;
  background: color-mix(in srgb, var(--c) 8%, transparent); color: var(--text); }
.prose .callout-title { margin: 4px 0; font: 700 .9rem/1.4 var(--ui, system-ui, sans-serif); color: var(--c); }
.prose .callout-title::before { margin-right: .4em; }
.prose .callout-note { --c: #2f6fdd; } .prose .callout-note .callout-title::before { content: "ℹ"; }
.prose .callout-tip { --c: #1a7f37; } .prose .callout-tip .callout-title::before { content: "✓"; }
.prose .callout-important { --c: #8250df; } .prose .callout-important .callout-title::before { content: "★"; }
.prose .callout-warning { --c: #b26b00; } .prose .callout-warning .callout-title::before { content: "⚠"; }
.prose .callout-caution { --c: #cf222e; } .prose .callout-caution .callout-title::before { content: "⛔"; }

/* Footnotes. */
.prose sup { line-height: 0; }
.prose .footnote-ref, .prose .footnote-backref { text-decoration: none; }
.prose .footnotes { margin-top: 2.5em; font-size: .92rem; color: var(--muted); }
.prose .footnotes hr { border: 0; border-top: 1px solid var(--line); }
.prose .footnotes li:target, .prose sup:target { background: color-mix(in srgb, var(--accent) 18%, transparent); border-radius: 4px; }

/* Checklists. */
.prose li:has(> input[type="checkbox"]) { list-style: none; margin-left: -1.3em; }
.prose input[type="checkbox"] { margin: 0 .45em 0 0; vertical-align: -1px; accent-color: var(--accent); }

/* Copy buttons on code blocks and diagrams (static/post.js). */
.code-wrap { position: relative; }
.code-copy { position: absolute; top: 6px; right: 6px; padding: 3px 9px; font: 600 .75rem/1.4 var(--ui, system-ui, sans-serif);
  color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; opacity: .85; }
@media (hover: hover) { .code-copy { opacity: 0; } .code-wrap:hover .code-copy, .code-copy:focus-visible { opacity: 1; } }
.code-copy:hover, .code-copy:focus-visible { color: var(--accent); border-color: var(--accent); }
.diagram-tools { position: sticky; left: 100%; float: right; display: flex; gap: 6px; margin: 0 0 6px 8px; }
.diagram-tools .diagram-expand { position: static; float: none; margin: 0; }

/* Photos in posts open in the viewer too (static/viewer.js). */
.prose img.zoomable, .post-cover.zoomable { cursor: zoom-in; }

/* The phone's own share sheet, where the browser has one (static/post.js). */
.share-native { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }

/* Replies to comments: one level, indented under the comment. */
.replies { list-style: none; margin: 8px 0 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); }
.replies .comment { border-bottom: 0; padding: 8px 0; }
.reply details summary { display: inline; cursor: pointer; color: var(--accent); font-size: .9rem; }
.reply details[open] summary { color: var(--muted); }
.reply form { margin-top: 8px; }
.comment-actions { display: flex; gap: 14px; align-items: baseline; }
.preview-banner { margin: 0 0 20px; padding: 10px 14px; border: 1px dashed var(--accent); border-radius: 10px; font-size: .95rem; }

/* Writer's guide and the dashboard's getting-started checklist */
.guide-nav ul { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.guide-nav a { display: inline-block; padding: 4px 0; }
.guide-nav a[aria-current="page"] { font-weight: 600; text-decoration: none; color: var(--text); }
.guide-next { margin-top: 32px; font-weight: 600; }
.tour h2 { font-size: 1.05rem; margin: 0 0 8px; }
.tour-steps { list-style: none; padding: 0; margin: 0 0 8px; }
.tour-steps li { padding: 3px 0; }
.tour-steps .tick { display: inline-block; width: 1.4em; color: var(--accent); }
.tour-steps li.done { color: var(--muted); }
.tour-steps .hint { margin-left: 6px; }
.tour-steps li.next { font-weight: 600; }

/* Listen: the floating reading controls, shown while the post is read aloud */
.listen-float { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 40;
  display: flex; align-items: center; gap: 6px; padding: 6px 12px; max-width: calc(100vw - 32px);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 6px 24px rgb(0 0 0 / .25); }
.listen-float .btn { box-sizing: border-box; height: 40px; margin: 0; padding: 0 14px; line-height: 1; white-space: nowrap; }
.listen-float .listen-icon { width: 40px; padding: 0; }
.listen-where { box-sizing: border-box; height: 40px; display: inline-flex; align-items: center; font-size: .85rem; color: var(--muted); white-space: nowrap; }
@media print { .listen-float { display: none; } }
