/* kbr.sh v1 — "literary essay". Gambetta reads, Switzer labels, Fragment Mono codes. */

@font-face { font-family: "Gambetta"; src: url("fonts/gambetta-400.6c655b13748e.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Gambetta"; src: url("fonts/gambetta-400-italic.23d29ed594a6.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Gambetta"; src: url("fonts/gambetta-500.0315eff29ab3.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Gambetta"; src: url("fonts/gambetta-600.8119744269a9.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("fonts/switzer-400.230159e17d6a.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("fonts/switzer-500.8303be7d0454.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("fonts/switzer-600.6346661ef07c.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Fragment Mono"; src: url("fonts/fragment-mono-400.a963fca36c7e.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

/* ===== Tokens: Fir on Linen ===== */
:root {
    color-scheme: light dark;
    --bg: #f7f6f0;
    --code: #eceae1;
    --rule: #dad8cd;
    --ink: #252217;
    --ink2: #434035;
    --meta: #666359;
    --link: #0e6c43;
    --hover: #004d2d;
    --mark: #deecb8;
    --wave: #33618c;   /* masthead only: a hint of Hokusai's Prussian blue */

    --serif: "Gambetta", Georgia, "Times New Roman", serif;
    --ui: "Switzer", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "Fragment Mono", ui-monospace, "SF Mono", Menlo, monospace;

    --measure: 40rem;
    --gutter: clamp(1.125rem, 4vw, 2rem);
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1b1913;
        --code: #27251e;
        --rule: #37352d;
        --ink: #edebe5;
        --ink2: #cccbc3;
        --meta: #a19e96;
        --link: #76cd9c;
        --hover: #a8e5c0;
        --mark: #434c26;
        --wave: #86abcf;
    }
}

/* ===== Staff-page token bridge =====
   Unversioned staff templates (dashboard, image inbox, activity graph) extend
   the live base.html and use v0's token names. Map them onto Fir on Linen. */
:root {
    --text-50: #f8f7f2;
    --text-100: #f0eeea;
    --text-200: #e1ded1;
    --text-300: #cbc7bb;
    --text-400: #aeab9e;
    --text-500: #8f8c80;
    --text-600: #726f63;
    --text-700: #58554a;
    --text-800: #403d33;
    --text-900: #29261c;
    --text-950: #171613;
    --background-50: #f7f7f4;
    --background-100: #efeeeb;
    --background-200: #e0ded5;
    --background-300: #cac7bf;
    --background-400: #adaba3;
    --background-500: #8e8c84;
    --background-600: #716f67;
    --background-700: #57554e;
    --background-800: #3f3d36;
    --background-900: #282620;
    --background-950: #171614;
    --primary-50: #e4ffee;
    --primary-100: #dcf6e6;
    --primary-200: #a4f3c5;
    --primary-300: #8edbaf;
    --primary-400: #71be93;
    --primary-500: #529f75;
    --primary-600: #328058;
    --primary-700: #0e653f;
    --primary-800: #004c28;
    --primary-900: #003411;
    --primary-950: #061b10;
    --secondary-50: #f5f9ec;
    --secondary-100: #edf0e4;
    --secondary-200: #d9e3bf;
    --secondary-300: #c3cda9;
    --secondary-400: #a6b08d;
    --secondary-500: #88916f;
    --secondary-600: #6b7352;
    --secondary-700: #515a3a;
    --secondary-800: #3a4122;
    --secondary-900: #232a0b;
    --secondary-950: #15170e;
    --accent-50: #e0ffec;
    --accent-100: #d8f8e4;
    --accent-200: #96f6c0;
    --accent-300: #7fdfa9;
    --accent-400: #61c28e;
    --accent-500: #3fa270;
    --accent-600: #158353;
    --accent-700: #00683a;
    --accent-800: #004e22;
    --accent-900: #00360b;
    --accent-950: #031c0e;
    --text: var(--ink);
    --background: var(--bg);
    --primary: var(--link);
    --secondary: var(--code);
    --accent: var(--link);
}
@media (prefers-color-scheme: dark) {
    :root {
        --text-50: #171613;
        --text-100: #29261c;
        --text-200: #403d33;
        --text-300: #58554a;
        --text-400: #726f63;
        --text-500: #8f8c80;
        --text-600: #aeab9e;
        --text-700: #cbc7bb;
        --text-800: #e1ded1;
        --text-900: #f0eeea;
        --text-950: #f8f7f2;
        --background-50: #171614;
        --background-100: #282620;
        --background-200: #3f3d36;
        --background-300: #57554e;
        --background-400: #716f67;
        --background-500: #8e8c84;
        --background-600: #adaba3;
        --background-700: #cac7bf;
        --background-800: #e0ded5;
        --background-900: #efeeeb;
        --background-950: #f7f7f4;
        --primary-50: #061b10;
        --primary-100: #003411;
        --primary-200: #004c28;
        --primary-300: #0e653f;
        --primary-400: #328058;
        --primary-500: #529f75;
        --primary-600: #71be93;
        --primary-700: #8edbaf;
        --primary-800: #a4f3c5;
        --primary-900: #dcf6e6;
        --primary-950: #e4ffee;
        --secondary-50: #15170e;
        --secondary-100: #232a0b;
        --secondary-200: #3a4122;
        --secondary-300: #515a3a;
        --secondary-400: #6b7352;
        --secondary-500: #88916f;
        --secondary-600: #a6b08d;
        --secondary-700: #c3cda9;
        --secondary-800: #d9e3bf;
        --secondary-900: #edf0e4;
        --secondary-950: #f5f9ec;
        --accent-50: #031c0e;
        --accent-100: #00360b;
        --accent-200: #004e22;
        --accent-300: #00683a;
        --accent-400: #158353;
        --accent-500: #3fa270;
        --accent-600: #61c28e;
        --accent-700: #7fdfa9;
        --accent-800: #96f6c0;
        --accent-900: #d8f8e4;
        --accent-950: #e0ffec;
    }
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
img, video, iframe { max-width: 100%; }
img, video { height: auto; }

html {
    scroll-padding-top: 5.5rem; /* anchors land below the pinned header */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scrollbar-color: var(--rule) var(--bg);
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--serif);
    font-size: 1.125rem;
    line-height: 1.6;
    font-kerning: normal;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    overflow-wrap: break-word;
}

::selection { background: var(--mark); color: var(--ink); }

a {
    color: var(--link);
    text-decoration-line: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 0.18em;
    text-decoration-color: color-mix(in oklab, var(--link) 50%, transparent);
    transition: color 0.15s var(--ease), text-decoration-color 0.15s var(--ease);
}
a:hover { color: var(--hover); text-decoration-color: currentColor; }

:focus-visible {
    outline: 2px solid var(--link);
    outline-offset: 3px;
    border-radius: 2px;
}

.skip-link {
    position: absolute;
    left: var(--gutter);
    top: -3rem;
    padding: 0.5rem 0.75rem;
    background: var(--ink);
    color: var(--bg);
    font: 500 0.875rem/1 var(--ui);
    z-index: 20;
}
.skip-link:focus { top: 0.75rem; }

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ===== Masthead: ASCII waves behind the site header (blog/v1/masthead.js) ===== */
.masthead {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6rem; /* masthead.js resizes this to the header's height */
    z-index: -1;
    pointer-events: none;
}
#masthead-canvas-wrapper { width: 100%; height: 100%; }

/* ===== Frame ===== */
.wrap {
    width: 100%;
    max-width: calc(var(--measure) + 2 * var(--gutter));
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.site-header {
    --header-pad: clamp(1rem, 4vw, 2.25rem);
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.125rem 1.5rem;
    padding-top: var(--header-pad);
    padding-bottom: 0.25rem;
    font-family: var(--ui);
    /* Pinned on scroll. The negative top lets the roomy top padding scroll
       away first, so the pinned bar is compact. */
    position: sticky;
    top: calc(0.5rem - var(--header-pad));
    z-index: 10;
}
/* Transparent at the top of the page so the masthead wave shows through;
   once scrolled (data-stuck, set in base.html) it gets the page background,
   full-bleed, with a hairline rule. box-shadow + clip-path go edge to edge
   without adding horizontal scroll. */
.site-header::before,
.site-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    z-index: -1;
    clip-path: inset(0 -100vmax);
    opacity: 0;
    transition: opacity 0.2s var(--ease);
    pointer-events: none;
}
.site-header::before { top: 0; bottom: 0; background: var(--bg); box-shadow: 0 0 0 100vmax var(--bg); }
.site-header::after { bottom: 0; height: 1px; background: var(--rule); box-shadow: 0 0 0 100vmax var(--rule); }
.site-header[data-stuck]::before,
.site-header[data-stuck]::after { opacity: 1; }

.site-name {
    font: 600 1rem/1.3 var(--ui);
    color: var(--ink);
    text-decoration: none;
    letter-spacing: -0.005em;
}
.site-name:hover { color: var(--ink); }

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.125rem;
    margin: 0 -0.25rem;
}
.site-nav a {
    display: inline-block;
    padding: 0.6875rem 0.25rem;
    font: 400 0.9375rem/1.2 var(--ui);
    color: var(--meta);
    text-decoration: none;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--link);
    text-decoration-thickness: 2px;
    text-underline-offset: 0.45em;
}

main { display: block; padding-bottom: clamp(3rem, 8vw, 5rem); }

.site-footer {
    border-top: 1px solid var(--rule);
    padding: 1rem 0 2rem;
    font: 400 0.875rem/1.5 var(--ui);
    color: var(--meta);
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.25rem;
    align-items: center;
    justify-content: space-between;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-footer a { display: inline-block; padding: 0.5rem 0; color: var(--meta); text-decoration-color: var(--rule); }
.site-footer a:hover { color: var(--link); text-decoration-color: currentColor; }

/* ===== Homepage ===== */
.intro { margin: clamp(2.5rem, 9vw, 4.5rem) 0 clamp(2.25rem, 7vw, 3.5rem); }
.intro h1 {
    margin: 0;
    font: 500 clamp(1.875rem, 1.6rem + 1vw, 2.125rem)/1.15 var(--serif);
    letter-spacing: -0.012em;
    text-wrap: balance;
}
.intro p {
    margin: 0.75rem 0 0;
    font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
    line-height: 1.5;
    color: var(--ink2);
    max-width: 34rem;
    text-wrap: pretty;
}

.section { margin-top: clamp(2.25rem, 6vw, 3.25rem); }
.section-title {
    margin: 0 0 0.25rem;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid var(--rule);
    font: 600 0.9375rem/1.3 var(--ui);
    color: var(--ink);
    letter-spacing: 0;
}
.section-more {
    display: inline-block;
    margin-top: 0.5rem;
    padding-block: 0.625rem;
    font: 500 0.9375rem/1.3 var(--ui);
}

/* ===== Entries (shared by home, lists, tag pages) ===== */
.entry {
    padding: 1.125rem 0;
    border-bottom: 1px solid var(--rule);
}
.entry:last-child, .entry:has(+ .pagination) { border-bottom: 0; }

.entry-title {
    margin: 0;
    font: 500 clamp(1.3125rem, 1.2rem + 0.5vw, 1.5rem)/1.25 var(--serif);
    letter-spacing: -0.005em;
    text-wrap: balance;
}
.entry-title a { color: var(--ink); text-decoration: none; }
.entry-title a:hover { color: var(--link); }

.entry-excerpt {
    margin: 0.375rem 0 0;
    font-size: 1.0625rem;
    line-height: 1.55;
    color: var(--ink2);
    text-wrap: pretty;
}
.entry-excerpt p { margin: 0; }
.entry-excerpt p + p { margin-top: 0.5em; }

.meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.125rem 0.5rem;
    margin-top: 0.5rem;
    font: 400 0.875rem/1.5 var(--ui);
    color: var(--meta);
    font-variant-numeric: tabular-nums;
}
.meta > * + *::before {
    content: "·";
    display: inline-block; /* keeps the dot out of a link's underline */
    margin-right: 0.5rem;
    color: var(--meta);
}
.meta a { color: var(--meta); text-decoration-color: var(--rule); }
.meta .type { color: var(--ink2); font-weight: 500; }
.meta a:hover { color: var(--link); text-decoration-color: currentColor; }
.meta .tags { display: inline-flex; flex-wrap: wrap; gap: 0 0.75rem; }
.meta .tags a { padding: 0.375rem 0; }
/* Tags and the like button sit apart without a leading dot, so a wrapped line never starts with one. */
.meta > .tags::before { content: none; }

/* Link (blogmark) entries */
.link-title {
    margin: 0;
    font: 400 1.1875rem/1.4 var(--serif);
    text-wrap: pretty;
}
.link-title .domain {
    font: 400 0.8125rem/1 var(--ui);
    color: var(--meta);
    margin-left: 0.25rem;
    white-space: nowrap;
}
.link-commentary {
    margin-top: 0.375rem;
    font-size: 1.0625rem;
    line-height: 1.55;
    color: var(--ink2);
}
.link-commentary p, .link-commentary ul, .link-commentary ol, .link-commentary blockquote { margin: 0 0 0.6em; }
.link-commentary blockquote, .note-body blockquote {
    margin-left: 0;
    padding-left: 1em;
    border-left: 1px solid var(--rule);
    font-style: italic;
    color: var(--meta);
}
.link-commentary ul, .link-commentary ol { padding-left: 1.25em; }
.link-commentary > :first-child { margin-top: 0; }
.link-commentary > :last-child { margin-bottom: 0; }

/* Notes */
.note-body {
    font-size: 1.125rem;
    line-height: 1.55;
    color: var(--ink);
    text-wrap: pretty;
}
.note-body > :first-child, .note-body > p:first-child > img:first-child { margin-top: 0; }
.note-body > :last-child { margin-bottom: 0; }
.note-body p { margin: 0 0 0.5em; }

.note-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    min-height: 2.75rem;
    margin: -0.625rem 0;
    padding: 0 0.5rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--link);
    font: 500 0.875rem/1 var(--ui);
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.note-like-btn:hover { color: var(--link); background: color-mix(in oklab, var(--link) 10%, transparent); }
.heart-icon {
    display: inline-block;
    width: 0.95rem;
    height: 0.95rem;
    font-size: 0;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linejoin='round'%3E%3Cpath d='M12 20.5S3.5 15.3 3.5 9.2A4.7 4.7 0 0 1 12 6.6a4.7 4.7 0 0 1 8.5 2.6c0 6.1-8.5 11.3-8.5 11.3Z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linejoin='round'%3E%3Cpath d='M12 20.5S3.5 15.3 3.5 9.2A4.7 4.7 0 0 1 12 6.6a4.7 4.7 0 0 1 8.5 2.6c0 6.1-8.5 11.3-8.5 11.3Z'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: transform 0.25s var(--ease);
}
.note-like-btn.liked { color: var(--link); }
.meta > .note-like-btn::before { content: none; }
.meta > .note-like-btn { margin-left: auto; margin-right: -0.5rem; }
.note-like-btn .like-count { color: var(--meta); }
.note-like-btn.liked .heart-icon {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21.5S2.5 15.8 2.5 9.1a5.4 5.4 0 0 1 9.5-3.5 5.4 5.4 0 0 1 9.5 3.5c0 6.7-9.5 12.4-9.5 12.4Z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21.5S2.5 15.8 2.5 9.1a5.4 5.4 0 0 1 9.5-3.5 5.4 5.4 0 0 1 9.5 3.5c0 6.7-9.5 12.4-9.5 12.4Z'/%3E%3C/svg%3E");
    transform: scale(1.08);
}

/* ===== Page headings (lists, tags) ===== */
.page-head { margin: clamp(2.25rem, 8vw, 4rem) 0 clamp(1rem, 3vw, 1.5rem); }
.page-head h1 {
    margin: 0;
    font: 500 clamp(1.875rem, 1.4rem + 2vw, 2.5rem)/1.12 var(--serif);
    letter-spacing: -0.012em;
    text-wrap: balance;
}
.page-head p, .page-head .description {
    margin: 0.625rem 0 0;
    color: var(--ink2);
    font-size: 1.0625rem;
    line-height: 1.55;
}
.page-head .description > :first-child { margin-top: 0; }

/* ===== Article (post, blogmark, note detail) ===== */
.article { margin-top: clamp(2.25rem, 8vw, 4rem); }
.article-head .meta { margin: 0 0 0.75rem; }
.article-title {
    margin: 0 0 clamp(1.25rem, 4vw, 1.75rem);
    font: 500 clamp(2rem, 1.35rem + 3vw, 2.75rem)/1.1 var(--serif);
    letter-spacing: -0.015em;
    text-wrap: balance;
}
.article-title a { color: inherit; text-decoration: none; }
.article-title a:hover { color: var(--link); }
.article-foot {
    margin-top: 2.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--rule);
}
.article-foot .meta { margin-top: 0; }
.note-detail .note-body { font-size: clamp(1.3125rem, 1.15rem + 0.8vw, 1.625rem); line-height: 1.45; }

/* Prose: rendered markdown */
.prose {
    font-size: clamp(1.125rem, 1.08rem + 0.2vw, 1.1875rem);
    line-height: 1.68;
    color: var(--ink2);
}
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .prose table, .prose figure { margin: 0 0 1.15em; }
.prose h2, .prose h3, .prose h4 {
    color: var(--ink);
    font-family: var(--serif);
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: -0.008em;
    text-wrap: balance;
}
.prose h2 { font-size: 1.5em; margin: 2em 0 0.55em; }
.prose h3 { font-size: 1.25em; margin: 1.8em 0 0.5em; }
.prose h4 { font: 600 1rem/1.4 var(--ui); margin: 1.8em 0 0.5em; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: 0.3em 0; padding-left: 0.15em; }
.prose li::marker { color: var(--meta); }
.prose p, .prose li, .prose blockquote { text-wrap: pretty; }
.prose blockquote {
    margin-left: 0;
    padding-left: 1.1em;
    border-left: 1px solid var(--ink2);
    font-style: italic;
    color: var(--ink2);
}
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5em 0; }
.prose img, .prose video, .prose iframe,
.note-body img, .note-body video, .note-body iframe,
.link-commentary img, .link-commentary video, .link-commentary iframe {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1.5em auto;
    border-radius: 4px;
}
.prose iframe, .note-body iframe, .link-commentary iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; }
.prose mark { background: var(--mark); color: var(--ink); padding: 0 0.12em; border-radius: 2px; }
.prose table {
    display: block;
    width: max-content;
    min-width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    font: 400 0.9375rem/1.45 var(--ui);
    font-variant-numeric: tabular-nums;
}
.prose th, .prose td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.prose th { color: var(--ink); font-weight: 600; }
.prose input[type="checkbox"] { accent-color: var(--link); }

