:root {
    --bg-color: #111;
    --text-color: #eee;
    /* every colour on the page fades together on a theme switch */
    --theme-fade: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, fill 0.15s ease, stroke 0.15s ease;
}

/* only while switching (button.js sets .theme-fading on <html> for a moment), so page loads
   and hovers aren't slowed down. Kept above the other rules so anything with its own
   transition (the toggle's slide) still wins — those add var(--theme-fade) to their list. */
.theme-fading :where(*, *::before, *::after) { transition: var(--theme-fade); }

.theme-toggle-wrapper {
    /* stays with the window (follows scroll) on both desktop and mobile */
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    z-index: 1000;
}

.toggle-button {
    position: relative;
    width: 60px;
    height: 30px;
    background-color: var(--fz-accent-fill);
    border-radius: 30px;
    transition: background-color 0.3s ease;
    cursor: pointer;
    overflow: hidden;
}
/* the header's toggle is a <button>: drop the browser's button look */
button.toggle-button { display: block; flex: none; margin: 0; padding: 0; border: 0; font: inherit; }
button.toggle-button:focus-visible { outline: 2px solid var(--text-color); outline-offset: 3px; }

.toggle-button img {
    position: absolute;
    top: 50%;
    left: 5px;
    width: 28px;
    height: 28px;
    transform: translateY(-50%);
    transition: left 0.3s ease, transform 0.3s ease;
    z-index: 1;
    opacity: 0;
}

.toggle-button::before{
    content: "";
    position: absolute;
    top: 50%;
    left: 5px;
    width: 0px;
    height: 0px;
    background-color: white;
    border-radius: 50%;
    transform: translateY(-50%);
    transition: left 0.3s ease;
}

/* light mode syling */

.light-mode {
    --bg-color: #eee;
    --text-color: #111;
}

.light-mode .toggle-button {
    background-color: var(--fz-accent-fill);
}

.light-mode .toggle-button::before {
    left: 33px;
}

.light-mode .toggle-button img.light {
    opacity: 1;
}

.light-mode .toggle-button img.dark {
    opacity: 0;
}

.light-mode .toggle-button img {
    left: 45px;
    transform: translate(-50%, -50%);
}

.light-mode a {
    color:#2b7a2f;
    text-decoration: none;
}

.light-mode a:active {
    color:#1f6a23;
}

.light-mode a:visited {
    color:#7b45b8;
}

/* dark mode styling */
.toggle-button img.dark {
    opacity: 1;
}

.toggle-button img.light {
    opacity: 0;
}

/* link colours clear 4.5:1 on the page and 3:1 against the body text, so a link inside a
   paragraph stands out without an underline (WCAG 1.4.3, 1.4.1) */
a {
    color:#d9661a;
    text-decoration: none;
}

a:active {
    color:#ea7e35;
}

a:visited {
    color:#a46ce0;
}

