/* The project-board area's look: the IVO board's stylesheet (app/globals.css of the Next.js board, itself the
   reference page's), ported rule for rule with its class names, every rule scoped under the .pboard root so
   nothing leaks into the host — and the host's app.css, Bootstrap (whose .pb-* are padding utilities) and the
   CRM (a bare .pb) do not leak in.

   What changed in the port, and why:
   - :root tokens and the html/body rules live on .pboard. Page-level rules are dropped: the safe-area padding
     and strip (body::before), html scroll padding, body margin and font — the host owns the page.
   - Fonts: the original self-hosts Barlow Condensed, Public Sans, IBM Plex Mono, and for Russian Fira Sans Extra
     Condensed and IBM Plex Sans, through next/font. The same files and @font-face rules are copied under
     wwwroot/fonts (fonts.css, imported below) and served by this app — never from Google, whose font links would
     send every visitor's address there. next/font's --font-* variables are set on .pboard, so the --f-* stacks
     read exactly as the original's.
   - Theme: the host is light only (no dark mode, no data-theme), so the board is light. Its dark palette is
     kept, but only applies under data-theme="dark" on the page root or the board, ready for a host theme switch;
     the operating system's dark preference alone does not switch it, or the board would go dark inside a light app.
   - Layout: the host (MainLayout) is a 100vh column: its 62px header, then .app-content, the scroll container.
     The board's sticky header sticks to the top of that container (--pboard-top: 0) — just under the host header.
     Fixed side panels (the card and tender sheets, versions, Ask) and their scrim start below the host header
     (--pboard-host-top), so the host's navigation stays reachable; dialogs and toasts still cover everything.
   - The board root carries lang="en|ru": html[lang="ru"] became .pboard[lang="ru"].
   - The view tabs are links (<a class="tab">), not buttons: they get no underline. */

@import url("fonts/fonts.css");

.pboard {
    color-scheme: light;
    --bg: #eef1f2;
    --surface: #ffffff;
    --surface-2: #f6f8f8;
    --ink: #14212b;
    --muted: #586773;
    --faint: #8b98a3;
    --line: #d6dde1;
    --accent: #0a6c86;
    --accent-ink: #ffffff;
    --find: #2d64c8;
    --find-bg: #e6eefb;
    --decide: #a86400;
    --decide-bg: #fbf0dc;
    --build: #23794c;
    --build-bg: #e3f3e9;
    --do: #6a4fc4;
    --do-bg: #eee9fb;
    --blocked: #b93a12;
    --blocked-bg: #fde9e1;
    --shadow: 0 1px 2px rgba(20, 33, 43, .06), 0 2px 8px rgba(20, 33, 43, .05);
    /* What next/font sets on the original's <html> (fonts/fonts.css has the faces). */
    --font-display: "Barlow Condensed", "Barlow Condensed Fallback";
    --font-body: "Public Sans", "Public Sans Fallback";
    --font-mono: "IBM Plex Mono", "IBM Plex Mono Fallback";
    --font-display-cyr: "Fira Sans Extra Condensed", "Fira Sans Extra Condensed Fallback";
    --font-body-cyr: "IBM Plex Sans", "IBM Plex Sans Fallback";
    --f-display: var(--font-display), "Barlow Condensed", var(--font-display-cyr), "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
    --f-body: var(--font-body), "Public Sans", var(--font-body-cyr), system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --f-mono: var(--font-mono), "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

    /* The host layout (MainLayout.razor.css): the board header sticks at the top of the host's scroll container,
       which already starts under the host header; fixed side panels start below the 62px host header. */
    --pboard-top: 0px;
    --pboard-host-top: 62px;

    /* The shell's own names (the Projects page and the not-found state), on the board's palette. */
    --pboard-accent: var(--accent);
    --pboard-card: var(--surface);
    --pboard-line: var(--line);
    --pboard-ink: var(--ink);
    --pboard-muted: var(--muted);
    --pboard-r: 10px;

    background: var(--bg);
    color: var(--ink);
    font-family: var(--f-body);
    font-size: 14px;
    line-height: 1.45;
    /* Fill the host's content column, so the board's background reaches the bottom of short pages. */
    flex: 1 0 auto;
}
:root[data-theme="dark"] .pboard,
.pboard[data-theme="dark"] {
    --bg: #0d1419; --surface: #151e25; --surface-2: #1a252d; --ink: #e5ecf1; --muted: #9eabb6; --faint: #6f7d88; --line: #27343e;
    --accent: #4fb4d3; --accent-ink: #06222b;
    --find: #79a6f2; --find-bg: #17263d; --decide: #e7a948; --decide-bg: #33260f; --build: #64c792; --build-bg: #13301f;
    --do: #a895f3; --do-bg: #241d3d; --blocked: #f2875f; --blocked-bg: #3a1c12;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 2px 10px rgba(0,0,0,.25);
    color-scheme: dark;
}
.pboard img { max-width: 100%; }
.pboard [hidden]:not([hidden=until-found i]) { display: none !important; }

/* The host loads Bootstrap's reboot, which restyles bare elements the original left to the browser (heading
   weights and margins, list and paragraph margins, floated legends, pink code, faded rules). Inside the board
   those elements go back to the browser's own styles; :where() keeps this at one class of specificity, so every
   rule below still wins. */
.pboard :where(h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dt, dd, legend, fieldset, hr, label, summary, blockquote, pre, code, kbd, small, mark, sub, sup) { all: revert; }

/* ---------- The shell: pages that are not a board (Projects, not found) ---------- */
.pboard-wrap { max-width: 1180px; margin: 0 auto; padding: 32px 28px 90px; display: grid; gap: 18px; align-content: start; }
.pboard-sub { color: var(--muted); max-width: 760px; margin: 0; }
.pboard-empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--pboard-r); padding: 40px 24px; text-align: center; }
.pboard-empty .pboard-sub { margin: 0 auto; }
.pboard-empty-title { font-weight: 600; margin: 0 0 4px; }

/* Projects: one row per project, like the original's project list. */
.pboard-projects { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pboard-projects li { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; padding: 10px 14px; box-shadow: var(--shadow); }
.pboard-projects li:hover { border-color: var(--accent); }
.pboard-projects a { display: grid; gap: 2px; min-width: 0; flex: 1; color: var(--ink); text-decoration: none; }
.pboard-projects-name { font-family: var(--f-display); font-weight: 700; font-size: 20px; line-height: 1.15; letter-spacing: .01em; overflow-wrap: anywhere; }
.pboard-role { font-family: var(--f-display); font-weight: 600; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 7px; white-space: nowrap; }
.pboard-new { display: grid; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--pboard-r); padding: 16px; }
.pboard-new h2 { margin: 4px 0 0; font-family: var(--f-display); font-weight: 600; font-size: 15px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.pboard-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.pboard-form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.pboard-form input:not([type="file"]) { border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; background: var(--surface); color: var(--ink); min-height: 36px; font-size: 14px; }
.pboard-form input[type="file"] { font-size: 13px; }
.pboard-btn { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 6px; padding: 7px 14px; font-weight: 600; min-height: 36px; }
.pboard-btn:disabled { opacity: .5; cursor: default; }
.pboard-message { color: var(--blocked); font-size: 13px; margin: 0; }
@media (max-width: 640px) {
    .pboard-wrap { padding: 20px 16px 60px; }
}

/* ---------- The board (app/globals.css, scoped) ---------- */
.pboard * { box-sizing: border-box; }

.pboard button, .pboard input, .pboard select { font: inherit; color: inherit; }
.pboard button { cursor: pointer; }
.pboard :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pboard .wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); max-width: 1440px; margin: 0 auto; }


/* Header */
.pboard header.top { position: sticky; top: var(--pboard-top); z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); }
.pboard header .wrap { padding-block: 14px 0; display: grid; gap: 10px; }
/* The live board's header (newer than the code this was ported from): the title with the tagline and the project's
   time under it on the left, the buttons on the right across both. One wrapping row instead put the buttons on a line
   of their own whenever the labels got longer (Russian), with the time block pushed over to the right. */