code, pre, kbd, samp { font-family: var(--mono); }
:not(pre) > code {
    font-size: 0.84em;
    padding: 0.12em 0.32em;
    border-radius: 4px;
    background: var(--code);
    color: var(--ink);
}
pre {
    font-size: 0.875rem;
    line-height: 1.6;
    background: var(--code);
    color: var(--ink);
    padding: 1rem 1.125rem;
    border-radius: 6px;
    overflow-x: auto;
    tab-size: 4;
    -webkit-overflow-scrolling: touch;
}
pre code { font-size: inherit; background: none; padding: 0; }

/* ===== Tag index ===== */
.topic-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin: 0;
    font: 500 1.25rem/1.3 var(--serif);
}
.topic-title a { color: var(--ink); text-decoration: none; }
.topic-title a:hover { color: var(--link); }
.topic-description {
    margin: 0.25rem 0 0;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--meta);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}
.topic-title .count, .tag-index .count {
    font: 400 0.8125rem/1 var(--ui);
    color: var(--meta);
    font-variant-numeric: tabular-nums;
}
.tag-index {
    list-style: none;
    margin: 0;
    padding: 0.75rem 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.375rem;
}
.tag-index li { white-space: nowrap; }
.tag-index a {
    display: inline-block;
    padding-block: 0.4375rem;
    font: 400 1.0625rem/1.3 var(--serif);
}
.tag-index .count { margin-left: 0.3rem; }