@font-face {
    font-family: 'JetBrains Mono';
    src: url('../assets/fonts/JetBrains\ Mono/JetBrainsMono-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
}

body {
    margin: 40px auto;
    max-width: 800px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    padding: 0 10px;
    font-family: 'JetBrains Mono', monospace;
    text-align: left;
    position: relative;
}

h1 {
    margin-top: 60px;
    text-align: center;
}

/* site masthead — links to the homepage, on every page */
.site-title {
    margin: 30px 0 0;
    text-align: center;
    font-size: 1.6em;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.site-title a,
.site-title a:visited,
.site-title a:active {
    color: var(--text-color);
    text-decoration: none;
}
.site-title a:hover { opacity: 0.7; }

h2 {
    text-align: center;
}

/* running text stops at 80 characters a line (JetBrains Mono: 1ch is one character). Only
   paragraphs and plain or prose lists, not rows of a list-styled component */
main :where(p, ul:not([class]) > li, ol:not([class]) > li, .ins-list > li) { max-width: 80ch; }

canvas {
    display: block;
    width: 100%;
    max-width: 800%;
    height: auto;
}

/* navigation */
.site-nav {
    display: flex;
    gap: 1.2em;
    justify-content: center;
    margin-top: 20px;
    font-size: 0.95em;
}

/* burger nav — hidden on landscape/desktop, shown when portrait */
.nav-toggle { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.nav-burger { display: none; }
/* burger menu's theme item (header.html): only exists in burger mode; its label follows the theme */
.nav-theme, .nav-theme-light, .light-mode .nav-theme-dark { display: none; }
.light-mode .nav-theme-light { display: inline; }

@media (max-aspect-ratio: 1/1) {
    /* burger mode (mobile/portrait): the header row stays put at the top, scrolls away */
    .theme-toggle-wrapper { position: absolute; }
    .nav-burger {
        display: block;
        width: 44px;
        margin: 20px auto 0 0;   /* left-aligned */
        text-align: center;
        font-size: 26px;
        line-height: 1;
        cursor: pointer;
        user-select: none;
    }
    .nav-burger:focus-visible,
    .nav-toggle:focus-visible + .nav-burger { outline: 2px solid var(--text-color); border-radius: 4px; }
    .site-nav { display: none; margin-top: 12px; }
    /* the theme switch lives here in burger mode, as the menu's last item: [Dark mode (switch)] */
    .site-nav .nav-theme {
        display: flex; align-items: center; gap: 12px; margin: 0; padding: 0; border: 0;
        background: none; color: var(--text-color); font: inherit; text-align: left; cursor: pointer;
    }
    .nav-theme:focus-visible { outline: 2px solid var(--text-color); outline-offset: 4px; border-radius: 4px; }
    .nav-theme-switch { display: block; flex: none; }
    .nav-toggle:checked ~ .site-nav {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.7em;
    }
}

/* article listings */
.article-list {
    list-style: none;
    padding: 0;
}

.article-list li {
    margin-bottom: 0.6em;
}

.article-list time {
    opacity: 0.6;
    font-size: 0.85em;
    margin-left: 0.6em;
}

/* tags + post meta */
.tags a {
    margin-right: 0.4em;
    font-size: 0.85em;
}

.meta {
    opacity: 0.6;
    font-size: 0.85em;
    margin-top: -0.4em;
}

/* furigana sizing */
rt {
    font-size: 0.6em;
}

/* footer */
.site-footer {
    margin-top: 60px;
    padding-top: 16px;
    border-top: 1px solid rgba(127, 127, 127, 0.3);
    font-size: 0.8em;
    color: var(--fz-muted);
}
/* links inside muted text are too close to it in colour, so they're underlined */
.site-footer .footer-text a, .fz-muted a, .tk-small a { text-decoration: underline; text-underline-offset: 2px; }
/* footer: text on the left, the Ko-fi mug link on the right (footer.html) */
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.site-footer .footer-text { min-width: 0; }
.site-footer .kofi { flex: none; display: inline-block; line-height: 0; border-radius: 4px; transition: transform 0.15s ease; }
.site-footer .kofi img { height: 26px; width: auto; }
.site-footer .kofi:hover, .site-footer .kofi:focus-visible { transform: translateY(-2px); }
.site-footer .kofi:focus-visible { outline: 2px solid var(--text-color); outline-offset: 3px; }

/* content images */
main img {
    max-width: 100%;
    height: auto;
}

figure {
    margin: 1.5em 0;
    text-align: center;
}

figure img {
    display: block;
    margin: 0 auto;
    border-radius: 4px;
}

figcaption {
    margin-top: 0.5em;
    font-size: 0.85em;
    opacity: 0.7;
}

/* ---- accounts, comments, notifications (js/fazon-api.js, js/fazon-comments.js) ---- */
:root {
    /* --fz-accent is for text and lines; --fz-accent-fill sits behind white text. In dark they
       differ: orange bright enough to read on #111 is too bright for white text on it */
    --fz-accent: #d9661a;
    --fz-accent-fill: #c3540a;
    --fz-accent-soft: rgba(195, 84, 10, 0.16);
    --fz-surface: #1a1a1a;
    --fz-line: rgba(255, 255, 255, 0.14);
    --fz-muted: #9a9a9a;
    --fz-bad: #e2564a;
}
.light-mode {
    --fz-accent: #2b7a2f;
    --fz-accent-fill: #2b7a2f;
    --fz-accent-soft: rgba(43, 122, 47, 0.14);
    --fz-surface: #ffffff;
    --fz-line: rgba(0, 0, 0, 0.14);
    --fz-muted: #666666;
    --fz-bad: #b8352b;
}

/* top-right group (header.html): the theme toggle stays where it always was; under it, right-
   aligned, a row with [bell] [Log in pill | account button]. It all lives in .theme-toggle-wrapper,
   so it's fixed on desktop and scrolls away together in portrait. The row appears only once
   /v1/me has answered (fades in; stays hidden if the API is down). In portrait the toggle is
   hidden and the row sits inline on the title's line (see .site-header below). */
.theme-toggle-wrapper { flex-direction: column; align-items: flex-end; gap: 8px; }
.fz-cluster-row { display: flex; align-items: center; gap: 8px; animation: fz-fade-in 0.2s ease; }
.fz-cluster-row[hidden] { display: none; }
.fz-menu-wrap { position: relative; display: flex; align-items: center; }
.fz-menu-wrap[hidden] { display: none; }
@keyframes fz-fade-in { from { opacity: 0; } to { opacity: 1; } }
/* header box: invisible on desktop/landscape (children lay out exactly as before) */
.site-header { display: contents; }
@media (max-aspect-ratio: 1/1) {
    /* portrait/burger: YouTube-style compact single row near the top — burger + title on the left,
       [bell + account | Log in] inline on the right; the burger's nav opens below (with the theme
       switch as its last item — the top-right toggle is hidden here). It scrolls away with the page.
       The group column has a fixed min-width and the title is left-aligned, so logging in/out never
       moves the title. The negative margin collapses with body's 40px top margin: row starts 12px down. */
    .site-header {
        display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas: "burger title group" "nav nav nav";
        align-items: center; column-gap: 8px; margin-top: -28px;
    }
    .site-header .nav-burger { grid-area: burger; margin: 0; }
    .site-header .site-title {
        grid-area: title; margin: 0; text-align: left; white-space: nowrap;
        font-size: clamp(1.05em, 5.4vw, 1.6em);
    }
    /* fixed-height box (the 36px bell/account row) whatever the login state, so the row never resizes */
    .site-header .theme-toggle-wrapper {
        grid-area: group; position: static; padding: 0; min-width: 80px;
        height: 36px; justify-content: center;
    }
    .site-header .theme-toggle-wrapper > .toggle-button { display: none; }
    .site-header .fz-cluster-row { min-height: 36px; }
    .site-header .site-nav { grid-area: nav; }
}

.fz-bell {
    position: relative; display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
    background: transparent; color: var(--fz-accent);  /* the icon strokes in currentColor */
}
.fz-bell:hover, .fz-bell[aria-expanded="true"] { background: var(--fz-accent-soft); }
.fz-bell:focus-visible, .fz-login-pill:focus-visible { outline: 2px solid var(--fz-accent); outline-offset: 2px; }
.fz-bell-badge {
    position: absolute; top: 1px; right: -1px; min-width: 16px; height: 16px; padding: 0 4px;
    box-sizing: border-box; border-radius: 999px; background: #e0352b; color: #fff;
    font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; pointer-events: none;
}
.fz-bell-badge[hidden] { display: none; }

/* logged out: "Log in" pill in the accent colour */
.fz-login-pill, .fz-login-pill:visited, .light-mode .fz-login-pill, .light-mode .fz-login-pill:visited {
    display: inline-block; padding: 4px 14px; border-radius: 999px; border: 1.5px solid var(--fz-accent);
    color: var(--fz-accent); font-size: 0.85rem; font-weight: 700; line-height: 1.4; white-space: nowrap;
    text-decoration: none; background: transparent;
}
.fz-login-pill:hover, .light-mode .fz-login-pill:hover { background: var(--fz-accent-fill); color: #fff; }
/* logged out: [Sign up] (filled) [Log in]. Portrait phones narrower than 385px keep only
   "Log in" (its page links to sign-up), so the one-row header never overflows. */
.fz-signup-pill, .fz-signup-pill:visited, .light-mode .fz-signup-pill, .light-mode .fz-signup-pill:visited {
    background: var(--fz-accent-fill); color: #fff; margin-right: 8px;
}
.fz-signup-pill:hover, .light-mode .fz-signup-pill:hover { filter: brightness(1.12); }
@media (max-aspect-ratio: 1/1) {
    .fz-login-pill, .fz-login-pill:visited, .light-mode .fz-login-pill, .light-mode .fz-login-pill:visited { padding: 4px 11px; }
    .fz-signup-pill, .light-mode .fz-signup-pill { margin-right: 6px; }
}
@media (max-aspect-ratio: 1/1) and (max-width: 384.98px) { .fz-signup-pill { display: none !important; } }

/* logged in: the avatar component is the account button */
.fz-acct-btn {
    display: flex; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; color: inherit;
}
.fz-acct-btn:hover .fz-av-pic, .fz-acct-btn[aria-expanded="true"] .fz-av-pic { filter: brightness(1.12); }
.fz-acct-btn:focus-visible { outline: 2px solid var(--fz-accent); outline-offset: 2px; }

/* avatar component (Fazon.avatar): picture or initial, XP ring, level badge */
.fz-av { position: relative; display: inline-block; flex: none; vertical-align: middle; line-height: 1; }
.fz-av-pic {
    position: absolute; border-radius: 50%; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: var(--fz-surface); color: #fff; font-weight: 700; user-select: none;
}
.fz-av-pic.fz-av-initial { background: var(--fz-accent-fill); }
.fz-av-none .fz-av-pic { inset: 0; background: rgba(127, 127, 127, 0.25); }
.fz-av-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fz-av-ring { position: absolute; inset: 0; display: block; }
.fz-av-track { fill: none; stroke: var(--fz-line); }
.fz-av-arc { fill: none; stroke: var(--fz-accent); stroke-linecap: round; }
.fz-av-badge {
    position: absolute; right: -3px; bottom: -3px; box-sizing: border-box; padding: 0 3px;
    border-radius: 999px; text-align: center; font-weight: 700; font-family: 'JetBrains Mono', monospace;
    background: var(--fz-accent-fill); color: #fff; border: 1px solid var(--bg-color);
}

/* dropdown panels (bell + account) */
.fz-panel {
    position: fixed; z-index: 1001; box-sizing: border-box; max-width: calc(100vw - 32px);
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--fz-surface); color: var(--text-color);
    border: 1px solid var(--fz-line); border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35); font-size: 0.85rem; line-height: 1.45; text-align: left;
}
.light-mode .fz-panel { box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14); }
.fz-panel[hidden] { display: none; }
.fz-bell-panel { width: 360px; }
.fz-acct-panel { width: 260px; }
@media (max-width: 520px) { .fz-bell-panel, .fz-acct-panel { width: auto; max-width: none; } }
.fz-acct-who { display: flex; align-items: center; gap: 14px; padding: 14px; border-bottom: 1px solid var(--fz-line); }
.fz-acct-id { display: flex; flex-direction: column; min-width: 0; }
.fz-acct-id b { overflow-wrap: anywhere; }
.fz-acct-email { color: var(--fz-muted); font-size: 0.9em; overflow-wrap: anywhere; }
.fz-acct-item, .fz-acct-item:visited,
.light-mode .fz-acct-item, .light-mode .fz-acct-item:visited {
    display: block; width: 100%; box-sizing: border-box; padding: 10px 14px; text-align: left;
    border: 0; background: none; color: var(--text-color); font: inherit; cursor: pointer; text-decoration: none;
}
.fz-acct-item:hover, .fz-acct-item:focus-visible { background: var(--fz-accent-soft); outline: none; }
.fz-acct-item + .fz-acct-item { border-top: 1px solid var(--fz-line); }

.fz-np-head, .fz-np-foot { display: flex; align-items: center; padding: 10px 14px; flex: none; }
.fz-np-head { border-bottom: 1px solid var(--fz-line); }
.fz-np-title { font-weight: 700; margin-right: auto; }
.fz-np-all { font-size: 0.92em; }
.fz-np-list { overflow-y: auto; overscroll-behavior: contain; flex: 1 1 auto; min-height: 0; }
.fz-np-item {
    display: flex; gap: 10px; padding: 10px 14px; text-decoration: none;
    border-bottom: 1px solid var(--fz-line);
}
.fz-np-item, .fz-np-item:visited, .fz-np-item:active,
.light-mode .fz-np-item, .light-mode .fz-np-item:visited, .light-mode .fz-np-item:active { color: var(--text-color); }
.fz-np-item:hover, .fz-np-item:focus-visible { background: var(--fz-accent-soft); outline: none; }
.fz-np-dot { flex: none; width: 8px; height: 8px; margin-top: 0.45em; border-radius: 50%; background: transparent; }
.fz-np-item.unread .fz-np-dot { background: var(--fz-accent); }
.fz-np-item.unread { background: rgba(127, 127, 127, 0.07); }
.fz-np-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fz-np-snip { color: var(--fz-muted); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fz-np-time { color: var(--fz-muted); font-size: 0.88em; }
.fz-np-empty { margin: 0; padding: 22px 14px; text-align: center; color: var(--fz-muted); }
.fz-np-foot { justify-content: center; border-top: 1px solid var(--fz-line); margin-top: -1px; }
.fz-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* form controls */
.fz-input, .fz-textarea {
    box-sizing: border-box; width: 100%; padding: 0.55em 0.7em;
    font: inherit; font-size: 0.95em; color: var(--text-color);
    background: var(--fz-surface); border: 1px solid var(--fz-line); border-radius: 6px;
}
.fz-textarea { min-height: 6.5em; resize: vertical; line-height: 1.5; }
.fz-input:focus, .fz-textarea:focus { outline: none; border-color: var(--fz-accent); }
.fz-btn {
    font: inherit; font-size: 0.9em; cursor: pointer; padding: 0.4em 1.1em; border-radius: 6px;
    color: var(--text-color); background: transparent; border: 1px solid var(--fz-line);
}
.fz-btn:hover:not(:disabled) { border-color: var(--fz-accent); }
.fz-btn.primary { background: var(--fz-accent-fill); border-color: var(--fz-accent-fill); color: #fff; }
.fz-btn.primary:hover:not(:disabled) { filter: brightness(1.08); }
.fz-btn:disabled { opacity: 0.45; cursor: default; }
.fz-linkbtn {
    font: inherit; font-size: inherit; padding: 0; border: 0; background: none; cursor: pointer;
    color: var(--fz-muted);
}
.fz-linkbtn:hover:not(:disabled) { color: var(--fz-accent); }
.fz-linkbtn:disabled { opacity: 0.5; cursor: default; }
.fz-muted { color: var(--fz-muted); }
.fz-error { color: var(--fz-bad); font-size: 0.9em; }
.fz-note {
    padding: 0.8em 1em; border: 1px solid var(--fz-line); border-left: 3px solid var(--fz-accent);
    border-radius: 6px; background: var(--fz-surface);
}
.fz-form { display: flex; flex-direction: column; gap: 0.7em; max-width: 30em; margin: 1.5em auto 0; }
.fz-form label { font-size: 0.9em; }
.fz-row { display: flex; align-items: center; gap: 0.8em; flex-wrap: wrap; }
.fz-account-page { max-width: 30em; margin: 0 auto; }
.fz-switch { text-align: center; }
.fz-fine { font-size: 0.85em; margin: 0; }
/* sign-up honeypot: off-screen (not display:none, which some bots skip) */
.fz-hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.fz-account-page p { margin: 1em 0; }

/* article like: compact ♥ in the date line, and the bar above the comments */
.meta.art-meta { opacity: 1; color: var(--fz-muted); }
.art-like-mini { color: var(--fz-muted); }
.art-like-mini.on, .art-like.on { color: var(--fz-accent); }
.art-like-mini:focus-visible, .art-like:focus-visible { outline: 2px solid var(--fz-accent); outline-offset: 2px; border-radius: 4px; }
.art-like-msg { margin-left: 0.7em; }
.art-like-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; margin: 48px 0 -24px; }
.art-like-bar[hidden] { display: none; }
.art-like-bar .art-like-msg { flex-basis: 100%; margin: 0.6em 0 0; text-align: center; font-size: 0.9em; }
.art-like {
    display: inline-flex; align-items: center; gap: 0.45em; font: inherit; font-size: 0.95em; line-height: 1.3;
    padding: 0.45em 1.1em; border-radius: 999px; cursor: pointer; color: var(--fz-muted);
    background: transparent; border: 1px solid var(--fz-line);
    transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.art-like:hover { color: var(--fz-accent); border-color: var(--fz-accent); }
.art-like.on { border-color: var(--fz-accent); background: var(--fz-accent-soft); }
.art-like-heart { font-size: 1.1em; line-height: 1; }
.art-like-word { color: var(--text-color); }
.art-like.on .art-like-word { color: var(--fz-accent); }
.art-like-div { width: 1px; align-self: stretch; margin: 0.1em 0.15em; background: var(--fz-line); }
.art-like-n { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .art-like { transition: none; } }

/* comments */
.comments { margin-top: 60px; padding-top: 10px; border-top: 1px solid rgba(127, 127, 127, 0.3); }
.comments-h { margin-bottom: 0.8em; }
.cmt-composer { margin-bottom: 1.6em; }
.cmt-composer-foot { display: flex; align-items: center; gap: 0.8em; margin-top: 0.5em; font-size: 0.85em; }
.cmt-count { margin-right: auto; color: var(--fz-muted); }
.cmt-count.over { color: var(--fz-bad); }
.cmt-composer .fz-error:empty { display: none; }
.cmt { padding: 0.7em 0 0.2em; scroll-margin-top: 80px; }
.cmt-self { display: flex; gap: 10px; align-items: flex-start; border-radius: 6px; transition: background-color 0.4s ease; }
.cmt-av { display: flex; flex: none; margin-top: 2px; }
.cmt-self > .fz-av { margin-top: 2px; }
.cmt-main { flex: 1; min-width: 0; }
a.cmt-author, a.cmt-author:visited, .light-mode a.cmt-author, .light-mode a.cmt-author:visited { color: var(--text-color); }
a.cmt-author:hover { color: var(--fz-accent) !important; }
.cmt.flash > .cmt-self { background: var(--fz-accent-soft); }
.cmt-head { font-size: 0.85em; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.6em; }
.cmt-author { font-weight: 700; }
.cmt-tag {
    font-size: 0.8em; padding: 0 0.5em; border-radius: 999px;
    border: 1px solid var(--fz-accent); color: var(--fz-accent);
}
.cmt-head time { color: var(--fz-muted); }
.cmt-body { margin: 0.25em 0 0.3em; white-space: pre-wrap; overflow-wrap: anywhere; }
.cmt-deleted .cmt-body { color: var(--fz-muted); font-style: italic; }
.cmt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2em 1.2em; font-size: 0.82em; }
.cmt-like.on { color: var(--fz-accent); }
.cmt-actions .fz-error, .cmt-actions .cmt-hint { font-size: 1em; }
.cmt-reply-form { margin: 0.6em 0 0.4em; }
.cmt-children { margin-left: 17px; padding-left: 12px; border-left: 1px solid var(--fz-line); }
.cmt-children.flat { margin-left: 0; padding-left: 0; border-left: 0; }
@media (max-width: 600px) {
    .cmt-children { margin-left: 8px; padding-left: 8px; }
    .cmt-children.deep { margin-left: 0; padding-left: 0; border-left: 0; }
}
.cmt-empty { color: var(--fz-muted); text-align: center; font-size: 0.9em; }

/* notifications page */
.notif-tools { display: flex; justify-content: flex-end; margin: 1em 0 0.6em; }
.notif-list { list-style: none; padding: 0; margin: 0; }
.notif-list li + li { margin-top: 0.5em; }
.notif {
    display: block; padding: 0.7em 0.9em; border: 1px solid var(--fz-line); border-radius: 6px;
    color: var(--text-color); text-decoration: none;
}
.notif, .notif:visited, .notif:active,
.light-mode .notif, .light-mode .notif:visited, .light-mode .notif:active { color: var(--text-color); }
.notif:hover { border-color: var(--fz-accent); }
.notif.unread { border-left: 3px solid var(--fz-accent); background: var(--fz-accent-soft); }
a.notif { display: flex; gap: 12px; align-items: flex-start; }
.notif-main { min-width: 0; flex: 1; }
.notif-line { font-size: 0.92em; }
.notif-line b { font-weight: 700; }
.notif-snip { margin-top: 0.25em; font-size: 0.85em; color: var(--fz-muted); overflow-wrap: anywhere; }
.notif-meta { margin-top: 0.25em; font-size: 0.78em; color: var(--fz-muted); }
.notif-more { text-align: center; margin-top: 1em; }

/* profile page (/users/?id=N) */
.pf { margin-top: 40px; }
.pf-msg { text-align: center; color: var(--fz-muted); margin-top: 60px; }
.pf-card {
    background: var(--fz-surface); border: 1px solid var(--fz-line); border-radius: 12px; padding: 22px;
}
.pf-top { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.pf-avwrap { flex: none; }
.pf-id { flex: 1; min-width: 200px; }
.pf-name { margin: 0; text-align: left; font-size: 1.6em; line-height: 1.25; overflow-wrap: anywhere;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pf-name .cmt-tag { font-size: 0.45em; font-weight: 400; }
.pf-joined { font-size: 0.85em; margin-top: 4px; }
.pf-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pf-tools[hidden] { display: none; }
.pf-file { display: none; }
.pf-name-edit { display: flex; flex-direction: column; gap: 8px; max-width: 22em; }
.pf-level { margin-top: 20px; }
.pf-level-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 0.9em; }
.pf-bar { height: 8px; border-radius: 4px; background: var(--fz-line); margin-top: 6px; overflow: hidden; }
.pf-bar span { display: block; height: 100%; border-radius: 4px; background: var(--fz-accent); }
.pf-stats { display: flex; gap: 32px; margin-top: 18px; }
.pf-stats b { display: block; font-size: 1.4em; line-height: 1.2; }
.pf-stats span { color: var(--fz-muted); font-size: 0.8em; }
.pf-err:empty { display: none; }
.pf-err { margin: 12px 0 0; }

.pf-crop { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--fz-line);
    display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pf-crop-h { font-weight: 700; font-size: 0.9em; }
.pf-crop-cv { border-radius: 8px; cursor: grab; touch-action: none; background: #000; max-width: 100%; }
.pf-crop-cv.grabbing { cursor: grabbing; }
.pf-crop-cv:focus-visible { outline: 2px solid var(--fz-accent); outline-offset: 3px; }
.pf-zoom-row { display: flex; align-items: center; gap: 10px; width: min(280px, 100%); font-size: 0.85em; }
.pf-zoom { flex: 1; accent-color: var(--fz-accent); }
.pf-crop-btns { justify-content: center; }

.pf-sec h2 { margin-top: 1.8em; }
.pf-recent { list-style: none; padding: 0; margin: 0; }
.pf-recent li + li { margin-top: 8px; }
.pf-recent a, .pf-recent a:visited, .light-mode .pf-recent a, .light-mode .pf-recent a:visited {
    display: block; padding: 10px 12px; border: 1px solid var(--fz-line); border-radius: 8px; color: var(--text-color);
}
.pf-recent a:hover { border-color: var(--fz-accent); }
.pf-r-line { font-size: 0.85em; color: var(--fz-muted); }
.pf-r-line b { color: var(--text-color); }
.pf-r-snip { margin-top: 2px; overflow-wrap: anywhere; }
.pf-r-meta { margin-top: 2px; font-size: 0.78em; color: var(--fz-muted); }

.pf-levels { margin-top: 2em; border: 1px solid var(--fz-line); border-radius: 8px; padding: 10px 14px; }
.pf-levels summary { cursor: pointer; font-weight: 700; }
.pf-lv-body p { font-size: 0.9em; }
.pf-lv-table { border-collapse: collapse; width: 100%; max-width: 26em; font-size: 0.85em; }
.pf-lv-table th, .pf-lv-table td { text-align: left; padding: 4px 10px; border-bottom: 1px solid var(--fz-line); }
.pf-lv-table th { color: var(--fz-muted); font-weight: 400; }
.pf-lv-table tr.cur td { background: var(--fz-accent-soft); font-weight: 700; }
.pf-lv-you { color: var(--fz-accent); }
@media (max-width: 480px) {
    .pf-card { padding: 16px; }
    .pf-top { gap: 16px; }
    .pf-name { font-size: 1.35em; }
}

/* about me (profile page) */
.pf-bio-wrap { margin-top: 10px; }
.pf-bio { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.92em; line-height: 1.5; }
.pf-bio-empty { font-size: 0.88em; text-decoration: underline dotted; text-underline-offset: 3px; }
.pf-bio-edit { margin-top: 10px; }
.pf-bio-input { min-height: 0; }

/* avatar as a profile link (Fazon.avatar default) */
.fz-av-link { display: inline-flex; border-radius: 50%; flex: none; }
.fz-av-link:focus-visible { outline: 2px solid var(--fz-accent); outline-offset: 2px; }

/* profile hover card (Fazon: any [data-user-card]) */
.fz-ucard {
    position: fixed; z-index: 1100; box-sizing: border-box; width: 420px; max-width: calc(100vw - 16px);
    display: flex; gap: 18px; padding: 18px;
    background: var(--fz-surface); color: var(--text-color);
    border: 1px solid var(--fz-line); border-radius: 14px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45); font-size: 0.85rem; line-height: 1.45; text-align: left;
    animation: fz-fade-in 0.12s ease;
}
.light-mode .fz-ucard { box-shadow: 0 10px 32px rgba(0, 0, 0, 0.16); }
.fz-ucard[hidden] { display: none; }
.fz-uc-left { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 120px; }
.fz-uc-left .fz-av { margin-bottom: 8px; }
.fz-uc-level { color: var(--fz-accent); font-weight: 700; }
.fz-uc-next { color: var(--fz-muted); font-size: 0.85em; text-align: center; text-wrap: balance; }
.fz-uc-right { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.fz-uc-name, .fz-uc-name:visited, .light-mode .fz-uc-name, .light-mode .fz-uc-name:visited {
    color: var(--text-color); font-size: 1.15em; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.fz-uc-name:hover span:first-child { color: var(--fz-accent); }
.fz-uc-name span:first-child { min-width: 0; overflow-wrap: anywhere; }   /* long unbroken names wrap inside the card */
.fz-uc-name .cmt-tag { font-size: 0.65em; font-weight: 400; }
.fz-uc-bio { white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.fz-uc-meta { color: var(--fz-muted); font-size: 0.88em; }

/* User-supplied names, titles and snippets are bidi-isolated, so a stray U+202E (right-to-left
   override) in one can't reverse the text around it ("X liked your comment on …"). */
.fz-np-line b, .notif-line b, .pf-r-line b, .fz-acct-id b, .fz-uc-name span, .pf-name span, .cmt-author,
.fz-np-snip, .notif-snip, .pf-r-snip, .lb-user a, .sm-who a, .tk-row-name, .tk-arch-row span, .fc-li, .fc-tip-r span, .fc-tip-t {
    unicode-bidi: isolate;
}

/* ==== personal API keys: profile "Developers" section (js/fazon-devkeys.js) and the /developers/
   docs page (layouts/developers/section.html). Owned by the API-keys feature; keep it in one block. ==== */
.dk-intro { font-size: 0.92em; }
.dk-err:empty { display: none; }
.dk-list { list-style: none; padding: 0; margin: 1em 0 0; display: flex; flex-direction: column; gap: 8px; }
.dk-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    border: 1px solid var(--fz-line); border-radius: 8px; background: var(--fz-surface);
}
.dk-item.confirming { border-color: var(--fz-bad); }
.dk-info { flex: 1; min-width: 0; }
.dk-line1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dk-name { overflow-wrap: anywhere; unicode-bidi: isolate; }
.dk-scope { font-size: 0.75em; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--fz-line); color: var(--fz-muted); white-space: nowrap; }
.dk-scope-write { border-color: var(--fz-accent); color: var(--fz-accent); background: var(--fz-accent-soft); }
.dk-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 2px; font-size: 0.8em; color: var(--fz-muted); }
.dk-prefix { color: var(--text-color); }
.dk-revoke { flex: none; }
.dk-confirm { flex: 1; min-width: 0; }
.dk-confirm p { margin: 0 0 8px; font-size: 0.9em; }
.fz-btn.dk-danger { border-color: var(--fz-bad); color: var(--fz-bad); }
.fz-btn.dk-danger:hover:not(:disabled) { background: var(--fz-bad); color: #fff; }
.dk-empty { color: var(--fz-muted); font-size: 0.9em; padding: 4px 2px; }
.dk-form {
    margin-top: 16px; padding: 14px; border: 1px dashed var(--fz-line); border-radius: 8px;
    display: flex; flex-direction: column; gap: 8px;
}
.dk-form-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.dk-count { font-size: 0.85em; }
.dk-label { font-size: 0.85em; color: var(--fz-muted); padding: 0; }
.dk-name-input { max-width: 24em; }
.dk-scopes { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.dk-radio { display: flex; align-items: baseline; gap: 8px; font-size: 0.9em; cursor: pointer; }
.dk-radio input { accent-color: var(--fz-accent); }
.dk-full { margin: 0; font-size: 0.85em; }
.dk-reveal {
    margin-top: 12px; padding: 14px; border: 1px solid var(--fz-accent); border-left-width: 4px;
    border-radius: 8px; background: var(--fz-accent-soft);
}
.dk-reveal-h { font-size: 0.95em; }
.dk-warn { margin: 6px 0 10px; font-size: 0.85em; }
.dk-keyrow { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.dk-key {
    flex: 1 1 18em; min-width: 0; padding: 0.45em 0.7em; border-radius: 6px; font-size: 0.85em;
    background: var(--bg-color); border: 1px solid var(--fz-line); overflow-wrap: anywhere; word-break: break-all;
    user-select: all;
}
.dk-copied { display: block; margin-top: 4px; font-size: 0.8em; color: var(--fz-bad); }
.dk-copied:empty { margin: 0; }
.dk-reveal-foot { padding-top: 6px; }
.dk-copybuf { position: fixed; top: 0; left: -9999px; opacity: 0; }
@media (max-width: 480px) {
    .dk-item { flex-wrap: wrap; }
    .dk-revoke { margin-left: auto; }
}

/* /developers/ docs page */
.dev-docs { min-width: 0; }
.dev-docs h1 { margin-bottom: 0.3em; }
.dev-lead { text-align: center; color: var(--fz-muted); margin-top: 0; }
.dev-docs h2 { text-align: left; margin-top: 2.2em; padding-top: 0.4em; border-top: 1px solid var(--fz-line); }
.dev-docs h3 { margin-top: 1.8em; overflow-wrap: anywhere; }
.dev-docs h3 code { font-size: 0.95em; }
.dev-docs :not(pre) > code {
    font-size: 0.9em; padding: 0.05em 0.35em; border-radius: 4px;
    background: var(--fz-surface); border: 1px solid var(--fz-line); overflow-wrap: anywhere;
}
.dev-docs pre {
    max-width: 100%; overflow-x: auto; margin: 0.8em 0 1.2em; padding: 12px 14px; box-sizing: border-box;
    border: 1px solid var(--fz-line); border-radius: 8px; background: var(--fz-surface);
    font-size: 0.82em; line-height: 1.5; tab-size: 4;
}
.dev-docs pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.dev-docs .highlight { max-width: 100%; }
.dev-docs table {
    display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 0.8em 0 1.2em; font-size: 0.85em;
}
.dev-docs th, .dev-docs td { text-align: left; vertical-align: top; padding: 6px 10px; border-bottom: 1px solid var(--fz-line); }
.dev-docs th { color: var(--fz-muted); font-weight: 400; white-space: nowrap; }
.dev-docs td:first-child { white-space: nowrap; }
.dev-docs blockquote { margin: 1em 0; padding: 0.6em 1em; border-left: 3px solid var(--fz-accent); background: var(--fz-surface); border-radius: 0 6px 6px 0; }
.dev-docs blockquote p { margin: 0.3em 0; }
.dev-toc { margin: 1.5em 0 0; border: 1px solid var(--fz-line); border-radius: 8px; padding: 8px 14px; font-size: 0.88em; }
.dev-toc summary { cursor: pointer; font-weight: 700; }
.dev-toc ul { margin: 0.4em 0; padding-left: 1.2em; }
.dev-toc li { margin: 0.15em 0; }
.dev-toc a, .dev-toc a:visited, .light-mode .dev-toc a, .light-mode .dev-toc a:visited { color: var(--text-color); }
.dev-toc a:hover { color: var(--fz-accent); }
/* syntax colours (Hugo/Chroma classes), one palette per theme */
.dev-docs .chroma .c, .dev-docs .chroma .c1, .dev-docs .chroma .cm, .dev-docs .chroma .ch { color: var(--fz-muted); font-style: italic; }
.dev-docs .chroma .s, .dev-docs .chroma .s1, .dev-docs .chroma .s2, .dev-docs .chroma .sa, .dev-docs .chroma .sd, .dev-docs .chroma .se, .dev-docs .chroma .si { color: #9ccc65; }
.dev-docs .chroma .k, .dev-docs .chroma .kn, .dev-docs .chroma .kd, .dev-docs .chroma .kc, .dev-docs .chroma .ow { color: #f0954a; }
.dev-docs .chroma .m, .dev-docs .chroma .mi, .dev-docs .chroma .mf, .dev-docs .chroma .nb, .dev-docs .chroma .bp { color: #7fb8e6; }
.dev-docs .chroma .nt, .dev-docs .chroma .nf, .dev-docs .chroma .nv { color: #d7a6f0; }
.light-mode .dev-docs .chroma .s, .light-mode .dev-docs .chroma .s1, .light-mode .dev-docs .chroma .s2, .light-mode .dev-docs .chroma .sa,
.light-mode .dev-docs .chroma .sd, .light-mode .dev-docs .chroma .se, .light-mode .dev-docs .chroma .si { color: #2e7d32; }
.light-mode .dev-docs .chroma .k, .light-mode .dev-docs .chroma .kn, .light-mode .dev-docs .chroma .kd, .light-mode .dev-docs .chroma .kc,
.light-mode .dev-docs .chroma .ow { color: #b5470a; }
.light-mode .dev-docs .chroma .m, .light-mode .dev-docs .chroma .mi, .light-mode .dev-docs .chroma .mf, .light-mode .dev-docs .chroma .nb,
.light-mode .dev-docs .chroma .bp { color: #1f5f99; }
.light-mode .dev-docs .chroma .nt, .light-mode .dev-docs .chroma .nf, .light-mode .dev-docs .chroma .nv { color: #7b3fa0; }
/* ==== end personal API keys ==== */

/* ==== profile "Your data": export + delete account (js/fazon-account.js, own profile only) ==== */
.acc-intro { font-size: 0.92em; }
.acc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.acc-status { font-size: 0.85em; }
.acc-status:empty, .acc-err:empty { display: none; }
.acc-danger {
    margin-top: 1.4em; padding: 14px 16px; border: 1px solid var(--fz-bad); border-radius: 8px;
}
.acc-danger h3 { margin: 0 0 0.4em; color: var(--fz-bad); font-size: 1em; }
.acc-danger p { margin: 0 0 0.8em; font-size: 0.9em; }
.acc-confirm { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.acc-confirm label { font-size: 0.88em; }
.acc-confirm .fz-input { max-width: 24em; }
.fz-btn.acc-danger-btn { border-color: var(--fz-bad); color: var(--fz-bad); }
.fz-btn.acc-danger-btn:hover:not(:disabled) { background: var(--fz-bad); color: #fff; }
.fz-btn.acc-danger-btn.solid { background: var(--fz-bad); color: #fff; }
/* ==== end "Your data" ==== */