.pboard .titlerow { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title actions" "info actions"; align-items: center; gap: 6px 24px; }
.pboard .titlerow h1 { grid-area: title; min-width: 0; overflow-wrap: break-word; }
.pboard .titlerow .head-info { grid-area: info; }
.pboard .titlerow .head-actions { grid-area: actions; flex-wrap: nowrap; justify-content: flex-end; margin-left: 0; }
@media (max-width: 1180px) {
  .pboard .titlerow { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "info" "actions"; }
  .pboard .titlerow .head-actions { flex-wrap: wrap; justify-content: flex-start; }
}
.pboard h1 { font-family: var(--f-display); font-weight: 700; font-size: 28px; letter-spacing: .01em; margin: 0; line-height: 1.05; text-wrap: balance; }
.pboard .asof { color: var(--muted); font-size: 13px; }
.pboard .asof b { color: var(--ink); font-weight: 600; }
.pboard .tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin-bottom: -1px; }
.pboard .tabs::-webkit-scrollbar { display: none; }
.pboard .tab { display: inline-block; text-decoration: none; background: none; border: 0; border-bottom: 3px solid transparent; padding: 8px 12px 9px; font-family: var(--f-display); font-weight: 600; font-size: 17px; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.pboard .tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.pboard .tab .n { font-family: var(--f-mono); font-size: 12px; font-weight: 500; color: var(--faint); margin-left: 4px; letter-spacing: 0; }

.pboard main .wrap { padding-block: 18px 48px; display: grid; gap: 18px; }
.pboard main .wrap > * { min-width: 0; }
.pboard #view { display: grid; gap: 14px; min-width: 0; }
.pboard .zones > *, .pboard .zone, .pboard .chains > * { min-width: 0; }

/* Date rail */
.pboard .rail-box { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 10px; overflow-x: auto; }
.pboard .rail { position: relative; min-width: 620px; height: 74px; }
.pboard .rail .line { position: absolute; left: 0; right: 0; top: 36px; height: 4px; border-radius: 2px; background: var(--line); }
.pboard .rail .done { position: absolute; left: 0; top: 36px; height: 4px; border-radius: 2px; background: var(--accent); }
.pboard .mk { position: absolute; top: 30px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
.pboard .mk i { width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--ink); display: block; }
.pboard .mk.today i { border-color: var(--accent); background: var(--accent); }
.pboard .mk.soft i { border-style: dashed; }
.pboard .mk span { position: absolute; white-space: nowrap; font-size: 12px; line-height: 1.25; color: var(--muted); text-align: center; }
.pboard .mk span b { display: block; font-family: var(--f-mono); font-weight: 500; color: var(--ink); font-size: 12px; }
.pboard .mk.up span { bottom: 20px; }
.pboard .mk.down span { top: 20px; }
.pboard .mk.left span { left: -4px; text-align: left; }
.pboard .mk.right span { right: -4px; text-align: right; }

/* Summary strip */
.pboard .summary { display: flex; flex-wrap: wrap; gap: 8px; }
.pboard .sum { display: flex; align-items: baseline; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.pboard .sum b { font-family: var(--f-display); font-size: 24px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.pboard .sum span { color: var(--muted); font-size: 13px; }
.pboard .sum.find b { color: var(--find); } .pboard .sum.decide b { color: var(--decide); } .pboard .sum.build b { color: var(--build); } .pboard .sum.do b { color: var(--do); } .pboard .sum.blocked b { color: var(--blocked); }
.pboard .sum.fork b { color: var(--decide); } .pboard .sum.fork { border-style: dashed; border-color: var(--decide); }
.pboard button.sum { text-align: left; }
.pboard button.sum:hover { border-color: var(--accent); }
.pboard button.sum[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 -3px 0 var(--accent); }
.pboard .sumhint { font-size: 12px; color: var(--faint); align-self: center; }

/* Legend + intro */
.pboard .intro { display: grid; gap: 6px; max-width: 80ch; color: var(--muted); }
.pboard .intro p { margin: 0; }
.pboard .legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.pboard .legend span { display: inline-flex; align-items: center; gap: 6px; }

/* Chips */
.pboard .ty { display: inline-flex; align-items: center; gap: 5px; font-family: var(--f-display); font-weight: 600; font-size: 13px; letter-spacing: .05em; text-transform: uppercase; padding: 1px 7px; border-radius: 4px; line-height: 1.5; white-space: nowrap; }
.pboard .ty.find { color: var(--find); background: var(--find-bg); }
.pboard .ty.decide { color: var(--decide); background: var(--decide-bg); }
.pboard .ty.build { color: var(--build); background: var(--build-bg); }
.pboard .ty.do { color: var(--do); background: var(--do-bg); }
.pboard .ty.fork { color: var(--decide); background: transparent; border: 1px dashed var(--decide); padding: 0 6px; }
.pboard .fk { font-family: var(--f-display); font-weight: 600; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--decide); border: 1px dashed var(--decide); border-radius: 3px; padding: 0 4px; line-height: 1.4; }
.pboard .st { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.pboard .st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.pboard .st.open::before { background: var(--accent); }
.pboard .st.waiting::before { background: transparent; border: 2px solid var(--muted); width: 8px; height: 8px; box-sizing: border-box; }
.pboard .st.blocked { color: var(--blocked); } .pboard .st.blocked::before { background: var(--blocked); border-radius: 2px; }
.pboard .st.done { color: var(--build); } .pboard .st.done::before { background: var(--build); }
.pboard .code { font-family: var(--f-mono); font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; white-space: nowrap; }
.pboard .date { font-family: var(--f-mono); font-size: 12px; color: var(--ink); white-space: nowrap; }
.pboard .date.soon { color: var(--blocked); font-weight: 500; }

/* Cards */
.pboard .card { display: grid; gap: 6px; text-align: left; width: 100%; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 8px; padding: 10px 12px; box-shadow: var(--shadow); min-width: 0; }
.pboard .card:hover { border-color: var(--accent); border-left-color: inherit; }
.pboard .card.find { border-left-color: var(--find); } .pboard .card.decide { border-left-color: var(--decide); } .pboard .card.build { border-left-color: var(--build); } .pboard .card.do { border-left-color: var(--do); }
.pboard .card.fork { border-left-style: dashed; }
.pboard .card.isblocked { background: var(--surface-2); }
.pboard .card.isdone { opacity: .62; }
.pboard .card .t { font-weight: 600; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.pboard .card .meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 12px; color: var(--muted); }
.pboard .card .who { color: var(--muted); }
.pboard .card .links { font-size: 12px; color: var(--muted); }
.pboard .card .links b { color: var(--ink); font-weight: 600; }

/* Next up */
.pboard .groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; align-items: start; }
.pboard .group { display: grid; gap: 8px; min-width: 0; }
.pboard .gh { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; border-bottom: 2px solid var(--ink); padding-bottom: 4px; }
.pboard .gh h3 { font-family: var(--f-display); font-weight: 700; font-size: 20px; margin: 0; letter-spacing: .02em; }
.pboard .gh span { font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
/* Done recently: finished cards folded under Next up, newest first. */
.pboard .done-fold { margin-top: 28px; }
.pboard .done-fold > summary { cursor: pointer; list-style: none; }
.pboard .done-fold > summary::-webkit-details-marker { display: none; }
.pboard .done-fold > summary h3::before { content: "▸ "; }
.pboard .done-fold[open] > summary h3::before { content: "▾ "; }
.pboard .done-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 10px 16px; }
.pboard .done-list li { display: grid; gap: 3px; min-width: 0; }
.pboard .done-list .mini.isdone { opacity: 1; }
.pboard .done-when { font-size: 12px; color: var(--muted); }
.pboard .done-decision { font-size: 12px; overflow-wrap: anywhere; }
.pboard .done-fold .btn-s { margin-top: 10px; }
.pboard .toolbar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.pboard .toolbar label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.pboard .toolbar select, .pboard .toolbar input[type="search"] { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; min-width: 0; max-width: 100%; }
.pboard .toolbar input[type="search"] { width: 220px; }
.pboard .seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); }
.pboard .seg button { border: 0; background: none; padding: 6px 10px; font-size: 13px; color: var(--muted); }
.pboard .seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }

