/* tokens.css — Design tokens (colours, type, geometry) + dark theme

   Нововолинськ інфо. Look: simple and precise, in the spirit of attio.com —
   white canvas, hairline borders, cool greys, near-black ink, Inter with a
   slight negative tracking, 8/12px radii, whisper-soft shadows. The brand
   colour (from the logo) lives in --accent*; everything else is neutral.

   Components NEVER hardcode colours — only var(--token). A dark theme is a
   re-declaration of this block (see the bottom). See style.md. */

/* Inter (OFL), self-hosted variable font 400–700. unicode-range means a
   page downloads only the subsets it actually renders (~85 KB for
   Cyrillic + Latin; the extended sets load only when needed, e.g. ₴). */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../../fonts/inter/inter-cyrillic-ext.woff2") format("woff2");
    unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../../fonts/inter/inter-cyrillic.woff2") format("woff2");
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../../fonts/inter/inter-latin-ext.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: "Inter";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../../fonts/inter/inter-latin.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;
}

:root {
    /* Surfaces */
    --bg: #ffffff;               /* page canvas */
    --surface: #ffffff;          /* cards, panels, popovers */
    --soft: #f7f7f8;             /* quiet fills: sidebars, wells, placeholders */

    /* Ink (text) — near-black with a cool cast, Attio-like */
    --ink: #1b1c1f;
    --ink-2: #3c3f45;
    --ink-3: #6f747d;
    --ink-4: #a0a4ac;

    /* Lines */
    --line: #ececef;             /* hairlines: card borders, dividers */
    --line-2: #dcdee3;           /* control borders (buttons, inputs) */

    /* Neutral states (hover / active / chips) */
    --surface-hover: #f4f4f6;
    --surface-active: #eeeff1;
    --surface-2: #e7e8eb;
    --chip-bg: #f2f3f5;

    /* Alias of --ink-3 — many components reference var(--muted). */
    --muted: var(--ink-3);

    /* Accent — the brand colour from the logo (#0E2229, deep ink-teal).
       Primary buttons, active states, "on" icons, focus rings. */
    --accent: #0e2229;
    --accent-hover: #1b3a45;
    --accent-soft: #e9f0f2;
    --accent-ink: #ffffff;       /* text on --accent */
    --link: #0e2229;             /* inline links in prose */

    /* Status */
    --danger: #e5484d;
    --danger-dark: #b42318;
    --danger-soft: #feeceb;
    --success: #17a34a;
    --success-soft: #e9f8ef;
    --warning: #d99000;
    --warning-soft: #fff5db;

    /* Type */
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-serif: var(--font-sans);   /* one family everywhere (reading included) */
    --tracking: -0.011em;             /* Inter reads tighter, like Attio */
    --tracking-tight: -0.022em;       /* headings */

    /* Elevation — hairline-first, shadows barely there */
    --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
    --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.03);
    --shadow-md: 0 8px 24px rgba(16, 24, 40, 0.07), 0 1px 3px rgba(16, 24, 40, 0.04);
    --shadow-lg: 0 16px 44px rgba(16, 24, 40, 0.14), 0 2px 6px rgba(16, 24, 40, 0.05);
    --ring: 0 0 0 3px rgba(14, 34, 41, 0.14);

    /* Geometry. The shell width and column positions NEVER change between
       layouts (3-col vs 2-col); a 2-col page just leaves the right rail
       empty, the left nav and the centre column stay where they were. */
    --radius-sm: 6px;            /* chips, badges, small controls */
    --radius: 8px;               /* buttons, inputs, nav items */
    --radius-lg: 12px;           /* cards, panels, popovers */
    --radius-pill: 999px;
    --control-h: 34px;           /* buttons / inputs */
    --shell-w: 1280px;
    --content-w: 720px;
    --content-2col: 744px;
    --left-w: 200px;
    --right-w: 300px;
    --gutter: 28px;
}

/* Dark theme (planned) — flip the tokens here, components stay untouched.
   Enable by adding data-theme="dark" on <html>. Kept commented until the
   palette is finalised; see style.md.
:root[data-theme="dark"] {
    --bg: #0e0f11;
    --surface: #151619;
    --soft: #1a1b1e;
    --ink: #ececef;
    --ink-2: #c4c6cc;
    --ink-3: #8c9099;
    --ink-4: #62666e;
    --line: #25272b;
    --line-2: #33363b;
    --surface-hover: #1e2023;
    --surface-active: #24262a;
    --surface-2: #2b2d32;
    --chip-bg: #222428;
    --accent: #ececef;
    --accent-hover: #ffffff;
    --accent-soft: #24262a;
    --accent-ink: #0e0f11;
    --link: #ececef;
}
*/

/* base.css — Reset, base elements, safety nets */

/* Reset / base */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

/* ------------------------------------------------------------------
   iOS Safari auto-zoom guard. Safari forcibly zooms the page in when
   the user taps an input/textarea/select whose computed font-size is
   under 16px. That feels like the site is "jumping" on every search
   click or reply tap. Pinning textual fields to >=16px on mobile
   suppresses that zoom entirely (without locking pinch-zoom for
   accessibility — we keep the default viewport meta).

   `!important` is intentional here: this rule must beat every
   per-component override (search-form, comment-form, etc.). Treat it
   as an accessibility/UX safeguard, not styling. */
@media (max-width: 760px) {
    input[type="text"],
    input[type="search"],
    input[type="email"],
    input[type="url"],
    input[type="tel"],
    input[type="password"],
    input[type="number"],
    input:not([type]),
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* overflow-x: clip (not "hidden") — clip does NOT create a scroll
   container, so position:sticky on descendants still anchors to the
   viewport and the sidebars track the scroll. "hidden" silently
   breaks sticky. */
html, body {
    overflow-x: clip;
    max-width: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: var(--tracking);
    font-feature-settings: "cv11";     /* Inter: single-storey a — calmer text */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

::selection { background: rgba(14, 34, 41, 0.14); }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm); }

/* Anti-overflow safety net — nothing escapes the viewport on mobile.
   Long URLs in comments / posts wrap. Media never overflows its column. */
img, video, iframe, embed, object, audio, table, pre {
    max-width: 100%;
}

img, video { height: auto; }

pre, code, kbd, samp {
    overflow-x: auto;
    word-wrap: break-word;
}

.card-title, .feed-title, .card-excerpt, .grid-card-title,
.comment-body, .post-body, .post-lead {
    overflow-wrap: anywhere;
    word-break: break-word;
}

table { display: block; overflow-x: auto; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--ink); }

img { max-width: 100%; display: block; }

button { font: inherit; letter-spacing: inherit; cursor: pointer; }
input, textarea, select { font: inherit; letter-spacing: inherit; }

h1, h2, h3, h4 {
    margin: 0;
    font-weight: 600;
    letter-spacing: var(--tracking-tight);
    line-height: 1.2;
}

p { margin: 0; }

ul, ol { margin: 0; padding: 0; list-style: none; }
/* Inline SVG sizing */
.ico { display: inline-block; vertical-align: middle; }

/* icons.css — Reicon sprite icons (public theme)
   Markup comes from icon()/reicon() in Helpers.php:
     <svg class="ico ri ri-NAME"><use class="ri-o" …/><use class="ri-f" …/></svg>
   Glyphs are filled shapes painted with currentColor, so colour an icon by
   setting `color` on it or any parent. Icons with a filled variant (heart,
   bookmark, star — marked .ri-has-f) swap to it inside any .is-on control. */

.ri {
    display: inline-block;
    flex: none;
    vertical-align: middle;
    fill: currentColor;
}

.ri .ri-f { display: none; }

/* Only icons that actually ship a filled variant swap (others keep the outline). */
.is-on .ri-has-f .ri-o { display: none; }
.is-on .ri-has-f .ri-f { display: inline; }

/* layout.css — Shell: header, left nav, right rail, footer, mobile drawer, user menu */

/* ============================================================
   Каркас: шапка + основна сітка (ліве меню + центр + права) + футер
   ============================================================ */

.site {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header --------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.86);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    max-width: var(--shell-w);
    min-height: 52px;
    margin: 0 auto;
    padding: 6px 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.brand img {
    height: 30px;
    width: auto;
    flex: none;
}

.brand-logo { width: 30px; height: 30px; object-fit: contain; }

/* Two-line brand: name (black) + optional subtitle (grey, smaller) */
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 650; font-size: 15px; letter-spacing: var(--tracking-tight); color: var(--ink); }
.brand-sub { font-weight: 500; font-size: 11px; color: var(--ink-3); margin-top: 1px; letter-spacing: 0; }

/* Header nav (меню2) */
.header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: start;
}

.header-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 10px;
    border-radius: var(--radius);
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.12s ease, color 0.12s ease;
}
.header-nav a svg { flex: none; width: 16px; height: 16px; color: var(--ink-3); }

.header-nav a:hover { background: var(--surface-hover); color: var(--ink); }
.header-nav a.is-active { color: var(--ink); background: var(--surface-active); }
.header-nav a:hover svg,
.header-nav a.is-active svg { color: var(--ink); }

/* Uploaded (custom) menu icon — match the line-icon footprint */
.menu-ico-img { flex: none; object-fit: contain; vertical-align: middle; }

/* Header user (праворуч) */
.header-user {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex: none;
}

.header-login,
.header-register { height: 32px; }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: var(--ink-2);
    transition: background 0.12s ease, color 0.12s ease;
}

.icon-btn:hover { background: var(--surface-hover); color: var(--ink); }

/* Buttons — Attio-style: solid near-black primary, white bordered
   secondary, 8px radius, compact height, whisper shadow. */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: var(--control-h);
    padding: 0 12px;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    background: var(--accent);
    color: var(--accent-ink);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn:active { transform: translateY(0.5px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }

.btn-outline {
    background: var(--surface);
    border-color: var(--line-2);
    color: var(--ink);
    box-shadow: var(--shadow-xs);
}

/* Keep text readable on hover — without an explicit color it inherited the
   white from .btn:hover over a light background and disappeared. */
.btn-outline:hover { border-color: var(--line-2); background: var(--surface-hover); color: var(--ink); }

/* Ghost — text-only until hovered (quiet secondary action, e.g. "Увійти"). */
.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--ink-2);
    box-shadow: none;
}
.btn-ghost:hover { background: var(--surface-hover); border-color: transparent; color: var(--ink); }

/* Guest login/registration pair inside the mobile drawer (hidden on desktop,
   where the header has room for both). */
.drawer-auth { display: none; }

.avatar {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--chip-bg);
    color: var(--ink-2);
    font-weight: 600;
    font-size: 13px;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.06);
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Main grid ------------------------------------------------ */
/* Rock-solid shell. The outer container is ALWAYS exactly the same width
   (--shell-w / 1280). The left nav sits at the same x-pixel on every
   page. Only the centre column's *right edge* shifts a bit between
   3-col and 2-col layouts — same start, slightly more reading width
   when there's no right rail. No more jarring "site became narrower"
   moment when you click into a post or the cabinet. */
.site-main {
    flex: 1;
    display: grid;
    grid-template-columns: var(--left-w) minmax(0, 1fr) var(--right-w);
    column-gap: var(--gutter);
    max-width: var(--shell-w);
    width: 100%;
    margin: 0 auto;
    padding: 20px 24px 64px;
}

/* 2-column pages (account, static, post w/o right panel): centre fills
   ALL remaining width to the right edge of the shell. Same left rail,
   same start pixel — only the right edge of the centre stretches out. */
.site-main.is-wide,
.site-main.no-right-panel {
    grid-template-columns: var(--left-w) minmax(0, 1fr);
}

.site-main.is-wide > .col-right,
.site-main.no-right-panel > .col-right { display: none; }

.col-left, .col-right {
    align-self: start;
    position: sticky;
    top: 72px;
}

.col-left { margin-left: -8px; }

/* Allow the centre grid column to shrink below its content so horizontal
   carousels (in-feed ads) scroll instead of widening the page. */
.col-center { min-width: 0; }

/* Left nav (меню1, компактне) */
.nav1 {
    display: grid;
    gap: 1px;
}

.nav1 a {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 34px;
    padding: 0 8px;
    border-radius: var(--radius);
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.12s ease, color 0.12s ease;
}

.nav1 a:hover { background: var(--surface-hover); color: var(--ink); }
.nav1 a.is-active { background: var(--surface-active); color: var(--ink); }

.nav1 .ico { flex: none; width: 18px; height: 18px; color: var(--ink-3); }
.nav1 a:hover .ico,
.nav1 a.is-active .ico { color: var(--ink); }

/* The <hr> separators in nav1 (after public links, before admin link)
   add visual noise on a soft bg — drop them. Spacing is enough. */
.nav1 hr { border: 0; border-top: 1px solid var(--line); margin: 8px 8px; }

/* Header-nav items duplicated into the drawer: desktop hides them
   (they live in the top header), mobile shows them at the top. */
.nav1-from-header { display: none; }
@media (max-width: 760px) {
    .nav1-from-header { display: block; }
    .nav1-from-header hr {
        display: block;
        border: 0;
        border-top: 1px solid var(--line);
        margin: 10px 0;
    }
}

/* Right column */
.col-right h3 {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--ink-3);
    margin-bottom: 8px;
}

.widget + .widget { margin-top: 24px; }

/* Footer --------------------------------------------------- */
.site-footer {
    margin-top: 32px;
    background: var(--soft);
    border-top: 1px solid var(--line);
    font-size: 13px;
}

.site-footer-inner {
    max-width: var(--shell-w);
    margin: 0 auto;
    padding: 32px 24px 40px;
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 32px;
}

.footer-brand {
    display: grid;
    gap: 10px;
    color: var(--ink-3);
    font-size: 13px;
}

.footer-brand .brand { color: var(--ink); }

.footer-socials {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.footer-socials a {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink-2);
    border: 1px solid var(--line-2);
    box-shadow: var(--shadow-xs);
}

.footer-socials a:hover { color: var(--ink); background: var(--surface-hover); }

.footer-col h4 {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--ink-4);
    margin-bottom: 10px;
}

.footer-col ul { display: grid; gap: 6px; }

.footer-col a { color: var(--ink-2); font-size: 13px; }
.footer-col a:hover { color: var(--ink); }

.footer-bottom {
    border-top: 1px solid var(--line);
    color: var(--ink-4);
    font-size: 12px;
}

.footer-bottom-inner {
    max-width: var(--shell-w);
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
/* Responsive ----------------------------------------------- */
/* Burger — only visible on mobile. Big tap-target (44px Apple HIG). */
.burger {
    display: none;
    width: 40px;
    height: 40px;
    margin-right: -8px;
    padding: 0;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    place-items: center;
    flex: none;
    transition: background 0.16s ease;
}

.burger:hover,
.burger:active { background: var(--surface-hover); }

/* Close-button inside the mobile drawer. Hidden on desktop. */
.menu-close {
    display: none;
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: var(--radius);
    background: var(--soft);
    color: var(--ink);
    cursor: pointer;
    place-items: center;
    transition: background 0.16s ease, transform 0.16s ease;
    z-index: 2;
}

.menu-close:hover { background: var(--surface-2); }
.menu-close:active { transform: scale(0.95); }

/* Mobile menu backdrop. Apple-style: subtle dim + frosted blur. */
.menu-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(16, 24, 40, 0.28);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.42s cubic-bezier(0.32, 0.72, 0.16, 1);
}

body.is-menu-open .menu-backdrop {
    display: block;
    opacity: 1;
}

@media (max-width: 1100px) {
    /* Hide the right rail but keep the same grid shape so the centre
       doesn't suddenly grow / shift. */
    .site-main,
    .site-main.is-wide,
    .site-main.no-right-panel {
        grid-template-columns: var(--left-w) minmax(0, 1fr);
        column-gap: var(--gutter);
    }
    .col-right { display: none; }
}