/* ===== Pagination ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--rule);
    font: 500 0.9375rem/1.3 var(--ui);
    color: var(--meta);
    font-variant-numeric: tabular-nums;
}
.pagination a { display: inline-block; padding-block: 0.625rem; }
.pagination .spacer { min-width: 5rem; }

/* ===== Back link / empty ===== */
.back { margin-top: 2rem; font: 500 0.9375rem/1.3 var(--ui); }
.empty { color: var(--meta); font-style: italic; }

/* ===== Staff note composer ===== */
.note-composer {
    position: relative;
    margin: 1.25rem 0 1.75rem;
    padding: 1rem 1rem 0.75rem;
    border: 1px solid var(--rule);
    border-radius: 8px;
    background: color-mix(in oklab, var(--code) 55%, var(--bg));
}
.note-composer:focus-within { border-color: color-mix(in oklab, var(--link) 55%, var(--rule)); }
.note-composer .ProseMirror { min-height: 3.5rem; outline: none; font: 400 1.0625rem/1.5 var(--serif); color: var(--ink); }
.note-composer .ProseMirror p { margin: 0 0 0.4em; }
.note-composer .ProseMirror p.is-editor-empty:first-child::before {
    content: attr(data-placeholder);
    float: left;
    height: 0;
    color: var(--meta);
    pointer-events: none;
}
.tags-separator { height: 1px; background: var(--rule); margin: 0.5rem 0; }
.tags-input {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--ink);
    font: 400 0.875rem/1.5 var(--ui);
    padding: 0.25rem 0;
}
.tags-input::placeholder { color: var(--meta); }
.tags-input:focus { outline: none; }
.compose-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 0.5rem; }
#note-submit-btn {
    font: 600 0.875rem/1 var(--ui);
    padding: 0.625rem 1rem;
    border: 0;
    border-radius: 6px;
    background: var(--link);
    color: var(--bg);
    cursor: pointer;
}
#note-submit-btn:hover:not(:disabled) { background: var(--hover); }
#note-submit-btn:disabled { opacity: 0.55; cursor: default; }
#char-count { font: 400 0.8125rem/1 var(--ui); color: var(--meta); font-variant-numeric: tabular-nums; }
.hashtag-autocomplete {
    position: absolute;
    left: 1rem;
    z-index: 10;
    min-width: 12rem;
    padding: 0.25rem;
    background: var(--bg);
    border: 1px solid var(--rule);
    border-radius: 6px;
    box-shadow: 0 6px 20px rgb(0 0 0 / 0.12);
    font: 400 0.875rem/1.4 var(--ui);
}
.autocomplete-item { padding: 0.375rem 0.625rem; border-radius: 4px; cursor: pointer; color: var(--ink); }
.autocomplete-item:hover, .autocomplete-item.selected { background: var(--code); }
/* Notes inserted by notes.js after posting use v0 markup. */
.note .note-content { font-size: 1.125rem; line-height: 1.55; }
.note .note-meta { display: flex; gap: 0.5rem; align-items: center; font: 400 0.875rem/1.5 var(--ui); color: var(--meta); }
.note { padding: 1.125rem 0; border-bottom: 1px solid var(--rule); }

