/* Self-hosted fonts (SIL Open Font License 1.1) - no third-party render-blocking requests */
/* D-DIN PRO by Datto (OFL 1.1) - a DIN 1451 revival, the lettering family used on number plates */
@font-face { font-family: 'D-DIN PRO'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/d-din-pro-600.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/barlow-condensed-latin-ext-600-normal.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/barlow-condensed-latin-600-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: 'Barlow Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/barlow-condensed-latin-ext-700-normal.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/barlow-condensed-latin-700-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: 'Instrument Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/instrument-sans-latin-ext-400-normal.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/instrument-sans-latin-400-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: 'Instrument Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/instrument-sans-latin-ext-500-normal.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/instrument-sans-latin-500-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: 'Instrument Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/instrument-sans-latin-ext-600-normal.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/instrument-sans-latin-600-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: 'Instrument Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/instrument-sans-latin-ext-700-normal.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/instrument-sans-latin-700-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; }

/* =====================================================================
   ZiņoParNr - design system
   One stylesheet, token based. Light + dark via CSS variables only.
   ===================================================================== */

:root {
    --font-sans: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    --font-plate: 'D-DIN PRO', 'Barlow Condensed', 'Arial Narrow', sans-serif;

    --bg: #f2f1ed;
    --surface: #ffffff;
    --surface-2: #f7f6f3;
    --surface-3: #eeece7;
    --line: #e2e0da;
    --line-strong: #cfccc4;
    --ink: #16181d;
    --ink-2: #4b4f58;
    --ink-3: #868a92;

    --accent: #1d3f91;          /* LV plate blue */
    --accent-ink: #ffffff;
    --accent-soft: #e6ebf7;
    --header-bg: #16181d;
    --header-ink: #f2f1ed;

    --pos: #1c7a4b;
    --pos-soft: #e3f1e9;
    --neg: #b42a20;
    --neg-soft: #f8e5e2;
    --warn: #8a5a00;
    --warn-soft: #fbf0d6;

    --radius: 10px;
    --radius-sm: 6px;
    --shadow-pop: 0 10px 30px -10px rgba(20, 22, 28, .25), 0 2px 6px rgba(20, 22, 28, .06);
    --focus: 0 0 0 3px rgba(29, 63, 145, .25);

    --header-h: 64px;
    --bottom-nav-h: 64px;
    color-scheme: light;
}

html.dark {
    --bg: #101113;
    --surface: #17181b;
    --surface-2: #1d1f23;
    --surface-3: #25272c;
    --line: #2a2c31;
    --line-strong: #3a3d44;
    --ink: #ecebe7;
    --ink-2: #b5b7bc;
    --ink-3: #7e8188;

    --accent: #8aa6f2;
    --accent-ink: #0f1830;
    --accent-soft: #1b2440;
    --header-bg: #0b0c0e;
    --header-ink: #ecebe7;

    --pos: #5cc08c;
    --pos-soft: #16291f;
    --neg: #f07a70;
    --neg-soft: #301a18;
    --warn: #e9b949;
    --warn-soft: #2e2410;

    --shadow-pop: 0 12px 32px -8px rgba(0, 0, 0, .6);
    --focus: 0 0 0 3px rgba(138, 166, 242, .35);
    color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--ink);
    font: 15px/1.55 var(--font-sans);
    -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 18px; height: 18px; flex-shrink: 0; }
.icon-sm { width: 15px; height: 15px; }
.muted { color: var(--ink-3); }
.spacer { flex: 1; }

/* ---------- License plate component ----------
   Real LV plate: 520 × 110 mm (≈ 4.7 : 1), blue EU band ≈ 8 % of the length.
   Everything is derived from one height variable (--h), so every size keeps
   the same proportions and the plate stays long, not tall. */