@media (max-width: 760px) {
    /* Edge-to-edge content on mobile (cards/sections carry their own padding). */
    .site-main,
    .site-main.is-wide,
    .site-main.no-right-panel {
        grid-template-columns: 1fr;
        padding: 0;
        column-gap: 0;
    }
    .header-nav { display: none; }
    .site-footer-inner { grid-template-columns: 1fr; gap: 24px; }
    .site-header-inner { padding: 4px 12px; gap: 8px; min-height: 50px; }
    .brand img { height: 28px; }
    .brand-logo { width: 28px; height: 28px; }
    .brand { gap: 8px; min-width: 0; }
    .brand-text { min-width: 0; }
    .brand-name, .brand-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .header-user { gap: 4px; }
    .header-register { display: none; }
    .header-login { padding: 0 10px; }

    .drawer-auth {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin: 10px 2px 0;
        padding-top: 12px;
        border-top: 1px solid var(--line);
    }
    .drawer-auth .btn { height: 40px; font-size: 15px; }
    .brand-name { font-size: 15px; }
    .brand-sub { font-size: 10px; }
    .burger { display: inline-grid; }

    /* Generic side breathing room lives on .col-center (one place, no
       double-padding). Full-bleed app-like elements break out of it. */
    .col-center { padding: 12px 16px 32px; }

    /* ------------------------------------------------------------------
       Apple-style CENTERED mobile menu. The .col-left node is reused as
       a centred modal sheet: floats above the page, white, rounded,
       opens with a gentle fade + scale (iOS-style spring curve).
       The big × close-button is visible at the top-right of the panel,
       big enough to hit with a thumb without aiming. */
    .col-left {
        position: fixed;
        top: 50%;
        left: 50%;
        width: min(92%, 360px);
        max-height: min(86vh, 640px);
        padding: 52px 10px 12px;   /* top room for the × button */
        margin-left: 0;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: 16px;
        z-index: 60;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transform: translate(-50%, -50%) scale(0.96);
        opacity: 0;
        visibility: hidden;
        transition:
            opacity 0.32s cubic-bezier(0.32, 0.72, 0.16, 1),
            transform 0.36s cubic-bezier(0.32, 0.72, 0.16, 1),
            visibility 0s linear 0.36s;
        display: block;
        box-shadow: var(--shadow-lg);
    }

    body.is-menu-open .col-left {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
        visibility: visible;
        transition:
            opacity 0.32s cubic-bezier(0.32, 0.72, 0.16, 1),
            transform 0.36s cubic-bezier(0.32, 0.72, 0.16, 1),
            visibility 0s linear 0s;
    }

    body.is-menu-open { overflow: hidden; }

    /* Show the close button only when the drawer is on screen (mobile). */
    .menu-close { display: inline-grid; }

    /* Nav items in the drawer: larger, airier, with a soft hover pill. */
    .col-left .nav1,
    .col-left .nav2,
    .col-left .left-nav { display: flex; flex-direction: column; gap: 2px; }

    .col-left .nav1 a,
    .col-left .nav2 a,
    .col-left .left-nav a {
        display: flex;
        align-items: center;
        gap: 12px;
        height: auto;
        padding: 11px 12px;
        border-radius: 10px;
        color: var(--ink);
        font-size: 16px;
        font-weight: 500;
        line-height: 1.25;
        text-decoration: none;
        transition: background 0.18s ease, color 0.18s ease;
    }

    .col-left .nav1 a:hover,
    .col-left .nav1 a.is-active,
    .col-left .nav2 a:hover,
    .col-left .nav2 a.is-active,
    .col-left .left-nav a:hover,
    .col-left .left-nav a.is-active {
        background: var(--surface-active);
        color: var(--ink);
    }

    .col-left h3,
    .col-left .left-section-title {
        font-size: 12px;
        font-weight: 500;
        color: var(--muted);
        margin: 16px 12px 6px;
    }
}
/* ============================================================
   Header account dropdown (public)
   ============================================================ */
.user-menu { position: relative; }
.user-menu .avatar { border: 0; cursor: pointer; padding: 0; }
.user-menu-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1100;
    min-width: 210px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}
.user-menu-panel a,
.user-menu-panel button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 34px;
    padding: 0 10px;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.user-menu-panel a:hover,
.user-menu-panel button:hover { background: var(--surface-hover); }
.user-menu-panel a svg,
.user-menu-panel button svg { color: var(--ink-3); flex: none; }
.user-menu-logout { margin: 4px 0 0; padding-top: 4px; border-top: 1px solid var(--line); }
.user-menu-logout button:hover { background: var(--danger-soft); color: var(--danger-dark); }
.user-menu-logout button:hover svg { color: var(--danger-dark); }

/* Footer contacts (settings → Загальне → Контакти редакції) */
.footer-contacts {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 12px;
    font-size: 13px;
}
.footer-contacts a,
.footer-contacts span { color: var(--ink-3); text-decoration: none; }
.footer-contacts a:hover { color: var(--ink); }

.auth-social { text-decoration: none; font-weight: 600; font-size: 14px; }
/* Library/uploaded icon in nav (matches the line-icon footprint) */
.ui-ico-img { flex: none; object-fit: contain; vertical-align: middle; }

/* top-story.css — "Топ-новина": full-width photo banner under the header
   (home page). Edge-to-edge image, dark gradient at the bottom, text aligned
   to the site shell so it lines up with the columns below. */

.top-story {
    position: relative;
    background: var(--ink);
    border-bottom: 1px solid var(--line);
}

.top-story-link {
    position: relative;
    display: block;
    height: clamp(380px, 62vh, 620px);
    overflow: hidden;
    color: #fff;
}

.top-story-link:hover { color: #fff; }

.top-story-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 50%;
    transition: transform 0.8s ease;
}

.top-story-link:hover .top-story-img { transform: scale(1.01); }

/* Crop anchor chosen in the editor ("Що не обрізати на телефоні"). */
.top-focus-top .top-story-img { object-position: center 20%; }
.top-focus-bottom .top-story-img { object-position: center 80%; }

.top-story-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top, rgba(8, 12, 16, 0.86) 0%, rgba(8, 12, 16, 0.5) 34%, rgba(8, 12, 16, 0) 62%),
        linear-gradient(to right, rgba(8, 12, 16, 0.35), rgba(8, 12, 16, 0) 55%);
}

.top-story-inner {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: var(--shell-w);
    margin: 0 auto;
    padding: 0 24px 32px;
}

.top-story-kicker {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.86);
    letter-spacing: 0;
}

.top-story-label {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--accent);
    font-weight: 600;
}

.top-story-time { color: rgba(255, 255, 255, 0.7); }

.top-story-title {
    display: block;
    max-width: 860px;
    font-size: clamp(26px, 3.4vw, 44px);
    font-weight: 650;
    line-height: 1.08;
    letter-spacing: -0.03em;
    text-wrap: balance;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.25);
}

.top-story-lead {
    display: -webkit-box;
    max-width: 680px;
    font-size: 16px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.86);
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Mobile: taller (portrait-ish) crop, title-first, no lead. */
@media (max-width: 760px) {
    .top-story-link { height: min(78vh, 520px); }
    .top-story-inner { padding: 0 16px 20px; gap: 8px; }
    .top-story-title { font-size: 26px; }
    .top-story-lead { display: none; }
    .top-story-kicker { font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
    .top-story-img { transition: none; }
}

/* feed.css — Home feed: tabs, cards (standard/hero/compact/vertical), actions */

/* ============================================================
   Стрічка (центр)
   ============================================================ */

.feed-tabs-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

/* Segmented control (Attio-style): quiet grey track, the active tab is a
   raised white "key" with a hairline and a whisper shadow. */
.feed-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 2px;
    flex: 0 1 auto;
    min-width: 0;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--soft);
    overflow-x: auto;          /* horizontal scroll on mobile */
    scrollbar-width: none;     /* Firefox */
    -ms-overflow-style: none;  /* IE/Edge */
}
.feed-tabs::-webkit-scrollbar { display: none; }

.feed-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: none;
    height: 28px;
    white-space: nowrap;
    padding: 0 10px;
    border-radius: 7px;
    color: var(--ink-3);
    font-size: 13.5px;
    font-weight: 500;
    transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}
.feed-tabs a svg { width: 16px; height: 16px; }
.feed-tabs a .ui-ico-img { width: 16px; height: 16px; }

.feed-tabs a:hover { color: var(--ink); }

.feed-tabs a.is-active {
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 0 0 1px var(--line-2), var(--shadow-xs);
}

.feed {
    display: flex;
    flex-direction: column;
}

.feed-empty {
    padding: 40px 0;
    text-align: center;
    color: var(--ink-3);
}

.feed-empty h2 { font-size: 16px; margin-bottom: 6px; color: var(--ink-2); }

/* News card — white tile with a hairline border (Attio), shadow only on
   hover. Dense: 14px padding, 8px between parts. */
.card {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 0 0 8px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.card:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }

.card:last-child { margin-bottom: 0; }

.card-media {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--soft);
}

.card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.card:hover .card-media img { transform: scale(1.015); }

.card-body { display: grid; gap: 8px; }

.card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12.5px;
    color: var(--ink-3);
}

.card-meta .dot { color: var(--ink-4); }

/* Category chip — small rounded tag, not a pill. */
.chip {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 7px;
    border-radius: var(--radius-sm);
    background: var(--chip-bg);
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0;
    transition: background 0.12s ease, color 0.12s ease;
}

.chip:hover { background: var(--surface-2); color: var(--ink); }

.card-title {
    font-size: 18px;
    line-height: 1.3;
    font-weight: 600;
    letter-spacing: var(--tracking-tight);
    color: var(--ink);
}

.card-title a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }

.card-excerpt {
    color: var(--ink-3);
    font-size: 14px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- Feed card formats (placement + card_format) ----------------- */
/* Small badges in the meta row. */
.post-badge {
    display: inline-flex; align-items: center; gap: 4px;
    height: 20px; padding: 0 7px; border-radius: var(--radius-sm);
    font-size: 11.5px; font-weight: 500; line-height: 1; letter-spacing: 0;
}
.post-badge-promo { background: var(--chip-bg); color: var(--ink-4); }                  /* expired */
.post-badge-promo.is-active { background: var(--warning-soft); color: #8a5a00; }        /* active */
.post-badge-media { background: var(--chip-bg); color: var(--ink-3); padding: 0 5px; }

/* Media badge on the cover image. */
.card-media { position: relative; }
.card-media-badge {
    position: absolute; top: 8px; right: 8px;
    display: grid; place-items: center;
    width: 24px; height: 24px; border-radius: var(--radius-sm);
    background: rgba(16, 24, 40, 0.55); color: #fff;
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}

/* Hero / "виділити" — full-bleed cover, title on the photo. */
.card-hero { padding: 0; overflow: hidden; border-color: transparent; }
.card-hero-link { position: relative; display: block; }
.card-hero-img {
    width: 100%; aspect-ratio: 16 / 10; max-height: 420px;
    object-fit: cover; display: block;
    transition: transform 0.4s ease;
}
.card-hero:hover .card-hero-img { transform: scale(1.015); }
.card-hero-top {
    position: absolute; top: 12px; left: 14px; right: 44px;   /* room for the media badge */
    display: flex; align-items: flex-start; gap: 6px;
}
.card-hero-cat {
    display: inline-flex; align-items: center;
    height: 20px; padding: 0 7px; border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.92); color: var(--ink);
    font-size: 12px; font-weight: 500; letter-spacing: 0;
}
.card-hero-overlay {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 56px 16px 16px;
    background: linear-gradient(to top, rgba(10, 12, 16, 0.78) 10%, rgba(10, 12, 16, 0.4) 50%, rgba(10, 12, 16, 0));
}
.card-hero-title {
    color: #fff; font-size: 22px; font-weight: 600;
    line-height: 1.2; letter-spacing: var(--tracking-tight);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.25);
}

/* Compact / "не виділяти" — text row with a small side thumbnail. */
.card-compact {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
}
.card-compact-body { flex: 1 1 auto; min-width: 0; display: grid; gap: 6px; }
.card-title-sm { font-size: 15.5px; line-height: 1.3; }
.card-compact-thumb {
    flex: 0 0 56px; width: 56px; height: 56px;
    border-radius: var(--radius); overflow: hidden; background: var(--soft);
}
.card-compact-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Standard card: featured photo rendered under the excerpt */
.card-photo {
    display: block;
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--soft);
    margin-top: 2px;
}
.card-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.card:hover .card-photo img { transform: scale(1.015); }

/* Vertical card: meta on top (full width), photo|text two columns in the
   middle, actions at the bottom (full width). The outer card keeps the
   single-column stack from .card; only the middle row is 30/70. */
.card-vertical { gap: 8px; }
.card-vert-cols {
    display: grid;
    grid-template-columns: minmax(110px, 30%) 1fr;
    align-items: start; /* media keeps its aspect-ratio, no stretch glitch */
    gap: 14px;
}
.card-vert-media {
    display: block;
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--soft);
}
.card-vert-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.card-vertical:hover .card-vert-media img { transform: scale(1.015); }
.card-vert-text { min-width: 0; display: grid; gap: 6px; align-content: start; }

/* Multi-line excerpt clamp (vertical card) */
.card-excerpt-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 560px) {
    .card-vert-cols { grid-template-columns: minmax(96px, 34%) 1fr; gap: 12px; }
}

/* Hero post inside a category / tag grid — a full-row banner (cover +
   overlay title) above/among the regular tiles. The grid packs densely so
   the row it takes doesn't leave holes. */
.feed-grid { grid-auto-flow: row dense; }
.grid-card-hero {
    grid-column: 1 / -1;
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    gap: 0;
}
.grid-card-hero .card-hero-link { display: block; width: 100%; }
.grid-card-hero .card-hero-img {
    width: 100%;
    aspect-ratio: 21 / 9;
    max-height: 380px;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.grid-card-hero:hover .card-hero-img { transform: scale(1.015); }
.grid-card-hero .card-hero-title { font-size: 24px; max-width: 720px; }
.grid-card-hero .card-hero-overlay { padding: 64px 20px 18px; }

@media (max-width: 560px) {
    .grid-card-hero .card-hero-img { aspect-ratio: 16 / 10; }
    .grid-card-hero .card-hero-title { font-size: 19px; }
    .grid-card-hero .card-hero-overlay { padding: 48px 14px 14px; }
}

@media (max-width: 560px) {
    .card-hero-title { font-size: 19px; }
    .card-hero-img { aspect-ratio: 3 / 2; }
    .card-compact-thumb { flex-basis: 68px; width: 68px; height: 68px; }
    .card-title-sm { font-size: 15px; }
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 2px;
    color: var(--ink-3);
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
}

.card-actions .action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.card-actions .ico { width: 16px; height: 16px; color: var(--ink-4); }

.card-actions .action-spacer { flex: 1; }

.card-actions a.action {
    padding: 3px 5px;
    margin: -3px -5px;
    border-radius: var(--radius-sm);
    color: var(--ink-3);
}

.card-actions a.action:hover { background: var(--surface-hover); color: var(--ink); }
.card-actions a.action:hover .ico { color: var(--ink); }

.action-bookmark.is-on .ico { color: var(--accent); }

.load-more {
    margin-top: 16px;
    display: flex;
    justify-content: center;
}

/* "Show more" — a plain secondary button (was an animated accent pill). */
#load-more-posts {
    background: var(--surface);
    border-color: var(--line-2);
    color: var(--ink);
    box-shadow: var(--shadow-xs);
    padding: 0 16px;
}
#load-more-posts:hover { background: var(--surface-hover); color: var(--ink); }