/* Chains */
.pboard .chains { display: grid; gap: 18px; }
.pboard .chain { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 12px; min-width: 0; }
.pboard .chain-h { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline; }
.pboard .chain-h h3 { font-family: var(--f-display); font-weight: 700; font-size: 22px; margin: 0; letter-spacing: .01em; }
.pboard .chain-h p { margin: 0; color: var(--muted); max-width: 75ch; grid-column: 1 / -1; }
.pboard .chain-h .prog { font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.pboard .lanes { display: grid; grid-template-columns: 1.15fr 1fr 1fr .62fr; gap: 0; }
.pboard .lanes.no-deliv { grid-template-columns: 1.15fr 1fr 1fr; }
.pboard .lane { display: grid; gap: 8px; align-content: start; padding: 0 22px 0 0; position: relative; min-width: 0; }
.pboard .lane + .lane { padding-left: 4px; }
.pboard .lane:not(:last-child)::after { content: ""; position: absolute; right: 6px; top: 34px; width: 10px; height: 10px; border-top: 2px solid var(--faint); border-right: 2px solid var(--faint); transform: rotate(45deg); }
.pboard .lane h4 { margin: 0; font-family: var(--f-display); font-weight: 600; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pboard .lane.find h4 { color: var(--find); } .pboard .lane.decide h4 { color: var(--decide); } .pboard .lane.build h4 { color: var(--build); }
.pboard .lane .empty { font-size: 12px; color: var(--faint); font-style: italic; }
.pboard .mini { display: grid; gap: 3px; text-align: left; width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; min-width: 0; }
.pboard .mini:hover { border-color: var(--accent); }
.pboard .mini .t { font-size: 13px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.pboard .mini .meta { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 12px; color: var(--muted); align-items: center; }
.pboard .mini.isdone { opacity: .6; }
.pboard .deliv { display: grid; gap: 3px; border: 2px solid var(--ink); border-radius: 6px; padding: 7px 9px; background: var(--surface); text-align: left; width: 100%; }
.pboard .deliv b { font-family: var(--f-mono); font-size: 12px; font-weight: 500; }
.pboard .deliv span { font-size: 13px; font-weight: 600; line-height: 1.3; }
.pboard .deliv em { font-style: normal; font-size: 12px; color: var(--muted); }

/* Board */
.pboard .cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
.pboard .col { display: grid; gap: 8px; min-width: 0; }
.pboard .col-h { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 4px; border-bottom: 3px solid var(--line); }
.pboard .col-h h3 { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: 19px; letter-spacing: .03em; text-transform: uppercase; }
.pboard .col-h span { font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.pboard .col.find .col-h { border-color: var(--find); } .pboard .col.find h3 { color: var(--find); }
.pboard .col.decide .col-h { border-color: var(--decide); } .pboard .col.decide h3 { color: var(--decide); }
.pboard .col.build .col-h { border-color: var(--build); } .pboard .col.build h3 { color: var(--build); }
.pboard .col.do .col-h { border-color: var(--do); } .pboard .col.do h3 { color: var(--do); }
.pboard .col .sub { font-size: 12px; color: var(--muted); margin: -2px 0 2px; }
.pboard .noresult { color: var(--muted); font-style: italic; padding: 12px 0; }
.pboard .fork-h { display: flex; justify-content: space-between; align-items: baseline; margin-top: 10px; padding-bottom: 3px; border-bottom: 2px dashed var(--decide); }
.pboard .fork-h b { font-family: var(--f-display); font-weight: 700; font-size: 16px; letter-spacing: .05em; text-transform: uppercase; color: var(--decide); }
.pboard .fork-h span { font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.pboard .cols.one { grid-template-columns: minmax(0, 1fr); }
.pboard .cols.one .col { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); align-items: start; }
.pboard .cols.one .col > :not(.card) { grid-column: 1 / -1; }

/* Tenders */
.pboard .tgroups { display: grid; gap: 26px; }
.pboard .tgroup { display: grid; gap: 10px; min-width: 0; }
.pboard .pkgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 14px; align-items: start; }
.pboard .pkg { display: grid; gap: 10px; align-content: start; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--line); border-radius: 10px; padding: 14px; box-shadow: var(--shadow); min-width: 0; scroll-margin-top: 130px; }
.pboard .pkg.ok { border-top-color: var(--build); }
.pboard .pkg.wait { border-top-color: var(--blocked); }
.pboard .pkg.spec { border-top-color: var(--accent); }
.pboard .pkg.hl { outline: 2px solid var(--accent); outline-offset: 2px; }
.pboard .pkg h3 { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: 22px; line-height: 1.1; letter-spacing: .01em; text-wrap: balance; }
.pboard .pkg h4 { margin: 4px 0 0; font-family: var(--f-display); font-weight: 600; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pboard .pkg ul { margin: 0; padding-left: 18px; display: grid; gap: 3px; font-size: 13px; }
.pboard .pkg .pnote { margin: 0; font-size: 13px; color: var(--muted); }
.pboard .pkg .list { display: grid; gap: 6px; }
.pboard .pkg-meta { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.pboard .kind { font-family: var(--f-display); font-weight: 600; font-size: 13px; letter-spacing: .05em; text-transform: uppercase; padding: 1px 7px; border-radius: 4px; background: var(--ink); color: var(--surface); line-height: 1.5; }
.pboard .tt { font-size: 12px; font-weight: 600; color: var(--ink); border: 1px solid var(--line); border-radius: 4px; padding: 1px 7px; background: var(--surface-2); }
.pboard .readiness { font-size: 13px; border-radius: 6px; padding: 7px 10px; }
.pboard .readiness b { font-weight: 700; }
.pboard .readiness.ok { background: var(--build-bg); color: var(--build); }
.pboard .readiness.wait { background: var(--blocked-bg); color: var(--ink); }
.pboard .readiness.wait b { color: var(--blocked); }
.pboard .pkg .feeds { font-size: 12px; color: var(--muted); }
.pboard .pkg .feeds b { color: var(--ink); font-weight: 600; }
.pboard .mini .opts { display: flex; flex-wrap: wrap; gap: 4px; }
.pboard .mini .opts span { font-size: 12px; border: 1px dashed var(--decide); border-radius: 4px; padding: 0 6px; color: var(--ink); background: var(--surface); }
.pboard .mini .opts span.pref { border-style: solid; border-color: var(--build); background: var(--build-bg); font-weight: 600; }
.pboard .mini .fo { font-size: 12px; color: var(--muted); }
.pboard .mini .fo b { color: var(--ink); font-weight: 600; }
.pboard .sheet li.pref { font-weight: 600; }
.pboard .sheet li.pref em { font-style: normal; font-weight: 500; color: var(--build); }
.pboard .pkg details summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.pboard .pkg details[open] summary { margin-bottom: 6px; }
.pboard .pkg .assume { font-size: 13px; margin: 0; padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }
.pboard .rule { display: flex; flex-wrap: wrap; gap: 8px; }
.pboard .rule span { font-size: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; color: var(--ink); }

/* Map */
.pboard .zones { display: grid; gap: 22px; }
.pboard .zone h3 { font-family: var(--f-display); font-weight: 700; font-size: 22px; margin: 0 0 8px; display: flex; gap: 10px; align-items: baseline; }
.pboard .zone h3 .zl { font-family: var(--f-mono); font-size: 13px; font-weight: 500; color: var(--surface); background: var(--ink); border-radius: 4px; padding: 1px 7px; }
.pboard .tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 10px; }
.pboard .tile { display: grid; gap: 8px; align-content: start; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; min-width: 0; }
.pboard .tile:hover { border-color: var(--accent); }
.pboard .tile .hd { display: flex; gap: 8px; align-items: baseline; }
.pboard .tile .hd b { font-family: var(--f-display); font-size: 18px; font-weight: 700; line-height: 1.1; }
.pboard .tile p { margin: 0; font-size: 13px; color: var(--muted); }
.pboard .bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--surface-2); }
.pboard .bar i { display: block; height: 100%; }
.pboard .bar .f { background: var(--find); } .pboard .bar .d { background: var(--decide); } .pboard .bar .b { background: var(--build); } .pboard .bar .o { background: var(--do); }
.pboard .tile .cnt { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pboard .tile .cnt span b { color: var(--ink); }
.pboard .dtable { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.pboard .dtable th, .pboard .dtable td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 13px; }
.pboard .dtable th { font-family: var(--f-display); font-weight: 600; font-size: 14px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.pboard .dtable tr:last-child td { border-bottom: 0; }
.pboard .tscroll { overflow-x: auto; }

/* Side sheet */
.pboard .scrim { position: fixed; inset: var(--pboard-host-top) 0 0 0; background: rgba(8, 14, 18, .38); z-index: 20; }
.pboard .sheet { position: fixed; z-index: 21; top: var(--pboard-host-top); right: 0; bottom: 0; width: min(520px, 100%); background: var(--surface); border-left: 1px solid var(--line); box-shadow: -8px 0 30px rgba(0,0,0,.18); overflow-y: auto; padding: calc(16px + env(safe-area-inset-top, 0px)) max(18px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) 18px; display: grid; gap: 14px; align-content: start; }
.pboard .sheet h2 { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: 25px; line-height: 1.1; text-wrap: balance; }
.pboard .sheet .row { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: flex-end; }
.pboard .row-field { display: grid; gap: 2px; justify-items: start; }
.pboard .row-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pboard .sheet .kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; font-size: 13px; }
.pboard .sheet .kv dt { color: var(--muted); }
.pboard .sheet .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.pboard .sheet h4 { margin: 4px 0 0; font-family: var(--f-display); font-weight: 600; font-size: 15px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.pboard .sheet ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.pboard .sheet .note { margin: 0; white-space: pre-line; }
.pboard .sheet .linklist { display: grid; gap: 6px; }
.pboard .close { justify-self: end; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; }
.pboard .flag { border-left: 3px solid var(--decide); background: var(--decide-bg); padding: 6px 10px; border-radius: 4px; font-size: 13px; }

@media (max-width: 980px) {
  .pboard .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pboard .lanes, .pboard .lanes.no-deliv { grid-template-columns: 1fr; gap: 6px; }
  .pboard .lane { padding: 0 0 22px 0; }
  .pboard .lane + .lane { padding-left: 0; }
  .pboard .lane:not(:last-child)::after { right: auto; left: 50%; top: auto; bottom: 6px; transform: translateX(-50%) rotate(135deg); }
}
@media (max-width: 600px) {
  .pboard .cols { grid-template-columns: 1fr; }
  .pboard h1 { font-size: 24px; }
  .pboard .toolbar input[type="search"] { width: 100%; }
}
@media (prefers-reduced-motion: no-preference) {
  .pboard .card, .pboard .mini, .pboard .tile { transition: border-color .12s ease; }
}

/* ---------- App additions (not on the reference page) ---------- */

.pboard .asof form.account { display: inline; }
.pboard .linkbtn { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; font-size: 13px; min-height: 0; }
.pboard .auth { min-height: 100vh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-left, 0px)); }
.pboard .auth-box { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px; display: grid; gap: 14px; box-shadow: var(--shadow); }
.pboard .auth-box p { margin: 0; color: var(--muted); }
.pboard .auth-box label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.pboard .auth-box input { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px; font-size: 15px; min-height: 40px; }
.pboard .btn { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 6px; padding: 9px 14px; font-weight: 600; min-height: 40px; }
.pboard .err { color: var(--blocked); font-size: 13px; margin: 0; }
.pboard .projlist { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pboard .projlist a { display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); text-decoration: none; background: var(--surface-2); font-weight: 600; }
.pboard .projlist a:hover { border-color: var(--accent); }
.pboard .sheet .checklist { list-style: none; padding-left: 0; }
.pboard .sheet .checklist li.checked { color: var(--muted); text-decoration: line-through; }

/* ---------- Editing (M1). Only shown to roles that may edit. ---------- */
.pboard .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.pboard .muted { color: var(--muted); }
.pboard .st.archived { color: var(--faint); }
.pboard .st.archived::before { background: transparent; border: 2px dashed var(--faint); box-sizing: border-box; }

/* In-place text */
.pboard .ed { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; text-align: inherit; letter-spacing: inherit; line-height: inherit; text-transform: inherit; cursor: text; border-radius: 3px; display: inline; overflow-wrap: anywhere; white-space: inherit; }
.pboard .ed:hover { background: var(--surface-2); box-shadow: 0 0 0 3px var(--surface-2); }
/* The pencil is drawn by CSS so it is never part of the text. */
.pboard .ed::after { content: "\270E" / ""; display: inline-block; margin-left: 6px; font-size: 12px; font-weight: 400; font-style: normal; color: var(--faint); opacity: 0; vertical-align: middle; text-transform: none; }
.pboard .ed:hover::after, .pboard .ed:focus-visible::after { opacity: 1; }
.pboard .ed.empty { color: var(--faint); font-style: italic; }
.pboard .ed-input { width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--accent); border-radius: 6px; padding: 6px 8px; min-height: 36px; text-transform: none; letter-spacing: normal; }
.pboard textarea.ed-input { resize: vertical; line-height: 1.45; field-sizing: content; min-height: 4.5em; font-size: 14px; font-family: var(--f-body); font-weight: 400; }
.pboard .sheet h2 .ed-input { font-size: 22px; }
.pboard .dash-warn { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; font-family: var(--f-body); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--decide); margin-left: 8px; }

/* Buttons */
.pboard .btn-s { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; font-size: 13px; min-height: 30px; }
.pboard .btn-s:hover { border-color: var(--accent); }
.pboard .btn-s.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.pboard .btn-s.danger { color: var(--blocked); border-color: var(--blocked); background: var(--surface); }
.pboard .btn-s:disabled { opacity: .5; cursor: default; }
.pboard .new-card { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 6px; padding: 5px 12px; font-weight: 600; font-size: 13px; min-height: 32px; }
.pboard .plus { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 8px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: 600 15px/1 var(--f-body); letter-spacing: 0; vertical-align: middle; }
.pboard .plus:hover { color: var(--accent); border-color: var(--accent); }
.pboard .plus-row { justify-self: start; background: none; border: 1px dashed var(--line); border-radius: 6px; padding: 5px 10px; color: var(--muted); font-size: 13px; text-align: left; }
.pboard .plus-row:hover { border-color: var(--accent); color: var(--accent); }
.pboard .plus-inline { color: var(--muted); font-size: 13px; }
.pboard .x { background: none; border: 0; color: var(--faint); font-size: 16px; line-height: 1; padding: 2px 6px; border-radius: 4px; }
.pboard .x:hover { color: var(--blocked); background: var(--blocked-bg); }
.pboard .handle { background: none; border: 0; color: var(--faint); cursor: grab; padding: 2px 3px; font-size: 12px; letter-spacing: -2px; touch-action: none; }
.pboard .moves { display: inline-flex; gap: 0; opacity: 0; }
.pboard .srow:hover .moves, .pboard .srow:focus-within .moves { opacity: 1; }
.pboard .mv { background: none; border: 0; color: var(--faint); padding: 2px 4px; font-size: 12px; }
.pboard .mv:disabled { visibility: hidden; }
.pboard .srow.dragging { opacity: .85; }