/* ===== Staff pages: dashboard and activity graph =====
   Their templates are shared with v0 and carry inline <style> blocks, so these
   rules lead with `body` to outrank them. Graph colours come from the view as
   inline GitHub hexes; attribute selectors remap them onto Fir. */
body .dashboard-container, body .activity-graph { font-family: var(--ui); color: var(--ink); }
body .dashboard-container h1, body .dashboard-container h2, body .activity-graph h1, body .activity-graph h2 { font-family: var(--serif); font-weight: 500; }
body .dashboard-header h1 { font-size: clamp(2rem, 1.6rem + 1.6vw, 2.625rem); margin: 0 0 0.375rem; }
body .dashboard-header p { margin: 0; color: var(--meta); }

body .quick-links { gap: 0.625rem; margin-bottom: 2.5rem; }
body .quick-link {
    padding: 0.75rem 1rem;
    background: transparent;
    border: 1px solid var(--rule);
    border-radius: 6px;
    color: var(--ink);
    font: 500 0.9375rem/1.3 var(--ui);
    transition: border-color 0.15s, color 0.15s;
}
body .quick-link:hover { background: transparent; transform: none; box-shadow: none; border-color: var(--link); color: var(--link); }

body .stats-grid { gap: 1rem; margin-bottom: 2.5rem; }
body .stat-card, body .activity-section, body .masthead-editor, body .graph-container {
    background: transparent !important; /* v0's dark-mode rules out-specify this block */
    border: 1px solid var(--rule);
    border-radius: 6px;
    box-shadow: none;
}
body .stat-card:hover { box-shadow: none; }
body .stat-card h3 {
    font: 500 0.8125rem/1.3 var(--ui);
    text-transform: none;
    letter-spacing: 0;
    color: var(--meta);
    margin: 0 0 0.5rem;
}
body .stat-number {
    font: 500 2.25rem/1.1 var(--serif);
    color: var(--ink);
    font-variant-numeric: tabular-nums lining-nums;
}
body .stat-breakdown li { font-size: 0.875rem; color: var(--meta); font-variant-numeric: tabular-nums; }
body .stat-breakdown a { color: var(--link); }