.plate {
    --h: 24px;
    display: inline-flex;
    align-items: center;
    height: var(--h);
    width: calc(var(--h) * 4.7);      /* fixed length: every plate is the same size */
    background: #fff;
    background-clip: padding-box;   /* no white halo outside the rounded border */
    color: #0c0d0f;
    border: max(1px, calc(var(--h) * .07)) solid #15171b;
    border-radius: calc(var(--h) * .14);
    font-family: var(--font-plate);
    font-weight: 600;
    font-synthesis: none;
    overflow: hidden;
    vertical-align: middle;
    flex-shrink: 0;
    transition: transform .15s ease;
}
html.dark .plate { border-color: #000; box-shadow: 0 0 0 1px rgba(255, 255, 255, .14); }
a.plate:hover { transform: translateY(-1px); }

/* Blue EU band: stars above, "LV" below */
.plate-band {
    align-self: stretch;
    width: calc(var(--h) * .54);
    flex-shrink: 0;
    background: #1d3f91;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: calc(var(--h) * .03);
    font: 700 calc(var(--h) * .27)/1 var(--font-sans);
}
.plate-band svg { width: calc(var(--h) * .44); height: calc(var(--h) * .44); display: block; }

/* Characters: centred in the remaining length. text-box trims the font's
   built-in space above capitals so they sit exactly in the vertical middle. */
.plate-num {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: center;          /* centres even when a long plate is squeezed */
    padding: 0 calc(var(--h) * .2);
}
.plate-txt {
    display: block;
    font-size: calc(var(--h) * .9);
    line-height: 1;
    letter-spacing: .07em;            /* keep in sync with PLATE_LETTER_SPACING in utils.js */
    margin-right: -.07em;             /* trailing letter-spacing would push text off-centre */
    white-space: nowrap;
    /* Long custom plates (e.g. ZEMGALE1): same letter height, narrower letters */
    transform: scaleX(var(--fit, 1));
    position: relative;
    top: -.05em;                      /* fallback for browsers without text-box */
}
@supports (text-box: trim-both cap alphabetic) {
    .plate-txt { text-box: trim-both cap alphabetic; top: 0; }
}

.plate--xs { --h: 20px; border-width: 1px; vertical-align: -4px; }
.plate--xs .plate-band { gap: 0; font-size: 5.6px; }
/* Small plates: inner height 18px and capitals exactly 12px tall (cap height is .69em),
   so the letters sit at a whole 3px from the top and bottom. Fractional sizes made some
   plates (the ones narrowed with scaleX) render a pixel higher than others. */
.plate--xs .plate-txt { font-size: 17.39px; }
.plate--xs .plate-band svg.eu-ring { width: 10px; height: 10px; }
.plate--sm { --h: 26px; }
.plate--md { --h: 40px; }
.plate--lg { --h: clamp(48px, 11vw, 72px); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45em;
    height: 38px;
    padding: 0 14px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    border: 1px solid transparent;
    transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { border-color: var(--line-strong); background: var(--surface); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-quiet { color: var(--ink-2); }
.btn-quiet:hover { color: var(--ink); background: var(--surface-3); }
.btn-danger { color: var(--neg); }
.btn-danger:hover { background: var(--neg-soft); }
.btn-block { width: 100%; height: 42px; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    color: var(--ink-3);
    transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.link-btn { color: var(--accent); font-weight: 600; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 30;
    background: var(--header-bg);
    color: var(--header-ink);
}
.header-inner {
    max-width: 1160px; margin: 0 auto;
    height: var(--header-h);
    padding: 0 20px;
    display: flex; align-items: center; gap: 20px;
}
.brand { display: flex; align-items: center; flex-shrink: 0; }
.brand img { height: 36px; width: auto; }
.header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.site-header .icon-btn { color: rgba(242, 241, 237, .7); }
.site-header .icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.site-header .btn-ghost { background: transparent; border-color: rgba(255, 255, 255, .22); color: var(--header-ink); }
.site-header .btn-ghost:hover { background: rgba(255, 255, 255, .08); }
html.dark .site-header .btn-primary { background: #f2f1ed; color: #16181d; }
.site-header .btn-primary { background: #f2f1ed; color: #16181d; }
.user-chip {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 10px 4px 4px; border-radius: 99px;
    font-weight: 600; font-size: 14px;
}
.user-chip:hover { background: rgba(255, 255, 255, .08); }
.user-chip .avatar { width: 28px; height: 28px; font-size: 13px; }

/* Plate-shaped search */
.plate-search {
    position: relative;
    flex: 1; max-width: 440px;
    display: flex; align-items: stretch;
    height: 42px;
    background: #fff;
    border: 2px solid #fff;
    border-radius: 6px;
    color: #111;
}
.plate-search:focus-within { box-shadow: 0 0 0 3px rgba(138, 166, 242, .5); }
.plate-search > .plate-band { --h: 42px; border-radius: 3px 0 0 3px; }
.plate-search input {
    flex: 1; min-width: 0; width: 100%;
    border: 0; outline: 0; background: transparent;
    padding: 0 14px 1px;
    font: 600 26px/1 var(--font-plate);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #111;
}
.plate-search input::placeholder { color: #b9bbc0; letter-spacing: .08em; }
.plate-search button[type=submit] {
    display: flex; align-items: center; justify-content: center;
    width: 42px; color: #555;
}
.plate-search button[type=submit]:hover { color: #111; }
.search-suggest {
    position: absolute; top: calc(100% + 6px); left: -2px; right: -2px;
    background: var(--surface); color: var(--ink);
    border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-pop);
    padding: 6px; z-index: 40;
}
.search-suggest li a {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: var(--radius-sm);
    font-size: 14px; color: var(--ink-2);
}
.search-suggest li a:hover, .search-suggest li a.is-active { background: var(--surface-2); color: var(--ink); }
.search-suggest .suggest-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding: 6px 10px 2px; }

/* ---------- Layout ---------- */
.layout {
    flex: 1 0 auto;
    width: 100%; max-width: 1160px;
    margin: 0 auto;
    padding: 28px 20px 48px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 32px;
    align-items: start;
}
.feed { min-width: 0; }
.aside { display: flex; flex-direction: column; gap: 20px; }

.feed-head { margin-bottom: 16px; }
.feed-head h1 {
    font: 700 34px/1.05 var(--font-display);
    letter-spacing: -.005em;
    text-transform: uppercase;
}
.feed-head p { color: var(--ink-3); margin-top: 4px; font-size: 14px; }

/* Toolbar: sort tabs + filters */
.toolbar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-bottom: 16px;
}
.tabs { display: flex; gap: 2px; padding: 3px; background: var(--surface-3); border-radius: 8px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
    padding: 5px 11px; border-radius: 6px;
    font-size: 13px; font-weight: 600; color: var(--ink-2);
    white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.filters { display: flex; gap: 8px; margin-left: auto; }
.select {
    height: 34px; padding: 0 30px 0 10px;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23868a92' stroke-width='2'%3E%3Cpath d='M3 4.5l3 3 3-3'/%3E%3C/svg%3E") no-repeat right 10px center;
    appearance: none;
    font-size: 13px; color: var(--ink-2);
    max-width: 170px;
    text-overflow: ellipsis;
}
/* Dropdowns have a set width (a long chosen name never widens them) and may shrink
   a little on narrower screens instead of pushing the toolbar onto two lines. */
.filters { flex: 1 1 auto; min-width: 0; justify-content: flex-end; }
.filters .select { width: 150px; flex: 0 1 150px; min-width: 96px; }
@media (min-width: 761px) {
    .toolbar { flex-wrap: nowrap; }
    .toolbar .tabs { flex: 0 0 auto; }   /* tabs keep their size; the dropdowns give way */
}
.select.is-set { border-color: var(--accent); color: var(--ink); font-weight: 600; }
.select:focus { outline: 0; box-shadow: var(--focus); }

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.card-pad { padding: 18px; }
.card-title {
    display: flex; align-items: center; justify-content: space-between;
    font: 700 18px/1 var(--font-display);
    text-transform: uppercase; letter-spacing: .02em;
    margin-bottom: 12px;
}
.card-title a { font: 600 12px var(--font-sans); text-transform: none; letter-spacing: 0; color: var(--ink-3); }
.card-title a:hover { color: var(--accent); }

/* ---------- Post ---------- */
.post-list { display: flex; flex-direction: column; gap: 12px; }
.post {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px 12px;
    transition: border-color .15s;
}
.post:hover { border-color: var(--line-strong); }
.post-head {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 6px 12px;
}
.post-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-width: 0; font-size: 13px; color: var(--ink-3); }
.post-meta .sep { opacity: .5; }
.tag {
    display: inline-flex; align-items: center;
    padding: 2px 8px; border-radius: 4px;
    background: var(--surface-3);
    color: var(--ink-2);
    font-size: 12px; font-weight: 600;
}
.tag-link:hover { background: var(--accent-soft); color: var(--accent); }
.meta-place { display: inline-flex; align-items: center; gap: 4px; }
.meta-link:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.addition--teaser { display: block; margin-top: 12px; padding: 8px 12px; transition: background .15s; }
.addition--teaser:hover { background: var(--surface-3); }
.addition--teaser .addition-head { display: flex; align-items: center; gap: 6px; }
.addition--teaser .addition-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; color: var(--ink-2); white-space: normal; }
.post-time { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.post-time:hover { color: var(--ink); }
.post-text {
    margin-top: 12px;
    font-size: 15px; line-height: 1.6;
    color: var(--ink);
    overflow-wrap: anywhere;
    white-space: pre-line;
}
.post-text a:not(.plate):not(.read-more) { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.read-more { color: var(--accent); font-weight: 600; font-size: 14px; white-space: nowrap; }
.post-thumbs { display: flex; gap: 6px; margin-top: 12px; }
.thumb {
    position: relative; width: 92px; height: 92px;
    border-radius: var(--radius-sm); overflow: hidden;
    background: var(--surface-3); cursor: zoom-in;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.thumb:hover img { transform: scale(1.04); }
.thumb-more {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(10, 11, 13, .55); color: #fff; font-weight: 700;
}
.post-foot {
    display: flex; align-items: center; gap: 6px;
    margin-top: 12px; padding-top: 10px;
    border-top: 1px solid var(--line);
}
.foot-btn {
    display: inline-flex; align-items: center; gap: 6px;
    height: 32px; padding: 0 10px;
    border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 600; color: var(--ink-3);
    transition: background .15s, color .15s;
}
.foot-btn:hover { background: var(--surface-3); color: var(--ink); }
.foot-btn.is-danger:hover { background: var(--neg-soft); color: var(--neg); }

/* Vote control */
.vote {
    display: inline-flex; align-items: center;
    border: 1px solid var(--line); border-radius: 99px;
    height: 32px;
}
.vote-btn {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 100%;
    color: var(--ink-3);
    border-radius: 99px;
    transition: color .15s, background .15s;
}
.vote-btn:hover { background: var(--surface-3); color: var(--ink); }
.vote-up.is-on { color: var(--pos); background: var(--pos-soft); }
.vote-down.is-on { color: var(--neg); background: var(--neg-soft); }
.vote-score {
    min-width: 28px; text-align: center;
    font: 700 14px/1 var(--font-sans);
    font-variant-numeric: tabular-nums;
    color: var(--ink-2);
}
.is-pos { color: var(--pos) !important; }
.is-neg { color: var(--neg) !important; }
.vote--sm { height: 28px; border: 0; }
.vote--sm .vote-btn { width: 26px; }
.vote--sm .vote-score { font-size: 13px; min-width: 22px; }

/* Full (single) post */
.post--full { padding: 22px 24px 14px; }
.post--full .post-text { font-size: 16.5px; line-height: 1.65; margin-top: 16px; }
.post-number { font-size: 13px; color: var(--ink-3); }
.gallery { display: grid; gap: 6px; margin-top: 18px; grid-template-columns: repeat(2, 1fr); }
.gallery.is-single { grid-template-columns: 1fr; }
.gallery-item {
    position: relative; border-radius: var(--radius-sm); overflow: hidden;
    background: var(--surface-3); cursor: zoom-in; aspect-ratio: 4 / 3;
}
.gallery.is-single .gallery-item { aspect-ratio: auto; max-height: 520px; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.gallery.is-single .gallery-item img { object-fit: contain; max-height: 520px; background: var(--surface-3); }
.gallery-del {
    position: absolute; top: 8px; right: 8px; z-index: 2;
    width: 30px; height: 30px; border-radius: 99px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(10, 11, 13, .7); color: #fff;
    opacity: 0; transition: opacity .15s;
}
.gallery-item:hover .gallery-del, .gallery-del:focus-visible { opacity: 1; }
@media (hover: none) { .gallery-del { opacity: 1; } }
.vote-counts { font-size: 13px; color: var(--ink-3); margin-left: 6px; }

.additions { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.addition {
    border-left: 3px solid var(--accent);
    background: var(--surface-2);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 10px 14px;
}
.addition-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.addition-text { margin-top: 4px; white-space: pre-wrap; font-size: 15px; }

.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-3); margin-bottom: 14px; }
.back-link:hover { color: var(--ink); }

/* ---------- Plate summary panel ---------- */
.plate-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 24px;
    margin-bottom: 18px;
    position: relative;
    overflow: hidden;
}
/* tinted background instead of a side stripe. --tint grows with the score
   (set inline from JS: 1-4 light, 5-9 darker, 10-14 darker still ...) */
.plate-panel.tone-pos { --tone: var(--pos); }
.plate-panel.tone-neg { --tone: var(--neg); }
.plate-panel.tone-pos, .plate-panel.tone-neg {
    --tint: 20%;
    border-color: color-mix(in srgb, var(--tone) calc(var(--tint) * 1.5), var(--line));
    background: linear-gradient(120deg,
        color-mix(in srgb, var(--tone) var(--tint), var(--surface)) 0%,
        color-mix(in srgb, var(--tone) calc(var(--tint) * .7), var(--surface)) 55%,
        color-mix(in srgb, var(--tone) calc(var(--tint) * .4), var(--surface)) 100%);
}
html.dark .plate-panel.tone-pos, html.dark .plate-panel.tone-neg { box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
.plate-panel[class*="tone-"] .plate-facts { border-top-color: color-mix(in srgb, var(--tone, var(--line)) 22%, var(--line)); }
.plate-panel.tone-pos .verdict.is-pos { background: var(--pos); color: #fff !important; }
.plate-panel.tone-neg .verdict.is-neg { background: var(--neg); color: #fff !important; }
html.dark .plate-panel.tone-pos .verdict.is-pos { color: #0b2316 !important; }
html.dark .plate-panel.tone-neg .verdict.is-neg { color: #2b0c09 !important; }
/* labels stay readable on the stronger tints */
.plate-panel[class*="tone-"] .plate-facts dt,
.plate-panel[class*="tone-"] .plate-score-label,
.plate-panel[class*="tone-"] .owner-link { color: var(--ink); }
.plate-panel[class*="tone-"] .plate-facts { border-top-color: color-mix(in srgb, var(--ink) 15%, transparent); }
.plate-panel-main { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.plate-score { text-align: right; }
.plate-score-num {
    display: block;
    font: 700 56px/0.9 var(--font-display);
    font-variant-numeric: tabular-nums;
}
.plate-score-label { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.verdict {
    display: inline-block; margin-top: 6px;
    font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 4px;
}
.verdict.is-pos { background: var(--pos-soft); }
.verdict.is-neg { background: var(--neg-soft); }
.plate-facts {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 20px 0 0; padding-top: 16px;
    border-top: 1px solid var(--line);
}
.plate-facts div { padding-right: 10px; }
.plate-facts dt { font-size: 12px; color: var(--ink-3); }
.plate-facts dd { margin: 2px 0 0; font: 700 22px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.plate-panel-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.plate-panel--compact { padding: 16px 20px; margin-bottom: 0; }
.plate-panel--compact .plate-score-num { font-size: 40px; }
.plate-panel--compact .plate-facts { display: none; }

.notice {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
    padding: 12px 14px; margin-bottom: 14px;
    border-radius: var(--radius); font-size: 14px;
    background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2);
}
.notice strong { color: var(--ink); }
.notice--warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 24px; flex-wrap: wrap; }
.page-btn {
    min-width: 36px; height: 36px; padding: 0 10px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    font-weight: 600; font-size: 14px; color: var(--ink-2);
}
.page-btn:hover { background: var(--surface-3); color: var(--ink); }
.page-btn.is-current { background: var(--ink); color: var(--bg); }
.page-btn[disabled] { opacity: .35; pointer-events: none; }
.page-info { width: 100%; text-align: center; font-size: 12px; color: var(--ink-3); margin-top: 6px; }

/* ---------- Leaderboards ---------- */
.lb-tabs { margin-bottom: 10px; }
.lb-tabs .tab {
    flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    transition: background-color .15s, color .15s, box-shadow .15s;
}
.lb-tabs .tab > span { display: inline-flex; }
.lb-tabs .tab .icon { width: 14px; height: 14px; stroke-width: 2.4; }
/* inactive: coloured text only */
.lb-tabs .tab[data-lb="best"]  { color: var(--pos); }
.lb-tabs .tab[data-lb="worst"] { color: var(--neg); }
.lb-tabs .tab[data-lb="best"]:hover:not(.is-active)  { background: var(--pos-soft); }
.lb-tabs .tab[data-lb="worst"]:hover:not(.is-active) { background: var(--neg-soft); }
/* active: solid coloured pill */
.lb-tabs .tab.is-active[data-lb="best"]  { background: var(--pos); color: #fff; box-shadow: 0 1px 3px color-mix(in srgb, var(--pos) 45%, transparent); }
.lb-tabs .tab.is-active[data-lb="worst"] { background: var(--neg); color: #fff; box-shadow: 0 1px 3px color-mix(in srgb, var(--neg) 45%, transparent); }
html.dark .lb-tabs .tab.is-active[data-lb="best"]  { color: #0b2316; }
html.dark .lb-tabs .tab.is-active[data-lb="worst"] { color: #2b0c09; }
/* a score that changed since the last refresh flashes briefly */
.rank-row.is-updated { animation: rank-flash 1.6s ease-out; }
.rank-row.is-updated .rank-score { animation: rank-pop .5s ease-out; }
@keyframes rank-flash { 0%, 30% { background: var(--accent-soft, var(--surface-3)); } 100% { background: transparent; } }
@keyframes rank-pop { 40% { transform: scale(1.25); } }
@media (prefers-reduced-motion: reduce) { .rank-row.is-updated, .rank-row.is-updated .rank-score { animation: none; } }
.rank-row {
    display: grid; grid-template-columns: 18px auto 1fr auto;
    align-items: center; gap: 10px;
    padding: 7px 6px; border-radius: var(--radius-sm);
}
.rank-row:hover { background: var(--surface-2); }
.rank-n { font: 700 14px var(--font-display); color: var(--ink-3); text-align: right; }
.rank-meta { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-score { font: 700 17px var(--font-display); font-variant-numeric: tabular-nums; }
.rank-list--full .rank-row { padding: 12px 14px; grid-template-columns: 28px auto 1fr auto; gap: 16px; }
.rank-list--full .rank-row + .rank-row { border-top: 1px solid var(--line); border-radius: 0; }
.rank-list--full .rank-n { font-size: 20px; }
.rank-list--full .rank-score {
    font-size: 22px; line-height: 1; min-width: 56px; text-align: center;
    padding: 6px 10px; border-radius: 8px; background: var(--surface-3);
}
.rank-list--full .rank-score.is-pos { background: var(--pos-soft); }
.rank-list--full .rank-score.is-neg { background: var(--neg-soft); }
.rank-list--full .rank-meta { font-size: 13px; }
.rank-meta .rm-short { display: none; align-items: center; gap: 3px; }
.rank-meta .rm-short .icon { width: 13px; height: 13px; opacity: .8; }
.rank-meta .rm-short .icon:not(:first-child) { margin-left: 7px; }

/* Activity */
.activity li + li { border-top: 1px solid var(--line); }
.activity a { display: flex; gap: 10px; padding: 10px 2px; }
.activity a:hover .activity-text { color: var(--ink); }
.activity-ico {
    width: 28px; height: 28px; border-radius: 99px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-3); color: var(--ink-3);
}
.activity-ico--comment { color: var(--accent); }
.activity-top > span { white-space: nowrap; }
.activity-top .act-what { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.activity-top .act-what b { color: var(--ink-2); font-weight: 600; }
.activity-top .act-time { flex-shrink: 0; }
.activity-top .spacer { flex: 1; min-width: 0; }
.act-foot { display: flex; align-items: center; gap: 12px; margin-top: 5px; font-size: 12px; color: var(--ink-3); }
.act-foot > span { display: inline-flex; align-items: center; gap: 3px; }
.act-score b { font: 700 13px/1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--ink-2); }
.act-foot .act-time { margin-left: auto; }
.activity-body { min-width: 0; flex: 1; }
.activity-top { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); }
.activity-text { font-size: 13px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 3px; }

.about-card p { font-size: 14px; color: var(--ink-2); }
.about-card ul { margin: 12px 0; display: grid; gap: 6px; }
.about-card li { display: flex; gap: 8px; font-size: 14px; color: var(--ink-2); }
.about-card li::before { content: ''; width: 6px; height: 6px; border-radius: 1px; background: var(--accent); margin-top: 8px; flex-shrink: 0; }
.about-card .fine { font-size: 12px; color: var(--ink-3); }

.list-msg { font-size: 13px; color: var(--ink-3); padding: 8px 4px; }

/* ---------- Comments ---------- */
.comments { margin-top: 18px; }
.comments-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.comments-head h2 { font: 700 22px var(--font-display); text-transform: uppercase; }
.comments-head h2 span { color: var(--ink-3); }
.comment-form { display: flex; gap: 12px; margin-bottom: 8px; }
.comment-form .field-wrap { flex: 1; }
.comment-form textarea { min-height: 44px; resize: vertical; }
.comment-form-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--ink-3); }
.comment-login { padding: 14px; text-align: center; background: var(--surface-2); border-radius: var(--radius); font-size: 14px; color: var(--ink-2); margin-bottom: 8px; }
.comment-list li.comment { display: flex; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); }
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--ink-3); }
.comment-author { font-weight: 700; color: var(--ink); }
.comment-author:hover { text-decoration: underline; }
.rep { font-size: 12px; font-weight: 600; }
.comment-text { margin-top: 4px; font-size: 15px; overflow-wrap: anywhere; white-space: pre-line; }
.comment-text a:not(.plate) { color: var(--accent); text-decoration: underline; }
.comment-actions { display: flex; align-items: center; gap: 2px; margin-top: 4px; margin-left: -6px; }
.comment-actions .foot-btn { height: 28px; padding: 0 8px; font-size: 12px; }

.avatar {
    --h: 220;
    width: 36px; height: 36px; border-radius: 99px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: hsl(var(--h) 45% 88%); color: hsl(var(--h) 45% 28%);
    font: 700 15px var(--font-sans); text-transform: uppercase;
}
html.dark .avatar { background: hsl(var(--h) 30% 24%); color: hsl(var(--h) 60% 82%); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field + .field { margin-top: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.field-row .field + .field { margin-top: 0; }
.label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.label .req { color: var(--neg); }
.hint { font-size: 12px; color: var(--ink-3); }
.input, .textarea, .field .select {
    width: 100%; max-width: none;
    height: 42px; padding: 0 12px;
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 15px; color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.input:focus, .textarea:focus, .field .select:focus { outline: 0; border-color: var(--accent); box-shadow: var(--focus); }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.hint-box {
    font-size: 13px; color: var(--ink-2);
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
}
.hint-box code { font-family: var(--font-plate); font-weight: 600; font-size: 14px; letter-spacing: .04em; }

/* Plate input inside the post form */
.plate-input {
    display: flex; align-items: stretch; height: 58px; width: 100%; max-width: 280px;
    background: #fff; border: 2px solid #15171b; border-radius: 6px; overflow: hidden;
}
.plate-input:focus-within { box-shadow: var(--focus); }
.plate-input > .plate-band { --h: 54px; }
.plate-input input {
    flex: 1; min-width: 0; border: 0; outline: 0; background: #fff; color: #111;
    padding: 0 16px 2px; font: 600 38px/1 var(--font-plate); text-align: center; letter-spacing: .08em; text-transform: uppercase;
}
.plate-input input::placeholder { color: #c4c6ca; }

.dropzone {
    border: 1.5px dashed var(--line-strong); border-radius: var(--radius);
    padding: 18px; text-align: center; color: var(--ink-3); font-size: 14px;
    transition: border-color .15s, background .15s;
}
.dropzone { cursor: pointer; }
.dropzone .dz-touch { display: none; align-items: center; justify-content: center; gap: 8px; font-weight: 600; color: var(--accent); }
@media (pointer: coarse) {
    .dropzone .dz-desktop { display: none; }
    .dropzone .dz-touch { display: flex; }
    .dropzone { padding: 22px; }
}
.dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.previews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.preview { position: relative; width: 76px; height: 76px; border-radius: var(--radius-sm); overflow: hidden; }
.preview img { width: 100%; height: 100%; object-fit: cover; }
.preview button {
    position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 99px;
    background: rgba(10, 11, 13, .75); color: #fff; display: flex; align-items: center; justify-content: center;
}

.divider { display: flex; align-items: center; gap: 10px; margin: 16px 0; font-size: 12px; color: var(--ink-3); }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth-links { display: flex; justify-content: space-between; margin-top: 14px; font-size: 13px; }
.auth-links button { color: var(--ink-3); }
.auth-links button:hover { color: var(--accent); }
.auth-switch {
    margin: 20px -20px -20px; padding: 16px 20px 20px;
    border-top: 1px solid var(--line); background: var(--surface-2);
    display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
    font-size: 14px; color: var(--ink-2);
}
.auth-switch .btn { flex: 1 1 100%; border-color: var(--accent); color: var(--accent); background: var(--surface); }
.auth-switch .btn:hover { background: var(--accent-soft); }
.auth-switch .link-strong { color: var(--accent); font-weight: 700; }
.auth-switch .link-strong:hover { text-decoration: underline; }
.gsi-wrap { display: flex; justify-content: center; min-height: 44px; }

/* ---------- Modals ---------- */
.modal {
    position: fixed; inset: 0; z-index: 60;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    background: rgba(10, 11, 13, .55);
    animation: fade .15s ease;
}
.modal-card {
    width: 100%; max-width: 440px; max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: var(--surface);
    border-radius: 14px;
    box-shadow: var(--shadow-pop);
    animation: rise .2s ease;
}
.modal-card--wide { max-width: 600px; }
.modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px 0;
}
.modal-head h2 { font: 700 24px var(--font-display); text-transform: uppercase; letter-spacing: .01em; }
.modal-body { padding: 16px 20px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 20px; }
.modal-intro { font-size: 14px; color: var(--ink-2); margin-bottom: 14px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Lightbox ---------- */
.lightbox {
    position: fixed; inset: 0; z-index: 90;
    background: rgba(5, 6, 8, .94);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
    padding: 20px;
}
.lightbox img.lb-main { max-width: 92vw; max-height: 78vh; object-fit: contain; border-radius: 6px; }
.lightbox .lb-count { color: #aaa; font-size: 13px; }
.lightbox .lb-thumbs { display: flex; gap: 6px; }
.lightbox .lb-thumbs img { width: 52px; height: 52px; object-fit: cover; border-radius: 4px; opacity: .45; cursor: pointer; }
.lightbox .lb-thumbs img.is-current { opacity: 1; outline: 2px solid #fff; }
.lightbox .lb-btn {
    position: absolute; color: #fff; width: 48px; height: 48px; border-radius: 99px;
    display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .08);
}
.lightbox .lb-btn:hover { background: rgba(255, 255, 255, .16); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

/* ---------- Toast ---------- */
.toast {
    position: fixed; left: 50%; bottom: 24px; z-index: 100;
    transform: translate(-50%, 12px);
    max-width: min(92vw, 460px);
    padding: 11px 16px 11px 14px;
    border-radius: 8px;
    background: var(--ink); color: var(--bg);
    font-size: 14px; font-weight: 500;
    box-shadow: var(--shadow-pop);
    display: flex; align-items: center; gap: 10px;
    opacity: 0; pointer-events: none;
    transition: opacity .2s, transform .2s;
}
.toast::before { content: ''; width: 8px; height: 8px; border-radius: 99px; background: var(--ink-3); flex-shrink: 0; }
.toast--success::before { background: #4cc283; }
.toast--error::before { background: #f0645a; }
.toast--warning::before { background: #f0b93a; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }

/* ---------- Empty + loading ---------- */
.empty {
    text-align: center; padding: 48px 24px;
    background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius);
}
.empty .plate { margin-bottom: 16px; }
.empty h3 { font: 700 22px var(--font-display); text-transform: uppercase; }
.empty p { color: var(--ink-2); margin: 6px auto 0; max-width: 380px; font-size: 14px; }
.empty .empty-actions { display: flex; justify-content: center; gap: 8px; margin-top: 18px; flex-wrap: wrap; }

.skeleton { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.sk { background: var(--surface-3); border-radius: 4px; position: relative; overflow: hidden; }
.sk::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent);
    animation: shimmer 1.3s infinite;
}
html.dark .sk::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .05), transparent); }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ---------- Profile ---------- */
.profile-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.profile-head .avatar { width: 64px; height: 64px; font-size: 26px; }
.profile-head h1 { font: 700 32px var(--font-display); }
.profile-head p { color: var(--ink-3); font-size: 14px; }
.profile-score { margin-left: auto; text-align: right; }
.profile-score b { display: block; font: 700 44px/1 var(--font-display); }
.profile-score span { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.profile-items li { padding: 14px 0; border-top: 1px solid var(--line); }
.profile-items .pi-top { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-3); }
.profile-items .pi-text { margin-top: 6px; font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 24px; flex-shrink: 0; }
.footer-inner {
    max-width: 1160px; margin: 0 auto; padding: 24px 20px;
    display: flex; align-items: center; gap: 16px 28px; flex-wrap: wrap;
    font-size: 13px; color: var(--ink-3);
}
.footer-inner nav { display: flex; gap: 18px; }
.footer-inner a:hover { color: var(--ink); }
.footer-inner .footer-note { margin-left: auto; }

/* ---------- Mobile bottom nav ---------- */
.bottom-nav { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
    .layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .aside { position: static; }
}
@media (max-width: 760px) {
    :root { --header-h: auto; }
    body { font-size: 15px; }
    .header-inner { flex-wrap: wrap; height: auto; padding: 10px 14px 12px; gap: 10px; }
    .brand img { height: 30px; }
    .plate-search { order: 3; flex-basis: 100%; max-width: none; min-width: 0; height: 44px; }
    .header-actions .hide-sm { display: none; }
    .layout { padding: 18px 12px 96px; }
    .feed-head h1 { font-size: 28px; }
    .toolbar { flex-direction: column; align-items: stretch; flex-wrap: nowrap; }
    .filters { margin-left: 0; }
    .filters .select { flex: 1; max-width: none; }
    .post, .post--full { padding: 14px 14px 10px; border-radius: 8px; }
    .post-head { grid-template-columns: auto 1fr; }
    .post-time { grid-column: 2; grid-row: 1; justify-self: end; }
    .post-meta { grid-column: 1 / -1; }
    .thumb { width: 76px; height: 76px; }
    .plate-panel { padding: 20px 16px; text-align: center; }
    .plate-panel-main { flex-direction: column; justify-content: center; gap: 14px; }
    .plate-score { text-align: center; }
    .plate-score-num { font-size: 46px; }
    .plate-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); text-align: center; }
    .plate-facts div { padding: 0 2px; }
    .plate-facts dt { font-size: 11px; }
    .plate-facts dd { font-size: 20px; }
    .plate-panel-actions { justify-content: center; }
    .plate-panel-actions .btn { flex: 1 1 auto; justify-content: center; }
    .plate-panel--compact .plate-panel-main { flex-direction: row; justify-content: space-between; }
    .plate-panel--compact .plate-score { text-align: right; }
    .field-row { grid-template-columns: 1fr; }
    .rank-list--full .rank-row { grid-template-columns: 20px auto 1fr auto; gap: 10px; padding: 10px 14px 10px 10px; }
    .rank-list--full .rank-score { font-size: 19px; min-width: 48px; padding: 6px 8px; }
    .rank-list--full .rank-meta .rm-long { display: none; }
    .rank-list--full .rank-meta .rm-short { display: inline-flex; }
    .profile-score { margin-left: 0; text-align: left; width: 100%; }
    .footer-inner { padding-bottom: 90px; }
    .footer-inner .footer-note { margin-left: 0; }
    .toast { bottom: calc(var(--bottom-nav-h) + 16px); }

    .bottom-nav {
        display: grid; grid-template-columns: repeat(5, 1fr);
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
        height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        background: var(--surface); border-top: 1px solid var(--line);
    }
    .bottom-nav a, .bottom-nav button {
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
        font-size: 11px; font-weight: 600; color: var(--ink-3);
    }
    .bottom-nav .is-active { color: var(--ink); }
    .bottom-nav .bn-add span.bn-plus {
        width: 44px; height: 32px; border-radius: 8px;
        display: flex; align-items: center; justify-content: center;
        background: var(--accent); color: var(--accent-ink);
    }
    /* touch-friendly sizes (>= ~36-40px tap targets) */
    .vote { height: 38px; }
    .vote-btn { width: 40px; }
    .vote--sm { height: 34px; }
    .vote--sm .vote-btn { width: 34px; }
    .comment-actions .foot-btn { height: 34px; }
    .tag { min-height: 28px; display: inline-flex; align-items: center; }
    .meta-link { padding: 6px 2px; margin: -6px -2px; }
    #lb-more { display: inline-block; padding: 8px 0; }
    .back-link { padding: 6px 0; }
    /* iOS zooms into inputs under 16px - keep form text at 16px */
    .input, .textarea, .select, .field .select { font-size: 16px; }
    /* sort tabs scroll sideways: fade the edge so it's clear there's more */
    .toolbar .tabs { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
    .toolbar .tabs.is-end { -webkit-mask-image: none; mask-image: none; }
    .toolbar .tab { padding: 7px 12px; }
    /* the sidebar leaderboard repeats the page itself on /labakie and /kauna-stabs */
    body[data-page="leaderboard"] #lb-card { display: none; }
    .modal { align-items: flex-end; padding: 0; }
    .modal-card { border-radius: 16px 16px 0 0; max-height: 92vh; max-height: 92dvh; }
    /* header (with X) and action buttons stay visible while the form scrolls */
    .modal-head { position: sticky; top: 0; z-index: 2; background: var(--surface); padding-bottom: 10px; }
    .modal-foot {
        position: sticky; bottom: 0; z-index: 2; background: var(--surface);
        border-top: 1px solid var(--line); margin-top: 4px;
        padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
    }
    .modal-foot .btn { flex: 1; justify-content: center; height: 44px; }
    .modal-foot .btn-quiet { flex: 0 0 auto; }
    .auth-switch { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}

@media (max-width: 420px) { .hide-xs { display: none; } }

/* @mention plates inside running text */
.post-text .plate--xs, .comment-text .plate--xs, .pi-text .plate--xs { --h: 20px; vertical-align: -4px; margin: 0 1px; }

/* "N jauni ieraksti" pill above the feed */
.new-pill {
    position: sticky; top: calc(var(--header-h, 60px) + 10px); z-index: 20;
    display: flex; align-items: center; gap: 6px; margin: 0 auto 12px;
    padding: 7px 14px 7px 11px; border-radius: 99px;
    background: var(--accent); color: var(--accent-ink);
    font-size: 13px; font-weight: 600;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
    animation: rise .25s ease-out;
}
.new-pill:hover { filter: brightness(1.08); }

/* ---------- Draft + rules notes in "Jauns ziņojums" ---------- */
.draft-note {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
    margin-bottom: 14px; padding: 9px 12px; border-radius: var(--radius-sm);
    background: var(--accent-soft); color: var(--ink-2); font-size: 13px;
}
.draft-note .link-btn { font-size: 13px; font-weight: 600; }
.rules-note { margin-top: 14px; font-size: 12px; color: var(--ink-3); line-height: 1.5; }
.rules-note a { color: var(--accent); font-weight: 600; }
.footer-inner nav { flex-wrap: wrap; gap: 8px 18px; }

/* ---------- Notifications bell ---------- */
.notif-wrap { position: relative; }
.notif-count {
    position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px;
    border-radius: 99px; background: #e5484d; color: #fff; border: 2px solid var(--header-bg);
    font: 700 10px/13px var(--font-sans); text-align: center; pointer-events: none;
}
.notif-panel {
    position: absolute; top: calc(100% + 8px); right: -40px; z-index: 50;
    width: min(380px, calc(100vw - 24px)); max-height: min(70vh, 520px); overflow-y: auto;
    background: var(--surface); color: var(--ink);
    border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop);
    animation: rise .15s ease;
}
.notif-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 12px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface);
}
.notif-head .link-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.notif-list li + li { border-top: 1px solid var(--line); }
.notif-list a { display: flex; gap: 10px; padding: 12px 14px; }
.notif-list a:hover { background: var(--surface-2); }
.notif-list a.is-unread { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.notif-list a.is-unread .notif-what::before {
    content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 99px;
    background: var(--accent); margin-right: 6px; vertical-align: 2px;
}
.notif-ico { width: 28px; height: 28px; border-radius: 99px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--accent); }
.notif-body { min-width: 0; display: grid; gap: 3px; }
.notif-what { font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.notif-what b { color: var(--ink); }
.notif-excerpt { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-time { font-size: 12px; color: var(--ink-3); }
.notif-empty { padding: 28px 20px; text-align: center; color: var(--ink-3); font-size: 13px; }
.notif-empty .icon { width: 28px; height: 28px; margin-bottom: 8px; opacity: .6; }
@media (max-width: 760px) {
    .notif-panel { position: fixed; top: 58px; left: 12px; right: 12px; width: auto; }
}

/* ---------- Static pages (rules, privacy, removal form) ---------- */
.prose { font-size: 15px; line-height: 1.65; color: var(--ink-2); }
.prose .lead { font-size: 16.5px; color: var(--ink); }
.prose h2 { font: 700 20px/1.2 var(--font-display); text-transform: uppercase; letter-spacing: .02em; color: var(--ink); margin: 26px 0 10px; }
.prose p + p { margin-top: 10px; }
.prose ul { display: grid; gap: 8px; margin: 8px 0 0; padding: 0; }
.prose ul li { position: relative; padding-left: 26px; }
.prose ul li::before { content: ''; position: absolute; left: 8px; top: .7em; width: 6px; height: 6px; border-radius: 99px; background: var(--ink-3); }
.prose ul.check-list li::before, .prose ul.cross-list li::before {
    width: 18px; height: 18px; left: 0; top: .25em; border-radius: 99px; background-repeat: no-repeat; background-position: center; background-size: 12px;
}
.prose ul.check-list li::before { background-color: var(--pos-soft); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231c7a4b' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
.prose ul.cross-list li::before { background-color: var(--neg-soft); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b42a20' stroke-width='3.2' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E"); }
.prose a { color: var(--accent); font-weight: 600; }
.prose a:hover { text-decoration: underline; }
.prose b { color: var(--ink); }
.prose .fine { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }
.data-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 14px; }
.data-table th, .data-table td { text-align: left; vertical-align: top; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.data-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.data-table td:first-child { color: var(--ink); width: 44%; }
@media (max-width: 760px) {
    .data-table thead { display: none; }
    .data-table tr { display: grid; padding: 10px 0; border-bottom: 1px solid var(--line); }
    .data-table td { border: 0; padding: 2px 0; width: auto !important; }
    .data-table td:nth-child(3)::before { content: 'Glabā: '; color: var(--ink-3); }
}
.takedown-form { margin-top: 18px; display: grid; gap: 4px; }
.takedown-form .btn { justify-self: start; margin-top: 10px; height: 44px; padding: 0 18px; }
.input-plate { font: 600 22px var(--font-plate); letter-spacing: .08em; text-transform: uppercase; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); margin-top: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; accent-color: var(--accent); }
.notice--ok { background: var(--pos-soft); border-color: transparent; color: var(--pos); margin-top: 16px; }
.notice--ok span { color: var(--ink); }
.owner-link { margin-left: auto; align-self: center; font-size: 12px; color: var(--ink-3); }
.owner-link:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 760px) { .owner-link { margin: 6px auto 0; flex-basis: 100%; text-align: center; } }

.icon-xs { width: 12px; height: 12px; }

/* Whole post card opens the post */
.post--link { cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.post--link:hover { border-color: var(--line-strong); box-shadow: 0 6px 18px -10px rgba(20, 22, 28, .25); }
html.dark .post--link:hover { box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .7); }
.post--link .post-text, .post--link .post-meta { cursor: inherit; }
.foot-open { color: var(--accent); font-weight: 600; gap: 2px; }
.foot-open:hover { background: var(--accent-soft); color: var(--accent); }
.post--link:hover .foot-open .icon { transform: translateX(2px); }
.foot-open .icon { transition: transform .15s; }

/* "⋯" post menu */
.card-menu {
    position: absolute; z-index: 60; min-width: 220px; padding: 6px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-pop); animation: rise .12s ease;
}
.card-menu button {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: var(--radius-sm);
    font-size: 14px; color: var(--ink-2); text-align: left;
}
.card-menu button:hover, .card-menu button:focus-visible { background: var(--surface-2); color: var(--ink); outline: 0; }
.card-menu button.is-danger { color: var(--neg); }
.card-menu button.is-danger:hover { background: var(--neg-soft); }
.post.is-removing { opacity: 0; transform: scale(.98); transition: opacity .25s, transform .25s; }

/* ---------- Leaderboard: 3 tabs ---------- */
.lb-tabs .tab { flex: 1 1 auto; padding-left: 6px; padding-right: 6px; font-size: 13px; }
.lb-tabs .tab > span { display: none; } /* three tabs: colour says enough, the arrows don't fit */
.lb-tabs .tab[data-lb="week"] { color: var(--accent); }
.lb-tabs .tab[data-lb="week"]:hover:not(.is-active) { background: var(--accent-soft); }
.lb-tabs .tab.is-active[data-lb="week"] { background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 3px color-mix(in srgb, var(--accent) 45%, transparent); }

/* ---------- Follow button ---------- */
[data-follow].is-following { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.notice .notice-follow { margin-left: auto; }

/* ---------- Score history chart ---------- */
.plate-history { margin-top: 18px; }
.ph-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.ph-now { font: 700 15px var(--font-display); letter-spacing: 0; }
.ph-wrap { position: relative; height: 132px; touch-action: pan-y; cursor: crosshair; }
.ph-wrap svg { width: 100%; height: 100%; display: block; overflow: visible; }
.ph-zero { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; opacity: .7; }
.ph-area--pos { fill: color-mix(in srgb, var(--pos) 18%, transparent); }
.ph-area--neg { fill: color-mix(in srgb, var(--neg) 18%, transparent); }
.ph-line { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.ph-line--pos { stroke: var(--pos); }
.ph-line--neg { stroke: var(--neg); }
.ph-cross { stroke: var(--ink-2); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ph-dot { fill: var(--surface); stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; }
.ph-y { position: absolute; left: 0; transform: translateY(-50%); font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; pointer-events: none; }
.ph-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); padding-left: 34px; margin-top: 2px; }
.ph-tip {
    position: absolute; top: -6px; width: 70px; padding: 4px 6px; border-radius: 6px; pointer-events: none;
    background: var(--ink); color: var(--surface); font-size: 11px; text-align: center; display: grid; line-height: 1.3;
}
.ph-tip b { font: 700 14px var(--font-display); }
.plate-panel[class*="tone-"] .ph-dot { fill: transparent; }

/* ---------- Edit within 10 min / replies ---------- */
.inline-edit { display: grid; gap: 8px; margin-top: 10px; }
.inline-edit-foot { display: flex; align-items: center; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.inline-edit-foot .hint { margin-right: auto; }
.foot-edit { color: var(--accent); font-weight: 600; }
.foot-edit .edit-left { font-weight: 500; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.edited { color: var(--ink-3); font-style: italic; }
.reply-chip {
    display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px; padding: 4px 6px 4px 10px;
    border-radius: 99px; background: var(--accent-soft); color: var(--ink-2); font-size: 12px;
}
.reply-chip[hidden] { display: none; }
.reply-chip b { color: var(--ink); }
.reply-chip-x { display: inline-flex; padding: 3px; border-radius: 99px; color: var(--ink-3); }
.reply-chip-x:hover { background: var(--surface); color: var(--ink); }
.reply-ref {
    display: flex; align-items: center; gap: 6px; margin: 6px 0 2px; padding: 5px 9px; max-width: 100%;
    border-left: 2px solid var(--line-strong); background: var(--surface-2); border-radius: 0 6px 6px 0;
    font-size: 12.5px; color: var(--ink-3); overflow: hidden;
}
.reply-ref b { color: var(--ink-2); flex-shrink: 0; }
.reply-ref span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-ref:hover { border-left-color: var(--accent); color: var(--ink-2); }
.comment.is-flash { animation: rank-flash 1.6s ease-out; border-radius: 8px; }
.post-owner-note { margin-top: 10px; font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 5px; }
.post-owner-note a { color: var(--ink-3); text-decoration: underline; text-underline-offset: 2px; }
.post-owner-note a:hover { color: var(--ink); }

/* ---------- Cover faces editor ---------- */
.preview .preview-blur {
    position: absolute; left: 4px; bottom: 4px; top: auto; right: auto; width: auto; height: auto;
    display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px; border-radius: 5px;
    background: rgba(0, 0, 0, .65); color: #fff; font-size: 11px; font-weight: 600;
}
.blur-stage { position: relative; display: flex; justify-content: center; background: #111; border-radius: var(--radius-sm); overflow: hidden; touch-action: none; }
.blur-stage canvas { max-width: 100%; max-height: 62vh; height: auto; display: block; cursor: crosshair; touch-action: none; }
.blur-rect { position: absolute; border: 2px dashed #ffd200; background: rgba(255, 210, 0, .15); pointer-events: none; }
.blur-modal .modal-foot [data-undo] { margin-right: auto; }

/* ---------- Followed plates on the profile ---------- */
.follow-row { display: flex; align-items: center; gap: 12px; }
.follow-meta { font-size: 13px; color: var(--ink-3); }

.ph-tip[hidden] { display: none; }
.plate-panel .plate-history { text-align: left; }