/* Card bookmark count alignment */
.action.action-bookmark,
.action-form .action-bookmark {
    background: transparent;
    border: 0;
    padding: 3px 5px;
    margin: -3px -5px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--ink-3);
    font-size: 12.5px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.action.action-bookmark:hover,
.action-form .action-bookmark:hover { background: var(--surface-hover); color: var(--ink); }

.action.action-bookmark.is-on,
.action-form .action-bookmark.is-on { color: var(--accent); }
.action.action-bookmark.is-on .ico,
.action-form .action-bookmark.is-on .ico { color: var(--accent); }

.action-form { display: inline-flex; margin: 0; }
/* Feed default-tab gear picker */
.feed-gear { position: relative; flex: none; }
.feed-gear > summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    color: var(--ink-3);
}
.feed-gear > summary::-webkit-details-marker { display: none; }
.feed-gear > summary:hover { background: var(--surface-hover); color: var(--ink); }
.feed-gear[open] > summary { background: var(--surface-active); color: var(--ink); }
.feed-gear-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 30;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 10px;
    min-width: 200px;
    display: grid;
    gap: 2px;
}
.feed-gear-title { font-size: 12px; color: var(--ink-3); margin: 0 0 4px; }
.feed-gear-opt { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 5px 4px; border-radius: var(--radius-sm); cursor: pointer; }
.feed-gear-opt:hover { background: var(--surface-hover); }
.feed-gear-opt input { accent-color: var(--accent); }
.feed-gear-menu .btn { margin-top: 4px; }

/* Mobile: full-bleed feed like a social timeline — cards lose their
   frame and are separated by hairlines only. */
@media (max-width: 760px) {
    .feed,
    .feed-tabs-bar { margin-left: -16px; margin-right: -16px; }
    .feed-tabs-bar { padding: 0 12px; margin-bottom: 10px; }
    .feed { border-top: 1px solid var(--line); }
    .card {
        gap: 6px;
        margin: 0;
        padding: 12px 16px;
        border-width: 0 0 1px;
        border-radius: 0;
    }
    .card:hover { box-shadow: none; border-color: var(--line); }
    /* Hero feed card stays full-bleed (must come AFTER .card to win). */
    .card-hero { padding: 0; border-radius: 0; }
    .card-title { font-size: 17px; }
}

/* "Нововолинськ" — marks news of the local community (posts.scope = local). */
.scope-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 20px;
    padding: 0 7px 0 5px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0;
    white-space: nowrap;
}
.scope-badge .ico { width: 12px; height: 12px; }
.card-hero-top .scope-badge { background: rgba(255, 255, 255, 0.92); }

/* sidebar.css — Right-rail widgets */

/* ============================================================
   Права колонка — віджети
   ============================================================ */

.mini-list { display: grid; gap: 10px; }

.mini-item {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 10px;
    align-items: start;
}

.mini-thumb {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.05);
    overflow: hidden;
    background: var(--soft);
    display: grid;
    place-items: center;
    color: var(--ink-4);
    flex: none;
}

.mini-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mini-text { display: grid; gap: 2px; min-width: 0; }

.mini-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.3;
    letter-spacing: var(--tracking-tight);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mini-item:hover .mini-title { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 2px; }

.mini-meta { font-size: 12px; color: var(--ink-3); }

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* Configurable widgets (/admin/widgets) --------------------- */
.widget-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.col-right .widget-head h3 {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink);
}
.widget-head h3 svg { color: var(--ink-3); flex: none; }
.widget-head-more { font-size: 12px; color: var(--ink-3); text-decoration: none; }
.widget-head-more:hover { color: var(--ink); text-decoration: underline; }

.widget-metric { display: inline-flex; align-items: center; gap: 3px; }
.widget-metric svg { color: var(--ink-4); }

/* "Перший великий": first item = full-width 16:9 photo + bigger title. */
.mini-item.is-big { grid-template-columns: 1fr; gap: 6px; }
.mini-item.is-big .mini-thumb { width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: var(--radius-lg, 12px); }
.mini-item.is-big .mini-title { font-size: 14px; -webkit-line-clamp: 3; }
.is-lead .mini-item.is-big + .mini-item { padding-top: 2px; }

.widget-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; counter-reset: wl; }
.widget-list li { counter-increment: wl; }
.widget-list a { display: grid; gap: 2px; color: inherit; text-decoration: none; }
.widget-list-title {
    font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--ink);
    letter-spacing: var(--tracking-tight);
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.widget-list a:hover .widget-list-title { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 2px; }
.widget-list.is-numbered li { display: grid; grid-template-columns: 22px 1fr; gap: 6px; }
.widget-list.is-numbered li::before {
    content: counter(wl);
    font-size: 17px; font-weight: 700; line-height: 1.05; color: var(--line-2);
    font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}

/* Latest comments: avatar on the side, name · time, text, the post. */
.widget-comment-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.wc-item { display: grid; grid-template-columns: 28px 1fr; gap: 8px; color: inherit; text-decoration: none; }
.wc-av {
    width: 28px; height: 28px; border-radius: 50%; overflow: hidden;
    display: grid; place-items: center;
    background: var(--chip-bg, var(--soft)); color: var(--ink-2);
    box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.06);
    font-size: 12px; font-weight: 600;
}
.wc-av img { width: 100%; height: 100%; object-fit: cover; }
.wc-body { display: grid; gap: 1px; min-width: 0; }
.wc-head { display: flex; align-items: baseline; gap: 5px; min-width: 0; font-size: 12.5px; }
.wc-head b { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-head .comment-ai-badge { flex: none; }
.wc-time { flex: none; font-size: 11.5px; color: var(--ink-3); }
.wc-text {
    font-size: 13px; line-height: 1.4; color: var(--ink-2); overflow-wrap: anywhere;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.wc-post {
    font-size: 11.5px; color: var(--ink-3);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wc-post::before { content: "до "; }
.wc-item:hover .wc-text { color: var(--ink); }
.wc-item:hover .wc-post { text-decoration: underline; }

/* Own block (Telegram channel, "Підтримати редакцію"…): soft panel. */
.widget-note { padding: 12px; border-radius: var(--radius-lg, 12px); background: var(--soft); }
.col-right .widget-note h3 { margin: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--ink); }
.widget-note p { margin: 0 0 10px; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.widget-note .btn { width: 100%; justify-content: center; }

/* post.css — Post page: reading typography, action bar, embeds, gallery, lightbox */

/* ============================================================
   Сторінка матеріалу
   ============================================================ */

.post {
    display: grid;
    gap: 0;
    margin: 0 0 10px;
    padding: 24px 28px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.post-head { display: grid; gap: 8px; }

.post-kicker {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--ink-3);
    flex-wrap: wrap;
}
/* Views/comments pushed to the right edge of the kicker. */
.post-kicker-stats {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.post-title {
    font-size: 30px;
    line-height: 1.15;
    font-weight: 650;
    letter-spacing: -0.028em;
    color: var(--ink);
    margin: 2px 0 12px 0;
    text-wrap: balance;
}

.post-lead {
    font-size: 18px;
    line-height: 1.5;
    font-weight: 500;
    letter-spacing: -0.014em;
    color: var(--ink-2);
    margin: 0;
}

.post-cover {
    margin: 0px -15px 15px -15px;
}

.post-cover-zoom {
    display: block;
    cursor: zoom-in;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--soft);
}
.post-cover img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 480px;
    object-fit: cover;
}

/* Every in-text photo is zoomable. */
.post-figure-link { display: block; cursor: zoom-in; }

/* ---- Longread / hero post ---------------------------------------- */
.post-longread { padding: 0; overflow: hidden; }
.post-longread .post-hero-img { border-radius: 0; }
/* Full-bleed cover with the title on the photo. */
.post-hero { position: relative; margin: 0; }
.post-hero-img {
    width: 100%; display: block;
    aspect-ratio: 16 / 9; max-height: 560px; object-fit: cover;
    cursor: zoom-in;
}
.post-hero-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: flex-end;
    background: linear-gradient(to top, rgba(0,0,0,0.82) 6%, rgba(0,0,0,0.35) 42%, rgba(0,0,0,0) 72%);
    pointer-events: none;   /* let clicks reach the hero image (zoom) */
}
.post-hero-overlay a { pointer-events: auto; }   /* …except the category link */
.post-hero-inner { width: 100%; max-width: 820px; margin: 0 auto; padding: 30px 28px; }
.post-hero-cat {
    display: inline-flex; align-items: center; margin-bottom: 12px;
    height: 22px; padding: 0 8px; border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.92); color: var(--ink);
    font-size: 12px; font-weight: 500; letter-spacing: 0;
}
.post-hero-cat:hover { color: var(--ink); background: #fff; }
.post-hero-title {
    color: #fff; font-size: 32px; font-weight: 650;
    line-height: 1.12; letter-spacing: -0.028em; margin: 0;
    text-shadow: 0 2px 14px rgba(0,0,0,0.3);
    text-wrap: balance;
}
.post-hero-meta {
    display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px;
    color: rgba(255,255,255,0.88); font-size: 13px;
}
/* Centre the longread body in a readable column inside the wide card. */
.post-longread > *:not(.post-hero) {
    width: 100%; max-width: 760px; box-sizing: border-box;
    margin-left: auto; margin-right: auto;
    padding-left: 24px; padding-right: 24px;
}
.post-longread > .post-hero + * { margin-top: 22px; }
.post-longread { padding-bottom: 28px; }
.post-lead-longread { font-size: 19px; font-weight: 500; }
@media (max-width: 760px) {
    .post-title { font-size: 24px; }
    .post-hero-title { font-size: 23px; }
    .post-hero-inner { padding: 20px 18px; }
    .post-hero-img { aspect-ratio: 3 / 2; }
    .post-longread > *:not(.post-hero) { padding-left: 18px; padding-right: 18px; }
    /* Hero post full-bleed on mobile (break out of the .post 15px padding). */
    .post-hero { margin: -16px; }
}

/* Reading typography — single san-serif family across title, lead,
   and body, so the post reads as one piece of type. */
.post-body {
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.7;
    letter-spacing: -0.006em;
    color: var(--ink);
}

/* Vertical rhythm: paragraphs and lists get padding (extra breathing
   room around each block); headings keep margin so they don't double-
   space against the surrounding paragraph paddings. */
.post-body > * + * { margin-top: 0; }       /* padding does the work */
.post-body p { margin: 0; padding: 10px 0; }
.post-body h2 { font-size: 23px; margin: 1.3em 0 0.25em; font-weight: 650; letter-spacing: var(--tracking-tight); }
.post-body h3 { font-size: 19px; margin: 1.1em 0 0.2em; font-weight: 600; letter-spacing: var(--tracking-tight); }
.post-body ul, .post-body ol { padding: 8px 0 8px 1.4em; list-style: revert; }
.post-body li { margin: 0; }
.post-body li + li { margin-top: 4px; }
/* Quote — a quiet panel (no side accent bar), like an Attio callout. */
.post-body blockquote {
    margin: 1.2em 0;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--soft);
    color: var(--ink-2);
}
.post-body blockquote p { padding: 4px 0; }
.post-body a {
    color: var(--link);
    text-decoration: underline;
    text-decoration-color: var(--ink-4);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}
.post-body a:hover { text-decoration-color: var(--ink); }
.post-body figure { margin: 5px 0; }
.post-body figure img { border-radius: var(--radius); }
.post-body figcaption { margin-top: 6px; color: var(--ink-3); font-size: 13px; text-align: center; }
/* Gallery wraps its own figures (tile + caption); zero the body's
   margin so the grid stays edge-to-edge. */
.post-body .post-gallery figure { margin: 0; }
.post-body hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

.post-tags {
    padding: 10px;
}

/* Action bar — без коробки, на лінії */
/* Bottom bar — now contains only actions (heart/bookmark/share);
   stats migrated to the header above. Actions are LEFT-aligned. */
.post-bar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 10px 0 0;
    border-top: 1px solid var(--line);
    flex-wrap: wrap;
}

.post-bar-actions {
    justify-content: flex-start;
}

/* Stats are now small chips in the post header (under the lead). */
.post-bar-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink-3);
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
    margin-top: 8px;
}

.post-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.post-stat .ico { color: var(--ink-4); }

.post-bar-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.post-bar-form { margin: 0; display: inline-flex; }

/* Icon action button. Mostly icon-only (bookmark, telegram, facebook,
   copy); .post-react also carries an inline number next to the heart.
   Accessibility via aria-label + title. */
.post-act {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 32px;
    min-width: 32px;
    justify-content: center;
    padding: 0 8px;
    border: 1px solid var(--line-2);
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    color: var(--ink-2);
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
    font-size: 13px;
    font-weight: 500;
}

.post-act:hover { background: var(--surface-hover); color: var(--ink); }
.post-act[disabled] { opacity: 0.6; cursor: wait; }

/* Generic "on" state — bookmark filled / saved. */
.post-act.is-on { color: var(--ink); background: var(--surface-active); }

/* Heart goes red when liked (the filled glyph swaps in via icons.css). */
.post-react.is-on { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.post-react.is-on .ico { color: var(--danger); }

.post-react-count {
    font-variant-numeric: tabular-nums;
    color: inherit;
    font-weight: 600;
    line-height: 1;
}

/* Prev / Next — sits at the very bottom of the post page now.
   Simpler: just two faint pill tiles with a label and the title.
   No heavy border; lives on the soft body bg. */
.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 12px 0;
}

.post-nav-item {
    display: grid;
    gap: 2px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    color: var(--ink);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.post-nav-item:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); color: var(--ink); }
.post-nav-item-next { text-align: right; }
.post-nav-label { color: var(--ink-3); font-size: 12px; font-weight: 500; }
.post-nav-item strong { font-size: 14px; font-weight: 600; line-height: 1.35; letter-spacing: var(--tracking-tight); }

@media (max-width: 560px) {
    .post-nav { grid-template-columns: 1fr; }
}
/* ============================================================
   Lightbox (zoom for post images / galleries)
   ============================================================ */

.is-zoomable { cursor: zoom-in; }

/* Old .lb-* lightbox removed — superseded by .lightbox in the
   "Lightbox viewer" block below. */
/* ==================================================================
   Post embeds (Editor.js → server-rendered HTML).
   Mirrors the admin app.css rules so iframes are sized correctly on
   the public site too: Telegram, Facebook, Instagram, Twitter/X,
   TikTok, YouTube, generic <video>, and the orientation wrappers
   (.post-embed-auto / .post-embed-horizontal / .post-embed-vertical).
   ================================================================== */

/* Orientation wrappers — set the max-width of the entire embed block. */
.post-embed-auto       { margin: 24px auto; max-width: 540px; }
.post-embed-horizontal { margin: 24px auto; max-width: 680px; }
.post-embed-vertical   { margin: 24px auto; max-width: 360px; }

.post-embed-auto > figure,
.post-embed-horizontal > figure,
.post-embed-vertical > figure {
    margin: 0;
    max-width: none;
}

/* Generic <figure> embeds shared by all platforms. */
.embed-video,
.embed-telegram,
.embed-facebook,
.embed-facebook-video,
.embed-instagram,
.embed-twitter,
.embed-tiktok,
.embed-threads {
    margin: 24px auto;
    max-width: 540px;
}