body .activity-section, body .masthead-editor { padding: clamp(1.25rem, 3vw, 2rem); margin: 2.5rem 0; }
body .activity-section .graph-container { border: 0; padding: 0; }
body .activity-graph h2 { font-size: clamp(1.75rem, 1.5rem + 1vw, 2.125rem); margin: 0 0 1.25rem; }
body .graph-container { color: var(--ink); }
body .graph-title { font: 500 0.9375rem/1.3 var(--ui); color: var(--meta); }
body .graph-days { min-width: 2.25rem; }
body .day-label, body .month-label { font: 400 0.75rem/1 var(--ui); color: var(--meta); white-space: nowrap; }
body .graph-legend { border-top-color: var(--rule); font: 400 0.8125rem/1.3 var(--ui); color: var(--meta); }
body .day-cell:hover { box-shadow: 0 0 0 2px var(--bg); }
body [style*="#ebedf0"] { background-color: var(--code) !important; }
body [style*="#9be9a8"] { background-color: color-mix(in oklch, var(--link) 35%, var(--code)) !important; }
body [style*="#40c463"] { background-color: color-mix(in oklch, var(--link) 60%, var(--code)) !important; }
body [style*="#30a14e"] { background-color: color-mix(in oklch, var(--link) 82%, var(--code)) !important; }
body [style*="#216e39"] { background-color: var(--link) !important; }

