/* ============================================================
   Ordio — the design language. Written down in docs/Дизайн_език.md.

   Tokens are named by ROLE, never by colour: --brand, --attn („чака те"),
   --err, --info. Light is the :root default; [data-theme="dark"] overrides,
   and dark is what the operator actually works in all day.
   ============================================================ */
:root {
    color-scheme: light;

    /* ---- roles ----
       The light theme used to be built out of earth: a forest green, a brown
       amber, a brick red, all of them half a step from grey. On a dark ground
       that restraint reads as calm; on a white one it reads as faded, like a
       screen printed years ago. Same hues, same meanings, but taken up to the
       saturation white can actually carry. */
    /* Тъмни колкото трябва, за да носят бял текст. Мереното е просто: белият
       надпис на всеки главен бутон стоеше при 3.35 срещу искани 4.5, тоест
       човекът, който натисне „Светла тема" ЗАЩОТО не вижда добре, получаваше
       по-нечетимия от двата екрана. Тъмната тема беше наред и не се пипа. */
    --brand: #08765a;           /* white on it: 6.1; 4.85 on the darker ground (PU-40) */
    --brand-strong: #066b52;    /* и по-тъмно за hover: 6.64 */
    --brand-soft: #ecfdf3;
    --on-brand: #ffffff;

    /* ok and err were a step too light for their own soft grounds: a „свързана"
       chip read at 3.98:1 and a red note at 4.46:1. One step darker, both clear 4.5 (PU-12). */
    --ok-fg: #067647;  --ok-bg: #ecfdf3;  --ok-bd: #6ce9a6;
    --attn-fg: #c2410c; --attn-bg: #fff7ed; --attn-bd: #fdba74;   /* 5.89 */
    --err-fg: #b42318; --err-bg: #fef3f2; --err-bd: #fda29b;
    --info-fg: #3538cd; --info-bg: #eef4ff; --info-bd: #b2ccff;
    /* „не е истинско" — the sandbox database. Deliberately outside the four
       states above: it is not good news, not a warning, not an error and not a
       remark, and it must never be mistaken for any of them at a glance. */
    --sandbox-fg: #5b4a9e; --sandbox-bg: #edeaf8; --sandbox-bd: #cfc7ea;

    /* The two ends of the mark's gradient (templates/partials/logo.html, and
       scripts/generate_icon.py draws the .ico from the same pair). Declared here
       rather than written into the SVG because templates carry no literal
       colours — and deliberately NOT overridden for the dark theme: a logo that
       changed colour with the theme would stop being the same logo. */
    /* Text on the fullscreen scrim. Deliberately theme-independent: the
       overlay paints its own near-black ground in both themes. */
    --on-overlay: #ffffff;
    /* A QR code scans dark on light: its ground stays white in both themes (P13-17). */
    --qr-ground: #ffffff;

    /* The menu has its own ground and its own text, and inside it the shared
       tokens are redefined (see .sidebar) so everything it contains reads against
       THAT ground instead of the page's. In the light theme it is a deep pine
       green with white text — a green panel, not the dark theme's near-black one,
       chosen by the owner from six after a pale, a sage and a bright emerald
       version (2026-10-01, PU-18). The active row is LIGHTER than the ground. */
    --sidebar-bg: #053d32;
    --sidebar-wave-1: rgba(8, 118, 88, .30);
    --sidebar-wave-2: rgba(16, 150, 105, .18);
    --sidebar-line: #34d399;
    --sidebar-count: #0d8064;
    --sidebar-fg: #ffffff;      /* 14.5 on the ground */
    --sidebar-muted: #c4e3d2;   /* 7.2 on the active row, its lowest */
    --sidebar-hover: #0b4a3d;
    --sidebar-active: #145b48;   /* the spec's rgba(31,154,112,.22) on the ground, solid */
    --sidebar-border: #0b4a3d;
    /* The active section is marked in white on its lighter row (9.9). */
    --sidebar-brand: #ffffff;
    --sidebar-brand-strong: #ffffff;

    --mark-deep: #1f7a42;
    --mark-bright: #8ed028;

    /* ---- data ----
       Quiet steel, not the brand's green. A first attempt ran this ramp from the
       mark's deep green to its bright one, and the result was a screen that read
       green everywhere however dark the ground under it was: every chart is a
       large filled shape, so whatever colour the data wears becomes the colour of
       the application.

       So green is spent where it means something and nowhere else — the mark, the
       active row, the primary action, and „приключено".

       Everything else a chart says gets a colour of its own, and they are chosen
       to be told APART rather than to sit in a family: blue, teal, violet, sky,
       pink. One ramp of five near-identical steels was quiet and useless — two
       lines on one axis have to be distinguishable at a glance, and five rows of
       a ranking are five different things.

       None of them is near green, amber or red, which keep their meanings:
       finished, waiting for a person, wrong. */
    /* One hue, five steps (owner, 01.08). This reverses the note above, and the
       note was not wrong — it was written when the ramp ran through the whole
       card, chrome included, and the screen came out green before a single number
       was drawn. What makes a monochrome ramp work is that the green is spent
       ONLY inside the charts: the page, the cards, the text and the menu stay
       neutral, and the colour belongs to the data alone.

       Distinguishability comes from lightness, not from hue, so the steps are
       spaced far enough apart to survive next to each other in a ring — which is
       the hardest case, and the one that decides the spacing.

       The four state colours are NOT part of this: attn, err, ok and info mean
       something, and a ramp step that happened to look like „проблем" would be a
       chart telling somebody there is a problem. */
    --data-1: #0b7a55;
    --data-2: #109a67;
    --data-3: #2fba85;
    --data-4: #63d3a8;
    --data-5: #8adcbd;
    /* The previous period, drawn beside the current one: same unit, same scale,
       deliberately colourless so „сега" and „преди" are never confused. */
    /* 3:1 срещу фона — линия в диаграма е графика, не текст, но под това тя е
       рисунка, която не се вижда. Беше 2.24. */
    --data-past: #6f7d88;
    /* The band under the current period: present at the line, gone by the axis. */
    --data-fill-top: rgba(16, 154, 103, .18);
    --data-fill-bottom: rgba(16, 154, 103, 0);
    --data-grid: rgba(22, 24, 29, .08);

    /* ---- surfaces ----
       Neutral, not tinted. The ground was a pale sage once, which put a green
       cast on every screen before a single element was drawn — green is the
       accent here, not the air. But it went too far the other way afterwards and
       landed on a cold office grey. This is barely cool and much lighter: white
       cards on almost-white, the way the reference dashboards do it, with the
       separation carried by a soft border rather than by a darker page.

       That last part was overdone: white cards on a #f4f7f8 page, separated by a
       border a shade off both, and the whole screen ran together — the eye had
       nothing to catch on and every card bled into the one beside it. The ground
       is a real step darker now. White has to be the lightest thing on a light
       screen, or it stops reading as a surface at all. */
    --bg: #f5f8f6;              /* PU-62: the owner's spec — a green-grey ground, cards lifted by their border */
    --surface: #ffffff;
    --surface-2: #f8faf9;
    --surface-3: #f2f4f7;
    --border: #dce5e1;
    /* Ръбът на поле за писане е контрола, не украса: под 3:1 не си личи къде
       свършва полето. Беше 1.80. */
    --border-strong: #8e9ea8;
    --text: #101828;
    --muted: #667085;           /* PU-62: 4.6 on the ground, 4.8 on white */
    --muted-on-tint: var(--muted); /* PX-381: the grey on a tinted ground (a phone's line card) — the light one passes */

    /* ---- rhythm: everything spaces on a quarter-rem step ----
       In rem, not pixels, so the gaps travel with the type. A stylesheet that
       sets its words in rem and its padding in pixels has two scales in it: make
       the words smaller and the room around them stays exactly where it was, and
       the screen comes out the same size with smaller writing on it.
       At the default root these are the same 4/8/12/16/24/32/48 they always were. */
    --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem;
    --s5: 1.5rem; --s6: 2rem;  --s7: 3rem;

    /* ---- shape ---- */
    --radius: .625rem;
    --radius-sm: .4375rem;
    --radius-lg: 1rem;          /* the board's cards: more air asks for more corner */
    --rail: 3px;                /* the signature: state lives on a left edge —
                                   pixels on purpose, like a border: a hairline
                                   that scales is a hairline that goes blurry */

    /* ---- movement ----
       Two curves, and neither of them is `ease`. The browser default starts and
       ends abruptly enough to read as a jump on anything that travels far, which
       is what made the charts feel like they were catching rather than moving.
       --ease is for something changing in place; --ease-out is for something
       arriving — fast at first, then settling, the way a thing with weight does. */
    --ease: cubic-bezier(.4, 0, .2, 1);
    --ease-out: cubic-bezier(.22, .61, .36, 1);
    /* For the long reveals. Soft at both ends — a chart that is already at speed
       on its first frame reads as hurried however long it then takes, and one
       that stops dead at the end undoes whatever calm the middle had. */
    --ease-draw: cubic-bezier(.45, .05, .2, 1);
    /* PU-104: three durations, and every transition takes one of them — a state that answers a
       pointer (--dur-1), a part that changes in place (--dur-2), a thing that arrives or travels
       (--dur-3). An entrance or a drawn chart (`animation`) keeps its own choreography. */
    --dur-1: .12s;
    --dur-2: .18s;
    --dur-3: .3s;
    /* Soft and low. On a near-white page the shadow is what separates a card
       from the ground — the border alone gives the boxed, ruled look of a form. */
    --shadow: 0 4px 14px rgba(16, 24, 40, .035);   /* PU-62: almost unseen */
    --shadow-lift: 0 8px 22px rgba(20, 34, 44, .11);
    /* PU-40 — the owner's variant 4 (02.10.2026): on the light ground a card lifts on a soft
       shadow, every button sits on the card with a barely-there one, and the main action
       wears the menu's own green. The header's glow is as strong as it reads on the dark
       ground. The dark theme sets these back to how it always rendered, below. */
    --tile-shadow: 0 1px 2px rgba(20, 34, 44, .06), 0 6px 16px -8px rgba(20, 34, 44, .16);
    --tile-shadow-sm: var(--shadow);
    --tile-bd: var(--border);
    /* PU-117 (the owner, 2026-10-11: „избирам 5 за зеленото"): the menu's own green — its lightness and hue, the chroma
       raised so it stays green over white — at 75 %; the same flow, the banner and the line under the title follow */
    --hero-tint: oklch(from var(--sidebar-bg) l 0.14 h);
    --hero-glow: 75%;
    --profile-tint: var(--hero-tint);
    --profile-glow: 40%;
    --hero-lead: var(--ow-ink-2);
    --hero-glow-2: 24%;
    --hero-reach: 60%;
    --hero-pad: 2.125rem 2.375rem;
    /* PU-91 — one button style, the decide button's (the owner, 2026-10-08: „всички бутони да бъдат в този стил, не
       цвят, а стил"; her pick „1 Б, 2 Б"). The shape is one for both themes and lives here only; each role keeps its
       colour; the dark theme sets the same colour names below. The rules are the shared block under „Buttons". */
    --btn-radius: .625rem;
    --btn-h: 2.75rem;
    --btn-h-sm: 2.25rem;
    --btn-h-lg: 3.5rem;
    --btn-px: 1.125rem;
    --btn-px-sm: .875rem;
    --btn-fs: .95rem;
    --btn-fs-sm: .875rem;
    --btn-fs-lg: 1.15rem;
    --btn-weight: 600;
    --btn-primary-weight: 700;
    --btn-top: var(--surface);                 /* secondary: a soft neutral gradient with depth („1 Б") */
    --btn-bottom: var(--surface-3);
    --btn-bd: var(--border-strong);
    --btn-fg: var(--text);
    --btn-shadow: 0 4px 12px rgba(16, 24, 40, .10), inset 0 1px 0 rgba(255, 255, 255, .9);
    --btn-primary-top: var(--mk-btn-top);      /* primary: PU-63's green, the same in both themes */
    --btn-primary-bottom: var(--mk-btn-bottom);
    --btn-primary-bd: var(--mk-btn-edge);
    --btn-primary-shadow: var(--mk-btn-shadow);
    --btn-primary-fg: var(--mk-on-btn);
    --btn-danger-fg: var(--err-fg);            /* danger: the red ink and edge on the neutral ground */
    --btn-danger-bd: var(--err-bd);
    --btn-danger-top: #d92d20;                 /* filled danger: a red gradient, white on it 4.8 → 6.6 */
    --btn-danger-bottom: #b42318;
    --btn-danger-edge: #e5483c;
    --ctl-bd: #d0d5dd;                         /* the pager's chips and the like: the old flat control look */
    --ctl-bg: var(--surface);
    --ctl-shadow: 0 1px 2px rgba(20, 34, 44, .08);
    --on-fill: #08765a;   /* the picked tab, range, page: the primary's green (PU-62) */
    --on-fill-fg: #ffffff;
    --chip-shadow: 0 1px 2px rgba(20, 34, 44, .06);
    /* Narrower than it was (14.75rem): the menu is a list of eight short words
       and was reserving room for a paragraph. What it gives up, every page gets. */
    --sidebar-w: 13.25rem;

    /* ---- type: one family, drawn with a real Cyrillic (docs/Дизайн_език.md) ---- */
    --font-ui: "IBM Plex Sans", "Segoe UI", Roboto, system-ui, sans-serif;
    --font-display: var(--font-ui);   /* titles differ by size and weight, not by face */
    /* A code only (a product code, a key, a JSON value) — never words, which stay in --font-ui. Every monospace
       face below reads this one stack. PU-123: Chromium resolves neither ui-monospace nor the generic to a face with
       Cyrillic on macOS (Courier, then Times for „Код“) — a monospace face that has Cyrillic stands before the
       generic on each desktop: Menlo (macOS), Consolas (Windows), DejaVu / Liberation (Linux) */
    --font-mono: ui-monospace, Menlo, "Cascadia Code", Consolas, "DejaVu Sans Mono", "Liberation Mono", monospace;
}

/* PU-80: the light theme is :root's tokens; its block only names the scheme (DESIGN.md lists both themes) */
[data-theme="light"] { color-scheme: light; }

[data-theme="dark"] {
    color-scheme: dark;         /* native scrollbars and inputs follow along */

    /* In the dark theme the menu stays the near-black panel it always was. */
    --sidebar-bg: #051211;
    --sidebar-wave-1: rgba(126, 212, 160, .10);
    --sidebar-wave-2: rgba(126, 212, 160, .06);
    --sidebar-line: #7ed4a0;
    --sidebar-count: #1f6b4f;
    --sidebar-fg: #e7ece9;
    --sidebar-muted: #93a09a;
    --sidebar-hover: #10201c;
    --sidebar-active: #172f27;
    --sidebar-border: #12211e;
    /* The page's green is too dark to read on the panel. */
    --sidebar-brand: #7ed4a0;
    --sidebar-brand-strong: #9ae0b5;
    --brand: #4ea45c;           /* moss, not the stock acid green */
    --brand-strong: #5fb96c;
    --brand-soft: rgba(92, 176, 117, .15);
    --on-brand: #0c1410;

    --ok-fg: #6cc286;   --ok-bg: rgba(92, 176, 117, .15);  --ok-bd: rgba(92, 176, 117, .34);
    --attn-fg: #e0813a; --attn-bg: rgba(207, 154, 88, .15); --attn-bd: rgba(207, 154, 88, .36);
    --err-fg: #e28b80;  --err-bg: rgba(214, 90, 76, .16);   --err-bd: rgba(214, 90, 76, .40);
    --info-fg: #82b2da; --info-bg: rgba(90, 140, 190, .16); --info-bd: rgba(90, 140, 190, .36);
    --sandbox-fg: #ab9ce2; --sandbox-bg: rgba(138, 118, 216, .17); --sandbox-bd: rgba(138, 118, 216, .40);

    /* The mark keeps its own two greens in both themes — a logo that changed
       colour with the theme would stop being the same logo. The DATA ramp does
       shift: on dark glass the deep end disappears, so the whole ramp lifts. */
    /* The same ramp, run the other way. On a dark ground the deep end of a green
       goes to black and the steps stop being steps, so this one starts at a mid
       green and climbs towards white — the strongest step is still --data-1, so
       every chart keeps its order whichever theme it is drawn in. */
    --data-1: #2fbe86;
    --data-2: #4ecf9c;
    --data-3: #74dfb6;
    --data-4: #9aebcf;
    --data-5: #c3f5e4;
    --data-past: #808d98;      /* 3:1 срещу тъмния фон; беше 4.48 като текст, но
                                  като линия в диаграма стоеше твърде близо */
    --data-fill-top: rgba(47, 190, 134, .24);
    --data-fill-bottom: rgba(47, 190, 134, 0);
    --data-grid: rgba(233, 234, 236, .09);

    /* Black, with the surfaces lifted just enough to separate. No hue at all: the
       one colour on a dark screen should be the one that means something. */
    --bg: #111213;
    --surface: #1a1a1c;
    --surface-2: #202123;
    --surface-3: #2a2c2e;
    --border: #2c2e30;
    --border-strong: #41443f;
    --text: #e9eaec;
    --muted: #9aa09a;
    --muted-on-tint: #a3a9a3; /* PX-381: 4.99 on the warning ground #433423 (#9aa09a read 4.49) */

    --shadow: 0 1px 3px rgba(0, 0, 0, .45), 0 1px 2px rgba(0, 0, 0, .32);
    --shadow-lift: 0 10px 28px rgba(0, 0, 0, .5);

    /* PU-40's tiles are the light theme's; here everything renders as it did. */
    --tile-shadow: var(--shadow);
    --tile-shadow-sm: var(--shadow);
    --tile-bd: var(--border);
    --hero-tint: var(--brand);
    --hero-glow: 22%;
    --profile-tint: var(--brand);
    --profile-glow: 32%;
    --hero-lead: var(--muted);
    --hero-glow-2: 9%;
    --hero-reach: 60%;
    --btn-top: color-mix(in srgb, var(--surface-3) 94%, var(--text));   /* PU-91: the light theme's set, mirrored */
    --btn-bottom: var(--surface-2);
    --btn-bd: var(--border-strong);
    --btn-fg: var(--text);
    --btn-shadow: 0 6px 16px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .06);
    --btn-primary-top: var(--mk-btn-top);
    --btn-primary-bottom: var(--mk-btn-bottom);
    --btn-primary-bd: var(--mk-btn-edge);
    --btn-primary-shadow: var(--mk-btn-shadow);
    --btn-primary-fg: var(--mk-on-btn);
    --btn-danger-fg: var(--err-fg);
    --btn-danger-bd: var(--err-bd);
    --btn-danger-top: #d92d20;
    --btn-danger-bottom: #b42318;
    --btn-danger-edge: #e5483c;
    --ctl-bd: var(--border);
    --ctl-bg: transparent;
    --ctl-shadow: none;
    --on-fill: var(--brand);
    --on-fill-fg: var(--on-brand);
    --chip-shadow: none;
}

/* PU-62: the order screen's spec colours (the owner, 2026-10-03), both themes. */
:root {
    --ow-page-bg: #f5f8f6;
    --ow-card-bd: #dce5e1;
    --ow-card-shadow: 0 4px 14px rgba(16, 24, 40, .035);
    --ow-table-bd: #e4e7ec;
    --ow-row-rule: #eaecf0;
    --ow-head-bg: #f3f6f5;
    --ow-text-2: #667085;
    --ow-ink: #101828;
    --ow-green: #08765a;
    --ow-green-hover: #066b52;
    --ow-tab-line: #079455;
    --ow-dot-ok: #12b76a;
    /* PU-175 (the owner's variant 3, 2026-10-21): on white the states faded — the words a step darker; the pills, the
       chip and the compact band take more of their colour below. The rows' and notes' grounds stay pale: grey and
       orange text sits on them (axe, 4.5:1). */
    --ow-warn-ink: #9a3412;
    --ow-chip-warn-ink: #9a3412; /* PU-130: the chip's word on its own warm pill keeps 4.5 */
    --ow-warn-strong: #f79009;
    --ow-warn-ico: #ff8a00;
    --ow-warn-bg: #fff7ed;
    --ow-warn-bg-2: #fff4e7;
    --ow-warn-bd: #fdba74;
    --ow-ok-ink: #05603a;
    --ow-ok-bg: #ecfdf3;
    --ow-ok-bd: #6ce9a6;
    /* PU-175: how much of its colour a state pill, a chip and the compact band take on the light theme */
    --ow-pill-bg: 24%;
    --ow-pill-bd: 60%;
    --ow-chip-bg: 20%;
    --ow-band-tint: 10%;
    --ow-err-ink: #b42318;
    /* PU-177: the red pill's words on its PU-175 ground (24 % of the dot) keep 4.5:1; the compact band's grey on its 10 % */
    --ow-err-pill-ink: #a1201a;
    --ow-band-muted: #5d6679;
    --ow-err-bg: #fef3f2;
    --ow-err-bd: #fda29b;
    --ow-info-ink: #3538cd;
    --ow-info-bg: #eef4ff;
    --ow-info-bd: #b2ccff;
    --ow-busy-bg: #f2f4f7;
    --ow-muted-row: #f7f8fa;
    --ow-reject-bd: #d0d5dd;
    --ow-search-bg: #f2f6f4;
    --ow-search-bd: #e1e8e5;
    --app-search-kbd-bg: #ffffff;
    --ow-ink-2: #344054;
    --ow-src-warn: var(--ow-text-2);
    --ow-link: #175cd3;   /* 5.9 on the table's foot; the mockup's blue a step darker for 4.5 */
    --ow-on-fill: #ffffff;
    --ow-settled-line: #98a2b3;
    --ow-changed-bg: #eff8ff;
    --ow-changed-bd: #84caff;
    --ow-letter-light: #fff1e5;
    --ow-scrim: rgba(15, 23, 42, .42);
    /* PU-63: the owner's mockup of 2026-10-03 — the warning band and the approve button, exactly */
    --mk-warn-bg: #fee5c9;
    --mk-warn-arc: #fed2a1;
    --mk-warn-bd: #efa15a;
    --mk-warn-ico: #ff7a00;
    --mk-warn-ink: #431407;
    --mk-warn-chev: #7c2d12;
    --mk-btn-top: #008c5a;
    --mk-btn-bottom: #016b4c;
    --mk-btn-edge: #13996b;
    --mk-btn-shadow: 0 6px 16px rgba(1, 107, 76, .22), inset 0 1px 0 rgba(255, 255, 255, .14);
    --mk-on-btn: #ffffff;
    /* PU-86 — the pins' and the list numbers' two fills (the owner, 2026-10-08: „само плътно зелено и оранжево. Зеленото е
       когато е окей, а оранжево когато има проблем"), the same in both themes (light mirrors dark), the figure dark on
       either (`--ofx-on-orange`: 8.8 / 9.3 on the green, 6.8 / 7.2 on the orange); the pointed or open product a deep green
       with a white figure (5.7) and a ring — never the „fine" fill */
    --pin-ok: #47cd89;
    --pin-problem: var(--mk-warn-ico);
    --pin-cur: #067647;
    --pin-on-cur: #ffffff;
    --pop-shadow: 0 12px 32px -8px rgba(16, 24, 40, .18), 0 2px 6px rgba(16, 24, 40, .06);
}
[data-theme="dark"] {
    --ow-page-bg: var(--bg);
    --ow-card-bd: var(--border);
    --ow-card-shadow: var(--shadow);
    --ow-table-bd: var(--border);
    --ow-row-rule: var(--border);
    --ow-head-bg: var(--surface-2);
    --ow-text-2: var(--muted);
    --ow-ink: var(--text);
    --ow-green: var(--brand);
    --ow-green-hover: var(--brand-strong);
    --ow-tab-line: var(--brand);
    --ow-dot-ok: var(--ok-fg);
    --ow-warn-ink: #f4a35d;
    --ow-chip-warn-ink: var(--ow-warn-ink);
    --ow-warn-strong: #f79009;
    --ow-warn-ico: #f08a24;
    --ow-warn-bg: rgba(247, 144, 9, .07);
    --ow-warn-bg-2: rgba(247, 144, 9, .05);
    --ow-warn-bd: rgba(247, 144, 9, .42);
    --ow-ok-ink: var(--ok-fg);
    --ow-ok-bg: var(--ok-bg);
    --ow-ok-bd: var(--ok-bd);
    --ow-pill-bg: 11%;
    --ow-pill-bd: 24%;
    --ow-chip-bg: 12%;
    --ow-band-tint: 0%;
    --ow-err-ink: var(--err-fg);
    --ow-err-pill-ink: var(--ow-err-ink);
    --ow-band-muted: var(--muted);
    --ow-err-bg: var(--err-bg);
    --ow-err-bd: var(--err-bd);
    --ow-info-ink: #a4b4ff;
    --ow-info-bg: rgba(99, 112, 230, .14);
    --ow-info-bd: rgba(99, 112, 230, .40);
    --ow-busy-bg: var(--surface-2);
    --ow-muted-row: var(--surface-2);
    --ow-reject-bd: var(--border-strong);
    --ow-search-bg: var(--surface-2);
    --ow-search-bd: var(--border);
    --app-search-kbd-bg: var(--surface);
    --ow-ink-2: var(--muted);
    --ow-src-warn: color-mix(in srgb, var(--text) 40%, var(--muted));
    --ow-link: var(--info-fg);
    --ow-on-fill: #ffffff;
    --ow-settled-line: var(--border-strong);
    --ow-changed-bg: var(--info-bg);
    --ow-changed-bd: var(--info-bd);
    --ow-letter-light: rgba(247, 144, 9, .16);
    --ow-scrim: rgba(0, 0, 0, .55);
    --mk-warn-bg: rgba(255, 122, 0, .13);
    --mk-warn-arc: rgba(255, 122, 0, .10);
    --mk-warn-bd: rgba(239, 161, 90, .55);
    --mk-warn-ico: #ff7a00;
    --mk-warn-ink: #ffd9b8;
    --mk-warn-chev: #ffb27a;
    --mk-btn-top: #008c5a;
    --mk-btn-bottom: #016b4c;
    --mk-btn-edge: #13996b;
    --mk-btn-shadow: 0 6px 16px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .12);
    --mk-on-btn: #ffffff;
    --pop-shadow: 0 14px 34px -8px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }

/* `hidden` has to win. The browser's own rule for it is `[hidden] { display: none }`
   — one attribute, so any class here with a `display` beats it, and `.btn` has one.
   „Върни подредбата" sat in the heading of every board, visible, doing nothing. */
[hidden] { display: none !important; }

/* Reserve the scrollbar's gutter at all times, so locking the page while a
   dialog is open cannot make the content jump sideways. */
/* ---------- The size of everything ----------
   One number. Every size in this stylesheet is in rem — the type always was, the
   spacing and the radii now are too — so this is the dial for how big the whole
   application is, and there is no second place to change.

   A PERCENTAGE and not a pixel value, deliberately: 93.75% is 15px for somebody
   on the default, and 18.75px for somebody who has set their browser to 20px
   because they cannot read 16. `font-size: 15px` would overrule that person and
   there would be nothing they could do about it.

   Hairlines stay in pixels — borders, the rail, focus rings. A 1px line that
   scales to 0.94px is a 1px line the browser has to blur. */
html { font-size: 93.75%; scrollbar-gutter: stable; }
/* PU-138: the body as tall as its page, never one window — a sticky bar sticks only inside its parent, and a body of
   the window's height let the top bars and everything pinned under them slide away after one screen of scrolling */
html { height: 100%; }
body { min-height: 100%; }
/* While a modal is open the page behind it does not scroll. Only the root (PU-109): a hidden overflow on body, beside
   its `height: 100%`, clipped the document to one window and the page jumped to the top behind every modal. */
html.dialog-open { overflow: hidden; }
body {
    margin: 0;
    font-family: var(--font-ui);
    color: var(--text);
    background: var(--bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Titles are the same face as everything else — what marks them is weight and
   a tightened track, not a change of voice. */
.page-title,
.section-h,
.confirm-title {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -.015em;
}
.page-title { font-weight: 700; }

/* ---------- Layout ---------- */
body.has-sidebar { display: block; min-height: 100vh; padding-left: var(--sidebar-w); }
/* A column, not a row: the login screen has a sibling ABOVE the card whenever
   the sandbox banner is up, and in a row the two shared the width — the banner
   took most of it and the card was squeezed into a strip on the right. */
body.plain { display: flex; flex-direction: column; align-items: center; }
body.plain .devdb-bar { align-self: stretch; }

/* The cap used to be 73.75rem, which on an ordinary laptop left a hand's width
   of nothing down each side of every page — the sidebar took its 15rem, the
   container refused the rest, and the work sat in a column in the middle with
   the screen empty around it.

   A cap is still right: a table stretched across an ultra-wide monitor is a row
   whose first and last cell belong to different thoughts, and the eye loses the
   line between them. But it should bind on a 27-inch screen, not on a 15-inch
   one. At 96rem it stops mattering below roughly 100rem, and the padding — real
   air, not leftover — is what gives the page its margins there. */
.content {
    --content-gutter: var(--s6);  /* PU-138: the stuck search covers it */
    flex: 1; min-width: 0; width: 100%; margin: 0 auto;
    padding: var(--s6) var(--content-gutter) var(--s7);
    max-width: 96rem;
}
/* The region a tab bar or menu swaps (PU-31, App. H §H.2): a wrapper for htmx,
   not a box — its children lay out as the content's own. */
.page-region { display: contents; }
/* PU-93: what a list screen's filters swap — a box of its own would change no layout either */
.list-region { display: contents; }
/* Truly in the middle, not a guessed distance from the top: `padding-top: 9vh`
   put the card high in a maximised window and off the bottom of a short one.
   Centring inside the space LEFT OVER also keeps the sandbox bar where it
   belongs — the flex parent is the body, and the bar is its first child. */
body.plain .content {
    max-width: 26.5rem;
    display: flex; flex-direction: column; justify-content: center;
    /* Room for the card to breathe, and a floor under it on a short window. */
    padding: var(--s5) var(--s4);
}

/* ---------- Sidebar ---------- */
/* PU-61 (the owner, 2026-10-03: „искам да си имам акцентите в лявото меню, които бяха"): two soft curved bands of
   the menu's own green in its lower half — behind the items (the menu is its own stacking context), never over them,
   tokens only; folded, the stripe keeps its plain ground. */
/* PU-62 (the owner's spec, §2): two soft ellipses of a lighter green, turned against each other — the spec's sizes
   and colours, as tokens. */
.sidebar::before, .sidebar::after {
    content: ""; position: absolute; z-index: -1; pointer-events: none; border-radius: 50%;
}
.sidebar::before {
    width: 22.5rem; height: 16.25rem; left: -7.5rem; bottom: 4.375rem; transform: rotate(-18deg);
    background: var(--sidebar-wave-1);
}
.sidebar::after {
    width: 20.625rem; height: 13.75rem; left: -5rem; bottom: .3125rem; transform: rotate(14deg);
    background: var(--sidebar-wave-2);
}
html.nav-folded .sidebar::before, html.nav-folded .sidebar::after { display: none; }
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    /* Redefining the shared tokens here — not repainting each child — is what
       lets every control inside the menu keep using --text/--surface and still
       read correctly against the panel's own ground in either theme. */
    --surface: var(--sidebar-bg);
    --surface-2: var(--sidebar-hover);
    --surface-3: var(--sidebar-active);
    --border: var(--sidebar-border);
    --text: var(--sidebar-fg);
    --muted: var(--sidebar-muted);
    --brand: var(--sidebar-brand);
    --brand-strong: var(--sidebar-brand-strong);
    --brand-soft: var(--sidebar-active);
    /* PU-40's button and card tokens resolve on the root, past these; the menu takes them back
       to its own ground — PU-91: the secondary button's depth on the menu's dark ground, as the
       dark theme draws it; the primary is PU-63's green everywhere. */
    --btn-top: color-mix(in srgb, var(--surface-3) 94%, var(--text));
    --btn-bottom: var(--surface-2);
    --btn-bd: var(--border);
    --btn-fg: var(--text);
    --btn-shadow: 0 6px 16px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .06);
    --ctl-bd: var(--border);
    --ctl-bg: transparent;
    --ctl-shadow: none;
    --chip-shadow: none;
    --tile-shadow: var(--shadow);
    --tile-shadow-sm: var(--shadow);
    --tile-bd: var(--border);
    background: var(--sidebar-bg);
    color: var(--sidebar-fg);
    /* PU-180: the top bar carries the menu's ground across — no line between them */
    border-right: 1px solid var(--sidebar-bg);
    isolation: isolate; /* PU-61: the wave paints behind the items, above the ground */
    display: flex;
    flex-direction: column;
    padding: 1.125rem 0.875rem;
    /* Always pinned: the menu never scrolls away with the page. */
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 20;
    /* PU-104: no width animation — the content beside it snapped while the menu slid (CLS 0.105); both fold at once */
}

[data-theme="dark"] .sidebar {
    --on-fill: var(--brand);
    --on-fill-fg: var(--on-brand);
}

/* ---------- Folded away ----------
   Icons only, the width of a stripe. The whole mechanism is one custom property:
   --sidebar-w is what the menu is and what the page is padded by, so changing it
   moves both — and because it is set on the ROOT rather than on the aside, the
   page's own padding follows without a second rule that could disagree.

   Which state it is in is applied before paint (see base.html), so a folded menu
   does not unfold itself for a moment on every navigation. */
html.nav-folded { --sidebar-w: 3.75rem; }
.nav-folded .sidebar { padding-left: 0.5rem; padding-right: 0.5rem; }
/* Words go; icons stay. */
.nav-folded .brand-name,
.nav-folded .navitem > span,
.nav-folded .nav-group,
.nav-folded .nav-word,
.nav-folded .userchip-meta,
.nav-folded .update-notice { display: none; }
.nav-folded .navitem,
.nav-folded .userchip {
    justify-content: center; padding-left: 0; padding-right: 0; gap: 0;
}
.nav-folded .brand { justify-content: center; padding-left: 0; padding-right: 0; }

/* Folded, the profile chip is its avatar alone (the account card, PU-05). */
.userchip-meta { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
/* The handle. Sits at the top of the menu and turns with it, so the arrow always
   points at what pressing it will do. */
.nav-fold {
    display: flex; align-items: center; justify-content: center;
    width: 1.75rem; height: 1.75rem; margin-left: auto;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    background: transparent; color: var(--muted); cursor: pointer;
    transition: color var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}
.nav-fold:hover { color: var(--text); background: var(--surface-2); }
/* Pointing at what it does: left is „collapse to the left". It used to point
   right and rotate, which meant the arrow was wrong half the time. */
.nav-fold svg { transform: rotate(180deg); }
/* Folded, the handle is gone entirely — the mark takes its job (see base.html),
   because a 3.75rem stripe has no room for both and a menu with no visible way
   to reopen it is a menu somebody is stuck in. */
.nav-folded .nav-fold { display: none; }
.nav-folded .brand { cursor: pointer; }
.nav-folded .brand:hover { opacity: .75; }
.brand-row { display: flex; align-items: center; gap: var(--s2); padding-bottom: 1.125rem; }
.brand-row .brand { padding-bottom: 0; }
.brand {
    display: flex; align-items: center; gap: 0.625rem;
    font-weight: 700; font-size: 1.15rem; color: var(--text);
    padding: 0.375rem 0.5rem 1.125rem;
}
.brand:hover { text-decoration: none; }
.brand .logo { flex-shrink: 0; }

/* Icons take the colour of their line and never change its height. */
.ico { flex-shrink: 0; vertical-align: -.18em; }

.sidenav { display: flex; flex-direction: column; gap: var(--s1); }
/* Section labels in the admin's grouped menu (Надзор / Система / Работа). */
.nav-group {
    font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    color: var(--muted); padding: 2px 0.75rem; margin-top: var(--s3);
}
.nav-group:first-child { margin-top: 0; }
/* The menu is furniture: you learn it in a week and then navigate it by shape,
   not by reading it. It has no business being set at the same size as the work. */
.navitem {
    position: relative;
    display: flex; align-items: center; gap: var(--s3);
    padding: 0.5rem var(--s3); border-radius: var(--radius-sm);
    color: var(--muted); font-weight: 500; font-size: .88rem;
}
.navitem:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
/* Where you are is marked the same way state is marked everywhere else. */
.navitem.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.navitem.active::after {
    content: "›"; margin-left: auto; font-size: 1.15rem; line-height: 1;
    font-weight: 700; opacity: .8;
}
/* Folded there are no words to point past, and an arrow beside an icon in a
   stripe is just a second mark competing with it. */
.nav-folded .navitem.active::after { display: none; }
.navitem.active::before {
    content: ""; position: absolute; left: 0; top: 0.375rem; bottom: 0.375rem;
    width: var(--rail); border-radius: 0 var(--rail) var(--rail) 0; background: var(--brand);
}

/* How many offers wait on the owner, on „Оферти" (POF-29). Attention, like every „needs you" mark;
   folded, it sits on the icon's corner — the one menu mark that must survive the fold. */
.nav-count {
    flex: 0 0 auto; min-width: 1.25rem; padding: 0 0.375rem; border-radius: 999px;
    background: var(--attn-bg); color: var(--attn-fg); font-size: .72rem; font-weight: 700;
    line-height: 1.25rem; text-align: center; font-variant-numeric: tabular-nums;
}
.nav-folded .navitem .nav-count {
    position: absolute; top: 0.125rem; right: 0.125rem; min-width: 1rem; padding: 0 0.25rem;
    font-size: .64rem; line-height: 1rem;
}

.side-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 0.625rem; padding-top: 0.875rem; }

/* „Има нова версия" — desktop only. Uses the attention tokens rather than
   brand green: this is something to notice, not something to celebrate, and
   it must read as distinct from the nav items above it without shouting. */
.update-notice {
    display: flex; flex-direction: column; gap: 0.5rem;
    padding: 0.6875rem; border: 1px solid var(--attn-bd); border-radius: var(--radius-sm);
    background: var(--attn-bg);
}
.update-notice-text {
    display: flex; align-items: center; gap: 0.5rem;
    color: var(--attn-fg); font-size: .88rem; font-weight: 600;
}

.userchip {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.5rem 0.75rem; background: var(--surface-2); border-radius: var(--radius-sm);
    color: var(--text); border: 1px solid transparent; gap: 0.5rem;
}
a.userchip:hover { text-decoration: none; border-color: var(--brand); background: var(--surface); }
a.userchip.active { border-color: var(--brand); }
.uname { font-weight: 600; font-size: .9rem; }
.urole { font-size: .74rem; padding: 1px 0.5rem; border-radius: 999px; background: var(--border); color: var(--muted); white-space: nowrap; }
.urole.role-admin { background: var(--brand-soft); color: var(--brand); }
.urole.role-superadmin { background: var(--brand); color: var(--on-brand); }
/* On the menu's panel a filled brand chip is a lamp: the role is a label, not
   the loudest thing in the corner. */
.sidebar .urole.role-superadmin { background: var(--sidebar-active); color: var(--brand); }

/* ---------- My profile ---------- */

/* ---------- Typography ---------- */
/* The size lives with the rest of the type scale, further down. It was declared
   here too, at 1.7rem, and had been overruled by that one since the day it was
   written — two answers to one question, and the file only ever gave the second. */
.page-title { margin: 0 0 0.25rem; letter-spacing: -.01em; }
.muted { color: var(--muted); margin-top: 0; }
.page-head { margin-bottom: 1.375rem; }

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--tile-bd);
    border-radius: var(--radius);
    box-shadow: var(--tile-shadow);
    padding: 1.375rem;
}
.card + .card { margin-top: 1rem; }

/* ---------- Buttons — PU-91: one style for every button, the decide button's (the owner, 2026-10-08:
   „всички бутони да бъдат в този стил, не цвят, а стил"; her pick „1 Б, 2 Б"). Rounded, with depth, an icon and a
   key chip; each role keeps its colour. Every button takes its shape from here and the palette's --btn-* tokens only —
   a screen sets layout (width, gap, wrap), never a radius, a height, a depth or a weight
   (tools/acceptance/test_one_button_style.py). ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    min-height: var(--btn-h); padding: .375rem var(--btn-px); border: 1px solid var(--btn-bd); border-radius: var(--btn-radius);
    background-color: var(--btn-bottom); background-image: linear-gradient(180deg, var(--btn-top), var(--btn-bottom));
    box-shadow: var(--btn-shadow); color: var(--btn-fg);
    font: inherit; font-size: var(--btn-fs); font-weight: var(--btn-weight); line-height: 1.2; cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--brand); text-decoration: none; }
.btn-primary {
    background-color: var(--btn-primary-bottom);
    background-image: linear-gradient(180deg, var(--btn-primary-top), var(--btn-primary-bottom));
    border-color: var(--btn-primary-bd); box-shadow: var(--btn-primary-shadow); color: var(--btn-primary-fg);
    font-weight: var(--btn-primary-weight);
}
.btn-primary:hover {
    background-image: linear-gradient(180deg, var(--btn-primary-bottom), var(--btn-primary-bottom));
    border-color: var(--btn-primary-bd); color: var(--btn-primary-fg);
}
.btn-danger { color: var(--btn-danger-fg); border-color: var(--btn-danger-bd); }
.btn-danger:hover { color: var(--btn-danger-fg); border-color: var(--btn-danger-fg); --btn-top: var(--err-bg); --btn-bottom: var(--err-bg); }
.btn-primary.btn-danger {
    background-color: var(--btn-danger-bottom);
    background-image: linear-gradient(180deg, var(--btn-danger-top), var(--btn-danger-bottom));
    border-color: var(--btn-danger-edge); color: var(--btn-primary-fg);
}
.btn-primary.btn-danger:hover {
    background-image: linear-gradient(180deg, var(--btn-danger-bottom), var(--btn-danger-bottom));
    border-color: var(--btn-danger-edge);
}
.btn-sm { min-height: var(--btn-h-sm); padding: .25rem var(--btn-px-sm); font-size: var(--btn-fs-sm); }
.btn-lg { min-height: var(--btn-h-lg); font-size: var(--btn-fs-lg); }
.btn-icon { width: var(--btn-h); padding: 0; flex: none; }
.btn-icon.btn-sm { width: var(--btn-h-sm); }
.btn .ico, .btn svg { flex: none; }
.btn kbd {
    padding: 0 .3rem; border: 1px solid currentColor; border-radius: .25rem; background: none;
    font-family: var(--font-mono); font-size: .66rem; font-weight: 500; opacity: .7;
}
/* ---------- end of the button style ---------- */

/* ---------- Counters (clickable tiles) ---------- */
.counter-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr)); gap: 0.875rem;
}
/* PU-192: on a phone two to a row, and an odd last tile takes the whole row — no hole beside it */
@media (max-width: 600px) {
    .counter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .counter-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}
/* ---------- The rail ----------
   The signature of the interface: anything that HAS a state wears a 3px edge
   on its left in that state's colour. It replaces most badges — a screen
   covered in coloured pills is the look of a generated dashboard; a quiet one
   where a thin edge says where to look is not. See docs/Дизайн_език.md. */
.rail { position: relative; }
.rail::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0;
    width: var(--rail); border-radius: var(--radius) 0 0 var(--radius);
    background: var(--border-strong);
}
.rail-attn::before { background: var(--attn-fg); }

.rail-info::before { background: var(--info-fg); }
.rail-muted::before { background: var(--border-strong); }

/* A number in a table cell that is really a form-button: looks like a link,
   the wrapping form keeps the cell layout (generates no box). */
.enter-cell { display: contents; }
button.linklike {
    background: none; border: 0; padding: 0; font: inherit; cursor: pointer;
    color: var(--brand); font-variant-numeric: tabular-nums;
}
button.linklike:hover { text-decoration: underline; }
button.linklike.is-warn { color: var(--attn-fg); } /* PU-192: „Чакат решение" in its tile's tone */

.counter-go { position: absolute; top: 1rem; right: 1rem; color: var(--muted); opacity: 0; transition: opacity var(--dur-1) var(--ease); }

/* ---------- The board ----------
   Two questions, in the order they get asked: what needs me today, and how is the
   flow going. The three tiles answer the first and are given the room to; the
   trend and the ring answer the second.

   The charts' greens come from the mark's own gradient (--data-1..5). What needs a
   person keeps --attn and --err: a work board that painted „проблем" in the brand
   colour would be saying two things at once. */

/* A label that names a number without competing with it. */
.eyebrow {
    display: block; font-size: .72rem; font-weight: 600; letter-spacing: .08em;
    text-transform: uppercase; color: var(--muted);
}

/* A number, its name beside it, and one line of explanation. No stripe, no
   uppercase, no colour behind anything.

   Rebuilt 01.08. They were a shouted uppercase label over a huge number with a
   coloured bar down the left — the arrangement every generated dashboard arrives
   with, and they read as one. What makes a tile legible is the size difference
   between the number and its name; everything else that was here was decoration
   doing that job badly. */
/* A number and a phrase beside it. That is the whole tile.

   It has been a shouted uppercase label over a huge number with a coloured
   stripe, and then a number with a name and a hint under it and a coloured dot —
   both of them the same sentence cut in half and printed twice. „3 поръчки чакат
   решение" is one thing to read, and the size difference between the number and
   the words is the only emphasis it needs. */
.kpi {
    display: flex; align-items: center; gap: var(--s3); min-width: 0;
    padding: var(--s4) var(--s5);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow); color: var(--text);
    transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease),
                transform var(--dur-2) var(--ease);
}
a.kpi:hover {
    text-decoration: none; border-color: var(--border-strong);
    box-shadow: var(--shadow-lift); transform: translateY(-1px);
}

/* What a tile is made of (PU-49; since PU-83 „чакат решение" is the needs-person count alone). */
.kpi-note { font-size: .76rem; color: var(--muted); line-height: 1.3; }

.stat {
    font-size: 2.1rem; font-weight: 700; letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
}

.delta {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: .8rem; font-weight: 600; padding: 2px var(--s2); border-radius: 999px;
}
/* Up is healthy for mail arriving; a quieter month is not an error, so it is
   quiet rather than red. --err stays for what actually needs a person. */
.delta-up { color: var(--ok-fg); background: var(--ok-bg); }

/* While the new period is on its way, the old one steps back rather than
   vanishing. A board that blanks between two answers reads as a board that
   broke; a board that dims reads as a board that is thinking. */
#board-region { transition: opacity var(--dur-2) var(--ease); }
#board-region.htmx-request { opacity: .5; pointer-events: none; }

/* The trend. preserveAspectRatio="none" stretches the curve to the card's width,
   and non-scaling-stroke keeps the line an even weight while it does. */
/* The curve takes whatever height the row gives the card. preserveAspectRatio is
   already "none", so a taller box is a taller chart rather than a stretched one
   with white space under it. */
/* A fixed, modest height (owner, 01.08). It used to take whatever the row gave
   the card, and on a tall row that made one chart as big as the four cards
   beside it put together — a trend of thirty numbers does not get clearer by
   being enormous, it just stops its neighbours from being read. */
/* Does NOT grow. Letting it stretch put the leftover height of a tall row
   between the date axis and the legend — a gap in the middle of the card rather
   than space at the end of it, which is where every other card puts it. */
.trend { margin: var(--s4) 0 0; display: flex; flex-direction: column; }

/* The current period is a filled band — two bare lines read as a diagram, and a
   band reads as „ето толкова". Only ONE of them is filled: two areas laid over
   each other are a stack, which says something the chart does not mean. */
.chart-line {
    fill: none; stroke: var(--data-1); stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Ranked bars ----------
   Top customers, top products, where it jams — one shape, three cards. The bar
   is measured against the biggest row, not the total. */
.board-card { border-radius: var(--radius-lg); padding: var(--s5) var(--s6); }

.card-note { color: var(--muted); font-size: .8rem; margin: var(--s1) 0 var(--s4); }

.ranked { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }

/* One colour per row: five rows of a ranking are five different things. */
.data-1 { background: var(--data-1); }
.data-2 { background: var(--data-2); }
.data-3 { background: var(--data-3); }
.data-4 { background: var(--data-4); }
.data-5 { background: var(--data-5); }

/* ---------- Where the month is heading ---------- */

/* How far into the month we are. The bar is the caveat next to the projection:
   a fifth of a bar means a fifth of the evidence. */

.pace-projection {
    display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--s2);
    margin: 0; font-size: .82rem; color: var(--muted); /* PU-192: under the bar, not pushed to the foot */
}

/* ---------- Who is rising and who is falling ----------
   Two columns, not one ranked list with signs: a fall is not a small rise, and
   sorting them together buries the person who stopped ordering in the middle. */
/* 16rem and not 13: at thirteen the two columns still sat side by side in a
   narrow card, and each row became a name clipped to „Тестов Пе…" beside a bar
   too short to compare with anything. A column that cannot show a customer's
   name is not a column — below this they stack. */
.movers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr));
          gap: var(--s5); margin-top: var(--s2); }

/* ---------- A list of people ----------
   Four names and a „и още", because a count with nobody's name on it is a number
   you have to go to another screen to use. <details> and not a script: it stays
   a working list with JavaScript off, and the browser does the disclosure. */
.people { list-style: none; margin: var(--s4) 0 0; padding: 0; display: grid; gap: var(--s2); }
.person {
    display: grid; grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: baseline; gap: var(--s3); font-size: .86rem;
}
.person-name { color: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-name:hover { color: var(--brand); }
.person-orders { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.person-total { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.people-more {
    display: inline-block; margin-top: var(--s3);
    color: var(--muted); font-size: .82rem;
}
.people-more:hover { color: var(--brand); text-decoration: none; }

/* ---------- Small controls that live on a card ----------
   A select inside a meta line, and a pair of tabs under a heading. Both are the
   card changing what it is about, so both are quiet enough to read as part of
   the line they sit in rather than as buttons stuck onto it. */

/* The way back from a page somebody reached from a card. A link and not the
   browser's arrow: they should not have to know that the arrow is what does it. */
.back-link {
    display: inline-flex; align-items: center; gap: var(--s2);
    color: var(--muted); font-size: .85rem; margin-bottom: var(--s2);
}
.back-link:hover { color: var(--brand); text-decoration: none; }
.customers-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.customers-table .row-go { text-align: right; width: 1%; white-space: nowrap; color: var(--muted); }
/* PU-192: each heading over its values (words left, numbers right), the board's ranked rows' rules and air */

.customers-table { border-collapse: collapse; }
.customers-table th { text-align: left; }
.customers-table th.num { text-align: right; }
.customers-table th, .customers-table td { padding: 0.75rem 0.75rem; }
.customers-table tbody td { border-top: 1px solid var(--border); }
.customers-table tbody tr:hover td { background: var(--surface-2); }
@media (max-width: 600px) {
    /* the chevron is the card's own way in, at its right edge — not a labelled „: ›" line */
    .customers-table tbody tr { position: relative; padding-right: 2.25rem; }
    .customers-table tbody td { border-top: 0; padding: 3px 0; }
    .customers-table tbody tr:hover td { background: none; }
    .customers-table td.row-go::before { content: none; }
    .customers-table td.row-go { position: absolute; right: 0.875rem; top: 50%; transform: translateY(-50%); width: auto; padding: 0; }
}
/* The row IS the link here, and the customer's name is the point of the row —
   so it keeps the text colour rather than the quiet one a row-link usually has. */
.customers-table .row-link { color: var(--text); }

/* ---------- Figures ----------
   Four small numbers in one card, for the two questions about a period that has
   already happened: how long it took, and what it was worth. A grid rather than
   four cards, because none of them is worth a card of its own and together they
   read as one answer. */
.figures {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(120px, 100%), 1fr));
    gap: var(--s4); margin: 0;
}
.figure dt {
    font-size: .74rem; letter-spacing: .06em; text-transform: uppercase;
    color: var(--muted); font-weight: 600;
}
.figure dd {
    margin: var(--s1) 0 0; font-size: 1.55rem; font-weight: 700;
    letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}

/* ---------- Upright bars ----------
   Seven bars of one colour answer „how much" and nothing else. The busiest day is
   the whole reason the card exists — „кога трябва да има някой на екрана" — so it
   is the one that is lit, and the other six step back to let it be seen. */
.columns { display: block; width: 100%; height: 5.75rem; margin-top: var(--s2); }
.column { fill: var(--data-4); opacity: .5; }
.column.is-top { fill: var(--data-3); opacity: 1; }

/* ---------- One board, one grid ----------
   Six columns; each card says how many it wants. One container rather than three
   is what makes rearranging possible at all — a card cannot be dragged from one
   grid into another. */
.board {
    /* --s5, not --s4: the air between cards is most of what makes a dense board
       read as calm instead of crowded — the reference dashboards this one is
       measured against spend a fifth of their width on nothing. */
    display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: var(--s5);
    /* stretch, not start. „Заспали клиенти" has one row and „Къде засяда" has
       four, and with `start` every row of the board ended at a different height —
       eight cards that look dropped rather than laid out. The row is as tall as
       its tallest card and the others finish level with it. */
    align-items: stretch;
}
.board-item { grid-column: span 2; min-width: 0; }
/* The default is `span 2`, but the markup says so out loud on every card — so the
   class has to exist, or half the board would depend on a rule it never names. */
.board-item.span-2 { grid-column: span 2; }
.board-item.span-4 { grid-column: span 4; }
.board-item > .card { height: 100%; display: flex; flex-direction: column; }
/* Four small numbers spread into the height the row gave the card. A ranking does
   NOT: a card with one dormant customer would float its single line in the middle
   of the card, which reads as a layout that lost its content rather than as a
   short list. Lists stay where they were written — under their own heading. */
.board-item .figures { margin-top: auto; margin-bottom: auto; }

/* The GRIP appears on hover — a board wearing its handles at rest reads as an
   editor. The „i" does not: it is the only place some of these numbers are
   defined, and information you have to discover by waving a mouse at a card is
   information nobody finds. */
.card-grip { opacity: 0; transition: opacity var(--dur-1) var(--ease); }
.board-item:hover .card-grip, .board-item:focus-within .card-grip { opacity: 1; }
.card-grip {
    border: 0; background: transparent; color: var(--muted); font: inherit;
    line-height: 1; padding: 2px 0.3125rem; border-radius: var(--radius-sm);
}
/* An „i" in a circle, in place of the „×" that hid the card. Hiding was a control
   somebody pressed once by accident and then could not find their card again;
   „какво всъщност меря тук" is the question every one of these cards raises and
   none of them answered. */

.card-grip { cursor: grab; letter-spacing: -2px; }
.is-rearranging .card-grip { cursor: grabbing; }
.board-item.is-dragging {
    opacity: .6; outline: 2px dashed var(--brand); border-radius: var(--radius-lg);
    transition: none;                       /* the dragged card follows the pointer */
}
/* The neighbours slide. board.js measures where each card was, puts it back there
   with a transform and lets go — this is the transition that plays it out, and it
   is on transform alone so the browser can hand it to the compositor.

   Only while a drag is happening. A transform transition standing on every card
   at rest is a standing promise the compositor keeps by holding all eight of them
   — each a rasterised chart — in memory for a gesture nobody is making. */
.is-rearranging .board-item { transition: transform var(--dur-3) var(--ease); }
.is-rearranging { user-select: none; }

/* ---------- The tooltip ----------
   One element for the whole board; anything with data-tip gets it.

   Positioned with a transform rather than left/top: a transform is handed to the
   compositor, so following the pointer costs nothing, while moving `left` asks
   the browser to lay the page out again sixty times a second. */
.chart-tip {
    position: fixed; top: 0; left: 0; z-index: 60; pointer-events: none;
    background: var(--surface-3); color: var(--text);
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    padding: 0.375rem 0.625rem; font-size: .8rem; font-weight: 500;
    box-shadow: var(--shadow-lift);
    /* Chart tooltips are a handful of words and never reach this width; a card's
       explanation is a sentence and would otherwise run off the screen. */
    max-width: 22rem; line-height: 1.45;
    opacity: 0; transition: opacity var(--dur-1) var(--ease);
    will-change: transform;
}
.chart-tip.is-on { opacity: 1; transition: none; } /* PX-267: shown at once, fades out on leaving */

/* ---------- Hover that changes the chart ----------
   Slower than a click wants to be and faster than a page wants to be: long
   enough that the change reads as one thing moving, short enough that it has
   finished by the time the eye arrives. */
.column {
    transition: opacity var(--dur-2) var(--ease), filter var(--dur-2) var(--ease),
                stroke-width var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}

.column { transform-origin: bottom; }
.column:hover { filter: brightness(1.25); opacity: 1; }

/* ---------- The entrance ----------
   Once, when the board arrives — the first paint, or a period somebody chose.
   Not on the counters' thirty-second poll: a board that replayed this twice a
   minute would be one nobody could read.

   Each card comes in on its own beat. --i is the card's place in the order the
   READER put them in, set by board.js, so after a rearrangement the card at the
   top is still the first to arrive. */
.is-entering .board-item {
    animation: rise .6s var(--ease-draw) both;
    animation-delay: calc(var(--i, 0) * 75ms);
    /* Only while it is moving. A standing promise to animate keeps eight cards —
       each one a rasterised chart — on the compositor for the whole session. */
    will-change: transform, opacity;
}
/* Everything inside a card waits for its card, then draws. Adding the card's own
   delay is what stops a curve from drawing itself in mid-air while the card it
   belongs to is still on its way in.

   The trend opens from the left as one window over the band and both lines — see
   the clipPath in _board_trend.html for why it is a window and not a dash. One
   transform on one rect, so the browser scales a clip instead of recomputing a
   dash pattern along a 365-point path sixty times a second. */
/* --settled is when this card has finished arriving. Nothing inside it starts
   before then, and that is the whole trick: a card sliding up IS a layer, and
   redrawing a chart inside a layer that is itself moving means rasterising the
   card again on every frame. One thing at a time per card, and the browser has
   only ever one moving picture to compose. */
/* The card's own delay plus its own duration, and twenty milliseconds of margin.
   Not a round number picked by eye: if this is short by even a little, the chart
   starts drawing while the card is still moving, which is the one thing the
   sequencing exists to prevent. */
.is-entering .board-item { --settled: calc(var(--i, 0) * 75ms + 620ms); }
.is-entering .column {
    animation: grow .95s var(--ease-draw) both;
    animation-delay: var(--settled);
}
/* Seven columns rising one after another rather than as a block. The week reads
   left to right, and so should the chart of it. */
.is-entering .column:nth-child(2) { animation-delay: calc(var(--settled) + 60ms); }
.is-entering .column:nth-child(3) { animation-delay: calc(var(--settled) + 120ms); }
.is-entering .column:nth-child(4) { animation-delay: calc(var(--settled) + 180ms); }
.is-entering .column:nth-child(5) { animation-delay: calc(var(--settled) + 240ms); }
.is-entering .column:nth-child(6) { animation-delay: calc(var(--settled) + 300ms); }
.is-entering .column:nth-child(n+7) { animation-delay: calc(var(--settled) + 360ms); }

@keyframes wipe { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes sweep { from { stroke-dasharray: 0 100; } }
@keyframes grow { from { transform: scaleY(0); } }
@keyframes widen { to { transform: scaleX(1); } }
/* PX-267 (the owner's „а“, 2026-10-08): entrances move or appear, never fade in — text is AA on every frame; a
   staggered one waits hidden for its turn (visibility), then appears whole. Exits may fade. */
@keyframes rise { from { visibility: hidden; transform: translateY(14px) scale(.985); } }

@media (prefers-reduced-motion: reduce) {
    .is-entering .column,
.is-entering .board-item,
.board-item,
.column {
        animation: none; transition: none;
    }

}

@media (max-width: 1100px) {
    .board { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .board-item.span-4 { grid-column: span 4; }
}
@media (max-width: 760px) {
    .board { grid-template-columns: minmax(0, 1fr); }
    .board-item, .board-item.span-4 { grid-column: span 1; }
}

/* The ring. Every slice is the same circle wearing a different dash, rotated so
   the first one starts where a ring is read from. */

.ring { display: block; width: 100%; transform: rotate(-90deg); }
.dot.tone-attn { background: var(--attn-fg); }

.dot.tone-info { background: var(--data-past); }

/* ---------- How big the interface is ----------
   The „Аа" is deliberately NOT set in rem: this button is a sample of a size you
   have not chosen yet, and in rem every sample would be the size you are already
   looking at — four identical buttons claiming to be four different sizes. */
.ui-sizes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); max-width: 36rem; } /* PU-192: equal tiles */
@media (max-width: 560px) { .ui-sizes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.ui-size {
    display: flex; flex-direction: column; align-items: center; gap: 0.125rem;
    min-width: 0; padding: var(--s3) var(--s2); text-align: center;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface-2); color: var(--muted); font: inherit;
    cursor: pointer; transition: border-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}
.ui-size:hover { color: var(--text); border-color: var(--border-strong); }
.ui-size[aria-pressed="true"] {
    border-color: var(--brand); color: var(--text); background: var(--brand-soft);
}
.ui-size-a {
    font-family: var(--font-display); font-weight: 700; line-height: 1;
    margin-bottom: 0.125rem;
}
.ui-size:nth-child(1) .ui-size-a { font-size: 15px; }
.ui-size:nth-child(2) .ui-size-a { font-size: 17px; }
.ui-size:nth-child(3) .ui-size-a { font-size: 19px; }
.ui-size:nth-child(4) .ui-size-a { font-size: 22px; }
.ui-size-name { font-size: .85rem; font-weight: 600; }
.ui-size-note { font-size: .74rem; color: var(--muted); }
.ui-size[aria-pressed="true"] .ui-size-note { color: var(--brand); }

/* ---------- Messages / alerts ---------- */
.messages { display: flex; flex-direction: column; gap: var(--s2); margin-bottom: 1.125rem; }
.alert {
    position: relative; padding: 0.75rem 1rem 0.75rem 1.125rem; border-radius: var(--radius-sm);
    border: 1px solid transparent; overflow: hidden;
}
.alert::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--rail);
    background: currentColor;
}
.alert-success { background: var(--ok-bg); border-color: var(--ok-bd); color: var(--ok-fg); }
.alert-error { background: var(--err-bg); border-color: var(--err-bd); color: var(--err-fg); }
.alert-info { background: var(--info-bg); border-color: var(--info-bd); color: var(--info-fg); }
.alert-warning { background: var(--attn-bg); border-color: var(--attn-bd); color: var(--attn-fg); }
/* the sentence stays readable; only the rail carries the colour at full strength */
.alert strong, .alert b { color: inherit; }

/* ---------- Login ----------
   From #34, in rem: the screen is dev's, the units are this branch's, because
   every size in this file is a multiple of the root and `Много едър` has to
   reach the login screen as well as the board.

   The only screen the operator meets before there is any data on it, so it is
   the only one where the mark is the subject rather than a label. Everything
   else here is restraint: one column, in the middle of the window, and green
   spent exactly twice — the mark and the one button. */

/* The password field carries the eye INSIDE it, so the field keeps the full
   width of the column and the row does not grow a second control. */
.pw-field { position: relative; }
.pw-field input[type=password], .pw-field input[type=text] { padding-right: 2.875rem; }
.pw-eye {
    position: absolute; top: 0; right: 0; height: 100%; width: 44px;
    display: flex; align-items: center; justify-content: center;
    background: none; border: 0; padding: 0; cursor: pointer;
    color: var(--muted); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.pw-eye:hover { color: var(--text); }
.pw-eye.on { color: var(--brand); }
/* One button, two states: which icon shows is the state itself. */
.pw-eye .pw-eye-hide, .pw-eye.on .pw-eye-show { display: none; }
.pw-eye.on .pw-eye-hide { display: flex; }

/* ---------- Inputs ---------- */
input, select, textarea { font-family: inherit; }
select, .input {
    padding: 0.5625rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface-2); color: var(--text); font-size: .95rem;
}

/* ---------- Status tabs ---------- */

.status-tabs { display: flex; gap: 0.375rem; flex-wrap: wrap; }
.tab {
    padding: 0.4375rem 0.9375rem; border-radius: 999px; background: var(--surface-2); color: var(--muted);
    font-size: .88rem; border: 1px solid var(--border); box-shadow: var(--chip-shadow);
}
.tab:hover { color: var(--text); text-decoration: none; border-color: var(--brand); }
.tab-active { background: var(--on-fill); color: var(--on-fill-fg); border-color: var(--on-fill); }
/* Count badge inside a filter tab — one combined control (filter + numbers). */
.tab .tab-n {
    display: inline-block; margin-left: 0.4375rem; padding: 0 0.4375rem; border-radius: 999px;
    font-size: .74rem; font-weight: 700; background: var(--surface-3); color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.tab-active .tab-n { background: rgba(255, 255, 255, .25); color: var(--on-fill-fg); }
.search { flex: 1; min-width: 12.5rem; padding: 0.5625rem 0.8125rem; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); }

/* ---------- Table ---------- */
.table-card { padding: 0; overflow-x: auto; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.emails-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.emails-table thead th {
    text-align: left; padding: 0.8125rem 1rem; border-bottom: 1px solid var(--border);
    color: var(--muted); font-weight: 600; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em;
}
.emails-table tbody tr { border-bottom: 1px solid var(--border); cursor: pointer; }
.emails-table tbody tr:last-child { border-bottom: none; }
.emails-table tbody tr:hover { background: var(--brand-soft); }
.emails-table td { padding: 0.8125rem 1rem; vertical-align: middle; }
.emails-table .nowrap { white-space: nowrap; color: var(--muted); }
.emails-table .from { max-width: 15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.emails-table .subj a { font-weight: 500; color: var(--text); }
.emails-table .subj a:hover { color: var(--brand); }
.emails-table .center { text-align: center; }

.status-badge { display: inline-block; padding: 3px 0.6875rem; border-radius: 999px; font-size: .77rem; font-weight: 600; white-space: nowrap; }
/* The plain badge: its shape, and brand on brand-soft when it names no role. It
   stands BEFORE the role badges on purpose — at the same specificity the later
   rule wins, and when it stood after them every „badge badge-info" read as brand
   green: the catalogue's „промо" at 4.39:1 in the dark theme (PX-211). */
.badge { display: inline-block; font-size: .74rem; background: var(--brand-soft); color: var(--brand);
    padding: 2px 0.5625rem; border-radius: 999px; }
/* Badges named after the role they carry, like every other token. The
   status-* classes below are the older, per-status names kept in place. */
.badge-attn { background: var(--attn-bg); color: var(--attn-fg); }
.badge-err  { background: var(--err-bg);  color: var(--err-fg); }
.badge-ok   { background: var(--ok-bg);   color: var(--ok-fg); }
.badge-info { background: var(--info-bg); color: var(--info-fg); }
.badge-muted { background: var(--surface-3); color: var(--muted); }

/* offer type badges — monthly brochure vs daily/weekend clearly distinct */

.type-monthly { background: var(--info-bg); color: var(--info-fg); border-color: var(--info-bd); }
.type-daily { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-bd); }
.type-weekend { background: var(--attn-bg); color: var(--attn-fg); border-color: var(--attn-bd); }
.type-hourly { background: var(--err-bg); color: var(--err-fg); border-color: var(--err-bd); }
/* the type badge IS the control — the offer's type is changed where it is read */

.status-new { background: var(--info-bg); color: var(--info-fg); }
.status-processing { background: var(--info-bg); color: var(--info-fg); }
.status-review { background: var(--attn-bg); color: var(--attn-fg); }
.status-done { background: var(--ok-bg); color: var(--ok-fg); }
/* PU-180: the light theme's --muted read 3.9:1 on this ground (axe, an organization's „няма собствен ключ") */
.status-ignored { background: var(--border); color: var(--ow-ink-2); }
.status-error { background: var(--err-bg); color: var(--err-fg); }
/* legacy classes kept for any old rows still rendered */
.status-processed { background: var(--ok-bg); color: var(--ok-fg); }
.status-split { background: var(--attn-bg); color: var(--attn-fg); }

.pagination { display: flex; align-items: center; gap: 0.5rem; justify-content: center; margin-top: 1.25rem; flex-wrap: wrap; }
.page-info { color: var(--muted); font-size: .9rem; }
.page-num {
    display: inline-flex; min-width: 2.125rem; height: 2.125rem; align-items: center; justify-content: center;
    padding: 0 0.5625rem; border: 1px solid var(--ctl-bd); border-radius: 0.5rem;
    text-decoration: none; color: var(--text); font-size: .9rem;
    background: var(--ctl-bg); box-shadow: var(--ctl-shadow);
}
.page-num:hover { border-color: var(--brand); text-decoration: none; }
.page-num-active { background: var(--on-fill); color: var(--on-fill-fg); border-color: var(--on-fill); font-weight: 600; }

/* ---------- Filter bar: search + multi-select dropdowns ----------
   One strip, one border. Each dropdown shows WHAT is chosen, not how many —
   „Състояние · 2" told the operator nothing without opening it. */
.emails-filters {
    display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin: 0 0 0.875rem;
    padding: 0.5rem; background: var(--surface); border: 1px solid var(--border);
    border-radius: 0.75rem;
}
.emails-filters .search {
    border-color: transparent; background: var(--surface-2); min-width: 13.75rem;
}
.emails-filters .search:focus { border-color: var(--brand); outline: none; }
.filter-sep { flex: 1 1 auto; }          /* pushes the actions to the right */
.filter-dd { position: relative; }
.filter-dd > summary {
    list-style: none; cursor: pointer; display: inline-flex; align-items: baseline; gap: 0.375rem;
    padding: 0.5rem 0.8125rem; border: 1px solid var(--border); border-radius: 0.5rem;
    background: var(--surface-2); font-size: .9rem; user-select: none; white-space: nowrap;
}
.filter-dd > summary:hover { border-color: var(--muted); }
.filter-dd > summary::-webkit-details-marker { display: none; }
.filter-dd > summary::after { content: "\25be"; color: var(--muted); font-size: .8em; }
.filter-dd[open] > summary { border-color: var(--brand); background: var(--surface); }
.fb-label { color: var(--muted); font-size: .82rem; }
.fb-value { font-weight: 600; max-width: 13.125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-value.fb-any { font-weight: 400; color: var(--muted); }
.filter-menu {
    position: absolute; z-index: 40; margin-top: 0.375rem; min-width: 15rem; max-height: 21.25rem; overflow: auto;
    background: var(--surface); border: 1px solid var(--border); border-radius: 0.625rem; padding: 0.375rem;
    box-shadow: var(--shadow-lift);
}
.filter-opt { display: flex; align-items: center; gap: 0.5rem; padding: 0.4375rem 0.5rem; border-radius: 0.375rem; cursor: pointer; font-size: .9rem; }
.filter-opt:hover { background: var(--surface-2); }
/* PCAT-05: only the COUNT is pushed right. The old `span:last-child` rule also
   caught a single-select option's lone label (Подредба), dragging it away from its
   radio; the count now carries its own class. */
.filter-opt .filter-count { margin-left: auto; color: var(--muted); font-size: .82rem; }
.filter-empty { margin: 0.25rem 0.5rem; font-size: .9rem; }

.badge { white-space: nowrap; }
.cat-actions { flex-wrap: wrap; }

.mono { font-family: var(--font-mono); }

.cat-actions { display: inline-flex; gap: 0.375rem; align-items: center; }

/* ---------- Newly synced offer: make the arrival visible ---------- */
@keyframes row-arrive {
    0%   { background: var(--brand-soft); transform: translateY(-4px); }
    35%  { background: var(--brand-soft); transform: none; }
    100% { background: transparent; }
}

/* ---------- Email detail: header with classification on the right ---------- */
.email-header-split { display: flex; gap: 1.75rem; flex-wrap: wrap; align-items: flex-start; }

/* ---------- Email detail ---------- */

.section-h { font-size: 1.1rem; margin: 0 0 0.75rem; }
.email-body {
    white-space: pre-wrap; word-wrap: break-word; font-family: "Segoe UI", sans-serif;
    font-size: .96rem; margin: 0; line-height: 1.65; max-height: 38.75rem; overflow-y: auto;
    background: var(--surface-2); padding: 1rem; border-radius: var(--radius-sm); border: 1px solid var(--border);
}

.back-link { display: inline-block; margin-bottom: 0.875rem; color: var(--muted); }

/* ---------- Settings ---------- */
.setting-row { display: grid; grid-template-columns: 1fr 300px; gap: 1.375rem; padding: 0.875rem 0;
    border-bottom: 1px dashed var(--border); align-items: start; }
.setting-row:last-child { border-bottom: none; }
.setting-meta label { font-weight: 600; }
.setting-help { margin: 0.25rem 0; color: var(--muted); font-size: .9rem; }
/* The raw key used to sit under every label in monospace — jargon in the
   operator's eyes. It is a quiet question mark now, with the key on hover. */
.setting-input input[type=text], .setting-input input[type=number],
.setting-input input[type=date], .setting-input input[type=time],
.setting-input select, .setting-input textarea {
    width: 100%; padding: 0.5625rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface-2); color: var(--text); font-size: .95rem;
}
.setting-input textarea.mono { font-family: var(--font-mono); font-size: .85rem; }
/* The same row for somebody who may only read it: the value, in the column the
   control would have stood in, so the two versions of the page line up. */
.setting-static {
    display: block; padding: 0.5625rem 0; font-size: .95rem;
    white-space: pre-wrap; overflow-wrap: anywhere;
}
.settings-actions { position: sticky; bottom: 0; padding: 1rem 0; }

/* ---------- AI models page ---------- */
/* The chosen model sends data outside the EU — said next to the choice, and
   in the warning colour, so it reads as a caution rather than a footnote. */
/* A deciding task (PAI-03): its choice now, the change in its eval, the form, the history. */
.ai-choice { padding: 1.125rem 0; border-bottom: 1px dashed var(--border); }
.ai-choice:last-child { border-bottom: none; }
.ai-choice-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.ai-choice .t-name { font-size: 1rem; font-weight: 600; margin: 0; }
.ai-choice .t-desc { color: var(--muted); font-size: .9rem; margin-top: 2px; }
.ai-choice .t-warn { color: var(--attn-fg); display: flex; gap: 0.375rem; align-items: flex-start; }
.ai-choice .t-warn svg, .ai-choice .t-ok svg { flex: none; margin-top: 2px; }
.ai-choice .t-ok { color: var(--ok-fg); display: flex; gap: 0.375rem; align-items: flex-start; }

.ai-pending, .ai-refused { margin-top: 0.875rem; padding: 0.75rem 0.875rem; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--surface-2); }
.ai-pending p, .ai-refused p { margin: 0 0 0.5rem; overflow-wrap: anywhere; }
.ai-choice-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.ai-choice-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.75rem;
    align-items: end; margin-top: 0.875rem; }
.ai-choice-form label { display: flex; flex-direction: column; gap: 0.25rem; font-size: .85rem; color: var(--muted); }
.ai-choice-form select { width: 100%; padding: 0.5rem 0.625rem; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); font-size: .9rem; }

.ai-history { margin-top: 0.5rem; font-size: .88rem; }
.ai-history td { overflow-wrap: anywhere; }
/* PU-37: the change form behind „Смени модела", its technical fields behind „Подробности". */
.ai-group-title { margin: 1.25rem 0 0; font-size: .8rem; font-weight: 600; letter-spacing: .04em;
    text-transform: uppercase; color: var(--muted); }
/* PU-186: the order actions' numbers on AI система — label left, number right, one row each */
.act-num-list { margin: var(--s2) 0 var(--s4); display: grid; gap: var(--s1); }
.act-num-list > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2); padding: var(--s1) 0;
    border-bottom: 1px solid var(--border); }
.act-num-list dt { color: var(--muted); }
.act-num-list dd { margin: 0; font-variant-numeric: tabular-nums; }
.ai-group-title:first-child { margin-top: 0; }
/* PU-192: the lead and the group labels breathe; a wrapped number stays right */
.page-lead.ai-lead { margin-bottom: var(--s4); }
.set-group-body > .ai-group-title { margin: var(--s5) 0 var(--s2); }
.set-group-body > .ai-group-title:first-child { margin-top: var(--s4); }
.act-num > .ai-group-title { margin: var(--s4) 0 var(--s1); }
.act-num + .act-num { margin-top: var(--s2); }
.act-num-list dd { margin-left: auto; text-align: right; }
.ai-change { margin-top: 0.75rem; }
.ai-change > summary { display: inline-flex; list-style: none; }
.ai-change > summary::-webkit-details-marker { display: none; }
.ai-change[open] > summary { margin-bottom: 0.25rem; }
.ai-change .ai-choice-form { grid-template-columns: minmax(0, 1fr); max-width: 32rem; }
.ai-more > summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.ai-more-now { margin: 0.5rem 0 0; font-size: .85rem; overflow-wrap: anywhere; }
.ai-more-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.75rem;
    margin-top: 0.5rem; }

/* ---------- Looking through someone else's account ----------
   Impossible to miss on purpose: an admin must never forget whose screen this
   is, and the strip is the only way back out. */
/* ---------- The sandbox database ----------
   Announced on every screen it serves, including the login one. The tape along
   the bottom edge is the point: the bar has to read as „не е истинско" before a
   word of it has been read, and no other state in the app is striped. */
.devdb-bar {
    position: sticky; top: 0; z-index: 31;
    display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
    flex-wrap: wrap; padding: 0.625rem 1.125rem 0.8125rem;
    background: var(--sandbox-bg); color: var(--sandbox-fg); font-size: .92rem;
}
.devdb-bar::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 0.25rem;
    background: repeating-linear-gradient(-45deg,
        var(--sandbox-fg) 0 6px, transparent 6px 12px);
    opacity: .55;
}
.devdb-what { display: inline-flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.devdb-quiet { opacity: .8; }
/* Sign-in hint on the sandbox's own login screen — never on the real one. */
.sandbox-hint {
    margin: var(--s4) 0 0; text-align: center; font-size: .84rem; color: var(--muted);
}
.sandbox-hint code {
    font-family: var(--font-mono); color: var(--sandbox-fg);
    padding: 1px var(--s1); border-radius: 0.25rem; background: var(--sandbox-bg);
}
.devdb-var {
    font-family: var(--font-mono); font-size: .8rem; white-space: nowrap;
    padding: 2px var(--s2); border-radius: var(--radius-sm);
    border: 1px solid var(--sandbox-bd); opacity: .85;
}
/* Two bars pinned to the same edge would sit on top of each other. When both
   are up the sandbox wins the sticky position — mistaking which DATABASE you
   are in is worse than losing sight of whose ACCOUNT you are looking at. */
.devdb-bar ~ .viewas-bar { position: static; }
/* PU-138: two bars of ours („Работиш в" and the deferred-steps reminder) — the first sticks, the second scrolls */
.viewas-bar ~ .viewas-bar { position: static; }
/* PU-180: the deferred-steps reminder sits under the top bar and scrolls with the page */
.viewas-bar.reminder-bar { position: static; }

.viewas-bar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; justify-content: space-between; gap: 0.875rem;
    flex-wrap: wrap; padding: 0.625rem 1.125rem;
    background: var(--attn-bg); color: var(--attn-fg);
    border-bottom: 1px solid var(--attn-bd); font-size: .92rem;
}
.viewas-bar .btn { color: var(--text); }
/* Working IN an org (owner, full power) — green, not the amber read-only look. */
.viewas-bar.workin-bar { background: var(--ok-bg); color: var(--ok-fg); border-bottom-color: var(--ok-bd); }

/* On a phone the banner is one short row (PU-49: it took most of the first screen on every page):
   the organization's name and „Излез"; the button keeps its full name for assistive technology. */
@media (max-width: 640px) {
    .viewas-bar.workin-bar { flex-wrap: nowrap; gap: var(--s2); padding: var(--s1) var(--s3); font-size: .84rem; }

    .workin-bar form { flex: none; }
}
/* A deferred step (27.07) — calm/informational, not an alert: nothing is
   wrong, it is just not done yet. */
.viewas-bar.reminder-bar { background: var(--info-bg); color: var(--info-fg); border-bottom-color: var(--info-bd); }
.reminder-bar a { color: inherit; font-weight: 600; text-decoration: underline; }
.people-table td { vertical-align: middle; }
.people-table form { margin: 0; }

/* New organization: its own modal (owner 26.07), wearing the same chrome and
   backdrop as the app's confirmation — only wider, since it holds a form.
   Inside, a two-column grid: name+role and username+email pair up, while the
   password, hint and actions run full width. */
.orgnew-dialog, .form-dialog {
    position: fixed; inset: 0; margin: auto; height: fit-content;
    border: 1px solid var(--border); border-radius: var(--radius);
    /* No padding on the dialog itself: a click landing on it is then always the
       backdrop, never the frame around the form — closing on the frame would
       throw away what the person had just typed. The form carries the inset. */
    padding: 0;
    background: var(--surface); color: var(--text);
    width: min(42.5rem, calc(100vw - 2rem));
    max-height: calc(100vh - 3rem); overflow-y: auto;
    box-shadow: var(--shadow-lift), inset var(--rail) 0 0 var(--brand);
}
.orgnew-dialog > form, .form-dialog > form { padding: 1.375rem 1.5rem 1.375rem 1.625rem; }
.orgnew-dialog::backdrop, .form-dialog::backdrop { background: rgba(6, 12, 8, .55); backdrop-filter: blur(2px); }
.orgnew-dialog[open], .form-dialog[open] { animation: confirm-in .16s var(--ease-out); }
@media (prefers-reduced-motion: reduce) { .orgnew-dialog[open], .form-dialog[open] { animation: none; } }
.orgnew-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0.875rem; }
.orgnew-head { grid-column: 1 / -1; }
.orgnew-head h2 { margin: 0 0 2px; font-size: 1.12rem; }
.orgnew-head p { margin: 0; }
.orgnew-field { display: flex; flex-direction: column; gap: 0.3125rem; font-weight: 600; font-size: .88rem; }
.orgnew-field input, .orgnew-field select, .orgnew-field textarea {
    padding: 0.5625rem 0.6875rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface-2); color: var(--text); font-size: .95rem; font-weight: 400;
    font-family: inherit; }
.orgnew-pass { grid-column: 1 / -1; }
.pass-row { display: flex; gap: 0.5rem; align-items: stretch; }
.pass-row input { flex: 1; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.pass-row .btn { white-space: nowrap; }
.orgnew-actions { grid-column: 1 / -1; display: flex; gap: 0.625rem;
    justify-content: flex-end; margin-top: 0.25rem; flex-wrap: wrap; }
.orgnew-hint { grid-column: 1 / -1; margin: 0; font-weight: 400; font-size: .82rem; }
@media (max-width: 640px) { .orgnew-form { grid-template-columns: 1fr; } }

/* A whole table row that navigates on click (26.07 #11). */
tr.row-link { cursor: pointer; }
tr.row-link:hover td { background: var(--surface-2); }

/* The owner's own AI key, shown masked with an eye to reveal (feedback #9). */
.key-reveal { display: flex; align-items: center; gap: 0.625rem; flex-wrap: wrap; }
.key-reveal code {
    font-family: var(--font-mono);
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 0.3125rem 0.625rem; font-size: .9rem;
    letter-spacing: .04em; user-select: all; }
.key-eye.on { color: var(--brand); }

.role-select { padding: 0.3125rem 0.5625rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface-2); color: var(--text); font-size: .88rem; cursor: pointer; }
.person-actions { display: flex; gap: 0.375rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.person-actions form { display: inline-flex; }
.pw-set { position: relative; }
.pw-set > summary { list-style: none; cursor: pointer; }
.pw-set > summary::-webkit-details-marker { display: none; }
.pw-form { display: flex; gap: 0.375rem; margin-top: 0.375rem; padding: 0.625rem; align-items: center;
    position: absolute; right: 0; z-index: 10; box-shadow: var(--shadow); }
.pw-form input { padding: 0.4375rem 0.5625rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface-2); color: var(--text); font-size: .9rem; }
/* A second flex row with no explicit input width, same shape as .ai-key-row
   — the eye-toggle wrap needs the same override or it shrinks to ~14px
   (audit finding, 27.07, round 4). */
.pw-form .pw-wrap { flex: 1 1 auto; min-width: 8.75rem; width: auto; }
.btn-danger:hover { color: var(--err-fg); border-color: var(--err-bd); }
.person-off td { opacity: .6; }

/* ---------- Icons ----------
   Strokes that inherit the text colour and size, instead of emoji drawn by the
   operating system in a different style on every machine. */

.ic { width: 1em; height: 1em; vertical-align: -.125em; flex-shrink: 0; }
.ic.ok { color: var(--ok-fg); }

/* the status of one line: the word, in its colour — no filled pill */
.line-status { font-size: .86rem; font-weight: 600; }
.ls-ok { color: var(--muted); font-weight: 500; }
.ls-warn { color: var(--attn-fg); }
.ls-err { color: var(--err-fg); }

.chip { display: inline-block; font-size: .73rem; background: var(--surface-2); border: 1px solid var(--border);
    color: var(--muted); padding: 1px 0.5625rem; border-radius: 999px; margin-left: 0.25rem; }
/* The state pills, and they must come AFTER .chip — they used to sit five
   hundred lines above it, at the same specificity, so the neutral base simply
   won and „Има проблем" was the same grey as „наред". The owner's own alarm,
   whispering. */
.chip-ok { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-bd); }
.chip-warn { background: var(--attn-bg); color: var(--attn-fg); border-color: var(--attn-bd); }
.chip-off { background: var(--err-bg); color: var(--err-fg); border-color: var(--err-bd); }

/* ---------- Costs: processing pipeline ---------- */
.pipeline { list-style: none; margin: 0.625rem 0 0; padding: 0; }

/* ---------- Emails: sync bar + summary ---------- */

.dot { width: 0.5625rem; height: 0.5625rem; border-radius: 50%; flex-shrink: 0; }

.email-summary { display: flex; gap: 0.625rem; flex-wrap: wrap; margin-bottom: 0.25rem; }

/* ---------- Charts ---------- */

.hbars { display: flex; flex-direction: column; gap: 0.6875rem; }

/* reserved status palette (always paired with a text label) */
.c-ok { background: var(--ok-fg); }
.c-warn { background: var(--attn-fg); }
.c-err { background: var(--err-fg); }
.c-info { background: var(--info-fg); }
.c-muted { background: var(--muted); }

/* ---------- Live progress card ---------- */
.progress-card { border-left: var(--rail) solid var(--brand); }
.progress-head { display: flex; align-items: center; gap: 0.875rem; margin-bottom: 0.75rem; }
.spinner {
    width: 1.625rem; height: 1.625rem; flex-shrink: 0; border-radius: 50%;
    border: 3px solid var(--border); border-top-color: var(--brand);
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.pulse {
    width: 0.5625rem; height: 0.5625rem; border-radius: 50%; background: var(--brand);
    animation: pulse 1.1s var(--ease) infinite; flex-shrink: 0;
}
@keyframes pulse { 0%, 100% { opacity: .35; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.15); } }

/* ---------- Правила: един подреден списък, едно правило = един ред --------
   The card grid packed rules shoulder to shoulder and read like a mosaic
   (26.07 №4); now they run top to bottom, numbered, with a steady rhythm:
   заглавие → обяснение → кодове → условия → цитат. */
.rule-cards { display: flex; flex-direction: column; gap: 0.75rem; counter-reset: rule; }
.rule-card {
    background: var(--surface-2); border: 1px solid var(--border);
    border-left: var(--rail) solid var(--brand); border-radius: var(--radius-sm);
    padding: 0.875rem 1.125rem; font-size: .92rem; line-height: 1.55;
    counter-increment: rule;
}
.rule-card.rule-sum, .rule-card.rule-right { border-left-color: var(--muted); }
.rule-card.rule-manual { border-left-color: var(--attn-fg); }
.rule-title { font-weight: 700; font-size: 1rem; }
.rule-title::before {
    content: counter(rule) ". "; color: var(--muted); font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.rule-lead { color: var(--muted); margin-top: 0.25rem; max-width: 68ch; }
.rule-codes { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.625rem; }
.rule-code {
    display: inline-flex; align-items: baseline; gap: 0.3125rem; font-size: .8rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 999px; padding: 2px 0.5625rem;
}
.rule-conds { margin: 0.625rem 0 0; padding-left: 1.125rem; max-width: 68ch; }
.rule-conds li { margin-top: 0.25rem; }
.rule-ladder { margin-top: 0.625rem; border-collapse: collapse; font-size: .88rem; }
.rule-ladder td { padding: 3px 1rem 3px 0; font-variant-numeric: tabular-nums; }
.rule-quote {
    margin-top: 0.75rem; padding-top: 0.5rem; border-top: 1px dashed var(--border);
    color: var(--muted); font-size: .82rem; font-style: italic; max-width: 68ch;
}

/* ---------- Responsive ----------
   On a phone the menu used to wrap onto four rows and the status tabs onto
   another four, so the first row of the queue started below a full screen of
   chrome. Both scroll sideways on one line instead. */
@media (max-width: 820px) {
    body.has-sidebar { padding-left: 0; }
    .sidebar { width: 100%; height: auto; position: static; flex-direction: row;
        flex-wrap: wrap; align-items: center; gap: 0.5rem; overflow-y: visible;
        padding: 0.625rem 0.75rem; }
    /* No folding here. The menu is a row across the top at this width and does
       not read --sidebar-w at all, so the handle was a control that looked
       pressable and did nothing.

       The folded STATE is undone too, not just its handle: somebody who folded
       the menu on a desktop carries `nav-folded` in this browser, and without
       this the words would still be hidden on a layout that has room for them. */
    .nav-fold { display: none; }
    .nav-folded .brand-name, .nav-folded .navitem > span, .nav-folded .nav-word,
    .nav-folded .userchip-meta { display: inline; }
    .brand { padding: 0 0.5rem 0 0; font-size: 1.05rem; }
    /* Едно навито меню, което не казва, че продължава, е меню, в което
       „Настройки" не съществува: на телефон се виждат три-четири елемента, а
       плъзгачът е скрит. Затова десният ръб избледнява — единственият знак,
       че там има още, и той изчезва, щом лентата е доплъзгана докрай. */
    .sidenav { flex-direction: row; flex-wrap: nowrap; gap: 2px;
        overflow-x: auto; scrollbar-width: none; flex: 1 1 100%; align-items: center;
        /* На маска се чете само прозрачността, не цветът — затова тук стои
           токен, а не литерал: непрозрачно докрай и после чезне. */
        -webkit-mask-image: linear-gradient(to right, var(--text) calc(100% - 2.5rem), transparent);
        mask-image: linear-gradient(to right, var(--text) calc(100% - 2.5rem), transparent); }
    .sidenav::-webkit-scrollbar { display: none; }
    .navitem { padding: 0.5rem 0.625rem; white-space: nowrap; }
    /* one scrollable row on a phone — the group labels only clutter it */
    .nav-group { display: none; }
    .side-bottom { margin-top: 0; flex-direction: row; align-items: center;
        gap: 0.5rem; padding-top: 0; margin-left: auto; }
    /* Тримата вдясно са една лента, не три различни неща. Значката на профила
       беше двуредова (име над роля) и на филия висока колкото два бутона, с
       плътен фон — четеше се като поле за въвеждане, а е надпис. Тук името и
       ролята застават един до друг, фонът пада, и трите се изравняват по
       височина, за да легнат на една линия. */
    .side-bottom { align-items: center; }
    .side-bottom .userchip {
        width: auto; min-height: 2.375rem; padding: 0 0.6875rem;
        display: inline-flex; align-items: center; justify-content: center;
    }
    .side-bottom .userchip { background: none; border-color: var(--border); gap: 0.4375rem; }
    .side-bottom .userchip-meta { flex-direction: row; align-items: center; gap: 0.4375rem; }
    .side-bottom .uname { white-space: nowrap; }
}
/* PU-192: a strip that scrolls sideways fades at the edge it continues past (base.html sets data-fade: l, r or lr) and
   its open item is brought into view; a mask reads only the alpha, so the token's colour does not matter */
[data-fade="r"] { -webkit-mask-image: linear-gradient(to right, var(--text) calc(100% - 2.5rem), transparent);
    mask-image: linear-gradient(to right, var(--text) calc(100% - 2.5rem), transparent); }
[data-fade="l"] { -webkit-mask-image: linear-gradient(to left, var(--text) calc(100% - 2.5rem), transparent);
    mask-image: linear-gradient(to left, var(--text) calc(100% - 2.5rem), transparent); }
[data-fade="lr"] { -webkit-mask-image: linear-gradient(to right, transparent, var(--text) 2.5rem, var(--text) calc(100% - 2.5rem), transparent);
    mask-image: linear-gradient(to right, transparent, var(--text) 2.5rem, var(--text) calc(100% - 2.5rem), transparent); }

/* На най-тесния екран думите отстъпват на иконите си: „Светла тема" и „Изход"
   се пренасяха на два реда и растяха лентата, за да остане потребителското име
   без място. Иконите си носят имената (title и aria-label). */
@media (max-width: 480px) {
    .side-bottom .nav-word { display: none; }
    /* The sandbox bar keeps its headline; the explanations are what go, so it
       stays one line instead of three. */
    .devdb-quiet { display: none; }
    .content { --content-gutter: 1rem; padding: 1rem; }
    .setting-row { grid-template-columns: 1fr; gap: 0.625rem; }

    /* one scrollable line of buckets, never a wall of tabs */
    .status-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
        padding-bottom: 0.25rem; }
    .status-tabs::-webkit-scrollbar { display: none; }
    .tab { white-space: nowrap; }

    /* Thumb-sized targets. 44px, in pixels, and it stays in pixels: this is a
       measurement of a FINGER, and a finger is not larger or smaller because
       somebody chose a different font size. Converting it to rem quietly took it
       to 41px — under the minimum, on the one screen where it matters most. */
    .btn { min-height: 44px; }
}

/* ---------- Phone: the queue reads as cards ----------
   Seven columns in 335px meant sideways scrolling to answer „whose order is
   this?". Same markup — each row becomes a card and each cell carries its own
   label (data-label on the td). */
@media (max-width: 600px) {

    /* the number and the customer lead the card — no label needed there */

    .table-card { overflow-x: visible; }

    /* A phone screen is worth more than chrome: cards give back some padding. */
    .card { padding: 1rem; }
    .page-title { font-size: 1.35rem; }
}

/* ---------- Floating messages (toasts) ----------
   Messages used to sit in the flow and push the whole page down on every
   action. They now float over it and fade out, so nothing shifts.
   The tints are translucent on purpose (they blend into a card), but a
   FLOATING message over buttons was unreadable — so a toast gets an opaque
   base under its tint and sits in the bottom corner, out of the way of the
   action buttons at the top. */
.messages {
    position: fixed; bottom: 1.25rem; right: 1.375rem; z-index: 200;
    display: flex; flex-direction: column-reverse; gap: 0.5rem;
    max-width: min(28.75rem, calc(100vw - 2.75rem)); margin: 0; pointer-events: none;
}
.messages .alert {
    pointer-events: auto; margin: 0; font-weight: 500;
    background-color: var(--surface);                 /* nothing shows through */
    background-image: linear-gradient(var(--toast-tint, transparent),
                                      var(--toast-tint, transparent));
    box-shadow: var(--shadow-lift);
    animation: toast-in .18s var(--ease-out) both;
}
.messages .alert-success { --toast-tint: var(--ok-bg); }
.messages .alert-error   { --toast-tint: var(--err-bg); }
.messages .alert-info    { --toast-tint: var(--info-bg); }
.messages .alert-warning { --toast-tint: var(--attn-bg); }
.messages .alert.toast-out { animation: toast-out .35s var(--ease) both; }
@keyframes toast-in  { from { transform: translateY(8px); }  }
@keyframes toast-out { to   { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
    .messages .alert, .messages .alert.toast-out { animation: none; }
}

/* ---------- Offer detail: header actions ---------- */

/* Части на един документ (един PDF = няколко кампании) */
.doc-parts {
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
    margin-top: 0.875rem; padding-top: 0.75rem; border-top: 1px dashed var(--border);
    font-size: .84rem;
}
/* These referenced --fg and --accent, which never existed — so the text fell
   back to inherit and the accents were a hardcoded blue from another project. */
.doc-part {
    display: inline-block; padding: 0.3125rem 0.75rem; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface-2);
    color: var(--text); text-decoration: none;
}
a.doc-part:hover { border-color: var(--brand); }
.doc-part-on { border-color: var(--brand); color: var(--brand); font-weight: 600; }

/* ============================================================
   Фаза 1 — работният екран: четими редове, истински връзки,
   наш диалог за потвърждение, телефонът като първокласен.
   ============================================================ */

/* Visible only to screen readers — for headers that must exist but not show. */
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 1px); white-space: nowrap; border: 0;
}

/* ---------- A row that IS a link ----------
   Rows used to navigate with onclick: no keyboard, no middle-click, no „open in
   new tab". One real <a> per row now covers it, and stays a normal link. */
.emails-table tbody tr { position: relative; }
.row-link::after { content: ""; position: absolute; inset: 0; }
.row-link:hover { text-decoration: none; }
/* controls inside a row must stay above the row-wide link */
.emails-table td .btn, .emails-table td a:not(.row-link),
.emails-table td button, .emails-table td input, .emails-table td select {
    position: relative; z-index: 1;
}

/* ---------- Empty states: say what this is and what to do ---------- */
.empty-row td { padding: 0; }

/* No pill here: in this column a pill had room only for „Промо н…". The colored
   rail on the left carries the state, these words name it. */
.line-state { font-size: .84rem; color: var(--muted); white-space: nowrap; }

.inline-form { display: inline; }

.cls-reason {
    display: block; color: var(--muted); font-size: .74rem; max-width: 14.375rem;
    white-space: normal; line-height: 1.25; margin-top: 2px;
}
.cls-yes { font-weight: 600; }
.cls-no { color: var(--muted); }

/* A rail on a list row — the same mark as everywhere else, drawn with an inset
   shadow because a table row cannot carry a pseudo-element reliably. */
.emails-table tbody tr.row-attn { box-shadow: inset var(--rail) 0 0 var(--attn-fg); }
.emails-table tbody tr.row-err  { box-shadow: inset var(--rail) 0 0 var(--err-fg); }

/* ---------- Our confirmation dialog ----------
   Built from the same parts as a card — surface, border, radius, lifted shadow —
   and it wears the system's signature too: a rail on the left in the colour of
   what it asks. Amber for a normal decision, red when the action is destructive. */
.confirm {
    /* Centre it in the viewport ourselves. The browser centres a <dialog> with
       margin: auto, but that only holds while its position stays the UA default;
       giving it position:relative (which the rail once needed) knocked it
       off-centre. So the rail is drawn with an inset shadow instead — the same
       way order rows wear it — and the dialog is pinned to the middle. */
    position: fixed; inset: 0; margin: auto; height: fit-content;
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.375rem 1.5rem 1.375rem 1.625rem;
    background: var(--surface); color: var(--text);
    width: min(28.75rem, calc(100vw - 2rem));
    box-shadow: var(--shadow-lift), inset var(--rail) 0 0 var(--attn-fg);
}
.confirm.confirm-danger { box-shadow: var(--shadow-lift), inset var(--rail) 0 0 var(--err-fg); }
.confirm::backdrop {
    background: rgba(6, 12, 8, .55);
    backdrop-filter: blur(2px);
}
.confirm[open] { animation: confirm-in .16s var(--ease-out); }
@keyframes confirm-in { from { transform: translateY(8px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .confirm[open] { animation: none; } }
.confirm-title { margin: 0 0 0.5rem; font-size: 1.12rem; }
.confirm-text { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.55; }
.confirm-actions { display: flex; gap: 0.625rem; justify-content: flex-end; margin-top: 1.25rem; flex-wrap: wrap; }
/* PU-90: a broken Gmail link — the red bar at the top of every page while it lasts, and its modal (a confirm
   dialog in red) that names each box with its own „Свържи наново". */
.mail-link-bar {
    display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap;
    margin-bottom: var(--s4); padding: var(--s3) var(--s4);
    background: var(--err-bg); color: var(--err-fg);
    border: 1px solid var(--err-bd); border-radius: var(--radius-sm);
    box-shadow: inset var(--rail) 0 0 var(--err-fg); font-size: .95rem;
}
.mail-link-bar > svg { flex: none; }
.mail-link-bar-text { flex: 1 1 18rem; min-width: 0; overflow-wrap: anywhere; }
.mail-link-bar-text strong, .mail-link-bar-who { color: inherit; }
.mail-link-bar-who { font-weight: 600; }
.mail-link-dialog { width: min(34rem, calc(100vw - 2rem)); }
.mail-link-dialog .confirm-title { display: flex; align-items: center; gap: var(--s2); color: var(--err-fg); }
.mail-link-dialog .confirm-text + .confirm-text { margin-top: var(--s2); }
.mail-link-dialog .confirm-text strong { color: var(--text); overflow-wrap: anywhere; }
.mail-link-boxes { list-style: none; margin: var(--s4) 0 0; padding: 0; display: grid; gap: var(--s2); }
.mail-link-box {
    display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap;
    padding: var(--s2) var(--s3); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.mail-link-box-name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Guided tour (plan §8, PU-05, static/js/tour.js) ----------
   No literal backdrop element: the spotlight's own box-shadow both dims the
   rest of the page (a spread of 9999px) and rings the highlighted item — one
   box, one paint layer, always in sync with where the ring itself sits. A
   centred step shrinks it to a point in the middle: the spread still dims the
   whole page, and the ring goes.

   Motion: the spotlight and the bubble land on each item (PU-104: a glide of
   their top/left/width/height repainted the whole window every frame), the
   bubble fades and settles in, its content slides from the side the walk is
   heading to, the bar fills (a scaleX). All
   of it stops under prefers-reduced-motion — the steps simply land. */
#tour-overlay[hidden] { display: none; }
.tour-spotlight {
    position: fixed; z-index: 501; border-radius: var(--radius-sm);
    box-shadow: 0 0 0 9999px rgba(6, 12, 8, .6), 0 0 0 3px var(--brand);
    pointer-events: none; opacity: 0;
    /* the dim deepens when a step has no item (`is-center`): a paint-only fade, nothing moves */
    transition: opacity var(--dur-3) var(--ease), box-shadow var(--dur-3) var(--ease);
}
/* a soft pulse around the ringed item: „here" */
.tour-spotlight::after {
    content: ""; position: absolute; inset: -3px; border-radius: inherit;
    border: 2px solid var(--brand); opacity: 0;
    animation: tour-pulse 1.8s var(--ease-out) .5s infinite;
}
.tour-overlay.is-center .tour-spotlight { box-shadow: 0 0 0 9999px rgba(6, 12, 8, .68); }
.tour-overlay.is-center .tour-spotlight::after { display: none; }
@keyframes tour-pulse {
    0% { opacity: .9; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.35); }
}
.tour-bubble {
    position: fixed; z-index: 502; width: min(21.5rem, calc(100vw - 1.75rem));
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-lift);
    padding: 0 1.25rem 0.875rem; overflow: hidden;
    opacity: 0; transform: translateY(6px) scale(.97);
    transition: opacity var(--dur-3) var(--ease), transform var(--dur-3) var(--ease-out);
}
.tour-bubble.tour-bubble-wide { width: min(27.5rem, calc(100vw - 1.75rem)); }
.tour-overlay.is-open .tour-spotlight, .tour-overlay.is-open .tour-bubble { opacity: 1; }
/* PX-267 (the owner's „а“): the bubble enters whole — its shown state settles (a transform) but does not fade in; it
   still fades out (the hidden state's transition). PU-104: it lands on each item at once, nothing glides between them */
.tour-overlay.is-open .tour-bubble { transform: none;
    transition: transform var(--dur-3) var(--ease-out); }
.tour-bubble:focus { outline: none; }
.tour-bar { height: 3px; margin: 0 -1.25rem 0.875rem; background: var(--surface-2); }
.tour-bar-fill {
    display: block; height: 100%; width: 100%; background: var(--brand); transform-origin: left;
    transform: scaleX(var(--tour-progress, 0)); transition: transform var(--dur-3) var(--ease-out);
}
.tour-bubble-inner.is-entering { animation: tour-step-in .38s var(--ease-out) both; }
.tour-bubble-inner.is-entering[data-dir="back"] { animation-name: tour-step-back; }
@keyframes tour-step-in { from { transform: translateX(14px); } }
@keyframes tour-step-back { from { transform: translateX(-14px); } }

.tour-bubble-progress { font-size: .76rem; font-weight: 600; letter-spacing: .02em; color: var(--muted); }

.tour-bubble-title { margin: 0 0 0.375rem; font-size: 1.08rem; }
.tour-overlay.is-center .tour-bubble-title { font-size: 1.25rem; }
.tour-bubble-body { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.55; }
.tour-bubble-actions { display: flex; justify-content: flex-end; margin-top: 1.125rem; }
.tour-bubble-actions .btn { min-width: 6.5rem; justify-content: center; }

/* The pictures of the centred steps. Each part arrives a beat after the last. */
.tour-visual { margin: 0.25rem 0 1rem; }
.tour-visual[hidden] { display: none; }

@keyframes tv-pop { from { visibility: hidden; transform: translateY(6px) scale(.85); } }
@keyframes tv-grow { from { transform: scaleX(0); } }

@keyframes tv-slide { from { visibility: hidden; transform: translateX(-10px); } }

@keyframes tv-press { 0%, 70%, 100% { transform: none; } 80% { transform: translateY(2px); box-shadow: none; } }

@media (prefers-reduced-motion: reduce) {
    .tour-spotlight, .tour-bubble, .tour-bar-fill { transition: none; }
    .tour-spotlight::after { animation: none; display: none; }
    .tour-bubble-inner.is-entering { animation: none; }

}

/* ---------- Keyboard shortcuts (PU-05, static/js/shortcuts.js) ----------
   One look for a key wherever it is named: the dialog, „Как работи", and the tour. */
.keys kbd, kbd.keys-inline {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 1.875rem; height: 1.875rem; padding: 0 0.5rem; box-sizing: border-box;
    font: 600 .82rem/1 var(--font-ui); letter-spacing: 0;
    color: var(--text);
    background: color-mix(in srgb, var(--text) 7%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--text) 20%, transparent);
    border-bottom-width: 3px; border-radius: 0.4375rem;
}
kbd.keys-inline { min-width: 1.5rem; height: 1.5rem; font-size: .76rem; border-bottom-width: 2px; vertical-align: middle; }
/* ---------- The account card (PU-05) ----------
   Who is signed in — a gradient monogram, the name, the role as quiet text (the theme,
   the shortcut list and leaving are the top bar's, PU-280). */
.side-account {
    display: flex; flex-direction: column; gap: 0.5rem;
    padding: 0.625rem; border: 1px solid var(--border); border-radius: var(--radius);
    background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 7%, var(--surface-2)), var(--surface-2));
}
.side-account .userchip {
    flex: 1 1 auto; min-width: 0; justify-content: flex-start; gap: 0.5rem; padding: 0.125rem;
    background: transparent; border: 0; border-radius: var(--radius-sm);
}
.side-account a.userchip:hover { background: transparent; }
.side-account a.userchip:hover .uname, .side-account a.userchip.active .uname { color: var(--brand); }
.userchip-avatar {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    width: 2rem; height: 2rem; border-radius: 0.625rem;
    background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 45%, var(--info-fg)));
    color: var(--on-brand); font-weight: 700; font-size: .95rem; letter-spacing: .02em;
    box-shadow: 0 4px 12px -6px color-mix(in srgb, var(--brand) 80%, transparent);
}
/* The name and the role never leave the card (PU-36): the text column takes the free width and may
   shrink below its words; a long name ends in an ellipsis (its title carries it whole), the role wraps.
   The role wraps between its words, never inside one (PU-49): „администратор" fits the column even
   beside the settings cog (the owner working in an organization), and breaks only if it cannot. */
.side-account .userchip-meta { flex: 1 1 auto; min-width: 0; gap: 0.0625rem; }
.side-account .uname { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color var(--dur-2) var(--ease); }
.side-account .urole, .sidebar .side-account .urole {
    padding: 0; background: none; border-radius: 0; font-size: .7rem; color: var(--muted);
    white-space: normal; overflow-wrap: break-word; line-height: 1.25;
}
.side-account .urole.role-admin, .sidebar .side-account .urole.role-superadmin { color: var(--brand); }
/* PU-192: the role is one line — the cog rides the name's line at the right, so the role takes the card's whole width */
.side-account .userchip { position: relative; }
.side-account .userchip:has(.userchip-go) .uname { padding-right: 1.375rem; }
.side-account .userchip-go { position: absolute; top: .25rem; right: .125rem; }
.side-account .urole, .sidebar .side-account .urole { white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-size: .66rem; letter-spacing: -.01em; }

/* PU-180 (the owner, 2026-10-22: „при затваряне това не ми харесва"): folded, the card goes — the top bar's avatar
   stands for it; on a phone, where the menu is a row, too */
.nav-folded .side-account { display: none; }
@media (max-width: 820px) { .side-account { display: none; } }

.keys-dialog {
    position: fixed; inset: 0; margin: auto; height: fit-content; max-height: calc(100vh - 2.5rem);
    width: min(58rem, calc(100vw - 2rem)); padding: 0;
    display: none; flex-direction: column; overflow: hidden;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); color: var(--text);
    box-shadow: var(--shadow-lift);
}
.keys-dialog[open] { display: flex; animation: keys-in .22s var(--ease-out); }
.keys-dialog::backdrop { background: rgba(6, 12, 8, .55); backdrop-filter: blur(2px); animation: keys-fade .2s var(--ease); }
@keyframes keys-in { from { transform: translateY(10px) scale(.98); } }
@keyframes keys-fade { from { opacity: 0; } }
.keys-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
    padding: 1.25rem 1.5rem 0.875rem; border-bottom: 1px solid var(--border);
}
.keys-title { margin: 0 0 0.25rem; font-size: 1.2rem; }
.keys-sub { margin: 0; color: var(--muted); font-size: .88rem; }
.keys-close {
    display: inline-flex; padding: 0.375rem; border: 1px solid transparent; border-radius: var(--radius-sm);
    background: transparent; color: var(--muted); cursor: pointer;
}
.keys-close:hover { color: var(--text); border-color: var(--border); }
.keys-tour {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    margin: 1rem 1.5rem 0; padding: 0.875rem 1rem; border-radius: var(--radius-sm);
    background: var(--brand-soft); border: 1px solid var(--ok-bd);
}
.keys-tour-text { display: flex; flex-direction: column; gap: 0.125rem; font-size: .9rem; }
.keys-tour-text span { color: var(--muted); font-size: .84rem; }
.keys-body { overflow-y: auto; padding: 0.25rem 1.5rem 1.5rem; }
.keys-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); gap: 0.25rem 3rem; align-items: start; }
.keys-group { margin-top: 1.125rem; }
.keys-group-title {
    margin: 0 0 0.25rem; font-size: .8rem; font-weight: 700; letter-spacing: .04em;
    text-transform: uppercase; color: var(--muted);
}
.keys-note { margin: 0 0 0.375rem; font-size: .8rem; color: var(--muted); }
.keys-list { margin: 0; }
.keys-row {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 0.625rem 0; border-bottom: 1px solid var(--border);
}
.keys-row:last-child { border-bottom: none; }
.keys-combo {
    order: 2; flex: 0 0 auto; display: flex; flex-wrap: nowrap; align-items: center;
    justify-content: flex-end; gap: 0.3125rem; margin: 0;
}
.keys-sep { font-size: .74rem; color: var(--muted); }
.keys-what { order: 1; min-width: 0; margin: 0; display: flex; flex-direction: column; gap: 0.125rem; font-size: .9rem; }
.keys-what span { color: var(--muted); font-size: .84rem; line-height: 1.4; }
.keys-card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.keys-card-head .section-h { margin-bottom: 0.25rem; }
#klavishi .keys-groups { margin-top: -0.25rem; }

@media (prefers-reduced-motion: reduce) {
    .keys-dialog[open], .keys-dialog::backdrop { animation: none; }
}
@media (max-width: 600px) {
    .keys-row { flex-wrap: wrap; gap: 0.375rem; }
    .keys-head, .keys-body { padding-left: 1rem; padding-right: 1rem; }
    .keys-tour { margin-left: 1rem; margin-right: 1rem; }
}

/* ---------- Phone: a list is a stack of cards, not a squeezed table ----------
   Eight columns never fit 380px. Each row becomes a card whose cells carry their
   own label, so nothing is hidden and nothing overflows. */
@media (max-width: 600px) {
    .list-table thead { display: none; }
    .list-table, .list-table tbody, .list-table tr, .list-table td { display: block; width: 100%; }
    .list-table tr {
        padding: 0.75rem 0.875rem; border-bottom: 1px solid var(--border);
    }
    .list-table tbody tr:last-child { border-bottom: none; }
    .list-table td {
        display: flex; align-items: baseline; justify-content: space-between; gap: 0.875rem;
        padding: 0.25rem 0; border: none; text-align: left;
        /* PU-110: a long word (an organization's name, a username) breaks inside its card
           instead of pushing the page sideways */
        min-width: 0; overflow-wrap: anywhere;
    }
    .list-table td::before {
        content: attr(data-label); color: var(--muted); font-size: .78rem;
        flex: 0 0 auto; text-transform: uppercase; letter-spacing: .03em;
    }
    .list-table td.subj, .list-table td.from { max-width: none; white-space: normal; }
    .list-table .row-link { font-weight: 600; }
    .list-table .cls-reason { max-width: none; text-align: right; }
    .list-table .empty-row td { display: block; padding: 0; }
    .list-table .empty-row td::before { content: none; }

    /* Thumbs, not cursors — 44px in pixels, for the same reason as above. */
    .btn, .tab, .page-num { min-height: 44px; }
    .btn { padding-top: 0.6875rem; padding-bottom: 0.6875rem; }
    .tab { display: inline-flex; align-items: center; }
    .content { --content-gutter: 0.875rem; padding: 1rem 0.875rem; }
    .card { padding: 1rem; }
    .page-title { font-size: 1.45rem; }
}

/* ============================================================
   Фаза 2 — визуалният език: типография, икони, жичка, форми.
   ============================================================ */

/* ---------- Type scale ----------
   The one place a heading's size is decided. Titles came down a step (1.85 →
   1.55): at the old size „Табло" was the largest thing on a screen whose whole
   point is the numbers under it, and a page title is a label, not a headline —
   you read it once to know where you are and never again. */
.page-title { font-size: 1.55rem; line-height: 1.2; }
.section-h { font-size: 1.05rem; }
/* Figures line up in columns wherever they are compared. */
.num,
.tab-n,
.emails-table td { font-variant-numeric: tabular-nums; }

/* ---------- Icons sitting in a line of text ---------- */
.note-line {
    display: flex; align-items: flex-start; gap: var(--s2);
    margin: var(--s4) 0 0;
}
.note-line + .note-line { margin-top: var(--s3); }
.note-line .ico { margin-top: .22em; }
.alert .ico { vertical-align: -.2em; margin-right: 2px; }

/* ---------- Colour used as data, never as decoration ---------- */
.c-brand { background: var(--brand); }
.is-missing { color: var(--err-fg); font-weight: 600; }

/* ---------- Rails on the things that already had them ---------- */
.progress-card { border-left: var(--rail) solid var(--brand); }
.rule-card { border-left-width: var(--rail); }

/* ---------- Forms: nothing in English, nothing unstyled ---------- */
input[type=text], input[type=password], input[type=search], input[type=number],
input[type=date], input[type=time], input[type=email], textarea, select {
    font-family: inherit; font-size: .95rem; color: var(--text);
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 0.5625rem 0.75rem;
}
input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }

/* A date field showed „mm/dd/yyyy" — an American format in a Bulgarian screen.
   The hint below every date field says the order in our own words; the picker
   itself follows the browser's locale and cannot be relabelled. */

input[type=date], input[type=time] { min-height: 2.375rem; }

/* „Choose File / No file chosen" is the browser's English. The real input is
   hidden behind a label that is ours, and the chosen name is written beside it. */
.file-field { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.file-field input[type=file] {
    position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none;
}
.file-field .btn { cursor: pointer; }
.file-name { color: var(--muted); font-size: .9rem; }

/* Native checkboxes ignore the dark theme on Windows; these follow it. */
input[type=checkbox] {
    appearance: none; -webkit-appearance: none;
    width: 1.1875rem; height: 1.1875rem; flex-shrink: 0; margin: 0;
    border: 1px solid var(--border-strong); border-radius: 0.3125rem;
    background: var(--surface-2); cursor: pointer; position: relative;
}
input[type=checkbox]:checked { background: var(--brand); border-color: var(--brand); }
input[type=checkbox]:checked::after {
    content: ""; position: absolute; left: 0.375rem; top: 2px; width: 0.3125rem; height: 0.625rem;
    border: solid var(--on-brand); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
input[type=checkbox]:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- Lists read on two levels ----------
   The heaviest text used to be the least useful („Поръчка от Иван Примерен"
   twenty-five times). The meaning goes on the main line; the rest goes quiet. */
.emails-table .subj a { font-weight: 600; }
.emails-table .from { color: var(--muted); }

/* ---------- Focus is always visible ---------- */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
.tab:focus-visible,
.navitem:focus-visible,
.row-link:focus-visible {
    outline: 2px solid var(--brand); outline-offset: 2px; border-radius: var(--radius-sm);
}
.row-link:focus-visible::after { outline: 2px solid var(--brand); outline-offset: -2px; }

/* ---------- Form layout ---------- */
.form-card { max-width: 40rem; }
.form-row { margin-bottom: var(--s4); }
.form-row > label { display: block; font-weight: 600; margin-bottom: var(--s2); font-size: .93rem; }
.form-row input[type=text], .form-row input[type=date], .form-row select { width: 100%; }
.form-cols { display: flex; gap: var(--s4); flex-wrap: wrap; }
.form-cols .form-row { flex: 1 1 170px; min-width: 0; }

.manual-fields { margin-bottom: 1.125rem; }
.manual-fields > summary { cursor: pointer; margin-bottom: var(--s4); }

/* The customer's reply is an email: it is always on white, whatever the app
   wears, because that is where it will be read. */
.reply-preview {
    width: 100%; height: 32.5rem; border: 1px solid var(--border);
    border-radius: var(--radius); background: #ffffff;
}
/* PU-368: the To and Subject the letter leaves with, above its frame */
.reply-letter-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .125rem .625rem;
    margin: 0 0 .5rem; font-size: .86rem; }
.reply-letter-head > div { display: contents; }
.reply-letter-head dt { color: var(--ow-text-2); }
.reply-letter-head dd { margin: 0; overflow-wrap: anywhere; }

/* ============================================================
   Фаза 3 — полир: отзивчивост, честно чакане, спокойни екрани.
   ============================================================ */

/* ---------- Motion: everything answers, nothing performs ----------
   Only transform and opacity are animated (the compositor handles those), and
   every property is named — never `transition: all`. */
.btn, .tab, .page-num, .navitem, .filter-dd > summary {
    transition: background-color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease),
                color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.btn:active,
.tab:active,
.page-num:active,
.file-field .btn:active {
    transform: translateY(1px);
}

/* One place decides how much motion the interface is allowed. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
    .brz-spin { animation: none; }

    /* page flips (view transitions) are pseudo-elements the universal selector does not reach */
    ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ---------- A theme switch recolours the page at once (PU-104) ----------
   While frame.js holds this class, nothing transitions: the colour fades of buttons, tabs and menu
   items would otherwise trail the backgrounds that have none. */
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after { transition: none !important; }
/* An element HTMX is replacing dims instead of jumping — but ONLY when a person
   asked for it. The dashboard polls every few seconds; dimming that would make
   the whole page pulse on its own. */
.htmx-request:not([hx-trigger*="every"]) { opacity: .62; transition: opacity var(--dur-2) var(--ease); }

/* ---------- „Как работи" ---------- */

/* Последната колона с действие — подравнена вдясно. Класът се ползваше
   от два екрана и просто го нямаше в стиловете. */
.emails-table td.right, .emails-table th.right { text-align: right; }
/* The catalogue is opened to check a price, so the price is what the eye
   should land on — the points step back to being a supporting number. */
.price-cell { color: var(--text); font-weight: 600; }

/* ---------- An error names the problem AND the way out ---------- */
.alert-next { margin-top: var(--s2); font-size: .9rem; opacity: .92; }
.alert-next a { color: inherit; text-decoration: underline; }
.spaced-below { margin-bottom: var(--s4); }
.progress-phase { font-size: .88rem; }
.progress-side {
    margin-left: auto; display: flex; gap: var(--s4);
    font-size: .9rem; align-items: center; flex-wrap: wrap;
}

/* ---------- Setup windows ----------
   Before an account is set up there is no menu, so these pages carry their own
   frame: the mark on top, one card, and the way out underneath. Wider than the
   login card — the later steps hold lists and progress, not two fields. */
body.setup .content { max-width: 38.75rem; padding-top: 7vh; }

.setup-mark {
    display: flex; align-items: center; justify-content: center; gap: var(--s2);
    font-weight: 700; font-size: 1.1rem; color: var(--muted);
}

@keyframes setup-card-in { from { transform: translateY(6px); } }
/* No component-level reduced-motion override needed: the global rule
   ("One place decides how much motion is allowed") already zeroes this. */

/* The opening sentence is the message, not a caption — full strength. */
.setup-lede { margin: 0 0 var(--s4); line-height: 1.6; font-size: 1.02rem; }
.setup-lede:last-of-type { margin-bottom: var(--s5); }

/* Live checklist next to a password field (static/js/password_ux.js) — an
   unmet rule reads as a quiet X; met, it switches to a green check without
   the row ever changing size (both icons occupy the same slot, plan §1). */
.pw-requirements { list-style: none; margin: var(--s2) 0 0; padding: 0;
    display: flex; flex-direction: column; gap: 0.25rem; }
.pw-requirements li {
    display: flex; align-items: center; gap: var(--s2);
    font-size: .86rem; color: var(--muted);
    transition: color var(--dur-2) var(--ease);
}
.pw-rule-icon { position: relative; display: inline-flex; width: 0.875rem; height: 0.875rem;
    color: var(--err-fg); flex-shrink: 0; }
.pw-rule-icon svg { position: absolute; inset: 0; transition: opacity var(--dur-2) var(--ease); }
.pw-rule-icon svg:last-child { opacity: 0; }
li.pw-rule-ok { color: var(--ok-fg); }
li.pw-rule-ok .pw-rule-icon { color: var(--ok-fg); }
li.pw-rule-ok .pw-rule-icon svg:first-child { opacity: 0; }
li.pw-rule-ok .pw-rule-icon svg:last-child { opacity: 1; }
.pw-requirements-note { margin: var(--s2) 0 0; font-size: .78rem; }

/* Show/hide eye on every password field, everywhere (static/js/password_ux.js
   wraps each input[type=password] with this at runtime — plan §2). */
/* The wrap replaces the bare input as whatever flex/stretch context it sat
   in (login card, setup form, profile's column-flex label) — width: 100%
   here keeps the input filling that box exactly as it did unwrapped. */
.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap input[type=password], .pw-wrap input[type=text] { width: 100%; padding-right: 38px; }
.pw-eye {
    position: absolute; right: 3px; top: 50%; transform: translateY(-50%);
    display: flex; align-items: center; justify-content: center;
    width: 1.875rem; height: 1.875rem; padding: 0; border: none; background: transparent;
    color: var(--muted); cursor: pointer; border-radius: var(--radius-sm);
    transition: color var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}
.pw-eye:hover { color: var(--text); background: var(--surface-2); }
.pw-eye:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.pw-eye.pw-eye-open::after {
    content: ""; position: absolute; top: 50%; left: 50%;
    width: 1.1875rem; height: 1.5px; background: currentColor;
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* Leaving is always possible, but it is not the thing to do — quiet, not hidden. */
.setup-exit { text-align: center; }
/* the word stays even on a machine where the menu was folded (html.nav-folded hides .nav-word) */
.nav-folded .setup-exit .nav-word, .setup-exit .nav-word { display: inline; }

/* Setup footer nav (owner feedback 27.07) — „← Назад" bottom-left, „Пропусни
   за сега" bottom-right, both quiet and never competing with the step's own
   primary action above them. One click each — no confirmation dialog, to
   keep the whole flow light rather than bureaucratic. */

.setup-back-btn { color: var(--muted); font-size: .86rem; text-decoration: none; }
.setup-back-btn:hover { color: var(--text); text-decoration: underline; }

/* ---------- Запитвания от сайта ----------
   Дотук единственият екран със свой <style> блок вътре в шаблона; всичко
   останало живее тук, и това е мястото, където се търси. */

/* An unanswered message gets the „чака те“ rail, the same signal the order
   queues use — the colour means one thing across the whole app. */

.badge-attn {
    font-size: .74rem; font-weight: 600; padding: 0.1875rem 0.5625rem; border-radius: 999px;
    background: var(--attn-bg); color: var(--attn-fg);
}
/* Brochure read: a small spinner for the „обработва се" state (offers screen). */
@keyframes brz-spin { to { transform: rotate(360deg); } }
.brz-spin { display: inline-block; width: 0.75rem; height: 0.75rem; vertical-align: -1px;
    border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%;
    animation: brz-spin .8s linear infinite; }

/* Semantic chips for the offer screens — theme-aware (light + dark). */
.chip-ok   { background: var(--ok-bg);   color: var(--ok-fg);   border-color: var(--ok-bd); }
.chip-err  { background: var(--err-bg);  color: var(--err-fg);  border-color: var(--err-bd); }
.chip-attn { background: var(--attn-bg); color: var(--attn-fg); border-color: var(--attn-bd); }
.chip-info { background: var(--info-bg); color: var(--info-fg); border-color: var(--info-bd); }
.chip-gift { background: var(--sandbox-bg); color: var(--sandbox-fg); border-color: var(--sandbox-bd); }

/* Offer detail: fullscreen gallery overlay + a flash on the searched product. */
#brz-lightbox { position: fixed; inset: 0; z-index: 1000; display: none;
    align-items: center; justify-content: center; background: rgba(0,0,0,.85); padding: 2vh 3vw; }
#brz-lightbox .lb-img { max-width: 92vw; max-height: 92vh; object-fit: contain;
    border-radius: 0.375rem; box-shadow: 0 10px 40px rgba(0,0,0,.6); cursor: zoom-in; }
/* Click the image to zoom to actual size; the overlay then scrolls. */
#brz-lightbox.lb-zoom { align-items: flex-start; justify-content: flex-start; overflow: auto; }
/* margin: auto centres the actual-size page in the viewport when it is smaller than
   the screen (the common case — otherwise it sat pinned to the top-left with empty
   space to the right), while still allowing scroll to every edge when it is larger. */
#brz-lightbox.lb-zoom .lb-img { max-width: none; max-height: none; cursor: zoom-out; }
/* The image and the page's numbers in one sheet (PU-188): the pins stand in % of it, so they follow the image at both
   sizes; the sheet takes the centring the image had. */
#brz-lightbox .lb-sheet { position: relative; display: inline-block; flex: none; line-height: 0; }
#brz-lightbox .lb-sheet .lb-img { display: block; }
#brz-lightbox.lb-zoom .lb-sheet { margin: auto; }
#brz-lightbox .lb-btn { position: absolute; background: rgba(255,255,255,.12); color: var(--on-overlay);
    border: none; border-radius: 0.5rem; cursor: pointer; font-size: 2rem; line-height: 1;
    width: 3.375rem; height: 3.375rem; display: flex; align-items: center; justify-content: center; }
#brz-lightbox .lb-btn:hover { background: rgba(255,255,255,.25); }
#brz-lightbox .lb-close { top: 1rem; right: 1.25rem; width: 44px; height: 44px; font-size: 1.6rem; }
#brz-lightbox .lb-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
#brz-lightbox .lb-next { right: 1rem; top: 50%; transform: translateY(-50%); }
#brz-lightbox .lb-cap { position: absolute; bottom: 0.875rem; left: 0; right: 0; text-align: center;
    color: var(--on-overlay); font-size: .9rem; opacity: .8; }
/* A brief highlight on a just-saved/reset row. BOTH the background and the left
   edge fade out via the animation and revert to nothing afterwards — the class may
   stay on the server-rendered row, but it leaves no lasting marker. */
@keyframes brz-flash-kf { 0% { background: var(--attn-bg); } 100% { background: transparent; } }
@keyframes brz-flash-edge-kf { 0% { box-shadow: inset var(--rail) 0 0 var(--attn-fg); } 100% { box-shadow: inset var(--rail) 0 0 transparent; } }

/* ============================================================
   „Modernized" offers look — reusable pieces per the mockups.
   ============================================================ */

/* Uppercase lifecycle badge. */
.brz-state { display: inline-block; padding: 3px 0.5625rem; border-radius: 0.375rem; font-size: .66rem;
    font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.brz-state.draft  { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.brz-state.review { background: var(--err-bg); color: var(--err-fg); border: 1px solid var(--err-bd); }
.brz-state.ready  { background: var(--attn-bg); color: var(--attn-fg); border: 1px solid var(--attn-bd); }
.brz-state.active { background: var(--ok-bg); color: var(--ok-fg); border: 1px solid var(--ok-bd); }

/* Offer detail: product window — a real overlay in front of everything. */
.brz-modal-bg { position: fixed; inset: 0; z-index: 1100; display: flex;
    align-items: flex-start; justify-content: center; overflow-y: auto;
    background: rgba(0,0,0,.5); padding: 6vh 4vw; }
.brz-modal { position: relative; width: 100%; max-width: 38.75rem; margin: auto;
    background: var(--surface); color: var(--text); border: 1px solid var(--border);
    border-radius: 0.875rem; box-shadow: var(--shadow-lift, 0 20px 60px rgba(0,0,0,.35));
    padding: 1.25rem 1.375rem; }
.brz-modal-x { position: absolute; top: 0.625rem; right: 0.75rem; width: 2rem; height: 2rem;
    border: 1px solid var(--border); border-radius: 0.5rem; background: var(--surface);
    color: var(--text); cursor: pointer; font-size: 1.2rem; line-height: 1; }
.brz-modal-x:hover { background: var(--brand-soft); }

/* ================================================================
   Оферти — преработените екрани (дизайн v20).
   „of-" принадлежи само на екраните за офертите; нищо извън тях не
   се променя. Състоянието пак живее на левия ръб (--rail), както
   навсякъде другаде в приложението.
   ================================================================ */
.of-head { display: flex; justify-content: space-between; align-items: flex-start;
    gap: 1rem; flex-wrap: wrap; margin-bottom: .875rem; }
.of-head h1 { margin: 0; }
.of-head .sub { color: var(--muted); margin: .125rem 0 0; font-size: .9rem; }
.of-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap;
    margin-left: auto; }

/* Табовете са периодът на офертата; броячът пътува със заглавието. */
.of-tabs { display: flex; gap: 1.75rem; align-items: flex-end;
    border-bottom: 1px solid var(--border); margin-bottom: 1.125rem; }
.of-tab { display: inline-flex; align-items: center; gap: .5rem;
    padding: .5rem .125rem .625rem; margin-bottom: -1px; font-size: .95rem;
    color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; }
.of-tab:hover { color: var(--text); }
.of-tab.on { color: var(--brand-strong); border-bottom-color: var(--brand); font-weight: 600; }
.of-tab .cnt { font-variant-numeric: tabular-nums; opacity: .8; }
/* A disabled button must look it: there was no rule, so a held-back „Одобри и пусни" still
   glowed like an invitation (POF-03). App-wide, for every .btn. */
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; filter: saturate(.4); }
.of-approve-why { font-size: .78rem; flex-basis: 100%; text-align: right; }
/* POF-05: how a row's numbers are known */
.of-proof {
  font-size: 0.66rem;
  line-height: 1.2;
  margin-top: 0.125rem;
  color: var(--muted);
  white-space: nowrap;
}
.of-proof-proven {
  color: var(--ok-fg);
}
.of-proof-unproven {
  color: var(--err-fg);
  font-weight: 600;
}
.of-proof-count {
  font-weight: 600;
}
/* the rows the intake accepted, folded from the owner's review (POF-12) */
.of-intake-folded {
  margin: 0.625rem 0.125rem;
}
.of-proof-count-open {
  color: var(--err-fg);
}
/* the count's colour means something: an error only while a note blocks (POF-03) */
.of-tab .cnt.cnt-err { color: var(--err-fg); font-weight: 700; opacity: 1; }
.of-tab .cnt.cnt-attn { color: var(--attn-fg); font-weight: 600; opacity: 1; }
.of-hd .of-state { font-size: .72rem; margin-right: .375rem; vertical-align: middle; }
/* a regular price the offer did not print: the catalogue's, and it says so */
.of-from-cat { color: var(--muted); }
.of-from-cat small { font-size: .68rem; }

.of-filters { display: flex; gap: .625rem; align-items: center; flex-wrap: wrap;
    margin-bottom: 1rem; }
/* Търсачката е ЕДНО поле с икона вътре — иконата и полето са в общ flex ред,
   вместо иконата да плава над него: така нищо не се застъпва при друг размер
   на шрифта или по-дълъг надпис. */
.of-search { display: flex; align-items: center; gap: .625rem;
    flex: 1 1 18rem; max-width: 30rem; padding: 0 .875rem;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); }
.of-search:focus-within { border-color: var(--brand);
    outline: 2px solid var(--brand); outline-offset: 1px; }
.of-search .ico { color: var(--muted); flex: none; display: flex; }
.of-search input { flex: 1 1 auto; min-width: 0; width: 100%; padding: .5rem 0;
    border: none; background: none; color: var(--text); font-size: .9rem; }
.of-search input:focus-visible { outline: none; }

.of-table { width: 100%; border-collapse: collapse; }
.of-table thead th { text-align: left; font-weight: 500; font-size: .85rem;
    color: var(--muted); background: var(--surface-2); padding: .75rem 1rem;
    border-bottom: 1px solid var(--border); }
.of-table tbody td { padding: .875rem 1rem; border-bottom: 1px solid var(--border);
    vertical-align: middle; }
.of-table tbody tr:last-child td { border-bottom: none; }
.of-table tbody tr:hover { background: var(--surface-2); }
.of-table tbody tr.attn { box-shadow: inset var(--rail) 0 0 var(--attn-fg); }
.of-table tbody tr.crit { box-shadow: inset var(--rail) 0 0 var(--err-fg); }

.of-name { display: flex; gap: .75rem; align-items: center; }
.of-name .ico { color: var(--muted); flex: none; }
/* „Нова" beside the title: an offer that needs the owner (or, POF-13's hook, went into force without her), not opened yet (POF-29). */
.of-name .status-badge { margin-left: .375rem; vertical-align: .1em; }
.of-title { font-weight: 600; color: var(--text); text-decoration: none; }
.of-title:hover { color: var(--brand-strong); }
.of-sub { color: var(--muted); font-size: .8rem; margin-top: .0625rem; }
.of-note { color: var(--attn-fg); font-size: .85rem; margin-top: .125rem; }
.of-note.err { color: var(--err-fg); }
.of-reread { margin-top: .375rem; } /* „Разчети отново" under a failed or interrupted read (PX-173) */
.of-go { display: inline-flex; align-items: center; gap: .375rem; white-space: nowrap;
    color: var(--muted); text-decoration: none; font-size: .9rem; }
.of-table tbody tr:hover .of-go, .of-go:hover { color: var(--brand-strong); }
/* An offer being read (PU-38): found and shown, not opened until the read is done. */
.of-table tbody tr.of-locked:hover, .of-table tbody tr.of-unreleased:hover { background: transparent; }
/* an offer not released yet, to anyone but the owner (PU-100): there, quiet, nothing to open */
.of-unreleased .of-title { color: var(--muted); cursor: default; }
.of-locked .of-title, .of-locked .of-go,
.of-table tbody tr.of-locked:hover .of-go { color: var(--muted); cursor: not-allowed; }
.of-locked .of-go { opacity: .55; }

/* --- Оферта: работният екран (снимка вляво, продукти вдясно) --- */
.of-crumb { display: inline-flex; align-items: center; gap: .375rem; color: var(--muted);
    text-decoration: none; font-size: .85rem; }
.of-crumb:hover { color: var(--brand-strong); }
.of-offer-head { margin: .25rem 0 .75rem; }
.of-note.attn { color: var(--attn-fg); }
.of-doc-modal { max-width: min(64rem, 92vw); }
/* auto-FIT, not auto-fill: a one-page price list is a dense table, and it has to
   take the whole width to be readable rather than sit in a narrow first column. */
.of-doc-pages { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
    gap: .625rem; max-height: 66vh; overflow: auto; padding-right: .125rem; }
.of-doc-pages figure { margin: 0; }
/* A real box before the bytes arrive: gives lazy loading something to measure
   and keeps the modal from resizing under the reader as pages come in. */
.of-doc-pages img { width: 100%; height: auto; display: block; border-radius: .375rem;
    min-height: 12rem; border: 1px solid var(--border); background: var(--surface); }
.of-doc-pages figcaption { font-size: .72rem; margin-top: .2rem; text-align: center; }
.of-head-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.of-offer-head h1 { margin: 0; font-size: 1.4rem; letter-spacing: -.01em; }
.of-offer-head .meta { color: var(--muted); font-size: .85rem; margin-top: .125rem; }

.of-card { background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    display: flex; flex-direction: column; min-height: 0; min-width: 0; }

.of-check-ok { color: var(--ok-fg); display: inline-flex; }
.of-check-todo { color: var(--err-fg); font-size: .85rem; background: none; border: none;
    cursor: pointer; padding: 0; font-weight: 600; }
.of-check-todo:hover { text-decoration: underline; }

.of-footer { flex: none; display: flex; align-items: center; gap: .75rem;
    flex-wrap: wrap; padding: .75rem; border-top: 1px solid var(--border);
    background: var(--surface-2); }
.of-footer .left { display: inline-flex; align-items: center; gap: .5rem;
    font-size: .9rem; color: var(--muted); }
.of-footer .right { margin-left: auto; display: inline-flex; gap: .5rem; align-items: center; }

/* One product, one line: the name gives way (ellipsis), the numbers never wrap —
   a table that re-wraps per row is a table that cannot be scanned down a column. */
.of-table td .of-name-1 { display: block; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; max-width: 22rem; }
.of-table td.num, .of-table td.center { white-space: nowrap; }
.of-thumb img { width: 3.75rem; }

/* the note line in the offers list is the shortest way into the checks */
a.of-note { text-decoration: none; }
a.of-note:hover { text-decoration: underline; }

/* the list of notes stays a glance, so the decision keeps the room */

/* --- История: какво се е случило, ден по ден --- */
.of-hist tbody tr.of-day td { background: var(--surface-2); font-weight: 600;
    font-size: .82rem; color: var(--muted); padding-top: .5rem; padding-bottom: .5rem; }
.of-act { display: inline-flex; align-items: center; gap: .5rem; }
.of-act .ico { color: var(--muted); display: inline-flex; }
.of-act .ico.err { color: var(--err-fg); }
.of-change { display: inline-flex; align-items: center; gap: .25rem; margin-left: .375rem; }
.of-change s { opacity: .6; }
.of-end { text-align: center; padding: .75rem; font-size: .82rem; color: var(--muted);
    border-top: 1px solid var(--border); }

/* ============================================================
   Оферти — одит v21: телефон, фокус-режим, шаблони, достъпност.
   Използва наличните токени (--s*, --shadow-lift, --err-bg…) — нищо ново.
   ============================================================ */

/* Разгънатите кодове на шаблон стоят на СОБСТВЕН ред през цялата ширина —
   не сврени в първата колона, където имената се режеха, а редът се разкривяваше. */
.of-exp-toggle { display: inline-flex; align-items: center; gap: .25rem;
    margin-top: .125rem; padding: 0; border: none; background: none;
    color: var(--muted); font-size: .72rem; cursor: pointer; }
.of-exp-toggle:hover { color: var(--brand-strong); text-decoration: underline; }
.of-exp-toggle::before { content: "▸"; font-size: .62rem; }
.of-exp-toggle[aria-expanded="true"]::before { content: "▾"; }
.of-exp-row > td { background: var(--surface-2); padding: 0; }
.of-exp-row .expand-box { padding: var(--s2) var(--s3); }

/* Достъпност: редът-продукт е бутон — фокусът се вижда, Enter/Space отваря. */
.of-prod-row { cursor: pointer; }
.of-prod-row:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

/* История: ред за грешка — лек фон, а не само иконка, за да личи. */
.of-hist tbody tr.err-row td { background: var(--err-bg); }

/* Табовете не се събират на тесен екран → един плъзгащ се ред, вместо да
   прелеят и да скрият „История". */
@media (max-width: 700px) {
    .of-tabs { overflow-x: auto; flex-wrap: nowrap; gap: var(--s4);
        scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .of-tabs::-webkit-scrollbar { display: none; }
    .of-tab { white-space: nowrap; flex: none; }
}

/* Списъците като плочки на телефон (ползват общия .list-table) — скрий
   излишния етикет на името и повтарящото се действие (целият ред е връзка). */
@media (max-width: 600px) {
    .of-table.list-table td.act-cell { display: none; }
    .of-table.list-table td[data-label="Оферта"]::before,
    .of-table.list-table td[data-label="Продукт"]::before,
    .emails-table.list-table td[data-label="Продукт"]::before { content: none; }
    /* Дълга причина („разчитането се провали — …") се пренася под баджа,
       вместо да излиза от картата и да я прави с хоризонтален скрол. */
    .of-table.list-table td { flex-wrap: wrap; }
    .of-table.list-table td .of-note { white-space: normal; text-align: left; }
}

/* --- Нова оферта: мястото, където се пуска файлът --- */
.of-drop { display: flex; flex-direction: column; align-items: center; gap: .5rem;
    padding: 2.5rem 1rem; border: 2px dashed var(--border); border-radius: var(--radius);
    background: var(--surface-2); cursor: pointer; text-align: center; }
.of-drop:hover, .of-drop.over { border-color: var(--brand); background: var(--brand-soft); }
.of-drop .ico { color: var(--muted); }
.of-drop .big { font-weight: 600; }
.of-drop.has-file { border-style: solid; border-color: var(--ok-bd); background: var(--ok-bg); }
.of-drop .picked { font-weight: 600; color: var(--ok-fg); }
.of-choice { display: flex; align-items: flex-start; gap: .625rem; padding: .625rem .75rem;
    border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.of-choice:hover { border-color: var(--brand); }
.of-choice input { accent-color: var(--brand); margin-top: .2rem; }

/* The whole row opens the offer. Done with a real link stretched over the row —
   not a click handler — so the keyboard, the middle button and „отвори в нов таб"
   keep working. Anything else clickable in the row is lifted above it. */
.of-table tbody tr { position: relative; }
.of-row-link::after { content: ""; position: absolute; inset: 0; }
.of-table td a:not(.of-row-link), .of-table td button { position: relative; z-index: 1; }

/* ================================================================
   Оферта — работното място за сверка (PU-02).
   Два панела в една рамка: вляво страницата от брошурата — цялата, с
   номерирани маркери там, където е отпечатан всеки код; вдясно същите
   продукти със същите номера, подредени в колони. Избраният продукт
   свети върху страницата. Решението се взима в самия ред: въпросът на
   бележката и един бутон; полетата са зад „Поправи". Само токени.
   ================================================================ */
.rc-work { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start;
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
/* Breakpoints stay in px — a media query's rem is the INITIAL font size. */
@media (min-width: 1100px) {
    /* PU-119 (the owner: „частта за снимката е много голяма и продуктите не се виждат добре"): the products keep at
       least --rc-products-min — a row's number, name, price and state on one line — and the page takes the rest, at
       most 46 %. CSS alone, the same on every page: final at first paint, nothing measures or moves it. */
    .rc-work { --rc-products-min: 38rem;
        /* the page's own room at the column's height (the work area, its border, the 3.2rem toolbar, the stage's
           padding) for the offer's widest page (--rc-split-ar, from the server): a portrait offer gets no gutters, a
           landscape page is capped at 46 % — and none of it waits for a script */
        --rc-stage-h: calc(max(24rem, 100dvh - var(--rc-top, 11rem)) - 2px - 3.2rem - 2 * var(--s3));
        grid-template-columns: max(15rem, min(46%, calc(100% - var(--rc-products-min)),
            calc(var(--rc-stage-h) * var(--rc-split-ar, .7071) + 2 * var(--s3)))) minmax(0, 1fr);
        align-items: stretch; height: max(24rem, calc(100dvh - var(--rc-top, 11rem))); overflow: hidden; }
    .rc-page, .rc-side { min-height: 0; height: 100%; }
    .rc-side { border-left: 1px solid var(--border); }
}

/* --- the page ------------------------------------------------------------------ */
.rc-page { display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: var(--surface-2);
    border-radius: var(--radius) 0 0 var(--radius); }
/* a letter with no page yet (POF-22): nothing beside it, so it takes the whole workspace */
.rc-page-alone { grid-column: 1 / -1; border-radius: var(--radius); }
.rc-toolbar { flex: none; display: flex; align-items: center; gap: var(--s2); height: 3rem;
    padding: 0 var(--s3); border-bottom: 1px solid var(--border); background: var(--surface); min-width: 0; }
.rc-pager { flex: 1 1 auto; display: flex; align-items: center; gap: var(--s1); min-width: 0; }
.rc-step { color: var(--muted);   /* PU-91: a .btn.btn-ghost.btn-icon.btn-sm — the shape is the shared button's */
    transition: border-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease), transform var(--dur-1) var(--ease); }
.rc-step:hover { color: var(--text); }
.rc-step:active { transform: scale(.94); }
.rc-step[aria-disabled="true"] { opacity: .35; pointer-events: none; }
.rc-pagebtn { flex: none; height: 2rem; padding: 0 var(--s2); border: 0; border-radius: var(--radius-sm);
    background: none; color: var(--text); font: inherit; font-size: .88rem; cursor: pointer; white-space: nowrap;
    transition: background var(--dur-2) var(--ease); }
.rc-pagebtn b { font-weight: 700; font-variant-numeric: tabular-nums; }
.rc-pagebtn span { color: var(--muted); }
.rc-pagebtn:hover { background: var(--surface-3); }

/* The stage measures itself (container units), so the sheet is the page's own shape at the
   largest size that fits BOTH ways — the whole page, nothing scrolls, the pins stay on it. */
.rc-stage { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; container-type: size;
    display: grid; place-items: center; padding: var(--s3); overscroll-behavior: contain; }
.rc-sheet { position: relative; width: min(100cqw, 100cqh * var(--rc-ar, .7071)); aspect-ratio: var(--rc-ar, .7071); }
/* a click on the page opens it full screen, where it can be read at its actual size */
.rc-img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 2px;
    box-shadow: var(--shadow-lift); cursor: zoom-in; }
.rc-stage.is-loading .rc-img { opacity: .55; }
.rc-empty { margin: 0; padding: var(--s5); color: var(--muted); font-size: .88rem; text-align: center; }
/* an offer from a letter with no PDF (POF-22): the letter itself — its text and its images — where a page would be */
.rc-letter { align-self: stretch; justify-self: stretch; max-width: 46rem; width: 100%; margin: 0 auto; overflow: auto;
    padding: var(--s4); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lift); }
.rc-letter-k { margin: 0 0 var(--s3); color: var(--muted); font-size: .8rem; }
.rc-letter-from { margin: 0 0 .5rem; font-size: .82rem; color: var(--muted); }  /* PU-134: who sent the offer letter */
.rc-letter-text { font-size: .9rem; line-height: 1.5; overflow-wrap: anywhere; }
.rc-letter-img { display: block; max-width: 100%; height: auto; margin: var(--s3) 0 0; border-radius: 2px; }

/* the pins: the list's numbers, printed where each code is */
.rc-pins { position: absolute; inset: 0; pointer-events: none; }
.rc-pin { position: absolute; left: var(--x); top: calc(var(--y) + var(--h) / 2); z-index: 1;
    min-width: 1.25rem; height: 1.25rem; padding: 0 .3rem; border: 0; border-radius: 999px;
    background: var(--pin-ok); color: var(--ofx-on-orange); font: inherit; font-size: .68rem; font-weight: 700; line-height: 1.25rem;
    font-variant-numeric: tabular-nums; cursor: pointer; pointer-events: auto;
    box-shadow: 0 0 0 2px var(--surface), var(--shadow);
    transform: translate(calc(-100% - .2rem), -50%);
    transition: transform var(--dur-2) var(--ease-out), background var(--dur-2) var(--ease), opacity var(--dur-2) var(--ease); }
.rc-pin[data-state="crit"], .rc-pin[data-state="unknown"] { background: var(--pin-problem); }
.rc-pin:hover, .rc-pin.is-hot, .rc-pin.is-cur { z-index: 2; opacity: 1; background: var(--pin-cur); color: var(--pin-on-cur);
    transform: translate(calc(-100% - .2rem), -50%) scale(1.2); }
/* the open product, lit on the page: its code and the price label above it, the rest of the page
   a shade quieter */
.rc-spot { position: absolute; z-index: 1; left: calc(var(--x) - 1%); top: calc(var(--y) - 3.2%);
    width: calc(var(--w) + 2%); height: calc(var(--h) + 4.4%); border-radius: .375rem;
    outline: 2px solid var(--brand); outline-offset: 2px;
    box-shadow: 0 0 0 100vmax color-mix(in srgb, var(--surface-3) 45%, transparent);
    opacity: 0; transition: opacity var(--dur-2) var(--ease); }
.rc-sheet.has-spot .rc-spot { opacity: 1; }
/* the other places a code is printed (a duplicate): ringed with the lit one, dashed */
.rc-also { position: absolute; z-index: 1; left: calc(var(--x) - 1%); top: calc(var(--y) - 3.2%);
    width: calc(var(--w) + 2%); height: calc(var(--h) + 4.4%); border-radius: .375rem;
    outline: 3px dashed var(--brand); outline-offset: 2px; opacity: 0; pointer-events: none;
    background: color-mix(in srgb, var(--brand) 22%, transparent);
    transition: opacity var(--dur-2) var(--ease); }
.rc-sheet.has-spot .rc-also.is-on { opacity: 1; }

/* --- the work: the page's products --------------------------------------------------- */
.rc-side { display: flex; flex-direction: column; min-width: 0; background: var(--surface); }
.rc-side-head { flex: none; display: flex; align-items: flex-end; flex-wrap: wrap; gap: var(--s2) var(--s3);
    padding: var(--s4) var(--s5) var(--s3); }
.rc-side-t { flex: 1 1 12rem; min-width: 0; }
.rc-side-title { margin: 0; font-size: 1.3rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.2;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-side-sub { margin: .2rem 0 0; font-size: .8rem; color: var(--muted); }
.rc-tally { flex: none; display: flex; gap: 2px; }
.rc-chip { display: inline-flex; align-items: baseline; gap: .3rem; height: 1.875rem; padding: 0 .6rem;
    border: 0; border-radius: var(--radius-sm); background: none; color: var(--muted);
    font: inherit; font-size: .8rem; cursor: pointer; align-items: center;
    transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease); }
.rc-chip b { font-weight: 700; font-variant-numeric: tabular-nums; }
.rc-chip-todo b { color: var(--attn-fg); }
.rc-chip-ok b { color: var(--ok-fg); }
.rc-chip:hover { background: var(--surface-2); color: var(--text); }
.rc-chip[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }
/* a state tints the button through its own tokens, never a `background` (PU-91) — the shape stays the shared one */
.rc-search-btn[aria-expanded="true"] { color: var(--brand-strong); border-color: var(--brand); --btn-top: var(--brand-soft); --btn-bottom: var(--brand-soft); }
.rc-search { position: relative; flex: 1 1 100%; order: 5; animation: rc-drop .16s var(--ease-out); }
.rc-search input { width: 100%; height: 2.25rem; padding: 0 3rem 0 2.1rem;
    border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
    color: var(--text); font: inherit; font-size: .86rem;
    transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), background var(--dur-2) var(--ease); }
.rc-search input:focus { outline: none; border-color: var(--brand); background: var(--surface);
    box-shadow: 0 0 0 3px var(--brand-soft); }
.rc-search-ico { position: absolute; left: .7rem; top: 1.125rem; transform: translateY(-50%);
    color: var(--muted); display: inline-flex; pointer-events: none; }
.rc-search-key { position: absolute; right: .6rem; top: 1.125rem; transform: translateY(-50%); }
/* results lie OVER the list (a dropdown in the flow moved the list on every keystroke) */
.rc-search-anchor { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + .375rem); }
.rc-search-menu { max-height: 20rem; overflow-y: auto; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lift);
    animation: rc-drop .16s var(--ease-out); }
.rc-hit { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 var(--s2);
    padding: var(--s2) var(--s3); text-decoration: none; color: var(--text); border-bottom: 1px solid var(--border); }
.rc-hit:last-child { border-bottom: 0; }
.rc-hit:hover, .rc-hit:focus-visible { background: var(--brand-soft); outline: none; }
.rc-hit-name { font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-hit-meta { grid-column: 2; font-size: .72rem; color: var(--muted); }
.rc-hit-none { margin: 0; padding: var(--s3); font-size: .82rem; color: var(--muted); }

/* PU-112: the list's header has one height (--rc-cols-h); the list reserves it, and the gap above it, for every
   scroll into view — an opened row, a walk down the rows — so no row stops under the header */
.rc-scroll { --rc-cols-h: 3rem; flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 var(--s5) var(--s4); overscroll-behavior: contain;
    scroll-padding-top: calc(var(--rc-cols-h) + var(--s2)); }
.rc-side.is-loading .rc-scroll { opacity: .55; transition: opacity var(--dur-2) var(--ease) .12s; }

.rc-docs { margin: 0 0 var(--s3); padding: var(--s2) var(--s3);
    border: 1px solid var(--attn-bd); background: var(--attn-bg); border-radius: var(--radius-sm); font-size: .8rem; }
.rc-docs summary { cursor: pointer; font-weight: 600; }
.rc-doc { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; padding: .2rem 0; }
.rc-doc label { flex: 1 1 12rem; min-width: 0; display: flex; align-items: center; gap: var(--s1); }
.rc-docs-foot { display: flex; justify-content: flex-end; gap: var(--s2); margin-top: var(--s2); }

/* what belongs to the page itself: its promotions and its own notes */
.rc-pagectx { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s2); margin-bottom: var(--s2); }
.rc-pagectx.is-empty { display: none; }
.rc-pagectx > .rc-lbl { display: none; }
.rc-ctx-promo { display: flex; align-items: center; gap: var(--s3); min-width: 0; padding: .7rem var(--s3); font-size: .84rem;
    border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); text-decoration: none;
    transition: border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease); }
.rc-ctx-promo:hover { border-color: var(--brand); background: var(--brand-soft); }
.rc-ctx-ico { flex: none; display: inline-flex; color: var(--brand-strong); }
.rc-ctx-t { flex: 1 1 auto; min-width: 0; font-weight: 600; }
.rc-ctx-q { display: block; overflow: hidden; margin-top: .1rem; font-size: .76rem; font-weight: 400; color: var(--muted);
    text-overflow: ellipsis; white-space: nowrap; }
.rc-ctx-n { flex: none; font-size: .76rem; color: var(--muted); }
.rc-ctx-note { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start;
    gap: var(--s2) var(--s3); padding: .7rem var(--s3); border: 1px solid var(--attn-bd); border-radius: var(--radius-sm);
    background: var(--attn-bg); color: var(--text); font-size: .82rem; }
.rc-ctx-note.sev-critical { border-color: var(--err-bd); background: var(--err-bg); }
.rc-ctx-note.sev-info { border-color: var(--info-bd); background: var(--info-bg); }
.rc-ctx-note .rc-dot { width: .5rem; height: .5rem; margin-top: .4rem; border-radius: 50%; background: var(--attn-fg); }
.rc-ctx-note.sev-critical .rc-dot { background: var(--err-fg); }
.rc-ctx-note.sev-info .rc-dot { background: var(--info-fg); }
.rc-ctx-b { margin: 0; }
.rc-ctx-note-n { display: block; margin-top: .1rem; font-size: .78rem; color: var(--muted); }
.rc-ctx-acts { display: inline-flex; gap: var(--s3); white-space: nowrap; }

/* the list: four columns, the same on every row and in the header above them */
.rc-cols, .rc-row { display: grid; grid-template-columns: 1.75rem minmax(0, 1fr) 6.75rem 5.5rem; gap: 0 var(--s3); align-items: center; }
.rc-cols { position: sticky; top: 0; z-index: 2; padding: var(--s3) var(--s2) var(--s2); background: var(--surface);
    border-bottom: 1px solid var(--border-strong); font-size: .68rem; font-weight: 600; letter-spacing: .06em;
    text-transform: uppercase; color: var(--muted); }
.rc-cols-r { text-align: right; }
.rc-list { list-style: none; margin: 0; padding: 0; }
.rc-list > .rc-empty { padding: var(--s5) var(--s4); }
.rc-list[data-filter="todo"] > .rc-item:not([data-state="crit"]):not([data-state="unknown"]),
.rc-list[data-filter="ok"] > .rc-item[data-state="crit"], .rc-list[data-filter="ok"] > .rc-item[data-state="unknown"] { display: none; }

.rc-item { position: relative; border-bottom: 1px solid var(--border); scroll-margin: 0 0 var(--s2);
    transition: background var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease); }
.rc-row { width: 100%; margin: 0; padding: .7rem var(--s2); border: 0; background: none; color: inherit;
    font: inherit; text-align: left; cursor: pointer; border-radius: var(--radius-sm); transition: background var(--dur-2) var(--ease); }
.rc-row:hover, .rc-item.is-hot > .rc-row { background: var(--surface-2); }
.rc-row:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.rc-n { display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; border-radius: 50%;
    border: 1px solid var(--pin-ok); background: var(--pin-ok); color: var(--ofx-on-orange);
    font-size: .7rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.rc-item[data-state="crit"] .rc-n, .rc-item[data-state="unknown"] .rc-n { border-color: var(--pin-problem); background: var(--pin-problem); }
.rc-item.is-open .rc-n, .rc-item.is-hot .rc-n { border-color: var(--pin-cur); background: var(--pin-cur); color: var(--pin-on-cur); }
.rc-main { display: flex; flex-direction: column; min-width: 0; gap: .1rem; }
.rc-name { font-size: .9rem; font-weight: 600; line-height: 1.3; overflow: hidden;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.rc-qty { font-weight: 400; color: var(--muted); }
.rc-tag { margin-right: .35rem; padding: 0 .35rem; border-radius: 999px; font-size: .66rem; font-weight: 600;
    background: var(--sandbox-bg); color: var(--sandbox-fg); vertical-align: 1px; }
.rc-meta { display: flex; align-items: baseline; gap: 0 var(--s2); flex-wrap: wrap; font-size: .76rem; color: var(--muted); }
.rc-code { font-family: var(--font-mono); font-size: .76rem; color: var(--muted); letter-spacing: .01em; }
.rc-reason { font-weight: 500; }
.rc-nopin { padding: 0 .35rem; border: 1px dashed var(--border-strong); border-radius: 999px; font-size: .68rem; color: var(--muted); }
.rc-item[data-state="crit"] .rc-reason, .rc-item[data-state="unknown"] .rc-reason { color: var(--err-fg); }
.rc-item[data-state="attn"] .rc-reason { color: var(--attn-fg); }
.rc-item[data-state="pattern"] .rc-reason { color: var(--info-fg); }
.rc-item[data-state="ok"] .rc-reason { color: var(--muted); font-weight: 400; }
.rc-more { padding: 0 .3rem; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: .68rem; }
.rc-price { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: baseline; gap: 0 .35rem;
    text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rc-reg { flex-basis: 100%; font-size: .74rem; color: var(--muted); }
.rc-promo { font-size: .94rem; font-weight: 700; }
.rc-pct { font-size: .7rem; color: var(--muted); }
.rc-st { display: inline-flex; align-items: center; justify-content: flex-end; gap: .2rem; font-size: .76rem; color: var(--muted); }
.rc-st > svg { flex: none; transition: transform var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease); }
.rc-st-ok { display: inline-flex; align-items: center; gap: .2rem; color: var(--ok-fg); }
.rc-st-todo { color: var(--attn-fg); font-weight: 600; }
.rc-item[data-state="crit"] .rc-st-todo, .rc-item[data-state="unknown"] .rc-st-todo { color: var(--err-fg); }
.rc-item.is-open .rc-st > svg { transform: rotate(90deg); color: var(--brand-strong); }

/* the open product: one card, the decision inside it */
.rc-item.is-open { margin: var(--s2) calc(-1 * var(--s2)); border: 1px solid var(--brand); border-radius: var(--radius);
    background: var(--surface); box-shadow: var(--shadow-lift); }
.rc-item.is-open > .rc-row { background: none; padding-left: var(--s4); padding-right: var(--s4); }
/* PU-104: opens in one step — no height animation (it moved every row below it on each frame), and no fade in
   (PX-267: an entrance enters whole) */
.rc-editor { display: grid; grid-template-rows: 0fr; }
.rc-editor-in { min-height: 0; overflow: hidden; }
.rc-item.is-open > .rc-editor { grid-template-rows: 1fr; }
.rc-item.is-open > .rc-editor > .rc-editor-in { overflow: visible; }
.rc-ed { display: grid; gap: var(--s2); padding: 0 var(--s4) var(--s3) calc(var(--s4) + 1.75rem + var(--s3));
    animation: rc-rise .26s var(--ease-out); }
.rc-ed-body { display: grid; gap: var(--s2); }
.rc-ed-body[hidden] { display: none; }

.rc-decide { display: grid; gap: var(--s3); }
.rc-decide-q { margin: 0; font-size: .92rem; font-weight: 600; }
.rc-cmp { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
.rc-cmp-c { display: flex; flex-direction: column; gap: .15rem; min-width: 0; padding: var(--s2) var(--s3);
    border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.rc-cmp-l { font-size: .72rem; color: var(--muted); }
.rc-cmp-v { font-size: .88rem; overflow-wrap: anywhere; }
.rc-cmp-v.is-diff { color: var(--attn-fg); font-weight: 600; }
.rc-decide-n { display: grid; gap: .2rem; margin: 0; padding: var(--s2) var(--s3); border-radius: var(--radius-sm);
    background: var(--surface-2); font-size: .84rem; }
.rc-decide-n span { font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
.rc-decide-acts { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.rc-decide-acts .rc-like { margin-left: auto; }
.rc-decide-acts kbd, .rc-foot kbd, .rc-search-key { padding: 0 .3rem; border: 1px solid currentColor; border-radius: .25rem;
    font-family: var(--font-mono); font-size: .66rem; opacity: .7; transition: opacity var(--dur-2) var(--ease); }
.rc-search input:focus ~ .rc-search-key { opacity: .7; }

.rc-note { display: flex; align-items: center; gap: var(--s2); margin: 0; padding: var(--s2) var(--s3);
    border-radius: var(--radius-sm); font-size: .82rem; }
.rc-note-err { background: var(--err-bg); color: var(--err-fg); border: 1px solid var(--err-bd); }
.rc-note-ok { background: var(--ok-bg); color: var(--ok-fg); border: 1px solid var(--ok-bd); }
.rc-issue { margin: 0; padding: .35rem var(--s3); border-radius: var(--radius-sm); background: var(--surface-2);
    border: 1px solid var(--attn-bd); color: var(--text); font-size: .8rem; }
.rc-issue .rc-dot { display: inline-block; margin-right: .35rem; vertical-align: 1px; }
.rc-issue.sev-critical { border-color: var(--err-bd); }
.rc-issue.sev-info { border-color: var(--info-bd); }
.rc-issue-t { display: flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap; margin: 0; font-size: .84rem; }
.rc-issue-t .rc-dot { flex: none; width: .5rem; height: .5rem; border-radius: 50%; background: var(--attn-fg); }
.rc-issue.sev-critical .rc-issue-t .rc-dot { background: var(--err-fg); }
.rc-issue.sev-info .rc-issue-t .rc-dot { background: var(--info-fg); }
.rc-issue-n { flex-basis: 100%; font-size: .78rem; color: var(--muted); }
.rc-fills { display: inline-flex; align-items: center; gap: var(--s1); flex-wrap: wrap; }
.rc-fill { display: inline-flex; align-items: center; gap: .3rem; height: 1.75rem; padding: 0 .65rem;
    border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface);
    color: var(--muted); font: inherit; font-size: .76rem; cursor: pointer;
    transition: background var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease), transform var(--dur-1) var(--ease); }
.rc-fill b { color: var(--text); font-size: .84rem; font-variant-numeric: tabular-nums; }
.rc-fill:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); }
.rc-fill:active { transform: scale(.96); }
.rc-fill.is-used { border-color: var(--ok-bd); background: var(--ok-bg); color: var(--ok-fg); }
.rc-fill-quiet { height: 1.5rem; border-color: var(--border); }
.rc-fill-quiet b { font-size: .78rem; }

/* the editor's table: each field as the brochure has it, beside what the catalogue holds */
.rc-tbl { display: grid; gap: .2rem; }
.rc-tr { display: grid; grid-template-columns: 7.25rem minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; gap: var(--s2) var(--s3); }
.rc-th { font-size: .66rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.rc-th .rc-pts { text-transform: none; letter-spacing: 0; font-weight: 400; }
.rc-tl { font-size: .8rem; color: var(--muted); }
.rc-f { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rc-tc { display: flex; align-items: center; gap: var(--s1); flex-wrap: wrap; min-width: 0; font-size: .84rem; }
.rc-tc-v { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-tc-v.is-diff { color: var(--attn-fg); font-weight: 600; }
.rc-in { width: 100%; min-width: 0; height: 2rem; padding: 0 .6rem; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-size: .9rem;
    transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), background var(--dur-2) var(--ease); }
textarea.rc-in { height: auto; padding: var(--s2) .65rem; resize: vertical; }
.rc-in:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.rc-in[readonly] { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.rc-num { font-variant-numeric: tabular-nums; }
.rc-in.rc-flag { border-color: var(--attn-fg); box-shadow: 0 0 0 3px var(--attn-bg); }
.rc-in.is-changed { border-color: var(--brand); }
.rc-was { font-size: .7rem; color: var(--muted); }
.rc-was s { font-variant-numeric: tabular-nums; }
.rc-check { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--s2); font-size: .84rem; cursor: pointer; }
.rc-check input { accent-color: var(--brand); }

.rc-source, .rc-ed .rc-promo { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; margin: 0; font-size: .82rem; font-weight: 400; }
.rc-promo-h { flex-basis: 100%; display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.rc-ed .rc-promo .rc-promo-h .rc-lbl { flex-basis: auto; margin-right: auto; }
.rc-promo-h .rc-pop > summary { height: 1.5rem; padding: 0 .55rem; font-size: .72rem; }
.rc-series-box { font-size: .8rem; color: var(--muted); }
.rc-series-box > summary { cursor: pointer; list-style: none; }
.rc-series-box > summary::-webkit-details-marker { display: none; }
.rc-series-box[open] > summary .rc-link { text-decoration: underline; }
.rc-series-box .rc-expand { margin-top: var(--s2); }
/* after „Поправи" the table shows both sides: the question stays, its comparison steps aside */
.rc-ed.is-fixing .rc-cmp, .rc-ed.is-fixing .rc-decide-n { display: none; }
.rc-ed.is-fixing .rc-decide { gap: var(--s2); }
.rc-source-col { display: grid; gap: var(--s1); }
.rc-lbl { flex: none; font-size: .66rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.rc-ed .rc-promo .rc-lbl { flex-basis: 100%; }
.rc-cat { min-width: 0; }
.rc-pts { font-size: .76rem; color: var(--muted); }
.rc-expand { font-size: .8rem; }
.rc-series-n { margin: 0 0 var(--s1); font-size: .74rem; color: var(--muted); }
.rc-series-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.rc-series-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: var(--s3);
    padding: .35rem var(--s3); border-top: 1px solid var(--border); font-size: .8rem; }
.rc-series-list li:first-child { border-top: 0; }
.rc-series-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-series-price { color: var(--muted); font-variant-numeric: tabular-nums; }
.rc-rule { flex-basis: 100%; display: flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap;
    padding: .35rem var(--s3); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.rc-rule-t { font-weight: 600; }
.rc-rule-p { padding: 0 .45rem; border: 1px solid var(--border); border-radius: 999px; font-size: .72rem; color: var(--muted); }
.rc-rule-q { flex-basis: 100%; order: 3; font-size: .74rem; color: var(--muted); }
.rc-rule .rc-link { margin-left: auto; }
.rc-rule-none { flex-basis: 100%; margin: 0; padding: var(--s2) var(--s3); border: 1px dashed var(--border);
    border-radius: var(--radius-sm); color: var(--muted); }
.rc-rule-acts { display: flex; gap: var(--s2); flex-wrap: wrap; }
.rc-pop > summary { list-style: none; display: inline-flex; align-items: center; gap: .3rem; height: 1.75rem;
    padding: 0 .7rem; border: 1px solid var(--border); border-radius: 999px; font-size: .76rem;
    color: var(--muted); cursor: pointer; user-select: none; transition: border-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease); }
.rc-pop > summary::-webkit-details-marker { display: none; }
.rc-pop > summary:hover, .rc-pop[open] > summary { color: var(--brand-strong); border-color: var(--brand); }
.rc-pop-panel { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; margin-top: var(--s2);
    padding: var(--s2); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
    animation: rc-drop .16s var(--ease-out); }
.rc-pop-panel select { flex: 1 1 14rem; }
.rc-pop-col { flex-direction: column; align-items: stretch; min-width: min(26rem, 80vw); }
.rc-hint { margin: 0; font-size: .74rem; color: var(--muted); }

.rc-link { display: inline-flex; align-items: center; gap: .3rem; padding: 0; border: 0; background: none;
    color: var(--brand-strong); font: inherit; font-size: .8rem; cursor: pointer; text-decoration: none; }
.rc-link:hover { text-decoration: underline; }
.rc-link-danger:hover { color: var(--err-fg); }
.rc-later { color: var(--muted); }

.rc-foot { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; padding-top: var(--s1); }
.rc-foot-r { margin-left: auto; display: inline-flex; gap: var(--s2); }
/* PU-194: a product taller than the list's room keeps „Запази" in view — the editor's action row sticks to the list's
   bottom on the card's own surface while the fields run under it; a product that fits keeps it where it was. Stuck,
   it ends flush with the list's edge (the scroll's own bottom padding, --s4, would leave a strip of fields under it);
   its --s3 under the buttons is the editor's own bottom padding, so its place in the flow is unchanged. A field
   tabbed to is scrolled clear of it (scroll-padding-bottom: the row's height and a breath). */
.rc-item.is-open .rc-ed-body > .rc-foot { position: sticky; bottom: calc(-1 * var(--s4)); z-index: 1;
    padding-bottom: var(--s3); margin-bottom: calc(-1 * var(--s3)); background: var(--surface); }
.rc-scroll:has(.rc-item.is-open .rc-ed-body > .rc-foot) {
    scroll-padding-bottom: calc(var(--s1) + var(--btn-h) + var(--s3) + var(--s2)); }
.rc-save { transition: transform var(--dur-1) var(--ease); }
.rc-save:active { transform: scale(.97); }

.rc-conflict { padding: var(--s3); border: 1px solid var(--err-bd); background: var(--err-bg);
    border-radius: var(--radius-sm); display: grid; gap: var(--s2); }
.rc-conflict-t { display: flex; align-items: center; gap: var(--s2); margin: 0; color: var(--err-fg); font-weight: 600; font-size: .86rem; }
.rc-diff { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: .82rem; }
.rc-diff li { display: grid; grid-template-columns: minmax(8rem, auto) auto 1fr; gap: var(--s3); }
.rc-diff s { color: var(--muted); }
.rc-conflict-acts { display: flex; align-items: center; justify-content: flex-end; gap: var(--s2); flex-wrap: wrap; }
.rc-conflict-acts .rc-link { margin-right: auto; }

/* the page's foot: how far this page is, and on to the next page that waits */
.rc-pagefoot { flex: none; display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap;
    padding: var(--s3) var(--s5); border-top: 1px solid var(--border); background: var(--surface); }
.rc-pf-state { display: inline-flex; align-items: center; gap: .35rem; margin-right: auto; font-size: .82rem; color: var(--muted); }
.rc-pf-state b { color: var(--attn-fg); font-variant-numeric: tabular-nums; }
.rc-pagefoot.is-clear .rc-pf-state, .rc-pf-done { color: var(--ok-fg); }
.rc-pf-done { display: inline-flex; align-items: center; gap: .35rem; font-size: .84rem; font-weight: 600; }
.rc-pf-prev { color: var(--muted); }
.rc-next { white-space: nowrap; }

/* the offer's progress, in the header */
.rc-progress { flex: none; align-self: center; display: inline-flex; align-items: center; gap: var(--s2);
    padding-left: var(--s4); border-left: 1px solid var(--border); font-size: .84rem; color: var(--muted); white-space: nowrap; }
.rc-ring { flex: none; width: 1.25rem; height: 1.25rem; border-radius: 50%;
    background: conic-gradient(var(--ok-fg) var(--rc-prog, 0%), var(--surface-3) 0);
    mask: radial-gradient(closest-side, transparent 66%, var(--text) 68%); }
.rc-prog-t b { color: var(--text); font-variant-numeric: tabular-nums; }
.rc-prog-t a { color: inherit; text-decoration: none; }
.rc-prog-t a:hover { color: var(--brand-strong); }
.rc-approved { font-size: .72rem; }
.of-tab .cnt-open { color: var(--err-fg); font-weight: 700; }
.of-tab .cnt-open:empty { display: none; }

/* every page as a sheet of thumbnails */
.rc-pages { width: min(66rem, calc(100vw - 2rem)); max-height: calc(100dvh - 4rem); padding: 0; overflow: hidden;
    border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text);
    box-shadow: var(--shadow-lift); }
.rc-pages[open] { display: flex; flex-direction: column; animation: rc-drop .18s var(--ease-out); }
.rc-pages::backdrop { background: color-mix(in srgb, var(--bg) 72%, transparent); }
.rc-pages-hd { flex: none; display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4);
    border-bottom: 1px solid var(--border); }
.rc-pages-hd h2 { margin: 0; font-size: 1rem; }
.rc-pages-hd h2 span { margin-left: .35rem; font-weight: 400; color: var(--muted); }
.rc-pages-key { margin-left: auto; display: inline-flex; align-items: center; gap: .4rem; font-size: .76rem; color: var(--muted); }
.rc-pages-key i { display: inline-block; width: .55rem; height: .55rem; margin-left: var(--s2); border-radius: 50%; }
.rc-pages-key .is-todo { background: var(--pin-problem); }
.rc-pages-key .is-done { background: var(--pin-ok); }
.rc-pages-key .is-page { background: var(--muted); }
.rc-pagemap { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
    gap: var(--s3); padding: var(--s4); }
.rc-pm-cell { position: relative; display: block; aspect-ratio: .7071; overflow: hidden; border: 2px solid transparent;
    border-radius: var(--radius-sm); background: var(--surface-3); text-decoration: none;
    transition: transform var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease); }
.rc-pm-cell img { display: block; width: 100%; height: 100%; object-fit: cover; }
.rc-pm-cell:not(.has-notes):not(.has-page-notes) img { opacity: .55; }
/* a page whose only open note is about the page itself: a quiet grey mark, not the yellow of a product */
.rc-pm-i { position: absolute; right: .4rem; top: .4rem; width: .6rem; height: .6rem; border-radius: 50%;
    background: var(--muted); box-shadow: 0 0 0 2px var(--surface); }
.rc-pm-cell.is-cur { border-color: var(--brand); }
.rc-pm-cell:hover, .rc-pm-cell:focus-visible { transform: translateY(-2px); border-color: var(--brand); box-shadow: var(--shadow-lift); outline: none; }
.rc-pm-n { position: absolute; left: .3rem; bottom: .3rem; padding: 0 .35rem; border-radius: .3rem;
    background: var(--surface); color: var(--text); font-size: .72rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.rc-pm-b { position: absolute; right: .3rem; top: .3rem; min-width: 1.25rem; height: 1.25rem; padding: 0 .3rem; border-radius: 999px;
    background: var(--pin-problem); color: var(--ofx-on-orange); font-size: .7rem; font-weight: 700; line-height: 1.25rem; text-align: center; }

/* the notes by kind: one line per kind, its pages named; opened to see each */
.rc-kind { border-top: 1px solid var(--border); }
.rc-kind > summary { list-style: none; }
.rc-kind > summary::-webkit-details-marker { display: none; }
.rc-kind-h { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) auto; align-items: baseline; gap: var(--s3);
    padding: var(--s3) 0; cursor: pointer; }
.rc-kind-h:hover .rc-kind-t b { color: var(--brand-strong); }
.rc-kind-t { min-width: 0; display: flex; flex-direction: column; gap: .1rem; font-size: .9rem; }
.rc-kind-t b::before { content: "▸"; display: inline-block; width: 1rem; color: var(--muted); font-size: .7rem;
    transition: transform var(--dur-2) var(--ease); }
.rc-kind[open] .rc-kind-t b::before { transform: rotate(90deg); }
.rc-kind-t .muted { padding-left: 1rem; font-size: .78rem; }
/* a kind's bulk ignore: the details' sibling laid on its summary's line (a button in a summary is nested-interactive),
   over the summary's own invisible room of the same text */
.rc-kind-g { position: relative; }
.rc-kind-all { position: absolute; top: calc(var(--s3) + .1875rem); right: 0; } /* + the summary's baseline drop: on its room's line */
.rc-kind-room { visibility: hidden; }
.rc-kind .rc-note-list { padding-bottom: var(--s2); }
.rc-kind .rc-note-row { border-top: 1px dashed var(--border); }
.rc-note-where { font-size: .8rem; font-weight: 600; white-space: nowrap; }
.rc-note-page + .rc-note-page { margin-top: var(--s2); }
.rc-note-page-h { display: flex; align-items: baseline; gap: var(--s2); margin: var(--s3) 0 0; font-size: .84rem; }
.rc-note-page-t { font-weight: 700; }
.rc-note-page-h .rc-link { margin-left: auto; }

/* the offer header in one compact block, so the work area keeps the height */
.of-hd { position: relative; display: flex; align-items: flex-end; gap: var(--s2) var(--s4); flex-wrap: wrap; margin: 0 0 var(--s3);
    border-bottom: 1px solid var(--border); }
.of-hd-back { flex: none; align-self: center; display: inline-flex; align-items: center; justify-content: center;
    width: 2rem; height: 2rem; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--muted);
    transition: background var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease); }
.of-hd-back:hover { color: var(--text); border-color: var(--brand); background: var(--brand-soft); }
.of-hd-main { flex: 1 1 18rem; min-width: 0; align-self: center; display: flex; align-items: baseline;
    gap: .25rem var(--s3); flex-wrap: wrap; padding: var(--s1) 0; }
.of-hd-main h1 { max-width: 100%; margin: 0; overflow: hidden; font-size: 1.2rem; letter-spacing: -.01em;
    text-overflow: ellipsis; white-space: nowrap; }
.of-hd-meta { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.of-hd .of-hd-tabs { gap: var(--s4); margin: 0; border-bottom: 0; }
.of-hd .of-tab { padding: .55rem .125rem .7rem; font-size: .9rem; }
/* PX-269: „приключена" beside the state chip; the action itself is an item of „⋯" */
.of-end-mark .chip { font-size: .7rem; }
/* PU-93: a filter chip and its ×, a control beside the words, not a link inside a sentence */

.of-end-mark:empty { display: none; }
/* POF-33: the offer's hidden menu — „Провери отново" / „Разчети отново", each with its one-line hint */
.of-hd-menu { margin-left: auto; align-self: center; }
.of-hd-pop { min-width: 20rem; }
/* PU-193: as wide as its words (one line each on a desktop, as before) but never wider than the window less its
   gutters — there the hints wrap; dialogs.js moves it back inside when the button leaves it too little room */
details.of-hd-menu .of-hd-pop { width: max-content; min-width: min(20rem, calc(100vw - 2 * var(--s4)));
    max-width: calc(100vw - 2 * var(--s4)); white-space: normal; }
details.of-hd-menu .of-hd-pop .ow-more-item { white-space: normal; }
.of-hd-pop .ow-more-item { align-items: flex-start; }
.of-hd-pop .ow-more-item .ico { margin-top: .15rem; }
/* an item that cannot be used here (P4-04: an unreleased offer is not ended by hand) — dimmed, no hover */
.of-hd-pop .ow-more-item:disabled { opacity: .45; cursor: not-allowed; }
.of-hd-pop .ow-more-item:disabled:hover { background: none; }
.of-menu-text { display: grid; gap: .1rem; }
.of-menu-hint { color: var(--muted); font-size: .75rem; line-height: 1.35; }

/* a saved product glows once, then settles */
.rc-flash > .rc-row { animation: rc-glow 1.6s var(--ease-out); }

/* --- the notes tab ----------------------------------------------------------------- */
.rc-notes { padding: var(--s4); margin-bottom: var(--s4); }
.rc-notes.is-crit { border-color: var(--err-bd); }
.rc-notes.is-attn { border-color: var(--attn-bd); }
.rc-notes-head { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s2); }
.rc-notes-t { margin: 0; font-size: 1.05rem; }
.rc-notes-n { font-size: .82rem; }
.rc-notes-acts { margin-left: auto; display: inline-flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.rc-note-list { list-style: none; margin: 0; padding: 0; }
.rc-note-row { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) auto; align-items: start; gap: var(--s3);
    padding: var(--s3) 0; border-top: 1px solid var(--border); }
.rc-note-row.is-closed { opacity: .8; }
.rc-note-body { min-width: 0; }
.rc-note-l { margin: 0; font-size: .9rem; }
.rc-note-l .muted { font-size: .76rem; margin-left: var(--s1); }
.rc-note-n { margin: 2px 0 0; font-size: .8rem; color: var(--muted); }
.rc-note-acts { display: inline-flex; align-items: center; gap: var(--s3); }
.rc-notes-clean { display: flex; align-items: center; gap: var(--s2); margin: 0; color: var(--ok-fg); font-size: .9rem; }
.rc-closed { margin-top: var(--s3); padding-top: var(--s2); border-top: 1px solid var(--border); }
.rc-closed > summary { cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--muted); }
.sev { display: inline-flex; align-items: center; gap: .4rem; font-size: .76rem; font-weight: 600; white-space: nowrap; margin-top: .1rem; }
.sev-dot { width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }
.sev-critical { color: var(--err-fg); }
.sev-warning { color: var(--attn-fg); }
.sev-info { color: var(--info-fg); }

/* the offer-wide list, by brochure page: a jump, the search, a header per page */
.of-prod-bar { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin: 0 0 var(--s3); }
.of-prod-jump { display: inline-flex; align-items: center; gap: var(--s2); font-size: .82rem; color: var(--muted); }
.of-prod-jump select { height: 2rem; padding: 0 var(--s2); border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text); font: inherit; font-size: .84rem; }
.of-prod-search { flex: 1 1 16rem; max-width: 26rem; order: 0; animation: none; }
.of-page-h > th { position: sticky; top: 0; z-index: 1; padding: .55rem 1rem; background: var(--surface-2);
    border-top: 1px solid var(--border); text-align: left; font-weight: 600; }
.of-page-h > th > span + span { margin-left: var(--s2); font-weight: 400; font-size: .78rem; }
.of-page-h .rc-link { float: right; }
.of-prod-more { display: flex; justify-content: center; gap: var(--s2); padding: .75rem; }
/* the offer-wide list: a row opens the product in the workspace */
.of-prod-row[data-href] { cursor: pointer; }
.of-prod-row[data-href]:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.of-prod-row a.of-name-1 { color: var(--text); text-decoration: none; }
.of-prod-row:hover a.of-name-1 { color: var(--brand-strong); }

/* --- motion ------------------------------------------------------------------------ */
/* PX-258: the open product rises into place without fading — its text is at full strength (AA) on every frame */
@keyframes rc-rise { from { transform: translateY(-4px); } }
/* PX-260: the workspace's pop-overs drop into place without fading — their text is AA on every frame, as rc-rise's */
@keyframes rc-drop { from { transform: translateY(-4px) scale(.99); } }
@keyframes rc-glow { 0% { background: var(--ok-bg); } 100% { background: transparent; } }

/* --- narrower screens: the page sticks to the top, the list runs under it ---------- */
@media (max-width: 1099px) {
    /* the shadow's first ring caps the gap above the stuck pane, so the list never shows through */
    .rc-page { position: sticky; top: calc(var(--app-stick, 0rem) + var(--app-search-h)); z-index: 6; height: min(45vh, 30rem);
        border-radius: var(--radius) var(--radius) 0 0; box-shadow: 0 -1rem 0 0 var(--bg); }
    .rc-side { border-top: 1px solid var(--border); }
    .rc-scroll { overflow: visible; }
    /* an item brought into view stops below the page stuck at the top, not under it: the page's height here, the bars
       above it and the air from html's scroll-padding-top (PU-85) — the two add up, so each is counted once */
    .rc-item { scroll-margin-top: min(45vh, 30rem); }
    .rc-pagefoot { position: sticky; bottom: 0; z-index: 5; border-radius: 0 0 var(--radius) var(--radius); }
    .rc-progress { order: 3; padding-left: 0; border-left: 0; }
}
@media (max-width: 600px) {
    .rc-toolbar { gap: var(--s1); padding: 0 var(--s2); }
    #page-fullscreen { display: none; }
    .rc-pagebtn { padding: 0 var(--s1); font-size: .84rem; }
    .rc-pagebtn span { display: none; }
    .rc-pin { min-width: 1rem; height: 1rem; padding: 0 .2rem; font-size: .58rem; line-height: 1rem;
        box-shadow: 0 0 0 1px var(--surface); }
    .rc-pf-prev { display: none; }
    .rc-pagefoot .rc-long { display: none; }
    .rc-pf-state { font-size: .76rem; }
    .rc-side-head { padding: var(--s3) var(--s3) var(--s2); }
    .rc-scroll { padding: 0 var(--s3) var(--s3); }
    .rc-cols { display: none; }
    .rc-row { grid-template-columns: 1.5rem minmax(0, 1fr) auto; gap: 0 var(--s2); padding: var(--s3) var(--s1); }
    .rc-st { display: none; }
    .rc-ed { padding: 0 var(--s3) var(--s3); }
    .rc-cmp { grid-template-columns: minmax(0, 1fr); }
    .rc-tr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .rc-tl { grid-column: 1 / -1; }
    .rc-th > span:first-child { display: none; }
    .rc-note-row { grid-template-columns: minmax(0, 1fr); gap: var(--s1); }
    .rc-pagefoot { padding: var(--s2) var(--s3); }
    .of-offer-head { margin: 0 0 var(--s2); }
    .of-offer-head h1 { font-size: 1.1rem; flex: 1 1 0; min-width: 0; }
    .of-head-row { flex-wrap: nowrap; align-items: flex-start; }
    .of-offer-head .meta { font-size: .78rem; }
    .of-hd { gap: var(--s1) var(--s2); }
    .of-hd-main { flex-basis: calc(100% - 3rem); }
    .of-hd-main h1 { font-size: 1.05rem; }
    .of-hd .of-hd-tabs { flex-basis: 100%; }
    .rc-pagemap { grid-template-columns: repeat(auto-fill, minmax(4.75rem, 1fr)); gap: var(--s2); padding: var(--s3); }
}

/* ============================================================
   „Каталогът иска промяна" — предложенията на MLM-PRO по редове,
   които са нечие решение. Една таблица, но групирана по продукт:
   петте полета на един продукт са ЕДНО решение, не пет разпилени.
   ============================================================ */

/* PCAT-02: an archived catalogue row is dimmed, and the shown-range count sits
   quietly under the list. Badges keep their own colour. */
.row-archived td { color: var(--muted); }
.row-archived td .badge { color: var(--muted); }
.list-count { margin: 0.625rem 0 0; }

/* PCAT-03: the „спрян от продажба" toggle in the edit dialog — a checkbox on one
   line with its label, not stacked like the text fields. */
.orgnew-check { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; font-size: .88rem; }
/* not the checkbox: `width: auto` collapses the themed (appearance: none) checkbox to its border — PCAT-09 F-1 */
.orgnew-check input:not([type=checkbox]) { width: auto; }

/* PCAT-06: „Обнови от файл" leads with the action — a large drop zone (the native
   input is hidden, the whole zone is the control), then one line of context and the
   button in a footer row. */
.import-card { display: flex; flex-direction: column; gap: 0.875rem; }
.dropzone {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0.375rem; text-align: center; padding: 1.75rem 1rem; cursor: pointer;
    border: 1.5px dashed var(--border-strong); border-radius: 0.75rem;
    background: var(--surface-2); color: var(--muted); transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.dropzone:hover, .dropzone.is-drop { border-color: var(--brand); background: var(--surface); }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.dropzone-title { color: var(--text); font-weight: 600; font-size: .95rem; }
.dropzone-link { color: var(--brand); text-decoration: underline; }
.dropzone-name { font-size: .84rem; }
.import-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.import-foot .muted { font-size: .88rem; }

/* =========================================================   The order workspace (PU-06, PU-17).
   One frame of one width on every tab — the owner saw the page jump: the
   content's edge moved between tabs and the tabs floated after the header.
   Now: the header (who, the state, the actions in one place), the tabs on
   their own row at the content's edge, then the tab. Tokens only.
   ================================================================ */
.ow-page { max-width: 88rem; }
/* PU-52: two columns — the order on the left, the rail (customer, reply, actions) on the right, sticky */
.ow-grid { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: var(--s5); align-items: start; }
.ow-main { min-width: 0; }
.ow-rail { position: sticky; top: calc(var(--app-stick, 0rem) + var(--app-search-h) + var(--s2)); display: grid;
    gap: var(--s4); min-width: 0;
    max-height: calc(100vh - var(--app-stick, 0rem) - var(--app-search-h) - var(--s2) - var(--s4)); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
@media (max-width: 1024px) {
    .ow-grid { grid-template-columns: minmax(0, 1fr); }
    .ow-rail { position: static; max-height: none; overflow: visible; }
}
.ow-hd { display: block; padding: 0; margin: 0 0 var(--s4); }
.ow-back { display: inline-flex; align-items: center; gap: .45rem; margin: 0 0 var(--s3); font-size: .9rem;
    color: var(--muted); text-decoration: none; }
.ow-back:hover { color: var(--text); }
.ow-title-row { display: flex; align-items: center; gap: var(--s3); min-width: 0; }

.ow-title { margin: 0; min-width: 0; font-size: 1.75rem; font-weight: 650; letter-spacing: -.015em; line-height: 1.25;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* PU-13: an order Ordio still reads wears a spinner beside „Обработва се" — in the tone's own colour */
.st-spin { display: inline-block; width: .8em; height: .8em; flex: none; vertical-align: -.1em; border-radius: 50%;
    border: 2px solid color-mix(in srgb, currentColor 25%, transparent); border-top-color: currentColor; }
/* it turns only for those who have not asked for less motion — still, it is a ring beside the words */
@media (prefers-reduced-motion: no-preference) { .st-spin { animation: spin .9s linear infinite; } }
.status-badge .st-spin { margin-right: .35em; }
.oq-verdict:has(.st-spin)::before { display: none; }
/* a turning ring is its own layer and sat over the row's link — a click on it opened nothing (PU-16) */
.oq-row .st-spin { pointer-events: none; }
.ow-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; min-height: 1.5rem; margin: .3rem 0 0;
    font-size: .84rem; color: var(--muted); }
.ow-meta b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.ow-match { display: inline-flex; align-items: center; padding: 0 .5rem; border-radius: 999px; font-size: .74rem;
    font-weight: 600; line-height: 1.4rem; border: 1px solid transparent; }
.ow-match-attn { background: var(--attn-bg); color: var(--attn-fg); border-color: var(--attn-bd); }
.ow-match-info { background: var(--info-bg); color: var(--info-fg); border-color: var(--info-bd); }
.ow-meta .ico { color: var(--muted); }

/* --- PU-52: ⋯ — the order's quieter actions, one pop-over (dialogs.js closes the others) ------ */
.ow-more { position: relative; flex: none; }
.ow-more > summary { list-style: none; }
.ow-more > summary::-webkit-details-marker { display: none; }
.ow-more-menu { position: absolute; right: 0; top: calc(100% + .35rem); z-index: 20; display: grid; min-width: 14rem;
    padding: .35rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); }
.ow-more-item { display: flex; align-items: center; gap: .55rem; width: 100%; padding: .55rem .65rem; border: 0;
    border-radius: var(--radius-sm); background: none; color: var(--text); font: inherit; font-size: .9rem; text-align: left;
    cursor: pointer; }
.ow-more-item:hover, .ow-more-item:focus-visible { background: var(--surface-2); }
.ow-more-item:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.ow-more-item .ico { color: var(--muted); }

/* --- PU-52: the rail's cards ------------------------------------------------------------- */
.ow-card { min-width: 0; padding: var(--s4) var(--s5); background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow); }
.ow-card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin: 0 0 var(--s3); }
.ow-card-title { margin: 0; font-size: 1.05rem; font-weight: 650; }
.ow-card-empty { margin: 0; font-size: .88rem; color: var(--muted); }
.ow-card-foot { justify-content: flex-end; width: 100%; margin-top: var(--s3); }
.ow-client-name { margin: 0; font-weight: 650; font-size: 1rem; line-height: 1.3; overflow-wrap: anywhere; }
.ow-vip { display: inline-flex; padding: 0 .5rem; border-radius: var(--radius-sm); background: var(--surface-2);
    font-size: .8rem; line-height: 1.45rem; font-variant-numeric: tabular-nums; color: var(--text); }
.ow-sender-addr { overflow-wrap: anywhere; color: var(--brand-strong); }
.ow-reply-sum { display: flex; align-items: center; gap: var(--s3); }
.ow-reply-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.5rem;
    height: 2.5rem; border-radius: var(--radius-sm); background: var(--info-bg); color: var(--info-fg); }
.ow-reply-t { display: grid; gap: .3rem; justify-items: start; min-width: 0; }
.ow-reply-kind { margin: 0; font-size: .92rem; }
.ow-reply-state { display: inline-flex; padding: 0 .55rem; border-radius: 999px; font-size: .76rem; font-weight: 600;
    line-height: 1.45rem; background: var(--surface-2); color: var(--muted); }
.ow-reply-state.ow-reply-draft { background: var(--attn-bg); color: var(--attn-fg); }
.ow-reply-state.ow-reply-approved, .ow-reply-state.ow-reply-sent { background: var(--ok-bg); color: var(--ok-fg); }
/* PU-58: a letter's several orders — one light row of tabs above the band */
.ow-letter-orders { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); margin: 0 0 var(--s3);
    padding: 0 0 var(--s3); border-bottom: 1px solid var(--border); font-size: .88rem; }

.ow-dot.ow-tone-ok { background: var(--ok-fg); }
.ow-dot.ow-tone-attn { background: var(--attn-fg); }
.ow-dot.ow-tone-err { background: var(--err-fg); }
.ow-dot.ow-tone-info { background: var(--info-fg); }
.ow-reply-letter { display: grid; gap: .3rem; margin: 0 0 var(--s3); }
.ow-reply-letter-t { margin: 0; font-weight: 600; }
.ow-reply-letter-n, .ow-reply-letter-left { margin: 0; font-size: .84rem; color: var(--muted); }
.ow-progress { display: block; height: .4rem; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.ow-progress > span { display: block; width: var(--done, 0%); height: 100%; border-radius: inherit; background: var(--ok-fg); }
/* PU-60: the order's dialogs — the notes as a list, a field's error under it */
.ow-dialog-head { display: flex; align-items: center; gap: var(--s3); }
.ow-dialog-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.5rem;
    height: 2.5rem; border-radius: 999px; }
.ow-dialog-ico.is-attn { background: var(--attn-bg); color: var(--attn-fg); }
.ow-notes { margin: 0; padding-left: 1.25rem; display: grid; gap: .3rem; font-size: .92rem; }
.ow-dialog-q { margin: var(--s2) 0 0; font-weight: 600; }
.ow-field-err { margin: -.25rem 0 0; font-size: .84rem; color: var(--err-fg); }
/* the order's dialogs read top to bottom: every part spans the form's two columns */
#ow-approve .orgnew-form > *, #ow-reject .orgnew-form > * { grid-column: 1 / -1; }
#ow-approve .orgnew-form > .dialog-x, #ow-reject .orgnew-form > .dialog-x { grid-column: auto; }
[aria-invalid="true"] { border-color: var(--err-fg) !important; }
/* PU-56: the letter in the rail's place — the cards step aside, the actions stay */
.ow-rail.is-letter > .ow-card-reply { display: none; }
.ow-letter-panel { display: grid; gap: var(--s3); }
.ow-letter-panel:focus { outline: none; }
.ow-letter-panel .ow-card-head { margin: 0; }

.ow-letter-open { justify-self: start; }

.ow-panel-body { max-height: 40vh; overflow-y: auto; padding: var(--s3); border-radius: var(--radius-sm);
    background: var(--surface-2); font-size: .9rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.ow-lt-line { border-radius: .25rem; transition: background-color var(--dur-1) var(--ease); }
.ow-lt-line[data-lines] { cursor: default; }
/* PU-147: the mark is seen at a glance — the attention colour at 40 %, the same formula in both themes */
.ow-lt-line.is-lit { --lit: color-mix(in srgb, var(--attn-fg) 40%, var(--surface-2)); background: var(--lit);
    box-shadow: 0 0 0 .2rem var(--lit); color: var(--text); }
.ow-table tbody tr.is-lit td { background: color-mix(in srgb, var(--brand) 9%, var(--surface)); }
.ow-panel-h { margin: 0; font-size: .9rem; font-weight: 600; }
.ow-panel-files { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.ow-panel-files li { display: flex; align-items: center; gap: var(--s2); min-width: 0; font-size: .86rem; }
.ow-actions { display: grid; gap: var(--s2); }
.ow-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; }
.ow-hd .ow-tabs { display: flex; align-items: flex-end; gap: var(--s5); margin: var(--s4) 0 0;
    border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.ow-hd .ow-tabs::-webkit-scrollbar { display: none; }
.ow-hd .of-tab { flex: none; padding: .55rem .125rem .7rem; font-size: .92rem; white-space: nowrap; }
/* the open tab is told by its colour and its line, not its weight: a bold tab grew and pushed the others */
.ow-hd .of-tab.on { font-weight: inherit; }
.ow-hd .of-tab .cnt { display: inline-flex; min-width: 1.25rem; justify-content: center; padding: 0 .3rem;
    border-radius: 999px; background: var(--surface-2); font-size: .72rem; line-height: 1.25rem; opacity: 1; }
.ow-hd .of-tab.on .cnt { background: var(--brand-soft); }
.ow-hd .ow-tabs .ow-next { margin-left: auto; align-self: center; padding-bottom: .15rem; }

/* --- the hand-over after „Одобри" (PU-17): the approved order is named, the next one slides in ----- */
.ow-handoff { display: flex; align-items: center; gap: .55rem; margin: 0 0 var(--s4); padding: .65rem var(--s4);
    border: 1px solid var(--ok-bd); border-radius: var(--radius); background: var(--ok-bg); font-size: .9rem;
    animation: ow-handoff .5s var(--ease-out) both; }
.ow-handoff .ico { flex: none; color: var(--ok-fg); }
.ow-handoff b { color: var(--ok-fg); font-weight: 600; }
@keyframes ow-handoff { from { transform: translateY(-.5rem); } to { transform: none; } }
.ow-page.is-arriving .ow-hd, .ow-page.is-arriving .ow-body, .ow-page.is-arriving .ow-rail {
    animation: ow-arrive .5s var(--ease-out) both; }
.ow-page.is-arriving .ow-rail { animation-delay: .05s; }
.ow-page.is-arriving .ow-body { animation-delay: .1s; }
@keyframes ow-arrive { from { visibility: hidden; transform: translateX(3rem); } to { transform: none; } }

/* --- the body: one column, one width ------------------------------------------------- */
.ow-body, .ow-single { display: grid; gap: var(--s4); min-width: 0; }
.ow-eyebrow { display: inline-flex; align-items: center; gap: .35rem; margin: 0; font-size: .72rem; font-weight: 600;
    letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* --- PU-53: the state band — loud, above the order's number, one place and height on every tab ------- */
.ow-band { --ow-tone: var(--info-fg); --ow-tone-bg: var(--info-bg); --ow-tone-bd: var(--info-bd);
    display: flex; align-items: center; gap: var(--s4); min-height: 5.75rem; margin: 0 0 var(--s4);
    padding: var(--s4) var(--s5); border: 1px solid var(--ow-tone-bd); border-radius: var(--radius);
    background: linear-gradient(var(--ow-tone-bg), var(--ow-tone-bg)), var(--surface); }
.ow-band-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 3rem; height: 3rem;
    border-radius: 999px; background: var(--ow-tone); color: var(--surface); }
.ow-band-t { flex: 1 1 auto; min-width: 0; }
.ow-band-title { margin: 0; font-size: 1.4rem; font-weight: 700; line-height: 1.25; letter-spacing: -.01em;
    color: var(--ow-tone); }
.ow-band-who { font-size: 1rem; font-weight: 500; color: var(--muted); }
.ow-band-lead, .ow-band-reason { margin: .3rem 0 0; font-size: .9rem; line-height: 1.45;
    overflow-wrap: anywhere; }
.ow-band-reason { white-space: pre-line; }
.ow-band-quote { margin: .4rem 0 0; padding: .4rem .7rem; border-left: var(--rail) solid var(--ow-tone-bd);
    background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: .92rem; }
.ow-band-act { flex: none; margin: 0; }
@media (max-width: 640px) {
    .ow-band { flex-wrap: wrap; padding: var(--s4); }
    .ow-band-title { font-size: 1.2rem; }
}
:target { scroll-margin-top: var(--s5); }
.ow-table tbody tr:target td { box-shadow: inset 0 0 0 9999px color-mix(in srgb, var(--brand) 8%, transparent); }

.ow-tone-ok { --ow-tone: var(--ok-fg); --ow-tone-bg: var(--ok-bg); --ow-tone-bd: var(--ok-bd); }
.ow-tone-attn { --ow-tone: var(--attn-fg); --ow-tone-bg: var(--attn-bg); --ow-tone-bd: var(--attn-bd); }
.ow-tone-err { --ow-tone: var(--err-fg); --ow-tone-bg: var(--err-bg); --ow-tone-bd: var(--err-bd); }
.ow-tone-info { --ow-tone: var(--info-fg); --ow-tone-bg: var(--info-bg); --ow-tone-bd: var(--info-bd); }
.ow-tone-muted { --ow-tone: var(--muted); --ow-tone-bg: var(--surface-2); --ow-tone-bd: var(--border); }
/* --- the lines (PU-54): the previous table's look — rules only between rows, a rounded header band on one
   line, the rows in one card; a line's issue opens Ordio's proposals; its checks unfold in a row of their own --- */
.ow-lines { min-width: 0; padding: var(--s3); background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow); }
.ow-sec-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
    padding: var(--s4) var(--s5); }
.ow-sec-head-page { display: block; padding: 0; }
.ow-sec-title { margin: 0; font-size: 1.05rem; font-weight: 600; }
.ow-sec-sub { margin: .2rem 0 0; font-size: .84rem; color: var(--muted); }
.ow-link { flex: none; display: inline-flex; align-items: center; gap: .2rem; font-size: .86rem; font-weight: 500;
    color: var(--brand-strong); text-decoration: none; white-space: nowrap; }
.ow-link:hover { text-decoration: underline; }
.ow-table-wrap { min-width: 0; }
/* PU-125: a table wider than its column scrolls inside its card, never under the rail; only then — a scroll box would
   clip the row's issue and ⋯ menus (order_lines.js sets is-wide) */
.ow-table-wrap.is-wide { overflow-x: auto; }
.ow-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .92rem; font-variant-numeric: tabular-nums; }
.ow-table th { text-align: left; font-weight: 500; font-size: .8rem; color: var(--muted); padding: .65rem .75rem;
    background: var(--surface-2); white-space: nowrap; }
.ow-table th:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.ow-table th:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.ow-table td { padding: .8rem .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ow-table th:first-child, .ow-table td:first-child { padding-left: var(--s4); }
.ow-table th:last-child, .ow-table td:last-child { padding-right: var(--s3); }
.ow-table .num { text-align: right; white-space: nowrap; }
/* a line that wants a person is tinted with a bar on its edge; one that is fine stays quiet */
.ow-table tbody tr.line-err td { background: var(--err-bg); }
.ow-table tbody tr.line-warn td { background: var(--attn-bg); }
.ow-table tbody tr.line-err td:first-child { box-shadow: inset var(--rail) 0 0 var(--err-fg); }
.ow-table tbody tr.line-warn td:first-child { box-shadow: inset var(--rail) 0 0 var(--attn-fg); }
.ow-table tbody tr.line-out td { color: var(--muted); }
/* a decided order: the work on its lines is over — the tints step back */
.ow-table.is-settled tbody tr.line-err td, .ow-table.is-settled tbody tr.line-warn td { background: var(--surface-2); }
.ow-table.is-settled tbody tr.line-err td:first-child, .ow-table.is-settled tbody tr.line-warn td:first-child {
    box-shadow: inset var(--rail) 0 0 var(--border-strong); }
.ow-table.is-settled .line-status { color: var(--muted); }
.ow-c-no { width: 2.25rem; color: var(--muted); }
/* the product takes what the narrow columns leave: they keep to one line and their own width */
.ow-table td.ow-c-code, .ow-table td.ow-c-qty, .ow-table .num { white-space: nowrap; }
.ow-table th, .ow-table td { padding-left: .6rem; padding-right: .6rem; }
.ow-c-prod { min-width: 12rem; }
.ow-c-more { width: 2.75rem; text-align: right; }
.ow-prod { display: block; font-weight: 600; color: var(--text); }

.ow-code { font-family: var(--font-mono); font-size: .86rem; color: var(--muted); }
.ow-dot { display: inline-block; flex: none; width: .6rem; height: .6rem; border-radius: 999px; background: currentColor; }
.ow-dot.is-ok { background: var(--ok-fg); }

.line-status { display: inline-flex; align-items: center; gap: .4rem; font-size: .86rem; font-weight: 600; }

.ow-line-note { display: block; margin: 0 0 .25rem; font-size: .84rem; color: var(--attn-fg); }

.ow-issue-form { flex: none; margin: 0; }

.ow-more-toggle { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; padding: 0;
    border: 0; border-radius: var(--radius-sm); background: none; color: var(--muted); cursor: pointer; }
.ow-more-toggle:hover { background: var(--surface-2); color: var(--text); }
.ow-more-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.ow-more-toggle .ico { transition: transform var(--dur-2) var(--ease); }
.ow-more-toggle[aria-expanded="true"] .ico { transform: rotate(180deg); }
.ow-table tbody tr.is-open td { border-bottom-color: transparent; }
.ow-line-more td { padding-top: 0; background: var(--surface); }
.ow-table tbody tr.line-err + .ow-line-more td, .ow-table tbody tr.line-warn + .ow-line-more td { background: var(--surface); }
.ow-line-order .ow-prod { font-weight: 500; color: var(--muted); }
.ow-chk-head { margin: 0 0 .35rem; font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
.ow-chk-head b { color: var(--text); font-weight: 600; }
.ow-chk-head .ico { vertical-align: -.15em; }
.ow-chk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.ow-chk { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: .25rem .6rem; font-size: .86rem; }
.ow-chk-ico { display: inline-flex; align-items: center; justify-content: center; width: 1.15rem; height: 1.15rem;
    margin-top: .05rem; border-radius: 999px; background: var(--ow-tone); color: var(--surface); }
.ow-chk.ow-tone-info .ow-chk-ico { background: var(--surface-3); color: var(--muted); }
.ow-chk-state { font-weight: 600; color: var(--ow-tone); }
.ow-chk.ow-tone-info .ow-chk-state, .ow-chk.ow-tone-info .ow-chk-name { color: var(--muted); }
.ow-chk-said { display: block; margin-top: .1rem; color: var(--muted); }
.ow-chk-src { font-size: .8rem; color: var(--muted); text-align: right; max-width: 22rem; overflow-wrap: anywhere; }

/* PU-55: a cell that can be corrected reads as text with a pencil; it opens as a field on hover and focus */
.ow-cell { position: relative; display: inline-flex; align-items: center; gap: .3rem; }
.ow-cell > .ico { flex: none; color: var(--muted); opacity: 0; transition: opacity var(--dur-1) var(--ease); }
.ow-cell-input { flex: none; border-color: transparent; background: transparent; }

.ow-c-qty .ow-cell { justify-content: flex-end; }
tr:hover .ow-cell > .ico, .ow-cell:focus-within > .ico { opacity: 1; }
tr:hover .ow-cell-input, .ow-cell-input:focus { border-color: var(--border-strong); background: var(--surface); }

.ow-cell.is-changed .ow-cell-input { border-color: var(--info-bd); background: var(--info-bg); color: var(--info-fg); font-weight: 600; }
.ow-cell.is-changed > .ico { opacity: 1; color: var(--info-fg); }
/* the save bar: with JavaScript it shows only while something changed, and then sticks to the window's bottom */
.ow-savebar { position: sticky; bottom: var(--s3); z-index: 15; display: flex; flex-wrap: wrap; align-items: center;
    gap: var(--s2) var(--s3); margin: var(--s3) 0 0; padding: .6rem var(--s4); border: 1px solid var(--info-bd);
    border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }

.ow-savebar .btn { display: inline-flex; align-items: center; gap: .35rem; }
.ow-js .ow-savebar:not(.is-dirty) { display: none; }
/* P10-04: a person adds a line, removes a line, sets the VIP number; PU-192: „Добави ред" in the table's foot */
.ow-vip-group { display: inline-flex; align-items: center; gap: .2rem; white-space: nowrap; }

.ow-more-item.is-danger, .ow-more-item.is-danger .ico { color: var(--err-fg); }
.ow-vip-set { display: inline-flex; align-items: center; gap: .2rem; padding: 0 .4rem; border: 0;
    border-radius: var(--radius-sm); background: none; color: var(--brand-strong); font: inherit; font-size: .8rem;
    font-weight: 500; line-height: 1.45rem; cursor: pointer; }
.ow-vip-set:hover { text-decoration: underline; }
.ow-vip-set:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.ow-vip-set.is-quiet { color: var(--muted); padding: 0 .25rem; }
.ow-table tfoot td { border-bottom: 0; padding-top: var(--s4); padding-bottom: .35rem; background: none; }

.ow-none td { padding: var(--s5); text-align: center; color: var(--muted); }
.ow-hint { font-size: .82rem; color: var(--muted); }

/* --- the letter ---------------------------------------------------------------------- */
.ow-letter { min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); }
.ow-letter-head { display: grid; gap: var(--s2); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--border); }
.ow-letter-subject { margin: 0; font-size: 1.1rem; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.ow-letter-meta { display: grid; gap: .15rem; margin: 0; font-size: .84rem; }
.ow-letter-meta > div { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: var(--s2); }
.ow-letter-meta dt { color: var(--muted); }
.ow-letter-meta dd { margin: 0; overflow-wrap: anywhere; }
.ow-letter-body { padding: var(--s4) var(--s5); }
.ow-text { margin: 0; max-width: 46rem; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font-ui);
    font-size: .95rem; line-height: 1.7; color: var(--text); }
.ow-text-quoted { color: var(--muted); font-size: .88rem; padding: var(--s3) var(--s4); background: var(--surface-2);
    border-radius: var(--radius-sm); }
.ow-quoted { margin-top: var(--s3); }
.ow-quoted > summary { cursor: pointer; font-size: .84rem; color: var(--muted); padding: .3rem 0; }
.ow-quoted > summary:hover { color: var(--text); }
.ow-quoted[open] > summary { margin-bottom: .35rem; }
.ow-empty { margin: 0; padding: var(--s3) var(--s4); font-size: .88rem; color: var(--muted);
    background: var(--surface-2); border-radius: var(--radius-sm); }
.ow-files { display: grid; gap: var(--s3); min-width: 0; }
.ow-files-h { margin: 0; font-size: 1rem; font-weight: 600; }
.ow-file-ico { flex: none; display: inline-flex; color: var(--muted); }
.ow-file-t { flex: 1 1 auto; min-width: 0; display: grid; }
.ow-file-name { font-size: .88rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ow-file-sub { font-size: .76rem; color: var(--muted); }

/* --- the thread ---------------------------------------------------------------------- */
.ow-thread { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.ow-msg { padding: var(--s4) var(--s5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); }
.ow-msg.is-own { border-color: var(--brand); }
.ow-msg-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem var(--s2); }
.ow-msg-who { font-weight: 600; }
.ow-msg-tag { font-size: .72rem; font-weight: 600; color: var(--brand-strong); background: var(--brand-soft);
    padding: 0 .5rem; border-radius: 999px; line-height: 1.4rem; }
.ow-msg-when { margin-left: auto; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ow-msg-subject { margin: .2rem 0 var(--s3); font-size: .86rem; color: var(--muted); }
.ow-msg .ow-text { max-width: none; }
.ow-msg-files { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s3) 0 0; padding: 0; }
.ow-msg-files a { display: inline-flex; align-items: center; gap: .3rem; font-size: .84rem; padding: .25rem .55rem;
    border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.ow-msg-files a:hover { border-color: var(--brand); color: var(--brand-strong); }

/* --- the reply ----------------------------------------------------------------------- */
.ow-reply { padding: var(--s5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); }
.ow-reply.is-older { background: var(--surface-2); }
.ow-reply-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); }
.ow-reply-head .ow-sec-title { margin-top: .25rem; }
.ow-reply-text { max-height: 32rem; overflow: auto; padding: var(--s3) var(--s4); background: var(--surface-2);
    border-radius: var(--radius-sm); max-width: none; }
.ow-reply-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3);
    margin-top: var(--s4); font-size: .86rem; }
.ow-reply-foot .btn { display: inline-flex; align-items: center; gap: .3rem; }
.ow-reply-draft { background: var(--attn-bg); color: var(--attn-fg); }
.ow-reply-approved, .ow-reply-sent { background: var(--ok-bg); color: var(--ok-fg); }
.ow-reply-rejected, .ow-reply-superseded { background: var(--surface-3); color: var(--muted); }

/* --- the history --------------------------------------------------------------------- */
.ow-events { list-style: none; margin: 0; padding: var(--s4) var(--s5); background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.ow-event { position: relative; display: flex; gap: var(--s3); padding: 0 0 var(--s4); }
.ow-event:last-child { padding-bottom: 0; }
.ow-event::before { content: ""; position: absolute; left: .3rem; top: 1rem; bottom: 0; width: 1px; background: var(--border); }
.ow-event:last-child::before { content: none; }
.ow-event-dot { flex: none; width: .65rem; height: .65rem; margin-top: .35rem; border-radius: 999px;
    background: var(--surface); border: 2px solid var(--brand); }
.ow-event.is-start .ow-event-dot { background: var(--brand); }
.ow-event-t { display: grid; gap: .1rem; }
.ow-event-what { font-size: .92rem; }
.ow-event-meta { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ow-event-text { font-size: .88rem; color: var(--text); font-style: italic; }
.ow-event.is-feedback .ow-event-dot { border-color: var(--attn-fg); }
.ow-event.is-edit .ow-event-dot { border-color: var(--info-fg); }
.ow-event.is-reply .ow-event-dot { border-color: var(--border-strong); }
.ow-event.is-quiet .ow-event-dot { border-color: var(--border-strong); }
.ow-event.is-quiet .ow-event-what { color: var(--muted); }

/* --- P10-01: why Ordio decided — the reason, the checks with their evidence, the proposals, the reply ---- */

.ow-checks, .ow-proposals, .ow-review { min-width: 0; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow); }

.ow-props { list-style: none; margin: 0; padding: 0 var(--s5) var(--s4); display: grid; gap: var(--s2); }
.ow-prop { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem var(--s3); padding: .55rem .75rem;
    border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: .9rem; }
.ow-prop.is-proposed { border-color: var(--ok-bd); background: var(--ok-bg); }
.ow-prop.is-past { background: var(--surface-2); }
.ow-prop-text { flex: 1 1 18rem; min-width: 0; overflow-wrap: anywhere; }
.ow-prop-flags { display: inline-flex; flex-wrap: wrap; gap: .3rem; }
.ow-prop-chip { padding: 0 .5rem; border-radius: 999px; font-size: .74rem; font-weight: 600; line-height: 1.35rem;
    background: var(--surface-3); color: var(--text); }
.ow-prop-chip.is-ok { background: var(--ok-bg); color: var(--ok-fg); border: 1px solid var(--ok-bd); }
.ow-prop-chip.is-muted { color: var(--muted); }
.ow-prop-chip.is-wait { display: inline-flex; align-items: center; gap: .25rem; background: var(--info-bg); color: var(--info-fg); border: 1px solid var(--info-bd); }
.ow-prop-by { font-size: .8rem; color: var(--muted); }
.ow-prop-chip.is-answer { display: inline-flex; align-items: center; gap: .25rem; background: var(--attn-bg); color: var(--attn-fg); border: 1px solid var(--attn-bd); }

.ow-prop-form { margin: 0; }
.ow-prop-form .btn { display: inline-flex; align-items: center; gap: .3rem; }
.ow-prop-mark { display: inline-flex; align-items: center; gap: .3rem; font-size: .84rem; font-weight: 600; color: var(--ok-fg); }
.ow-review-actions .btn { display: inline-flex; align-items: center; gap: .3rem; }
.ow-review { padding-bottom: var(--s4); }
/* PU-184: the act card — what Ordio did (info: Ordio's own action) or proposes (neutral), above the lines */
.ow-act-card { margin: 0 0 var(--s3); padding: var(--s3) var(--s4); border: 1px solid var(--ow-card-bd);
    border-left: var(--rail) solid var(--ow-card-bd); border-radius: var(--radius-sm); background: var(--surface); }
.ow-act-card.is-applied { border-left-color: var(--ow-info-bd); background: var(--ow-info-bg); }
.ow-act-card.is-settled { opacity: .8; }
/* PU-185: what MLM-PRO still owes — the act card's frame in the attention tone, said above the act cards */
.ow-mlm-card { margin: 0 0 var(--s3); padding: var(--s3) var(--s4); border: 1px solid var(--ow-card-bd);
    border-left: var(--rail) solid var(--ow-warn-bd); border-radius: var(--radius-sm); background: var(--surface); }
.ow-mlm-say { margin: var(--s2) 0 0; color: var(--ow-text-2); }
.ow-act-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s1) var(--s2); }
.ow-act-ico { display: inline-flex; align-self: center; color: var(--ow-info-ink); }
.ow-act-title { margin: 0; font-size: .98rem; font-weight: 600; color: var(--ow-ink); }
.ow-act-meta { color: var(--ow-text-2); font-size: .85rem; }
.ow-act-quote { margin: var(--s2) 0 0; font-style: italic; color: var(--ow-ink); overflow-wrap: anywhere; }
.ow-act-diff { list-style: none; margin: var(--s2) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3);
    font-variant-numeric: tabular-nums; }
.ow-act-code { color: var(--ow-text-2); }
/* PU-182: a cancelled order's receipt it voids, beside the state */
.ow-band-badge { margin-left: var(--s1); font-weight: 500; font-size: .8rem; vertical-align: middle; }
/* PU-182 „Сравни": the two orders' lines side by side — a code per row, the differing quantity in the attention tone */
.ow-compare-wrap { margin: var(--s2) 0 0; max-width: 100%; overflow-x: auto; }
.ow-compare { border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .9rem; }
.ow-compare th, .ow-compare td { padding: var(--s1) var(--s3); text-align: right; border-bottom: 1px solid var(--ow-card-bd); }
.ow-compare th:first-child { text-align: left; font-weight: 400; }
.ow-compare thead th { font-weight: 600; color: var(--ow-ink); vertical-align: bottom; }
.ow-compare-vip { display: block; font-weight: 400; font-size: .8rem; color: var(--ow-text-2); }
.ow-compare tr.is-diff td { background: var(--ow-warn-bg); color: var(--ow-warn-ink); font-weight: 600; }
.ow-act-link { margin: var(--s2) 0 0; font-size: .9rem; }
.ow-act-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
.ow-act-form { display: contents; }
.ow-act-choices, .orgnew-form .ow-act-choices { display: grid; gap: var(--s2); margin: var(--s3) 0; padding: 0; border: 0;
    grid-column: 1 / -1; width: 100%; min-width: 0; }
.ow-act-choices label, .orgnew-form .ow-act-choices label { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.ow-act-choices select { max-width: 100%; }
.ow-act-hint { color: var(--ow-text-2); }
/* PU-186: why the approve button waits — a proposal on the order, settled on its card */
.ow-act-why { margin: 0; color: var(--ow-text-2); font-size: .8125rem; line-height: 1.4; }
.ow-chain-list { list-style: none; margin: 0; padding: var(--s3) var(--s5); display: grid; gap: var(--s2);
    background: var(--surface); border-radius: var(--radius-sm); }
.ow-chain-item.is-current .ow-chain-head { font-weight: 600; }
.ow-chain-head, .ow-chain-act { margin: 0; }
.ow-chain-act { color: var(--ow-text-2); font-size: .88rem; padding-left: var(--s3); }
.ow-review-text { margin: 0 var(--s5); max-height: 24rem; overflow: auto; padding: var(--s3) var(--s4);
    background: var(--surface-2); border-radius: var(--radius-sm); max-width: none; }
.ow-review-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin: var(--s3) var(--s5) 0; }
.ow-reply-kind { margin: .2rem 0 0; font-size: .84rem; color: var(--muted); }

.ow-fix .orgnew-form > p { grid-column: 1 / -1; }
.ow-fix-actions { flex-wrap: wrap; }
.ow-sub-title { margin: var(--s4) 0 var(--s2); font-size: .95rem; font-weight: 600; }
.ow-decisions { margin-bottom: var(--s4); }
.ow-dec-list { list-style: none; margin: 0; padding: var(--s3) var(--s5); display: grid; gap: var(--s3); background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.ow-dec { display: grid; gap: .15rem; font-size: .9rem; }
.ow-dec + .ow-dec { padding-top: var(--s3); border-top: 1px solid var(--border); }
.ow-dec-head { font-variant-numeric: tabular-nums; }
.ow-dec-reason { white-space: pre-line; overflow-wrap: anywhere; color: var(--text); }
.ow-dec-kept { font-size: .82rem; }
.oq-relation { display: inline-flex; align-items: center; gap: .25rem; margin-left: .4rem; padding: 0 .45rem;
    border-radius: 999px; font-size: .74rem; font-weight: 600; line-height: 1.3rem; background: var(--info-bg); color: var(--info-fg); }
.oq-relation a { position: relative; z-index: 1; color: inherit; }

.cv-question { max-width: 36rem; overflow-wrap: anywhere; }

/* --- disagreements (P10-02): a person's correction beside Ordio's decision -------------- */
.ow-dec-fix { padding-left: var(--s3); border-left: var(--rail) solid var(--attn-bd); }
.ow-fix-why, .ow-why { display: grid; gap: var(--s2); grid-column: 1 / -1; }
.ow-why-hint { margin: 0; font-size: .82rem; }
/* PU-192: „С твои думи (по желание)" — one label line, the aside quiet */
.ow-why-l { display: block; }
.ow-why-opt { font-weight: 400; color: var(--muted); }

.dg-tabs { margin: var(--s3) 0; }
.dg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s4); }
.dg-card { display: grid; gap: var(--s3); padding: var(--s4) var(--s5); }
.dg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s3); flex-wrap: wrap; }
.dg-what { margin: 0; font-size: 1rem; font-weight: 600; }
.dg-what a { color: inherit; }
.dg-meta { margin: .15rem 0 0; font-size: .85rem; font-variant-numeric: tabular-nums; }
.dg-meta a { text-decoration: underline; }
.dg-age { padding: 0 .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; line-height: 1.5rem;
    background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.dg-age-late { background: var(--attn-bg); color: var(--attn-fg); }
.dg-reason { margin: 0; overflow-wrap: anywhere; }
.dg-sides { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: var(--s3); }
.dg-side { padding: var(--s3); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.dg-side-person { border-color: var(--attn-bd); }
.dg-side-title { margin: 0 0 var(--s2); font-size: .85rem; font-weight: 600; color: var(--muted); }
.dg-state, .dg-total { margin: 0; font-size: .9rem; overflow-wrap: anywhere; }
.dg-lines { margin: var(--s2) 0; padding-left: 1.1rem; font-size: .9rem; font-variant-numeric: tabular-nums; }
.dg-draft { max-height: 12rem; overflow: auto; }
.dg-config { margin: 0; font-size: .82rem; }
.dg-verdicts { margin: 0; padding-left: 1.1rem; display: grid; gap: .2rem; font-size: .88rem; }
.dg-verdict-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s3); }
.dg-verdict-form .orgnew-field { min-width: 12rem; }

/* --- an empty tab -------------------------------------------------------------------- */
.ow-blank { display: grid; justify-items: center; gap: .35rem; padding: var(--s7) var(--s5); text-align: center;
    background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.ow-blank-ico { display: inline-flex; align-items: center; justify-content: center; width: 3rem; height: 3rem;
    margin-bottom: var(--s2); border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.ow-blank-t { margin: 0; font-weight: 600; }
.ow-blank-s { margin: 0; max-width: 28rem; font-size: .88rem; color: var(--muted); }
.ow-elsewhere { margin: 0; font-size: .84rem; color: var(--muted); }
.ow-elsewhere a { display: inline-flex; align-items: center; gap: .35rem; }

/* --- narrower screens ------------------------------------------------------------------ */
@media (max-width: 720px) {
    .ow-title { font-size: 1.2rem; }
    .ow-hd .ow-tabs { gap: var(--s4); }
    .ow-sec-head { flex-wrap: wrap; padding: var(--s3) var(--s4); }
    /* the lines become cards: one product per block, its numbers under it */
    .ow-table thead { display: none; }
    .ow-table, .ow-table tbody, .ow-table tfoot { display: block; }
    .ow-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .35rem var(--s3);
        padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); }
    .ow-table tbody tr.line-err { background: var(--err-bg); }
    .ow-table tbody tr.line-warn { background: var(--attn-bg); }
    /* PX-381: a card on the warning or error ground: its grey a step lighter in the dark theme */
    .ow-table tbody tr.line-warn, .ow-table tbody tr.line-err { --muted: var(--muted-on-tint); --ow-text-2: var(--muted-on-tint); }
    .ow-table tbody tr.line-err td, .ow-table tbody tr.line-warn td { background: none; }
    .ow-table tbody td { display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
        padding: 0; border: 0; background: none; }
    .ow-table th:first-child, .ow-table td:first-child, .ow-table th:last-child, .ow-table td:last-child { padding: 0; }
    .ow-table tbody td::before { content: attr(data-label); font-size: .76rem; color: var(--muted); }
    .ow-table tbody td.ow-c-no { display: none; }
    .ow-table tbody td.ow-c-prod { grid-column: 1 / -1; display: block; }
    .ow-table tbody td.ow-c-prod::before { content: none; }

    .ow-c-code, .ow-c-qty, .ow-c-money, .ow-c-offer, .ow-c-more { width: auto; }
    /* PU-54: the toggle closes the card; the unfolded checks span it */
    .ow-table tbody td.ow-c-more { grid-column: 1 / -1; justify-content: flex-end; }
    .ow-table tbody td.ow-c-more::before, .ow-table tbody tr.ow-line-more td::before { content: none; }
    .ow-table tbody tr.ow-line-more td:first-child { display: none; }
    .ow-table tbody tr.ow-line-more td { grid-column: 1 / -1; display: block; }
    .ow-chk { grid-template-columns: auto minmax(0, 1fr); }
    .ow-chk-src { grid-column: 2; text-align: left; }

    .ow-table tfoot tr { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: baseline;
        gap: var(--s3); padding: var(--s3) var(--s4); background: var(--surface-2); border-radius: 0 0 calc(.875rem - 1px) calc(.875rem - 1px); }
    /* PU-192: the reply's text and buttons on the heading's edge */
    .ow-review-text { margin: 0 var(--s4); }
    .ow-review-actions { margin: var(--s3) var(--s4) 0; }
    .ow-table tfoot td { display: block; padding: 0; }

    .ow-letter-head, .ow-letter-body { padding: var(--s3) var(--s4); }
    .ow-letter-meta > div { grid-template-columns: 4.5rem minmax(0, 1fr); }
    .ow-msg { padding: var(--s3) var(--s4); }
    .ow-msg-when { margin-left: 0; flex-basis: 100%; }
}
/* ============================================================
   The settings area and the side menu's other screens (PU-12)

   One frame, one vocabulary. Every screen here is a page head (title, a line
   of what the page is for, its one or two actions on the right) followed by
   cards that each open with an icon, a name and a sentence of purpose. The
   four settings screens share a section menu of their own, so moving between
   them is a click on the left rather than a trip back through the main menu.
   Nothing here adds a colour: the cards are surfaces, the icons are muted,
   and green stays where it means something — the current section, the main
   action, „свързана".
   ============================================================ */

/* ---------- The page head, split: words on the left, actions on the right ---------- */
.page-head.is-split {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: var(--s4) var(--s5); flex-wrap: wrap; margin-bottom: var(--s5);
}
.page-head-text { flex: 1 1 22rem; min-width: 0; }
.page-head.is-split .page-title { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.page-lead { margin: var(--s1) 0 0; color: var(--muted); max-width: 70ch; line-height: 1.55; }
.page-actions { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.page-actions form { margin: 0; display: inline-flex; }
/* Where the page sits, above its title — a way back that reads as a place. */
.page-crumb {
    display: inline-flex; align-items: center; gap: var(--s1); margin: 0 0 var(--s2);
    color: var(--muted); font-size: .86rem; font-weight: 500;
}
.page-crumb:hover { color: var(--brand); text-decoration: none; }

/* A section heading between cards keeps its distance from the card above it —
   it belongs to what follows, and glued to what precedes it read as a caption. */
.card + .section-h, .table-card + .section-h, .counter-grid + .section-h,
.set-group + .section-h, .set-card + .section-h { margin-top: var(--s6); }

/* ---------- The settings frame ----------
   The menu is a row of tabs across the top at every width (owner, 02.10.2026, PU-47): the
   screen below takes the full width, so a wide one such as the team table fits its card.
   On a narrow window the row scrolls sideways inside itself and never wraps into a block. */
.set-layout { display: flex; flex-direction: column; gap: var(--s4); }
.set-main { min-width: 0; }

.set-nav {
    display: flex; flex-wrap: nowrap; gap: var(--s1); overflow-x: auto;
    padding-bottom: 2px; border-bottom: 1px solid var(--border);
    scrollbar-width: none;
}
.set-nav::-webkit-scrollbar { display: none; }
.set-nav-item {
    position: relative; flex: none; display: flex; align-items: center; gap: var(--s2);
    padding: 0.625rem 0.875rem; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    color: var(--text); white-space: nowrap;
    transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}
.set-nav-item:hover { background: var(--surface-2); text-decoration: none; }
.set-nav-item[aria-current="page"] { color: var(--brand); }
.set-nav-item[aria-current="page"]::before {
    content: ""; position: absolute; left: 0.5rem; right: 0.5rem; bottom: -3px;
    height: var(--rail); border-radius: var(--rail) var(--rail) 0 0; background: var(--brand);
}
.set-nav-icon { flex: none; display: flex; color: var(--muted); }
.set-nav-item[aria-current="page"] .set-nav-icon { color: var(--brand); }
.set-nav-label { font-weight: 600; font-size: .92rem; line-height: 1.3; }

/* ---------- A card that says what it is for ----------
   The settings group and every other card of these screens open the same way:
   an icon in a quiet tile, the name, one sentence of purpose. */
.set-group, .set-card {
    background: var(--surface); border: 1px solid var(--tile-bd);
    border-radius: var(--radius); box-shadow: var(--tile-shadow);
}
.set-group + .set-group, .set-card + .set-card, .set-group + .set-card, .set-card + .set-group,
.readonly-note + .set-group, .readonly-note + .set-form { margin-top: var(--s4); }
.set-group-head {
    display: flex; align-items: flex-start; gap: var(--s3);
    padding: 1.125rem 1.375rem; border-bottom: 1px solid var(--border);
}
.set-group-head.is-bare { border-bottom: 0; padding-bottom: 0.25rem; }
.set-group-head .set-group-aside { margin-left: auto; align-self: center; flex: none; }
.set-group-icon {
    flex: none; display: flex; align-items: center; justify-content: center;
    width: 2.25rem; height: 2.25rem; border-radius: var(--radius-sm);
    background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
}
.set-group-title { margin: 0; font-size: 1.02rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.35; }
.set-group-desc { margin: 2px 0 0; color: var(--muted); font-size: .86rem; line-height: 1.45; }
.set-group-body { padding: 0 1.375rem; }
.set-card-body { padding: 1.125rem 1.375rem 1.375rem; }
/* PU-113: a card's one-time setup steps, folded under „Как се прави" */
.set-how { margin-top: var(--s3); color: var(--muted); font-size: .86rem; line-height: 1.5; }
.set-how > summary { width: fit-content; cursor: pointer; color: var(--brand-strong); font-weight: 500; }
.set-how > p { margin: var(--s2) 0 0; }
.set-card-foot {
    padding: 0.875rem 1.375rem; border-top: 1px solid var(--border);
    color: var(--muted); font-size: .84rem;
}
.set-card-foot p { margin: 0; }
/* A table inside a titled card runs edge to edge under the head. */
.set-card > .table-scroll, .set-card > table { border-top: 0; }
.set-card .emails-table { margin: 0; }
.set-card .emails-table th:first-child, .set-card .emails-table td:first-child { padding-left: 1.375rem; }
.set-card .emails-table th:last-child, .set-card .emails-table td:last-child { padding-right: 1.375rem; }

/* One setting: what it is and what it does on the left, the control in one
   fixed column on the right — close enough to be read as one line. */
.set-group .setting-row {
    grid-template-columns: minmax(0, 1fr) minmax(13rem, 20rem);
    gap: var(--s3) var(--s6); padding: 1.125rem 0; align-items: center;
    border-bottom: 0; border-top: 1px solid var(--border);
}
.set-group .setting-row:first-child { border-top: 0; }
.set-group .setting-meta label, .set-group .setting-meta .setting-name { font-weight: 600; font-size: .95rem; }
.set-group .setting-help { margin: 3px 0 0; font-size: .86rem; line-height: 1.45; max-width: 60ch; }
.set-group .setting-input { justify-self: stretch; }
.set-group .setting-input textarea { min-height: 4.5rem; resize: vertical; line-height: 1.45; }
.set-group .setting-input textarea.mono { min-height: 9rem; }
/* A yes/no setting is a switch, sitting where the other controls start. */
.set-group .setting-input input[type=checkbox] {
    width: 2.5rem; height: 1.375rem; border-radius: 999px; transition: background var(--dur-2) var(--ease);
}
.set-group .setting-input input[type=checkbox]::after,
.set-group .setting-input input[type=checkbox]:checked::after {
    content: ""; position: absolute; top: 0.125rem; left: 0.125rem; width: 1rem; height: 1rem;
    border: 0; border-radius: 50%; background: var(--muted); transform: none;
    transition: transform var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}
.set-group .setting-input input[type=checkbox]:checked::after {
    background: var(--on-brand); transform: translateX(1.125rem);
}
/* PU-192: the switch says its state in a word */
.setting-input:has(> .setting-state) { display: flex; align-items: center; gap: var(--s2); }
.setting-state { font-size: .875rem; font-weight: 600; color: var(--muted); }
.setting-state .is-on, input:checked + .setting-state .is-off { display: none; }
input:checked + .setting-state .is-on { display: inline; color: var(--ow-green); }
/* Read-only: the value, set like a value rather than like a sentence. */
.set-group .setting-static {
    padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); background: var(--surface-2);
    border: 1px solid transparent; font-weight: 500; color: var(--text);
}
@media (max-width: 720px) {
    .set-group .setting-row { grid-template-columns: minmax(0, 1fr); gap: var(--s2); }
    .set-group-head, .set-group-body, .set-card-body, .set-card-foot { padding-left: 1rem; padding-right: 1rem; }
    .set-card .emails-table th:first-child, .set-card .emails-table td:first-child { padding-left: 1rem; }
}

/* ---------- Read only ---------- */
.readonly-note {
    display: flex; align-items: center; gap: var(--s3); margin: 0 0 var(--s4);
    padding: 0.75rem 1rem; border-radius: var(--radius);
    background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-size: .9rem;
}
.readonly-note strong { color: var(--text); font-weight: 600; }
.readonly-note .ico { flex: none; }

/* ---------- The save bar ----------
   It sits after the last group, quiet, saying there is nothing to save. The
   moment a field changes it rises to the bottom edge of the window and stays
   there — the reader is never more than a glance from „Запази" and never in
   doubt whether what is on the screen is what is stored. */
.save-bar { margin-top: var(--s4); z-index: 20; }
.save-bar.is-dirty { position: sticky; bottom: var(--s4); }
.save-bar-inner {
    display: flex; align-items: center; justify-content: space-between; gap: var(--s3) var(--s4);
    flex-wrap: wrap; padding: 0.75rem 0.875rem 0.75rem 1.25rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: box-shadow var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
}
.save-bar.is-dirty .save-bar-inner { border-color: var(--attn-bd); box-shadow: var(--shadow-lift); }
.save-bar-state { display: flex; align-items: center; gap: var(--s2); margin: 0; color: var(--muted); font-size: .9rem; }
.save-bar-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--ok-fg); flex: none; }
.save-bar.is-dirty .save-bar-dot { background: var(--attn-fg); }
.save-bar.is-dirty .save-bar-state { color: var(--text); font-weight: 500; }
.save-bar-actions { display: flex; gap: var(--s2); margin-left: auto; }
.save-bar .btn[disabled] { opacity: .5; cursor: default; }
.save-bar .btn-ghost[disabled]:hover { border-color: var(--border); }

/* ---------- Avatars: initials in a quiet disc ---------- */
.avatar {
    flex: none; display: inline-flex; align-items: center; justify-content: center;
    width: 2rem; height: 2rem; border-radius: 50%;
    background: var(--surface-3); color: var(--text); border: 1px solid var(--border);
    font-size: .74rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
}
.avatar.is-me { background: var(--brand-soft); color: var(--brand); border-color: transparent; }

.person-cell { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.person-cell-name { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; min-width: 0; }
@media (max-width: 600px) {
    .list-table td.person-td { display: flex; }
    .list-table td.person-td::before { content: none; }
    .list-table .person-cell-name strong { white-space: normal; } /* PU-110: a long name wraps on a phone */
}

/* ---------- Моят профил ---------- */
.profile-hero {
    display: flex; align-items: center; gap: var(--s4) var(--s5); flex-wrap: wrap;
    padding: 1.375rem; margin-bottom: var(--s4);
}
.profile-id { flex: 1 1 14rem; min-width: 0; }
.profile-name { margin: 0; font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.profile-meta {
    display: flex; align-items: center; gap: 0.375rem var(--s2); flex-wrap: wrap;
    margin: 0.375rem 0 0; color: var(--muted); font-size: .88rem;
}
.profile-stats {
    display: grid; grid-template-columns: repeat(4, minmax(5.5rem, 1fr)); gap: 0;
    margin: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden;
}
.profile-stat { padding: 0.625rem 1rem; background: var(--surface-2); }
.profile-stat + .profile-stat { border-left: 1px solid var(--border); }
.profile-stat dt { color: var(--muted); font-size: .76rem; white-space: nowrap; }
.profile-stat dd {
    margin: 2px 0 0; font-size: 1.35rem; font-weight: 600; line-height: 1.15;
    font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.profile-stat:first-child dd { color: var(--brand); }
@media (max-width: 520px) {
    .profile-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .profile-stat:nth-child(3) { border-left: 0; }
    .profile-stat:nth-child(n + 3) { border-top: 1px solid var(--border); }
}
.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.625rem; }
.check-list li { display: flex; gap: var(--s2); align-items: flex-start; line-height: 1.45; font-size: .92rem; }
.check-list .ico { flex: none; margin-top: 3px; color: var(--ok-fg); }
.login-list { list-style: none; margin: 0; padding: 0; }
.login-list li {
    display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
    padding: 0.625rem 0; border-top: 1px solid var(--border); font-size: .92rem;
}
.login-list li:first-child { border-top: 0; padding-top: 0; }
.login-list .ico { color: var(--muted); }
.login-when { display: flex; align-items: center; gap: var(--s2); }
.login-now { font-size: .74rem; font-weight: 600; color: var(--ok-fg); background: var(--ok-bg); border-radius: 999px; padding: 1px 0.5rem; }

/* Изглед: two labelled rows inside the card. */
.look-row + .look-row { margin-top: var(--s5); }
.look-label { margin: 0 0 var(--s3); font-size: .78rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }

/* ---------- Хора и права ---------- */
.people-table td { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.people-table .role-select { min-width: 9rem; }
.people-table .role-fixed { display: inline-flex; align-items: center; gap: 0.375rem;
    min-height: 2.5rem; padding-left: calc(0.5625rem + 1px); } /* PU-192: as tall as the select beside it, its words where the select's start */
.people-table .role-fixed .ico { color: var(--muted); }

/* The add-person dialog reuses the new-organization form's grid. */
.form-dialog .orgnew-form .orgnew-field input, .form-dialog .orgnew-form .orgnew-field select { width: 100%; }
.dialog-x {
    position: absolute; top: 0.875rem; right: 0.875rem; display: flex; padding: 0.375rem;
    border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer;
}
.dialog-x:hover { color: var(--text); background: var(--surface-2); }
.orgnew-head { padding-right: 2.5rem; }

/* ---------- Пощенски кутии ---------- */

.mbx-icon {
    flex: none; display: flex; align-items: center; justify-content: center;
    width: 2.25rem; height: 2.25rem; border-radius: var(--radius-sm);
    background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
}

.mbx-name { font-size: 1rem; font-weight: 600; overflow-wrap: anywhere; }
.mbx-actions { display: flex; gap: var(--s2); flex-wrap: wrap; margin: 0; }
.mbx-error {
    display: flex; gap: var(--s2); align-items: flex-start; margin: 0 1.25rem 0.875rem 1.375rem;
    padding: 0.625rem 0.75rem; border-radius: var(--radius-sm);
    background: var(--err-bg); color: var(--err-fg); font-size: .86rem; line-height: 1.45;
}
.mbx-error .ico { flex: none; margin-top: 2px; }

.mbx-since { display: flex; gap: 0.375rem; align-items: center; flex-wrap: wrap; margin: 0; }
.mbx-since input[type=date] { min-height: 2rem; padding: 0.25rem 0.5rem; font-size: .88rem; max-width: 10.5rem; }
@media (max-width: 640px) {

    .mbx-actions { width: 100%; }
}
.connect-form { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: var(--s3); align-items: end; }
.connect-form label { display: flex; flex-direction: column; gap: 0.3125rem; font-weight: 600; font-size: .86rem; }
.connect-form input { width: 100%; font-weight: 400; }
/* PX-280: the read-only choice — its own row under the fields, a checkbox beside its words */
.connect-form .connect-check { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: var(--s2); }
.connect-form .connect-check input { width: 1.1875rem; flex: none; }
.connect-form .connect-check .muted { font-weight: 400; }
/* PU-101: where a popup connect ends — a small card, centered, for the moment before the window closes */
.connect-done { max-width: 32rem; margin: var(--s7) auto; padding: 0 var(--s4); }
.connect-done-card { padding: var(--s5); }
.connect-done-card .set-group-title { display: flex; align-items: center; gap: var(--s2); margin: 0 0 var(--s3); }
.connect-hint { margin: var(--s3) 0 0; color: var(--muted); font-size: .84rem; line-height: 1.5; max-width: 72ch; }
@media (max-width: 720px) { .connect-form { grid-template-columns: minmax(0, 1fr); } }

/* ---------- An empty state that still points somewhere ---------- */
.empty-block {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s2);
    padding: 2.75rem 1.5rem;
}

.empty-block p { margin: 0; color: var(--muted); max-width: 52ch; font-size: .9rem; }

/* ---------- The counter tiles fill their row ---------- */
.counter-grid { margin-bottom: var(--s5); }

/* ---------- Как работи ---------- */
.how-section + .how-section { margin-top: var(--s6); }
.how-path {
    list-style: none; margin: 0; padding: 0; counter-reset: how;
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3);
}
.how-path li {
    position: relative; padding: 1.125rem 1.125rem 1.25rem; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.how-step-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s3); }
.how-num {
    display: inline-flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem;
    border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: .85rem;
}
.how-step-icon { color: var(--muted); display: flex; }
.how-path h3 { margin: 0 0 0.375rem; font-size: 1rem; }
.how-path p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.how-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: var(--s3); }
.how-tile {
    padding: 1rem 1.125rem; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
}
.how-tile p { margin: var(--s2) 0 0; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.how-buttons { margin: 0; }
.how-buttons > div {
    display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: var(--s4); align-items: baseline;
    padding: 0.875rem 1.375rem; border-top: 1px solid var(--border);
}
.how-buttons > div:first-child { border-top: 0; }
.how-buttons dd { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.how-callout {
    display: flex; gap: var(--s4); align-items: flex-start; margin-top: var(--s6);
    padding: 1.25rem 1.375rem; border-radius: var(--radius);
    background: var(--attn-bg); border: 1px solid var(--attn-bd);
}
.how-callout .ico { flex: none; color: var(--attn-fg); margin-top: 2px; }
.how-callout h2 { margin: 0 0 0.375rem; font-size: 1rem; }
.how-callout p { margin: 0; font-size: .9rem; line-height: 1.55; }
.how-callout p + p { margin-top: var(--s2); }
@media (max-width: 1000px) { .how-path { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
    .how-path { grid-template-columns: minmax(0, 1fr); }
    .how-buttons > div { grid-template-columns: minmax(0, 1fr); gap: var(--s2); }
}

/* ---------- An organization (PX-166, the owner's variant 4) ----------
   The counters are a strip at the bottom of the hero card; under it one row of
   three equal cards (who, where, whose key), each acting from its foot on the
   right; the working settings follow at full width. */
.hero-stats {
    display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0;
    margin: 0; border-top: 1px solid var(--border);
}
/* PU-192: however many counters, they share the row — the phone's two-to-a-row rule is not theirs */
@media (max-width: 600px) { .hero-stats.counter-grid { grid-template-columns: none; } }

/* PU-181: the AI period by task — the organization's rows, then the platform-key line under its own rule */

@media (max-width: 720px) {

    /* the hero's buttons: full width, the way in first */
    .page-hero .page-actions { flex-direction: column; align-items: stretch; }
    .page-hero .page-actions form, .page-hero .page-actions .btn { display: flex; width: 100%; justify-content: center; }
    .page-hero .page-actions form:last-child { order: -1; }
}

.mini-empty { padding: 1rem 1.125rem; margin: 0; color: var(--muted); font-size: .88rem; }

/* ---------- AI система ---------- */

.key-list { list-style: none; margin: 0; padding: 0; }
.key-item {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: var(--s3) var(--s5);
    align-items: center; padding: 1rem 1.375rem; border-top: 1px solid var(--border);
}
.key-item:first-child { border-top: 0; }
.key-who { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.key-who-name { display: block; font-weight: 600; font-size: .94rem; }
.key-who-sub { display: block; color: var(--muted); font-size: .8rem; }
.key-state { display: block; margin-top: var(--s1); }
.key-edit { min-width: 0; }
.ai-key-row { display: flex; gap: var(--s2); align-items: center; flex-wrap: nowrap; margin: 0; }
.key-field { flex: 1 1 auto; min-width: 0; }
.ai-key-row .pw-wrap { width: 100%; }
.key-field input { width: 100%; font-family: var(--font-mono); font-size: .88rem; }
.key-field input::placeholder { font-family: var(--font-ui); } /* PU-192: the hint is words, the key is code */
.ai-key-row .btn { flex: none; }
/* Removing a key is not a neighbour of saving one (PU-49): a gap and a rule between them. */
.ai-key-row .ai-key-clear { position: relative; margin-left: var(--s5); }
.ai-key-row .ai-key-clear::before {
    content: ""; position: absolute; left: calc(-1 * var(--s3) - 0.5px); top: 15%; bottom: 15%;
    border-left: 1px solid var(--border);
}
@media (max-width: 760px) {
    .key-item { grid-template-columns: minmax(0, 1fr); }
    .ai-key-row { flex-wrap: wrap; }
    .key-field { flex-basis: 100%; }
}

/* ---------- Система: the offer senders ---------- */
.sender-list { list-style: none; margin: 0; padding: 0; }
.sender-list li {
    display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap;
    padding: 0.75rem 1.375rem; border-top: 1px solid var(--border);
}
.sender-list li:first-child { border-top: 0; }
.sender-addr { flex: 1 1 14rem; min-width: 0; display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; font-weight: 600; }
.sender-actions { display: flex; gap: var(--s2); margin: 0; }
.sender-add { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.sender-add input { flex: 1 1 16rem; min-width: 0; }

/* ---------- Django админ ---------- */
.warn-callout {
    display: flex; gap: var(--s3); align-items: flex-start; margin-top: var(--s4);
    padding: 1rem 1.25rem; border-radius: var(--radius);
    background: var(--attn-bg); border: 1px solid var(--attn-bd); color: var(--text); line-height: 1.55; font-size: .92rem;
}
.warn-callout .ico { flex: none; color: var(--attn-fg); margin-top: 2px; }

/* ---------- Офертен имейл ---------- */
.omb { max-width: 44rem; }

.omb-row { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; justify-content: space-between; }
.omb-row form { margin: 0; }
.omb-row-text { flex: 1 1 18rem; min-width: 0; }
.omb-row-text strong { display: flex; align-items: center; gap: var(--s2); font-size: .94rem; }
.omb-row-text p { margin: 3px 0 0; color: var(--muted); font-size: .86rem; }
.omb-connect { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: flex-end; }
.omb-connect label { display: flex; flex-direction: column; gap: 0.3125rem; font-weight: 600; font-size: .86rem; flex: 1 1 18rem; }
.omb-connect input { width: 100%; font-weight: 400; }

.prose { margin: 0 0 var(--s3); line-height: 1.6; max-width: 72ch; }
.prose:last-child { margin-bottom: 0; }
#mbx-region + .set-card { margin-top: var(--s4); }
.key-note { font-size: .82rem; }
.set-card-foot p { display: flex; align-items: center; gap: var(--s2); }

.set-form + .set-card, .set-form + .section-h { margin-top: var(--s5); }
.activity { display: flex; flex-direction: column; gap: 2px; font-size: .88rem; line-height: 1.4; }
.person-cell-name strong { white-space: nowrap; }
.people-table .person-actions { flex-wrap: nowrap; }
.mbx-since-edit { position: relative; }
.mbx-since-edit > summary { list-style: none; cursor: pointer; }
.mbx-since-edit > summary::-webkit-details-marker { display: none; }
.mbx-since-edit[open] > summary { display: none; }
.mbx-since-edit .mbx-since { display: flex; }
.profile-meta-item { display: inline-flex; align-items: center; gap: 0.375rem; }
.profile-meta-item .ico { color: var(--muted); opacity: .8; }
@media (max-width: 1100px) { .people-table .person-actions { flex-wrap: wrap; justify-content: flex-start; } }
/* A marker, not a word of the label (PU-49: „Интервал на проверка (сек) техническа" read as one
   sentence): a filled chip, set apart from the label's words. */
.set-group .setting-meta .badge {
    margin-top: var(--s1); vertical-align: middle; background: var(--surface-3); color: var(--muted);
    border: 1px solid var(--border); font-size: .7rem; font-weight: 600; letter-spacing: .02em;
}
.set-group .setting-meta label + .badge, .set-group .setting-meta .setting-name + .badge { margin-left: var(--s2); }
.person-cell-text { display: flex; flex-direction: column; min-width: 0; }
.person-cell-name { flex-wrap: nowrap; }
.activity > span { white-space: nowrap; }
.person-actions .btn, .person-actions summary.btn { white-space: nowrap; }

/* A menu word never breaks over two lines: the active row's chevron used to push
   „Пощенски кутии" onto a second one, a row twice the height of its neighbours. */
.sidenav .navitem > span { flex: 1 1 auto; min-width: 0; white-space: nowrap; }
.sidenav .navitem.active::after { margin-left: -0.375rem; margin-right: -0.375rem; }
/* Links inside running text are underlined — colour alone does not tell a link
   apart for everyone (axe: link-in-text-block). */
.page-lead a, .set-group-desc a, .prose a, .connect-hint a { text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 600px) {
    /* A long address or name in a stacked row wraps instead of pushing the page sideways. */
    .set-main .list-table td, .set-main .list-table td.nowrap { white-space: normal; overflow-wrap: anywhere; min-width: 0; }
    .set-main .list-table td > * { min-width: 0; }
    .activity > span { white-space: normal; }
    .person-cell-name { flex-wrap: wrap; }
}
/* Green words on the soft green ground take the stronger green: the plain one
   sits just under 4.5:1 there in the dark theme. */
.avatar.is-me, .content .urole.role-admin, .ui-size[aria-pressed="true"] .ui-size-note { color: var(--brand-strong); }

/* The sandbox banner sticks while the page scrolls; its tinted ground laid over
   the page's own, so the text passing under it does not show through. */
.devdb-bar { background: linear-gradient(var(--sandbox-bg), var(--sandbox-bg)), var(--bg); }

/* --- attachments shown in place (PU-07) --------------------------------------------- */

.ow-previews { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr));
    align-items: start; }
.ow-preview { margin: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
    overflow: hidden; scroll-margin-top: var(--s4); }
.ow-preview:target { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.ow-preview-head { display: flex; align-items: center; gap: var(--s3); padding: .65rem var(--s3);
    border-bottom: 1px solid var(--border); background: var(--surface-2); }
.ow-preview-head .btn { display: inline-flex; align-items: center; gap: .3rem; flex: none; }
.ow-preview-img { display: flex; align-items: center; justify-content: center; height: 22rem; padding: var(--s3);
    background: var(--surface-2); }
/* PU-17: the box holds its height before the photo loads, so nothing under it moves */
.ow-preview-img img { display: block; width: 100%; height: 100%; object-fit: contain; }
.ow-pdf-frame { display: block; width: 100%; height: 36rem; border: 0; background: var(--surface-2); }
.ow-pdf-frame .ow-empty { margin: var(--s4); }
.ow-preview > .ow-empty { margin: var(--s3); }
.ow-sheet-wrap { overflow: auto; max-height: 28rem; }
.ow-sheet-wrap:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.ow-sheet { border-collapse: collapse; font-size: .84rem; font-variant-numeric: tabular-nums; min-width: 100%; }
.ow-sheet td { padding: .4rem .65rem; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border);
    white-space: nowrap; color: var(--text); }
.ow-sheet td:last-child { border-right: 0; }
.ow-preview-more { margin: 0; padding: .5rem var(--s3); border-top: 1px solid var(--border); }
@media (max-width: 720px) {
    .ow-preview-head { flex-wrap: wrap; }
    .ow-preview-head .ow-file-t { flex-basis: calc(100% - 2.5rem); }
    .ow-pdf-frame { height: 26rem; }
}

/* --- the whole exchange (PU-08): the customer's letters left, ours right ---------------- */
.ow-thread-item { display: flex; }
.ow-thread-item > .ow-msg { flex: 0 1 88%; min-width: 0; }
.ow-thread-item.is-ours { justify-content: flex-end; }
.ow-msg.is-ours { background: var(--surface-2); border-color: var(--border); }
.ow-msg.is-ours.is-own { box-shadow: var(--shadow), inset var(--rail) 0 0 var(--brand); }
.ow-msg.is-draft { border-style: dashed; }
.ow-msg-avatar { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 1.6rem;
    height: 1.6rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); align-self: center; }
.ow-msg.is-ours .ow-msg-avatar { background: var(--brand-soft); color: var(--brand-strong); }
.ow-msg-addr { font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
.ow-msg-tag.is-ours { color: var(--muted); background: var(--surface-3); }
.ow-msg-head .status-badge { font-size: .72rem; }
.ow-msg-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2);
    margin: var(--s3) 0 0; font-size: .86rem; }
.ow-msg-foot a { display: inline-flex; align-items: center; gap: .2rem; }
@media (max-width: 720px) {
    .ow-thread-item > .ow-msg { flex-basis: 100%; }
}
/* PU-174: the reply to the order's letter on the Писмо tab — the whole width, its preview on white (PU-369: read only) */
.ow-thread-item > .ow-msg.ow-reply-edit { flex-basis: 100%; }
.ow-reply-edit .ow-msg-who { margin: 0; font-size: inherit; }
.ow-reply-edit .readonly-note { margin-top: var(--s3); }
.ow-reply-to { margin: var(--s2) 0 var(--s3); font-size: .86rem; }
.ow-reply-state { margin: .4rem 0 0; font-size: .82rem; }
/* the small badge sits on the card's darker surface: its word in ink keeps 4.5:1 in both themes */
.ow-reply-edit .ow-msg-head .status-badge.ow-reply-draft { color: var(--ow-ink); }
.ow-others { display: flex; align-items: center; gap: .35rem; margin-top: .35rem; }

/* ================================================================
   The orders list (PU-10): the offers' header, tabs and search, and per
   row who, when, how it came, Ordio's decision in its state colour, and
   the money. The whole row opens the order through a real link.
   ================================================================ */

/* PU-16: one height for every cell of a row — the owner saw them hang at different heights */

.oq-row { position: relative; }
.oq-row:hover { background: var(--surface-2); }
.oq-row:focus-within { background: var(--brand-soft); }

.oq-came { display: inline-flex; align-items: center; gap: .25rem; white-space: nowrap; }
.oq-came.is-thread { color: var(--brand-strong); }

.oq-verdict { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; color: var(--oq-tone); }
.oq-verdict::before { content: ""; width: .5rem; height: .5rem; border-radius: 999px; background: var(--oq-tone); flex: none; }
.oq-finding { display: block; margin-top: .2rem; font-size: .82rem; color: var(--muted); line-height: 1.4; }
.oq-more { color: var(--text); font-weight: 600; }

.oq-money { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.oq-open { font-weight: 600; color: var(--text); text-decoration: none; }
.oq-open::after { content: ""; position: absolute; inset: 0; }
.oq-row:hover .oq-open, .oq-open:focus-visible { color: var(--brand-strong); }
.oq-open:focus-visible { outline: none; }
.oq-row:has(.oq-open:focus-visible) { outline: 2px solid var(--brand); outline-offset: -2px; }

.oq-blank { border: 0; border-radius: 0; }

/* PU-16: the page foot — which orders these are, and the pages from two on */
.oq-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s4);
    padding: .65rem 1rem; border-top: 1px solid var(--border); background: var(--surface-2); font-size: .85rem; }
.oq-range { color: var(--muted); font-variant-numeric: tabular-nums; }
.oq-pages { display: flex; align-items: center; gap: .25rem; }
.oq-page { display: inline-flex; align-items: center; justify-content: center; min-width: 2rem; height: 2rem; padding: 0 .45rem;
    border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-variant-numeric: tabular-nums; }
a.oq-page:hover { background: var(--surface); }
a.oq-page:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.oq-page.is-on { background: var(--brand-soft); color: var(--brand-strong); font-weight: 600; }
.oq-page.is-off { color: var(--muted); opacity: .45; }
.oq-gap { min-width: 1.2rem; text-align: center; color: var(--muted); }

/* the order's header: the way on to the next order waiting (PU-11) */
.ow-next { display: inline-flex; align-items: center; gap: .2rem; font-size: .82rem; font-weight: 500;
    color: var(--brand-strong); text-decoration: none; white-space: nowrap; }
.ow-next:hover { text-decoration: underline; }

/* ============================================================
   PU-15 — the owner's first look at the settings area
   ============================================================ */

/* A person's password pop-over: the field wide enough for a password, its eye
   inside it, Запази beside it — one line, the way the owner expects to read it. */
.pw-form { width: max-content; max-width: min(26rem, calc(100vw - 2rem)); padding: 0.75rem; gap: var(--s2); }
.pw-form .pw-wrap { flex: 1 1 13rem; min-width: 12rem; width: auto; }
.pw-form .pw-wrap input { width: 100%; }
.pw-form .pw-eye { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); }
.pw-form .btn { flex: none; }

/* The first password in the add-person dialog: field, Генерирай, Копирай. */
.pass-row .pw-wrap { flex: 1 1 auto; min-width: 0; width: auto; }
.pass-row .pw-wrap input, .pass-row > input { font-family: var(--font-mono); font-size: .9rem; letter-spacing: .02em; }
@media (max-width: 560px) { .pass-row { flex-wrap: wrap; } .pass-row .pw-wrap { flex-basis: 100%; } }

/* The chip at the bottom is the way into Настройки for an admin and an operator
   (PU-15): a gear on its right says so, and it lights on every settings screen. */
.userchip-go { margin-left: auto; display: inline-flex; color: var(--sidebar-muted); transition: color var(--dur-2) var(--ease); }
a.userchip:hover .userchip-go, a.userchip.active .userchip-go { color: var(--sidebar-brand); }
.nav-folded .userchip-go { display: none; }

/* Моят профил, the second time (PU-15): a banner the avatar stands on. The banner is
   the one place in the settings area that is allowed a little colour — the brand's own
   soft green running into the card — because this is the page about the person.
   The third time (PU-29, the owner's pick of six): the four counts sit small on the
   right of the name's row, no tiles; the card does not clip, so the role's pop-over
   can stand outside it — the banner rounds its own top corners instead. */
.profile-hero { display: block; padding: 0; }
.profile-banner {
    height: 6rem; border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
    background:
        radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--profile-tint) var(--profile-glow), transparent) 0%, transparent 60%),
        radial-gradient(90% 120% at 100% 0%, color-mix(in srgb, var(--mark-bright) 16%, transparent) 0%, transparent 55%),
        linear-gradient(180deg, var(--surface-2), var(--surface));
}
.profile-hero-body {
    display: flex; align-items: flex-start; gap: var(--s4); flex-wrap: wrap;
    padding: 0 1.5rem 1.375rem; margin-top: -2.5rem;
}
.avatar-xl {
    width: 5rem; height: 5rem; font-size: 1.6rem; letter-spacing: .03em;
    border: 4px solid var(--surface); box-shadow: var(--shadow-lift);
}
/* The words start below the banner; only the avatar stands across its edge. */
.profile-hero .profile-id { padding-top: 2.85rem; }
.profile-hero .profile-name { font-size: 1.45rem; line-height: 1.2; }
.profile-hero .profile-stats {
    display: flex; margin: 0 0 0 auto; padding-top: 2.85rem;
    border: 0; border-radius: 0; overflow: visible;
}
.profile-hero .profile-stat { padding: 0 1.25rem; background: transparent; text-align: right; }
.profile-hero .profile-stat:last-child { padding-right: 0; }
.profile-hero .profile-stat + .profile-stat { border-left: 1px solid var(--border); }
.profile-hero .profile-stat dt { font-size: .76rem; }
.profile-hero .profile-stat dd { font-size: 1.45rem; margin-top: 0.125rem; }
@media (max-width: 960px) {
    .profile-hero .profile-stats {
        flex-basis: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
        margin: 0; padding: var(--s3) 0 0; border-top: 1px solid var(--border);
    }
    .profile-hero .profile-stat, .profile-hero .profile-stat:last-child { text-align: left; padding: 0 0.75rem; }
    .profile-hero .profile-stat:first-child { padding-left: 0; }
}
@media (max-width: 560px) {
    .profile-hero-body { padding: 0 1rem 1rem; }
    .profile-hero .profile-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--s3); }
    .profile-hero .profile-stat:nth-child(3) { border-left: 0; padding-left: 0; }
}

/* The role's chip is the door to what the role allows (PU-29): a pop-over, one open at
   a time, closed by a click outside or Escape (dialogs.js, PU-21). */
.role-pop { position: relative; display: inline-flex; }
.role-pop > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 0.25rem; }
.role-pop > summary::-webkit-details-marker { display: none; }
.role-pop > summary .ico { opacity: .75; }
.role-pop > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.role-pop-card {
    position: absolute; left: 0; top: calc(100% + 0.5rem); z-index: 20;
    width: min(22rem, calc(100vw - 2rem)); padding: 1rem 1.125rem; color: var(--text);
    box-shadow: var(--shadow-lift);
}
.role-pop-title { margin: 0 0 0.625rem; font-weight: 600; font-size: .9rem; }

/* Сигурност (PU-29): rows — an icon, its words, its one action. */
.sec-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: var(--s3); padding: 1rem 1.375rem; }
.sec-row + .sec-row { border-top: 1px solid var(--border); }
.sec-row > .btn { align-self: center; }
.sec-row-icon {
    flex: none; display: flex; align-items: center; justify-content: center;
    width: 2.25rem; height: 2.25rem; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted);
}
.sec-row-text { min-width: 0; }
.sec-row-title { margin: 0; font-size: .95rem; font-weight: 600; }
.sec-row-desc { margin: 2px 0 0; color: var(--muted); font-size: .86rem; line-height: 1.45; }
.sec-row .login-list { display: flex; flex-wrap: wrap; gap: 0.375rem var(--s4); margin-top: 0.375rem; }
.sec-row .login-list li { padding: 0; border: 0; justify-content: flex-start; gap: var(--s2); color: var(--muted); font-size: .86rem; }
.form-dialog.pw-dialog { width: min(30rem, calc(100vw - 2rem)); }

/* PU-95: the open sessions and the sign-ins — one line per device: what, when, from where, the action. */
.sec-row > form { align-self: start; }
/* PU-192: the sessions span the row under its words and its button, so each „Изход" reaches the card's edge */
.sec-row > .session-list { grid-column: 1 / -1; margin-top: 0; } /* PU-404: the profile's sessions joined „Устройства и влизания" */
.session-list, .sec-row .login-list.login-list { list-style: none; margin: var(--s2) 0 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.session-row, .sec-row .login-list .login-row, .signin-part .login-row {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s3);
    padding: 0.5rem 0; border-top: 1px solid var(--border); font-size: .88rem; color: var(--text);
}
.session-row:first-child, .login-list .login-row:first-child { border-top: 0; }
.session-device { display: inline-flex; align-items: center; gap: var(--s2); }
.session-device .ico { color: var(--muted); }
.session-meta, .login-when, .login-ip { color: var(--muted); }
.login-device { font-weight: 500; }
.login-ip { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.session-end { margin-left: auto; }
.session-row .login-now { margin-left: auto; }

/* PU-95: Влизания — one card per account, its sessions beside its sign-ins. */
.signin-list { display: flex; flex-direction: column; gap: var(--s3); }
.signin-card { padding: 1rem 1.375rem; }
.signin-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.signin-who { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.signin-name { margin: 0; font-size: 1rem; font-weight: 600; overflow-wrap: anywhere; }
.signin-org { color: var(--muted); font-size: .86rem; }
.signin-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); margin-top: var(--s3); }
.signin-part-title { margin: 0 0 var(--s1); font-size: .78rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.signin-part .login-list { list-style: none; margin: 0; padding: 0; }
.signin-part .login-list .login-row { justify-content: flex-start; }
@media (max-width: 760px) {
    .signin-body { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
    /* On a phone the pop-over spans the card's body instead of starting at the chip,
       which would push it past the screen's right edge. */
    .profile-hero-body { position: relative; }
    .role-pop { position: static; }
    .role-pop-card { left: 1rem; right: 1rem; top: auto; width: auto; margin-top: 0.5rem; }
    .sec-row { grid-template-columns: auto minmax(0, 1fr); padding: 0.875rem 1rem; }
    .sec-row > .btn { grid-column: 2; justify-self: start; }
    /* PU-192: the name stands under the avatar here — no banner-height padding above it */
    .profile-hero .profile-id { padding-top: 0; flex-basis: 100%; }
    /* a session: the device over its time and address (one line each), „Изход" at the right */
    .session-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--s3); row-gap: 0; }
    .session-row .session-device { grid-column: 1; }
    .session-row .session-meta { grid-column: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .session-row .session-end, .session-row .login-now { grid-column: 2; grid-row: 1 / span 2; align-self: center; margin-left: 0; }
}

/* ============================================================
   PU-19 — an organization sees only what is its own to do
   ============================================================ */
/* A product as an organization reads it: the values as text in the editor's table. */
.rc-view .rc-v { padding: 0.375rem 0; font-weight: 500; overflow-wrap: anywhere; }
.rc-view .rc-promo-h { margin-bottom: var(--s2); }
/* A role that is not a choice reads as a value. */
.role-fixed-text { display: block; padding: 0.5rem 0; font-weight: 500; font-size: .95rem; }

/* ============================================================
   PU-21 — the settings screens open with a header card
   The Моят профил banner (PU-15), which the owner liked, as a shared card
   header: the soft green gradient behind the screen's icon, the title and its
   line, the actions on the right. It says each thing once — no tiles that
   repeat what the screen shows below — and nothing stands across its edge
   (owner, 01.10: „има излишни повторения и презастъпвания"). A list that is
   the screen (Хора и права) continues inside the same card.
   ============================================================ */
.page-hero { padding: 0; overflow: hidden; margin-bottom: var(--s4); }
.hero-banner {
    display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap;
    padding: var(--hero-pad);
    background:
        radial-gradient(90% 180% at 0% 0%, color-mix(in srgb, var(--hero-tint) var(--hero-glow), transparent) 0%, transparent var(--hero-reach)),
        radial-gradient(70% 160% at 100% 0%, color-mix(in srgb, var(--mark-bright) var(--hero-glow-2), transparent) 0%, transparent 55%),
        var(--surface);
}
.hero-icon {
    flex: none; display: flex; align-items: center; justify-content: center;
    width: 3rem; height: 3rem; border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--brand) 14%, var(--surface-2)); color: var(--brand);
    border: 1px solid color-mix(in srgb, var(--brand) 28%, var(--border));
}
.hero-text { flex: 1 1 18rem; min-width: 0; }
.hero-text .page-title { display: flex; align-items: center; gap: var(--s2) var(--s3); flex-wrap: wrap; margin: 0; }
.hero-text .page-lead { margin: 0.25rem 0 0; max-width: 46rem; color: var(--hero-lead); }
.hero-chip, .hero-count {
    display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.125rem 0.625rem;
    border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2);
    color: var(--muted); font-size: .8rem; font-weight: 500; letter-spacing: 0;
    font-variant-numeric: tabular-nums;
}
.hero-banner .page-actions { margin-left: auto; }
/* PU-80 (the owner, 2026-10-04: themes 1:1): a screen's heading lays out the same in both themes — PU-40's light-only
   heading card is gone, as the redesign's screens head without a card. */
/* the „Choose file" button dresses as one of ours, in both themes (PU-80) — the shared small button (PU-91) */
input[type=file]::file-selector-button {
    margin-right: var(--s3); min-height: var(--btn-h-sm); padding: 0 var(--btn-px-sm); cursor: pointer;
    font: inherit; font-size: var(--btn-fs-sm); font-weight: var(--btn-weight);
    border: 1px solid var(--btn-bd); border-radius: var(--btn-radius); color: var(--btn-fg);
    background-color: var(--btn-bottom); background-image: linear-gradient(180deg, var(--btn-top), var(--btn-bottom));
    box-shadow: var(--btn-shadow);
}
input[type=file]::file-selector-button:hover { border-color: var(--brand); }
.page-hero > .list-table { border-top: 1px solid var(--border); }
@media (max-width: 640px) {
    .hero-banner { padding: 1rem; gap: var(--s3); }
    .hero-icon { width: 2.5rem; height: 2.5rem; }
    .hero-text { flex-basis: calc(100% - 3.5rem); }
    .hero-banner .page-actions { margin-left: 0; width: 100%; }
}
/* where a list reads as cards (.list-table, ≤ 600px): no empty „Действия" line (the team; PU-167 a stopped organization) */
@media (max-width: 600px) { .list-table td.no-actions { display: none; } }

/* One pop-over at a time (dialogs.js); its trigger stays lit while it is open. */
details[data-popover][open] > summary { border-color: var(--brand); color: var(--text); }

/* PU-44: the open password pop-over stays in its own row. Beside its trigger, centred on it, it
   covers no other person's „Парола“ (under it, it took the next row's click); on a phone, where the
   team is a stack of cards, it takes the card's width under its trigger instead of hanging off
   the screen's edge. */
@media (min-width: 601px) {
    .pw-set > .pw-form { top: 50%; right: calc(100% + var(--s2)); margin-top: 0; transform: translateY(-50%); }
}
@media (max-width: 600px) {
    .pw-set[open] { flex-basis: 100%; }
    .pw-set > .pw-form { position: static; width: 100%; max-width: none; box-shadow: none; }
    .pw-set > .pw-form .pw-wrap { min-width: 0; }
}
/* PU-41: kept on one line with their words, the actions made the table 146px wider than its
   card at 1280px (`overflow: hidden`): „Спри достъпа" was clipped and a focused field scrolled
   the card sideways. Where the card is 48–58rem wide, „Виж като него" and „Парола" show their
   icon only (the owner's pick, 2026-10-02), which buys one line — the words stay in the
   accessible name and the tooltip. Scoped to Хора и права's own table (`.team-table`); Всички
   акаунти shares `.people-table` and is not touched. */
.page-hero:has(> .team-table) { container-type: inline-size; }
@media (min-width: 601px) {
    @container (min-width: 48rem) and (max-width: 58rem) {
        .team-table .person-actions > form[data-view-as] .btn,
        .team-table .pw-set > summary { font-size: 0; gap: 0; padding-inline: 0.4375rem; }
    }
}
/* Above 1100px a card just past the icon band (a ~1140–1160px window since the settings menu
   became tabs, PU-47) wraps the labelled actions as the ≤ 1100px layout always has; the pop-over
   then stands beside the whole actions block, centred on it, so it stays in its row whichever
   line „Парола" is on (PU-44's invariant). At ≤ 1100px only the icon band above reaches the
   table; the wrap and the pop-over's placement there stay PU-44's. */
@media (min-width: 1101px) {
    .team-table .person-actions { flex-wrap: wrap; position: relative; }
    .team-table .pw-set { position: static; }
}

/* ============================================================
   PU-24 — one error page (templates/errors/base.html)
   The sign-in card's frame — the logo in its tile, centred on the
   empty ground — with a title, one line and the way on. The five
   error pages extend it; none carries its own CSS.
   ============================================================ */

/* PU-24: inside a table the empty state is the table's own body — no second frame (as .oq-blank). */
td > .ow-blank { border: 0; border-radius: 0; }

/* PU-25 — every notice has its own close; an error or a warning waits for it (base.html toast). */
.messages .alert { display: flex; align-items: flex-start; gap: var(--s2); }
.alert-text { flex: 1; min-width: 0; }
.alert-x {
    flex: none; display: inline-flex; align-items: center; justify-content: center;
    width: 1.75rem; height: 1.75rem; margin: -0.25rem -0.375rem -0.25rem 0;
    border: 0; border-radius: var(--radius-sm); background: transparent; color: inherit;
    opacity: .7; cursor: pointer;
}
.alert-x:hover { opacity: 1; background: color-mix(in srgb, currentColor 10%, transparent); }
.alert-x:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; opacity: 1; }

/* POF-18 — no active monthly / daily offer: the owner's warning above the offers list and the board */
.offer-coverage { margin-bottom: var(--s3); }
.offer-coverage-line { margin: 0; }
.offer-coverage-line + .offer-coverage-line { margin-top: var(--s1); }
.offer-coverage a { color: inherit; text-decoration: underline; }
/* P2-63 (D16): an offer that went live on its own, with „Спри" */
.offer-released { margin-bottom: var(--s3); }
.offer-released-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); }
.offer-released-line + .offer-released-line { margin-top: var(--s1); }
.offer-released-line form { margin: 0; }
.offer-released a { color: inherit; text-decoration: underline; }
.of-stop { display: inline-block; margin: 0 0 0 var(--s1); }

/* =========================================================   PU-62: the order screen at the owner's final mockup and
   UI spec (2026-10-03). The spec's colours as tokens, both themes; the rules after them win over the PU-52…PU-61 block.
   ================================================================ */
/* the frame: rail 340 px, 24 px between */
.ow-page { max-width: 96rem; }
@media (min-width: 1025px) { .ow-grid { grid-template-columns: minmax(0, 1fr) 21.25rem; } }
.ow-card { border-radius: .875rem; border-color: var(--ow-card-bd); box-shadow: var(--ow-card-shadow); }
/* the head: the back link tertiary, the number 34 px / 650 */
.ow-back { font-size: .875rem; color: var(--ow-ink-2); }
.ow-back:hover { color: var(--ow-green); }
.ow-title { font-size: 2.125rem; line-height: 1.15; font-weight: 650; letter-spacing: -.02em; }
.ow-meta { margin-top: .5rem; font-size: .95rem; color: var(--ow-text-2); }
/* the band: one component, its tone from tokens */
.ow-band { min-height: 5.75rem; margin: var(--s4) 0 var(--s4); padding: 1.125rem 1.25rem; border-radius: .875rem; gap: 1rem; }
.ow-band.ow-tone-attn { --ow-tone: var(--ow-warn-ink); --ow-tone-bd: var(--ow-warn-bd);
    background: linear-gradient(90deg, var(--ow-warn-bg) 0%, var(--ow-warn-bg-2) 55%, var(--ow-warn-bg) 100%); }
.ow-band.ow-tone-attn .ow-band-ico { background: var(--ow-warn-ico); color: var(--ow-on-fill); }
.ow-band.ow-tone-ok { --ow-tone: var(--ow-ok-ink); --ow-tone-bd: var(--ow-ok-bd); background: var(--ow-ok-bg); }
.ow-band.ow-tone-err { --ow-tone: var(--ow-err-ink); --ow-tone-bd: var(--ow-err-bd); background: var(--ow-err-bg); }
.ow-band.ow-tone-info { --ow-tone: var(--ow-info-ink); --ow-tone-bd: var(--ow-info-bd); background: var(--ow-info-bg); }
.ow-band[role="status"] { --ow-tone: var(--ow-text-2); --ow-tone-bd: var(--ow-row-rule); background: var(--ow-busy-bg); }
.ow-band-ico { width: 3rem; height: 3rem; }
.ow-band-title { font-size: 1.4375rem; font-weight: 650; color: var(--ow-tone); }

.ow-band-lead { color: var(--ow-ink); font-size: .9rem; }
/* the tabs: no card, the open one green with a 3 px line */
.ow-hd .ow-tabs { margin-top: var(--s2); }
.ow-hd .of-tab { font-size: 1rem; color: var(--ow-ink-2); padding: .6rem .25rem .75rem; border-bottom-width: var(--rail); }
/* the open tab reads heavier without growing: a stroke, not a weight, so no tab moves when another opens (PU-17) */
.ow-hd .of-tab { font-weight: 500; }
.ow-hd .of-tab.on { color: var(--ow-green); border-bottom-color: var(--ow-tab-line); -webkit-text-stroke: .025em currentColor; font-weight: 500; }
.ow-hd .of-tab .cnt { background: color-mix(in srgb, var(--ow-green) 12%, transparent); color: var(--ow-green); font-weight: 600; }
/* PU-192: the open tab's count a visible pill in light too (the dark one's tint) */
.ow-hd .of-tab.on .cnt { background: color-mix(in srgb, var(--ow-green) 15%, transparent); }
/* the table: one card, a 48 px header band, rules only between rows */
.ow-lines { padding: 0; border-radius: .875rem; border-color: var(--ow-table-bd); box-shadow: var(--ow-card-shadow); }
.ow-table th { height: 3rem; background: var(--ow-head-bg); font-size: .8125rem; color: var(--ow-text-2); }
.ow-table th:first-child { border-radius: .875rem 0 0 0; }
.ow-table th:last-child { border-radius: 0 .875rem 0 0; }
.ow-table td { border-bottom-color: var(--ow-row-rule); padding-top: .9rem; padding-bottom: .9rem; }
.ow-table th.num, .ow-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.ow-c-no { width: 5%; font-weight: 600; color: var(--ow-ink); }
.ow-c-prod { width: 28%; }
.ow-prod { font-size: .875rem; font-weight: 600; }

.ow-code { font-family: var(--font-ui); font-size: .875rem; color: var(--ow-text-2); }
.ow-dot { width: .5rem; height: .5rem; }
.ow-dot.is-ok { background: var(--ow-dot-ok); }
.ow-table tbody tr.line-err td, .ow-table tbody tr.line-warn td { background: var(--ow-warn-bg); }
.ow-table tbody tr.line-err td:first-child, .ow-table tbody tr.line-warn td:first-child { box-shadow: inset var(--rail) 0 0 var(--ow-warn-strong); }
.line-status.ls-err, .line-status.ls-warn { color: var(--ow-warn-ink); font-weight: 500; }
.line-status.ls-err .ow-dot, .line-status.ls-warn .ow-dot { background: var(--ow-warn-strong); }

.ow-table tbody tr.line-out td { background: var(--ow-muted-row); opacity: .62; }

.ow-table.is-settled tbody tr.line-err td, .ow-table.is-settled tbody tr.line-warn td { background: var(--ow-muted-row); color: var(--ow-text-2); }
.ow-table.is-settled tbody tr.line-err td:first-child, .ow-table.is-settled tbody tr.line-warn td:first-child {
    box-shadow: inset var(--rail) 0 0 var(--ow-text-2); }
/* PU-178: on a phone the line is a card on its own ground; its cells take none — the desktop rules above, later in the
   file than the card layout, painted every cell a second box on the dark theme */
@media (max-width: 720px) {
    .ow-table tbody tr.line-err td, .ow-table tbody tr.line-warn td { background: none; }
    /* a decided order's card wears the settled grey its desktop cells do; the settled cells' rule outweighs the one
       above, so it is cleared on its own */
    .ow-table.is-settled tbody tr.line-err, .ow-table.is-settled tbody tr.line-warn { background: var(--ow-muted-row); }
    .ow-table.is-settled tbody tr.line-err td, .ow-table.is-settled tbody tr.line-warn td { background: none; }
}
/* a row's ⋯ */
.ow-row-menu { position: relative; display: inline-block; }
.ow-row-menu > summary { list-style: none; display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem;
    border-radius: .5rem; color: var(--ow-ink); cursor: pointer; }
.ow-row-menu > summary::-webkit-details-marker { display: none; }
.ow-row-menu > summary:hover, .ow-row-menu[open] > summary { background: var(--ow-head-bg); }
.ow-row-menu > summary:focus-visible { outline: .125rem solid var(--brand); outline-offset: .0625rem; }
.ow-row-menu .ow-more-menu { right: 0; top: calc(100% + .35rem); }
.ow-c-prod { cursor: default; }
tr:has(.ow-more-toggle) .ow-c-prod { cursor: pointer; }
/* the unfolded checks: an extension of the row, two columns */
.ow-line-more td { background: color-mix(in srgb, var(--ow-warn-bg) 45%, var(--surface)); }
.ow-chk { grid-template-columns: auto minmax(0, 1.5fr) minmax(0, 1fr); }
.ow-chk-src { text-align: left; color: var(--ow-text-2); }
/* the foot: Сравни с писмото on the left, the total on the right */
.ow-table tfoot td { padding-top: 1rem; padding-bottom: 1rem; }

/* the rail */
.ow-card-head { margin-bottom: var(--s4); }
.ow-card-title { font-size: 1.0625rem; font-weight: 600; }
.ow-client-name { font-size: 1rem; font-weight: 600; }
.ow-vip { background: none; padding: 0; color: var(--ow-text-2); font-size: .875rem; }
.ow-reply-ico { width: 2.75rem; height: 2.75rem; border-radius: 999px; }
.ow-actions { gap: .75rem; }
/* PU-133: the pilot's box — agree with Ordio's ready order or say what is wrong; a card of the rail's own */
.ow-pilot { display: grid; gap: .5rem; padding: var(--s4) var(--s5); background: var(--surface); border: 1px solid var(--ow-card-bd);
    border-radius: .875rem; box-shadow: var(--ow-card-shadow); }
.ow-pilot-q { display: flex; align-items: center; gap: .5rem; margin: 0; font-size: 1rem; font-weight: 600; color: var(--ow-ink); }
.ow-pilot-sub { margin: 0; font-size: .82rem; color: var(--ow-text-2); }
.ow-pilot-acts { display: grid; gap: .5rem; }
.ow-pilot-acts .btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; }
.ow-pilot.is-agreed .ow-pilot-q { font-size: .9rem; color: var(--ow-ok-ink); }
.ow-pilot.is-agreed .ow-dot { background: var(--ow-dot-ok); }
.ow-actions .ow-pilot-no { color: var(--ow-text-2); }
.ow-act-alt .ico { color: var(--ow-err-ink); }
/* the letter beside the lines: about a third of the width */
/* PU-63 (answer 14): the letter opens in the rail's own width — no column moves */
/* Ordio still reading: a skeleton table */
.ow-skeleton .ow-sk { display: block; height: .7rem; border-radius: .375rem; background: var(--ow-head-bg); margin: .2rem 0; }
.ow-skeleton .ow-sk.w-70 { width: 70%; } .ow-skeleton .ow-sk.w-60 { width: 60%; margin-left: auto; }
.ow-skeleton .ow-sk.w-40 { width: 40%; } .ow-skeleton .ow-sk.w-30 { width: 30%; margin-left: auto; }
.ow-skeleton .ow-sk-dot { display: inline-block; width: .5rem; height: .5rem; border-radius: 999px; background: var(--ow-row-rule); }
/* the order's dialogs lead with their action */
.orgnew-actions.is-lead { justify-content: flex-start; }
/* the menu's active item (spec §2): a lighter ground, a bright 3 px line on its left edge, white words, no chevron */
.sidebar .navitem.active::before { top: 0; bottom: 0; background: var(--sidebar-line); border-radius: 0 .125rem .125rem 0; }
.sidebar .navitem.active::after { content: none; }
.sidebar .navitem { font-size: .9375rem; }

/* the table fits its column from 1025 px up: the cells' inputs as wide as their values, the pencil in the cell's
   padding (it takes no width), the product the first to wrap */

.ow-cell > .ico { position: absolute; right: -1.05rem; }
.ow-c-prod { min-width: 9rem; }
@media (min-width: 1025px) and (max-width: 1279px) {
    .ow-grid { grid-template-columns: minmax(0, 1fr); }
    .ow-rail { position: static; max-height: none; overflow: visible; }
}
@media (min-width: 1280px) and (max-width: 1439px) {
    .ow-grid { grid-template-columns: minmax(0, 1fr) 20rem; }
    .ow-table th, .ow-table td { padding-left: .5rem; padding-right: .5rem; }
}
/* inside a row's ⋯ the checks' toggle is a menu item like its neighbour, not PU-54's round chevron */
.ow-row-menu .ow-more-item.ow-more-toggle { width: 100%; height: auto; justify-content: flex-start; padding: .55rem .65rem;
    border-radius: var(--radius-sm); color: var(--text); }
.ow-row-menu .ow-more-toggle[aria-expanded="true"] .ico { transform: none; }
.ow-row-menu .ow-more-menu { text-align: left; white-space: nowrap; }
/* a top bar on a phone: no room for the menu's shapes — they would spill over the page */
@media (max-width: 820px) { .sidebar::before, .sidebar::after { display: none; } }
/* on a phone the band keeps its words beside the icon, the title a step smaller */
@media (max-width: 640px) {
    .ow-band { padding: var(--s4); }
    .ow-band-title { font-size: 1.2rem; }
    .ow-band-ico { width: 2.5rem; height: 2.5rem; }
    .ow-band-t { flex: 1 1 calc(100% - 3.5rem); min-width: 0; }
}

/* =========================================================   PU-63: the owner's review of PU-62 (2026-10-03).
   ================================================================ */
/* the other orders of the letter, named once in the meta line */
.ow-meta-sep { margin: 0 .35rem; color: var(--ow-text-2); }
.ow-meta-others a { display: inline-flex; align-items: center; gap: .3rem; font-weight: 600; color: var(--ow-ink);
    text-decoration: none; }
.ow-meta-others a:hover { text-decoration: underline; }
.ow-meta-others .ow-dot { width: .5rem; height: .5rem; }
.ow-meta { flex-wrap: wrap; }
/* the customer card: avatar | words, and the sender on the same two columns */
.ow-sender-t { min-width: 0; font-size: .875rem; overflow-wrap: anywhere; }
/* one pop-over: the title's ⋯, a row's ⋯, an issue's proposals */
.ow-pop { background: var(--surface); border: 1px solid var(--border); border-radius: .75rem; box-shadow: var(--pop-shadow);
    padding: .375rem; display: grid; gap: .125rem; min-width: 14rem; text-align: left; white-space: normal; z-index: 30; }
@media (prefers-reduced-motion: no-preference) {
    details[open] > .ow-pop { animation: ow-pop-in .12s var(--ease-out); }
}
@keyframes ow-pop-in { from { transform: translateY(-.25rem); } to { transform: none; } }
.ow-pop .ow-more-item, .ow-row-menu .ow-pop .ow-more-item.ow-more-toggle {
    display: flex; align-items: center; gap: .625rem; width: 100%; min-height: 2.5rem; padding: .5rem .625rem;
    border: 0; border-radius: .5rem; background: none; color: var(--text); font: inherit; font-size: .875rem;
    font-weight: 500; text-align: left; white-space: nowrap; text-decoration: none; cursor: pointer; }
.ow-pop .ow-more-item:hover, .ow-pop .ow-more-item:focus-visible {
    background: var(--surface-2); }
.ow-pop .ow-more-item .ico { color: var(--ow-text-2); flex: none; }
/* P6-16: „Прекрати поръчката" ends an order — the menus' danger ink (person-menu, mbx-menu) */
.ow-pop .ow-more-item.is-danger .ico { color: var(--ow-err-ink); }
.ow-pop .ow-more-item.is-danger:hover { color: var(--ow-err-ink); }

.ow-pop .ow-prop-chip { flex: none; margin-top: .1rem; }
.ow-pop .ow-issue-form { margin: 0; }
/* the unfolded rows: Проверки · Източник, an extension of the row */
.ow-chk-heads { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--s4); padding: 0 0 .5rem 1.75rem;
    font-size: .75rem; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--ow-text-2); }
.ow-chk-list { display: grid; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.ow-chk { display: grid; grid-template-columns: 1.25rem minmax(0, 3fr) minmax(0, 2fr); gap: .5rem var(--s4); align-items: start; }
.ow-chk-t { font-size: .875rem; }
.ow-chk-said { display: block; margin-top: .125rem; font-size: .8125rem; color: var(--ow-text-2); }
.ow-chk-src { font-size: .8125rem; color: var(--ow-text-2); text-align: left; }
.ow-chk-head { margin: 0 0 .75rem; font-size: .8125rem; color: var(--ow-text-2); }
.ow-line-more > td { padding-top: .25rem; padding-bottom: 1rem; }
.ow-line-order td { color: var(--ow-text-2); }
/* the warning band, as the mockup draws it */
.ow-band.ow-tone-attn { position: relative; overflow: hidden; isolation: isolate; align-items: center;
    background: var(--mk-warn-bg); border: 1.5px solid var(--mk-warn-bd); border-radius: .75rem;
    padding: 1.25rem 1.5rem; min-height: 6.5rem; gap: 1.25rem; --ow-tone: var(--mk-warn-ink); }
.ow-band.ow-tone-attn::before, .ow-band.ow-tone-attn::after { content: ""; position: absolute; z-index: -1; border-radius: 50%;
    background: var(--mk-warn-arc); opacity: .55; pointer-events: none; }
.ow-band.ow-tone-attn::before { width: 26rem; height: 26rem; right: -4rem; top: -2rem; }
.ow-band.ow-tone-attn::after { width: 20rem; height: 20rem; right: 6rem; top: 3.5rem; opacity: .35; }
.ow-band.ow-tone-attn .ow-band-ico { flex: none; width: 4rem; height: 4rem; background: var(--mk-warn-ico); color: var(--mk-on-btn); }
.ow-band-bang { font-size: 2.1rem; font-weight: 800; line-height: 1; }
.ow-band.ow-tone-attn .ow-band-title { color: var(--mk-warn-ink); font-size: 1.6rem; font-weight: 700; }

.ow-band.ow-tone-attn .ow-band-t { flex: 1 1 auto; min-width: 0; }
@media (max-width: 640px) {
    .ow-band.ow-tone-attn .ow-band-ico { width: 2.75rem; height: 2.75rem; }
    .ow-band.ow-tone-attn .ow-band-title { font-size: 1.2rem; }
    .ow-band.ow-tone-attn .ow-band-t { flex: 1 1 calc(100% - 7rem); }
}
/* the approve button: a .btn-primary.btn-lg (PU-91) */
.ow-act-main .ico { stroke-width: 2.5; }
.ow-band.ow-tone-attn .ow-band-lead { margin-top: .25rem; font-size: 1.25rem; color: var(--mk-warn-ink); }
@media (max-width: 640px) { .ow-band.ow-tone-attn .ow-band-lead { font-size: 1rem; } }
/* PU-130 (the owner, 2026-10-13: „тази визуализация е много грозна" — a whole label wrapped over five lines): the
   „Оферта" cell is one line — a line's issue a soft chip, a dot and a few words, cut with an ellipsis, never wrapped
   (so never wider than its column, PU-125); its whole reason, the proposals and the line's checks in the pop-over */
.ow-table td.ow-c-offer { white-space: normal; }
@media (min-width: 721px) { .ow-table td.ow-c-offer { width: 11rem; min-width: 0; max-width: 12rem; } }
/* PU-192: every column but the product's a fixed width, the offer's head as wide as its cells — no column moves between
   orders (the order screen's `section.ow-lines` only — the catalogue shares `.ow-table`); the product takes what is left. A chip too long for its column takes a second line, never cut („Потвърдено
   от клиента"); one line keeps its pill (the radius is half its height) */
@media (min-width: 721px) {
    section.ow-lines .ow-table .ow-c-no { width: 2.25rem; }
    section.ow-lines .ow-table .ow-c-prod { width: auto; }
    section.ow-lines .ow-table .ow-c-code { width: 7.5rem; }
    section.ow-lines .ow-table .ow-c-offer { width: 12rem; min-width: 0; max-width: 12rem; }
    section.ow-lines .ow-table .ow-c-qty { width: 3.75rem; }
    section.ow-lines .ow-table .ow-c-money, section.ow-lines .ow-table tbody td.num:not(.ow-c-qty) { width: 5.75rem; }
    section.ow-lines .ow-table .ow-c-more { width: 2.75rem; min-width: 2.75rem; }

}

/* a flex item on a phone's stacked card: it may shrink below its words, so the chip cuts them inside the card */

.ow-table td.ow-c-offer .line-status { display: inline-flex; align-items: center; max-width: 100%;
    white-space: nowrap; overflow: hidden; }
.ow-table td.ow-c-offer .ow-dot, .ow-table td.ow-c-offer .line-status .ico { flex: none; }

/* a phone's stacked card gives the chip a whole row: in half a card its words were cut („Не е в п…") */
@media (max-width: 720px) { .ow-lines .ow-table tbody td.ow-c-offer { grid-column: 1 / -1; } }
/* PU-125: a phone's stacked row gives its two columns equal halves — an `auto` second column took a long note's whole
   width and squeezed the code and the quantity under their labels */
@media (max-width: 720px) { .ow-lines .ow-table tbody tr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
/* PU-192: on a phone the product takes the card's width (the desktop's 28 % squeezed it to two words a line); the whole
   order's row is its words and its chevron on one line */
@media (max-width: 720px) {
    .ow-lines .ow-table tbody td.ow-c-prod { width: auto; min-width: 0; }
    .ow-lines .ow-table tbody tr.ow-line-order { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
    .ow-lines .ow-table tbody tr.ow-line-order td:first-child { display: none; }
    .ow-lines .ow-table tbody tr.ow-line-order td { justify-content: flex-start; }
    .ow-lines .ow-table tbody tr.ow-line-order td::before { content: none; }
    .ow-lines .ow-table tbody tr.ow-line-order td.ow-c-more { grid-column: auto; }
}

/* =========================================================   PU-64: the search bar at the top of every page (spec §3).
   ================================================================ */
/* PU-85: it stays at the top while the page scrolls (the owner, 2026-10-07: „винаги статичен и видим"), right under
   the bar pinned above the frame (the sandbox strip — `--app-stick`, measured by app_search.js; „Гледаш като" is a row
   of the page since PU-365), on its own
   ground with the fine rule, never taller than --app-search-h. The stacking order (App. H §H.2): the page and its own
   sticky pieces (≤ 6) < the bar (12) < the order's save bar (15) < the menu and open menus (20–40) < the sandbox
   strip (31) < the catalogue panel (60) < toasts (200) < the help panel and every dialog (the top layer). */
:root { --app-search-h: 0rem; }
:root:has(.app-search-wrap) { --app-search-h: 3rem; }
/* PU-180: the search now stands in the top bar — what is pinned under the sandbox and view-as bars is the bar */
:root:has(#topbar) { --app-search-h: 3.875rem; }
html { scroll-padding-top: calc(var(--app-stick, 0rem) + var(--app-search-h) + var(--s2)); }
/* PU-180: inside the top bar, in its middle; the bar pins it (PU-85, PU-138) */
.app-search-wrap { display: flex; align-items: center; flex: 1 1 36rem; min-width: 0; max-width: 40rem; margin: 0 auto; }
.app-search-btn { display: none; }
.app-search { position: relative; display: flex; flex: 1 1 auto; align-items: center; height: 2.75rem;
    background: var(--ow-search-bg); border: 1px solid var(--ow-search-bd); border-radius: .8rem;
    box-shadow: inset 0 1px 0 var(--topbar-glint); }
.app-search:focus-within { border-color: var(--sidebar-line); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sidebar-line) 30%, transparent); }
.app-search-ico { position: absolute; left: 1rem; display: flex; color: var(--sidebar-muted); pointer-events: none; }
.app-search input[type="search"] { flex: 1 1 auto; min-width: 0; height: 100%; padding: 0 4.5rem 0 3.1rem; border: 0;
    background: transparent; color: var(--sidebar-fg); font: inherit; font-size: .95rem; outline: none; }
.app-search input[type="search"]::placeholder { color: var(--sidebar-muted); opacity: 1; }
.app-search input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }
.app-search-kbd { position: absolute; right: .75rem; padding: .15rem .45rem; border: 1px solid var(--ow-search-bd);
    border-radius: .4rem; background: var(--app-search-kbd-bg); color: var(--sidebar-muted); font-family: var(--font-ui);
    font-size: .8rem; font-weight: 600; line-height: 1.4; pointer-events: none; }
.app-search:focus-within .app-search-kbd { display: none; }
/* PU-171 „Сигнал": a quiet flag at the right end of the top bar, the search's size and ground — never a floating bubble */
.report-btn { position: relative; display: inline-flex; flex: none; align-items: center; justify-content: center;
    width: 2.75rem; height: 2.75rem; min-width: 44px; min-height: 44px; margin-left: var(--s2); padding: 0;
    border: 1px solid var(--ow-search-bd); border-radius: .8rem; background: var(--ow-search-bg); color: var(--sidebar-muted);
    cursor: pointer; }
.report-btn:hover { color: var(--sidebar-fg); border-color: var(--sidebar-line); }
.report-btn:focus-visible { outline: 2px solid var(--sidebar-line); outline-offset: 2px; }
.report-dialog { width: min(34rem, calc(100vw - 2rem)); }
.report-form { grid-template-columns: 1fr; }
.report-head { display: grid; grid-template-columns: auto 1fr; column-gap: var(--s3); align-items: start;
    padding-right: 2rem; }
.report-head-ico { display: inline-flex; padding: .45rem; border-radius: .6rem; background: var(--brand-soft); color: var(--brand); }
.report-head h2 { font-size: 1.02rem; line-height: 1.4; }
.report-head .report-place { grid-column: 2; margin-top: var(--s1); font-size: .85rem; }
.report-place strong { color: var(--text); font-weight: 600; }
.report-field textarea { resize: vertical; min-height: 6rem; }
.report-shot { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2); font-size: .85rem; }
.report-shot-pick { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; }
.report-shot:focus-within .report-shot-pick { outline: 2px solid var(--brand); outline-offset: 2px; }
.report-shot-name { overflow-wrap: anywhere; }
/* PU-172: the flag's dot — a change to one of the person's reports not yet opened; no badge, no number */
.report-dot { position: absolute; top: .45rem; right: .45rem; width: .55rem; height: .55rem; border-radius: 50%;
    background: var(--sidebar-line); box-shadow: 0 0 0 2px var(--sidebar-bg); }
.report-foot { margin: 0; font-size: .85rem; }
.report-foot a { color: var(--text); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
/* PU-172 „Моите сигнали": one card per report — its status, words, place and the way it has gone */
.rp-list { display: grid; gap: var(--s3); margin: 0; padding: 1.125rem 1.5rem 1.5rem; list-style: none; }
.rp-area .pagination { padding: 0 1.5rem 1.25rem; }
.rp-card { display: grid; gap: var(--s2); padding: var(--s4); border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface-2); }
.rp-top { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2) var(--s3); }
.rp-status { display: inline-flex; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600;
    background: var(--info-bg); color: var(--info-fg); border: 1px solid var(--info-bd); }
.rp-status.status-received { background: transparent; color: var(--ow-text-2); border-color: var(--border); }
.rp-status.status-done { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-bd); }
.rp-status.status-wont_do { background: transparent; color: var(--ow-text-2); border-color: var(--border); }
/* PU-274: the info statuses read 4.48:1 in the dark theme (axe) — their text is the info ink mixed toward the text, as
   the order screens' info notes are (PU-355: here, beside the area's own status rules, not in redesign.css) */
.rp-area .rp-status.status-accepted,
.rp-area .rp-status.status-in_progress { color: var(--ow-info-ink); }
.rp-new { font-size: .8rem; font-weight: 700; color: var(--ok-fg); }
.rp-card.is-new { border-color: var(--ok-bd); }
.rp-meta { font-size: .85rem; overflow-wrap: anywhere; }
.rp-meta a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.rp-text { margin: 0; overflow-wrap: anywhere; }
.rp-shot { display: inline-flex; align-items: center; gap: .35rem; width: fit-content; font-size: .85rem; color: var(--text);
    text-decoration: underline; text-underline-offset: 2px; }
.rp-steps { display: flex; flex-wrap: wrap; gap: .25rem; margin: var(--s1) 0 0; padding: 0; list-style: none; font-size: .8rem; }
.rp-step { padding: .15rem .55rem; border-radius: 999px; color: var(--ow-text-2); border: 1px dashed var(--border); }
.rp-step.is-done { color: var(--text); border-style: solid; }
.rp-step.is-current { color: var(--ok-fg); background: var(--ok-bg); border: 1px solid var(--ok-bd); font-weight: 600; }
.rp-reply { margin: 0; padding: var(--s2) var(--s3); border-left: var(--rail) solid var(--brand); background: var(--surface);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0; overflow-wrap: anywhere; }
.rp-reply-who { font-weight: 600; }
/* PU-173: the thanks at Готово, and the owner's answer form under each report */
.rp-thanks { display: flex; align-items: center; gap: .45rem; margin: 0; color: var(--ok-fg); font-weight: 600; }
.rp-answer { display: grid; grid-template-columns: minmax(10rem, 14rem) 1fr auto; gap: var(--s3); align-items: end;
    margin-top: var(--s2); }
.rp-answer textarea { resize: vertical; }
@media (max-width: 720px) { .rp-answer { grid-template-columns: 1fr; } }
.rp-owner .dg-head { align-items: flex-start; }
.profile-thanks { margin: var(--s2) 0 0; font-size: .85rem; }
.profile-thanks a { display: inline-flex; align-items: center; gap: .35rem; color: var(--ow-text-2); text-decoration: underline;
    text-underline-offset: 2px; }
.profile-thanks a:hover { color: var(--text); }

.rp-area > .ow-blank { border: 0; border-radius: 0; } /* PU-192: the shared empty state, inside the card without a frame */

@media (max-width: 640px) {
    /* PU-85: on a phone the search button stands for the field until it is tapped (or ⌘K / Ctrl+K) */
    .app-search-btn { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem;
        min-width: 44px; min-height: 44px; padding: 0; border: 1px solid var(--ow-search-bd); border-radius: .8rem;
        background: var(--ow-search-bg); color: var(--sidebar-muted); cursor: pointer; }
    .app-search-btn:focus-visible { outline: 2px solid var(--sidebar-line); outline-offset: 2px; }
    /* PU-180: the bar keeps its name, the flag, the bell and the avatar; an open search takes a row of its own */
    .app-search-wrap { flex: 0 0 auto; margin: 0 0 0 auto; }
    .app-search-wrap.is-open { flex: 1 1 100%; max-width: none; }
    .app-search-wrap.is-open .app-search-btn { display: none; }
    .app-search-wrap:not(.is-open) .app-search { display: none; }
    .app-search-kbd { display: none; }
    .app-search input[type="search"] { padding-right: 1rem; font-size: .95rem; }
}

/* =========================================================   PU-180: the top bar beside the menu
   (the owner, 2026-10-22: „лентата от лявото меню да продължава … да стои статично винаги"; „градиент"). The menu's
   own ground carried across from its edge, lighter to the right, fading into the page below; pinned under the sandbox
   strip (`--app-stick`). The search, the flag, the bell and the avatar on it; their menus on the page's
   own ground. Stacking (App. H §H.2): above the page and the order's save bar (15), under the sandbox (31).
   ================================================================ */
.topbar {
    --ow-search-bg: color-mix(in srgb, var(--sidebar-fg) 8%, transparent);
    --ow-search-bd: color-mix(in srgb, var(--sidebar-fg) 14%, transparent);
    --app-search-kbd-bg: color-mix(in srgb, var(--sidebar-fg) 6%, transparent);
    --topbar-glint: color-mix(in srgb, var(--sidebar-fg) 5%, transparent);
    position: sticky; top: var(--app-stick, 0rem); z-index: 28;
    display: flex; align-items: center; gap: var(--s3); box-sizing: border-box; height: var(--app-search-h);
    padding: 0 var(--s4) 0 var(--s5); color: var(--sidebar-fg);
    background:
        radial-gradient(45% 260% at 100% 0%, color-mix(in srgb, var(--sidebar-line) 22%, transparent) 0%, transparent 65%),
        linear-gradient(90deg, var(--sidebar-bg) 0%, var(--sidebar-bg) 15%, color-mix(in srgb, var(--sidebar-line) 14%, var(--sidebar-bg)) 100%);
}
/* the soft step from the bar into the page — no line */
.topbar::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 1.5rem; pointer-events: none;
    background: linear-gradient(180deg, color-mix(in srgb, var(--sidebar-bg) 16%, transparent), transparent); }
/* the page starts a breath below the bar's fade — what the search bar's own margin gave it (PU-85) */
body:has(#topbar) .content { padding-top: calc(var(--s6) + .875rem); }
/* …but an offer's workspace keeps its window (PU-02 AC-18, PU-84's pin 0.7): on a wide screen the bar's own fade is
   the air above its header, and the work area ends a step above the window's edge (`_broshura_fit.html` reads it) */
@media (min-width: 1100px) { body:has(#page-pane) .content { padding-top: var(--s3); padding-bottom: var(--s3); } }
.topbar-title { flex: 0 1 auto; min-width: 9rem; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: 1.15rem; font-weight: 650; letter-spacing: -.01em; color: var(--sidebar-fg); }
.topbar-count { margin-left: var(--s2); padding: .1rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 600;
    vertical-align: .1em; color: var(--sidebar-fg); background: color-mix(in srgb, var(--sidebar-line) 22%, transparent); }
.topbar-end { display: flex; align-items: center; gap: var(--s2); margin-left: auto; flex: none; }
.app-search-wrap + .topbar-end { margin-left: 0; }
.topbar-workin { display: inline-flex; align-items: center; gap: var(--s2); margin: 0; padding: .3rem .35rem .3rem .8rem;
    border-radius: 999px; white-space: nowrap; font-size: .84rem; color: var(--sidebar-muted);
    background: color-mix(in srgb, var(--sidebar-line) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--sidebar-line) 28%, transparent); }
.topbar-workin strong { color: var(--sidebar-fg); }
.topbar-workin-exit { display: inline-flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem;
    padding: 0; border: 0; border-radius: 999px; cursor: pointer; color: var(--sidebar-fg);
    background: color-mix(in srgb, var(--sidebar-fg) 12%, transparent); }
.topbar-workin-exit:hover { background: color-mix(in srgb, var(--sidebar-fg) 22%, transparent); }
.topbar-workin-exit:focus-visible, .topbar-pop > summary:focus-visible { outline: 2px solid var(--sidebar-line); outline-offset: 2px; }
.topbar-pop { position: relative; }
.topbar-pop > summary { list-style: none; cursor: pointer; }
.topbar-pop > summary::-webkit-details-marker { display: none; }
.topbar-ico { position: relative; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
    width: 2.75rem; height: 2.75rem; border-radius: .8rem; color: var(--sidebar-muted);
    background: var(--ow-search-bg); border: 1px solid var(--ow-search-bd); }
.topbar-ico:hover, .topbar-pop[open] > .topbar-ico { color: var(--sidebar-fg); border-color: var(--sidebar-line); }
.topbar-badge { position: absolute; top: -.5rem; right: -.5rem; min-width: 1.15rem; height: 1.15rem; padding: 0 .3rem;
    box-sizing: border-box; border-radius: 999px; display: flex; align-items: center; justify-content: center;
    font-size: .68rem; font-weight: 700; color: var(--sidebar-bg); background: var(--ow-warn-strong);
    box-shadow: 0 0 0 2px var(--sidebar-bg); }
.topbar-avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; box-sizing: border-box;
    width: 2.75rem; height: 2.75rem; border-radius: 999px; font-weight: 700; font-size: 1rem; color: var(--sidebar-bg);
    background: linear-gradient(135deg, var(--sidebar-line), color-mix(in srgb, var(--sidebar-line) 45%, var(--info-fg)));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--sidebar-fg) 16%, transparent), 0 6px 16px -6px rgba(0, 0, 0, .5); }
.topbar-pop[open] > .topbar-avatar, .topbar-avatar:hover { box-shadow: 0 0 0 2px var(--sidebar-line), 0 6px 16px -6px rgba(0, 0, 0, .5); }
.topbar-pop-body { position: absolute; top: calc(100% + .5rem); right: 0; z-index: 2; width: 20rem; max-width: calc(100vw - 2rem);
    box-sizing: border-box; display: grid; gap: .125rem; padding: .5rem; text-align: left; white-space: normal;
    color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 1rem;
    box-shadow: var(--pop-shadow); }
@media (prefers-reduced-motion: no-preference) {
    .topbar-pop[open] > .topbar-pop-body { animation: ow-pop-in .12s var(--ease-out); }
}

.topbar-note { display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem; border-radius: .625rem; color: var(--text);
    text-decoration: none; font-size: .9rem; line-height: 1.35; }
.topbar-note:hover, .topbar-note:focus-visible { background: var(--surface-2); }
.topbar-note-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem;
    border-radius: .625rem; color: var(--attn-fg); background: var(--attn-bg); }
.topbar-note-none { margin: 0; padding: .6rem .7rem .7rem; color: var(--muted); font-size: .9rem; }
.topbar-me-head { display: flex; align-items: center; gap: .75rem; margin: -.5rem -.5rem .375rem; padding: .75rem;
    border-radius: 1rem 1rem 0 0; border-bottom: 1px solid var(--border);
    background: radial-gradient(120% 160% at 0% 0%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 60%), var(--surface-2); }
.topbar-avatar.is-big { width: 3rem; height: 3rem; border-radius: .875rem; font-size: 1.2rem; box-shadow: none; }
.topbar-me-who { display: grid; min-width: 0; }
.topbar-me-who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-me-who span { font-size: .82rem; color: var(--brand); }
.topbar-me-menu form { margin: 0; display: contents; }
.topbar-item { display: flex; align-items: center; gap: .65rem; width: 100%; box-sizing: border-box; padding: .6rem .7rem;
    border: 0; border-radius: .625rem; background: none; color: var(--text); font: inherit; font-size: .9rem; text-align: left;
    text-decoration: none; cursor: pointer; }
.topbar-item:hover, .topbar-item:focus-visible { background: var(--surface-2); outline: none; }
.topbar-item .ico { color: var(--muted); flex: none; }
.topbar-item kbd { margin-left: auto; padding: .05rem .4rem; border: 1px solid var(--border); border-radius: .35rem;
    font-family: var(--font-ui); font-size: .75rem; color: var(--muted); }
.topbar-item.is-out { color: var(--err-fg); }
.topbar-item.is-out .ico { color: currentColor; }
.topbar-sep { height: 1px; margin: .35rem .25rem; border: 0; background: var(--border); }

/* the side now shown is lit — the theme sets which, as tokens */

@media (max-width: 820px) {
    .topbar { padding: 0 var(--s3); gap: var(--s2); }
    .topbar-title { min-width: 0; font-size: 1.02rem; }
    .topbar-workin-text { max-width: 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
/* on a phone the menu's row above names the page — inside an organization, its name takes the page name's place (the
   words „Работиш в" stay for a screen reader); an open search lies over the bar instead of pushing the page down */
@media (max-width: 640px) {
    .topbar { gap: var(--s1); padding: 0 var(--s2); }
    .topbar-end { gap: var(--s1); }
    /* PU-192: inside an organization the bar takes two rows — the page's name above, the controls and the
       organization's chip below — so the phone always names the page */
    :root:has(#topbar .topbar-workin) { --app-search-h: 5.5rem; }
    .topbar:has(.topbar-workin) { flex-wrap: wrap; align-content: center; row-gap: var(--s1); }
    .topbar:has(.topbar-workin) .topbar-title { flex: 1 0 100%; padding: 0 var(--s1); font-size: 1.02rem; line-height: 1.6rem; }
    .topbar-workin { padding-left: .6rem; }
    .topbar-workin-text { max-width: 7.5rem; }
    .topbar-workin-lead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .topbar .app-search-wrap.is-open { position: absolute; inset: 0 var(--s2); z-index: 3; order: 0; padding: 0;
        background: var(--sidebar-bg); }
}
/* a screen's own button stays on a phone (the bar is its only place) — its icon alone, its words its name; the
   words are hidden, the button keeps the shared shape (PU-91; PU-183) */
@media (max-width: 640px) {
    .topbar-end .btn-words {
        position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
        overflow: hidden; clip: rect(0, 0, 0, 1px); white-space: nowrap; border: 0;
    }
    .topbar-end > .btn { width: var(--btn-h); justify-content: center; }
}

/* =========================================================   PU-65: Имейли and Отговори in the order screen's language
   (the owner, 2026-10-03: „Следвай този дизайн"). Its head, tabs, tables, cards and buttons; tokens only, both themes.
   ================================================================ */
.mr-page { max-width: 96rem; }
/* the head: back · title · one meta line, the page's actions on the right */
.mr-hd { margin: 0 0 var(--s5); }

.mr-hd .ow-title { white-space: normal; overflow-wrap: anywhere; }
.mr-hd .ow-meta { gap: .25rem .5rem; }
.mr-hd .ow-meta .ow-meta-sep { margin: 0; }
.mr-meta-from, .mr-meta-subj { overflow-wrap: anywhere; }

/* a state: an 8 px dot and its word, in the ink of the page */
.mr-state { display: inline-flex; align-items: center; gap: .45rem; padding: 0; border: 0; background: none; color: var(--ow-ink); font-weight: 500; white-space: nowrap; }
.mr-page .ow-dot.ow-tone-ok { background: var(--ow-dot-ok); }
.mr-page .ow-dot.ow-tone-attn { background: var(--ow-warn-strong); }
.mr-page .ow-dot.ow-tone-err { background: var(--ow-err-ink); }
.mr-page .ow-dot.ow-tone-info { background: var(--ow-info-ink); }
.mr-page .ow-dot.ow-tone-muted { background: var(--ow-settled-line); }
.mr-state.line-status.ls-ok .ow-dot { background: var(--ow-dot-ok); }
.mr-state.line-status.ls-ok { color: var(--ow-ink); }
.mr-count { display: inline-flex; align-items: center; margin-left: .35rem; padding: 0 .5rem; border-radius: 999px;
    background: color-mix(in srgb, var(--ow-green) 12%, transparent); color: var(--ow-green); font-size: .8rem;
    font-weight: 600; line-height: 1.45rem; font-variant-numeric: tabular-nums; vertical-align: .1em; }
/* a note under the head: a reason, a hold */
.mr-note { display: flex; align-items: flex-start; gap: .55rem; margin: var(--s3) 0 0; padding: .75rem 1rem;
    border: 1px solid var(--ow-err-bd); border-radius: .75rem; background: var(--ow-err-bg); color: var(--ow-ink);
    font-size: .9rem; line-height: 1.45; }
.mr-note .ico { flex: none; margin-top: .1rem; color: var(--ow-err-ink); }
.mr-note.is-attn { border-color: var(--ow-warn-bd); background: var(--ow-warn-bg); }
.mr-note.is-attn .ico { color: var(--ow-warn-ink); }
/* the buttons: .btn with its role (PU-91) — the primary, a quiet secondary, the reject with its red mark */
.mr-btn-main, .mr-btn-alt { white-space: nowrap; }
.mr-btn-main:focus-visible, .mr-btn-alt:focus-visible { outline: .125rem solid var(--brand); outline-offset: .125rem; }
.mr-btn-quiet .ico { color: var(--ow-text-2); }
.mr-btn-alt .ico { color: var(--ow-err-ink); }
/* the screen's own search, in the bar's look */
.mr-filters { border-color: var(--ow-card-bd); border-radius: .875rem; box-shadow: var(--ow-card-shadow); padding: .5rem; }

.mr-filters .search::placeholder { color: var(--ow-text-2); opacity: 1; }
/* PU-192: Кутия / Състояние and „Приложи" the search's height; the value ink, never read as disabled (as .oq-filters) */
.mr-filters .filter-dd > summary { align-items: center; min-height: 2.75rem; padding: .45rem .8rem; gap: .45rem;
    background: var(--surface); border-color: var(--ow-card-bd); border-radius: .625rem; color: var(--ow-ink); }
.mr-filters .filter-dd > summary:hover, .mr-filters .filter-dd[open] > summary { border-color: var(--ow-green); }
.mr-filters .fb-label { color: var(--ow-text-2); }
.mr-filters .fb-value, .mr-filters .fb-value.fb-any { font-weight: 500; color: var(--ow-ink); }

/* the tabs: the order screen's — no pills, the open one green with a 3 px line, a count */
.mr-tabs { margin: var(--s4) 0 0; }
.mr-tabs .of-tab { font-size: 1rem; font-weight: 500; color: var(--ow-ink-2); padding: .6rem .25rem .75rem;
    border-bottom-width: var(--rail); }
.mr-tabs .of-tab.on { color: var(--ow-green); border-bottom-color: var(--ow-tab-line); -webkit-text-stroke: .025em currentColor; font-weight: 500; }
.mr-tabs .of-tab .cnt { padding: 0 .45rem; border-radius: 999px; background: color-mix(in srgb, var(--ow-green) 12%, transparent);
    color: var(--ow-green); font-size: .8rem; font-weight: 600; opacity: 1; }
.mr-page .ow-card { border-radius: .875rem; border-color: var(--ow-card-bd); box-shadow: var(--ow-card-shadow); }

/* an order: #N · who and ВИП · the state · the total · „Отвори" — as on the order screen; each its own order */
.mr-orders { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin: 0; padding: 0; list-style: none; }
.mr-order-item { padding: .75rem 0; border-top: 1px solid var(--ow-row-rule); }
.mr-order-item:first-child { border-top: 0; padding-top: 0; }
.mr-order-item:last-child { padding-bottom: 0; }
.mr-order { display: grid; grid-template-columns: 4rem minmax(0, 1fr) auto 8rem auto; align-items: center; gap: .5rem var(--s4); }
.mr-order-no { font-weight: 600; color: var(--ow-ink); font-variant-numeric: tabular-nums; }
.mr-order-who { display: grid; min-width: 0; }
.mr-order-who b { font-weight: 600; color: var(--ow-ink); overflow-wrap: anywhere; }
.mr-order-vip { font-size: .8125rem; color: var(--ow-text-2); font-variant-numeric: tabular-nums; }
.mr-order-sum { text-align: right; font-weight: 600; color: var(--ow-ink); font-variant-numeric: tabular-nums; }
.mr-order-sum .muted { display: block; font-weight: 400; font-size: .75rem; color: var(--ow-text-2); }
.mr-order-open { color: var(--ow-green); font-weight: 600; text-decoration: none; white-space: nowrap; }
.mr-order-open:hover { text-decoration: underline; }
/* in the rail: who on the first line, the state and the total under it */

/* the reply's draft card */
.mr-draft .reply-preview { border-color: var(--ow-card-bd); border-radius: .625rem; }
.mr-draft-form { margin: var(--s4) 0 0; }
.mr-draft-label { display: block; margin: 0 0 .4rem; font-size: .875rem; color: var(--ow-text-2); }
.mr-draft-text { width: 100%; padding: .75rem .9rem; border: 1px solid var(--ow-search-bd); border-radius: .625rem;
    background: var(--surface); color: var(--ow-ink); font: inherit; font-size: .95rem; line-height: 1.5; }
.mr-draft-text:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); outline: none; }
.mr-draft-acts { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: var(--s4); }
.mr-draft-acts .mr-btn-alt { margin-left: auto; }
/* PU-111: „Без изпращане" — the sending switch in a word beside the button; its sentence is the tooltip */
.mr-draft-acts .reply-send-mode { font-size: .8rem; cursor: help; }
/* PU-192: sending off — the button says „Маркирай като приет"; one quiet line under the bar says why */
.mr-send-off { flex: 1 1 100%; margin: -.25rem 0 0; font-size: .8125rem; color: var(--ow-text-2); }
@media (max-width: 640px) {
    .mr-hd .ow-title { font-size: 1.6rem; }

    .mr-draft-acts > * { flex: 1 1 100%; }
    .mr-draft-acts .mr-btn-alt { margin-left: 0; }
    .mr-draft-acts .reply-send-mode { flex: 0 0 auto; margin: -.25rem auto 0; }
    .mr-draft .reply-preview { height: 26rem; }

}

/* --- PU-65: the mailbox — the list on the left stays, the open item on the right --------------------------------- */

.mb-inbox { display: grid; grid-template-columns: 25rem minmax(0, 1fr); gap: var(--s5); align-items: start; }
.mb-list { position: sticky; top: calc(var(--app-stick, 0rem) + var(--app-search-h) + var(--s2));
    max-height: calc(100vh - var(--app-stick, 0rem) - var(--app-search-h) - var(--s2) - var(--s4)); overflow-y: auto; overscroll-behavior: contain;
    scrollbar-width: thin; background: var(--surface); border: 1px solid var(--ow-card-bd); border-radius: .875rem;
    box-shadow: var(--ow-card-shadow); }
.mb-rows { margin: 0; padding: 0; list-style: none; }
.mb-rows > li + li .mb-row { border-top: 1px solid var(--ow-row-rule); }
.mb-row { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr) auto; grid-template-areas: "av who when" "av subj subj" "av sub sub" "av why why";
    gap: .1rem .75rem; padding: .8rem 1rem .8rem .9rem; color: var(--ow-ink); text-decoration: none; }
.mb-row:hover { background: color-mix(in srgb, var(--ow-head-bg) 70%, transparent); text-decoration: none; }
.mb-row:focus-visible { outline: .125rem solid var(--brand); outline-offset: -.125rem; }
.mb-row.on { background: color-mix(in srgb, var(--ow-green) 9%, var(--surface)); box-shadow: inset var(--rail) 0 0 var(--ow-tab-line); }
.mb-row.row-attn, .mb-row.row-err { box-shadow: none; }
.mb-row.on.row-attn, .mb-row.on.row-err { box-shadow: inset var(--rail) 0 0 var(--ow-tab-line); }
.mb-av { grid-area: av; display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem;
    border-radius: 999px; background: color-mix(in srgb, var(--ow-green) 12%, var(--surface)); color: var(--ow-green);
    font-size: .8rem; font-weight: 700; letter-spacing: .02em; }
.mb-who { grid-area: who; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.mb-when { grid-area: when; font-size: .8rem; color: var(--ow-text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mb-subj { grid-area: subj; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; color: var(--ow-ink-2); }
.mb-sub { grid-area: sub; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .6rem; margin-top: .15rem; font-size: .8rem; }
.mb-sub .mr-state { font-weight: 500; color: var(--ow-text-2); }
.mb-tag { display: inline-flex; padding: 0 .45rem; border-radius: 999px; background: color-mix(in srgb, var(--ow-green) 10%, transparent);
    color: var(--ow-green); font-weight: 600; line-height: 1.35rem; }
.mb-tag.is-quiet { background: var(--ow-head-bg); color: var(--ow-text-2); font-weight: 500; }
.mb-clip { display: inline-flex; align-items: center; gap: .2rem; color: var(--ow-text-2); }
.mb-why { grid-area: why; margin-top: .15rem; font-size: .78rem; color: var(--ow-err-ink); }
.mb-none { padding: var(--s4); }
.mb-pages { margin: 0; padding: .75rem; border-top: 1px solid var(--ow-row-rule); }
.mb-list .progress-card, .mb-list .alert { margin: .75rem; }
/* the pane */
.mb-read { display: grid; min-width: 0; }
.mb-read-in { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); min-width: 0; }
.mb-read-hd { min-width: 0; }
.mb-read-hd .ow-title-row { align-items: flex-start; }
.mb-title { font-size: 1.75rem; white-space: normal; overflow-wrap: anywhere; outline: none; }
.mb-read-hd .ow-meta { gap: .25rem .5rem; margin-top: .4rem; }
.mb-read-hd .ow-meta .ow-meta-sep { margin: 0; }

.mr-meta-subj { color: var(--ow-ink); font-weight: 600; }
.mb-back { display: none; }
.mb-band { margin: 0; }

.mb-read .ow-card { border-radius: .875rem; border-color: var(--ow-card-bd); box-shadow: var(--ow-card-shadow); }
/* ⋯ — classification and the pipeline's steps */
.mb-more { min-width: 17rem; }
.mb-more form { margin: 0; }
.mb-more .ow-more-item:disabled { opacity: .45; cursor: not-allowed; }
.mb-more-note { margin: .35rem .625rem .25rem; font-size: .75rem; color: var(--ow-text-2); white-space: normal; }

/* a narrower window: the list and the item are two screens */
@media (max-width: 1024px) {
    .mb-inbox { grid-template-columns: minmax(0, 1fr); }
    .mb-list { position: static; max-height: none; overflow: visible; }
    .mb-inbox.is-reading .mb-list { display: none; }
    .mb-inbox:not(.is-reading) .mb-read { display: none; }
    .mb-page.is-reading > .mr-hd, .mb-page.is-reading .mr-filters { display: none; }
    .mb-back { display: inline-flex; }
}
@media (max-width: 640px) {
    .mb-title { font-size: 1.45rem; }
    .mb-row { padding: .75rem .8rem; }
    .mr-order { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "no who open" ". state sum"; gap: .25rem .75rem; }
    .mr-order-no { grid-area: no; } .mr-order-who { grid-area: who; } .mr-order-open { grid-area: open; }
    .mr-order-state { grid-area: state; font-size: .875rem; } .mr-order-sum { grid-area: sum; }
}
/* the reply's buttons stay in reach while its card is on screen: the preview is tall */
.mb-read .mr-draft-acts { position: sticky; bottom: 0; z-index: 5; margin: var(--s4) calc(-1 * var(--s5)) 0; padding: .75rem var(--s5);
    background: var(--surface); border-top: 1px solid var(--ow-row-rule); border-radius: 0 0 .875rem .875rem; }
.mb-read .mr-draft .reply-preview { height: 26rem; }
/* PU-192: a phone — the bar is not sticky and compact (the main button whole, the other two side by side);
   the heads wrap without orphan „·" */
@media (max-width: 640px) {
    .mb-read .mr-draft-acts { position: static; margin: var(--s4) 0 0; padding: 0; border-top: 0; background: none; gap: .5rem; align-items: stretch; }
    .mr-draft-acts .mr-btn-main { flex: 1 1 100%; }
    .mr-draft-acts .mr-btn-quiet, .mr-draft-acts .mr-btn-alt { flex: 1 1 0; min-width: 0; }
    .mb-page .ow-meta .ow-meta-sep { display: none; }
    .mb-page .ow-meta { gap: .25rem .75rem; }
}
/* a mailbox row is itself the link: no row-wide overlay (the table rows' `.row-link::after`) */
.mb-row { position: relative; }
.mb-row.row-link::after { content: none; }
/* the open row's tinted ground: its small words a step darker, for 4.5 */
.mb-row.on .mb-when, .mb-row.on .mb-sub .mr-state, .mb-row.on .mb-tag.is-quiet { color: var(--ow-ink-2); }
.mb-row.on .mb-tag { background: var(--surface); }

/* =========================================================   PU-71: the offers — the list, an offer's header, its review
   workspace and its tabs — in the order screen's design (2026-10-03). The look only: tokens, both themes, rem.
   ================================================================ */
/* the block's two theme tokens — a theme sets colours only, the rules below are one for both themes */
:root { --ofx-quiet-ink: var(--ow-ink-2); --ofx-on-orange: var(--ow-ink); }
[data-theme="dark"] { --ofx-quiet-ink: var(--muted); --ofx-on-orange: var(--bg); }
/* the list's head and the upload's: the order screen's title and meta line, no header card */
.ofx-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s3) var(--s4); flex-wrap: wrap;
    margin: 0 0 var(--s5); }
.ofx-head-t { min-width: 0; }
.ofx-title { margin: 0; font-size: 2.125rem; line-height: 1.15; font-weight: 650; letter-spacing: -.02em; color: var(--ow-ink); }
.ofx-meta { margin: .5rem 0 0; font-size: .95rem; color: var(--ow-text-2); }
.ofx-head .of-actions { gap: .625rem; }
.ofx-inline { margin: 0; }
/* „no active monthly offer": the warning band's colours */
.ofx-head + .offer-coverage { padding: .875rem 1.25rem; border: 1px solid var(--mk-warn-bd); border-radius: .75rem;
    background: var(--mk-warn-bg); color: var(--mk-warn-ink); margin-bottom: var(--s4); }
.ofx-head + .offer-coverage::before { background: var(--mk-warn-ico); }
/* the tabs: the order screen's — green with a 3 px line, a count as a pill */
.ofx-tabs, .ofx-hd .of-hd-tabs { gap: 1.75rem; }
.ofx-tabs { border-bottom-color: var(--ow-row-rule); margin-bottom: var(--s4); }
.ofx-tabs .of-tab, .ofx-hd .of-tab { padding: .6rem .25rem .75rem; font-size: 1rem; font-weight: 500; color: var(--ofx-quiet-ink);
    border-bottom: var(--rail) solid transparent; }
.ofx-tabs .of-tab:hover, .ofx-hd .of-tab:hover { color: var(--ow-ink); }
.ofx-tabs .of-tab.on, .ofx-hd .of-tab.on { color: var(--ow-green); border-bottom-color: var(--ow-tab-line); font-weight: 500;
    -webkit-text-stroke: .025em currentColor; }
.ofx-tabs .of-tab .cnt, .ofx-hd .of-tab .cnt { min-width: 1.5rem; padding: .05rem .45rem; border-radius: 999px; text-align: center;
    background: color-mix(in srgb, var(--ow-text-2) 12%, transparent); color: var(--ofx-quiet-ink); font-size: .8rem; font-weight: 600;
    opacity: 1; -webkit-text-stroke: 0; }
.ofx-tabs .of-tab.on .cnt, .ofx-hd .of-tab.on .cnt { background: color-mix(in srgb, var(--ow-green) 12%, transparent); color: var(--ow-green); }
.ofx-hd .of-tab .cnt.cnt-err { background: var(--ow-err-bg); color: var(--ow-err-ink); }
.ofx-hd .of-tab .cnt.cnt-attn { background: var(--ow-warn-bg); color: var(--ow-warn-ink); }
.ofx-hd .of-tab .cnt:empty { display: none; }
/* the search and the filters: the search bar's look */
.ofx-filters { gap: .625rem; margin-bottom: var(--s4); }
.ofx-filters .of-search { height: 2.75rem; padding: 0 1rem; border: 1px solid var(--ow-search-bd); border-radius: .75rem;
    background: var(--ow-search-bg); }
.ofx-filters .of-search:focus-within { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px var(--brand-soft); }
.ofx-filters .of-search .ico { color: var(--ow-text-2); }
.ofx-filters .of-search input::placeholder { color: var(--ow-text-2); opacity: 1; }
/* the mailbox's answer above the list */
.ofx-mail { margin-bottom: .75rem; padding: .75rem 1rem; border-radius: .75rem; font-size: .9rem; box-shadow: none; }
.ofx-mail.is-running { display: flex; align-items: center; gap: .625rem; flex-wrap: wrap; border-color: var(--ow-info-bd);
    background: var(--ow-info-bg); color: var(--ow-ink); }
.ofx-mail.is-running .brz-spin { color: var(--ow-info-ink); }
.ofx-mail.is-running .muted { font-size: .85rem; }
.ofx-mail.is-ok { border-color: var(--ow-ok-bd); }
.ofx-mail.is-err { border-color: var(--ow-err-bd); background: var(--ow-err-bg); }
.ofx-mail-notes { margin: .375rem 0 0; padding-left: 1.25rem; }
/* the tables: one card, a 48 px header band, rules between rows only */
.ofx-card { padding: 0; overflow: hidden; border-color: var(--ow-table-bd); border-radius: .875rem; box-shadow: var(--ow-card-shadow); }
.ofx-scroll { overflow-x: auto; }
.ofx-table { font-size: .9rem; }
.ofx-table thead th { height: 3.2rem; padding: 0 1rem; border: 0; border-bottom: 1px solid var(--ow-row-rule); background: var(--ow-head-bg);
    font-size: .8125rem; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ow-text-2); vertical-align: middle;
    white-space: nowrap; }
.ofx-table tbody td { padding: .9rem 1rem; border-left: 0; border-right: 0; border-bottom: 1px solid var(--ow-row-rule); }
.ofx-table th.num, .ofx-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.ofx-table tbody tr:hover > td { background: color-mix(in srgb, var(--ow-head-bg) 55%, transparent); }
.ofx-table tbody tr.attn, .ofx-table tbody tr.crit { box-shadow: none; }
.ofx-table tbody tr.attn > td, .ofx-table tbody tr.crit > td { background: var(--ow-warn-bg); }
.ofx-table tbody tr.attn > td:first-child, .ofx-table tbody tr.crit > td:first-child { box-shadow: inset var(--rail) 0 0 var(--ow-warn-strong); }
.ofx-table .of-page-h > th, .ofx-table tr.of-day > td { padding: .6rem 1rem; background: var(--ow-muted-row); color: var(--ow-ink);
    font-size: .875rem; border-bottom: 1px solid var(--ow-row-rule); }
.ofx-table .of-page-h .rc-link { color: var(--ow-green); font-weight: 600; }
/* a row of the list: the type's icon in a soft round tile, the note as a dot and its word */
.ofx-table .of-name { gap: .875rem; }
.ofx-table .of-name > .ico { display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem;
    border-radius: 999px; background: color-mix(in srgb, var(--ow-green) 10%, transparent); color: var(--ow-green); }
.ofx-table .of-title { color: var(--ow-ink); font-weight: 600; }
.ofx-table .of-title:hover { color: var(--ow-green); }
.ofx-table .of-sub { color: var(--ow-text-2); font-size: .8125rem; }
.ofx-table .of-note { display: inline-flex; align-items: center; gap: .45rem; margin-top: .25rem; color: var(--ow-warn-ink); font-weight: 500;
    text-decoration: none; }
.ofx-table .of-note:hover { text-decoration: underline; }
.ofx-table .of-note .ow-dot { background: var(--ow-warn-strong); }
.ofx-table .of-note.err { color: var(--ow-err-ink); }
.ofx-table .of-note.err .ow-dot { background: var(--ow-err-ink); }
.ofx-go-cell { text-align: right; }
.ofx-table .of-go { color: var(--ow-green); font-weight: 600; }
.ofx-table tbody tr:hover .of-go, .ofx-table .of-go:hover { color: var(--ow-green-hover); }
.ofx-table .of-check-ok { color: var(--ow-ok-ink); }
.ofx-table .of-check-todo { color: var(--ow-warn-ink); font-weight: 500; }
.ofx-members { margin-top: .125rem; }
.ofx-members-s { cursor: pointer; font-size: .75rem; }
.ofx-loading { font-size: .75rem; }
/* a daily pool's codes, typed by the owner (P2-143) */
.ofx-pool { display: flex; flex-direction: column; gap: .3rem; margin-top: .4rem; max-width: 22rem; }
.ofx-pool-in { font-size: .8rem; }
.ofx-pool .btn { align-self: flex-start; }
/* the status filters of Продукти: a row of pills */
.ofx-seg { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 var(--s3); }
.ofx-seg .chip { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .85rem; border: 1px solid var(--ow-search-bd);
    border-radius: 999px; background: var(--surface); color: var(--ow-ink-2); font-size: .875rem; font-weight: 500; text-decoration: none; }
.ofx-seg .chip b { color: var(--ow-ink); font-variant-numeric: tabular-nums; }
.ofx-seg .chip:hover { border-color: var(--ow-green); }
.ofx-seg .chip.chip-info, .ofx-seg .chip.chip-ok { border-color: var(--ow-green); background: color-mix(in srgb, var(--ow-green) 10%, transparent);
    color: var(--ow-green); }
.ofx-seg .chip.chip-info b, .ofx-seg .chip.chip-ok b { color: var(--ow-green); }
.ofx-seg .chip.chip-err { border-color: var(--ow-err-bd); background: var(--ow-err-bg); color: var(--ow-err-ink); }
.ofx-seg .chip.chip-err b { color: var(--ow-err-ink); }
/* Продукти: the page jump and the search in the search bar's look */
.ofx-seg + .of-prod-bar .of-prod-jump select, .ofx-hd ~ .of-prod-bar .of-prod-jump select { height: 2.75rem; padding: 0 .875rem;
    border-color: var(--ow-search-bd); border-radius: .75rem; background-color: var(--surface); color: var(--ow-ink); font-size: .875rem; }
.ofx-hd ~ .of-prod-bar .of-prod-search input { height: 2.75rem; border-color: var(--ow-search-bd); border-radius: .75rem;
    background: var(--ow-search-bg); }
.ofx-hd ~ .of-prod-bar .of-prod-search input:focus { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px var(--brand-soft); }
.ofx-hd ~ .of-prod-bar .of-prod-search .rc-search-ico { top: 1.375rem; }
/* a note above the rules („Замества офертата …") */
.ofx-banner { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-bottom: .75rem; padding: .75rem 1rem;
    border-color: var(--ow-info-bd); border-radius: .75rem; background: var(--ow-info-bg); box-shadow: none; }
.ofx-banner-acts { display: flex; gap: .5rem; margin: 0; }
/* the cards under an offer's header (Срок на офертата, its kind) */
.ofx-hd ~ .card { border-color: var(--ow-card-bd); border-radius: .875rem; box-shadow: var(--ow-card-shadow); }

/* an offer's header: the way back in words, the title and its state once, one meta line, the tabs.
   POF-12's intake count is a second meta line; the spacing is tight so the work area keeps its
   0.7 of the window (PU-02 AC-18) — every rem here is a rem of the workspace (PU-84). */
.ofx-hd { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 0; margin: 0 0 var(--s2); border-bottom: 0; }
.ofx-hd .of-tab { padding-top: .35rem; padding-bottom: .5rem; }
.ofx-hd .of-hd-back { justify-self: start; width: auto; height: auto; gap: .375rem; padding: 0; border: 0; border-radius: 0;
    background: none; font-size: .875rem; line-height: 1.25; color: var(--ofx-quiet-ink); text-decoration: none; }
.ofx-hd .of-hd-back:hover { color: var(--ow-green); background: none; }
.ofx-hd .of-hd-main { display: flex; align-items: center; gap: .5rem .75rem; flex-wrap: wrap; margin-top: var(--s1); padding: 0; }
.ofx-hd .of-hd-main h1 { flex: 0 1 auto; min-width: 0; font-size: 1.75rem; line-height: 1.1; font-weight: 650; letter-spacing: -.02em;
    color: var(--ow-ink); }
.ofx-hd .of-state { margin: 0; padding: .2rem .7rem; border-radius: 999px; font-size: .8125rem; font-weight: 600; }
.ofx-hd .of-hd-meta { margin: .2rem 0 0; font-size: .95rem; line-height: 1.35; color: var(--ow-text-2); white-space: normal; }
.ofx-hd .of-hd-meta + .of-hd-meta { margin-top: 0; }
.ofx-hd-row { display: flex; align-items: flex-end; gap: var(--s2) var(--s4); flex-wrap: wrap; margin-top: var(--s1);
    border-bottom: 1px solid var(--ow-row-rule); }
.ofx-hd .of-hd-tabs { flex: 1 1 auto; margin: 0; border-bottom: 0; }
.ofx-hd .rc-progress { margin-left: auto; align-self: center; padding: 0 0 .25rem var(--s4); border-left-color: var(--ow-row-rule); }

/* the workspace: its two panes one card of the order screen, the products' heads its header band */
.ofx-hd ~ .rc-work { border-color: var(--ow-card-bd); border-radius: .875rem; box-shadow: var(--ow-card-shadow); }
.ofx-hd ~ .rc-work .rc-page { border-radius: .875rem 0 0 .875rem; }
/* PU-192: no page yet — one sentence in a frame its own size, not the workspace's two empty panes */
.rc-work.rc-work-empty { display: block; height: auto; overflow: visible; }
.rc-work-empty > .rc-none { margin: 0; padding: var(--s5); color: var(--ow-text-2); font-size: .95rem; text-align: center; }
/* PU-192: a page with no picture (a daily offer's text) — the products take the workspace; the page pane only carries the
   pager and a line, and with one page it goes */
.rc-pager[hidden] { display: none; }
.rc-work.rc-work-noimg { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
.rc-work.rc-work-noimg > .rc-page { position: static; height: auto; box-shadow: none; border-radius: .875rem .875rem 0 0; }
.rc-work.rc-work-noimg > .rc-page > .rc-stage { flex: none; container-type: normal; }
.rc-work.rc-work-noimg > .rc-page .rc-empty { padding: var(--s2) var(--s4); text-align: left; }
.rc-work.rc-work-noimg > .rc-side { border-left: 0; }
.rc-work.rc-work-noimg.rc-work-one { grid-template-rows: minmax(0, 1fr); }
.rc-work.rc-work-noimg.rc-work-one > .rc-page { display: none; }
.rc-work.rc-work-noimg.rc-work-one > .rc-side { border-top: 0; }
/* PU-192: the offers list's filters — a drawn caret, one weight for every chosen value */
.ofx-filters .filter-dd > summary { align-items: center; }
.ofx-filters .filter-dd > summary::after { content: ""; width: .4rem; height: .4rem; margin: 0 .1rem 0 .15rem;
    border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; color: var(--ow-text-2);
    transform: translateY(-.15rem) rotate(45deg); }
.ofx-filters .fb-value, .ofx-filters .fb-value.fb-any { font-weight: 500; }
.rc-toolbar { height: 3.2rem; background: var(--ow-head-bg); border-bottom-color: var(--ow-row-rule); }
.rc-side-title { font-size: 1.25rem; font-weight: 650; color: var(--ow-ink); }
.rc-side-sub { font-size: .875rem; color: var(--ow-text-2); }
.rc-cols { margin-top: var(--s2); height: var(--rc-cols-h); box-sizing: border-box; padding: 0 var(--s2); border-bottom: 0;
    border-radius: .625rem; background: var(--ow-head-bg);
    font-size: .8125rem; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ow-text-2); }
.rc-item { border-bottom-color: var(--ow-row-rule); }
.rc-name { color: var(--ow-ink); }
.rc-code { color: var(--ow-text-2); }
/* a product with a problem is lit; a warning-only one reads checked — its note waits in Бележки (PU-86) */
.rc-item[data-state="crit"]:not(.is-open) > .rc-row,
.rc-item[data-state="unknown"]:not(.is-open) > .rc-row { background: var(--ow-warn-bg); box-shadow: inset var(--rail) 0 0 var(--ow-warn-strong); }
.rc-item[data-state="crit"] .rc-reason, .rc-item[data-state="unknown"] .rc-reason { color: var(--ow-warn-ink); }
.rc-item[data-state="attn"] .rc-reason { color: var(--ow-text-2); }
.rc-st-ok, .rc-st-todo { display: inline-flex; align-items: center; gap: .4rem; font-weight: 500; }
.rc-st-ok { color: var(--ow-ok-ink); }
.rc-st-ok .ow-dot { background: var(--ow-dot-ok); }
.rc-st-todo, .rc-item[data-state="crit"] .rc-st-todo, .rc-item[data-state="unknown"] .rc-st-todo { color: var(--ow-warn-ink); }
.rc-st-todo .ow-dot { background: var(--ow-warn-strong); }
/* a code new to the catalogue: settled, yet orange — never the green „сверен" (P2-107) */
.rc-st-new { display: inline-flex; align-items: center; gap: .4rem; font-weight: 500; color: var(--ow-warn-ink); }
.rc-st-new .ow-dot { background: var(--ow-warn-strong); }
.rc-item[data-state="new"] .rc-reason { color: var(--ow-warn-ink); }
.rc-item.is-open { border-color: var(--ow-green); border-radius: .75rem; box-shadow: var(--ow-card-shadow); }
.rc-ctx-promo { border-color: var(--ow-card-bd); border-radius: .75rem; }
.rc-decide { padding: var(--s3); border: 1px solid var(--ow-warn-bd); border-radius: .75rem; background: var(--ow-warn-bg); }
.rc-decide-q { color: var(--ow-ink); }
.rc-in { border-radius: .5rem; }
.rc-pagefoot { border-top-color: var(--ow-row-rule); }

/* Бележки: the panel a card whose head is the warning band while a note waits */
.rc-notes { border-color: var(--ow-card-bd); border-radius: .875rem; box-shadow: var(--ow-card-shadow); }
.rc-notes > .rc-notes-head:first-child { margin: calc(-1 * var(--s4)) calc(-1 * var(--s4)) var(--s2); padding: var(--s4);
    border-bottom: 1px solid var(--ow-row-rule); border-radius: .875rem .875rem 0 0; background: var(--ow-head-bg); }
.rc-notes.is-crit, .rc-notes.is-attn { border-color: var(--mk-warn-bd); }
.rc-notes.is-crit > .rc-notes-head:first-child, .rc-notes.is-attn > .rc-notes-head:first-child { border-bottom-color: var(--mk-warn-bd);
    background: var(--mk-warn-bg); }
.rc-notes.is-crit .rc-notes-t, .rc-notes.is-attn .rc-notes-t, .rc-notes.is-crit .rc-notes-n, .rc-notes.is-attn .rc-notes-n { color: var(--mk-warn-ink); }
.rc-notes.is-ok > .rc-notes-head:first-child { background: var(--ow-ok-bg); }
.rc-notes-t { font-size: 1.125rem; font-weight: 650; }
.rc-kind, .rc-note-row, .rc-closed { border-top-color: var(--ow-row-rule); }
.rc-note-where .rc-link, .rc-kind-all, .rc-note-acts .rc-link { color: var(--ow-green); }

/* the upload */
.ofx-back { display: inline-flex; align-items: center; gap: .375rem; margin-bottom: .75rem; font-size: .875rem; color: var(--ofx-quiet-ink);
    text-decoration: none; }
.ofx-back:hover { color: var(--ow-green); }
.ofx-upload { max-width: 52rem; padding: 1.25rem; border-color: var(--ow-card-bd); border-radius: .875rem; box-shadow: var(--ow-card-shadow); }
.ofx-upload-l { margin-top: 0; }
.ofx-upload .of-drop { border-radius: .75rem; }
.ofx-small { font-size: .8rem; }
.ofx-choice { margin-top: 1rem; border-radius: .75rem; }
.ofx-upload-foot { margin: 1rem -1.25rem -1.25rem; border-radius: 0 0 .875rem .875rem; }

/* the owner's review (2026-10-04): an opened product lights its whole section — the cell the PDF draws round its
   code (--cell: 1) — tinted and ringed, the rest of the page quieter; a code outside every cell is lit as before */
.rc-spot { left: calc(var(--x) - 1% * (1 - var(--cell, 0))); top: calc(var(--y) - 3.2% * (1 - var(--cell, 0)));
    width: calc(var(--w) + 2% * (1 - var(--cell, 0))); height: calc(var(--h) + 4.4% * (1 - var(--cell, 0)));
    border-radius: .5rem; outline: 3px solid var(--ow-green); outline-offset: 0;
    background: color-mix(in srgb, var(--ow-green) 12%, transparent);
    transition: opacity var(--dur-2) var(--ease); }
/* the pins and the list's numbers (the owner's pick, 2026-10-04: variant Е — round, upright, one size; in a section
   they stand on its top-left corner, side by side), in two fills by „problem or not" (PU-86): green when the product
   is fine (a pattern code and a warning-only product too — a warning lives in the notes), orange for a critical note
   or an unknown code; the open or pointed product the deep green, ringed. `tools/acceptance/test_offer_pins_two_states.py`
   fails a rule that paints every state one colour again (PR 544 did) */
.rc-pin, .rc-pin[data-state] { min-width: 1.7rem; height: 1.7rem; padding: 0 .35rem; border-radius: 999px; opacity: 1;
    background: var(--pin-ok); color: var(--ofx-on-orange); font-size: .8rem; font-weight: 800; line-height: 1.7rem;
    box-shadow: 0 0 0 2px var(--surface), var(--ow-card-shadow); }
.rc-pin[data-state="crit"], .rc-pin[data-state="unknown"] { background: var(--pin-problem); }
.rc-pin[data-state="new"] { background: var(--pin-problem); }  /* a code new to the catalogue: orange (P2-107) */
.rc-pin:hover, .rc-pin.is-hot, .rc-pin.is-cur, .rc-pin[data-state]:hover, .rc-pin[data-state].is-hot, .rc-pin[data-state].is-cur {
    background: var(--pin-cur); color: var(--pin-on-cur); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--pin-ok), var(--ow-card-shadow); }
.rc-pin.ofx-pin-cell { left: calc(var(--x) - .6rem + var(--i, 0) * 1.95rem); top: calc(var(--y) - .6rem); transform: none; }
.rc-pin.ofx-pin-cell:hover, .rc-pin.ofx-pin-cell.is-hot, .rc-pin.ofx-pin-cell.is-cur { transform: scale(1.12); }
/* a daily offer (PU-87, the owner's pick Б): the pin smaller, in the margin just left of its section, on the section's
   first line — never on the text; the pager keeps a page's pins in one column apart (--dy) */
.rc-pin.ofx-pin-side { left: calc(var(--x) - .35rem); top: calc(var(--fy) + var(--dy, 0px)); min-width: var(--ps, 1.3rem);
    height: var(--ps, 1.3rem); padding: 0 calc(var(--ps, 1.3rem) * .12); font-size: calc(var(--ps, 1.3rem) * .51);
    line-height: var(--ps, 1.3rem); transform: translate(-100%, -50%); }
/* pointed, it keeps its size (a dense list leaves no room to grow): PU-86's deep green and ring say it */
.rc-pin.ofx-pin-side:hover, .rc-pin.ofx-pin-side.is-hot, .rc-pin.ofx-pin-side.is-cur { transform: translate(-100%, -50%); }
.rc-item .rc-n, .rc-item[data-state] .rc-n { border-color: var(--pin-ok); background: var(--pin-ok); color: var(--ofx-on-orange);
    font-weight: 800; }
.rc-item[data-state="crit"] .rc-n, .rc-item[data-state="unknown"] .rc-n { border-color: var(--pin-problem); background: var(--pin-problem); }
.rc-item[data-state="new"] .rc-n { border-color: var(--pin-problem); background: var(--pin-problem); }  /* P2-107 */
.rc-item.is-open .rc-n, .rc-item.is-hot .rc-n, .rc-item[data-state].is-open .rc-n, .rc-item[data-state].is-hot .rc-n {
    border-color: var(--pin-cur); background: var(--pin-cur); color: var(--pin-on-cur);
    box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--pin-ok); }
/* the figure dark on either fill, so it reads: the text's ink in the light theme, the page's ground in the dark */
.rc-pin:not(:hover):not(.is-hot):not(.is-cur), .rc-item:not(.is-open):not(.is-hot) .rc-n { color: var(--ofx-on-orange); }
/* the list's prices: one right edge — the regular struck above the promotion, the percent a pill in its own column */
@media (min-width: 601px) { .rc-cols, .rc-row { grid-template-columns: 1.75rem minmax(0, 1fr) 8.25rem 5.5rem; } }
.rc-price { display: grid; grid-template-columns: auto 2.75rem; justify-content: end; align-items: center; gap: .1rem .4rem;
    font-variant-numeric: tabular-nums; }
.rc-price > .rc-reg { grid-column: 1; grid-row: 1; justify-self: end; flex-basis: auto; font-size: .75rem; color: var(--ow-text-2); }
.rc-price > .rc-promo { grid-column: 1; grid-row: 2; justify-self: end; font-size: .95rem; font-weight: 700; color: var(--ow-ink); white-space: nowrap; }
.rc-price > .rc-pct { grid-column: 2; grid-row: 2; justify-self: stretch; padding: .05rem 0; border-radius: 999px; text-align: center;
    background: color-mix(in srgb, var(--ow-green) 10%, transparent); color: var(--ow-green); font-size: .72rem; font-weight: 600; }

/* a phone: the titles a step smaller, the tabs scroll in their row, the actions take the width */
@media (max-width: 640px) {
    .ofx-title { font-size: 1.6rem; }
    .ofx-head .of-actions { width: 100%; }
    .ofx-hd .of-hd-main h1 { font-size: 1.4rem; }
    .ofx-tabs, .ofx-hd .of-hd-tabs { gap: 1.25rem; overflow-x: auto; scrollbar-width: none; }
    .ofx-hd .rc-progress { margin-left: 0; padding-left: 0; }
    /* PU-192: the header's progress wraps — the approve button and its reason never push the page sideways */
    .ofx-hd .rc-progress { flex-wrap: wrap; white-space: normal; max-width: 100%; row-gap: var(--s1); }
    .ofx-hd-row { min-width: 0; }
    .rc-side-head .rc-search-btn { margin-left: auto; align-self: center; }
    .ofx-filters .of-search { flex-basis: 100%; }
    .rc-notes .rc-kind-h, .rc-notes .rc-note-row { grid-template-columns: minmax(0, 1fr); gap: var(--s1); }
    .rc-notes .rc-note-acts { flex-wrap: wrap; }
}

/* =========================================================   PU-66: the catalogue in the order screen's design (the
   owner, 2026-10-03: „Следвай този дизайн"). The head, the bar, the table, the dialog and /catalog/pending/ wear
   PU-62…PU-64's tokens and shapes; the behaviour is the PCAT slices'. A `badge-<role>` wears its role since PX-211.
   ================================================================ */
/* the block's own tokens: a theme sets colours only — every rule below is the same in both themes */
:root {
    --cat-cnt-bg: var(--ow-warn-ico);
    --cat-cnt-fg: var(--ow-on-fill);
    --cat-quiet-ink: var(--ow-ink-2);
    --cat-lit-quiet: var(--ow-ink-2);
    --cat-page-on: var(--ow-green);
}
[data-theme="dark"] {
    --cat-cnt-bg: var(--ow-warn-ink);
    --cat-cnt-fg: var(--bg);
    --cat-quiet-ink: var(--muted);
    --cat-lit-quiet: color-mix(in srgb, var(--text) 40%, var(--muted));
    --cat-page-on: var(--ow-ok-ink);
}
/* the head: the order screen's title and meta line on the page's ground, the actions on the right — no hero card */
.cat-hd { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s3) var(--s5);
    flex-wrap: wrap; margin: 0 0 var(--s5); }
.cat-hd-t { flex: 1 1 28rem; min-width: 0; }
.cat-title { margin: 0; font-size: 2.125rem; line-height: 1.15; font-weight: 650; letter-spacing: -.02em; color: var(--ow-ink); }
.cat-meta { display: flex; align-items: flex-start; gap: .5rem; margin: .5rem 0 0; max-width: 90ch; font-size: .95rem;
    line-height: 1.5; color: var(--ow-text-2); }
.cat-meta .ico { flex: none; margin-top: .2rem; }
.cat-hd-act { display: flex; align-items: center; gap: .625rem; flex-wrap: wrap; }
.cat-btn .ico { color: var(--ow-text-2); }
.cat-btn:hover .ico { color: currentColor; }
.cat-btn.is-attn { border-color: var(--ow-warn-bd); color: var(--ow-warn-ink); --btn-top: var(--ow-warn-bg); --btn-bottom: var(--ow-warn-bg); }
.cat-btn.is-attn .ico { color: var(--ow-warn-ink); }
.cat-btn.is-attn:hover { border-color: var(--ow-warn-ink); color: var(--ow-warn-ink); }
.cat-cnt { display: inline-flex; align-items: center; justify-content: center; min-width: 1.5rem; height: 1.5rem;
    padding: 0 .4rem; border-radius: 999px; background: var(--cat-cnt-bg); color: var(--cat-cnt-fg); font-size: .8rem;
    font-weight: 700; font-variant-numeric: tabular-nums; }
.ow-back + .cat-hd { margin-top: 0; }
/* the bar: no strip of its own — the field wears the app search's ground and edge, the dropdowns its shape */
.cat-bar { padding: 0; margin: 0 0 var(--s4); background: none; border: 0; gap: .625rem; }
.cat-search { position: relative; flex: 1 1 22rem; display: flex; align-items: center; min-width: 0; }
.cat-search > .ico { position: absolute; left: .875rem; color: var(--ow-text-2); pointer-events: none; }
.cat-bar .cat-search .search { width: 100%; min-width: 0; min-height: 44px; padding: 0 1rem 0 2.6rem;
    background: var(--ow-search-bg); border: 1px solid var(--ow-search-bd); border-radius: .75rem; font-size: .95rem; }
.cat-bar .cat-search .search::placeholder { color: var(--ow-text-2); opacity: 1; }
.cat-bar .cat-search .search:focus { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px var(--brand-soft); }
.cat-bar .filter-dd > summary { min-height: 44px; align-items: center; padding: 0 .875rem; border-radius: .75rem;
    border-color: var(--ow-search-bd); background: var(--surface); }
.cat-bar .filter-dd[open] > summary { border-color: var(--brand); }
.cat-bar .filter-menu { border-radius: .75rem; box-shadow: var(--pop-shadow); }
.cat-bar .filter-sep { display: none; }
/* the table: one card, the 48 px header band, rules only between rows, numbers right and tabular */
.cat-lines { padding: 0; overflow: hidden; border-radius: .875rem; border-color: var(--ow-table-bd); box-shadow: var(--ow-card-shadow); }
.cat-lines > .ow-table { border-collapse: separate; border-spacing: 0; }
.cat-lines .ow-table thead th { height: 3rem; padding-top: 0; padding-bottom: 0; background: var(--ow-head-bg);
    border-bottom: 1px solid var(--ow-row-rule); font-size: .8125rem; font-weight: 500; color: var(--ow-text-2);
    text-transform: none; letter-spacing: 0; }
.cat-lines .ow-table th:first-child { border-radius: .875rem 0 0 0; }
.cat-lines .ow-table th:last-child { border-radius: 0 .875rem 0 0; }
.cat-lines .ow-table tbody tr { border-bottom: 0; cursor: default; }
.cat-lines .ow-table tbody td { padding-top: .8rem; padding-bottom: .8rem; border-bottom: 1px solid var(--ow-row-rule); }
.cat-lines .ow-table tbody tr:last-child td { border-bottom: 0; }
.cat-lines .ow-table tbody tr:hover td { background: color-mix(in srgb, var(--ow-head-bg) 60%, transparent); }
.cat-lines .ow-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.cat-lines .ow-table td.price-cell { color: var(--ow-ink); font-weight: 600; }
.cat-lines .ow-table td.cat-pts { color: var(--ow-text-2); }
/* PU-192: an empty cell is one muted dash, in every column */
.cat-lines .ow-table .cat-none { color: var(--ow-text-2); font-weight: 400; }
/* PU-192: a heading stands on its values' edge — the header cells padded as the body cells under them */
.cat-lines .ow-table thead th { padding-left: .5625rem; padding-right: .5625rem; }
.cat-lines .ow-table thead th:first-child { padding-left: .9375rem; }
.cat-lines .ow-table thead th:last-child { padding-right: .703125rem; }
.cat-lines .ow-code { font-family: var(--font-ui); font-size: .875rem; color: var(--ow-text-2); }
.cat-lines .ow-prod { font-size: .9rem; font-weight: 600; color: var(--ow-ink); }
.cat-lines .ow-table td .badge { margin-left: .375rem; }
/* a withdrawn product reads as the order's excluded line */
.cat-lines .ow-table tbody tr.is-out td { background: var(--ow-muted-row); color: var(--ow-text-2); }
.cat-lines .ow-table tbody tr.is-out .ow-prod, .cat-lines .ow-table tbody tr.is-out td.price-cell { color: var(--ow-text-2); font-weight: 500; }
/* the pencil: the row ⋯'s shape */
.cat-c-edit { width: 3.5rem; text-align: right; }
.cat-edit { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; padding: 0;
    border: 0; border-radius: .5rem; background: transparent; color: var(--ow-ink); cursor: pointer; }
.cat-edit:hover { background: var(--ow-head-bg); color: var(--ow-green); }
.cat-edit:focus-visible { outline: .125rem solid var(--brand); outline-offset: .0625rem; }
/* the count and the pages under the card */
.cat-count { margin: var(--s3) 0 0; font-size: .875rem; color: var(--ow-text-2); }
.cat-pages { gap: .375rem; }
.cat-pages .page-num { min-width: 2.25rem; height: 2.25rem; display: inline-flex; align-items: center; justify-content: center;
    border-radius: .5rem; border-color: var(--ow-row-rule); background: var(--surface); color: var(--ow-ink); }
.cat-pages .page-num-active { background: var(--ow-green); border-color: var(--ow-green); color: var(--ow-on-fill); }
/* the edit dialog: PU-60's — the icon beside the title, every part across the form, the action first */
.cat-hint, .cat-check { grid-column: 1 / -1; }

/* PU-192: the two values right, under right-aligned headings; the date one line; the bulk pair and a row's pair one width */

@media (max-width: 640px) {
    .cat-title { font-size: 1.75rem; }
    .cat-hd-act, .cat-hd-act .cat-btn { width: 100%; }
    .cat-hd-act .cat-btn { justify-content: center; }
    .cat-search { flex-basis: 100%; }
    .cat-bar .filter-dd { flex: 1 1 auto; }
    .cat-bar .filter-dd > summary { width: 100%; }
    .cat-c-edit { width: auto; }
    .cat-lines .ow-table th:first-child, .cat-lines .ow-table th:last-child { border-radius: 0; }
}
/* on a phone a product is the order screen's line card: its name and pencil on top, its four numbers under it */
@media (max-width: 720px) {
    .cat-lines .ow-table tbody tr { padding: .875rem 1rem; border-bottom: 1px solid var(--ow-row-rule); gap: .35rem 1.25rem; }
    .cat-lines .ow-table tbody tr:last-child { border-bottom: 0; }
    .cat-lines .ow-table tbody td { padding: 0; border-bottom: 0; }
    .cat-lines .ow-table tbody td::before { font-size: .8125rem; font-weight: 400; color: var(--ow-text-2); text-transform: none; letter-spacing: 0; }
    .cat-table tbody td[data-label="Продукт"] { order: -2; grid-column: 1; display: block; }
    .cat-table tbody td[data-label="Продукт"]::before, .cat-table tbody td.cat-c-edit::before { content: none; }
    .cat-table tbody td.cat-c-edit { order: -1; grid-column: 2; justify-content: flex-end; align-self: start; }
    .cat-table tbody td[data-label="Продукт"] .badge { margin: .25rem .375rem 0 0; }
    .cat-table tbody td.ow-code { white-space: nowrap; }
    .cat-table:not(:has(.cat-c-edit)) tbody td[data-label="Продукт"] { grid-column: 1 / -1; }
    .cat-table tbody tr.empty-row { display: block; padding: 0; }

}
/* --- PU-66 (the owner, 2026-10-04): the right panel, the status column, the category, the row ⋯, the pages --- */
/* the card no longer clips: a row's ⋯ opens below its row */
.cat-lines { overflow: visible; }
.cat-lines .ow-table tbody tr:last-child td:first-child { border-bottom-left-radius: .875rem; }
.cat-lines .ow-table tbody tr:last-child td:last-child { border-bottom-right-radius: .875rem; }
.cat-lines .ow-table tbody tr[data-pk] { cursor: pointer; }
.cat-lines .ow-table tbody tr.is-lit td { background: color-mix(in srgb, var(--ow-green) 6%, var(--surface)); }
/* the open product's row: its quiet words a step darker, 4.5 on the tint */
.cat-lines .ow-table tbody tr.is-lit .ow-code, .cat-lines .ow-table tbody tr.is-lit .cat-cat,
.cat-lines .ow-table tbody tr.is-lit td.cat-pts { color: var(--cat-lit-quiet); }
.cat-open { padding: 0; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.cat-open:hover { color: var(--ow-green); text-decoration: underline; text-underline-offset: .2em; }
.cat-open:focus-visible { outline: .125rem solid var(--brand); outline-offset: .125rem; border-radius: .25rem; }
.cat-cat { max-width: 12rem; font-size: .8125rem; color: var(--ow-text-2); overflow-wrap: anywhere; }
/* one status word: a soft pill with its dot */
.cat-state { display: inline-flex; align-items: center; gap: .375rem; padding: .2rem .6rem; border-radius: 999px;
    font-size: .78rem; font-weight: 600; white-space: nowrap; }
.cat-lines .ow-table td .cat-state { margin-left: 0; }
.cat-dot, .filter-dot { flex: none; width: .5rem; height: .5rem; border-radius: 999px; background: currentColor; }
.cat-state.is-active { background: var(--ow-ok-bg); color: var(--ow-ok-ink); }
.cat-state.is-active .cat-dot, .filter-dot.is-active, .filter-dot.is-all { background: var(--ow-dot-ok); }
.cat-state.is-archived { background: var(--ow-err-bg); color: var(--ow-err-ink); }
.filter-dot.is-archived { background: var(--ow-err-ink); }
.cat-state.is-promo { background: var(--ow-info-bg); color: var(--ow-info-ink); }
.filter-dot.is-promo { background: var(--ow-info-ink); }
.cat-state.is-noprice { background: var(--ow-busy-bg); color: var(--ow-text-2); }
.filter-dot.is-noprice { background: var(--ow-settled-line); }
/* P2-14: a promo price the pricelist left unconfirmed — the warning tokens, as every „провери" */
.cat-state.is-unconfirmed { background: var(--ow-warn-bg); color: var(--ow-warn-ink); }
.filter-dot.is-unconfirmed { background: var(--ow-warn-strong); }
.cat-unconfirmed { display: flex; gap: .5rem; align-items: flex-start; margin: 0 0 .75rem; padding: .5rem .75rem;
    border-radius: .5rem; background: var(--ow-warn-bg); color: var(--ow-warn-ink); font-size: .8125rem; }
.cat-unconfirmed svg { flex: none; margin-top: .1rem; }
.cat-panel-edit .cat-unconfirmed { grid-column: 1 / -1; margin: 0; }
.filter-dot.is-all { background: var(--ow-green); }
/* the status menu as the mockup draws it: the dot in the radio's place, a check on the chosen option */
.cat-bar .filter-opt { position: relative; min-height: 2.5rem; padding-right: 2rem; border-radius: .5rem; }
.cat-bar .filter-opt:has(.filter-dot) input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.cat-bar .filter-opt:has(input:checked) { background: color-mix(in srgb, var(--ow-green) 8%, transparent); font-weight: 600; }
.cat-bar .filter-opt:has(input:checked)::after { content: ""; position: absolute; right: .75rem; top: 50%; width: .3rem; height: .6rem;
    margin-top: -.4rem; border: solid var(--ow-green); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.cat-bar .filter-opt:has(.filter-dot):focus-within { outline: .125rem solid var(--brand); outline-offset: -.125rem; }
.cat-bar .filter-menu { min-width: 17rem; }
/* the pencil and the ⋯ side by side */
.cat-c-edit { width: 5.5rem; }
.cat-c-edit > * { vertical-align: middle; }
.cat-row-menu > summary { color: var(--ow-ink); }
.cat-row-menu .ow-pop form { margin: 0; }
.cat-row-menu .ow-pop .ow-more-item { white-space: nowrap; }
/* the count and the pages in the card's foot */
.cat-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap;
    padding: .75rem 1rem; border-top: 1px solid var(--ow-row-rule); }
.cat-foot .cat-count { margin: 0; }
.cat-pages { display: flex; align-items: center; gap: .25rem; margin: 0; }
.cat-pages .page-num { min-width: 2.25rem; height: 2.25rem; padding: 0 .4rem; border: 0; background: none; font-weight: 500; }
.cat-pages .page-num:hover { background: var(--ow-head-bg); }
.cat-pages .page-num-active { background: color-mix(in srgb, var(--ow-green) 12%, transparent); color: var(--cat-page-on); font-weight: 700; }
.cat-page-gap { min-width: 1.5rem; text-align: center; color: var(--ow-text-2); }
.cat-page-arrow { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem;
    border: 1px solid var(--ow-row-rule); border-radius: .5rem; color: var(--ow-ink); background: var(--surface); }
.cat-page-arrow:hover { border-color: var(--ow-green); color: var(--ow-green); text-decoration: none; }
/* the right panel: fixed at the window's right edge, over the table — the table keeps its width; no scrim */
.cat-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; width: min(28rem, 100vw); overflow-y: auto;
    background: var(--surface); border-left: 1px solid var(--ow-card-bd); box-shadow: var(--pop-shadow); }
@media (prefers-reduced-motion: no-preference) {
    .cat-panel:not([hidden]) { animation: cat-panel-in .18s var(--ease-out); }
}
@keyframes cat-panel-in { from { transform: translateX(1.5rem); } to { transform: none; } }
.cat-panel-in { display: flex; flex-direction: column; min-height: 100%; }
.cat-panel-hd { position: relative; padding: 1.5rem 1.5rem 1rem; }
.cat-panel-hd h2 { margin: 0 2.5rem 0 0; font-size: 1.375rem; line-height: 1.25; font-weight: 650; color: var(--ow-ink); }
.cat-panel-hd h2:focus { outline: none; }
.cat-panel-hd h2:focus-visible { outline: .125rem solid var(--brand); outline-offset: .125rem; }
.cat-panel-x { position: absolute; top: 1.25rem; right: 1.125rem; display: inline-flex; align-items: center; justify-content: center;
    width: 2.25rem; height: 2.25rem; border: 0; border-radius: .5rem; background: none; color: var(--ow-text-2); cursor: pointer; }
.cat-panel-x:hover { background: var(--ow-head-bg); color: var(--ow-ink); }
.cat-panel-x:focus-visible { outline: .125rem solid var(--brand); }
.cat-panel-sub { display: flex; align-items: center; gap: .875rem; flex-wrap: wrap; margin: .625rem 0 0; font-size: .875rem; color: var(--ow-text-2); }
.cat-panel-view { display: flex; flex-direction: column; flex: 1 1 auto; }
.cat-tabs { display: flex; gap: 1.5rem; padding: 0 1.5rem; border-bottom: 1px solid var(--ow-row-rule); }
.cat-tab { padding: .6rem 0 .7rem; border: 0; border-bottom: var(--rail) solid transparent; background: none; font: inherit;
    font-size: .9375rem; font-weight: 500; color: var(--cat-quiet-ink); cursor: pointer; }
.cat-tab.on { color: var(--ow-green); border-bottom-color: var(--ow-tab-line); -webkit-text-stroke: .025em currentColor; }
.cat-tab:focus-visible { outline: .125rem solid var(--brand); outline-offset: .125rem; }
.cat-tab .cnt { margin-left: .25rem; padding: 0 .4rem; border-radius: 999px; font-size: .75rem;
    background: color-mix(in srgb, var(--ow-green) 12%, transparent); color: var(--ow-green); }
.cat-panel-body { padding: 1.25rem 1.5rem; flex: 1 1 auto; }
.cat-panel-h { margin: 1.5rem 0 .625rem; font-size: 1rem; font-weight: 650; color: var(--ow-ink); }
.cat-facts, .cat-nums, .cat-more { display: grid; gap: .75rem; margin: 0; }
.cat-facts dt, .cat-more dt { font-size: .8125rem; color: var(--ow-text-2); }
.cat-facts dd { margin: .125rem 0 0; font-size: .9375rem; color: var(--ow-ink); }
.cat-nums > div, .cat-more > div { display: flex; justify-content: space-between; gap: var(--s3); align-items: baseline; }
.cat-nums { gap: .625rem; }
.cat-nums dt { font-size: .9375rem; color: var(--cat-quiet-ink); }
.cat-nums dd { margin: 0; font-size: 1rem; font-weight: 700; color: var(--ow-ink); font-variant-numeric: tabular-nums; }
.cat-more { gap: .5rem; }
.cat-more dd { margin: 0; font-size: .875rem; color: var(--ow-ink); text-align: right; overflow-wrap: anywhere; }
.cat-history { display: grid; gap: .75rem; margin: 0; padding: 0; list-style: none; }
.cat-history li { display: grid; gap: .125rem; padding-bottom: .75rem; border-bottom: 1px solid var(--ow-row-rule); }
.cat-history li:last-child { border-bottom: 0; }
.cat-history-what { font-size: .875rem; color: var(--ow-ink); }
.cat-history-what s { color: var(--ow-text-2); }
.cat-history-when { font-size: .8125rem; color: var(--ow-text-2); }
.cat-history-none { margin: 0; color: var(--ow-text-2); }
.cat-panel-foot { position: sticky; bottom: 0; display: flex; gap: .75rem; flex-wrap: wrap; padding: 1rem 1.5rem;
    background: var(--surface); border-top: 1px solid var(--ow-row-rule); }
.cat-panel-foot > *, .cat-panel-foot form { flex: 1 1 10rem; margin: 0; }
.cat-panel-foot form .btn, .cat-panel-foot > .btn { width: 100%; justify-content: center; }
.cat-btn.is-danger { border-color: var(--ow-err-bd); color: var(--ow-err-ink); }
.cat-btn.is-danger .ico { color: var(--ow-err-ink); }
.cat-btn.is-danger:hover { border-color: var(--ow-err-ink); color: var(--ow-err-ink); --btn-top: var(--ow-err-bg); --btn-bottom: var(--ow-err-bg); }
/* the edit form in the panel: the fields two by two, the actions at its foot */
.cat-panel-edit { display: grid; grid-template-columns: 1fr 1fr; gap: .875rem; padding: 1.25rem 1.5rem 0; flex: 1 1 auto; align-content: start; }
.cat-panel-edit[hidden] { display: none; }
.cat-panel-note { grid-column: 1 / -1; margin: 0; font-size: .875rem; color: var(--ow-text-2); }
.cat-panel-edit .orgnew-field { font-weight: 500; font-size: .875rem; color: var(--cat-quiet-ink); }
.cat-panel-edit .orgnew-field input { width: 100%; min-height: 44px; border-radius: .625rem; border-color: var(--ow-search-bd); background: var(--surface); }
.cat-panel-edit .orgnew-field input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.cat-panel-foot.is-edit { grid-column: 1 / -1; margin: .5rem -1.5rem 0; }
@media (max-width: 720px) {
    .cat-c-edit { width: auto; }
    .cat-table tbody td.cat-c-edit { display: flex; gap: .25rem; }
    .cat-foot { justify-content: center; }
    .cat-panel { width: 100vw; border-left: 0; }
}
/* the one row menu, placed under the ⋯ that opened it */
.cat-row-menu { position: absolute; z-index: 30; width: max-content; }
.cat-row-menu .cat-if-archived, .cat-row-menu.is-archived .cat-if-active { display: none; }
.cat-row-menu.is-archived .cat-if-archived, .cat-row-menu .cat-if-active { display: inline-flex; align-items: center; gap: .625rem; }
.cat-row-menu.is-archived .cat-if-active { display: none; }
.cat-more[aria-expanded="true"] { background: var(--ow-head-bg); }
.cat-sprite, .rd-ntf-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
/* the pencil and the ⋯ stay on one line; the panel's two actions keep their words on one line */
.cat-lines .ow-table td.cat-c-edit { width: 6.5rem; white-space: nowrap; }
.cat-lines .ow-table td.cat-c-edit > .cat-edit { display: inline-flex; vertical-align: middle; }
.cat-panel-foot .btn { white-space: nowrap; }

/* =========================================================   PU-72: Разговори and Несъгласия in the order screen's
   language (the owner, 2026-10-03: „Следвай този дизайн") — the head's title, the order's tabs, its table card, its
   cards, its dots, the mockup's primary; tokens only, both themes.
   ================================================================ */
/* the theme sets only these tokens (the owner, 2026-10-04: „всичко … token based"); every rule below is one rule */
:root { --cd-tab-ink: var(--ow-ink-2); --cd-link: var(--ow-link); --cd-label-ink: var(--ow-ink-2); }
[data-theme="dark"] { --cd-tab-ink: var(--muted); --cd-link: var(--info-fg); --cd-label-ink: var(--muted); }

/* the filter tabs: the order's tabs — no pill, the open one green on a 3 px line, its count in a green chip */
.status-tabs.cd-tabs { display: flex; flex-wrap: nowrap; align-items: flex-end; gap: var(--s5); margin: 0 0 var(--s4);
    border-bottom: 1px solid var(--ow-row-rule); overflow-x: auto; scrollbar-width: none; }
.status-tabs.cd-tabs::-webkit-scrollbar { display: none; }
.cd-tabs .tab, .cd-tabs .tab-active { display: inline-flex; align-items: center; gap: .5rem; flex: none; margin: 0 0 -1px;
    padding: .6rem .25rem .75rem; border: 0; border-bottom: var(--rail) solid transparent; border-radius: 0;
    background: none; box-shadow: none; color: var(--cd-tab-ink); font-size: 1rem; font-weight: 500; white-space: nowrap; }
.cd-tabs .tab:hover { color: var(--ow-green); background: none; border-color: transparent; }
.cd-tabs .tab.tab-active { color: var(--ow-green); border-bottom-color: var(--ow-tab-line);
    -webkit-text-stroke: .025em currentColor; background: none; }
.cd-tabs .tab .tab-n, .cd-tabs .tab-active .tab-n { display: inline-flex; min-width: 1.25rem; justify-content: center; padding: 0 .35rem;
    border-radius: 999px; background: var(--ow-busy-bg); color: var(--ow-text-2); font-size: .8rem; font-weight: 600;
    line-height: 1.35rem; font-variant-numeric: tabular-nums; -webkit-text-stroke: 0; }
.cd-tabs .tab-active .tab-n { background: color-mix(in srgb, var(--ow-green) 12%, transparent); color: var(--ow-green); }
/* the conversations table: the order's table card */
.table-card.cd-card { border-radius: .875rem; border-color: var(--ow-table-bd); box-shadow: var(--ow-card-shadow); }
.cd-card .cv-table thead th { height: 3rem; padding-top: 0; padding-bottom: 0; background: var(--ow-head-bg);
    border-bottom: 1px solid var(--ow-row-rule); font-size: .8125rem; font-weight: 500; letter-spacing: 0;
    text-transform: none; color: var(--ow-text-2); vertical-align: middle; }
.cd-card .cv-table thead th:first-child { border-radius: .875rem 0 0 0; }
.cd-card .cv-table thead th:last-child { border-radius: 0 .875rem 0 0; }
.cd-card .cv-table tbody tr { cursor: default; border-bottom-color: var(--ow-row-rule); }
.cd-card .cv-table tbody tr:hover { background: none; }
@media (min-width: 601px) { .cd-card .cv-table td { padding-top: .9rem; padding-bottom: .9rem; vertical-align: middle; } }
.cd-card .cv-question { font-size: .875rem; color: var(--ow-ink); line-height: 1.45; }
/* PU-192: the question in two lines, the whole of it in the cell's title */
.cv-q { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.cd-who { color: var(--ow-ink); }
.cd-card .cv-table td.cd-who { max-width: 18rem; white-space: nowrap; color: var(--ow-ink); }
.cd-who-g { display: inline-flex; align-items: center; gap: .75rem; min-width: 0; max-width: 100%; }
.cd-order-g, .cd-when-g { display: inline-block; }
.cd-avatar { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem;
    border-radius: 999px; background: var(--brand-soft); color: var(--brand-strong); font-size: .875rem; font-weight: 700; }
.cd-who-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: .875rem; font-weight: 500; }
.cd-card .cv-when { font-size: .875rem; color: var(--ow-text-2); }
.cd-when-d { display: block; }
/* a state's word with its dot: answered · no answer · waiting · judged */
.cd-state { display: inline-flex; align-items: center; gap: .4rem; font-size: .8125rem; color: var(--ow-text-2); }
.cd-state a { color: var(--cd-link); font-weight: 500; }
.cd-dot { display: inline-block; flex: none; width: .5rem; height: .5rem; border-radius: 999px; background: var(--ow-settled-line); }
.cd-dot.is-ok { background: var(--ow-dot-ok); }
.cd-dot.is-attn { background: var(--ow-warn-strong); }
.cd-dot.is-off { background: var(--ow-settled-line); }
/* an order named as the order screen names it: #N with its state's dot, the customer · ВИП beside it */
.cd-order { display: inline-flex; align-items: center; gap: .4rem; color: var(--ow-ink); font-weight: 600;
    font-variant-numeric: tabular-nums; text-decoration: none; white-space: nowrap; }
.cd-order:hover { color: var(--ow-green); text-decoration: underline; }
.cd-order .ow-dot { width: .5rem; height: .5rem; }
.cd-order-cell { white-space: nowrap; }
.cd-order-who { display: block; margin-top: .15rem; font-size: .8125rem; color: var(--ow-text-2); white-space: normal; }
/* PU-179: the order a card is about — number and state, customer · ВИП · date · total, its offers — and its opener */
.dg-order { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem;
    padding: .75rem 1rem; border: 1px solid var(--ow-row-rule); border-radius: .75rem; background: var(--ow-muted-row); }
.dg-order-main { display: grid; gap: .3rem; min-width: 0; }
.dg-order-line, .dg-order-facts, .dg-order-offers { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; }
.dg-order-num { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; color: var(--ow-ink);
    font-variant-numeric: tabular-nums; }
.dg-order-num .ow-dot { width: .5rem; height: .5rem; }
.dg-order-state { font-size: .8125rem; color: var(--ow-text-2); }
.dg-order-facts { font-size: .875rem; color: var(--ow-ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dg-order-facts > span:not(:last-child)::after { content: "·"; margin-left: .75rem; color: var(--ow-text-2); } /* a wrapped line never starts with a dot */
.dg-order-sum { font-weight: 600; white-space: nowrap; }
.dg-order-offers { font-size: .8125rem; }
.dg-order-offers-k { color: var(--ow-text-2); }
.dg-offer { display: inline-flex; align-items: center; gap: .3rem; max-width: 100%; color: var(--cd-link); font-weight: 500;
    overflow-wrap: anywhere; text-underline-offset: .2em; }
.dg-offer:hover { text-decoration: underline; }
.dg-offer.is-veiled { color: var(--ow-text-2); font-weight: 400; }
.dg-offer svg { flex: none; }
.dg-order-go { margin: 0; }
.dg-order-open { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
@media (max-width: 600px) { .dg-order-go, .dg-order > .dg-order-open { width: 100%; } .dg-order-open { width: 100%; justify-content: center; } }
/* the record: the order's card */
.cd-recs { gap: var(--s4); }
.dg-card.cd-rec { gap: var(--s4); padding: 1.25rem 1.5rem; border-radius: .875rem; border-color: var(--ow-card-bd);
    box-shadow: var(--ow-card-shadow); }
.cd-rec .dg-what { font-size: 1.0625rem; font-weight: 600; color: var(--ow-ink); }
.cd-rec .dg-meta { margin-top: .35rem; font-size: .875rem; line-height: 1.6; color: var(--ow-text-2); }
.cd-rec .dg-meta a:not(.cd-order) { color: var(--cd-link); text-decoration: underline;
    text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: .2em; }
.cd-rec .dg-meta a:not(.cd-order):hover { text-decoration-color: currentColor; }
.cd-rec .dg-meta .cd-order { text-decoration: none; }
.cd-rec .dg-meta .cd-order:hover { text-decoration: underline; }
.cd-sep { margin: 0 .4rem; color: var(--ow-text-2); }
.cd-rec .dg-age { display: inline-flex; align-items: center; gap: .4rem; padding: .2rem .65rem; border: 1px solid var(--ow-row-rule);
    border-radius: 999px; background: var(--ow-busy-bg); color: var(--ow-text-2); font-size: .8125rem; font-weight: 500;
    line-height: 1.4; white-space: nowrap; }
.cd-rec .dg-age.is-late { border-color: var(--ow-warn-bd); background: var(--ow-warn-bg); color: var(--ow-warn-ink); }
.cd-label { display: block; margin: 0 0 .2rem; font-size: .75rem; font-weight: 600; letter-spacing: .02em;
    text-transform: uppercase; color: var(--ow-text-2); }
.cd-rec .dg-reason { font-size: .9375rem; color: var(--ow-ink); }
/* the two sides: two panels with the table's header band; the person's in the changed-cell tone */
.cd-rec .dg-sides { gap: var(--s4); }
.cd-rec .dg-side { padding: 0; overflow: hidden; border: 1px solid var(--ow-table-bd); border-radius: .75rem; background: var(--surface); }
.cd-rec .dg-side-title { margin: 0; padding: .7rem 1rem; background: var(--ow-head-bg); border-bottom: 1px solid var(--ow-row-rule);
    font-size: .75rem; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--ow-text-2); }
.cd-rec .dg-side > :not(.dg-side-title) { margin-left: 1rem; margin-right: 1rem; }
.cd-rec .dg-side > .dg-side-title + * { margin-top: .85rem; }
.cd-rec .dg-side > :last-child { margin-bottom: .9rem; }
.cd-rec .dg-side-person { border-color: var(--ow-changed-bd); }
.cd-rec .dg-side-person .dg-side-title { background: var(--ow-changed-bg); color: var(--ow-info-ink); border-bottom-color: var(--ow-changed-bd); }
.cd-rec .dg-state { font-size: .875rem; color: var(--ow-ink); line-height: 1.5; }
.cd-rec .dg-lines { margin-top: .6rem; margin-bottom: .6rem; padding: 0; list-style: none; display: grid; gap: .25rem;
    font-size: .875rem; color: var(--ow-ink); }
.cd-rec .dg-lines li { padding: .35rem .6rem; border-radius: .5rem; background: var(--ow-muted-row); }
.cd-rec .dg-total { font-size: .875rem; font-weight: 600; color: var(--ow-ink); text-align: right; font-variant-numeric: tabular-nums; }
.cd-rec .dg-verdicts { padding: 0; list-style: none; gap: .4rem; }
.cd-rec .dg-verdict { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .4rem; padding: .5rem .75rem;
    border: 1px solid var(--ow-ok-bd); border-radius: .625rem; background: var(--ow-ok-bg); color: var(--ow-ink); font-size: .875rem; }
.cd-rec .dg-verdict::before { content: ""; flex: none; width: .5rem; height: .5rem; border-radius: 999px; background: var(--ow-dot-ok); }
.cd-rec .dg-verdict b { color: var(--ow-ok-ink); }
/* the verdict form: the order dialogs' fields, the mockup's primary */
.cd-rec .dg-verdict-form { padding-top: var(--s4); border-top: 1px solid var(--ow-row-rule); }
.cd-rec .dg-verdict-form .orgnew-field { font-size: .8125rem; font-weight: 600; color: var(--cd-label-ink); }
.cd-rec .dg-verdict-form select, .cd-rec .dg-verdict-form input { height: 44px; padding: 0 .85rem; border: 1px solid var(--ow-search-bd);
    border-radius: .625rem; background: var(--surface); color: var(--text); font-size: .9375rem; font-weight: 400; }
.cd-rec .dg-verdict-form select:focus, .cd-rec .dg-verdict-form input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); outline: none; }
/* PU-187: the card says once what changed, folds both versions and takes a verdict in one press */
.cd-rec .dg-reason .cd-label { display: inline; margin: 0 .4rem 0 0; }
.dg-change { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; }
.dg-change li { padding: .25rem .7rem; border: 1px solid var(--ow-changed-bd); border-radius: 999px; background: var(--ow-changed-bg);
    color: var(--ow-ink); font-size: .875rem; font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dg-more > summary { width: max-content; max-width: 100%; color: var(--cd-link); font-size: .875rem; font-weight: 500; cursor: pointer; }
.dg-more > summary:hover { text-decoration: underline; }
.dg-more[open] > summary { margin-bottom: var(--s3); }
.dg-more > .dg-config { margin-top: var(--s3); }
.cd-rec .dg-verdict-form { display: grid; gap: .75rem; align-items: start; }
.dg-note { display: flex; align-items: center; gap: .6rem; max-width: 32rem; font-size: .8125rem; font-weight: 600; color: var(--cd-label-ink); }
.dg-note input { flex: 1 1 auto; min-width: 0; }
.cd-rec .dg-note input { height: 2.5rem; }
.dg-picks { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.dg-ask { margin-right: .25rem; font-size: .8125rem; font-weight: 600; color: var(--cd-label-ink); }
/* PU-74: a record has no page of its own — its address lands on its card, outlined, clear of the top */
.dg-card.cd-rec { scroll-margin-top: var(--s5); }
.dg-card.cd-rec:target { outline: .125rem solid var(--ow-green); outline-offset: .125rem; }
@media (max-width: 600px) {

    .table-card.cd-card { padding: 0; }
    .cd-card .cv-table tr { padding: .875rem 1rem; }
    .cd-card .cv-table td { align-items: center; }
    .cd-card .cv-table td.cd-who { max-width: none; }
    .cd-order-g, .cd-when-g { text-align: right; }
    .dg-card.cd-rec { padding: var(--s4); }
    .dg-note { flex-wrap: wrap; }
    .dg-ask { flex: 1 1 100%; }
}

/* =========================================================   PU-68: the home board in the order screen's design
   (the owner, 2026-10-03: „Следвай този дизайн"). Tokens only, both themes; every rule scoped to the board.
   ================================================================ */
/* the head: the order screen's bare title on the ground, the period on its right — no PU-40 glow card */

/* the counters: the order screen's card; the orders' state as its 8 px dot before the words */
#home-counters { gap: var(--s4); margin-bottom: var(--s5); }
#home-counters .kpi { gap: 1rem; padding: 1.125rem 1.25rem; border: 1px solid var(--ow-card-bd); border-radius: .875rem;
    box-shadow: var(--ow-card-shadow); }
#home-counters a.kpi:hover { border-color: var(--ow-green); box-shadow: var(--ow-card-shadow); transform: none; }

#home-counters .kpi-note { font-size: .8125rem; color: var(--ow-text-2); }

#home-counters .ow-dot { width: .5rem; height: .5rem; }
#home-counters .ow-dot.ow-tone-attn { background: var(--ow-warn-strong); }
#home-counters .ow-dot.ow-tone-err { background: var(--ow-err-ink); }
#home-counters .ow-dot.ow-tone-ok { background: var(--ow-dot-ok); }
#home-counters .ow-dot.ow-tone-info { background: var(--ow-info-ink); }
/* the cards: the order screen's — a 14 px corner, a 1 px edge, an almost unseen shadow */
#board-region .board { gap: var(--s4); }
#board-region .board-item > .card { padding: 1.25rem 1.5rem; border: 1px solid var(--ow-card-bd);
    border-radius: .875rem; box-shadow: var(--ow-card-shadow); background: var(--surface); }

.bd-title { margin: 0; font-size: 1.0625rem; font-weight: 600; line-height: 1.35; letter-spacing: 0; text-transform: none;
    color: var(--ow-ink); }
#board-region .card-note { margin: .25rem 0 0; font-size: .8125rem; color: var(--ow-text-2); }

/* the numbers: the order screen's weights */
#board-region .stat { font-size: 2.125rem; font-weight: 650; letter-spacing: -.02em; color: var(--ow-ink); }

#board-region .delta { padding: .125rem .5rem; font-size: .8125rem; font-weight: 600; border: 1px solid transparent; }
#board-region .delta-up { background: var(--ow-ok-bg); border-color: var(--ow-ok-bd); color: var(--ow-ok-ink); }

#board-region .figure dt { font-size: .8125rem; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ow-text-2); }
#board-region .figure dd { font-size: 1.5rem; font-weight: 650; color: var(--ow-ink); }

/* the lists: rows ruled like the order's table, the figures right in tabular numbers */
#board-region .ranked, #board-region .people { gap: 0; }
#board-region .person { padding: .625rem 0; border-bottom: 1px solid var(--ow-row-rule); font-size: .875rem; }
#board-region .person:last-child { border-bottom: 0; }
#board-region .person-name { color: var(--ow-ink); }
#board-region .person-name:hover { color: var(--ow-green); }

#board-region .person-total { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; color: var(--ow-ink); }

#board-region .person-orders { color: var(--ow-text-2); }
#board-region .people-more { color: var(--ow-link); font-size: .875rem; font-weight: 500; }
#board-region .people-more:hover { text-decoration: underline; }

/* one empty state: a quiet well under the heading */
.bd-empty { display: flex; align-items: center; justify-content: center; min-height: 5.5rem; margin: var(--s3) 0 0;
    padding: 1rem 1.25rem; border: 1px dashed var(--ow-card-bd); border-radius: .625rem; background: var(--ow-page-bg);
    color: var(--ow-text-2); font-size: .875rem; text-align: center; }

/* the warning: the order screen's band (PU-63), at the board's size */
.offer-coverage.bd-warn { display: flex; align-items: center; gap: 1rem; margin: 0 0 var(--s5); padding: 1rem 1.25rem;
    border: 1.5px solid var(--mk-warn-bd); border-radius: .875rem; background: var(--mk-warn-bg); color: var(--mk-warn-ink); }
.offer-coverage.bd-warn::before { display: none; }
.bd-warn-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem;
    border-radius: 999px; background: var(--mk-warn-ico); color: var(--mk-on-btn); font-size: 1.375rem; font-weight: 800; line-height: 1; }
.offer-coverage.bd-warn .offer-coverage-t { flex: 1 1 auto; min-width: 0; display: grid; gap: .25rem; }
.offer-coverage.bd-warn .offer-coverage-line { margin: 0; }
.offer-coverage.bd-warn a { color: var(--mk-warn-chev); font-weight: 600; text-decoration: underline; }
@media (max-width: 640px) {

    #board-region .board-item > .card { padding: 1rem 1.125rem; }
    #home-counters .kpi { flex-direction: column; align-items: flex-start; padding: .875rem 1rem; gap: .375rem; }

}

/* =========================================================   PU-73: the administrator's board opens on five KPIs
   (the owner, 2026-10-04: „повече kpi а не толкова оперативни"). The order screen's card, tokens only, both themes.
   ================================================================ */
.bd-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s4); margin: 0 0 var(--s5); }
.bd-kpi { display: flex; flex-direction: column; gap: .375rem; min-width: 0; padding: 1.125rem 1.25rem; background: var(--surface);
    border: 1px solid var(--ow-card-bd); border-radius: .875rem; box-shadow: var(--ow-card-shadow); }
.bd-kpi p { margin: 0; }
.bd-kpi-label { font-size: .875rem; font-weight: 500; color: var(--ow-text-2); }
.bd-kpi-value { font-size: 2rem; font-weight: 650; line-height: 1.1; letter-spacing: -.02em; color: var(--ow-ink);
    font-variant-numeric: tabular-nums; white-space: nowrap; }
.bd-kpi-unit { font-size: 1rem; font-weight: 600; color: var(--ow-text-2); }
.bd-kpi-move { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; }
.bd-kpi-before { font-size: .8125rem; color: var(--ow-text-2); }
.bd-kpis .delta { padding: .125rem .5rem; font-size: .8125rem; font-weight: 600; border: 1px solid transparent; }
.bd-kpis .delta-up { background: var(--ow-ok-bg); border-color: var(--ow-ok-bd); color: var(--ow-ok-ink); }

#board-region .board-card .people-more { margin-top: auto; padding-top: var(--s3); }
@media (max-width: 1240px) { .bd-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) {
    .bd-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
    .bd-kpi { padding: .875rem 1rem; }
    .bd-kpi-value { font-size: 1.625rem; }
    .bd-kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
.bd-kpi-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }

/* the administrator's rows fill: 4+2 | 3+3 | 2+2+2 | 6 */
#board-region .board-item.span-3 { grid-column: span 3; }
#board-region .board-item.span-6 { grid-column: span 6; }
#board-region .board-item.span-3 .figures { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) {
    #board-region .board-item.span-3 { grid-column: span 2; }
    #board-region .board-item.span-6 { grid-column: span 4; }
}
@media (max-width: 760px) {
    /* one column: every card the whole row — a `span 2` left over from the base rules makes an implicit column */
    #board-region .board .board-item { grid-column: 1 / -1; }
    #board-region .board-item.span-3 .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* the way to Несъгласия, quiet at the foot of „Работата на Ordio" */
#board-region .bd-disagree { align-self: flex-start; margin-top: auto; padding-top: var(--s3); color: var(--ow-link); font-size: .875rem; font-weight: 500; }
#board-region .bd-disagree:hover { text-decoration: underline; }
#board-region .bd-disagree b { color: var(--ow-warn-ink); font-weight: 650; }

/* =========================================================   PU-69: „Как работи" in the order screen's language.
   The path one card, each state a band of its own tone, the buttons drawn as the order screen draws them, the keys
   in the table's cards (on the page only — the dialog keeps its look). Tokens only, both themes.
   ================================================================ */
.how-section .section-h { font-size: 1.25rem; font-weight: 650; letter-spacing: -.01em; color: var(--text); }
/* the path: one card, four steps, a fine line from one number to the next */
.how-path { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; padding: 0; overflow: hidden;
    background: var(--surface); border: 1px solid var(--ow-card-bd); border-radius: .875rem; box-shadow: var(--ow-card-shadow); }
.how-path li { padding: 1.25rem 1.5rem 1.5rem; background: none; border: 0; border-radius: 0; box-shadow: none; }
.how-path .how-step-top { justify-content: flex-start; gap: .75rem; margin-bottom: var(--s4); }
.how-path li:not(:last-child) .how-step-top::after { content: ""; flex: 1 1 auto; height: 1px; margin-right: -3rem;
    background: var(--ow-row-rule); }
.how-num { width: 2rem; height: 2rem; background: var(--ow-green); color: var(--ow-on-fill); font-size: .875rem; }
.how-step-icon { color: var(--ow-text-2); }
.how-path h3 { font-size: 1.0625rem; font-weight: 600; color: var(--text); }
.how-path p { color: var(--ow-text-2); font-size: .875rem; }
/* the states: each one the band of its tone, small */
.how-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }  /* four states, two by two */
.how-tile { display: flex; gap: 1rem; align-items: flex-start; padding: 1.125rem 1.25rem; border-radius: .875rem;
    border: 1px solid var(--ow-tone-bd); background: var(--ow-tone-bg); box-shadow: none; }
.how-tile.how-tone-ok { --ow-tone: var(--ow-ok-ink); --ow-tone-bd: var(--ow-ok-bd); --ow-tone-bg: var(--ow-ok-bg); }
.how-tile.how-tone-err { --ow-tone: var(--ow-err-ink); --ow-tone-bd: var(--ow-err-bd); --ow-tone-bg: var(--ow-err-bg); }
.how-tile.how-tone-attn { --ow-tone: var(--mk-warn-ink); --ow-tone-bd: var(--mk-warn-bd); --ow-tone-bg: var(--mk-warn-bg); }
.how-tile.how-tone-busy { --ow-tone: var(--ow-text-2); --ow-tone-bd: var(--ow-row-rule); --ow-tone-bg: var(--ow-busy-bg); }
.how-tile-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem;
    border-radius: 999px; background: color-mix(in srgb, var(--ow-tone) 14%, transparent); color: var(--ow-tone); }
.how-tile.how-tone-attn .how-tile-ico { background: var(--mk-warn-ico); color: var(--mk-on-btn); font-size: 1.35rem; font-weight: 800; }
.how-tile-ico .st-spin { width: 1.1rem; height: 1.1rem; }
/* PU-192: a legend, not a page loading — its spinner stands still */
.how-tile-ico .st-spin { animation: none; }
.how-tile-t { min-width: 0; }
.how-tile .how-tile-title { margin: .45rem 0 0; font-size: 1.125rem; font-weight: 650; line-height: 1.25; color: var(--ow-tone); }
.how-tile p { margin: .375rem 0 0; color: var(--ow-ink); font-size: .875rem; line-height: 1.5; }
.how-tile.how-tone-attn p { color: var(--mk-warn-ink); }
/* the buttons: rows in one card, the samples as the order screen draws them */
.how-buttons.ow-card { margin: 0; padding: 0; }
.how-buttons > div { grid-template-columns: 15rem minmax(0, 1fr); align-items: center; padding: 1rem 1.5rem;
    border-top-color: var(--ow-row-rule); }
.how-buttons dd { color: var(--ow-text-2); font-size: .875rem; }
.how-sample { display: inline-flex; align-items: center; gap: .5rem; min-height: var(--btn-h); padding: 0 var(--btn-px);
    border: 1px solid var(--btn-bd); border-radius: var(--btn-radius); color: var(--btn-fg);
    background: linear-gradient(180deg, var(--btn-top), var(--btn-bottom)); box-shadow: var(--btn-shadow);
    font-size: var(--btn-fs); font-weight: var(--btn-weight); white-space: nowrap; cursor: default; user-select: none; }
.how-sample.is-main, .how-sample.is-small { border-color: var(--btn-primary-bd); color: var(--btn-primary-fg);
    background: linear-gradient(180deg, var(--btn-primary-top), var(--btn-primary-bottom)); box-shadow: var(--btn-primary-shadow);
    font-weight: var(--btn-primary-weight); }
.how-sample.is-main { min-height: var(--btn-h-lg); font-size: var(--btn-fs-lg); }
.how-sample.is-small { min-height: var(--btn-h-sm); padding: 0 var(--btn-px-sm); font-size: var(--btn-fs-sm); }
.how-sample.is-alt .ico { color: var(--ow-err-ink); }
/* PU-192: one sample size, so the descriptions start on one line */
.how-buttons .how-sample, .how-buttons .how-sample.is-main, .how-buttons .how-sample.is-small { min-height: var(--btn-h);
    padding: 0 var(--btn-px); font-size: var(--btn-fs); }
/* PU-192: the keys section is for a keyboard — not on a phone or a touch screen */
@media (hover: none), (max-width: 767px) { .how-section#klavishi { display: none; } }
/* if something looks wrong: a card with the info tone's mark, the table's two row marks named in its words */
.how-callout.ow-card { align-items: flex-start; padding: 1.25rem 1.5rem; background: var(--surface); }
.how-callout-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem;
    border-radius: 999px; background: var(--ow-info-bg); color: var(--ow-info-ink); }
.how-callout .how-callout-ico .ico { color: inherit; margin: 0; }
.how-callout h2 { margin-top: .5rem; font-size: 1.0625rem; font-weight: 600; }
.how-callout p { color: var(--ow-ink); font-size: .9rem; }
.how-swatch { display: inline-block; width: 1.1rem; height: .85rem; margin: 0 .3rem 0 .15rem; vertical-align: -.1em;
    border-radius: .2rem; background: var(--ow-warn-bg); box-shadow: inset var(--rail) 0 0 var(--ow-warn-strong); }
.how-dot.ow-dot { margin: 0 .3rem 0 .15rem; vertical-align: .05em; }
.how-nowrap { white-space: nowrap; }
.how-callout + .how-section { margin-top: var(--s6); }
/* the keys on the page: each group the table's card — a header band, rules only between rows, the search bar's chip */
#klavishi .keys-groups.is-cards { gap: var(--s4); margin-top: var(--s4); grid-template-columns: repeat(auto-fit, minmax(24rem, 1fr)); }
#klavishi .is-cards .keys-group { margin: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--ow-table-bd);
    border-radius: .875rem; box-shadow: var(--ow-card-shadow); }
#klavishi .is-cards .keys-group-title { display: flex; align-items: center; height: 3rem; margin: 0; padding: 0 1.25rem;
    background: var(--ow-head-bg); color: var(--ow-text-2); font-size: .8125rem; font-weight: 600; letter-spacing: 0;
    text-transform: none; }
#klavishi .is-cards .keys-note { margin: 0; padding: .75rem 1.25rem 0; color: var(--ow-text-2); }
#klavishi .is-cards .keys-row { padding: .75rem 1.25rem; border-bottom-color: var(--ow-row-rule); }
#klavishi .is-cards .keys-what { font-size: .875rem; font-weight: 500; }
#klavishi .is-cards .keys-what span { color: var(--ow-text-2); font-size: .8125rem; }
#klavishi .is-cards kbd, #klavishi kbd.keys-inline { min-width: 1.75rem; height: 1.75rem; padding: 0 .45rem; border: 1px solid var(--ow-search-bd);
    border-radius: .4rem; background: var(--app-search-kbd-bg); color: var(--ow-text-2); font-size: .8rem; font-weight: 600; }
#klavishi kbd.keys-inline { min-width: 1.5rem; height: 1.5rem; }
@media (max-width: 1100px) {
    .how-path { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .how-path li:nth-child(n + 3) { border-top: 1px solid var(--ow-row-rule); }
    .how-path li .how-step-top::after { content: none; }
}
@media (max-width: 640px) {
    .how-path { grid-template-columns: minmax(0, 1fr); }
    .how-path li + li { border-top: 1px solid var(--ow-row-rule); }
    .how-path li { padding: 1rem 1.25rem 1.25rem; }
    .how-buttons > div { grid-template-columns: minmax(0, 1fr); gap: var(--s2); padding: 1rem 1.25rem; }
    #klavishi .keys-groups.is-cards { grid-template-columns: minmax(0, 1fr); }
    .how-grid { grid-template-columns: minmax(0, 1fr); }
    .how-tile { padding: 1rem; }
}

/* =========================================================   PU-76: the help panel from „?" (the plan help-in-context).
   The keys dialog (#keys-dialog) docked to the right, full height: two jump links, the tour, „Как работи" (the page's
   own partial, one column here), then the keys. Tokens only, both themes; full width on a phone.
   ================================================================ */
#keys-dialog.help-panel { inset: 0 0 0 auto; margin: 0; width: min(34rem, 100vw); height: 100vh; height: 100dvh;
    max-width: 100vw; max-height: none; border: 0; border-left: 1px solid var(--border); border-radius: 0;
    box-shadow: var(--shadow-lift); }
#keys-dialog.help-panel[open] { animation: help-in .24s var(--ease-out); }
@keyframes help-in { from { transform: translateX(2rem); } }
.help-panel .keys-head { flex: none; padding: 1.25rem 1.5rem 1rem; }
.help-panel .keys-title { font-size: 1.375rem; font-weight: 650; letter-spacing: -.01em; }
.help-jump { flex: none; display: flex; gap: .5rem; padding: .75rem 1.5rem; border-bottom: 1px solid var(--ow-row-rule); }
.help-jump a { display: inline-flex; align-items: center; gap: .4rem; min-height: 2.25rem; padding: 0 .875rem;
    border: 1px solid var(--ow-search-bd); border-radius: 999px; background: var(--ow-search-bg); color: var(--text);
    font-size: .875rem; font-weight: 500; text-decoration: none; }
.help-jump a:hover { border-color: var(--ow-green); color: var(--ow-green); }
.help-jump a .ico { color: var(--ow-text-2); }
.help-panel .keys-body { flex: 1 1 auto; min-height: 0; padding: 1rem 1.5rem 2rem; scroll-padding-top: 1rem; }
.help-panel .keys-tour { margin: 0 0 var(--s4); }
.help-part + .help-part { margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid var(--ow-row-rule); }
.help-part-h { margin: 0 0 var(--s4); font-size: 1.125rem; font-weight: 650; color: var(--text); scroll-margin-top: 1rem; }
/* „Как работи" in one column */
.help-panel .how-section + .how-section { margin-top: var(--s5); }
.help-panel .how-section .section-h { margin-bottom: .625rem; font-size: 1rem; font-weight: 600; }
.help-panel .how-path { grid-template-columns: minmax(0, 1fr); }
.help-panel .how-path li { padding: .875rem 1rem; }
.help-panel .how-path li + li { border-top: 1px solid var(--ow-row-rule); }
.help-panel .how-path li .how-step-top::after { content: none; }
.help-panel .how-path .how-step-top { margin-bottom: .5rem; }
.help-panel .how-path h5 { margin: 0 0 .25rem; font-size: .9375rem; font-weight: 600; color: var(--text); }
.help-panel .how-path p { font-size: .8125rem; }
.help-panel .how-grid { grid-template-columns: minmax(0, 1fr); gap: .625rem; }
.help-panel .how-tile { gap: .75rem; padding: .875rem 1rem; }
.help-panel .how-tile-ico { width: 2rem; height: 2rem; }
.help-panel .how-tile .how-tile-title { margin-top: .25rem; font-size: 1rem; }
.help-panel .how-tile p { font-size: .8125rem; }
.help-panel .how-buttons > div { grid-template-columns: minmax(0, 1fr); gap: .5rem; padding: .875rem 1rem; }
.help-panel .how-buttons dd { font-size: .8125rem; }
.help-panel .how-callout { margin-top: var(--s5); padding: 1rem; gap: .75rem; }
.help-panel .how-callout h4 { margin: .375rem 0 .375rem; font-size: 1rem; font-weight: 600; }
.help-panel .how-callout p { font-size: .8125rem; }
.help-panel .how-callout-ico { width: 2rem; height: 2rem; }
/* the keys: one column in the panel's width */
.help-panel .keys-groups { grid-template-columns: minmax(0, 1fr); gap: 0; }
.help-panel .keys-group:first-child { margin-top: 0; }
/* reduced motion: the app-wide rule above stops the slide-in (it stays the last word on motion) */
@media (max-width: 600px) {
    #keys-dialog.help-panel { width: 100vw; border-left: 0; }
    .help-panel .keys-head, .help-jump, .help-panel .keys-body { padding-left: 1rem; padding-right: 1rem; }
}
/* PU-77: the panel's „Как работи" carries the way to its page — the menu no longer does */
.help-part-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); flex-wrap: wrap;
    margin: 0 0 var(--s4); }
.help-part-head .help-part-h { margin: 0; }
.help-page-link { display: inline-flex; align-items: center; gap: .25rem; color: var(--ow-link); font-size: .875rem;
    font-weight: 500; text-decoration: none; }
.help-page-link:hover { text-decoration: underline; }

/* =========================================================   PU-67: the orders list in the order screen's design
   (the owner, 2026-10-03: „Следвай този дизайн"). The head, the tabs, the table, the state and the empty states take
   the order screen's tokens (`--ow-*`), both themes; the rules after the PU-10/PU-16 block win by order.
   ================================================================ */

/* P4-05: the held orders' „Провери отново · без AI" beside the title */

.oq-recheck { margin: 0; }
.oq-recheck .btn { gap: .4rem; }

/* the table: one card, a 48 px header band, rules between rows only */

.oq-row:hover { background: var(--ow-muted-row); }
.oq-row:focus-within { background: color-mix(in srgb, var(--ow-green) 6%, var(--surface)); }
.oq-open { color: var(--ow-ink); font-size: .9375rem; }
.oq-row:hover .oq-open, .oq-open:focus-visible { color: var(--ow-green); }
.oq-row:has(.oq-open:focus-visible) { outline-color: var(--ow-green); }
.oq-finding { color: var(--ow-text-2); }

.oq-came.is-thread { color: var(--ow-green); }
.oq-money { color: var(--ow-ink); }
/* the state: an 8 px dot and its word, in the order screen's tones */

.oq-verdict { gap: .5rem; font-weight: 500; }
.oq-verdict::before { content: none; }
.oq-verdict .ow-dot { width: .5333rem; height: .5333rem; background: var(--oq-dot); }
/* the shared state dot (`ow-dot ow-tone-*`) in the spec's tones, for every screen that names an order's state */
.ow-dot.ow-tone-ok { background: var(--ow-dot-ok); }
.ow-dot.ow-tone-attn { background: var(--ow-warn-strong); }
.ow-dot.ow-tone-err { background: var(--ow-err-ink); }
.ow-dot.ow-tone-info { background: var(--ow-info-ink); }
.oq-more { color: var(--ow-ink); }
.oq-relation { color: var(--ow-text-2); }
/* the empty states: inside the card, the icon in a green-tinted round tile */
.oq-blank { padding: var(--s7) var(--s5); background: var(--surface); }
.oq-blank .ow-blank-ico { background: color-mix(in srgb, var(--ow-green) 10%, var(--surface)); color: var(--ow-green); }
.oq-blank .ow-blank-t { font-size: 1.0625rem; color: var(--ow-ink); }
.oq-blank .ow-blank-s { color: var(--ow-text-2); }
.oq-blank .ow-blank-s a { color: var(--ow-green); text-decoration: underline; text-underline-offset: .2em; }
/* the page foot */
.oq-foot { border-top-color: var(--ow-row-rule); background: var(--surface); font-size: .875rem; }
.oq-range { color: var(--ow-text-2); }
.oq-page { color: var(--ow-ink); }
a.oq-page:hover { background: var(--ow-muted-row); }
.oq-page.is-on { background: color-mix(in srgb, var(--ow-green) 12%, transparent); color: var(--ow-green); }

/* PU-67 round 2 — the owner's mockup (2026-10-04): the tabs and two filters on one row, compact rows, the state a pill,
   the reason its own column, a green line on the hovered row, a row ⋯, a bordered pager. Tokens only; no theme selector. */

.oq-filters { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0 0 .5rem; margin: 0; background: none; border: 0; }
.oq-filters .filter-dd > summary { align-items: center; min-height: 2.6rem; padding: .45rem .8rem; gap: .45rem;
    background: var(--surface); border-color: var(--ow-card-bd); border-radius: .625rem; color: var(--ow-ink); }
.oq-filters .filter-dd > summary:hover, .oq-filters .filter-dd[open] > summary { border-color: var(--ow-green); }
.oq-filters .fb-ico { display: inline-flex; color: var(--ow-text-2); }
.oq-filters .fb-value { font-weight: 500; color: var(--ow-ink); }
.oq-filters .fb-value.fb-any { font-weight: 500; color: var(--ow-ink); }
.oq-filters .filter-dd:last-child .filter-menu { right: 0; }
/* the card lets a row's ⋯ menu out; the header band and the foot keep its corners */

.oq-foot { border-radius: 0 0 .875rem .875rem; }

/* compact rows: the name over „ВИП · #N · ✉ N писма" */

.oq-open { line-height: 1.3; }
.oq-open:hover, .oq-open:focus-visible { text-decoration: none; }

.oq-row:hover, .oq-row:focus-within { background: none; }
.oq-row:hover td, .oq-row:focus-within td { background: color-mix(in srgb, var(--ow-green) 6%, var(--surface)); }
.oq-row:hover td:first-child, .oq-row:focus-within td:first-child { box-shadow: inset var(--rail) 0 0 var(--ow-green); }

/* the pager: bordered square buttons */
.oq-pages { gap: .4rem; }
.oq-page { min-width: 2.25rem; height: 2.25rem; border: 1px solid var(--ow-card-bd); border-radius: .5rem; background: var(--surface); }
a.oq-page:hover { border-color: var(--ow-green); background: var(--surface); }
.oq-page.is-on { border-color: color-mix(in srgb, var(--ow-green) 35%, transparent);
    background: color-mix(in srgb, var(--ow-green) 9%, var(--surface)); }
.oq-gap { min-width: 1rem; }
@container (max-width: 52rem) {

    .oq-row:hover, .oq-row:focus-within { box-shadow: inset var(--rail) 0 0 var(--ow-green); }
}

/* =========================================================   PU-82: the menu's count beside „Поръчки" (the owner,
   2026-10-04: only what waits for a person). The spec's 24 px green circle; tokens only; the folded menu hides it with
   every other word of an item (`.nav-folded .navitem > span`).
   ================================================================ */
.navitem .nav-count { display: inline-flex; align-items: center; justify-content: center; flex: none; margin-left: auto;
    min-width: 1.6rem; height: 1.6rem; padding: 0 .4rem; border-radius: 999px; background: var(--sidebar-count);
    color: var(--sidebar-fg); font-size: .8rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }

/* =========================================================   PU-78: a state explains itself where a person meets it
   (the plan help-in-context): the orders list's pill, the board's state tiles, the order band's title. The words are
   help_text's. Shown on hover only where a pointer can hover, and on keyboard focus — never on a tap, so on a phone it
   covers nothing; Escape hides it (shortcuts.js, `.tip-off`). Hidden with display: none, so it never lengthens the
   page (a last row's tip once gave the orders list a scrollbar). WCAG 1.4.13: dismissable (Escape), hoverable (a child
   of its trigger, taking the pointer, with a bridge over the gap so the pointer can cross onto it) and persistent (it
   stays while hovered or focused). `aria-hidden` in the markup keeps it out of its trigger's name; aria-describedby
   still reads it, once. Tokens only.
   ================================================================ */
/* PX-230: the pill's and the band title's tip is their next sibling in a `.tip-anchor`, so their own text holds
   only their words; the board's tile keeps its tip inside. */
.has-tip, .tip-anchor { position: relative; }
span.tip-anchor { display: inline-block; }
.state-tip { position: absolute; left: 0; top: calc(100% + .375rem); z-index: 40; width: max-content;
    max-width: min(22rem, 80vw); padding: .375rem .625rem; border-radius: var(--radius-sm);
    background: var(--surface-3); color: var(--text); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lift);
    font-size: .8rem; font-weight: 500; line-height: 1.45; text-align: left; white-space: normal; text-transform: none;
    letter-spacing: normal; display: none; cursor: default; }
.state-tip::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: .5rem; }
.has-tip:focus-visible > .state-tip, .has-tip:focus-visible + .state-tip { display: block; }
@media (hover: hover) {
    .has-tip:hover > .state-tip, .tip-anchor:hover > .state-tip { display: block; }
}
.has-tip.tip-off > .state-tip, .has-tip.tip-off + .state-tip, .tip-anchor.tip-off > .state-tip { display: none; }

/* =========================================================   PU-79: the help's demos (the plan help-in-context) —
   four short silent clips under „Как работи", two to a row, one row each at 640 px and below (the panel is 34rem, so
   there they stack). The clip keeps its 16:10 frame before it loads (`preload="none"`); the caption is its text
   alternative. Tokens and rem only — the breakpoint in px, a device width (PX-243).
   ================================================================ */
.how-demos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.how-demo { margin: 0; padding: var(--s3); display: flex; flex-direction: column; gap: var(--s2); }
.how-demo video { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--surface-2); }
.how-demo figcaption { color: var(--muted); font-size: .875rem; line-height: 1.5; }
.how-demo figcaption strong { color: var(--text); font-weight: 600; }
#keys-dialog .how-demos { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 640px) {
    .how-demos { grid-template-columns: minmax(0, 1fr); }
}

/* =========================================================   PU-70: the settings area in the order screen's design
   (the owner, 2026-10-03: „Следвай този дизайн"). Моят профил, Работни настройки / Система, Хора и права / Всички
   акаунти, Пощенски кутии, Офертен имейл — every rule under `.set-area`; the left menu, the search bar and the
   profile's banner stay as built. Tokens only: the order screen's `--ow-*`, the mockup's `--mk-btn-*`, `--pop-shadow`.
   ================================================================ */
/* the cards: the order screen's card, the heads as the rail's */
.set-area .set-card, .set-area .set-group { border-radius: .875rem; border-color: var(--ow-card-bd);
    box-shadow: var(--ow-card-shadow); }
.set-area .set-group + .set-group,
.set-area .set-card + .set-card,
.set-area .set-group + .set-card,
.set-area .set-card + .set-group { gap: var(--s4); }
.set-area .set-group + .set-group, .set-area .set-card + .set-card, .set-area .set-group + .set-card,
.set-area .set-card + .set-group { margin-top: var(--s5); }
.set-area .set-group-head { align-items: center; padding: 1.125rem 1.5rem; border-bottom-color: var(--ow-row-rule); }
.set-area .set-group-title { font-size: 1.0625rem; font-weight: 600; color: var(--ow-ink); }
.set-area .set-group-desc { margin-top: .15rem; font-size: .875rem; color: var(--ow-text-2); }
/* a role chip that names no lead role (an operator): the order's quiet chip — --muted on --border read 3.87 in light */
.set-area .urole:not(.role-admin):not(.role-superadmin) { background: var(--ow-busy-bg); color: var(--ow-ink-2); }
.set-area .set-group-body { padding: 0 1.5rem; }
.set-area .set-card-body { padding: 1.25rem 1.5rem 1.5rem; }
.set-area .set-card-foot { padding: 1rem 1.5rem; border-top-color: var(--ow-row-rule); color: var(--ow-text-2); }
.set-area .profile-banner { border-radius: calc(.875rem - 1px) calc(.875rem - 1px) 0 0; }

/* the header card: the order's title, the count as the tab's */
.set-area .hero-text .page-title { font-size: 2.125rem; line-height: 1.15; font-weight: 650; letter-spacing: -.02em;
    color: var(--ow-ink); }
.set-area .hero-text .page-lead { margin-top: .5rem; font-size: .95rem; color: var(--hero-lead); }
.set-area .hero-count { border: 0; padding: .1rem .6rem; font-size: .9rem; font-weight: 600; letter-spacing: 0;
    background: color-mix(in srgb, var(--ow-green) 12%, transparent); color: var(--ow-green); }

/* the section tabs: the order's tabs — words, the open one green over a 3 px line, no ground */
.set-area .set-nav { gap: var(--s5); padding-bottom: 0; border-bottom-color: var(--ow-row-rule); }
.set-area .set-nav-item { padding: .6rem .125rem .8rem; border-radius: 0; color: var(--ow-ink-2); }
.set-area .set-nav-item:hover { background: none; color: var(--ow-green); }
.set-area .set-nav-label { font-size: 1rem; font-weight: 500; }
.set-area .set-nav-item[aria-current="page"] { color: var(--ow-green); }
.set-area .set-nav-item[aria-current="page"] .set-nav-label { -webkit-text-stroke: .025em currentColor; }
.set-area .set-nav-item[aria-current="page"]::before { left: 0; right: 0; bottom: 0; height: var(--rail);
    border-radius: var(--rail) var(--rail) 0 0; background: var(--ow-tab-line); }
.set-area .set-nav-item:focus-visible { outline: .125rem solid var(--brand); outline-offset: -.125rem; }

/* the tables: the order's — a light header band, rules only between rows, no hover ground on a row that opens nothing */
.set-area .people-table thead th { height: 3rem; padding-top: 0; padding-bottom: 0; background: var(--ow-head-bg);
    border-bottom: 0; font-size: .8125rem; font-weight: 500; color: var(--ow-text-2); text-transform: none;
    letter-spacing: 0; white-space: nowrap; }
.set-area .people-table tbody tr { border-bottom-color: var(--ow-row-rule); cursor: default; }
.set-area .people-table tbody tr:hover { background: none; }
.set-area .people-table td { padding-top: .9rem; padding-bottom: .9rem; }
.set-area .person-cell-name strong { font-weight: 600; color: var(--ow-ink); }
.set-area .activity .muted, .set-area .person-cell-text .muted { color: var(--ow-text-2); }
.set-area .page-hero > .list-table { border-top-color: var(--ow-row-rule); }
.set-area .people-table .avatar { width: 2.25rem; height: 2.25rem; border: 0; background: var(--ow-busy-bg);
    color: var(--ow-ink-2); font-size: .78rem; }
.set-area .people-table .avatar.is-me { background: var(--brand-soft); color: var(--brand-strong); }

/* the chips and badges: the order screen's state colours */
.set-area .status-badge, .set-area .chip { border-radius: 999px; font-size: .76rem; font-weight: 600; }
.set-area .chip { padding: .05rem .55rem; border-color: transparent; background: var(--ow-busy-bg); color: var(--ow-ink-2); }
.set-area .status-done, .set-area .chip-ok { background: var(--ow-ok-bg); color: var(--ow-ok-ink); }
.set-area .status-error, .set-area .chip-off { background: var(--ow-err-bg); color: var(--ow-err-ink); }
.set-area .status-review { background: var(--ow-warn-bg); color: var(--ow-warn-ink); }
.set-area .status-ignored { background: var(--ow-busy-bg); color: var(--ow-ink-2); }

/* the buttons: the shared style (PU-91); a destructive one says so with its icon too */
.set-area .btn:not(.btn-primary) .ico { color: var(--ow-text-2); }
.set-area .btn:not(.btn-primary):hover .ico { color: inherit; }
/* PX-284: a danger secondary keeps PU-70's colour — the words and the edge its neighbours' (neutral), the red only in
   its icon, and red on hover; the shape is PU-91's shared one */
.set-area .btn-danger:not(.btn-primary) { color: var(--ow-ink); border-color: var(--btn-bd); }
.set-area .btn-danger:not(.btn-primary):hover { color: var(--ow-err-ink); border-color: var(--ow-err-bd); }
.set-area .btn-danger:not(.btn-primary) .ico, .set-area .btn-danger:not(.btn-primary):hover .ico { color: var(--ow-err-ink); }
.set-area .btn-primary .ico { stroke-width: 2.25; }

/* the fields: one look — the surface, a grey edge, a green border and a soft ring on focus */
.set-area :is(input[type=text], input[type=password], input[type=email], input[type=number], input[type=date],
    input[type=time], textarea, select) { background: var(--surface); border: 1px solid var(--ow-reject-bd);
    border-radius: .625rem; color: var(--ow-ink); }
.set-area :is(input[type=text], input[type=password], input[type=email], input[type=number], input[type=date],
    input[type=time], select) { min-height: 2.75rem; padding-top: .5rem; padding-bottom: .5rem; }
.set-area :is(input, textarea, select):focus-visible { outline: .125rem solid transparent; border-color: var(--ow-green);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ow-green) 18%, transparent); }
.set-area input[type=checkbox]:checked { background: var(--ow-green); border-color: var(--ow-green); }
.set-area input[type=checkbox]:focus-visible { box-shadow: none; outline: .125rem solid var(--brand); outline-offset: .125rem; }
.set-area .connect-form label, .set-area .orgnew-field { color: var(--ow-ink-2); font-size: .875rem; font-weight: 600; }

/* one setting: its rule, its words; a changed one in the info tone, as a changed cell of an order */
.set-area .set-group .setting-row { position: relative; border-top-color: var(--ow-row-rule); }
.set-area .set-group .setting-meta label, .set-area .set-group .setting-meta .setting-name { font-size: .9375rem;
    font-weight: 600; color: var(--ow-ink); }
.set-area .set-group .setting-help { font-size: .875rem; color: var(--ow-text-2); }
.set-area .set-group .setting-static { border-radius: .625rem; background: var(--ow-head-bg); color: var(--ow-ink); }
.set-area .setting-row.is-changed::before { content: ""; position: absolute; left: -1.5rem; top: .75rem; bottom: .75rem;
    width: var(--rail); border-radius: 0 var(--rail) var(--rail) 0; background: var(--ow-changed-bd); }
.set-area .setting-row.is-changed :is(input:not([type=checkbox]), select, textarea) { border-color: var(--ow-changed-bd);
    background: var(--ow-changed-bg); }

/* the save bar: the order's — quiet when clean; changed, it counts in the info tone and lifts */
.set-area .save-bar { margin-top: var(--s5); }
.set-area .save-bar-inner { padding: .75rem 1rem .75rem 1.25rem; border-color: var(--ow-card-bd); border-radius: .875rem;
    box-shadow: var(--ow-card-shadow); }
.set-area .save-bar-dot { background: var(--ow-dot-ok); }
.set-area .save-bar-state { color: var(--ow-text-2); }
.set-area .save-bar.is-dirty .save-bar-inner { border-color: var(--ow-info-bd); box-shadow: var(--pop-shadow); }
.set-area .save-bar.is-dirty .save-bar-state { color: var(--ow-info-ink); font-weight: 600; }
.set-area .save-bar.is-dirty .save-bar-dot { background: var(--ow-info-ink); }

/* the pop-overs: the order screen's one pop-over */
.set-area .role-pop-card { border: 1px solid var(--border); border-radius: .75rem; box-shadow: var(--pop-shadow); }
@media (min-width: 601px) {
    .set-area .pw-form { background: var(--surface); border: 1px solid var(--border); border-radius: .75rem;
        box-shadow: var(--pop-shadow); }
}
@media (max-width: 600px) { .set-area .pw-form { border-radius: .75rem; } }
/* PX-267 (the owner's „а“): the settings pop-overs simply appear — a fade drew their text below AA, and any move would
   carry the centred password pop-over across its row's edge (PU-44) */

/* Моят профил and Сигурност: the rows' rules, the counts in tabular figures */
.set-area .sec-row + .sec-row, .set-area .sender-list li { border-top-color: var(--ow-row-rule); }
.set-area .sec-row { padding: 1.125rem 1.5rem; align-items: center; }
.set-area .sec-row-title { font-size: .9375rem; color: var(--ow-ink); }
.set-area .sec-row-desc { font-size: .875rem; color: var(--ow-text-2); }
.set-area .profile-stat dt { color: var(--ow-text-2); }
.set-area .profile-stat dd { font-variant-numeric: tabular-nums; }
.set-area .login-now { background: var(--ow-ok-bg); color: var(--ow-ok-ink); }
.set-area .readonly-note { border-radius: .875rem; border-color: var(--ow-card-bd); background: var(--surface); color: var(--ow-text-2); }

/* Пощенски кутии: a card per mailbox, its state in the chip; only a broken one keeps the left line, in the error tone */

.set-area .mbx-name { color: var(--ow-ink); }
.set-area .mbx-error { margin: 0 1.5rem 1rem; border: 1px solid var(--ow-err-bd); border-radius: .625rem;
    background: var(--ow-err-bg); color: var(--ow-err-ink); }

.set-area .connect-hint { color: var(--ow-text-2); }
@media (max-width: 720px) {
    .set-area .set-group-head,
.set-area .set-group-body,
.set-area .set-card-body,
.set-area .set-card-foot,
.set-area .sec-row { padding-left: 1rem; padding-right: 1rem; }
    .set-area .setting-row.is-changed::before { left: -1rem; }
    .set-area .mbx-error { margin-left: 1rem; margin-right: 1rem; }
    .set-area .hero-text .page-title { font-size: 1.6rem; }
}

/* the owner's review (2026-10-04, „махни иконките които са ИИ изглеждащи"): no icon tile or disc beside a heading —
   a security row is its words and its one action */
.set-area .sec-row { grid-template-columns: minmax(0, 1fr) auto; }
@media (max-width: 560px) { .set-area .sec-row > .btn { grid-column: 1; } }

/* „Поправени поръчки" (P0-15): the owner's collection of hand corrections — one card per letter, Ordio's word
   beside the person's, the two answers at the foot; the added letters wait above for their download. */
.corr-list { display: flex; flex-direction: column; gap: var(--s3); margin-top: var(--s3); }
.corr-added { margin-top: var(--s3); }
.corr-added-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap;
    padding: var(--s2) 0; border-top: 1px solid var(--border); }
.corr-added-row:first-of-type { border-top: 0; }
.corr-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s3); flex-wrap: wrap; }
.corr-title { font-size: 1rem; margin: 0; }
.corr-meta { font-size: .84rem; margin-top: var(--s1); overflow-wrap: anywhere; }
.corr-kinds { display: flex; gap: var(--s1); flex-wrap: wrap; }
.corr-kinds .chip { margin-left: 0; }
.corr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: var(--s4); margin: var(--s3) 0; }
.corr-sub { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 var(--s1); }
.corr-line { margin: 0 0 var(--s1); }
.corr-changes { margin: 0 0 var(--s1); padding-left: 1.1rem; font-size: .9rem; }
.corr-warn { color: var(--attn-fg); font-size: .84rem; margin-top: var(--s1); }
.corr-body summary { cursor: pointer; color: var(--muted); font-size: .88rem; }
.corr-text { white-space: pre-wrap; margin: var(--s2) 0 0; font-size: .9rem; overflow-wrap: anywhere; }
.corr-foot { display: flex; justify-content: flex-end; margin-top: var(--s3); }
.corr-foot form { display: flex; gap: var(--s2); }
/* P0-15: „Поправени поръчки" is longer than the menu's column — it takes two lines rather than lose its end. */
.sidenav .navitem.navitem-wrap > span { white-space: normal; line-height: 1.2; }
/* PU-192: on a phone the menu is one scrolling row — every item on one line */
@media (max-width: 820px) { .sidenav .navitem.navitem-wrap > span { white-space: nowrap; } }
/* PU-112: the gap above the stuck header is the list's own ground, not a window onto the rows passing under it */
.rc-cols::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: var(--s2); background: var(--surface); }

/* =========================================================   PU-106: the order's band, compact (the owner's pick C,
   2026-10-11: „само най-необходимото"). A quiet card on the surface — a 1 px card edge, a 3 px rail and a dot in the
   state's colour (the orders list's dots; the rail `--rail`, PU-120), only the title coloured; one row, wrapping on a phone. Light mirrors dark
   through the tokens. The mailbox band (`.mb-band`) keeps PU-65's look. */
.ow-band.ow-band-c { --ow-band-dot: var(--ow-info-ink); --ow-text-2: var(--ow-band-muted); position: static; overflow: visible; isolation: auto;
    display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; min-height: 0;
    margin: var(--s3) 0 var(--s4); padding: .55rem 1rem .55rem .9rem;
    border: 1px solid var(--ow-card-bd); border-left: var(--rail) solid var(--ow-band-dot); border-radius: .625rem;
    background: var(--surface); box-shadow: none; }
.ow-band.ow-band-c::before, .ow-band.ow-band-c::after { content: none; }
.ow-band.ow-band-c.ow-tone-ok { --ow-band-dot: var(--ow-dot-ok); --ow-tone: var(--ow-ok-ink); }
.ow-band.ow-band-c.ow-tone-attn { --ow-band-dot: var(--ow-warn-strong); --ow-tone: var(--ow-warn-ink); }
.ow-band.ow-band-c.ow-tone-err { --ow-band-dot: var(--ow-err-ink); --ow-tone: var(--ow-err-ink); }
.ow-band.ow-band-c.ow-tone-info { --ow-band-dot: var(--ow-info-ink); --ow-tone: var(--ow-info-ink); }
.ow-band.ow-band-c[role="status"] { --ow-band-dot: var(--ow-text-2); --ow-tone: var(--ow-text-2); }

.ow-band.ow-band-c .st-spin { flex: none; width: .875rem; height: .875rem; border-width: 2px; }
.ow-band.ow-band-c .tip-anchor { flex: none; min-width: 0; max-width: 100%; }
.ow-band.ow-band-c .ow-band-title { margin: 0; font-size: 1rem; font-weight: 650; line-height: 1.4; letter-spacing: 0;
    color: var(--ow-tone); }

.ow-band.ow-band-c .ow-band-who { font-size: .875rem; font-weight: 500; color: var(--ow-text-2); }
/* PU-120: the second line says its words whole — it wraps, never „…" (the band is the only place they are said) */
.ow-band.ow-band-c .ow-band-lead { flex: 1 1 12rem; min-width: 0; margin: 0; display: flex; flex-wrap: wrap;
    gap: .2rem .6rem; align-items: baseline; font-size: .875rem; line-height: 1.4; color: var(--ow-ink-2);
    overflow-wrap: anywhere; }
.ow-band.ow-band-c .ow-band-reason { white-space: normal; }
.ow-band.ow-band-c .ow-band-quote { margin: 0; padding: 0; border: 0; background: none; font-style: italic;
    color: var(--ow-ink); }
.ow-band.ow-band-c .ow-band-quote::before { content: "„"; }
.ow-band.ow-band-c .ow-band-quote::after { content: "“"; }
.ow-band.ow-band-c .ow-band-lead a, .ow-band-link { color: var(--ow-tone); }
/* PX-381: the band's link („Заменя №23") is told from its words by more than colour (axe link-in-text-block) */
.ow-band.ow-band-c .ow-band-lead a { text-decoration: underline; text-underline-offset: .15em; }
.ow-band-link { flex: none; display: inline-flex; align-items: center; gap: .15rem; margin-left: auto;
    font-size: .8125rem; font-weight: 500; text-decoration: underline;
    text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 2px; }
.ow-band.ow-band-c .ow-band-act { flex: none; margin: 0 0 0 auto; }
.ow-band-link + .ow-band-act { margin-left: 0; }
@media (max-width: 640px) {
    .ow-band.ow-band-c { padding: .55rem .8rem; }
    .ow-band.ow-band-c .ow-band-lead { flex-basis: 100%; }
    .ow-band.ow-band-c .ow-band-title { font-size: 1rem; }
}
/* PU-134: a site form's letter names its person — „през формата на сайта" beside, quiet */
.mb-via, .ow-sender-via, .ow-msg-via { color: var(--muted); font-weight: 400; }
.ow-msg-via { font-size: .78rem; }

/* PU-138: the bars' tint over the page's ground — the dark theme's tints are translucent, and the page read through
   „Гледаш като" / „Работиш в" / the reminder while it scrolled (`.devdb-bar` had the same fix) */
.viewas-bar { background: linear-gradient(var(--attn-bg), var(--attn-bg)), var(--bg); }
.viewas-bar.workin-bar { background: linear-gradient(var(--ok-bg), var(--ok-bg)), var(--bg); }
.viewas-bar.reminder-bar { background: linear-gradient(var(--info-bg), var(--info-bg)), var(--bg); }

/* =========================================================   PU-148: the settings screens in the frame of the owner's
   mockup (2026-10-04). No header cards — the section tab names the screen; Моят профил the profile card beside
   Сигурност, Изглед below; the team a toolbar over its table; the mailboxes one table. Tokens only, both themes.
   ================================================================ */
/* Моят профил: one column, two from 1200 px — the card narrow on the left, its counts in two rows of two */
.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s5); align-items: start;
    margin-bottom: var(--s5); }
.set-area .profile-grid > .set-card { margin: 0; }
@media (min-width: 1200px) {
    .profile-grid { grid-template-columns: minmax(18rem, 22rem) minmax(0, 1fr); }
    .profile-grid .profile-hero-body { flex-direction: column; align-items: flex-start; gap: var(--s3); }
    .profile-grid .profile-hero .profile-id { flex: none; padding-top: 0; }
    .profile-grid .profile-hero .profile-stats { flex-basis: auto; width: 100%; display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3) 0; margin: 0; padding: var(--s3) 0 0;
        border-top: 1px solid var(--ow-row-rule); }
    .profile-grid .profile-hero .profile-stat, .profile-grid .profile-hero .profile-stat:last-child {
        padding: 0 .75rem; text-align: left; }
    .profile-grid .profile-hero .profile-stat:nth-child(odd) { padding-left: 0; border-left: 0; }
    .profile-grid .profile-hero .profile-stat:nth-child(even) { border-left: 1px solid var(--ow-row-rule); }
}

/* Работни настройки: the one short line PU-116 kept, without its card */
.set-lead { margin: 0 0 var(--s4); font-size: .9375rem; color: var(--ow-text-2); }
/* PU-271: the forwarding note's link is told apart by more than its colour (axe link-in-text-block) */
.set-forward a { text-decoration: underline; text-underline-offset: 3px; }

/* Хора и права: one card — the toolbar, then the team */
.team-card { padding: 0; overflow: hidden; container-type: inline-size; }
.team-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap;
    padding: 1rem 1.5rem; }
.team-count { font-size: .9375rem; font-weight: 600; color: var(--ow-ink); font-variant-numeric: tabular-nums; }
.set-area .team-card > .list-table { border-top: 1px solid var(--ow-row-rule); }
.set-area .team-table td[data-label="Състояние"] { white-space: nowrap; }

/* Пощенски кутии: one table — the address with its marks, the error under it; a broken row keeps the left line */
.mbx-card { padding: 0; overflow: hidden; }
.set-area .mbx-table td { vertical-align: middle; }
.mbx-table .mbx-addr { overflow-wrap: anywhere; }
.mbx-table .mbx-addr .status-badge { margin-left: .5rem; vertical-align: middle; }
.set-area .mbx-table .mbx-error { display: flex; align-items: flex-start; gap: .5rem; margin: .5rem 0 0;
    padding: .5rem .75rem; font-size: .875rem; }
.set-area .mbx-table .mbx-row.is-broken > td:first-child { box-shadow: inset var(--rail) 0 0 var(--ow-err-ink); }
.mbx-since-cell { display: inline-flex; align-items: center; gap: var(--s2) var(--s3); flex-wrap: wrap; }
.mbx-table .mbx-actions { display: flex; align-items: center; justify-content: flex-end; gap: var(--s2);
    flex-wrap: wrap; margin: 0; }
.set-area .mbx-card + .connect-card { margin-top: var(--s5); }
@media (max-width: 600px) {
    .list-table td.mbx-addr { display: block; }
    .list-table td.mbx-addr::before { content: none; }
    .mbx-table .mbx-actions { justify-content: flex-start; }
    .set-area .mbx-table .mbx-row.is-broken > td:first-child { box-shadow: none; }
    .set-area .mbx-table .mbx-row.is-broken { box-shadow: inset var(--rail) 0 0 var(--ow-err-ink); }
    .team-bar { padding: .875rem 1rem; }
}

/* =========================================================   PU-149: a person's e-mail — Основна информация over
   Сигурност in the column beside the profile card; the address under a person's name on Хора и права. Tokens only.
   ================================================================ */
.profile-side { display: flex; flex-direction: column; gap: var(--s5); min-width: 0; }
.set-area .profile-side > .set-card { margin: 0; }
.info-form { display: flex; align-items: flex-end; gap: var(--s3); flex-wrap: wrap; padding: 1.125rem 1.5rem 1.375rem; }
.info-field { display: flex; flex-direction: column; gap: .375rem; flex: 1 1 18rem; min-width: 0;
    font-size: .875rem; font-weight: 600; color: var(--ow-ink-2); }
.info-field input { width: 100%; }
.info-actions { flex: none; }
.info-static { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s3); margin: 0;
    padding: 1.125rem 1.5rem 1.375rem; }
.info-static dt { font-size: .875rem; color: var(--ow-text-2); }
.info-static dd { margin: 0; color: var(--ow-ink); overflow-wrap: anywhere; }
.person-email { color: var(--ow-ink-2); font-size: .8125rem; overflow-wrap: anywhere; }
@media (max-width: 720px) { .info-form, .info-static { padding-left: 1rem; padding-right: 1rem; } }

/* =========================================================   PU-155: Пощенски кутии' „Резултат" — how the last read
   went: „Успешно" in the ok tone with its count, or „Грешка" with the error's words under it (said here only).
   ================================================================ */
.mbx-result-ok { color: var(--ow-ok-ink); font-weight: 600; }
.mbx-result-bad { color: var(--ow-err-ink); font-weight: 600; }
/* PU-192: a box Ordio cannot read has no fine last result to show */
.mbx-result-stale { color: var(--ow-text-2); font-size: .875rem; }
.set-area .mbx-table td.mbx-result { max-width: 18rem; }
@media (max-width: 600px) {
    .list-table td.mbx-result { flex-wrap: wrap; }
    .set-area .mbx-table td.mbx-result { max-width: none; }
    .set-area .mbx-table td.mbx-result .mbx-error { flex-basis: 100%; }
}

/* =========================================================   PU-151: Хора и права's toolbar — the search, Роля and
   Състояние (the filter bar's dropdowns), „Добави човек" at the end; the count and the pages under the team.
   ================================================================ */
.team-search { position: relative; flex: 1 1 16rem; display: flex; align-items: center; min-width: 0; }
.team-search > .ico { position: absolute; left: .875rem; color: var(--ow-text-2); pointer-events: none; }
.set-area .team-search input[type=search] { width: 100%; min-width: 0; min-height: 2.75rem; padding: 0 1rem 0 2.5rem;
    background: var(--surface); border: 1px solid var(--ow-reject-bd); border-radius: .625rem; color: var(--ow-ink); }
.set-area .team-search input[type=search]::placeholder { color: var(--ow-text-2); opacity: 1; }
.set-area .team-search input[type=search]:focus-visible { outline: .125rem solid transparent; border-color: var(--ow-green);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ow-green) 18%, transparent); }
.team-bar .team-add { margin-left: auto; }
.team-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap;
    padding: .875rem 1.5rem; border-top: 1px solid var(--ow-row-rule); }
.team-foot .team-count { margin: 0; font-size: .875rem; color: var(--ow-text-2); font-variant-numeric: tabular-nums; }
.team-pages { display: flex; align-items: center; gap: .375rem; }
.team-pages .page-num { min-width: 2.25rem; height: 2.25rem; display: inline-flex; align-items: center; justify-content: center;
    border-radius: .5rem; border-color: var(--ow-row-rule); background: var(--surface); color: var(--ow-ink); }
.team-pages .page-num-active { background: var(--ow-green); border-color: var(--ow-green); color: var(--ow-on-fill); }
.team-none { margin: 0; padding: 1.5rem; text-align: center; color: var(--ow-text-2); }
@media (max-width: 600px) {
    .team-bar .team-add { margin-left: 0; flex: 1 1 100%; }
    .team-foot { padding: .75rem 1rem; }
}

/* =========================================================   PU-150: a person's actions in one row menu on Хора и
   права — the order screen's „⋯"; the team's card lets an open menu stand outside it, so the last row's is whole; the menu opens beside its „⋯“.
   ================================================================ */
.team-card { overflow: visible; }
.team-card .team-table td[data-label="Действия"] { width: 3.5rem; text-align: right; }
/* beside its „⋯", not under it: the column of „⋯" stays free, so any other row's opens with one click (PU-44's rule) */
.person-menu .ow-more-menu { top: 0; right: calc(100% + .35rem); text-align: left; white-space: nowrap; }
.person-menu .ow-more-item { font: inherit; font-size: .9rem; color: var(--ow-ink); background: none; cursor: pointer; }
.person-menu form { margin: 0; }
.person-menu .ow-more-item.is-danger .ico { color: var(--ow-err-ink); }
.person-menu .ow-more-item.is-danger:hover { color: var(--ow-err-ink); }
@media (max-width: 600px) {
    /* the card layout puts the „⋯" at the row's right end: the menu opens leftwards from it, inside the window */
    .team-card .team-table td[data-label="Действия"] { width: 100%; }
}

/* =========================================================   PU-152: Хора и права — a box per person and a bar for
   the selected, in the info tone, between the toolbar and the team.
   ================================================================ */
.team-select-bar { padding: .625rem 1.5rem; border-top: 1px solid var(--ow-row-rule);
    background: color-mix(in srgb, var(--ow-info-ink) 8%, var(--surface)); }
.team-select-form { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; margin: 0; }
.team-select-count { margin-right: auto; font-size: .9rem; font-weight: 600; color: var(--ow-info-ink); }
.team-select-role select { min-height: 2.25rem; }
.person-pick, .pick-all { width: 1.1rem; height: 1.1rem; margin: 0 .25rem 0 0; accent-color: var(--ow-green); flex: none; cursor: pointer; }
.person-pick-gap { width: 1.35rem; flex: none; }
@media (max-width: 600px) { .team-select-bar { padding: .625rem 1rem; } }
/* a stopped person's row keeps full contrast: the „Спрян" chip says the state (PU-148), the faded row failed axe in dark */
.set-area .team-table .person-off td { opacity: 1; }
.team-table thead .pick-all { vertical-align: middle; margin-top: -.15rem; margin-right: .625rem; } /* PU-192: room before „Потребител" */

/* =========================================================   PU-153: a person's own photo on the avatar — the round
   avatar holds the picture whole; changed or removed under the profile card's avatar.
   ================================================================ */
.avatar.has-photo { padding: 0; overflow: hidden; background: var(--surface-2); }
.avatar.has-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.profile-avatar { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); }
.photo-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.photo-form { margin: 0; }
.photo-pick { cursor: pointer; }
.photo-pick:focus-within { outline: .125rem solid var(--brand); outline-offset: .125rem; }

/* =========================================================   PU-156: a mailbox's name above its address, and who
   handles it („Обработва се от", shown only).
   ================================================================ */
.mbx-table .mbx-title { display: block; color: var(--ow-ink); font-weight: 650; }
.mbx-table .mbx-name.is-sub { font-weight: 500; font-size: .875rem; color: var(--ow-text-2); }
.mbx-person { display: inline-flex; align-items: center; gap: .5rem; color: var(--ow-ink); }
.mbx-person .avatar { width: 1.75rem; height: 1.75rem; font-size: .7rem; border: 0; background: var(--ow-busy-bg); color: var(--ow-ink-2); }
/* PU-348: the table shares the settings' `people-table` band, not its 2.25rem avatar — the handler keeps its 1.75rem */
.set-area .people-table .mbx-person .avatar { width: 1.75rem; height: 1.75rem; font-size: .7rem; }
/* with the new column the address keeps whole on a desktop (it broke mid-word); a phone's card still breaks it */
.set-area .mbx-table td.mbx-addr { overflow-wrap: normal; }
.set-area .mbx-table .mbx-name, .set-area .mbx-table .mbx-title { white-space: nowrap; }
.mbx-table td.mbx-handler { white-space: nowrap; }
@media (max-width: 600px) {
    .set-area .mbx-table td.mbx-addr { overflow-wrap: anywhere; }
    .set-area .mbx-table .mbx-name, .set-area .mbx-table .mbx-title { white-space: normal; }
}
/* =========================================================   PU-158: Работни настройки as the owner's mockup —
   each field under its label, Режим на работа on one line, the save in the last card.
   ================================================================ */
.set-area .set-group .setting-row--stacked { grid-template-columns: minmax(0, 1fr); gap: .5rem; align-items: start;
    align-content: start; }
.set-area .setting-row--stacked .setting-input { max-width: 36rem; }
.set-area .set-group .setting-row--stacked > .setting-help { margin: 0; }
/* one line: the mode and the interval that applies to it; a hidden one leaves no gap, a phone wraps them */
.set-area .set-group-body--inline { display: flex; flex-wrap: wrap; column-gap: var(--s6); }
.set-area .set-group-body--inline > .setting-row { flex: 1 1 14rem; border-top: 0; }
.set-area .set-group-body--inline .setting-input { max-width: none; }
/* the last card ends with the save: a rule, then the bar without a card of its own until something changed */
.set-area .set-group-foot { padding: 0 1.5rem 1.125rem; }
.set-area .set-group-foot .save-bar { margin-top: 0; padding-top: 1.125rem; border-top: 1px solid var(--ow-row-rule); }
.set-area .set-group-foot .save-bar:not(.is-dirty) .save-bar-inner { padding: 0; border-color: transparent;
    box-shadow: none; background: transparent; }
@media (max-width: 600px) {
    .set-area .set-group-foot { padding-left: 1rem; padding-right: 1rem; }
}
/* =========================================================   PU-159: „Преглед" of the reply at the end of Отговори —
   the designed letter in a dialog, nothing sent.
   ================================================================ */
/* PU-192: its own class — .reply-preview is the white 32.5rem letter frame */
.set-area .reply-preview-row { display: flex; align-items: center; padding: 1rem 0 1.125rem;
    border-top: 1px solid var(--ow-row-rule); }
.reply-preview-dialog { width: min(44rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 0;
    border: 1px solid var(--ow-card-bd); border-radius: .875rem; background: var(--surface); color: var(--ow-ink);
    box-shadow: var(--shadow-lift); }
.reply-preview-dialog::backdrop { background: rgb(0 0 0 / .45); }
.reply-preview-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--ow-row-rule); }
.reply-preview-head h2 { margin: 0; font-size: 1.0625rem; }
.reply-preview-note { margin: .25rem 0 0; font-size: .875rem; color: var(--ow-text-2); }
/* the letter brings its own paper in both themes (its body is the mail's grey): it is what the customer sees */
.reply-preview-frame { display: block; width: 100%; height: min(36rem, calc(100vh - 9rem)); border: 0;
    border-radius: 0 0 .875rem .875rem; }
/* =========================================================   PU-161: Имейли grouped by customer — the option in the
   filters, a quiet head over each customer's letters.
   ================================================================ */
.mb-group-toggle { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.5rem; color: var(--ow-ink);
    font-size: .9rem; white-space: nowrap; cursor: pointer; }
.mb-group-toggle input { width: 1rem; height: 1rem; margin: 0; accent-color: var(--ow-ink); }
.mb-rows > .mb-group { display: flex; align-items: baseline; gap: .5rem; min-width: 0; padding: .875rem 1rem .375rem;
    border-top: 1px solid var(--ow-row-rule); }
.mb-rows > .mb-group:first-child { border-top: 0; }
.mb-group-name { font-weight: 650; font-size: .875rem; color: var(--ow-ink); }
.mb-group-addr { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8125rem;
    color: var(--ow-text-2); }
/* =========================================================   PU-157: Пощенски кутии as the owner's mockup —
   „Свържи кутия" opens a side panel at the window's right edge; a box's actions in one „⋯".
   ================================================================ */

.form-dialog.side-panel { inset: 0 0 0 auto; margin: 0; width: min(28rem, 100vw); height: 100vh; max-height: 100vh;
    border-width: 0 0 0 1px; border-radius: 0; box-shadow: var(--shadow-lift); }
/* it simply appears: a fade would draw its text below AA while it enters (PX-267) */
.form-dialog.side-panel[open] { display: flex; animation: none; }
.form-dialog.side-panel > form.side-panel-form { display: flex; flex-direction: column; align-items: stretch; flex: 1;
    min-width: 0; min-height: 0; padding: 0; }
.side-panel-body .connect-check { flex-direction: row; align-items: flex-start; gap: var(--s2); }
.side-panel-head { position: relative; padding: 1.25rem 3rem 1rem 1.5rem; border-bottom: 1px solid var(--ow-row-rule); }
.side-panel-head h2 { margin: 0; font-size: 1.0625rem; color: var(--ow-ink); }
.side-panel-body { display: flex; flex-direction: column; gap: 1rem; flex: 1; overflow-y: auto; padding: 1.25rem 1.5rem; }
.side-panel-body .orgnew-field input, .side-panel-body .orgnew-field select { width: 100%; }
.side-panel-body .connect-hint { margin: 0; font-size: .875rem; color: var(--ow-text-2); }
.side-panel-foot { display: flex; justify-content: flex-end; gap: var(--s2); padding: 1rem 1.5rem;
    border-top: 1px solid var(--ow-row-rule); }
/* the row's „⋯": the card lets an open menu stand outside it (the last row's whole), the menu beside its button */
.set-area .mbx-card { overflow: visible; }
.mbx-table td[data-label="Действия"] { width: 3.5rem; text-align: right; }
.mbx-menu .ow-more-menu { top: 0; right: calc(100% + .35rem); text-align: left; white-space: nowrap; }
.mbx-menu .mbx-actions { display: block; }
.mbx-menu .ow-more-item { font: inherit; font-size: .9rem; color: var(--ow-ink); background: none; cursor: pointer; }
.mbx-menu .ow-more-item.is-lead { font-weight: 650; }
.mbx-menu .ow-more-item.is-danger .ico { color: var(--ow-err-ink); }
.mbx-menu .ow-more-item.is-danger:hover { color: var(--ow-err-ink); }
@media (max-width: 600px) {
    .mbx-table td[data-label="Действия"] { width: 100%; }
}

/* ================================================================
   PU-175 (the owner, 2026-10-21): the order screen's tabs, its letter panel and its opener
   ================================================================ */
/* the tab row has nothing to scroll: the open tab's line sits on the row's line (an inset shadow under it) instead of
   hanging 1 px below a row whose overflow-x: auto made it scroll up and down under a wheel */
.ow-hd .ow-tabs { border-bottom: 0; box-shadow: inset 0 -1px 0 var(--border); overflow-y: hidden; }
.ow-hd .of-tab { margin-bottom: 0; }
/* the letter beside the lines (variant В): a line a block, a blank line gone and a paragraph's gap kept, the number of
   the order line it holds before it (`data-lines`, PU-56's exact holds), the rail wider while it is open */
.ow-panel-body { padding: .375rem; white-space: normal; line-height: 1.45; }
.ow-lt-line { display: grid; grid-template-columns: minmax(1.375rem, max-content) minmax(0, 1fr); column-gap: .6rem;
    align-items: start; padding: .3rem .5rem; border-radius: .5rem; white-space: pre-wrap; }
.ow-lt-line::before { content: ""; }
.ow-lt-line:empty { display: none; }
.ow-lt-line:empty + .ow-lt-line:not(:empty) { margin-top: .5rem; }
.ow-lt-line[data-lines]::before { content: attr(data-lines); box-sizing: border-box;
    display: inline-flex; align-items: center; justify-content: center; min-width: 1.375rem; height: 1.375rem;
    padding: 0 .3rem; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: .72rem;
    font-weight: 700; line-height: 1; white-space: nowrap; }
.ow-lt-line.is-lit { box-shadow: inset .1875rem 0 0 var(--attn-fg); }
.ow-lt-line.is-lit::before { background: var(--surface); color: var(--ow-warn-ink); }
@media (min-width: 1280px) and (max-width: 1439px) {
    .ow-grid:has(.ow-rail.is-letter) { grid-template-columns: minmax(0, 1fr) 26rem; }
}
@media (min-width: 1440px) {
    .ow-grid:has(.ow-rail.is-letter) { grid-template-columns: minmax(0, 1fr) 27.5rem; }
}
/* the compact band (PU-106) a tint of its state on the light theme, so it is seen; dark keeps its plain surface */
.ow-band.ow-band-c { background: color-mix(in srgb, var(--ow-band-dot) var(--ow-band-tint), var(--surface)); }
/* „Сравни с писмото" in the screen's green on the light theme, as „Отвори писмото" in the panel — not the blue of a
   foreign link; the dark theme keeps its own (the owner's words were of the light one) */
:root { --ow-foot-link: var(--ow-green); }
[data-theme="dark"] { --ow-foot-link: var(--ow-link); }

/* „Форма“ (P13-10): the order form's state, address and preview — one card */
.ofs-card { max-width: none; }  /* PU-192: every card of the screen one width, the preview's */

/* P13-22: the order form shown on „Форма“ itself — the preview in a frame as tall as its page, VIP / client tabs */
.ofs-view { max-width: none; }  /* P13-23: the form's card spans the screen; the others keep their width */
.ofs-tabs { display: inline-flex; gap: var(--s1); padding: 2px; border: 1px solid var(--border); border-radius: var(--radius); }
.ofs-tab { border: 0; background: transparent; color: var(--muted); font: inherit; padding: var(--s1) var(--s3); border-radius: var(--radius-sm); cursor: pointer; }
.ofs-tab[aria-pressed="true"] { background: var(--brand-soft); color: var(--text); font-weight: 600; }
.ofs-frame { display: block; width: 100%; min-height: 32rem; margin-top: var(--s3); border: 0; border-top: 1px solid var(--border); background: var(--bg); }  /* P13-23: the card is its border */
.ofs-view.card { padding-bottom: 0; overflow: hidden; }
/* PU-192: the preview reaches the card's edges — no card ground beside the page (a frame in a frame) */
.ofs-view.card > .ofs-frame { width: calc(100% + 2.75rem); margin-left: -1.375rem; margin-right: -1.375rem; }
.ofl-view .ofs-frame { min-height: 28rem; }

/* „Обява за деня“ (P13-07): the composer on „Форма“ and the preview of the exact letter */

.fa-list { list-style: none; margin: 0; padding: 0; max-height: 18rem; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.fa-list > li { padding: var(--s2) var(--s3); border-bottom: 1px solid var(--border); }
.fa-list > li:last-child { border-bottom: 0; }
.fa-list label { display: flex; gap: var(--s2); align-items: baseline; flex-wrap: wrap; cursor: pointer; }

.fa-text { white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--s3); margin: 0; }