.embed-telegram iframe,
.embed-facebook iframe,
.embed-facebook-video iframe,
.embed-instagram iframe,
.embed-twitter iframe,
.embed-tiktok iframe,
.embed-threads iframe {
    display: block;
    width: 100%;
    border: 0;
    background: var(--surface, #fff);
    border-radius: var(--radius);
}

/* Video players keep their frame shape: 16:9, Shorts/Reels 9:16. */
.embed-video > iframe,
.embed-video > .embed-yt-facade,
.embed-facebook-video > iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 0;
    border-radius: var(--radius);
}
.post-embed-vertical .embed-video > iframe,
.post-embed-vertical .embed-video > .embed-yt-facade,
.post-embed-vertical .embed-facebook-video > iframe { aspect-ratio: 9 / 16; }

/* YouTube cover until clicked (app.js swaps in the player). */
.embed-yt-facade {
    position: relative;
    overflow: hidden;
    background: #000;
    cursor: pointer;
}
.embed-yt-facade img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .92;
    transition: opacity .15s;
}
.embed-yt-facade:hover img { opacity: 1; }
.embed-play {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 64px;
    height: 44px;
    margin: -22px 0 0 -32px;
    border-radius: 12px;
    background: rgba(18, 18, 18, .82);
    transition: background .15s;
}
.embed-play::after {
    content: "";
    position: absolute;
    left: 26px;
    top: 13px;
    border-style: solid;
    border-width: 9px 0 9px 15px;
    border-color: transparent transparent transparent #fff;
}
.embed-yt-facade:hover .embed-play { background: #f00; }

/* Height until the network reports the real one (Telegram, Instagram,
   Threads, X resize themselves via postMessage — see app.js). */
.embed-telegram { max-width: 520px; }
.embed-telegram iframe { min-height: 320px; }
.embed-facebook iframe { min-height: 520px; }
.embed-instagram iframe { min-height: 540px; }
.embed-threads iframe { min-height: 420px; }
/* X: widgets.js sizes its own iframe; until then (or without JS) a link card. */
.embed-twitter .twitter-tweet:not(.twitter-tweet-rendered) {
    margin: 0;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg, 12px);
    font-size: 14px;
}
.embed-twitter .twitter-tweet-rendered,
.embed-twitter twitter-widget { margin: 0 auto !important; }
.embed-tiktok { max-width: 340px; }
.embed-tiktok iframe { min-height: 740px; }

/* Caption + "open on …" link under every embed (fallback when the
   embedded post is deleted or blocked). */
.embed-video figcaption,
.embed-telegram figcaption,
.embed-facebook figcaption,
.embed-facebook-video figcaption,
.embed-instagram figcaption,
.embed-twitter figcaption,
.embed-tiktok figcaption,
.embed-threads figcaption {
    margin-top: 6px;
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--ink-3);
}
.embed-caption { color: var(--ink-2); }
.embed-caption::after { content: " ·"; color: var(--ink-4); }
.embed-source { color: var(--ink-3); text-decoration: none; white-space: nowrap; }
.embed-source:hover { color: var(--ink); text-decoration: underline; }

/* ---- Uploaded audio / file (Editor.js asset blocks) --------------------- */
.post-audio {
    margin: 24px auto;
    max-width: 640px;
}
.post-audio audio {
    width: 100%;
    display: block;
}
.post-audio figcaption {
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--muted);
    text-align: center;
}

/* Downloadable file card. */
.post-file {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 20px 0;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.post-file:hover {
    border-color: var(--line-2);
    box-shadow: var(--shadow-sm);
}
.post-file-icon {
    flex: 0 0 auto;
    min-width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--ink-2);
    background: var(--chip-bg);
    border-radius: var(--radius);
    padding: 0 8px;
}
.post-file-body { display: flex; flex-direction: column; min-width: 0; }
.post-file-name {
    font-weight: 600;
    color: var(--ink);
    word-break: break-word;
}
.post-file-meta {
    font-size: 0.8rem;
    color: var(--muted);
}

/* ---- AI comments: bot badge + admin generation panels ------------------ */
.comment-ai-badge {
    display: inline-block;
    margin-left: 2px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
    color: #6d4bd1;
    background: #efeaff;
    border-radius: 20px;
    vertical-align: middle;
}
.ai-comment-panel,
.ai-reply-tool {
    margin: 0 0 18px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--soft);
}
.ai-reply-tool { margin: 8px 0 0; }
.ai-comment-panel > summary,
.ai-reply-tool > summary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    color: #5b3fbf;
}
.ai-comment-panel > summary::-webkit-details-marker,
.ai-reply-tool > summary::-webkit-details-marker { display: none; }
.ai-reply-tool > summary { padding: 6px 10px; font-size: 13px; }
.ai-comment-form { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.ai-reply-tool .ai-comment-form { padding: 0 10px 10px; }
.ai-comment-row { display: flex; flex-wrap: wrap; gap: 10px; }
.ai-comment-row label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); flex: 1 1 120px; }
.ai-comment-form select,
.ai-comment-form input[type="text"] {
    width: 100%;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    background: #fff;
}
.ai-comment-hint { margin-bottom: 16px; font-size: 0.9rem; }

/* Inline AI-comment review (after generation) */
.ai-result {
    margin: 0 0 18px;
    padding: 12px 14px;
    border: 1px solid #e4dcfb;
    border-radius: var(--radius-lg);
    background: #faf9ff;
}
.ai-result.is-approved { border-color: #cdeed8; background: var(--success-soft); }
.ai-result-body {
    width: 100%;
    min-height: 80px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    line-height: 1.45;
    resize: vertical;
    background: #fff;
}
.ai-result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ai-result-actions .btn { padding: 6px 12px; font-size: 13px; }
.ai-result-msg { margin-top: 8px; font-size: 13px; color: var(--muted); }

/* ---- "Джерело" attribution paragraph (rendered from posts.sources) ----- */
.post-source {
    margin: 0 0 18px;
    font-size: 0.92rem;
    color: var(--muted);
}
.post-source b { color: var(--ink); }
.post-source a { color: var(--accent); }

/* ---- Table (Editor.js table block) -------------------------------------
   Rounded frame; wide tables scroll sideways with the first column pinned
   (row names stay visible); numbers right-aligned, "—" muted. */
.post-table { margin: 22px 0; }
.post-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg, 12px);
}
.post-table table {
    display: table;        /* base.css makes bare tables blocks; here the frame scrolls */
    overflow: visible;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14.5px;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
}
.post-table th,
.post-table td {
    padding: 8px 12px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--line);
    background: var(--surface, #fff);
}
.post-table tbody tr:last-child td { border-bottom: 0; }
.post-table th {
    background: var(--soft);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-2);
    white-space: nowrap;
    vertical-align: bottom;
}
.post-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--soft) 55%, var(--surface, #fff)); }
.post-table td.num { text-align: right; white-space: nowrap; }
.post-table td.nil { text-align: center; color: var(--ink-4); }
.post-table th.num { text-align: right; }
.post-table td:first-child { font-weight: 500; }
/* First column stays in place while the rest scrolls. */
.post-table th:first-child,
.post-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    box-shadow: 1px 0 0 var(--line);
}

@media (max-width: 560px) {
    .post-table { margin: 18px 0; }
    .post-table table { font-size: 13.5px; }
    .post-table th, .post-table td { padding: 7px 9px; }
    .post-table table.is-wide { font-size: 12.5px; }
    .post-table table.is-wide th, .post-table table.is-wide td { padding: 6px 7px; }
}

/* Multi-image gallery from the Editor.js media block.
   Layout adapts to image count via .count-{1..many}, social-media style.
   Lightbox is wired via JS (data-gallery / data-lightbox-src).

   Approach: each tile carries its OWN aspect-ratio. The grid container
   only sets columns. That guarantees every tile in the same row is the
   same height (no jagged red-line gaps between rows). */
.post-gallery {
    display: grid;
    gap: 6px;
    margin: 24px 0;
}

.post-gallery-item { margin: 0; min-width: 0; }

.post-gallery-link {
    position: relative;
    display: block;
    width: 100%;
    overflow: hidden;
    border-radius: var(--radius);
    cursor: zoom-in;
    background: var(--soft);
    aspect-ratio: 4 / 3;   /* default per-tile; overridden per layout */
}

.post-gallery-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.post-gallery-link:hover img { transform: scale(1.02); }

.post-gallery figcaption {
    margin-top: 6px;
    font-size: 13px;
    color: var(--muted);
    text-align: center;
}

/* "+N" overlay on the 4th visible tile. */
.post-gallery-more {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* 1 photo: full-bleed 16:9. */
.post-gallery.count-1 { grid-template-columns: 1fr; }
.post-gallery.count-1 .post-gallery-link { aspect-ratio: 16 / 9; }

/* 2 photos: half / half (4:3 each). */
.post-gallery.count-2 { grid-template-columns: 1fr 1fr; }
.post-gallery.count-2 .post-gallery-link { aspect-ratio: 4 / 3; }

/* 3 photos: one tall left (3:4), two square right. The grid sets one
   tall left column + two square right cells using grid rows. */
.post-gallery.count-3 {
    grid-template-columns: 2fr 1fr;
    grid-auto-rows: minmax(0, 1fr);
}
.post-gallery.count-3 .post-gallery-item:nth-child(1) {
    grid-row: 1 / span 2;
}
.post-gallery.count-3 .post-gallery-item:nth-child(1) .post-gallery-link { aspect-ratio: auto; height: 100%; }
.post-gallery.count-3 .post-gallery-item:nth-child(n+2) .post-gallery-link { aspect-ratio: 1 / 1; }

/* 4 photos: 2x2 squares. */
.post-gallery.count-4 { grid-template-columns: 1fr 1fr; }
.post-gallery.count-4 .post-gallery-link { aspect-ratio: 1 / 1; }

/* 5+ photos: desktop 3 columns, mobile 2 columns — all photos shown,
   no "+N" collapsing (robust across old/new stored content). Any legacy
   "+N" overlay baked into older posts is hidden. */
.post-gallery.count-many { grid-template-columns: 1fr 1fr 1fr; }
.post-gallery.count-many .post-gallery-link { aspect-ratio: 1 / 1; }
.post-gallery-more { display: none !important; }

/* Captions hidden in packed layouts; they reappear in the lightbox.
   Single-tile gallery keeps its caption visible. */
.post-gallery:not(.count-1) figcaption { display: none; }

@media (max-width: 560px) {
    .post-gallery.count-2,
    .post-gallery.count-3 {
        grid-template-columns: 1fr;
    }
    .post-gallery.count-3 .post-gallery-item:nth-child(1) { grid-row: auto; }
    .post-gallery.count-3 .post-gallery-link { aspect-ratio: 4 / 3; }

    /* Gallery on mobile: 2-column grid, all photos in rows. */
    .post-gallery.count-many { grid-template-columns: 1fr 1fr; }
}

/* ==================================================================
   Lightbox viewer — opens when any [data-lightbox-src] is clicked.
   Pure CSS scaffold; JS toggles .is-open and updates .lightbox-img.
   ================================================================== */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.96);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.lightbox.is-open {
    display: flex;
    opacity: 1;
}
.lightbox.is-open .lightbox-stage { animation: lbIn 0.26s cubic-bezier(0.22, 0.61, 0.36, 1); }
@keyframes lbIn {
    from { transform: scale(0.95) translateY(8px); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

.lightbox-stage {
    position: relative;
    width: min(96vw, 1400px);
    height: min(88vh, 100vh);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

/* iOS-style carousel: viewport clips, track holds 3 slides (prev/cur/next). */
.lightbox-viewport {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    position: relative;
    overflow: hidden;
    will-change: transform;
    touch-action: none;
}
.lightbox-track {
    display: flex;
    height: 100%;
    will-change: transform;
}
.lightbox-slide {
    flex: 0 0 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    box-sizing: border-box;
}
.lightbox-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 12px 60px rgba(0, 0, 0, 0.6);
}

/* Top title pill — shows the material name (iOS Photos "date" style). */
.lightbox-title {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    max-width: min(64vw, 520px);
    padding: 7px 16px;
    border-radius: 999px;
    background: rgba(20, 20, 22, 0.62);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 2;       /* hard limit: max 2 lines (iOS/Android Safari OK) */
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Two-line caption: bold title + muted "Фото: …" credit. */
.lightbox-caption {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
    padding: 0 16px;
    max-width: 760px;
}

.lightbox-caption-title {
    color: rgba(255, 255, 255, 0.92);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
}

.lightbox-caption-source {
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.lightbox-caption-title:empty,
.lightbox-caption-source:empty { display: none; }

/* Thumbnail strip — small previews to jump to any image in the set. */
.lightbox-thumbs {
    flex: 0 0 auto;
    display: flex;
    gap: 6px;
    padding: 4px 12px;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}

.lightbox-thumbs::-webkit-scrollbar { height: 6px; }
.lightbox-thumbs::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 3px; }

.lightbox-thumb {
    flex: 0 0 auto;
    width: 64px;
    height: 48px;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    background: rgba(255,255,255,0.05);
    transition: border-color 0.14s ease, opacity 0.14s ease;
    opacity: 0.55;
}

.lightbox-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lightbox-thumb:hover { opacity: 0.85; }
.lightbox-thumb.is-active {
    border-color: #fff;
    opacity: 1;
}

.lightbox-counter {
    position: absolute;
    top: 16px;
    left: 16px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
}

.lightbox-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px; height: 48px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    transition: background 0.16s ease;
}

.lightbox-btn:hover { background: rgba(255, 255, 255, 0.22); }
.lightbox-btn[data-lightbox-prev] { left: 16px; }
.lightbox-btn[data-lightbox-next] { right: 16px; }
.lightbox-btn[data-lightbox-close] {
    top: 16px; right: 16px;
    transform: none;
    width: 44px; height: 44px;
}

.lightbox-btn svg { width: 22px; height: 22px; }

body.is-lightbox-open { overflow: hidden; }

@media (max-width: 560px) {
    /* Swipe is the primary navigation on touch → hide the side arrows. */
    .lightbox-btn[data-lightbox-prev],
    .lightbox-btn[data-lightbox-next] { display: none; }

    .lightbox-stage {
        width: 100vw;
        height: 100dvh;
        gap: 10px;
        padding: 8px 0;
    }
    .lightbox-img { border-radius: 4px; }

    /* Bigger, clearer close target. */
    .lightbox-btn[data-lightbox-close] {
        top: 10px; right: 10px;
        width: 42px; height: 42px;
        background: rgba(0, 0, 0, 0.4);
    }
    .lightbox-counter { top: 14px; left: 14px; font-size: 14px; }
    .lightbox-title { font-size: 13px; max-width: 64vw; padding: 3px 14px; }
    .lightbox-caption-title { font-size: 14px; }
    .lightbox-thumbs { padding: 2px 10px; }
    .lightbox-thumb { width: 52px; height: 40px; }
}

/* Mobile: collapse all embeds to viewport width and let tall ones (TikTok)
   stay tall but never overflow. */
@media (max-width: 560px) {
    .post-embed-auto,
    .post-embed-horizontal,
    .post-embed-vertical,
    .embed-video,
    .embed-telegram,
    .embed-facebook,
    .embed-instagram,
    .embed-twitter,
    .embed-tiktok,
    .embed-threads,
    .embed-facebook-video {
        max-width: 100%;
    }
}

/* Important banner — реалізацію відкладено: будемо налаштовувати promo
   в адмінці окремо. Не видаляю місце повністю — CSS повернемо, коли
   запускатимемо. */
/* Share-card buttons (4:5 / 9:16) — plain icon buttons like the rest */
.post-act-card { gap: 6px; }

/* Mobile: full-bleed post. */
@media (max-width: 760px) {
    .post {
        margin: -12px -16px 0; padding: 16px;
        border-width: 0 0 1px; border-radius: 0;
    }
}

/* Photo captions & credits ------------------------------------------------ */
/* Cover: "caption · credit" under the photo (from the media library). */
.post-cover-caption {
    margin: 6px 15px 0;
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--ink-3);
}

/* Longread hero: credit in the photo's top-right corner. */
.post-hero-credit {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
    max-width: 60%;
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    background: rgba(10, 12, 16, 0.5);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: rgba(255, 255, 255, 0.9);
    font-size: 11.5px;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

/* Gallery: per-photo captions live in the lightbox; credits stay visible. */
.post-body .post-gallery { margin-bottom: 6px; }
.post-gallery-credit {
    margin: 0 0 18px;
    font-size: 12.5px;
    color: var(--ink-3);
    text-align: right;
}

/* Signed preview (/preview/{id}) — states clearly it isn't the live page. */
.preview-banner {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 10px;
    padding: 8px 12px;
    border: 1px solid #f3e1b1;
    border-radius: var(--radius-lg);
    background: var(--warning-soft);
    color: #6b4a00;
    font-size: 13px;
}
.preview-banner strong { color: var(--ink); font-weight: 600; }

/* comments.css — Comments: list, form, emoji, reactions, report modal */

/* ============================================================
   Коментарі
   ============================================================ */

.post-comments {
    margin: 10px 0;
    background: var(--surface);
    padding: 20px 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.post-comments-head { margin-bottom: 8px; }

.post-comments-head h2 {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: var(--tracking-tight);
}

.post-comments-head h2 span {
    color: var(--ink-4);
    font-weight: 500;
    margin-left: 4px;
}

.comment {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.comment:last-child { border-bottom: 0; }

.comment-av {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--chip-bg);
    box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.06);
    color: var(--ink-2);
    display: grid;
    place-items: center;
    font-weight: 600;
    font-size: 13px;
    overflow: hidden;
}

.comment-av img { width: 100%; height: 100%; object-fit: cover; }

.comment-main { min-width: 0; }

.comment-head {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 2px;
}

.comment-head strong { font-size: 13.5px; font-weight: 600; }
.comment-time { color: var(--ink-3); font-size: 12px; }

.comment-body {
    color: var(--ink);
    font-size: 14px;
    line-height: 1.55;
    word-wrap: break-word;
}

.comment-body a { color: var(--link); text-decoration: underline; text-decoration-color: var(--ink-4); text-underline-offset: 2px; }

/* Attached photo on a comment — sits above body, fixed sane size. */
.comment-photo-wrap {
    display: block;
    margin: 6px 0 8px;
    max-width: 320px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--soft);
    cursor: zoom-in;
    border: 1px solid var(--line);
}

.comment-photo-wrap img,
.comment-body .comment-photo {
    display: block;
    width: 100%;
    max-height: 240px;
    object-fit: cover;
}

.comment-embed {
    display: block;
    position: relative;
    margin: 10px 0;
    padding-top: 56.25%;
    max-width: 420px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.comment-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.comment-tools {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

.comment-link {
    border: 0;
    background: transparent;
    padding: 0;
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-3);
    cursor: pointer;
}

.comment-link:hover { color: var(--ink); }
.comment-link.muted { color: var(--ink-4); cursor: default; }

/* Replies: indented under the parent's avatar column — no side rule. */
.comment-replies {
    margin-top: 6px;
    padding-left: 0;
}

.comment-replies .comment {
    padding: 8px 0;
    border-bottom: 0;
}

.comment-reply-form,
.comment-report-form {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}

.comment-reply-form textarea,
.comment-report-form textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    font: inherit;
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    resize: vertical;
}

.comment-reply-form textarea:focus,
.comment-report-form textarea:focus {
    outline: none;
    border-color: var(--ink-4);
    box-shadow: var(--ring);
}

.comment-form-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    padding: 0 15px;
    margin-top: 0;
}