body .masthead-preview {
    background: var(--code);
    border: 0;
    border-radius: 4px;
    font: 400 0.8125rem/1.55 var(--mono);
    color: var(--ink2);
}
body .masthead-preview code { background: none; padding: 0; font-size: inherit; }
body #masthead_code_textarea {
    font: 400 0.8125rem/1.6 var(--mono);
    background: var(--code);
    color: var(--ink);
    border: 1px solid var(--rule);
    border-radius: 4px;
}
body #masthead_code_textarea:focus { outline: 2px solid var(--link); outline-offset: 2px; border-color: var(--rule); }
body .form-help { font: 400 0.875rem/1.5 var(--ui); color: var(--meta); }
body .btn-primary {
    padding: 0.6875rem 1.25rem;
    background: var(--link);
    color: var(--bg);
    border-radius: 6px;
    font: 600 0.9375rem/1.2 var(--ui);
    transition: background-color 0.15s;
}
body .btn-primary:hover { background: var(--hover); transform: none; box-shadow: none; }

body .message { border-radius: 6px; font: 400 0.9375rem/1.4 var(--ui); }
body .message.success { background: var(--mark); color: var(--ink); border: 1px solid var(--rule); }
body .message.error { background: transparent; color: var(--ink); border: 1px solid #b4412f; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}

@media print {
    .masthead, .site-nav, .site-footer, .note-like-btn, .note-composer, .preview-bar { display: none !important; }
    .site-header { position: static; }
    body { background: #fff; color: #000; }
    a { color: inherit; }
}