/* Pickers and popovers */
.pboard .pick-wrap { position: relative; display: inline-block; }
.pboard .pick-wrap.block { display: block; }
.pboard .pick-btn { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; text-align: left; border-radius: 4px; cursor: pointer; }
.pboard .pick-btn:hover { box-shadow: 0 0 0 3px var(--surface-2); background: var(--surface-2); }
.pboard .pick-wrap.block .pick-btn { display: block; width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: var(--surface); }
.pboard .pop { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; min-width: 260px; max-width: min(360px, calc(100vw - 32px)); display: grid; gap: 8px; padding: 10px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.18); font: 400 14px/1.4 var(--f-body); letter-spacing: 0; text-transform: none; text-align: left; }
.pboard .pop-search { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; background: var(--surface); min-height: 36px; }
.pboard .pop-list { display: grid; max-height: 280px; overflow-y: auto; }
.pboard .pop-opt { display: grid; grid-template-columns: 16px auto 1fr auto; align-items: center; gap: 6px; text-align: left; background: none; border: 0; border-radius: 5px; padding: 6px 6px; min-height: 34px; }
.pboard .pop-opt.active { background: var(--surface-2); }
.pboard .pop-opt .tick { color: var(--accent); font-weight: 700; }
.pboard .pop-opt .pl { overflow-wrap: anywhere; }
.pboard .pop-opt .ph { font-family: var(--f-mono); font-size: 11px; color: var(--faint); }
.pboard .pop-opt:not(:has(.swatch)) { grid-template-columns: 16px 1fr auto; }
.pboard .swatch { width: 10px; height: 10px; border-radius: 50%; }
.pboard .pop-empty { color: var(--muted); font-size: 13px; padding: 4px 6px; }
.pboard .pop-foot { display: flex; justify-content: flex-end; gap: 8px; }
.pboard .pop-field { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.pboard .pop-field input, .pboard .pop-field select, .pboard .pop-field textarea, .pboard .opt-row input:not([type="color"]) { border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; background: var(--surface); color: var(--ink); min-height: 36px; font-size: 14px; }
.pboard .pop-check { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.pboard .kinds { border: 0; padding: 0; margin: 0; display: grid; gap: 4px; }
.pboard .kinds legend { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.pboard .kinds label { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; align-items: baseline; padding: 5px 6px; border-radius: 6px; cursor: pointer; }
.pboard .kinds label.on { background: var(--surface-2); }
.pboard .kinds label span { grid-column: 2; font-size: 12px; color: var(--muted); }
.pboard .add-section { position: relative; }

/* Dialogs */
.pboard .dlg-scrim { position: fixed; inset: 0; z-index: 50; background: rgba(8, 14, 18, .45); display: grid; place-items: center; padding: 16px; }
.pboard .dlg { width: min(460px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.3); display: grid; }
.pboard .dlg.wide { width: min(620px, 100%); }
.pboard .dlg.full { width: min(1180px, 100%); }
.pboard .dlg-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px 6px; }
.pboard .dlg-h h3 { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: 22px; line-height: 1.1; }
.pboard .dlg-x { background: none; border: 0; font-size: 22px; color: var(--muted); min-width: 32px; min-height: 32px; }
.pboard .dlg-b { display: grid; gap: 12px; padding: 8px 16px 12px; }
.pboard .dlg-b p { margin: 0; }
.pboard .dlg-f { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px 14px; border-top: 1px solid var(--line); }
.pboard .dlg .seg { justify-self: start; }
.pboard .seg-field { border: 0; padding: 0; margin: 0; display: grid; gap: 4px; }
.pboard .seg-field legend { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.pboard .row2 { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.pboard .opt-list { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: grid; gap: 6px; }
.pboard .opt-list legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
.pboard .opt-row { display: grid; grid-template-columns: 36px 1fr auto; gap: 6px; align-items: center; }
.pboard .opt-row input[type="color"] { width: 36px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; }
.pboard .cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pboard .cmp > div { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--surface-2); }
.pboard .cmp h5 { margin: 0 0 4px; font-family: var(--f-display); font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pboard .cmp p { white-space: pre-line; overflow-wrap: anywhere; }
.pboard .conn-list { margin: 0; padding-left: 20px; display: grid; gap: 12px; }
.pboard .conn-list li { display: grid; gap: 4px; }
.pboard .conn-list li.answered::marker { color: var(--build); }

/* Toast */
.pboard .toasts { position: fixed; z-index: 60; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px); }
.pboard .toast { display: flex; gap: 12px; align-items: center; background: var(--ink); color: var(--surface); border-radius: 8px; padding: 8px 8px 8px 14px; box-shadow: 0 6px 20px rgba(0,0,0,.25); font-size: 14px; }
.pboard .toast.error { background: var(--blocked); color: #fff; }
.pboard .toast-btn { background: none; border: 1px solid currentColor; color: inherit; border-radius: 5px; padding: 3px 10px; font-weight: 600; min-height: 30px; }
.pboard .toast-x { background: none; border: 0; color: inherit; opacity: .7; font-size: 18px; min-width: 30px; min-height: 30px; }

/* Cards: quick status and Done tick (Next up), drag between Board columns */
.pboard .cardwrap { position: relative; min-width: 0; display: grid; }
.pboard .quick { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .1s ease; }
.pboard .cardwrap:hover .quick, .pboard .cardwrap:focus-within .quick { opacity: 1; }
.pboard .quick .pick-btn, .pboard .q-done { display: grid; place-items: center; min-width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--muted); font-size: 14px; }
.pboard .q-done:hover { color: var(--build); border-color: var(--build); background: var(--build-bg); }
.pboard .quick .pop { left: auto; right: 0; }
.pboard .dragwrap { min-width: 0; display: grid; touch-action: manipulation; }
.pboard .dragwrap.dragging { position: relative; z-index: 10; opacity: .9; }
.pboard .dragwrap.dragging .card { box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.pboard .col.drop-over { outline: 2px dashed var(--accent); outline-offset: 4px; border-radius: 6px; }
.pboard .tilewrap { position: relative; display: grid; min-width: 0; }
.pboard .tilewrap > .plus { position: absolute; top: 8px; right: 8px; margin: 0; }
.pboard .tilewrap > .tile { padding-right: 38px; }
.pboard .fchip { font-size: 11px; font-weight: 600; border: 1px solid var(--line); border-radius: 10px; padding: 0 7px; line-height: 1.6; white-space: nowrap; }
.pboard .fchip.plain { font-weight: 500; color: var(--muted); }

/* Card sheet */
.pboard .fork-toggle { font-family: var(--f-display); font-weight: 600; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); border: 1px dashed var(--line); background: none; border-radius: 4px; padding: 1px 6px; line-height: 1.5; }
.pboard .fork-toggle.on { color: var(--decide); border-color: var(--decide); background: var(--decide-bg); }
.pboard .sheet .kv .kv-row { display: contents; }
.pboard .who-edit { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pboard .who-edit .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pboard .pchip { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 14px; padding: 1px 2px 1px 4px; background: var(--surface-2); font-size: 13px; }
.pboard .pchip .x { font-size: 14px; padding: 0 4px; }
.pboard .linkrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px; align-items: center; }
.pboard .chainlist li { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pboard .lane-tag { display: inline-flex; align-items: center; font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 0 0 6px; }
.pboard .sec-list { display: grid; gap: 14px; }
.pboard .sec { display: grid; gap: 6px; }
.pboard .sec-h { display: flex; align-items: center; gap: 4px; }
.pboard .sec-h h4 { margin: 0; flex: 1; }
.pboard .sec .note { white-space: pre-line; }
.pboard .entry-list { display: grid; gap: 2px; }
.pboard .entry { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; font-size: 14px; min-height: 30px; }
.pboard .entry .etext { flex: 1 1 200px; }
.pboard .entry .etext + * { margin-left: auto; }
.pboard .entry .bullet { color: var(--faint); padding: 0 2px; }
.pboard .entry.pref .etext { font-weight: 600; }
.pboard .entry.checked .etext { color: var(--muted); text-decoration: line-through; }
.pboard .etext { display: grid; gap: 2px; min-width: 0; }
.pboard .eurl { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: baseline; min-width: 0; overflow-wrap: anywhere; }
.pboard .open-link { color: var(--accent); text-decoration: none; margin-left: 6px; }
.pboard .likely-btn { font-size: 11px; border: 1px dashed var(--line); border-radius: 10px; background: none; color: var(--faint); padding: 0 8px; min-height: 22px; }
.pboard .likely-btn.on { border-style: solid; border-color: var(--build); background: var(--build-bg); color: var(--build); font-weight: 600; }
.pboard .likely-tag { font-style: normal; color: var(--build); font-size: 13px; }
.pboard .likely-note { margin: 0; font-size: 13px; color: var(--muted); }
.pboard .entry-new { display: flex; gap: 6px; flex-wrap: wrap; }
.pboard .entry-new input { flex: 1 1 160px; min-width: 0; border: 1px dashed var(--line); border-radius: 6px; padding: 6px 8px; background: var(--surface); color: var(--ink); min-height: 34px; font-size: 14px; }
.pboard .entry-new input:focus { border-style: solid; }
.pboard .field-date { border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; background: var(--surface); color: var(--ink); }
.pboard .history summary { cursor: pointer; font-family: var(--f-display); font-weight: 600; font-size: 15px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.pboard .hist { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.pboard .hist li { display: grid; gap: 2px; font-size: 13px; border-left: 2px solid var(--line); padding-left: 10px; }
.pboard .hmeta { color: var(--faint); font-size: 12px; }
.pboard .hwhat { overflow-wrap: anywhere; }
.pboard .hist .linkbtn { justify-self: start; font-size: 12px; }
.pboard .sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.pboard .archived-flag { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; border-left-color: var(--faint); background: var(--surface-2); }
.pboard .date-btn .date.muted { color: var(--faint); font-style: italic; }

@media (hover: none) {
  .pboard .ed::after, .pboard .moves { opacity: .7; }
  .pboard .quick { opacity: 1; }
}
@media (pointer: coarse) {
  .pboard .x, .pboard .mv, .pboard .handle, .pboard .plus, .pboard .btn-s, .pboard .q-done, .pboard .quick .pick-btn, .pboard .likely-btn, .pboard .toast-btn, .pboard .new-card, .pboard .plus-row { min-height: 40px; min-width: 40px; }
  /* Header buttons stay one height on touch screens too. */
  .pboard .head-actions .hbtn { min-height: 42px; }
  .pboard .head-actions .lang-switch button { min-height: 40px; }
  .pboard .head-actions .bell-btn, .pboard .head-actions .versions-btn { width: 42px; height: 42px; }
  .pboard .plus { width: 40px; height: 40px; }
}
@media (max-width: 600px) {
  .pboard .sheet { width: 100%; border-left: 0; }
  .pboard .cmp { grid-template-columns: 1fr; }
}

/* ---------- Structure editing (M2). Only shown to roles that may edit. ---------- */
.pboard .head-actions { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-left: auto; }
.pboard .head-actions > * { white-space: nowrap; }
/* Header buttons (Ivo, after M7): the text ones share one width, the icon ones one square, all one height. */
.pboard .head-actions .hbtn { display: inline-flex; align-items: center; justify-content: center; width: 150px; min-height: 34px; padding: 4px 10px; overflow: hidden; text-overflow: ellipsis; text-decoration: none; font-size: 13px; }
.pboard .head-actions .bell-btn, .pboard .head-actions .versions-btn { width: 34px; min-width: 34px; height: 34px; min-height: 34px; padding: 0; }
.pboard .head-actions .lang-switch button { min-height: 32px; }
.pboard .titlerow h1 .ed-input { font-size: 24px; }
.pboard .rail-wrap { position: relative; display: grid; gap: 6px; }
.pboard .rail-add { display: flex; justify-content: flex-end; }
.pboard .pop-mark { top: auto; left: auto; right: 0; bottom: 36px; }
.pboard .mk.editable { cursor: grab; touch-action: none; }
.pboard .mk.editable:focus-visible { outline: none; }
.pboard .mk.editable:focus-visible i { outline: 2px solid var(--accent); outline-offset: 2px; }
.pboard .mk.editable:hover i { border-color: var(--accent); }
.pboard .pkg-actions, .pboard .chain-tools, .pboard .zone-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pboard .chain-tools { grid-column: 1 / -1; justify-content: flex-end; }
.pboard .zone-tools { margin-left: auto; font-family: var(--f-body); font-size: 13px; font-weight: 400; }
.pboard .role-list { display: grid; gap: 6px; }
.pboard .role-row { grid-template-columns: auto minmax(0, 1fr) auto; }
.pboard .row-tools { display: inline-flex; align-items: center; gap: 2px; }
.pboard .mv-role .pick-btn, .pboard .row-tools .pick-btn { display: grid; place-items: center; min-width: 26px; height: 26px; border-radius: 5px; color: var(--faint); }
.pboard .archived-list { font-size: 13px; color: var(--muted); }
.pboard .archived-list ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.pboard .lane-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 2px; align-items: center; }
.pboard .lane.drop-over, .pboard .tiles.drop-over { outline: 2px dashed var(--accent); outline-offset: 4px; border-radius: 6px; }
.pboard .tile-edit { cursor: default; }
.pboard .tile-edit:hover { border-color: var(--line); }
.pboard .tile-edit .hd { flex-wrap: wrap; }
.pboard .tile-actions { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.pboard .tile-actions .plus { margin-left: auto; }
.pboard .tile-edit.dragging { box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.pboard .add-zone { max-width: 520px; }
.pboard .dtable .ed { text-align: left; }
.pboard .settings { display: grid; gap: 14px; max-width: 1000px; }
.pboard .settings-h { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: 26px; }
/* The tabs and the box under them are one width: the tabs share the row. */
.pboard .settings .seg { display: flex; flex-wrap: wrap; }
.pboard .settings .seg button { flex: 1 1 auto; }
.pboard .settings .later { margin: 0; font-size: 13px; }
.pboard .settings-panel { display: grid; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.pboard .settings-panel h4 { margin: 4px 0 0; font-family: var(--f-display); font-weight: 600; font-size: 15px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.pboard .settings-panel p { margin: 0; }
.pboard .settings-grid { display: grid; gap: 12px; }
.pboard .set-kv { display: grid; grid-template-columns: minmax(120px, 200px) 1fr; gap: 8px 14px; margin: 0; font-size: 14px; }
.pboard .set-kv dt { color: var(--muted); }
.pboard .set-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.pboard .set-kv .kv-row { display: contents; }
.pboard .set-list { display: grid; gap: 6px; }
.pboard .set-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 6px; align-items: start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.pboard .set-main { display: grid; gap: 4px; min-width: 0; }
.pboard .field-row .opt-list { max-width: 420px; background: var(--surface); }
.pboard .danger { display: grid; gap: 10px; max-width: 520px; }
.pboard .danger .btn-s { justify-self: start; }
.pboard .sub-h { margin: 6px 0 0; font-family: var(--f-display); font-size: 18px; }
.pboard .archived-proj { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; }
@media (max-width: 600px) {
  .pboard .set-kv { grid-template-columns: 1fr; }
  .pboard .head-actions { margin-left: 0; gap: 8px; }
  /* On a phone the header (title, buttons, tabs) would take a third of the screen: it scrolls away with the page. */
  .pboard header.top { position: static; }
  .pboard .pkg, .pboard .dl { scroll-margin-top: 8px; }
  .pboard .pop-mark { left: 0; right: auto; }
}

/* ---------- People and collaboration (M3) ---------- */
.pboard .changes-btn { position: relative; background: none; border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; font-size: 13px; color: var(--ink); min-height: 32px; }
.pboard .changes-btn:hover { border-color: var(--accent); }
.pboard .badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 6px; padding: 0 5px; border-radius: 9px; background: var(--blocked); color: #fff; font: 600 11px/1 var(--f-body); }
.pboard .changes { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.pboard .changes h4 { margin: 0 0 4px; font-family: var(--f-display); font-size: 17px; }
.pboard .changes ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.pboard .changes li li { display: grid; gap: 1px; font-size: 13px; border-left: 2px solid var(--line); padding-left: 10px; }
.pboard .comments { display: grid; gap: 10px; }
.pboard .thread { display: grid; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--surface); }
.pboard .thread.resolved { background: var(--surface-2); }
.pboard .replies { display: grid; gap: 6px; margin-left: 14px; padding-left: 10px; border-left: 2px solid var(--line); }
.pboard .cmt { display: grid; gap: 2px; font-size: 14px; }
.pboard .cmt-h { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 13px; }
.pboard .cmt-b { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.pboard .cmt.deleted .cmt-b { font-style: italic; }
.pboard .cmt-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline; font-size: 12px; }
.pboard .cmt-actions .linkbtn { font-size: 12px; }
.pboard .mention { color: var(--accent); font-weight: 600; }
.pboard .composer { display: grid; gap: 6px; }
.pboard .composer-actions { display: flex; gap: 8px; justify-content: flex-end; }
.pboard .mention-wrap { position: relative; }
.pboard .mention-pop { top: 100%; }
.pboard .resolved-list summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.pboard .resolved-list[open] { display: grid; gap: 8px; }
.pboard .pkg-comments { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.pboard .pkg-comments .comments-toggle { justify-self: start; }
.pboard .invite-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.pboard .invite-form .pop-field { min-width: 160px; }
.pboard .invite-row { grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; }
.pboard .dtable.people select { border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; background: var(--surface); color: var(--ink); }

/* ---------- Languages and version history (M3b) ---------- */
.pboard .lang-switch button { padding: 4px 8px; font: 600 12px/1.2 var(--f-mono); min-height: 30px; }
.pboard .auth-lang { display: flex; justify-content: flex-end; }
.pboard .tr-busy { font-size: 12px; }
.pboard .tr-note { margin: 0; font-size: 12px; color: var(--muted); }
.pboard .tr-note .linkbtn { font-size: 12px; }
.pboard .ed-wrap { display: grid; gap: 4px; }
.pboard .ed-foot { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.pboard .ed-note { font-size: 12px; color: var(--muted); }
.pboard .lang-chip { margin-left: auto; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--muted); font: 600 11px/1 var(--f-mono); padding: 4px 6px; min-height: 24px; }
.pboard .lang-chip:hover { border-color: var(--accent); color: var(--ink); }
.pboard .versions-btn { display: inline-grid; place-items: center; background: none; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); min-width: 32px; min-height: 32px; }
.pboard .versions-btn:hover { border-color: var(--accent); }
.pboard .v-banner { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; border: 1px solid var(--decide); background: var(--decide-bg); border-radius: 8px; padding: 8px 12px; font-size: 14px; }
.pboard .vpanel { position: fixed; z-index: 22; top: var(--pboard-host-top); right: 0; bottom: 0; width: min(400px, 100%); background: var(--surface); border-left: 1px solid var(--line); box-shadow: -8px 0 30px rgba(0,0,0,.18); overflow-y: auto; padding: calc(14px + env(safe-area-inset-top, 0px)) 16px calc(20px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 10px; align-content: start; }
.pboard .vpanel:focus { outline: none; }
.pboard .vp-h { display: flex; justify-content: space-between; align-items: center; }
.pboard .vp-h h3 { margin: 0; font-family: var(--f-display); font-size: 22px; }
.pboard .vp-tabs { justify-self: start; }
.pboard .vlist { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.pboard .v-item { border: 1px solid var(--line); border-radius: 8px; }
.pboard .v-item.sel { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.pboard .v-head { display: grid; gap: 2px; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; color: var(--ink); font-size: 13px; min-height: 40px; }
.pboard .v-head:disabled { color: var(--muted); cursor: default; }
.pboard .v-when { display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: 14px; }
.pboard .v-now { font: 600 11px/1.4 var(--f-body); color: var(--accent); border: 1px solid var(--accent); border-radius: 3px; padding: 0 4px; }
.pboard .v-name { font-family: var(--f-display); font-weight: 700; font-size: 16px; color: var(--decide); }
.pboard .v-sum { color: var(--muted); }
.pboard .v-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 10px 10px; }
.pboard .v-actions h4 { flex-basis: 100%; margin: 6px 0 0; font-size: 13px; }
.pboard .v-naming { display: flex; gap: 6px; flex-basis: 100%; }
.pboard .v-naming input { flex: 1; }
.pboard .diff { flex-basis: 100%; margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 13px; }
.pboard .diff ul { margin: 4px 0 0; padding: 0 0 0 10px; list-style: none; display: grid; gap: 3px; border-left: 2px solid var(--line); }
.pboard .diff li li { overflow-wrap: anywhere; white-space: pre-line; }
.pboard .d-h { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.pboard .d-kind { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.pboard .d-label { font-weight: 600; }
.pboard .d-removed .d-label { text-decoration: line-through; color: var(--muted); }
.pboard .d-chip { font-size: 11px; border-radius: 3px; padding: 0 5px; }
.pboard .d-chip.added { color: var(--build); background: var(--build-bg); }
.pboard .d-chip.removed { color: var(--blocked); border: 1px solid var(--blocked); }
.pboard .d-chip.changed { color: var(--decide); background: var(--decide-bg); }
.pboard .diff del { color: var(--muted); }
.pboard .diff ins { text-decoration: none; color: var(--build); }
.pboard .card.v-added, .pboard .pkg.v-added, .pboard .chain.v-added { outline: 2px solid var(--build); outline-offset: 1px; }
.pboard .card.v-changed, .pboard .pkg.v-changed, .pboard .chain.v-changed { outline: 2px dashed var(--decide); outline-offset: 1px; }
.pboard .vgroups { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.pboard .vg-h { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 13px; }
.pboard .vg-h .btn-s { margin-left: auto; }
.pboard .deleted { display: grid; gap: 8px; }
.pboard .del-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.pboard .del-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 8px; align-items: center; font-size: 13px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.pboard .del-list .hmeta { grid-column: 1 / 3; }
.pboard .del-list .btn-s { grid-row: 1 / 3; grid-column: 3; }
.pboard .small { font-size: 12px; }
.pboard .terms { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.pboard .term-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto; gap: 8px; align-items: center; font-size: 14px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.pboard .term-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pboard .term-add .ed-input { flex: 1 1 160px; }
@media (max-width: 600px) {
  .pboard .term-row { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .vpanel-open .pboard header.top, .vpanel-open .pboard main { padding-right: min(400px, 100%); }
}

/* ---------- API tokens, import and export (M4) ---------- */
.pboard .import-form, .pboard .token-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.pboard .import-form .pop-field, .pboard .token-form .pop-field { min-width: 200px; }
.pboard .token-form select { border: 1px solid var(--line); border-radius: 6px; padding: 6px; background: var(--surface); color: var(--ink); }
.pboard .token-shown { display: grid; gap: 8px; border: 1px solid var(--build); background: var(--build-bg); border-radius: 8px; padding: 10px 12px; }
.pboard .token-shown p { margin: 0; }
.pboard .token-value { font: 13px/1.4 var(--f-mono); overflow-wrap: anywhere; user-select: all; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; }
.pboard .token-tools { display: flex; gap: 8px; }
.pboard .api-base { font: 12px var(--f-mono); overflow-wrap: anywhere; }
.pboard .confirm-inline { display: inline-flex; gap: 6px; }
.pboard .ok-flag { border-color: var(--build); }
.pboard .err-detail { display: block; margin-top: 4px; font: 12px/1.4 var(--f-mono); white-space: pre-wrap; }
.pboard a.btn-s { display: inline-block; justify-self: start; text-decoration: none; color: inherit; }

/* Russian pages: fonts with Cyrillic set the whole page, Latin names and codes included, so a title does not mix two typefaces. */
.pboard[lang="ru"] {
  --f-display: var(--font-display-cyr), "Fira Sans Extra Condensed", "Arial Narrow", system-ui, sans-serif;
  --f-body: var(--font-body-cyr), "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Board setup: views and new projects ---------- */
.pboard span.sum { cursor: default; }
.pboard .view-row.off .view-on b { color: var(--muted); text-decoration: line-through; }
.pboard .view-on { gap: 8px; }
.pboard .view-more summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.pboard .view-fields { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px 12px; align-items: start; margin-top: 8px; }
.pboard .lang-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pboard .lang-input { display: grid; gap: 2px; font-size: 12px; }
.pboard .lang-input textarea { resize: vertical; }
.pboard .kinds { display: flex; flex-wrap: wrap; gap: 12px; }
.pboard .view-fields .hints { margin: 0; }
@media (max-width: 600px) {
  .pboard .view-fields, .pboard .lang-inputs { grid-template-columns: 1fr; }
}
.pboard .new-project { width: min(520px, 100%); }
.pboard .new-project select { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px; font-size: 15px; min-height: 40px; color: var(--ink); }
.pboard .np-views { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.pboard .np-views legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
.pboard .np-dates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pboard .new-project-link { justify-self: start; text-decoration: none; color: inherit; }
.pboard .account-link { color: inherit; }
@media (max-width: 600px) { .pboard .np-dates { grid-template-columns: 1fr; } }
.pboard .auth-box label.pop-check { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; color: var(--ink); font-size: 14px; }
.pboard .auth-box input[type="checkbox"] { width: 16px; height: 16px; min-height: 0; padding: 0; margin: 0; }

/* ---------- Suggestions from mailboxes (M5) ---------- */
.pboard .suggestions-view { display: grid; gap: 14px; }
.pboard .suggestions-btn { text-decoration: none; display: inline-flex; align-items: center; }
.pboard .mailboxes { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--surface); }
.pboard .mailboxes h3 { margin: 0; font-family: var(--f-display); font-size: 18px; }
.pboard .mailboxes ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.pboard .mailbox { display: grid; gap: 4px; border-top: 1px solid var(--line); padding-top: 8px; }
.pboard .mb-h { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.pboard .mb-actions, .pboard .mb-connect, .pboard .mb-folders { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pboard .mb-connect a.btn-s { text-decoration: none; color: inherit; }
.pboard .sg-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.pboard .sg { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 12px 18px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 12px 14px; background: var(--surface); }
.pboard .sg.sg-new_card { border-left-color: var(--do); }
.pboard .sg.sg-status { border-left-color: var(--build); }
.pboard .sg.sg-due { border-left-color: var(--decide); }
.pboard .sg-change, .pboard .sg-message { display: grid; gap: 6px; align-content: start; min-width: 0; }
.pboard .sg-kind { justify-self: start; font: 600 11px/1.4 var(--f-body); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.pboard .sg-what, .pboard .sg-title, .pboard .sg-subject { margin: 0; }
.pboard .sg-title { font-weight: 600; }
.pboard .sg-subject { font-weight: 600; overflow-wrap: anywhere; }
.pboard .sg-quote { margin: 0; padding: 6px 10px; border-left: 3px solid var(--line); background: var(--surface-2); white-space: pre-line; overflow-wrap: anywhere; font-size: 14px; }
.pboard .sg-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.pboard .sg-message { border-left: 1px solid var(--line); padding-left: 14px; font-size: 14px; }
.pboard .sg-text summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.pboard .sg-text p { white-space: pre-line; overflow-wrap: anywhere; margin: 6px 0 0; }
.pboard .sg-edit { display: grid; gap: 8px; }
.pboard .sg-edit select { border: 1px solid var(--line); border-radius: 6px; padding: 6px; background: var(--surface); color: var(--ink); }
.pboard .sg-who { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
@media (max-width: 760px) {
  .pboard .sg { grid-template-columns: 1fr; }
  .pboard .sg-message { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 8px; }
}

/* Deliverables tab: one section per deliverable, with the work that feeds it. */
.pboard .dl { display: grid; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--ink); border-radius: 10px; padding: 14px; margin-bottom: 14px; box-shadow: var(--shadow); min-width: 0; scroll-margin-top: 130px; }
.pboard .dl.hl { outline: 2px solid var(--accent); outline-offset: 2px; }
.pboard .dl.v-added { outline: 2px solid var(--build); outline-offset: 1px; }
.pboard .dl.v-changed { outline: 2px dashed var(--decide); outline-offset: 1px; }
.pboard .dl-h { display: flex; gap: 10px; align-items: baseline; }
.pboard .dl-h h3 { margin: 0; flex: 1; font-family: var(--f-display); font-size: 22px; line-height: 1.15; min-width: 0; overflow-wrap: anywhere; }
.pboard .dl-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; font-size: 14px; }
.pboard .dl-progress { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); }
.pboard .dl-progress .bar { width: 120px; }
.pboard .dl-progress .bar i { background: var(--build); }
.pboard .dl-what, .pboard .dl-note { margin: 0; }
.pboard .dl-what { color: var(--muted); }
.pboard .dl-note { color: var(--decide); }
.pboard .dl h4 { margin: 6px 0 0; font: 600 12px/1.4 var(--f-body); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.pboard .dl .linklist { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.pboard .dl .empty { margin: 0; font-size: 13px; color: var(--faint); font-style: italic; }
.pboard .dl .chainlist { margin: 0; padding-left: 18px; }
.pboard .dl-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pboard .dl-foot { margin-top: 4px; }
/* A card's deliverables in its sheet: a click goes to the deliverable. */
.pboard .dchip { border-radius: 8px; padding: 3px 2px 3px 2px; align-items: flex-start; }
.pboard .dchip-go { background: none; border: 0; padding: 0 4px; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.pboard .dchip-go:hover { color: var(--accent); }
.pboard .dchip-due { margin-left: 6px; font-family: var(--f-mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.pboard .dchip.late { border-color: var(--blocked); }
.pboard .dchip.late .dchip-due { color: var(--blocked); font-weight: 600; }
/* Settings, Types and statuses: one row per type or status. */
.pboard .name-row { grid-template-columns: minmax(0, 1fr); }
.pboard .name-key { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
/* Settings, Import and export: the spreadsheet import. */
.pboard .data-links { display: flex; gap: 8px; flex-wrap: wrap; }
.pboard .data-links a.btn-s { text-decoration: none; color: inherit; }
.pboard .csv-help summary { cursor: pointer; color: var(--accent); font-size: 14px; }
.pboard .csv-help .kv { margin-top: 8px; }
.pboard .csv-preview { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.pboard .csv-problems ul { margin: 6px 0 0; padding-left: 18px; }
.pboard .csv-rows tr[data-action="same"] td { color: var(--muted); }
/* A tender's two dates: when it goes out, and when answers are due. */
.pboard .pkg-dates { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; align-items: center; }
.pboard .pkg-dates label { display: inline-flex; gap: 6px; align-items: center; }
/* A tab's own dates on its timeline: open what they stand for on a click. */
.pboard .mk.view { cursor: pointer; }
.pboard .mk.view:focus-visible { outline: none; }
.pboard .mk.view:focus-visible i, .pboard .mk.view:hover i { border-color: var(--accent); }
.pboard .mk.mk-deliv i { border-radius: 3px; }
.pboard .mk.mk-out i { border-color: var(--build); }
.pboard .mk.mk-answers i { border-color: var(--decide); }
.pboard .mk.mk-pay i { border-color: var(--accent); }
.pboard .rail-empty { margin: 4px 0 0; font-size: 12px; }
.pboard .pop-list-marks { display: grid; gap: 6px; max-width: 320px; }
/* The header's status bar: the project's start and end, today on the bar, the days left. */
.pboard .head-info { display: grid; gap: 4px; }
.pboard .pstatus { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12px; color: var(--muted); }
.pboard .ps-date { font-family: var(--f-mono); color: var(--ink); }
.pboard .ps-bar { position: relative; flex: 0 1 200px; min-width: 90px; height: 6px; border-radius: 3px; background: var(--line); }
.pboard .ps-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--accent); }
.pboard .ps-bar b { position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); transform: translate(-50%, -50%); }
.pboard .ps-bar.over i, .pboard .ps-bar.over b { background: var(--blocked); }
.pboard .ps-info b { color: var(--ink); font-weight: 600; }
/* Ask (spec 11): a side panel like version history; answers link their cards. */
.pboard .ask-turns { display: grid; gap: 14px; }
.pboard .ask-turn { display: grid; gap: 6px; }
.pboard .ask-q { margin: 0; justify-self: end; max-width: 90%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px 10px 2px 10px; padding: 6px 10px; white-space: pre-line; overflow-wrap: anywhere; }
.pboard .ask-a { margin: 0; white-space: pre-line; overflow-wrap: anywhere; line-height: 1.45; }
.pboard .ask-ref { display: inline; font: 500 12px/1.2 var(--f-mono); color: var(--accent); background: none; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; margin: 0 1px; cursor: pointer; }
.pboard .ask-ref:hover { border-color: var(--accent); }
.pboard .ask-cards, .pboard .ask-examples { display: grid; gap: 6px; justify-items: start; }
.pboard .ask-form { display: grid; gap: 6px; position: sticky; bottom: 0; background: var(--surface); padding-top: 8px; }
.pboard .ask-form textarea { width: 100%; resize: vertical; }
.pboard .ask-actions { display: flex; justify-content: space-between; align-items: center; }
/* Drafting help on a card. */
.pboard .add-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.pboard .draft-preview { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.pboard .draft-preview textarea { width: 100%; resize: vertical; }
/* A card opened while a side panel (Ask, versions) is open: beside it, not under it. */
@media (min-width: 1000px) {
  .vpanel-open .pboard .sheet { right: 400px; }
}

/* Tenders: filters, compact rows and the tender sheet */
.pboard .tender-tools { justify-content: space-between; align-items: flex-start; }
.pboard .tender-tools > .toolbar { flex: 1 1 auto; min-width: 0; }
.pboard .tender-tools select { max-width: 190px; }
.pboard .tlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pboard .trow { width: 100%; text-align: left; display: grid; grid-template-columns: minmax(0, 1fr) 170px 250px 110px; gap: 4px 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-left-width: 4px; border-radius: 8px; padding: 9px 12px; color: var(--ink); font: inherit; cursor: pointer; scroll-margin-top: 130px; }
.pboard .trow:hover { border-color: var(--accent); }
.pboard .trow.ok { border-left-color: var(--build); }
.pboard .trow.wait { border-left-color: var(--blocked); }
.pboard .trow.spec { border-left-color: var(--accent); }
.pboard .trow.hl { outline: 2px solid var(--accent); outline-offset: 2px; }
.pboard .trow.v-added { outline: 2px solid var(--build); outline-offset: 1px; }
.pboard .trow.v-changed { outline: 2px dashed var(--decide); outline-offset: 1px; }
.pboard .tr-what { display: grid; gap: 2px; min-width: 0; }
.pboard .tr-name { font-weight: 600; overflow-wrap: anywhere; }
.pboard .tr-meta, .pboard .tr-dates, .pboard .tr-feeds { font-size: 12px; color: var(--muted); }
.pboard .tr-ready { font-size: 12px; font-weight: 600; }
.pboard .tr-ready.ok { color: var(--build); }
.pboard .tr-ready.wait { color: var(--blocked); }
.pboard .tr-dates { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.pboard .tr-dates b { color: var(--ink); font-weight: 600; }
.pboard .tender-sheet .pkg { border: 0; border-top: 4px solid var(--line); border-radius: 0; box-shadow: none; padding: 10px 0 0; }
.pboard .tender-sheet .pkg.ok { border-top-color: var(--build); }
.pboard .tender-sheet .pkg.wait { border-top-color: var(--blocked); }
.pboard .tender-sheet .pkg.spec { border-top-color: var(--accent); }
.pboard .tender-sheet .pkg h2 { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: 25px; line-height: 1.1; text-wrap: balance; }
.pboard .tf-more { display: contents; }
.pboard .tf-toggle { display: none; }
@media (max-width: 860px) {
  .pboard .trow { grid-template-columns: minmax(0, 1fr) auto; }
  .pboard .tr-dates { grid-column: 1; }
  .pboard .tr-feeds { grid-column: 2; text-align: right; }
}
@media (max-width: 600px) {
  .pboard .tf-toggle { display: inline-flex; }
  .pboard .tender-tools .toolbar:not(.open) .tf-more { display: none; }
  .pboard .tender-tools input[type="search"] { width: auto; flex: 1 1 140px; }
}

/* What changed: a bell with the number of changes since your last visit */
.pboard .bell-btn { display: inline-grid; grid-auto-flow: column; place-items: center; gap: 0; min-width: 32px; padding: 4px 7px; }
.pboard .bell-btn .badge { position: absolute; top: -7px; right: -8px; margin: 0; box-shadow: 0 0 0 2px var(--surface); }
.pboard .bell-btn.has-news { border-color: var(--blocked); color: var(--blocked); }

/* Money (M7): offers on a tender, suppliers, the budget. Editors and up. */
.pboard .money-box { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.pboard .money-box .est { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.pboard input.amount, .pboard select.cur { border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; background: var(--surface); color: var(--ink); min-height: 30px; font: inherit; font-size: 13px; }
.pboard input.amount { width: 120px; text-align: right; font-variant-numeric: tabular-nums; }
.pboard input.amount.small { width: 80px; }
.pboard .offers { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pboard .offer { border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 8px; background: var(--surface); }
.pboard .offer.st-chosen { border-left-color: var(--build); }
.pboard .offer.st-shortlisted { border-left-color: var(--decide); }
.pboard .offer.st-declined { opacity: .7; }
.pboard .offer summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 8px 10px; cursor: pointer; font-size: 13px; }
.pboard .offer .of-who { font-weight: 600; flex: 1 1 140px; min-width: 0; overflow-wrap: anywhere; }
.pboard .offer .of-amount { font-variant-numeric: tabular-nums; font-weight: 600; }
.pboard .chip.of-st, .pboard .chip.of-low { font-size: 11px; border-radius: 10px; padding: 1px 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); }
.pboard .chip.of-st.chosen { background: var(--build-bg); color: var(--build); border-color: transparent; }
.pboard .chip.of-st.shortlisted { background: var(--decide-bg); color: var(--ink); border-color: transparent; }
.pboard .chip.of-st.declined { text-decoration: line-through; }
.pboard .chip.of-low { color: var(--accent); border-color: var(--accent); background: none; }
.pboard .offer-body { display: grid; gap: 10px; padding: 4px 10px 10px; }
.pboard .offer-body .kv { grid-template-columns: 100px 1fr; display: grid; gap: 6px 10px; font-size: 13px; margin: 0; align-items: center; }
.pboard .offer-body .kv dt { color: var(--muted); }
.pboard .offer-body .kv dd { margin: 0; min-width: 0; }
.pboard .offer-body h5, .pboard .offer-new h5 { margin: 0; font-family: var(--f-display); font-weight: 600; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pboard .of-files ul, .pboard .pay-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.pboard .of-files, .pboard .of-pay { display: grid; gap: 6px; }
.pboard .file-btn { justify-self: start; position: relative; cursor: pointer; display: inline-flex; align-items: center; }
.pboard .file-btn.busy { opacity: .6; }
.pboard .file-btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.pboard .pay-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "label label x" "share due paid"; gap: 4px 10px; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.pboard .pay-row .pay-label { grid-area: label; min-width: 0; }
.pboard .pay-row .pay-share { grid-area: share; display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.pboard .pay-row .pay-due { grid-area: due; }
.pboard .pay-row .pay-paid { grid-area: paid; }
.pboard .pay-row .x { grid-area: x; }
.pboard .pay-row.paid .pay-label { color: var(--muted); }
.pboard .pay-due, .pboard .pay-paid { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; }
.pboard .pay-sum.off { color: var(--blocked); }
.pboard .pay-new { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pboard .pay-new input:not(.amount):not([type="date"]) { flex: 1 1 140px; min-width: 0; border: 1px dashed var(--line); border-radius: 6px; padding: 5px 8px; background: var(--surface); color: var(--ink); min-height: 30px; font-size: 13px; }
.pboard .offer-new { display: grid; gap: 8px; border: 1px dashed var(--line); border-radius: 8px; padding: 10px; }
.pboard .offer-new .row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pboard .suppliers { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 14px; align-items: start; }
.pboard .supplier { display: grid; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px; box-shadow: var(--shadow); min-width: 0; scroll-margin-top: 130px; }
.pboard .supplier h3 { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: 20px; line-height: 1.1; }
.pboard .supplier h4 { margin: 4px 0 0; font-family: var(--f-display); font-weight: 600; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pboard .supplier .kv { display: grid; grid-template-columns: 80px 1fr; gap: 4px 10px; font-size: 13px; margin: 0; }
.pboard .supplier .kv dt { color: var(--muted); }
.pboard .supplier .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.pboard .supplier .pnote { margin: 0; font-size: 13px; color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; }
.pboard .supplier .pnote.folded:not(:has(textarea)) { max-height: 8.6em; overflow: hidden; mask-image: linear-gradient(to bottom, #000 60%, transparent); }
.pboard .supplier .note-toggle { justify-self: start; margin-top: -4px; }
.pboard .supplier .btn-s { justify-self: start; }
.pboard a.ext { margin-left: 6px; text-decoration: none; }
.pboard .sup-offers { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.pboard .btiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pboard .btile { display: grid; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.pboard .btile .bt-k { font-size: 12px; color: var(--muted); }
.pboard .btile b { font-size: 20px; font-variant-numeric: tabular-nums; }
.pboard .blines, .pboard .paylist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pboard .bline { display: grid; grid-template-columns: minmax(0, 1.4fr) 150px minmax(0, 1fr) minmax(0, 1.2fr) 120px; gap: 4px 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 8px; padding: 9px 12px; font-size: 13px; }
.pboard .bline.chosen { border-left-color: var(--build); }
.pboard .bline.over .bl-chosen b { color: var(--blocked); }
.pboard .bline > span { display: grid; gap: 2px; min-width: 0; }
.pboard .bl-name { font-weight: 600; text-align: left; color: var(--ink); text-decoration: none; font-size: 14px; }
.pboard .bl-k { font-size: 11px; color: var(--muted); }
.pboard .flag-s { font-size: 11px; color: var(--blocked); }
.pboard .paylist li { display: grid; grid-template-columns: 90px minmax(0, 1fr) 160px 130px; gap: 4px 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.pboard .paylist li.late { border-color: var(--blocked); }
.pboard .paylist li.paid { opacity: .7; }
.pboard .pl-who { display: grid; gap: 2px; min-width: 0; }
.pboard .pl-amount { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.pboard .pl-paid { display: inline-flex; gap: 6px; align-items: center; }
@media (max-width: 860px) {
  .pboard .bline { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pboard .bl-what { grid-column: 1 / -1; }
  .pboard .paylist li { grid-template-columns: minmax(0, 1fr) auto; }
  .pboard .pl-who { grid-column: 1 / -1; grid-row: 1; }
  .pboard .pl-amount { text-align: left; }
  .pboard .pay-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label x" "share share" "due paid"; }
}

/* Comparing a tender's offers (M7): criteria as rows, offers as columns, scores 1 to 5. */
.pboard .cmp-open { justify-self: start; }
.pboard .chip.of-score { font-size: 11px; border-radius: 10px; padding: 1px 8px; border: 1px solid var(--line); color: var(--muted); background: var(--surface-2); }
.pboard .chip.of-score.best { background: var(--build-bg); color: var(--build); border-color: var(--build); font-weight: 600; }
.pboard .cmp-start { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.pboard .cmp-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.pboard .cmp-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
.pboard .cmp-table th, .pboard .cmp-table td { border-bottom: 1px solid var(--line); padding: 8px 10px; vertical-align: top; text-align: left; background: var(--surface); }
.pboard .cmp-table thead th { background: var(--surface-2); font-weight: 600; position: sticky; top: 0; z-index: 1; }
.pboard .cmp-table tbody th, .pboard .cmp-table tfoot th, .pboard .cmp-table thead th:first-child { position: sticky; left: 0; z-index: 2; min-width: 190px; max-width: 240px; border-right: 1px solid var(--line); }
.pboard .cmp-table thead th:first-child { z-index: 3; }
.pboard .cmp-table tfoot td, .pboard .cmp-table tfoot th { background: var(--surface-2); border-bottom: 0; }
.pboard .cmp-table .cmp-w { white-space: nowrap; width: 1%; color: var(--muted); }
.pboard .cmp-offer { min-width: 170px; }
.pboard .cmp-offer .cmp-sup { display: block; font-weight: 700; }
.pboard .cmp-offer .small { display: block; font-weight: 400; }
.pboard .cmp-table .st-declined { opacity: .55; }
.pboard .cmp-crit { display: grid; gap: 4px; }
.pboard .cmp-name { display: flex; align-items: flex-start; justify-content: space-between; gap: 4px; font-weight: 600; }
.pboard .cmp-how { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.pboard .cmp-how select { font-size: 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink); }
.pboard .cmp-cell { display: grid; gap: 4px; }
.pboard .cmp-val { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.pboard .cmp-val select { border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; background: var(--surface); color: var(--ink); min-height: 30px; }
.pboard .cmp-money { font-variant-numeric: tabular-nums; font-weight: 600; }
.pboard .cmp-note { font-size: 12px; color: var(--muted); }
.pboard .cmp-sub th, .pboard .cmp-sub td { background: var(--surface-2); padding-top: 5px; padding-bottom: 5px; }
.pboard .cmp-sub th { font-weight: 400; padding-left: 22px; }
.pboard .cmp-total { font-size: 18px; font-variant-numeric: tabular-nums; margin-right: 6px; }
.pboard .cmp-foot { display: table-cell; }
.pboard .cmp-foot .chip { margin-right: 4px; }
.pboard input.amount.tiny { width: 56px; }
.pboard .sc { display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 5px; border-radius: 11px; font: 600 11px/1 var(--f-mono); color: #fff; }
.pboard .sc-1 { background: var(--blocked); }
.pboard .sc-2 { background: color-mix(in srgb, var(--blocked) 60%, var(--decide)); }
.pboard .sc-3 { background: var(--decide); color: var(--ink); }
.pboard .sc-4 { background: color-mix(in srgb, var(--build) 70%, var(--decide)); }
.pboard .sc-5 { background: var(--build); }
.pboard .cmp-new { display: grid; gap: 6px; border-top: 1px dashed var(--line); padding-top: 10px; }
.pboard .cmp-new h5 { margin: 0; font-family: var(--f-display); font-weight: 600; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pboard .cmp-new .row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pboard .cmp-new input:not(.amount) { flex: 1 1 180px; min-width: 0; border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; background: var(--surface); color: var(--ink); min-height: 32px; }
.pboard .cmp-new input.unit { flex: 0 1 90px; }
.pboard .cmp-new select { border: 1px solid var(--line); border-radius: 6px; padding: 5px 6px; background: var(--surface); color: var(--ink); min-height: 32px; }
.pboard .cmp-weight { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; }
.pboard .money-box > .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (max-width: 600px) {
  .pboard .cmp-table tbody th, .pboard .cmp-table tfoot th, .pboard .cmp-table thead th:first-child { min-width: 118px; max-width: 140px; }
  .pboard .cmp-table th, .pboard .cmp-table td { padding: 6px 7px; }
  .pboard .cmp-offer { min-width: 150px; }
}

/* Request for quotation (M7): the email written from a tender */
.pboard .rfq-open { justify-self: start; }
.pboard .rfq-asks { display: grid; gap: 2px; font-size: 13px; white-space: pre-line; overflow-wrap: anywhere; }
.pboard .rfq-reply { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pboard .rfq-body { font: 13px/1.5 var(--f-body); min-height: 320px; resize: vertical; white-space: pre-wrap; }
.pboard .rfq-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pboard .rfq-actions a.btn-s { text-decoration: none; display: inline-flex; align-items: center; }
.pboard .rfq-sent { margin: 0; }

/* A tender's list of suppliers to ask, and the supplier import */
.pboard .ask-list { display: grid; gap: 6px; }
.pboard .ask-list h5 { margin: 0; font-family: var(--f-display); font-weight: 600; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pboard .ask-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.pboard .ask-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 4px 8px; align-items: center; font-size: 13px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.pboard .ask-row.st-declined .ask-who { text-decoration: line-through; color: var(--muted); }
.pboard .ask-row select, .pboard select.ask-add { border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; background: var(--surface); color: var(--ink); min-height: 30px; font-size: 12px; }
.pboard select.ask-add { justify-self: start; }
.pboard .ask-who { min-width: 0; overflow-wrap: anywhere; }
.pboard .ask-who .chip { margin-left: 6px; }
.pboard .ask-reach { display: block; }
.pboard .ask-reach .linkbtn { font-size: 12px; }
.pboard .sup-import { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pboard .sup-lists { margin: 0; }
@media (max-width: 600px) {
  .pboard .ask-row { grid-template-columns: minmax(0, 1fr) auto; }
}
.pboard .myname { display: grid; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.pboard .myname-row { display: flex; gap: 8px; }
.pboard .myname-row input { flex: 1; min-width: 0; }

/* Documents tab: one row per document; an open one shows its text below a title bar that stays in view */
.pboard .docs { display: grid; gap: 8px; }
.pboard .doc-item { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.pboard .doc-item > .doc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; padding: 8px 12px 8px 6px; border-radius: 10px; }
.pboard .doc-item.open > .doc-head { position: sticky; top: var(--board-head, 0px); z-index: 3; background: var(--surface); border-bottom: 1px solid var(--line); border-radius: 10px 10px 0 0; }
.pboard .doc-item { scroll-margin-top: calc(var(--board-head, 0px) + 8px); }
.pboard .doc-head h2 { margin: 0; font-size: 17px; line-height: 1.25; flex: 1 1 260px; min-width: 0; }
.pboard .doc-item.open .doc-head h2 { font-size: 21px; }
.pboard .doc-toggle { display: flex; align-items: baseline; gap: 8px; width: 100%; text-align: left; border: 0; background: none; padding: 6px; font: inherit; font-weight: 700; color: var(--ink); border-radius: 6px; }
.pboard .doc-toggle:hover { background: var(--surface-2); }
.pboard .doc-toggle .chev { color: var(--muted); font-size: .8em; width: 1em; flex: none; }
.pboard .doc-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pboard .doc-move { display: inline-flex; }
.pboard .doc-move button { border: 0; background: none; color: var(--muted); padding: 4px 5px; font-size: 13px; }
.pboard .doc-move button:disabled { opacity: .3; }
.pboard .doc-body { padding: 4px 22px 22px 34px; }
.pboard .doc-meta { margin: 6px 0 14px; }
.pboard .doc-collapse-end { margin-top: 18px; }
.pboard .doc-new { max-width: 520px; }
.pboard .doc-contents { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 0 0 16px; background: var(--surface-2); font-size: 14px; }
.pboard .doc-contents ul { margin: 6px 0 0; padding-left: 18px; columns: 2 220px; }
.pboard .doc-contents li.sub { margin-left: 14px; list-style: circle; }
/* A document's files (the live board, after the code this was ported from): the offer-file list in a box of its own. */
.pboard .doc-files { border: 1px solid var(--line); border-radius: 8px; max-width: 78ch; margin: 0 0 16px; padding: 10px 14px; }
.pboard .doc-files h3 { font-family: var(--f-display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0; font-size: 12px; font-weight: 600; }
.pboard .doc-files li { overflow-wrap: anywhere; }
.pboard .doc-missing { display: grid; gap: 8px; justify-items: start; }
.pboard .md { font-size: 15px; line-height: 1.55; max-width: 78ch; }
/* Russian reads in the Cyrillic face first: the Latin face's fallback has no bold Cyrillic. */
.pboard .doc-item:lang(ru) .md, .pboard .doc-item:lang(ru) .doc-head h2 { font-family: var(--font-body-cyr), var(--f-body); }
/* Body font, bold: the condensed display face has no Cyrillic of its own, and both languages should read alike. */
.pboard .md h2, .pboard .md h3, .pboard .md h4, .pboard .md h5, .pboard .md h6 { font-family: inherit; font-weight: 700; line-height: 1.25; margin: 1.5em 0 .4em; scroll-margin-top: calc(var(--board-head, 0px) + 64px); }
.pboard .md h2 { font-size: 21px; }
.pboard .md h3 { font-size: 18px; }
.pboard .md h4 { font-size: 16px; }
.pboard .md p { margin: .6em 0; }
.pboard .md ul, .pboard .md ol { margin: .5em 0; padding-left: 1.4em; }
.pboard .md li { margin: .25em 0; }
.pboard .md li > p { margin: .2em 0; }
.pboard .md .tscroll { margin: .8em 0; max-width: none; }
.pboard .md .dtable { font-size: 13.5px; }
.pboard .md .dtable td, .pboard .md .dtable th { vertical-align: top; }
.pboard .md blockquote { margin: .8em 0; padding: 2px 14px; border-left: 3px solid var(--line); color: var(--muted); }
.pboard .md code { font-family: var(--f-mono); font-size: .9em; background: var(--surface-2); padding: 1px 4px; border-radius: 3px; }
.pboard .md pre { background: var(--surface-2); padding: 10px 12px; border-radius: 6px; overflow-x: auto; }
.pboard .md pre code { background: none; padding: 0; }
.pboard .md hr { border: 0; border-top: 1px solid var(--line); margin: 1.4em 0; }
.pboard .md a { overflow-wrap: anywhere; }
.pboard .doc-edit { display: grid; gap: 10px; }
.pboard .doc-edit label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.pboard .doc-text { width: 100%; font-family: var(--f-mono); font-size: 13px; line-height: 1.5; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: var(--surface); color: var(--ink); resize: vertical; }
.pboard .doc-edit-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pboard .doc-edit-actions .doc-delete { margin-left: auto; display: inline-block; }
@media (max-width: 760px) {
  .pboard .doc-body { padding: 4px 14px 18px; }
  .pboard .doc-contents ul { columns: 1; }
}

/* Drag and drop (projectboard.js drag): where the item will land. */
.pboard [data-drop].over { outline: 2px dashed var(--accent); outline-offset: 2px; }
.pboard .drop-before { box-shadow: 0 -3px 0 0 var(--accent); }
.pboard [data-horizontal] .drop-before { box-shadow: -3px 0 0 0 var(--accent); }
.pboard [data-drop].drop-end { box-shadow: inset 0 -3px 0 0 var(--accent); }
.pboard [data-drag].dragging { opacity: .85; }

/* Editing: tenders, chains, board */
/* A column or lane being dragged over looks as the original's (drop-over); on the Board the place in a column does not
   matter (a drop changes the type only), so no insertion line there. */
.pboard .col[data-drop].over, .pboard .lane[data-drop].over { outline: 2px dashed var(--accent); outline-offset: 4px; border-radius: 6px; }
.pboard .cols .drop-before, .pboard .cols [data-drop].drop-end { box-shadow: none; }
.pboard .lane-card.dragging { opacity: .85; }

/* Editing: map, deliverables, docs, rail */
.pboard .mk.editable.dragging { cursor: grabbing; z-index: 3; }