.form-row { display: grid; gap: 4px; font-size: 13px; }

.form-row select {
    height: var(--control-h);
    padding: 0 10px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    background: var(--surface);
    font: inherit;
}

.is-hidden { display: none !important; }

.muted { color: var(--ink-3); }

.notice {
    margin: 10px 0;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 13.5px;
}

.notice-success { background: var(--success-soft); border-color: #cdeed8; color: #146c36; }
.notice-error { background: var(--danger-soft); border-color: #fbd3d0; color: var(--danger-dark); }

.comments-empty { padding: 5px 0; }

/* Form for the main commentary (logged-in) */
.comment-form { margin-top: 14px; }

.comment-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    font: inherit;
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    resize: vertical;
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--ink-4);
    box-shadow: var(--ring);
}

.comment-form-cta {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* Guest hint to log in — wrapped in its own card with border so it
   reads as a distinct CTA, not a stray line of text. */
.comment-login-card {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--soft);
}

.comment-login-card p {
    margin: 0;
    color: var(--ink-2);
    font-size: 14px;
}
/* ==================================================================
   Report modal — пов'язана з [data-toggle-report] кнопками на
   коментарях. JS показує/ховає через hidden + aria-hidden, click
   на backdrop або кнопках з [data-report-close] закриває.
   ================================================================== */
.report-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.report-modal[hidden] { display: none; }

.report-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16, 24, 40, 0.28);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.report-modal-card {
    position: relative;
    width: min(92%, 440px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 20px 20px 16px;
    box-shadow: var(--shadow-lg);
}

.report-modal-card h3 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: var(--tracking-tight);
}

.report-modal-card .muted {
    font-size: 13px;
    margin: 0 0 16px;
}

.report-modal-card .form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 13px;
}

.report-modal-card .form-row label {
    font-weight: 500;
    color: var(--ink);
}

.report-modal-card select,
.report-modal-card textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    font: inherit;
    font-size: 14px;
    color: var(--ink);
    resize: vertical;
}

.report-modal-card select:focus,
.report-modal-card textarea:focus {
    outline: 0;
    border-color: var(--ink-4);
    box-shadow: var(--ring);
}

.report-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: var(--radius);
    background: var(--soft);
    color: var(--ink-2);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background 0.14s ease;
}

.report-modal-close:hover { background: var(--surface-2); }

.report-modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}

body.is-modal-open { overflow: hidden; }

/* ============================================================
   Emoji picker (textarea attachment)
   ============================================================ */
/* Comment form footer: actions on the left (attach + emoji), hint in the
   middle, submit on the right. Same shape for main form and reply form. */
.comment-form-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    padding: 0 2px;
}

.comment-form-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.comment-form-hint {
    flex: 1;
    font-size: 12px;
    color: var(--ink-3);
}

/* Moderation info — small (i) icon with a hover/tap tooltip. */
.comment-mod-info {
    position: relative;
    margin-right: auto;          /* keep the submit button on the right */
    display: inline-grid;
    place-items: center;
    color: var(--ink-4);
    cursor: help;
}
.comment-mod-info:hover,
.comment-mod-info:focus-visible { color: var(--ink-2); outline: none; }
.comment-mod-info::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    width: max-content;
    max-width: 230px;
    padding: 8px 10px;
    background: var(--ink);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
    z-index: 20;
    pointer-events: none;
}
.comment-mod-info:hover::after,
.comment-mod-info:focus::after,
.comment-mod-info:focus-visible::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.attach-trigger,
.emoji-trigger {
    position: relative;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    cursor: pointer;
    color: var(--ink-3);
    font-size: 18px;
    line-height: 1;
    display: inline-grid;
    place-items: center;
    transition: background 0.12s ease, color 0.12s ease;
}

.attach-trigger:hover,
.emoji-trigger:hover {
    background: var(--surface-hover);
    color: var(--ink);
}

/* Attached-photo preview tile shown above the textarea. */
.attach-preview {
    position: relative;
    display: inline-block;
    width: 72px;
    height: 72px;
    margin: 0 0 8px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--soft);
    border: 1px solid var(--line);
}

.attach-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.attach-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(17, 24, 39, 0.78);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}

.attach-remove:hover { background: var(--danger); }

/* Primary submit — the standard solid button. */
.btn-submit {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
    padding: 0 14px;
}

.btn-submit:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }

.emoji-pop {
    position: absolute;
    z-index: 900;
    width: 320px;
    max-height: 280px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.emoji-tabs {
    display: flex;
    gap: 2px;
    padding: 6px;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
    background: var(--soft);
    flex: none;
}

.emoji-tab {
    border: 0;
    background: transparent;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-3);
    cursor: pointer;
    white-space: nowrap;
}

.emoji-tab:hover { color: var(--ink); }
.emoji-tab.is-active { color: var(--ink); background: var(--surface); box-shadow: 0 0 0 1px var(--line-2), var(--shadow-xs); }

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    padding: 8px;
    overflow-y: auto;
    flex: 1;
}

.emoji-btn {
    border: 0;
    background: transparent;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: background 0.1s ease;
}

.emoji-btn:hover { background: var(--surface-hover); }

@media (max-width: 480px) {
    .emoji-pop { width: calc(100vw - 16px); }
    .emoji-grid { grid-template-columns: repeat(7, 1fr); }
}

/* ============================================================
   Comment reactions (+/−)
   ============================================================ */
.comment-reactions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
}

.cr-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 24px;
    padding: 0 7px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink-3);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}

.cr-btn:hover:not([disabled]) { background: var(--surface-hover); color: var(--ink); }

.cr-btn.is-on.cr-up { background: var(--accent-soft); color: var(--accent); }
.cr-btn.is-on.cr-up .ico { color: var(--accent); }

.cr-btn.is-on.cr-down { background: var(--danger-soft); color: var(--danger); }
.cr-btn.is-on.cr-down .ico { color: var(--danger); }

.cr-btn[disabled] { opacity: 0.5; cursor: default; }

.cr-count {
    font-variant-numeric: tabular-nums;
    min-width: 8px;
    text-align: center;
}
/* Pending comment (visible only to its author + moderators) */
/* Tinted panel (no side accent bar) + badge. */
.comment.is-pending > .comment-main {
    padding: 8px 10px;
    border-radius: var(--radius);
    background: var(--warning-soft);
}
.comment-pending-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #8a5a00;
    background: rgba(217, 144, 0, 0.14);
    height: 20px;
    padding: 0 7px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}
.comment-pending-badge svg { width: 13px; height: 13px; }

/* Mobile: full-bleed like the post above it. */
@media (max-width: 760px) {
    .post-comments {
        margin: 0 -16px;
        padding: 16px;
        border-width: 0 0 1px;
        border-radius: 0;
    }
}

.attach-trigger svg,
.emoji-trigger svg { width: 17px; height: 17px; }

/* Two composers on screen (main + inline reply): the one being typed in is
   active, the other is dimmed until focused (JS swaps .is-active/.is-inactive). */
.comment-composer { transition: opacity 0.15s ease; }
.comment-composer.is-active textarea { border-color: var(--ink-4); }
.comment-composer.is-inactive { opacity: 0.5; }
.comment-composer.is-inactive textarea { background: var(--soft); box-shadow: none; }
.comment-composer.is-inactive .btn-submit {
    background: var(--surface);
    border-color: var(--line-2);
    color: var(--ink-3);
    box-shadow: none;
}
.comment-composer.is-inactive:hover { opacity: 0.75; }

/* listing.css — Listings: related, grid cards, section heads, search, tags, 404 */

/* ============================================================
   "Читайте також"
   ============================================================ */

.post-related { margin-top: 16px; }

.post-related-head h2 {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: var(--tracking-tight);
    color: var(--ink);
    margin-bottom: 10px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

/* Grid card (used in related + listings) */
.grid-card { display: grid; gap: 8px; align-content: start; }

.grid-card-image {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--soft);
    box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.05);
}
.grid-card-image .card-media-badge { width: 22px; height: 22px; }

/* Comment count overlay on a post card image */
.card-comments-badge {
    position: absolute;
    left: 8px;
    bottom: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 22px;
    padding: 0 7px;
    border-radius: var(--radius-sm);
    background: rgba(16, 24, 40, 0.6);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
}
.card-comments-badge svg { width: 13px; height: 13px; }

.grid-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.grid-card:hover .grid-card-image img { transform: scale(1.02); }

.grid-card-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: var(--ink-4);
    background: var(--soft);
}

/* Bookmark card: position card relative so the × sits in the image corner. */
.grid-card { position: relative; }

.grid-card-remove { position: absolute; top: 8px; right: 8px; margin: 0; }

.grid-card-remove-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: var(--radius);
    background: rgba(16, 24, 40, 0.62);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.12s ease, background 0.12s ease;
}

.grid-card:hover .grid-card-remove-btn,
.grid-card-remove-btn:focus-visible { opacity: 1; }

.grid-card-remove-btn:hover { background: var(--danger); }

/* On touch devices there's no hover — always show the remove control. */
@media (hover: none) {
    .grid-card-remove-btn { opacity: 1; }
}

.empty-actions { margin-top: 14px; }

.pagination {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    margin-top: 24px;
    flex-wrap: wrap;
}

.grid-card-title {
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: var(--tracking-tight);
}

.grid-card-title a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 2px; }

.grid-card-meta {
    color: var(--ink-3);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.grid-card-meta .chip { font-size: 11.5px; height: 18px; padding: 0 6px; }

/* ============================================================
   Заголовки секцій (категорія, тег, пошук)
   ============================================================ */

.section-head {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.section-kicker {
    display: inline-block;
    margin-bottom: 4px;
    color: var(--ink-3);
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0;
}

.section-head h1 {
    font-size: 26px;
    line-height: 1.15;
    font-weight: 650;
    letter-spacing: -0.026em;
}

.section-lead {
    margin-top: 6px;
    color: var(--ink-3);
    font-size: 14px;
}

.search-form {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.search-form input {
    flex: 1;
    height: var(--control-h);
    padding: 0 10px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    font: inherit;
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}

.search-form input:focus { outline: none; border-color: var(--ink-4); box-shadow: var(--ring); }

/* Minimal search bar (search page + 404). Light, square-ish, airy. */
.search-bar {
    display: flex;
    gap: 8px;
    align-items: stretch;
    max-width: 560px;
    margin: 16px auto 24px;
}
.search-bar-field {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}
.search-bar-icon {
    position: absolute;
    left: 11px;
    display: grid;
    place-items: center;
    color: var(--ink-3);
    pointer-events: none;
}
.search-bar input {
    width: 100%;
    height: 40px;
    padding: 0 12px 0 36px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    font: inherit;
    font-size: 15px;
    color: var(--ink);
}
.search-bar input:focus {
    outline: none;
    border-color: var(--ink-4);
    box-shadow: var(--ring);
}
.search-bar .btn {
    height: 40px;
    padding: 0 16px;
    white-space: nowrap;
}
@media (max-width: 480px) {
    .search-bar .btn { padding: 0 16px; }
}

/* ---- Tags index (/tags) ------------------------------------------ */
.tags-index {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tag-index-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 5px 0 10px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line-2);
    box-shadow: var(--shadow-xs);
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 500;
    transition: background 0.12s ease;
}
.tag-index-item:hover { background: var(--surface-hover); color: var(--ink); }
.tag-index-count {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: var(--radius-sm);
    background: var(--chip-bg);
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* ---- Error pages (404/403) — centred + search -------------------- */
.error-page {
    max-width: 560px;
    margin: 0 auto;
    padding: 48px 16px 64px;
    text-align: center;
}
.error-page-code {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: var(--radius-sm);
    background: var(--chip-bg);
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
}
.error-page-title {
    font-size: 30px;
    font-weight: 650;
    letter-spacing: -0.028em;
    margin: 10px 0 6px;
}
.error-page-text { color: var(--ink-3); font-size: 15px; }
.error-page-search { margin: 22px auto 18px; }
.error-page-home { color: var(--ink-2); font-weight: 500; font-size: 14px; }
.error-page-home:hover { color: var(--ink); }

/* Сітка карток для категорії/тегу/пошуку */
.feed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px 16px;
}

@media (max-width: 560px) {
    .feed-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px 12px;
    }
    .related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px 12px;
    }
    .grid-card-title { font-size: 14px; }
    .grid-card-meta { font-size: 11px; }
}
/* Search results: matching headings for both sections. */
.search-section { margin-bottom: 8px; }
.search-section + .search-section { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.search-section-title {
    font-size: 15px; font-weight: 600; letter-spacing: var(--tracking-tight);
    margin: 0 0 10px; display: flex; align-items: center; gap: 6px;
}
.search-section-count {
    font-size: 11.5px; font-weight: 500; color: var(--muted);
    background: var(--chip-bg); border-radius: var(--radius-sm); padding: 1px 6px;
}
.search-ads-more { margin-top: 14px; }
/* Slightly smaller ad cards inside search. */
.search-ads .board-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

/* ui.css — Shared UI: toasts, cookie banner */

/* ============================================================
   Toast notifications (window.nv.toast)
   ============================================================ */
.toasts {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    min-width: 180px;
    max-width: 320px;
    padding: 9px 12px;
    border-radius: var(--radius-lg);
    background: var(--ink);
    color: #fff;
    font-size: 13.5px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    cursor: pointer;
}

.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--ink-2); }

@media (max-width: 560px) {
    .toasts { left: 12px; right: 12px; align-items: stretch; }
    .toast { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
    .toast { transition: none; }
}
/* Cookie consent banner (Phase A, step 7) */
.cookie-consent {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    z-index: 1200;
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    padding: 12px 14px 12px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}
.cookie-consent-text { margin: 0; font-size: 13.5px; color: var(--ink-2); flex: 1 1 320px; }
.cookie-consent-text a { color: var(--ink); font-weight: 500; text-decoration: underline; text-decoration-color: var(--ink-4); text-underline-offset: 2px; }
.cookie-consent .btn { flex: none; }

@media (max-width: 560px) {
    .cookie-consent {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 10px;
        padding: 12px 14px;
        border-radius: 12px;
        text-align: left;
    }
    /* In a column flex container a px flex-basis becomes a HEIGHT basis — which
       stretched the banner to ~320px tall. Reset it. */
    .cookie-consent-text { flex: none; font-size: 13px; }
    .cookie-consent .btn { width: 100%; }
}

/* Lazy-image fade-in (added by JS only; no-JS shows images normally) */
img.img-lazy { opacity: 0; transition: opacity 0.4s ease; }
img.img-lazy.is-loaded { opacity: 1; }

/* account.css — Account cabinet, own comments, public profile, avatar cropper */

/* ==================================================================
   Account / cabinet pages — газетний мінімалізм. Used by:
   - /account              (edit.php)
   ================================================================== */

/* Stats row: 3 cards summarising counts + profile visibility. */
.account-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 20px;
}

.account-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--ink);
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.account-stat:hover:not(.is-static) {
    border-color: var(--line-2);
    box-shadow: var(--shadow-sm);
    color: var(--ink);
}

.account-stat-label {
    font-size: 12.5px;
    color: var(--muted);
}

.account-stat-value {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: var(--tracking-tight);
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}

/* Two-column form: identity (avatar + name/email/roles) left, fields right. */
.account-form {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.account-identity {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 20px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    position: sticky;
    top: 80px;
}

.account-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--chip-bg);
    box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.06);
    color: var(--ink);
    display: grid;
    place-items: center;
    font-size: 36px;
    font-weight: 600;
    overflow: hidden;
    margin-bottom: 4px;
}

.account-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.account-identity-name {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: var(--tracking-tight);
}

.account-identity-email {
    font-size: 13px;
    color: var(--muted);
    word-break: break-all;
}

.account-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin: 6px 0 0;
}

/* The "Change avatar" label is itself styled as a btn so the input
   is invisible. Clicking the label opens the file picker; on change
   the JS submits the form. */
.account-avatar-upload {
    margin-top: 8px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.account-avatar-upload input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    font-size: 0;
}

.account-help {
    font-size: 12px;
    color: var(--muted);
    margin: 4px 0 0;
}

/* Right side: stacked sections. */
.account-fields {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.account-section {
    padding: 0;
}

.account-section h2 {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: var(--tracking-tight);
    color: var(--ink);
    margin: 0 0 12px;
}

/* Override the small .form-row used elsewhere — account inputs are larger. */
.account-form .form-row {
    display: grid;
    gap: 5px;
    font-size: 13.5px;
    margin-bottom: 12px;
}

.account-form .form-row > label {
    font-weight: 500;
    color: var(--ink);
}

.account-form input[type="text"],
.account-form input[type="email"],
.account-form input[type="url"],
.account-form input[type="password"],
.account-form textarea {
    width: 100%;
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    font: inherit;
    font-size: 14px;   /* phones get 16px from the iOS-zoom guard in base.css */
    color: var(--ink);
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.account-form input:focus,
.account-form textarea:focus {
    outline: 0;
    border-color: var(--ink-4);
    box-shadow: var(--ring);
}

.account-form textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

/* Checkbox row: input + (label + help) inline. */
.form-row-check {
    grid-template-columns: auto minmax(0, 1fr) !important;
    align-items: start;
    gap: 10px !important;
}

.form-row-check input[type="checkbox"] {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.form-row-check > label {
    cursor: pointer;
    display: block;
}

.form-row-check .account-help {
    display: block;
    margin-top: 2px;
    font-weight: 400;
}

.account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

/* Small button variant. */
.btn-sm {
    height: 28px;
    padding: 0 10px;
    font-size: 12.5px;
}

/* Mobile: stack identity above fields, collapse stats to 1 column. */
@media (max-width: 760px) {
    .account-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .account-stat { padding: 12px; }
    .account-stat-value { font-size: 18px; }

    .account-form {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .account-identity {
        position: static;
        padding: 20px 18px;
    }

    .account-avatar { width: 84px; height: 84px; font-size: 32px; }
}

/* ==================================================================
   /account/comments — compact read-only list of the user's own
   comments. Each row shows status, when, which post, body, score,
   reply count, and a quiet "Видалити" action.
   ================================================================== */

.my-comments {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.my-comment {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* A meta row (top: status + time + post-link; bottom: score + replies + delete). */
.my-comment-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: var(--muted);
}

.my-comment-foot {
    margin-top: 2px;
    color: var(--ink-3);
}

.my-comment-status {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 7px;
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    font-weight: 500;
    background: var(--chip-bg);
    color: var(--ink-2);
}

.my-comment-status.is-approved { background: var(--success-soft); color: #146c36; }
.my-comment-status.is-pending  { background: var(--warning-soft); color: #8a5a00; }
.my-comment-status.is-hidden   { background: var(--surface-2); color: var(--ink-2); }
.my-comment-status.is-spam     { background: var(--danger-soft); color: var(--danger-dark); }

.my-comment-time { color: var(--muted); font-variant-numeric: tabular-nums; }

/* Post link: subtle, with newspaper hairline. */
.my-comment-post {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--line);
    padding-bottom: 1px;
    transition: border-color 0.16s ease;
    margin-left: auto;          /* push to the right end of the top row */
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.my-comment-post:hover { border-color: var(--ink); }
.my-comment-post.is-gone { color: var(--muted); border: 0; font-style: italic; margin-left: auto; }

/* Compact body. */
.my-comment-body {
    margin: 2px 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink);
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Footer meta chips (score, replies). */
.my-comment-meta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--ink-3);
}

.my-comment-meta .ico { color: var(--ink-4); }
.my-comment-meta strong { color: var(--ink); font-weight: 600; }

.my-comment-delete { margin: 0 0 0 auto; }

.btn-link-danger {
    background: none;
    border: 0;
    padding: 0;
    color: var(--muted);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: color 0.16s ease;
}

.btn-link-danger:hover { color: var(--danger-dark); }

@media (max-width: 560px) {
    .my-comment { padding: 12px 14px; }

    /* On phones the post link gets its own line below status+time so
       long titles read in full instead of being ellipsis-truncated. */
    .my-comment-row { gap: 8px; }
    .my-comment-post {
        margin-left: 0;
        max-width: 100%;
        flex-basis: 100%;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        line-height: 1.3;
    }
    .my-comment-delete { margin-left: auto; }

    /* The section-head h1 ("Мої коментарі") is heavy on small screens
       — drop a step so it doesn't push the layout. */
    .section-head h1 { font-size: 22px; }
}

/* ==================================================================
   /users/id{N} — public user profile (newspaper minimal).
   Identity card (avatar + meta), then a list of approved comments
   in the same compact style as /account/comments (read-only).
   ================================================================== */

.profile-card {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 20px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    margin: 0 0 20px;
    align-items: center;
}

.profile-card-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--chip-bg);
    box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.06);
    overflow: hidden;
    display: grid;
    place-items: center;
    font-size: 44px;
    font-weight: 600;
    color: var(--ink);
}

.profile-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-card-body { display: flex; flex-direction: column; gap: 14px; }

/* dl meta laid out as a row of small key/value chips. */
.profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    margin: 0;
}

.profile-meta > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.profile-meta dt {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
}

.profile-meta dd {
    margin: 0;
    font-size: 14px;
    color: var(--ink);
    overflow-wrap: anywhere;
}

.profile-meta dd strong { font-weight: 600; }

.profile-meta dd a {
    color: var(--ink);
    border-bottom: 1px solid var(--line);
    padding-bottom: 1px;
    transition: border-color 0.16s ease;
}

.profile-meta dd a:hover { border-color: var(--ink); }

.profile-card-actions { margin-top: 4px; }

/* Comments section header. */
.profile-comments-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

.profile-comments-head h2 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    letter-spacing: var(--tracking-tight);
}

.profile-comments-head .muted { font-size: 12px; }

@media (max-width: 560px) {
    .profile-card {
        grid-template-columns: 1fr;
        text-align: left;
        padding: 18px;
    }
    .profile-card-avatar {
        width: 88px;
        height: 88px;
        font-size: 32px;
    }
    .profile-meta { gap: 14px; }
}
/* ============================================================
   Account cabinet tabs + verification banner (Phase A)
   ============================================================ */
/* Segmented control — same look as the home feed tabs. */
.account-tabs {
    display: flex;
    width: fit-content;
    max-width: 100%;
    gap: 2px;
    margin: 0 0 16px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--soft);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.account-tabs::-webkit-scrollbar { display: none; }

.account-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: none;
    height: 28px;
    padding: 0 10px;
    border-radius: 7px;
    color: var(--ink-3);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.12s ease, color 0.12s ease;
}
.account-tab:hover { color: var(--ink); }
.account-tab.is-active {
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 0 0 1px var(--line-2), var(--shadow-xs);
}
.account-tab-count {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--ink-3);
    font-size: 11.5px;
    font-weight: 500;
    line-height: 18px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.account-tab.is-active .account-tab-count { background: var(--chip-bg); color: var(--ink-2); }

.account-profile-link { margin: 0 0 14px; font-size: 13.5px; color: var(--ink-3); }

/* Security page bits */
.account-section h3 { margin: 20px 0 6px; font-size: 15px; }
.account-inline-form { margin: 6px 0 0; }
.account-email-status {
    display: inline-flex;
    align-items: center;
    height: 20px;
    margin-left: 4px;
    padding: 0 7px;
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    font-weight: 500;
}
.account-email-status.is-ok { background: var(--success-soft); color: #146c36; }
.account-email-status.is-no { background: var(--warning-soft); color: #8a5a00; }

/* Verification banner (public layout, shown to unverified users) */
.verify-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin-bottom: 12px;
    padding: 10px 12px 10px 14px;
    border: 1px solid #f3e1b1;
    border-radius: var(--radius-lg);
    background: var(--warning-soft);
}
.verify-banner-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.verify-banner-text strong { color: var(--ink); font-size: 14px; font-weight: 600; }
.verify-banner-text span { color: var(--ink-2); font-size: 13px; }
.verify-banner-form { flex: none; margin: 0; }

/* Auth success/notice line (login, forgot) */
.auth-notice {
    margin-bottom: 12px;
    padding: 9px 12px;
    border: 1px solid #cdeed8;
    border-radius: var(--radius);
    background: var(--success-soft);
    color: #146c36;
    font-weight: 500;
    font-size: 13.5px;
}

/* Security page panels (Phase A, step 5) */
.account-panel {
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
}
.account-email-line { margin: 0 0 10px; }
.account-panel .account-form { margin-top: 4px; }
.account-panel .btn { margin-top: 2px; }
.account-support-hint {
    margin: 22px 0 0;
    font-size: 14px;
    color: var(--ink-3);
}
.account-support-hint a { color: var(--ink); font-weight: 500; text-decoration: underline; text-decoration-color: var(--ink-4); text-underline-offset: 2px; }


/* Remember-me checkbox (login) + device list (security) — Phase A, step 6 */
.auth-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0 4px;
    font-size: 14px;
    color: var(--ink-2);
    cursor: pointer;
}
.auth-remember input { width: 16px; height: 16px; accent-color: var(--accent); }

.account-device-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.account-device {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 4px 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
}
.account-device.is-current { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.account-device-name { font-weight: 600; color: var(--ink); }
.account-device-tag {
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    background: var(--success-soft);
    color: #146c36;
    font-size: 11.5px;
    font-weight: 500;
}
.account-device-meta { font-size: 13px; color: var(--ink-3); }

/* Simple vertical form (security page) — nice inputs WITHOUT the profile grid */
.account-form-stack { max-width: 460px; }
.account-form-stack .form-row {
    display: grid;
    gap: 5px;
    margin-bottom: 12px;
    font-size: 13.5px;
}
.account-form-stack .form-row > label { font-weight: 500; color: var(--ink); }
.account-form-stack input[type="text"],
.account-form-stack input[type="email"],
.account-form-stack input[type="password"] {
    width: 100%;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    font: inherit;
    font-size: 14px;
    color: var(--ink);
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.account-form-stack input:focus {
    outline: 0;
    border-color: var(--ink-4);
    box-shadow: var(--ring);
}
.account-form-stack .form-row .account-help { margin: 2px 0 0; }
.account-form-stack .btn { margin-top: 6px; }
/* Account tab as icon-only (Безпека) */
.account-tab-icon { display: inline-flex; align-items: center; gap: 6px; }
.account-tab-icon svg { width: 18px; height: 18px; }

/* Avatar cropper modal */
.avatar-cropper { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; }
.avatar-cropper[hidden] { display: none; }
.avatar-cropper-backdrop { position: absolute; inset: 0; background: rgba(16, 24, 40, 0.5); }
.avatar-cropper-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px;
    width: min(340px, 92vw);
    box-shadow: var(--shadow-lg);
}
.avatar-cropper-card h3 { margin: 0 0 10px; font-size: 16px; }
.avatar-cropper-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 50%;
    background: #222;
    touch-action: none;
    cursor: grab;
    user-select: none;
}
.avatar-cropper-stage:active { cursor: grabbing; }
.avatar-cropper-stage img { position: absolute; top: 0; left: 0; max-width: none; will-change: transform; }
.avatar-cropper-zoom { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; font-size: 14px; color: var(--muted); }
.avatar-cropper-zoom input { flex: 1; }
.avatar-cropper-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
/* Account danger zone (delete account) */
.account-danger { border: 1px solid var(--danger-soft); }
.account-danger h2 { color: var(--danger-dark); }

/* Account danger zone — collapsed into a spoiler */
.account-danger > details > summary {
    cursor: pointer;
    font-weight: 500;
    color: var(--danger-dark);
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.account-danger-summary::-webkit-details-marker { display: none; }
.account-danger-summary::before { content: "⚠"; }
.account-danger > details[open] > .account-danger-summary { margin-bottom: 10px; }

/* pages.css — Static pages */

/* ==================================================================
   Static pages — /{slug}  (about, contacts, AI-generated widgets…)
   --------------------------------------------------------------
   IMPORTANT: $page['content'] is rendered as RAW HTML. Admin can paste
   a self-contained widget with its own <style> and <script> (prefixed
   class names, e.g. .ap-*). The rules below ONLY style the bare
   first-level newspaper tags (p, h2, h3, ul, ol, blockquote, etc.)
   inside .page-body. We do NOT use universal selectors, do NOT impose
   overflow:hidden, display:flex, or transform on .page-body — that
   would break embedded widgets. Treat .page-body as a transparent
   passthrough; styling is opt-in via the standard tag list only.
   ================================================================== */

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
    color: var(--muted);
    padding: 4px 0 0 0;
    margin: 0 0 12px;
}

.breadcrumbs a {
    color: var(--muted);
    transition: color 0.14s ease;
}

.breadcrumbs a:hover { color: var(--ink); }
.breadcrumbs .sep { color: var(--ink-4); }
.breadcrumbs [aria-current="page"] { color: var(--ink); }

.page-article {
    display: block;
    /* No min-height / overflow / flex — keep transparent. */
}

/* Typography for plain HTML inside .page-body. These selectors only
   match direct/descendant tags; they do NOT touch anything inside an
   element that has its own class with another prefix. */
.page-body {
    font-size: 17px;
    line-height: 1.7;
    color: var(--ink);
}

.page-body > * + * { margin-top: 1em; }

.page-body h2 {
    font-size: 22px;
    font-weight: 650;
    letter-spacing: var(--tracking-tight);
    margin-top: 1.6em;
    margin-bottom: 0.4em;
}

.page-body h3 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: var(--tracking-tight);
    margin-top: 1.4em;
    margin-bottom: 0.3em;
}

.page-body p { margin: 0; }

.page-body a {
    color: var(--ink);
    border-bottom: 1px solid var(--line-2);
    padding-bottom: 1px;
    transition: border-color 0.16s ease;
}

.page-body a:hover { border-color: var(--ink); }

.page-body ul,
.page-body ol {
    padding-left: 1.4em;
    margin: 0;
    list-style: revert;            /* revert: undo the global "no bullets" reset */
}

.page-body li + li { margin-top: 0.3em; }

.page-body blockquote {
    margin: 1.2em 0;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--soft);
    color: var(--ink-2);
}

.page-body hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 2em 0;
}

.page-body img,
.page-body video {
    border-radius: var(--radius-lg);
}

.page-body figure { margin: 0; }

.page-body figcaption {
    margin-top: 6px;
    font-size: 13px;
    color: var(--muted);
    text-align: center;
}

.page-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.page-body th, .page-body td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.page-body code {
    padding: 1px 6px;
    background: var(--chip-bg);
    border-radius: var(--radius-sm);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9em;
}

.page-body pre {
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    overflow-x: auto;
}

.page-body pre code {
    padding: 0;
    background: transparent;
}

.page-foot {
    margin-top: 28px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    color: var(--muted);
}

@media (max-width: 560px) {
    .page-body { font-size: 16px; }
    .page-body h2 { font-size: 20px; }
    .page-body h3 { font-size: 17px; }
}

/* auth.css — Login / register / reset + members-only splash */

/* ==================================================================
   /login, /register — centred newspaper-minimal auth pages.
   Uses layouts/auth.php which is its own <body class="auth-page"> —
   no site shell, no header/footer/nav. The card is centered on a
   soft background.
   ================================================================== */

.auth-page { background: var(--soft); }
.auth-page.has-bg { background-color: #0c141c; min-height: 100vh; }
.auth-page.has-bg .auth-brand { color: #fff; }
.auth-page.has-bg .auth-back a { color: rgba(255, 255, 255, 0.82); }
.auth-page.has-bg .auth-back a:hover { color: #fff; }

.auth-shell {
    min-height: 100vh;
    max-width: 420px;
    margin: 0 auto;
    padding: 48px 20px 32px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: center;
    font-weight: 650;
    font-size: 16px;
    letter-spacing: var(--tracking-tight);
    color: var(--ink);
    text-decoration: none;
}

.auth-brand:hover { color: var(--ink); }

.auth-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 24px 24px 20px;
    box-shadow: var(--shadow-md);
}

.auth-head { margin: 0 0 18px; }

.auth-head h1 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: var(--tracking-tight);
    margin: 0 0 4px;
}

.auth-head p {
    margin: 0;
    color: var(--muted);
    font-size: 13.5px;
}

.auth-alert {
    margin: 0 0 14px;
    padding: 9px 12px;
    background: var(--danger-soft);
    border: 1px solid #fbd3d0;
    color: var(--danger-dark);
    border-radius: var(--radius);
    font-size: 13.5px;
    line-height: 1.45;
}

.auth-alert p { margin: 0; }
.auth-alert p + p { margin-top: 4px; }

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-field { display: flex; flex-direction: column; gap: 5px; }

.auth-field > label {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
}

.auth-field-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.auth-field-link {
    font-size: 12px;
    color: var(--muted);
    transition: color 0.14s ease;
}

.auth-field-link:hover { color: var(--ink); }

.auth-field input {
    width: 100%;
    height: 38px;
    padding: 0 11px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    font: inherit;
    font-size: 15px;            /* phones get 16px from the iOS-zoom guard */
    color: var(--ink);
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.auth-field input:focus {
    outline: 0;
    border-color: var(--ink-4);
    box-shadow: var(--ring);
}

.auth-hint {
    margin: 0;
    font-size: 12px;
    color: var(--muted);
}

.auth-submit {
    width: 100%;
    height: 38px;
    margin-top: 4px;
    justify-content: center;
}

/* btn-primary — the solid accent button (same as .btn). Kept as an
   explicit modifier for templates that use it. */
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}

.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }

.auth-foot {
    margin: 18px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    text-align: center;
    font-size: 13.5px;
    color: var(--muted);
}

.auth-foot a {
    color: var(--ink);
    font-weight: 500;
    border-bottom: 1px solid var(--line-2);
    padding-bottom: 1px;
}

.auth-foot a:hover { border-color: var(--ink); color: var(--ink); }

.auth-back {
    text-align: center;
    font-size: 13px;
    margin: 0;
}

.auth-back a { color: var(--muted); transition: color 0.14s ease; }
.auth-back a:hover { color: var(--ink); }

/* Reserved hooks for Google OAuth — commented out in templates until
   OAuth + email verification are wired (see task #14). When we enable
   them, the styles below light up automatically. */
.auth-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 38px;
    margin: 0 0 12px;
    padding: 0 12px;
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.12s ease;
}

.auth-social:hover { background: var(--surface-hover); color: var(--ink); }
.auth-social:disabled { opacity: 0.5; cursor: not-allowed; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0 14px;
    color: var(--ink-4);
    font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

@media (max-width: 480px) {
    .auth-shell { padding: 28px 16px; gap: 14px; }
    .auth-card { padding: 20px 16px; }
    .auth-head h1 { font-size: 19px; }
}
/* ============================================================
   Members-only splash / login page
   ============================================================ */
.splash-page { margin: 0; background: var(--surface); }
.splash {
    display: grid;
    grid-template-columns: minmax(320px, 480px) 1fr;
    min-height: 100vh;
    min-height: 100dvh;
}
.splash-form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 28px;
}
.splash-form-inner { width: 100%; max-width: 360px; }
.splash-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-weight: 650;
    font-size: 16px;
    letter-spacing: var(--tracking-tight);
    color: var(--ink);
    text-decoration: none;
}
.splash-form-inner h1 { margin: 0 0 6px; font-size: 26px; font-weight: 650; letter-spacing: -0.026em; }
.splash-lead { margin: 0 0 18px; color: var(--ink-3); font-size: 14.5px; }
.splash-copyright { margin: 28px 0 0; font-size: 12px; color: var(--ink-4); }

.splash-media { position: relative; overflow: hidden; background: var(--soft); }
.splash-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.splash-media-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 30% 25%, #3a3d44, #1b1c1f 60%, #0e0f11);
}
.splash-media-placeholder span {
    font-size: 22vmin;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1;
}

@media (max-width: 820px) {
    .splash { grid-template-columns: 1fr; }
    .splash-media { order: -1; height: 200px; }
    .splash-form { padding: 28px 20px 40px; }
}

.auth-hint { margin: 10px 0 0; font-size: 13px; color: var(--ink-3); text-align: center; }

/* board.css — Classifieds board (Оголошення) */

/* ==================================================================
   Classifieds board ("Оголошення") — /board.
   Newspaper-minimal, mobile-first. White tiles on soft bg.
   ================================================================== */

.board-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Type filter chips */
.board-types {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 0 0 16px;
}
.board-type {
    display: inline-flex;
    align-items: center;
    height: 30px;
    padding: 0 10px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line-2);
    box-shadow: var(--shadow-xs);
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 500;
    transition: background 0.12s ease, color 0.12s ease;
}
.board-type:hover { background: var(--surface-hover); color: var(--ink); }
.board-type.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* Ad grid */
/* Compact ~200px square cards. */
.board-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin: 0 0 20px;
}
.board-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.board-card:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }

/* Priority: plus = darker frame; important = red frame. */
.board-card.priority-plus { border-color: var(--ink-4); }
.board-card.priority-important { border-color: var(--danger); }

.board-card-image {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;     /* square ~200x200 */
    background: var(--soft);
}
.board-card-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.board-card-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-4); }

/* Badge: top-right. plus = star (accent), important = red circle with "!". */
.board-badge {
    position: absolute;
    top: 8px; right: 8px;
    display: grid;
    place-items: center;
    width: 22px; height: 22px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.board-badge .ico { width: 13px; height: 13px; }
.board-badge-important { background: var(--danger); }
.board-badge-plus { background: var(--accent); }

.board-card-body {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}
.board-card-title {
    font-size: 14px; font-weight: 600; line-height: 1.3; margin: 0;
    overflow-wrap: anywhere;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.board-card-title a { color: var(--ink); }
.board-card-meta { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.board-card-type { background: var(--chip-bg); border-radius: var(--radius-sm); padding: 1px 6px; font-weight: 500; }
.board-price { margin-top: auto; font-size: 15px; font-weight: 600; letter-spacing: var(--tracking-tight); font-variant-numeric: tabular-nums; color: var(--ink); }

/* Similar ads block on the ad page. */
.board-similar { margin: 20px 0; }
.board-similar-title { font-size: 15px; font-weight: 600; margin: 0 0 10px; letter-spacing: var(--tracking-tight); }

@media (max-width: 560px) {
    .board-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .board-price { font-size: 14px; }
}

/* ---- Ad create form ("Facebook-simple") -------------------------- */
.oa-form { display: flex; flex-direction: column; gap: 18px; }

/* Progressive reveal: the rest of the form slides in once a type is chosen. */
.oa-rest {
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(6px);
    transition: max-height 0.45s ease, opacity 0.35s ease, transform 0.35s ease;
}
.oa-rest.is-revealed {
    max-height: 6000px;
    opacity: 1;
    transform: none;
    overflow: visible;
}
.oa-rest > .oa-block,
.oa-rest > .oa-actions { animation: adFadeUp 0.4s ease both; }
@keyframes adFadeUp {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}
.oa-block { display: flex; flex-direction: column; gap: 8px; }
.oa-label { font-size: 13.5px; font-weight: 500; color: var(--ink); }
.oa-hint { font-size: 12px; font-weight: 400; color: var(--muted); }

.oa-form input[type="text"],
.oa-form input[type="tel"],
.oa-form input[type="url"],
.oa-form input[type="number"],
.oa-form textarea,
.oa-form select {
    width: 100%;
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    font: inherit;
    font-size: 14px;      /* phones get 16px from the iOS-zoom guard */
    color: var(--ink);
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.oa-form input:focus, .oa-form textarea:focus, .oa-form select:focus {
    outline: 0; border-color: var(--ink-4); box-shadow: var(--ring);
}
.oa-form textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.oa-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 480px) { .oa-grid-2 { grid-template-columns: 1fr; } }

/* Type chips (radio) */
.oa-types { display: flex; flex-wrap: wrap; gap: 6px; }
.oa-type-chip { position: relative; cursor: pointer; }
.oa-type-chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.oa-type-chip span {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 12px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line-2);
    box-shadow: var(--shadow-xs);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink-2);
    transition: background 0.12s ease, color 0.12s ease;
}
.oa-type-chip:hover span { background: var(--surface-hover); }
.oa-type-chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* Photos dropzone */
.oa-dropzone {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px;
    padding: 24px 16px;
    border: 1px dashed var(--ink-4);
    border-radius: var(--radius-lg);
    background: var(--soft);
    cursor: pointer;
    text-align: center;
    transition: border-color 0.16s ease, background 0.16s ease;
}
.oa-dropzone:hover { border-color: var(--ink-3); background: var(--surface-hover); }
.oa-dropzone-icon { color: var(--ink-4); }
.oa-dropzone-text { font-size: 14px; color: var(--muted); }
.oa-dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

.oa-previews { display: flex; flex-wrap: wrap; gap: 8px; }
.oa-preview-tile { position: relative; width: 96px; height: 96px; border-radius: var(--radius); overflow: hidden; background: var(--soft); }
.oa-preview-tile.is-main { outline: 2px solid var(--accent); }
.oa-preview-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.oa-preview-main {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: var(--accent); color: #fff;
    font-size: 10px; font-weight: 600; text-align: center; padding: 3px;
}
.oa-preview-setmain {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: rgba(0,0,0,0.62); color: #fff; border: 0;
    font-size: 10px; font-weight: 600; text-align: center; padding: 4px;
    cursor: pointer;
    opacity: 0; transition: opacity 0.15s ease;
}
.oa-preview-tile:hover .oa-preview-setmain { opacity: 1; }
@media (hover: none) { .oa-preview-setmain { opacity: 1; } }
.oa-preview-remove {
    position: absolute; top: 4px; right: 4px;
    width: 22px; height: 22px; padding: 0;
    border: 0; border-radius: 50%;
    background: rgba(17,24,39,0.72); color: #fff;
    font-size: 15px; line-height: 1; cursor: pointer;
    display: grid; place-items: center;
}
.oa-preview-remove:hover { background: var(--danger); }

/* Price segmented */
.oa-price-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.oa-seg { position: relative; cursor: pointer; }
.oa-seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.oa-seg span {
    display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-xs);
    font-size: 13.5px; font-weight: 500; color: var(--ink-2);
}
.oa-seg.is-active span, .oa-seg input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.oa-price-input { max-width: 200px; }

/* Promotion (disabled MVP) */
.oa-promote-row { display: flex; flex-wrap: wrap; gap: 8px; }
.oa-promote-chip span {
    display: inline-flex; align-items: center; height: 30px; padding: 0 10px; border-radius: var(--radius);
    background: var(--soft); border: 1px solid var(--line); color: var(--ink-4);
    font-size: 13px; font-weight: 500;
}
.oa-promote-chip.is-disabled { cursor: not-allowed; }
.oa-promote-chip input { display: none; }

.oa-actions { display: flex; gap: 10px; padding-top: 6px; }

/* ---- Board panel + green CTAs (round 7) -------------------------- */
/* Soft card behind the board list / create form. */
.oa-panel {
    background: var(--surface);
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    margin-top: 4px;
}
@media (max-width: 560px) { .oa-panel { padding: 14px; } }

/* Green, gently animated "add ad" CTA. */
.btn-add-oa, .btn-publish-oa {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
    box-shadow: 0 2px 10px rgba(22, 163, 74, 0.28);
}
.btn-add-oa:hover, .btn-publish-oa:hover {
    background: #15803d; border-color: #15803d; color: #fff;
    box-shadow: 0 4px 16px rgba(22, 163, 74, 0.34);
}
.btn-add-oa { animation: oaPulse 2.4s ease-in-out infinite; }
.btn-add-oa:hover { animation: none; }
@keyframes oaPulse {
    0%, 100% { box-shadow: 0 2px 10px rgba(22, 163, 74, 0.28); }
    50%      { box-shadow: 0 2px 18px rgba(22, 163, 74, 0.45); }
}
@media (prefers-reduced-motion: reduce) {
    .btn-add-oa { animation: none; }
    .btn-add-oa:hover, .btn-publish-oa:hover { box-shadow: none; }
}

/* Edit-mode notice on the ad form. */
.oa-edit-note { margin-bottom: 16px; }
.my-oa-note { font-size: 13px; }

/* Share row on the ad page — compact icon-only buttons. */
.oa-share {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
    margin-top: 4px; padding-top: 16px;
    border-top: 1px solid var(--line);
}
.oa-share-btn {
    display: inline-grid; place-items: center;
    width: 32px; height: 32px; padding: 0;
    border-radius: var(--radius);
    border: 1px solid var(--line-2); background: var(--surface);
    box-shadow: var(--shadow-xs);
    color: var(--ink-2); cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.oa-share-btn:hover { background: var(--surface-hover); color: var(--ink); }
.oa-share-fb:hover { background: #1877f2; border-color: #1877f2; color: #fff; }
.oa-share-tg:hover { background: #2aabee; border-color: #2aabee; color: #fff; }
.oa-share-copy:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Thank-you modal after submitting an ad. */
.oa-thanks-card { text-align: center; }
.oa-thanks-icon {
    width: 52px; height: 52px; margin: 4px auto 12px;
    border-radius: 50%; display: grid; place-items: center;
    background: var(--success-soft); color: var(--success);
}
.oa-thanks-card h3 { margin: 0 0 8px; }
.oa-thanks-card p { color: var(--ink-2); margin: 0 0 18px; }
.oa-thanks-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
/* ---- In-feed ads carousel (mobile only, when the right rail is hidden) --- */
/* min-width:0 so this flex item of the column .feed can shrink (else the
   horizontal track forces it to its content width and nothing scrolls). */
.oa-feed-ads { display: none; min-width: 0; max-width: 100%; margin: 14px 0 18px; }
@media (max-width: 1100px) { .oa-feed-ads { display: block; } }
.oa-feed-ads-title {
    font-size: 15px; font-weight: 600; letter-spacing: var(--tracking-tight);
    margin: 0 0 10px;
}
.oa-feed-track {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding-bottom: 4px;
    scrollbar-width: none;
}
.oa-feed-track::-webkit-scrollbar { display: none; }
.oa-feed-card {
    flex: 0 0 148px;
    width: 148px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.oa-feed-card-img {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;          /* a touch taller — fits poster-style ads */
    background: var(--soft);
    display: grid;
    place-items: center;
    overflow: hidden;
}
/* contain (not cover): show the WHOLE main photo, no cropping of posters. */
.oa-feed-card-img img { width: 100%; height: 100%; object-fit: contain; }
.oa-feed-card-ph { color: var(--ink-4); }
.oa-feed-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px 10px;
}
.oa-feed-card-title {
    font-size: 13px; font-weight: 600; line-height: 1.25; color: var(--ink);
    display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}
.oa-feed-card-price { margin-top: auto; font-size: 14px; font-weight: 600; color: var(--ink); }
.oa-feed-card-type { margin-top: auto; font-size: 12px; color: var(--muted); }

/* "Усі оголошення" card — same footprint, centred CTA. */
.oa-feed-card-all {
    align-items: center;
    justify-content: center;
    background: var(--soft);
    box-shadow: none;
    border: 1px dashed var(--line-2);
}
.oa-feed-all-inner {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 0 12px; text-align: center;
    font-size: 13px; font-weight: 500; color: var(--ink);
}
.oa-feed-all-inner .ico { width: 22px; height: 22px; }

/* ---- Ad card (show) ---------------------------------------------- */
/* Ad page wrapped in a white card. */
.oa-view {
    display: flex; flex-direction: column; gap: 16px;
    padding: 18px;
    margin-top: 4px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}
/* Owner-only view of an unpublished/expired/rejected ad — muted card. */
.oa-view--inactive {
    background: var(--soft);
}
.oa-view--inactive .oa-gallery-main img,
.oa-view--inactive .oa-view-title { opacity: 0.78; }
.oa-inactive-banner { background: var(--surface-2); color: var(--ink-2); }
.oa-view-head { display: flex; flex-direction: column; gap: 10px; }

/* Title is the hero; price sits on the same row, smaller, highlighted. */
.oa-view-headline {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px 14px;
}
.oa-view-title { font-size: 26px; font-weight: 650; letter-spacing: -0.026em; line-height: 1.15; margin: 0; flex: 1 1 auto; min-width: 0; }
.oa-view-price {
    flex: none;
    font-size: 17px; font-weight: 600; letter-spacing: var(--tracking-tight);
    font-variant-numeric: tabular-nums;
    color: var(--ink);
    background: var(--chip-bg);
    padding: 3px 10px;
    border-radius: var(--radius);
    white-space: nowrap;
}
.oa-view-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.oa-view-body { font-size: 16px; line-height: 1.65; color: var(--ink); overflow-wrap: anywhere; }

/* Ad gallery — big original main image (not cropped), thumbnails below. */
.oa-gallery { display: flex; flex-direction: column; gap: 8px; }
.oa-gallery-main {
    display: block;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--soft);
    cursor: zoom-in;
}
.oa-gallery-main img {
    display: block;
    width: 100%;
    max-height: 560px;
    min-height: 280px;
    object-fit: contain;
}
.oa-gallery-thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.oa-gallery-thumb {
    width: 80px; height: 80px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--soft);
    cursor: zoom-in;
}
.oa-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Contacts — soft tinted card so it stands out from the body. */
.oa-contacts {
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg); padding: 14px 16px;
    display: flex; flex-direction: column; gap: 8px;
}
.oa-contacts h2 { font-size: 15px; font-weight: 600; margin: 0 0 2px; letter-spacing: var(--tracking-tight); }
.oa-contact-row { display: flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--ink); }
.oa-contact-row .ico { color: var(--ink-4); flex: none; }
.oa-phone-reveal {
    background: none; border: 0; padding: 0; color: var(--ink);
    font: inherit; font-weight: 500; cursor: pointer; text-decoration: underline; text-decoration-color: var(--ink-4); text-underline-offset: 3px;
}
.oa-phone-value { font-weight: 600; color: var(--ink); }
.oa-contacts-note { font-size: 12px; margin: 4px 0 0; }

.oa-owner-actions { display: flex; align-items: center; gap: 8px; }

/* ---- My ads ------------------------------------------------------ */
.my-oa-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.my-oa {
    display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 10px 12px;
}
.my-oa-thumb { width: 64px; height: 64px; border-radius: var(--radius); overflow: hidden; background: var(--soft); display: grid; place-items: center; }
.my-oa-thumb img { width: 100%; height: 100%; object-fit: cover; }
.my-oa-thumb span { color: var(--ink-4); }
.my-oa-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.my-oa-top { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.my-oa-status { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: var(--radius-sm); font-size: 11.5px; font-weight: 500; }
.my-oa-status.is-active { background: var(--success-soft); color: #146c36; }
.my-oa-status.is-pending { background: var(--warning-soft); color: #8a5a00; }
.my-oa-status.is-expired, .my-oa-status.is-inactive { background: var(--surface-2); color: var(--ink-2); }
.my-oa-status.is-rejected { background: var(--danger-soft); color: var(--danger-dark); }
.my-oa-title { font-size: 14.5px; font-weight: 600; letter-spacing: var(--tracking-tight); color: var(--ink); overflow-wrap: anywhere; }
.my-oa-meta { display: flex; gap: 6px; font-size: 13px; color: var(--ink-2); }
.my-oa-actions { display: flex; align-items: center; gap: 10px; }
@media (max-width: 560px) {
    .my-oa { grid-template-columns: 56px 1fr; }
    .my-oa-thumb { width: 56px; height: 56px; }
    .my-oa-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

/* ---- Sidebar widget ---------------------------------------------- */
/* Sidebar widget — compact rows with a small photo (like account/ads). */
.board-widget-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.board-widget-list li {
    background: var(--surface);
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.board-widget-list li:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.board-widget-list li.priority-plus { background: var(--soft); }
.board-widget-list li.priority-important { border-color: #fbd3d0; background: var(--danger-soft); }
.board-widget-item {
    display: flex;
    gap: 10px;
    align-items: center;
    color: var(--ink);
}
.board-widget-type {
    font-size: 11.5px; font-weight: 500;
    color: var(--ink-3);
    background: var(--chip-bg);
    border-radius: var(--radius-sm);
    padding: 1px 6px;
    align-self: flex-start;
}
.board-widget-thumb {
    position: relative;
    flex: none;
    width: 48px; height: 48px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--soft);
    display: grid;
    place-items: center;
    color: var(--ink-4);
}
.board-widget-thumb img { width: 100%; height: 100%; object-fit: cover; }
.board-badge-sm { width: 16px; height: 16px; top: 3px; right: 3px; font-size: 9px; box-shadow: none; }
.board-badge-sm .ico { width: 10px; height: 10px; }
.board-widget-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.board-widget-name {
    font-size: 13px; font-weight: 500; line-height: 1.25;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.board-widget-price { color: var(--ink); font-weight: 600; font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* ---- Ad form validation + hints --------------------------------- */
.oa-req { color: var(--danger); font-weight: 600; }
.oa-block.is-invalid .oa-label { color: var(--danger); }
.oa-block.is-invalid input,
.oa-block.is-invalid textarea,
.oa-block.is-invalid select,
.oa-block.is-invalid .oa-type-chip span,
.oa-block.is-invalid .oa-seg span {
    border-color: var(--danger);
}
.oa-block.is-invalid .oa-dropzone { border-color: var(--danger); }

.oa-dropzone-sub { font-size: 12px; color: var(--ink-2); font-weight: 500; }

.oa-preview-tile.is-toobig { outline: 2px solid var(--danger); }
.oa-preview-warn {
    position: absolute; top: 0; left: 0; right: 0;
    background: rgba(225,29,72,0.85); color: #fff;
    font-size: 10px; font-weight: 600; text-align: center; padding: 2px;
}

/* Mobile: in-feed ads → distinct grey band (inside the full-bleed .feed). */
@media (max-width: 760px) {
    .oa-feed-ads { margin: 0; padding: 12px 16px; background: var(--soft); border-bottom: 1px solid var(--line); }
}

/* Rules above the posting form (admin → Налаштування оголошень). */
.oa-rules { display: flex; gap: 8px; margin: 0 0 10px; padding: 10px 12px; border-radius: var(--radius); background: var(--soft); font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.oa-rules svg { flex: none; margin-top: 2px; color: var(--ink-3); }

/* Filters bar on /board (2026-10) ------------------------------------ */
.board-filters { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; margin: 0 0 12px; }
.board-filter-q { flex: 1 1 200px; min-width: 0; height: 32px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--radius); font: inherit; font-size: 13.5px; background: var(--surface, #fff); }
.board-filter-sort { height: 32px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: var(--radius); font: inherit; font-size: 13px; background: var(--surface, #fff); }
.board-filter-more { order: 5; flex-basis: 100%; }
.board-filter-more > summary { display: inline-flex; align-items: center; gap: 5px; list-style: none; cursor: pointer; font-size: 13px; color: var(--ink-2); padding: 4px 2px; }
.board-filter-more > summary::-webkit-details-marker { display: none; }
.board-filter-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; }
.board-filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-top: 6px; padding: 10px; border-radius: var(--radius); background: var(--soft); }
.board-filter-field { display: grid; gap: 3px; font-size: 12px; color: var(--ink-3); }
.board-filter-field input, .board-filter-field select { height: 30px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 6px; font: inherit; font-size: 13px; color: var(--ink); background: var(--surface, #fff); }
.board-filter-check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); align-self: end; padding-bottom: 6px; }
.board-filter-reset { align-self: center; font-size: 13px; color: var(--ink-3); }

/* Sold */
.board-card.is-sold { opacity: .72; }
.board-card.is-sold .board-card-image img { filter: grayscale(.6); }
.board-sold-badge { position: absolute; left: 8px; top: 8px; padding: 3px 8px; border-radius: 6px; background: #d92d20; color: #fff; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.oa-sold-banner { display: flex; align-items: center; gap: 6px; background: #fef3f2; color: #b42318; }
.oa-view--sold .oa-gallery-main img { filter: grayscale(.5); }

/* Bookmark on the ad page */
.oa-bookmark-form { display: inline; margin: 0; }
.oa-bookmark { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border: 1px solid var(--line-2); border-radius: 999px; background: transparent; font: inherit; font-size: 12.5px; color: var(--ink-2); cursor: pointer; text-decoration: none; }
.oa-bookmark:hover { border-color: var(--ink-3); color: var(--ink); }
.oa-bookmark.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

@media (max-width: 560px) {
    .board-filter-q { flex-basis: 100%; }
}

/* Author stats in «Мої оголошення» */
.my-oa-stats { display: flex; gap: 10px; margin-top: 3px; font-size: 12px; color: var(--ink-3); }
.my-oa-stats span { display: inline-flex; align-items: center; gap: 3px; }
.my-oa-status.is-sold { background: #fef3f2; color: #b42318; }

/* Saved ads on /account/bookmarks */
.saved-oa-list { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.saved-oa { display: flex; align-items: center; gap: 6px; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius-lg, 12px); background: var(--surface, #fff); }
.saved-oa.is-gone { opacity: .6; }
.saved-oa-link { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; color: inherit; text-decoration: none; }
.saved-oa-thumb { flex: none; width: 46px; height: 46px; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: var(--soft); color: var(--ink-4); }
.saved-oa-thumb img { width: 100%; height: 100%; object-fit: cover; }
.saved-oa-text { display: grid; gap: 1px; min-width: 0; }
.saved-oa-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.saved-oa-meta { font-size: 12px; color: var(--ink-3); }
.saved-oa-flag { color: #b42318; font-weight: 600; margin-right: 4px; }
.saved-oa-remove { border: 0; background: transparent; color: var(--ink-4); cursor: pointer; padding: 6px; border-radius: 6px; }
.saved-oa-remove:hover { color: var(--ink); background: var(--soft); }

/* «?» hint next to «Виконано»: hover / focus (tap on phones) shows the tip. */
.oa-hint-dot {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    margin-left: 2px;
    border-radius: 50%;
    background: var(--soft);
    color: var(--ink-3);
    font-size: 11.5px;
    font-weight: 700;
    cursor: help;
    vertical-align: middle;
    outline: none;
}
.oa-hint-dot:hover, .oa-hint-dot:focus { background: var(--accent-soft); color: var(--accent); }
.oa-hint-dot::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    right: -8px;
    z-index: 20;
    width: 260px;
    padding: 8px 10px;
    border-radius: var(--radius);
    background: var(--ink);
    color: #fff;
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.4;
    text-align: left;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity .15s, transform .15s, visibility .15s;
    pointer-events: none;
}
.oa-hint-dot:hover::after, .oa-hint-dot:focus::after { opacity: 1; visibility: visible; transform: none; }
@media (max-width: 560px) {
    .oa-hint-dot::after { width: min(240px, 72vw); }  /* buttons sit at the right edge — tip opens leftwards */
}

