:root {
  --bg: #ffffff;
  --surface: #fafbfb;
  --surface-2: #f2f4f5;
  --text: #232628;
  --text-muted: rgba(35, 38, 40, .55);
  --border: #d9d9d9;
  --primary: #169bc2;
  --primary-tint: rgba(22, 155, 194, .1);
  --success: #52c41a;
  --danger: #d4433f;
  --danger-tint: rgba(255, 77, 79, .1);
  --warning: #c98a0a;
  --accent-backlog: #8c9196;
  --violet: #9747ff;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle; line-height: 1;
}
.app { max-width: 1400px; margin: 0 auto; padding: 24px 20px 40px; }
/* Sticky at every width (qMJeQkmhYwcXFTjeOJw0-3): the hamburger, logo and
   + New project CTA stay reachable while scrolled down a long board on
   desktop/tablet too, not just on a phone — this used to be a mobile-only
   rule (@media max-width:640px) with the exact same position/background/
   z-index declarations; they're the base rule now so every viewport gets
   them, and the mobile media query below only adds its own size/spacing
   compaction on top. See --sticky-topbar-h below for why the offset this
   feeds (.mobile-action-bar's own top, also no longer mobile-only) is
   measured rather than hard-coded.
   qER8mO5v6ZX9FrMXuKYm: on web/tablet the bar had 0 horizontal padding
   (the logo sat flush against the screen edge) and top-aligned its
   content, so a shorter item like the + New project button sat noticeably
   higher than the taller logo beside it. `padding` now has 10px either
   side, `align-items` is `center` so shorter items sit level with the
   logo, and vertical padding is trimmed 10px -> 6px to lower the bar's
   overall height — the phone media query below already sets its own
   padding/align-items explicitly, so none of this changes the ≤640px
   (mobile) rendering.
   jJh1TP9WSMlTiKmERHPj had switched this to a 3-column grid so the
   hamburger, pulled out as a direct middle child, could sit centred
   regardless of how wide the logo or actions button were. Reverted by
   H7NANhnIijj2yyGR8e8v: centred read as the hamburger floating
   unconnected to the logo — it's back inside .topbar-left-row (first
   child, logo to its right), so a plain 2-item flex row with
   `justify-content: space-between` is enough again; no grid, no dedicated
   middle column. */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
  position: sticky; top: 0; z-index: 16;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 6px 10px;
}
/* qMJeQkmhYwcXFTjeOJw0: the hamburger and the topbar logo now live in their
   own row (.topbar-left-row), a direct flex row with nothing else sharing
   it, instead of one flex row that also had to hold the stacked
   title+subtitle block. That stacked block gave the row two very
   differently-sized items to align (a tall title stack vs. a short button)
   and nothing here constrained either from growing past the available
   width, so on a narrow viewport the logo (previously 78px tall, ~312px
   wide at this image's fixed 4:1 aspect ratio) had no room to shrink and
   either overflowed past the screen edge or forced the row to break —
   pushing the hamburger away from it, which is what mobile testing kept
   catching. Fixed at the root instead of re-tuning sizes again:
   - the logo is shrunk 25% (78px -> 58.5px, min-width:0 + overflow:hidden
     on the <h1> so it can shrink further instead of overflowing if space
     is still tight); shrunk again, 58.5px -> 46px, by qER8mO5v6ZX9FrMXuKYm
     above, as part of lowering the sticky bar's height on web/tablet;
   - the <img> now also carries HTML width/height attributes (234x58, the
     same 4:1 ratio) so the browser reserves its box before the SVG has
     loaded/decoded, instead of laying it out at 0 width and reflowing once
     it arrives;
   - the subtitle is now a sibling row below .topbar-left-row, not nested
     inside the flex item that also holds the logo, so it can never affect
     the logo/hamburger row's own sizing. */
.topbar-left { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.topbar-left-row { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 10px; min-width: 0; }
.topbar h1 { margin: 0; font-size: 22px; font-weight: 700; min-width: 0; max-width: 100%; overflow: hidden; }
.logo-link {
  font: inherit; font-size: inherit; font-weight: inherit; color: inherit;
  background: none; border: none; padding: 0; margin: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-width: 0;
}
.logo-link:hover { opacity: .75; }
.topbar-logo-img { height: 46px; width: auto; max-width: 100%; display: block; flex-shrink: 0; }
.footer-logo-btn { vertical-align: middle; }
.footer-logo-img { height: 42px; display: block; }
.auth-gate-logo { height: 120px; max-width: 100%; width: auto; margin: 0 auto 4px; display: block; }
.subtitle { margin: 4px 0 0; font-size: 13px; color: var(--text-muted); }
.hamburger-btn { font-size: 20px; flex-shrink: 0; }

/* ── Page header — one shared format for every page's own title + summary
   (the board itself, Docs, Archive, Archived projects, FAQ Management,
   Settings, …). Deliberately kept out of .topbar: the topbar is global,
   sticky chrome on mobile (see below), while a page header is per-page
   content that scrolls away normally, same as the rest of that page. ───── */
.page-header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-header h2 { margin: 0; font-size: 18px; font-weight: 700; }
.page-header-count { font-size: 12px; font-weight: 700; color: var(--text-muted); background: var(--surface-2); border-radius: 9999px; padding: 2px 10px; }

/* ── Pipeline health strip (YeCj7sNpHXFUZQhmAmEb) ────────────────────────
   Compact by design — a "is the machinery alive" glance, not a dashboard.
   Hidden entirely until systemStatus/pipeline's first snapshot lands (see
   renderHealthStrip in app.js). Sits at the bottom of the page (just above
   the footer, see index.html) rather than up top — background-machinery
   status isn't worth pushing the actual page content down for. */
.health-strip {
  display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center;
  margin: 18px 0 0; padding: 7px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  font-size: 12px; color: var(--text-muted);
}
.health-seg { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.health-seg-link { color: inherit; text-decoration: none; }
.health-seg-link:hover { color: var(--primary); text-decoration: underline; }
.health-seg-unknown { opacity: .7; }
.health-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: var(--text-muted); }
.health-dot-ok { background: var(--success); }
.health-dot-bad { background: var(--danger); }
.health-dot-pending { background: var(--warning); }
@media (max-width: 640px) {
  .health-strip { font-size: 11px; padding: 6px 10px; }
}

/* ── Left nav drawer — hamburger-opened, slides in over the board. Kept in
   the DOM at all times (not [hidden]) so the transform transition actually
   animates; off-screen + non-interactive while closed. ────────────────── */
.nav-drawer-backdrop {
  position: fixed; inset: 0; background: rgba(10, 12, 13, .4); z-index: 20;
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.nav-drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.nav-drawer {
  /* Widened 320 -> 360px, with proportionally larger text below, so the
     drawer reads as matching the topbar rather than undersized next to it
     (qMJeQkmhYwcXFTjeOJw0); max-width: 85vw unchanged so it still caps on
     the narrowest phones. */
  position: fixed; top: 0; left: 0; bottom: 0; width: 360px; max-width: 85vw;
  background: var(--bg); border-right: 1px solid var(--border); z-index: 21;
  box-shadow: 2px 0 16px rgba(0, 0, 0, .15);
  transform: translateX(-100%); transition: transform .22s ease;
  display: flex; flex-direction: column; padding: 12px 0;
  visibility: hidden;
}
.nav-drawer.open { transform: translateX(0); visibility: visible; }
.nav-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 20px 16px; border-bottom: 1px solid var(--border); margin-bottom: 6px;
}
.nav-drawer-title { font-weight: 700; font-size: 18px; }
.nav-drawer-item {
  display: block; width: 100%; text-align: left; background: transparent; border: none;
  padding: 17px 20px; font-size: 16px; color: var(--text); cursor: pointer; font-family: inherit;
}
.nav-drawer-item:hover { background: var(--surface-2); }
.nav-drawer-item-home { font-weight: 700; color: var(--primary); border-bottom: 1px solid var(--border); }
.nav-drawer-section {
  padding: 14px 20px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-muted);
}
/* Signed-in email + Sign out — pushed to the bottom of the drawer
   (margin-top: auto, .nav-drawer is a column flex) since it's used rarely,
   not worth permanent space in the sticky mobile topbar it moved out of. */
.nav-drawer-footer {
  margin-top: auto; padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.btn-primary {
  background: var(--primary); color: #fff; border: none; border-radius: 6px;
  padding: 9px 16px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.btn-primary:hover { opacity: .92; }
.btn-primary:disabled, .btn-ghost:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary:disabled:hover { opacity: .4; }
.btn-ghost {
  background: transparent; color: var(--text-muted); border: 1px solid var(--border);
  border-radius: 6px; padding: 9px 16px; font-size: 13px; cursor: pointer; font-family: inherit;
}
/* Cancel must always read as active, never as "maybe disabled" the way
   .btn-ghost already can (see its own :disabled rule just above, and the
   .btn-attach comment below for the same look causing a real bug once
   already) — e6vsSRDsjEdug0oRsCTK was exactly the Save/Publish pair right
   next to it now genuinely being disabled until the page is dirty (see
   updateFaDirtyState in app.js), which made a muted Cancel unreadable as
   "the one that's always safe to click". Full-strength text color and a
   heavier border, not a fill — it's a way out, not the primary action. */
.btn-outline {
  background: transparent; color: var(--text); border: 1.5px solid var(--text-muted);
  border-radius: 6px; padding: 9px 16px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.btn-outline:hover { background: var(--surface-2); border-color: var(--text); }
/* Filled/outlined, not muted-grey-on-transparent like .btn-ghost — used for
   Attach screenshot/Record screen. These used to be plain .btn-ghost, which
   next to the filled blue Save/Add comment buttons read as disabled
   (DrIEsKsdi3WrwXbUdMH6 and its duplicates: "it's not possible to attach
   anything to a ticket" was this look, not a real bug). */
.btn-attach {
  background: var(--primary-tint); color: var(--primary); border: 1px solid var(--primary);
  border-radius: 6px; padding: 9px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: inherit; display: inline-flex; align-items: center; gap: 6px;
}
.btn-attach:hover { background: var(--primary); color: #fff; }
.btn-attach.recording { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger {
  background: var(--danger); color: #fff; border: none; border-radius: 6px;
  padding: 9px 16px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.btn-danger:hover { opacity: .92; }
.board { display: grid; grid-template-columns: repeat(4, minmax(260px, 1fr)); gap: 14px; align-items: start; overflow-x: auto; }
.column { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; min-width: 260px; display: flex; flex-direction: column; max-height: calc(100vh - 200px); }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 2px solid var(--border); border-radius: 8px 8px 0 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.col-head-backlog { border-top: 3px solid var(--accent-backlog); }
.col-head-testing { border-top: 3px solid var(--warning); }
.col-head-publish { border-top: 3px solid var(--primary); }
.col-head-live { border-top: 3px solid var(--success); }
.col-count { background: var(--surface-2); border-radius: 9999px; padding: 1px 8px; }
/* Groom Backlog merged into the Backlog column's own header (originally
   mobile-only — JHY0F2AdMSjtL4WU8F2K — now the only treatment, on every
   viewport width: eST3jOS85Mtl8KMgpOH0 asked for the same "CTA replaces
   the count, right in the header" look desktop already had a separate
   .col-groom-row for). See groomBacklogInlineHTML in app.js. :has() scopes
   the count-hiding to a header that actually has the inline button
   rendered — an empty Backlog has nothing to groom (groomableCountForProject
   in app.js), so its header keeps the plain "0" count. */
.col-head:has(.col-groom-inline) .col-count { display: none; }
.col-groom-inline { display: inline-flex; }
.col-groom-inline .notify-claude-btn { padding: 3px 10px; font-size: 11px; min-height: 0; }
.col-groom-inline .notify-claude-icon { font-size: 14px; }
.col-list { padding: 10px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.empty-hint { color: var(--text-muted); font-size: 12.5px; font-style: italic; padding: 10px 6px; text-align: center; }
/* cursor:pointer signals the whole tile opens for editing on click now
   (Vz3OY3vWkOYs3M8BFhiK) — see the delegated click handler's own .card
   fallback in app.js, which excludes the card's buttons/inputs/links so
   their own actions still work normally. */
.card { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px; box-shadow: 0 1px 2px rgba(20, 20, 20, .05); cursor: pointer; }
.card-in-development { cursor: default; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.card-top-left { display: flex; align-items: center; gap: 8px; }
.card-select-cb { width: 15px; height: 15px; margin: 0; cursor: pointer; flex-shrink: 0; }
.col-select-all { display: inline-flex; align-items: center; margin-right: 6px; cursor: pointer; }
.col-select-all input { width: 13px; height: 13px; margin: 0; cursor: pointer; }
.badge { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border-radius: 9999px; padding: 2px 9px; }
.badge-feature { background: var(--primary-tint); color: var(--primary); }
.badge-bug { background: var(--danger-tint); color: var(--danger); }
.card-move { display: flex; gap: 2px; }
.icon-btn { border: none; background: transparent; color: var(--text-muted); border-radius: 6px; cursor: pointer; padding: 4px 7px; font-size: 14px; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
/* Revert (hfEmgPWmgrv5pxxcv8vE) — an .icon-btn like archive/delete beside
   it, but its hover state hints "this undoes something live" rather than
   reading as just another muted utility icon. */
.revert-btn:hover { background: var(--danger-tint); color: var(--danger); }
.card-title { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.card-desc { margin: 0; font-size: 12.5px; color: var(--text-muted); }
.card-desc-wrap .card-desc-original { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border); }
.card-desc-toggle-btn {
  display: block; margin: 4px 0 0; padding: 0; border: none; background: none; cursor: pointer;
  font-family: inherit; font-size: 11px; font-weight: 600; color: var(--primary);
}
.card-desc-toggle-btn:hover { text-decoration: underline; }
.card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.card-footer-left { display: flex; align-items: center; gap: 4px; }
.card-cat { font-size: 10.5px; color: var(--text-muted); background: var(--surface-2); border-radius: 9999px; padding: 2px 8px; }
/* Bottom-right of the tile (in .card-move, alongside archive/delete), not
   a plain muted icon-row entry anymore — a filled, rounded pill with a
   soft shadow and a gentle hover/press scale, so it reads as its own
   distinct "you can comment here" affordance rather than blending into
   the row of housekeeping icons next to it. */
.quick-comment-btn {
  font-size: 14px; padding: 5px 9px; border-radius: 9999px;
  background: var(--primary-tint); color: var(--primary);
  display: inline-flex; align-items: center; gap: 4px;
  box-shadow: 0 1px 3px rgba(20, 20, 20, .12);
  transition: transform .12s ease, background-color .12s ease, color .12s ease;
}
.quick-comment-btn:hover { background: var(--primary); color: #fff; transform: scale(1.08); box-shadow: 0 2px 6px rgba(20, 20, 20, .18); }
.quick-comment-btn:active { transform: scale(.97); }
.quick-comment-btn .options-menu-count { color: inherit; font-weight: 600; }
.approve-btn { width: 100%; margin-top: 10px; background: var(--primary); color: #fff; border: none; border-radius: 6px; padding: 8px 10px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
/* Failed testing (xYAk2oIFgbkvHikhufaT) — the only CTA on a Ready for
   Testing card now that approving is the checkbox rather than a "Confirm
   tested" button, so the outline/muted treatment is what keeps a reject
   from reading as that card's primary action. (It used to sit directly
   below Confirm tested, hence the smaller margin-top, which still reads
   correctly against the test link above it.) */
.fail-testing-btn {
  background: transparent; color: var(--danger); border: 1px solid var(--danger);
  margin-top: 6px;
}
.fail-testing-btn:hover { background: var(--danger-tint); }
/* Not a button — a passive status line for a "Live on Feature Branch"
   card. There is deliberately no manual way to merge from here; only the
   project's own Notify Claude — Deploy action can move a card past this
   point, since only that path actually merges the PR before advancing
   the status (see cardHTML's own comment in js/app.js). */
.merge-pending-hint {
  display: block; width: 100%; margin-top: 10px; text-align: center; box-sizing: border-box;
  background: var(--surface-2); color: var(--text-muted); border: 1px dashed var(--border); border-radius: 6px;
  padding: 8px 10px; font-size: 11.5px; font-style: italic;
}
/* Shared by cardHTML's isInDevelopment (a Backlog card the Routine has
   already packaged a fix for, patchReady, still sitting in Backlog until
   backlog-automation.yml opens its PR) and isDeploying (a ready-to-publish
   card the Routine has confirmed is green/mergeable and set mergeReady on,
   still sitting there until backlog-automation.yml actually merges it) —
   both are "real, in-flight work behind this card, hands off" states. Greyed
   and desaturated so it reads as locked at a glance rather than an ordinary
   editable card; its own hint line below replaces every other card's
   move/edit/delete controls, same pattern as .merge-pending-hint above. */
.card.card-in-development { background: var(--surface-2); opacity: .65; filter: grayscale(55%); }

/* Same-deployment grouping (see deploymentGroupKey/columnCardsHTML). A
   bracket around cards that already sit in this column, not a container for
   anything new: the cards inside keep their own styling untouched, including
   the greyed .card-in-development treatment above, so the group reads as
   "these ones travel together" and nothing else changes. The gap matches
   .col-list's own 10px so grouped and ungrouped cards stay on one rhythm. */
.card-group {
  display: flex; flex-direction: column; gap: 10px;
  padding: 8px; border: 1px dashed var(--border); border-left: 3px solid var(--primary);
  border-radius: 8px; background: var(--primary-tint);
}
.card-group-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--primary); padding: 0 2px;
}
.card-group-icon { font-size: 15px; }
.card-group-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-group-count {
  background: var(--bg); border-radius: 9999px; padding: 1px 8px; flex-shrink: 0;
}
.in-development-hint {
  display: block; width: 100%; margin-top: 10px; text-align: center; box-sizing: border-box;
  background: var(--surface); color: var(--text-muted); border: 1px dashed var(--border); border-radius: 6px;
  padding: 8px 10px; font-size: 11.5px; font-style: italic; font-weight: 600;
}
/* .attachment-btn (an .icon-btn) replaced the old, non-interactive,
   zero-hidden .attachment-count-badge span — see cardHTML in app.js — so
   it needs no styling of its own beyond .icon-btn's existing rule. */
.test-link-row { display: flex; align-items: center; gap: 4px; margin-top: 10px; }
.test-link-btn {
  flex: 1; text-align: center; background: var(--primary-tint); color: var(--primary); text-decoration: none;
  border-radius: 6px; padding: 7px 10px; font-size: 12.5px; font-weight: 600;
}
.test-link-btn:hover { opacity: .85; }
.btn-ghost.test-link-set-btn { width: 100%; margin-top: 10px; padding: 7px 10px; font-size: 12.5px; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 12, 13, .5); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 10; }
/* The panel scrolls its own content instead of growing past the window.
   The FAQ article editor's form is taller than a ~900px-tall window, and
   with .modal-backdrop at overflow: visible its Save article / Cancel row
   simply fell below the fold with nothing to scroll — the page behind
   scrolled instead, so the button could not be reached at all. This was a
   mobile-only rule until then, but a modal outgrowing the window has
   nothing to do with viewport width. */
.modal-panel { background: var(--bg); border-radius: 12px; box-shadow: 0 8px 40px rgba(0, 0, 0, .25); width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto; padding: 20px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-header h2 { margin: 0; font-size: 17px; }
.modal-close { border: none; background: transparent; font-size: 20px; cursor: pointer; color: var(--text-muted); }
.dialog-panel { max-width: 420px; }
.dialog-message { margin: 0 0 14px; font-size: 13.5px; color: var(--text); white-space: pre-line; }
.dialog-fields { display: flex; flex-direction: column; gap: 12px; }
.dialog-field-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 5px; }
.dialog-field-input {
  width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: 6px;
  padding: 8px 10px; font-size: 13.5px; font-family: inherit; background: var(--bg); color: var(--text);
}
textarea.dialog-field-input { resize: vertical; min-height: 70px; }
.dialog-fields:not(:empty) { margin-bottom: 14px; }
.field-label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin: 10px 0 4px; }
#ni-desc-input {
  width: 100%; font-family: inherit; font-size: 14px; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px;
}
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.type-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.type-opt { font-family: inherit; font-size: 12px; font-weight: 500; color: var(--text-muted); background: var(--bg); border: none; padding: 7px 14px; cursor: pointer; }
.type-opt + .type-opt { border-left: 1px solid var(--border); }
.type-opt.active { background: var(--primary-tint); color: var(--primary); }
.form-actions { display: flex; gap: 8px; }
.field-hint { margin: 6px 0 0; font-size: 11.5px; color: var(--text-muted); }

.desc-wrap { position: relative; }
.mic-btn {
  position: absolute; right: 7px; bottom: 7px; width: 30px; height: 30px; border-radius: 50%;
  border: none; background: var(--primary-tint); cursor: pointer; font-size: 15px; line-height: 1;
  display: flex; align-items: center; justify-content: center; color: var(--primary);
}
.mic-btn:hover { background: var(--primary); }
.mic-btn.listening { background: var(--danger); color: #fff; animation: mic-pulse 1.4s ease-in-out infinite; }
@keyframes mic-pulse { 0%, 100% { box-shadow: 0 0 0 0 var(--danger-tint); } 50% { box-shadow: 0 0 0 8px transparent; } }
.listening-hint { margin: 6px 0 0; font-size: 11.5px; color: var(--danger); display: none; }
.listening-hint.on { display: block; }
.mic-error { margin: 6px 0 0; font-size: 11.5px; color: var(--danger); display: none; }
.mic-error.on { display: block; }

/* ── Multi-project sections ─────────────────────────────────────────── */
#projects-root { display: flex; flex-direction: column; gap: 20px; }
.project { border: 1px solid var(--border); border-radius: 10px; padding: 16px 16px 18px; background: var(--bg); }
.project-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.project-collapse-btn { border: none; background: transparent; cursor: pointer; font-size: 16px; color: var(--text-muted); padding: 2px 6px; flex-shrink: 0; }
.project-collapse-btn:hover { color: var(--text); }
.project-title-wrap { flex: 1; min-width: 180px; }
.project-name-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.project-name { margin: 0; font-size: 18px; font-weight: 700; }
.project-item-count { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.project-rename-btn { border: none; background: transparent; cursor: pointer; font-size: 13px; color: var(--text-muted); padding: 2px 6px; }
.project-rename-btn:hover { color: var(--text); }
.project-name-input {
  font-family: inherit; font-size: 18px; font-weight: 700; color: var(--text); background: var(--surface);
  border: 1px solid var(--primary); border-radius: 6px; padding: 2px 8px; min-width: 180px;
}
.project-header .subtitle { margin: 4px 0 0; }
.project.collapsed .project-body { display: none; }

/* Program/Product grouping — a heading above a set of projects, only
   rendered at all once at least one program exists (see app.js render()).
   No board/columns of its own, just a label; each project inside still
   renders exactly as it does ungrouped. */
.program-group { display: flex; flex-direction: column; gap: 20px; }
.program-heading {
  margin: 0; font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted);
}

/* ── Header actions: one primary CTA + one "⋮" options menu ─────────────
   Everything that isn't "add a backlog item" (archive, requirements,
   interfaces) lives behind the options menu now, on both desktop and
   mobile — this is what used to be 2-3 separate ghost buttons competing
   with the primary Add button for space, especially on a phone screen. */
.project-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.new-item-btn { white-space: nowrap; }
/* AI-driven action — same teal→violet gradient family as the platform's
   own "Launch a New Campaign" (see the ph-designer skill's "AI action
   button" recipe): a 20%-opacity gradient fill, no border, a sparkle icon,
   and gradient-clipped label text. The count pill uses the solid (100%)
   version of the same gradient so it reads as the "loud" part of the
   control. Only ever rendered when there's actually something to notify
   about — notifyClaudeButtonHTML() returns nothing at all otherwise. */
.notify-claude-btn {
  white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
  border: none; border-radius: 6px; padding: 9px 14px; font-size: 13px; font-family: inherit;
  cursor: pointer; background: linear-gradient(135deg, rgba(22, 155, 194, .2), rgba(151, 71, 255, .2));
}
.notify-claude-icon { font-size: 17px; background: linear-gradient(135deg, var(--primary), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.notify-claude-label {
  background: linear-gradient(135deg, var(--primary), var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.notify-claude-count-pill {
  background: linear-gradient(135deg, var(--primary), var(--violet)); color: #fff;
  font-size: 11px; font-weight: 700; border-radius: 9999px; padding: 1px 8px;
}
/* Muted/disabled variant while a fired session is still working — visually
   distinct from the actionable gradient state above, not just non-clickable. */
.notify-claude-btn-working {
  background: var(--surface-2); cursor: default;
}
.notify-claude-btn-working .notify-claude-icon,
.notify-claude-btn-working .notify-claude-label {
  background: none; -webkit-background-clip: unset; background-clip: unset; color: var(--text-muted);
}
.notify-claude-btn-working .notify-claude-count-pill { background: var(--text-muted); }
.notify-claude-spinner {
  width: 13px; height: 13px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--border); border-top-color: var(--primary);
  animation: notify-claude-spin .8s linear infinite;
}
@keyframes notify-claude-spin { to { transform: rotate(360deg); } }
/* Once a session id has resolved, the working button itself becomes the
   "View session" link (see notifyClaudeButtonHTML) instead of a separate
   link next to a disabled button — this just restores the pointer cursor
   and kills the default <a> underline that .notify-claude-btn-working's
   cursor:default would otherwise leave in place. */
.notify-claude-btn-clickable { cursor: pointer; text-decoration: none; }
.project-options { position: relative; flex-shrink: 0; }
.project-options-btn { font-size: 18px; line-height: 1; padding: 7px 11px; }
.project-options-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 15;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .14); min-width: 250px; max-width: 88vw;
  overflow: hidden; display: flex; flex-direction: column; padding: 6px;
}
.options-menu-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; text-align: left; background: transparent; border: none; border-radius: 6px;
  padding: 10px 11px; font-size: 13px; font-family: inherit; color: var(--text); cursor: pointer;
}
.options-menu-item:hover { background: var(--surface-2); }
.options-menu-item-empty { color: var(--text-muted); font-style: italic; }
.options-menu-count { font-size: 11px; color: var(--text-muted); font-style: normal; }
.options-menu-sub { font-size: 11px; color: var(--text-muted); }
.options-menu-item-danger { color: var(--danger); }
.options-menu-item-danger:hover { background: var(--danger-tint); }
/* A menu row with nothing to click (e.g. "No artifact yet") — unlike the
   other -empty item (interface-add-btn), it has no action, so it shouldn't
   look clickable. */
.options-menu-item-static { cursor: default; }
.options-menu-item-static:hover { background: transparent; }

/* ── Archive page ────────────────────────────────────────────────────── */
.archive-page { margin-bottom: 20px; }
.archive-table-wrap { border: 1px solid var(--border); border-radius: 8px; overflow: auto; background: var(--surface); margin-top: 12px; }
.archive-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.archive-table th, .archive-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.archive-table th { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); cursor: pointer; user-select: none; white-space: nowrap; }
.archive-table th:hover { color: var(--text); }
.archive-table th[data-sort-active] { color: var(--primary); }
.archive-filter-row th { padding: 6px 12px 10px; cursor: default; }
.archive-filter-row th:hover { color: var(--text-muted); }
.archive-filter-row select, .archive-filter-row input {
  width: 100%; font-family: inherit; font-size: 12.5px; font-weight: 400; text-transform: none;
  letter-spacing: normal; color: var(--text); background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 8px; box-sizing: border-box;
}
.archive-table tbody tr:last-child td { border-bottom: none; }
.archive-table tbody tr:hover { background: var(--surface-2); }
.archive-row-title { font-weight: 600; margin: 0 0 2px; }
.archive-row-desc { margin: 0; font-size: 12px; color: var(--text-muted); max-width: 46ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.archive-row-date { white-space: nowrap; color: var(--text-muted); }
.restore-btn { background: var(--primary-tint); color: var(--primary); border: none; border-radius: 6px; padding: 6px 10px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; white-space: nowrap; }
.restore-btn:hover { background: var(--primary); color: #fff; }

/* ── New Project modal — a plainer, more minimal treatment than the base
   .modal-panel: bigger radius, more breathing room, borderless inputs on a
   soft fill (the closer-to-native look of a macOS/iOS sheet) instead of the
   denser, bordered form styling shared by every other modal in this app.
   Scoped to .np-panel only — every other modal keeps the original look. ── */
.np-panel { max-width: 400px; padding: 28px 26px; border-radius: 20px; }
.np-panel .modal-header { margin-bottom: 18px; }
.np-panel .modal-header h2 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.np-panel .field-label { margin: 16px 0 6px; font-size: 12px; }
.np-panel .field-label:first-of-type { margin-top: 0; }
.np-panel #np-name-input, .np-panel #np-program-select {
  width: 100%; font-family: inherit; font-size: 15px; color: var(--text); background: var(--surface-2);
  border: 1px solid transparent; border-radius: 10px; padding: 11px 13px; box-sizing: border-box;
}
.np-panel #np-name-input:focus, .np-panel #np-program-select:focus {
  outline: none; border-color: var(--primary); background: var(--bg);
}
.np-panel .field-hint { font-size: 12px; }
.np-panel .form-row { margin-top: 22px; }
.np-panel .btn-primary, .np-panel .btn-ghost { border-radius: 10px; padding: 10px 18px; font-size: 14px; }

/* ── Quick comment modal — same plainer, more minimal treatment as
   .np-panel above (bigger radius, more breathing room, a borderless
   textarea on a soft fill instead of the denser bordered look every other
   modal uses). Scoped to .qc-panel only, so the full Edit item modal's own
   comment box — which shares layout with its title/desc/category fields —
   is untouched. ─────────────────────────────────────────────────────── */
.qc-panel { max-width: 400px; padding: 28px 26px; border-radius: 20px; }
.qc-panel .modal-header { margin-bottom: 18px; }
.qc-panel .modal-header h2 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.qc-panel #qc-comment-input {
  width: 100%; font-family: inherit; font-size: 15px; color: var(--text); background: var(--surface-2);
  border: 1px solid transparent; border-radius: 10px; padding: 12px 13px; box-sizing: border-box; resize: vertical;
}
.qc-panel #qc-comment-input:focus { outline: none; border-color: var(--primary); background: var(--bg); }
.qc-panel .form-row { margin-top: 22px; }
.qc-panel .btn-primary, .qc-panel .btn-ghost { border-radius: 10px; padding: 10px 18px; font-size: 14px; }

/* ── Interface modal (shared with New Project's inline fields) ─────────── */
#if-backdrop select, #if-backdrop input, #if-backdrop textarea,
#docs-requirements-input {
  width: 100%; font-family: inherit; font-size: 13px; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; box-sizing: border-box; resize: vertical;
}
#if-content-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.5; }
#docs-requirements-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.5; }

/* ── Project Settings page ────────────────────────────────────────────
   Cleaner, quieter card style (fJ4kR2vTsWmXoP81nQeH): a hard 1px border
   on every block read as busy/boxy once the page's copy was trimmed down
   to just the essentials — a soft shadow instead of a border, more
   internal padding, and a narrower reading column (720px) give it the
   same "one setting per row, generous whitespace" feel as a native
   Settings screen, without changing anything else on the board (this rule
   is scoped to .docs-page only). */
.docs-page { margin-bottom: 20px; max-width: 720px; }
/* The FAQ Management / Settings page-switcher nav (jump straight to the
   other page) was removed (hXR16fmKAq0f2pJAtwiq) so each page's header is
   just its own <h2>, the same plain format the board and every other page
   use — the switcher was extra chrome the request asked to drop. */
.docs-block {
  border: none; border-radius: 14px; padding: 20px 22px;
  background: var(--surface); margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}
.docs-block h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.docs-block-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.docs-block-header h3 { margin: 0; }
.interface-row { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-top: 10px; background: var(--bg); }
.interface-row-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.interface-row-title { font-weight: 600; font-size: 13.5px; }
.interface-row-with { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.interface-row-actions { display: flex; gap: 4px; }
.interface-row-content { margin-top: 8px; font-size: 12.5px; color: var(--text); white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; max-height: 160px; overflow-y: auto; background: var(--surface); border-radius: 6px; padding: 8px 10px; }
.interface-row-empty { color: var(--text-muted); font-style: italic; }

/* A card with no code to push (a live data/config-only fix) — see the Edit
   item modal's "No deployment required" checkbox and cardHTML's own
   confirm-no-deploy-btn, which skips Approved for Deployment/Notify Claude —
   Deploy entirely for a card carrying this flag. */
/* Live "X / max" readout for every bounded text field (see wireCharCount in
   app.js). firestore.rules rejects a write over these caps with a bare 403
   and no indication length was the problem — native maxlength already stops
   typing/pasting past it, but said nothing to a viewer approaching the
   limit, and did nothing at all against dictation setting .value directly
   (see the dictation clamp in createDictationController). This is the
   visible half of that fix: amber near the cap, red once actually at it. */
.char-count {
  display: block; font-size: 11px; color: var(--text-muted); text-align: right;
  margin-top: 2px;
}
.char-count-warn { color: var(--warning); }
.char-count-limit { color: var(--danger); font-weight: 600; }

.no-deploy-badge {
  display: inline-block; font-size: 10.5px; font-weight: 600;
  color: var(--success); background: rgba(82, 196, 26, .12); border-radius: 9999px;
  padding: 2px 8px; margin: 6px 0 0 6px;
}
/* The backlog-tracker APP_VERSION (see public/js/version.js) captured the
   moment a card first enters Ready for Testing — the same number the app's
   own footer shows, so a tester can compare "ticket says v1.5.2" against
   the live footer to confirm they're looking at the right build. Carries
   through Approved for Deployment and Deployed/Main Branch (Live)
   unchanged (see moveItem/processApplyPatch — it's stamped once, not
   recomputed on every move), and into the Archived table's own Version
   column. */
.test-version-badge {
  display: inline-block; font-size: 10.5px; font-weight: 600;
  color: var(--text-muted); background: var(--surface-2); border-radius: 9999px;
  padding: 2px 8px; margin: 6px 0 0 6px;
}
/* The PR a card's work landed in (backlogItems.prUrl/prNumber, written by
   run-backlog-automation.js). Links straight to GitHub, and reads merged
   once the automation has actually merged it. */
.pr-badge {
  display: inline-block; font-size: 10.5px; font-weight: 600; text-decoration: none;
  color: var(--primary); background: var(--primary-tint); border-radius: 9999px;
  padding: 2px 8px; margin: 6px 0 0 6px;
}
.pr-badge:hover { text-decoration: underline; }
.pr-badge-merged { color: var(--success); background: rgba(82, 196, 26, .12); }

/* Per-card deploy provenance (backlogItems.mergeCommit/deployRunUrl/
   deployConclusion, written by run-backlog-automation.js's processMergePr
   and its own reconciliation pass — see cardHTML's own deployBadge
   comment). Only shown on a Merged to Main (Live) card. Colored by
   deployConclusion: amber while the dispatched run hasn't finished yet,
   green once it reports success, red for anything else (failure,
   cancelled, timed_out, ...) so a red card is immediately visible without
   opening the run. */
.deploy-badge {
  display: flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 600;
  border-radius: 9999px; padding: 2px 8px; margin: 6px 0 0 6px; width: fit-content;
}
.deploy-badge a { color: inherit; text-decoration: none; }
.deploy-badge a:hover { text-decoration: underline; }
.deploy-badge-commit {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; opacity: .75;
}
.deploy-badge-pending, .deploy-badge-unknown { color: var(--warning); background: rgba(201, 138, 10, .12); }
.deploy-badge-success { color: var(--success); background: rgba(82, 196, 26, .12); }
.deploy-badge-failure, .deploy-badge-cancelled, .deploy-badge-timed_out, .deploy-badge-startup_failure {
  color: var(--danger); background: var(--danger-tint);
}

/* ── Current-project floating bar (see syncMobileActionBar in app.js) ─────
   Started phone-only (a scrolled-off project's own Ready for Dev/Approved
   for Deployment/Deploy to Main actions were unreachable without scrolling
   back up); now shown at every width (qMJeQkmhYwcXFTjeOJw0-3) so the same
   "whichever project is scrolled into view keeps its actions on screen"
   behaviour holds on desktop/tablet too. Fixed, not sticky, and never in
   the flow, deliberately: an in-flow header that collapses when it pins
   changes the document height mid-scroll, which Chrome's scroll anchoring
   then tries to correct, which un-pins it — a loop that read on a real
   phone as the page juddering up and down when a plain `.project-header {
   position: sticky }` was tried first. A fixed element is outside the
   flow, so it cannot change the document's height or position at all, and
   that loop cannot exist — see the longer comment above
   syncMobileActionBar in app.js.
   top is --sticky-topbar-h, not a literal 0: .topbar is also pinned to the
   very top of the screen (qMJeQkmhYwcXFTjeOJw0-3), so this bar needs to
   sit directly below it rather than underneath/overlapping it.
   syncStickyTopbarOffset() in app.js measures the real topbar height on
   load/resize and sets that custom property — it can't be a fixed number
   here since the topbar's height isn't fixed (it wraps to two rows on the
   narrowest phones). Mobile-only compaction (icon-only buttons, hidden
   labels) stays in the @media block below. */
.mobile-action-bar {
  position: fixed; top: var(--sticky-topbar-h, 0px); left: 0; right: 0; z-index: 15;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 16px;
  background: var(--bg); border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 10px -6px rgba(20, 20, 20, .35);
}
.mobile-action-bar-name {
  flex: 1; min-width: 0; font-size: 13px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mobile-action-bar-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* ── Mobile ──────────────────────────────────────────────────────────────
   Two real problems on a phone before this: (1) the board's 4 columns were
   forced side by side (`repeat(4, minmax(260px,1fr))`), so most of the
   board — including the "Confirm live on branch"/"Merge to main" buttons —
   only existed off-screen behind a sideways scroll nobody found; (2) the
   header crammed the primary Add button in among 2-3 ghost buttons with no
   size floor, so on a narrow screen they wrapped small and mis-tappable.
   Below 640px: columns stack vertically (no horizontal scroll at all), and
   the header becomes one big full-width Add button plus a small "⋮" next
   to it — everything else already moved into that menu above. */
@media (max-width: 640px) {
  .app { padding: 16px 12px 32px; }
  /* Sticky header compaction (qMJeQkmhYwcXFTjeOJw0-2): the sticky/blur/
     z-index declarations themselves now live on the base .topbar rule
     above (qMJeQkmhYwcXFTjeOJw0-3) so desktop/tablet get them too — this
     block only trims size/spacing further for a phone screen.
     z-index sits above .mobile-action-bar (below, z-index: 15) — see its
     own top offset just below for how the two stack instead of overlapping.
     align-items: center (same ticket) keeps the logo row and the + New
     project button vertically centered on the row instead of top-aligned,
     and padding is trimmed further so the pinned bar eats less of a phone
     screen's height while scrolling. */
  .topbar {
    align-items: center;
    padding: 6px 0; margin: 0 0 16px;
    gap: 12px;
  }
  .topbar h1 { font-size: 18px; }
  /* Extra headroom on top of the 78px -> 58.5px global shrink above: the
     logo's fixed 4:1 aspect ratio still makes 58.5px tall ~234px wide,
     which is most of a phone's width once the hamburger, its gap and the
     .app side padding are subtracted. Shrinking further here is a width
     floor, not a redo of the resize — min-width:0 + overflow:hidden on
     .topbar h1 (above) still applies if an even narrower screen needs it.
     Trimmed again, 46 -> 40px (hXR16fmKAq0f2pJAtwiq), as part of lowering
     the sticky bar's overall height on a phone screen. */
  .topbar-logo-img { height: 40px; }
  .btn-primary, .btn-ghost { min-height: 40px; }

  .board { grid-template-columns: 1fr; overflow-x: visible; }
  .column { max-height: none; }
  /* Tap-to-collapse a single column (eQOIaEcF4xMSVmZt1rnA) — mobile only,
     since this is where 4 stacked columns actually means scrolling past a
     long Backlog to reach Approved for Deployment below it; side-by-side
     desktop columns don't have that problem, so .column-collapsed does
     nothing outside this media query. See isColumnCollapsed in app.js. */
  .col-head { cursor: pointer; }
  .column-collapsed .col-list { display: none; }
  /* Groom Backlog's own header CTA (.col-groom-inline) is styled
     unconditionally above now — nothing mobile-specific left to add here.
     Tapping the label/count side still collapses the column (.col-head's
     own rule just above); tapping the CTA button itself grooms Backlog
     instead (see the ", button" exclusion in the col-head click handler in
     app.js), on every viewport width. */

  .project { padding: 14px 12px 16px; }
  .project-header { flex-wrap: wrap; }
  .project-title-wrap { flex-basis: 100%; }
  .project-header-actions { flex-basis: 100%; flex-wrap: wrap; }
  .new-item-btn { flex: 1; min-height: 46px; font-size: 14px; justify-content: center; }
  /* Its own row above New backlog item + ⋮ (order in the DOM already puts
     it first) — three buttons crammed onto one row would otherwise squeeze
     each other into unreadable widths on a phone. Width is the row width
     minus the ⋮ button (46px) and the row's own gap (8px), not a flat
     100%, so it lines up with New backlog item's own width on the row
     below (that button is flex:1 sharing its row with the same ⋮ button) —
     a flat 100% here made the Gen AI CTA visibly wider than Add to backlog. */
  .notify-claude-btn { flex-basis: calc(100% - 54px); min-height: 46px; font-size: 14px; justify-content: center; }
  .project-options-btn { min-width: 46px; min-height: 46px; }
  .project-options-menu { left: auto; right: 0; max-width: calc(100vw - 24px); }

  /* Width only — max-height/overflow-y moved to the base rule, which now
     applies at every width. */
  .modal-panel { max-width: 94vw; }
  /* New item modal anchors near the top instead of centering — centered on
     a phone, the on-screen keyboard opening for the description textarea
     pushes the Add-to-backlog button down under the keyboard. */
  #ni-backdrop { align-items: flex-start; padding-top: 14px; }
  .mic-btn { width: 42px; height: 42px; font-size: 18px; }
  .type-opt { padding: 10px 16px; font-size: 13px; }
  .form-row { gap: 10px; }
  .icon-btn { padding: 7px 10px; font-size: 15px; }

  /* Compact-only overrides for the floating current-project bar — its own
     position/layout now lives in the base .mobile-action-bar rule above
     (qMJeQkmhYwcXFTjeOJw0-3, since the bar itself is no longer phone-only).
     Icon + count only here: the labels don't fit beside a project name on
     a 390px screen, and the count is the part that tells you there's
     something waiting. Desktop/tablet keep the full labels (more room). */
  .mobile-action-bar .notify-claude-btn {
    flex-basis: auto; min-height: 38px; padding: 0 10px; font-size: 13px;
  }
  .mobile-action-bar .notify-claude-label { display: none; }
  .mobile-action-bar .new-item-btn {
    flex: 0 0 auto; min-height: 38px; padding: 0 14px; font-size: 0;
  }
  .mobile-action-bar .new-item-btn::after { content: "+"; font-size: 20px; font-weight: 700; }
}

/* ── Topbar actions (FAQ Center + New project) ──────────────────────── */
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ── FAQ Center admin page ──────────────────────────────────────────── */
.faq-admin-page { margin-bottom: 20px; }
.faq-admin-page code { background: var(--surface-2); border-radius: 4px; padding: 1px 5px; font-size: 12px; }
.modal-panel-wide { max-width: 720px; }
.form-row-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.form-row-grid select { width: 100%; }
#faq-article-editor-page input[type="text"], #faq-article-editor-page textarea, #faq-article-editor-page select {
  width: 100%; font-family: inherit; font-size: 13px; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; box-sizing: border-box; resize: vertical;
}

/* Dedicated article editor page: title/summary/body take the full main
   column; everything else (slug, category, doc type, linked project,
   keywords, status, needs review) lives in a sidebar of independently
   expand/collapsible named groups to the right — see
   ROUTINE_INSTRUCTIONS.md item "dedicated page for every article" and
   app.js's openFaqArticleEditorPage/setFaGroupOpen. Replaced the old
   single slide-out "Advanced settings" panel per the redesign mockup, which
   grouped the same kind of secondary fields into separate titled,
   collapsible sections instead of one flat drawer. */
.faq-editor-layout { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.faq-editor-main { max-width: 820px; flex: 1 1 480px; min-width: 0; }
.faq-editor-sidebar { flex: 1 1 280px; min-width: 240px; max-width: 340px; display: flex; flex-direction: column; gap: 12px; }
.fa-group { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); overflow: hidden; }
.fa-group-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  font-family: inherit; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text); background: var(--surface-2); border: none; padding: 10px 14px; cursor: pointer; text-align: left;
}
.fa-group-header:hover { background: var(--border); }
.fa-group-caret { color: var(--text-muted); font-size: 11px; transition: transform .15s ease; flex-shrink: 0; }
.fa-group-header[aria-expanded="true"] .fa-group-caret { transform: rotate(180deg); }
.fa-group-body { padding: 12px 14px 16px; }
.fa-group-body > .field-label:first-child { margin-top: 0; }
.fa-status-badge {
  display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 4px 10px; border-radius: 20px; background: var(--surface-2); color: var(--text-muted);
}
.fa-status-badge-published { background: var(--primary-tint); color: var(--primary); }
@media (max-width: 860px) {
  .faq-editor-sidebar { max-width: none; }
}
/* ── FAQ Management's two-pane browser ────────────────────────────────────
   Structure on the left, the selected folder's articles on the right —
   modelled on the Freshdesk layout this content came from, and replacing a
   flat list + "Folders" toggle that between them could never show where an
   article actually sat. Collapses to one column on a narrow screen, tree
   first, because picking a folder has to come before reading its contents. */
.faq-browser { display: grid; grid-template-columns: minmax(240px, 320px) 1fr; gap: 0; padding: 0; overflow: hidden; }
.faq-browser-pane { padding: 14px 16px 18px; min-width: 0; }
.faq-browser-tree { border-right: 1px solid var(--border); background: var(--surface); }
.faq-browser-pane-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 2px; }
.faq-browser-pane-head h3 { margin: 0; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.faq-tree-hint { margin: 2px 0 10px; }

/* Selected category's icon + edit toggle, next to the article-list heading
   (moved here from Settings — see renderFaqCategoryHeader in app.js). */
.faq-cat-heading-group { display: flex; align-items: center; gap: 6px; min-width: 0; }
.faq-cat-heading-icon { color: var(--primary); font-size: 17px; flex-shrink: 0; }
.faq-cat-edit-toggle { flex-shrink: 0; }
.faq-cat-heading-desc { margin: 2px 0 10px; font-size: 12.5px; color: var(--text-muted); }
.faq-cat-edit-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 2px 0 12px; }
.faq-cat-edit-form input { font-family: inherit; font-size: 12.5px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); flex: 1; min-width: 160px; }
@media (max-width: 860px) {
  .faq-browser { grid-template-columns: 1fr; }
  .faq-browser-tree { border-right: none; border-bottom: 1px solid var(--border); }
}

/* One row per node, indented by depth. The whole row is the hit target and
   the drag handle — a separate grip would be one more thing to aim at on a
   list this long. */
.faq-tree-row {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: transparent; border: none; border-radius: 6px;
  padding: 7px 8px; font: inherit; font-size: 13px; color: var(--text);
  cursor: pointer; text-align: left;
}
.faq-tree-row:hover { background: var(--surface-2); }
.faq-tree-row.selected { background: var(--primary-tint); color: var(--primary); font-weight: 600; }
.faq-tree-row[data-depth="1"] { padding-left: 22px; }
.faq-tree-row[data-depth="2"] { padding-left: 40px; }
.faq-tree-icon { font-size: 18px; color: var(--text-muted); flex-shrink: 0; }
.faq-tree-row.selected .faq-tree-icon { color: var(--primary); }
.faq-tree-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.faq-tree-count { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.faq-tree-row.selected .faq-tree-count { color: var(--primary); }
.faq-tree-caret { font-size: 18px; color: var(--text-muted); flex-shrink: 0; }
.faq-tree-add {
  border: none; background: transparent; cursor: pointer; color: var(--text-muted);
  font-size: 16px; line-height: 1; padding: 2px 4px; border-radius: 4px;
}
.faq-tree-add:hover { background: var(--surface-2); color: var(--primary); }
.faq-tree-group { margin-bottom: 2px; }

/* Drag feedback. The line shows where the row will land, which matters more
   than styling the row being dragged — you are aiming at a gap, not a row. */
.faq-tree-row.dragging, .faq-article-row.dragging { opacity: .45; }
.faq-drop-before { box-shadow: inset 0 2px 0 0 var(--primary); }
.faq-drop-after { box-shadow: inset 0 -2px 0 0 var(--primary); }
.faq-article-row[draggable="true"], .faq-tree-row[draggable="true"] { cursor: grab; }
.faq-article-row[draggable="true"]:active, .faq-tree-row[draggable="true"]:active { cursor: grabbing; }

.fa-body-header { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
#fa-body-editor-wrap { border-radius: 6px; overflow: hidden; }
#fa-body-editor { background: var(--bg); font-size: 13px; }
#fa-body-editor .ql-editor { min-height: 220px; max-height: 380px; overflow-y: auto; }
/* View-live preview — a small, backlog-tracker-local copy of faq/css/faq.css's
   .article-body rules (see renderFaqBodyMd's own comment: two small copies
   kept in sync rather than a shared import across the two static sites). */
.fa-body-viewer {
  border: 1px solid var(--border); border-radius: 6px; padding: 12px 14px; background: var(--surface);
  font-size: 14px; line-height: 1.7; min-height: 220px; max-height: 380px; overflow-y: auto;
}
.fa-body-viewer h1, .fa-body-viewer h2, .fa-body-viewer h3 { font-weight: 700; margin: 16px 0 6px; }
.fa-body-viewer h1 { font-size: 19px; } .fa-body-viewer h2 { font-size: 17px; } .fa-body-viewer h3 { font-size: 15px; }
.fa-body-viewer p { margin: 0 0 10px; }
.fa-body-viewer ul, .fa-body-viewer ol { margin: 0 0 10px; padding-left: 20px; }
.fa-body-viewer img { max-width: 100%; border-radius: 6px; }
.fa-body-viewer iframe { max-width: 100%; aspect-ratio: 16 / 9; width: 100%; height: auto; border: none; border-radius: 6px; }

/* ── Edit item modal (title/desc/type/category + comments) ─────────────── */
#ei-backdrop input[type="text"], #ei-backdrop textarea, #ei-backdrop select {
  width: 100%; font-family: inherit; font-size: 13px; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; box-sizing: border-box; resize: vertical;
}
.ei-comments-block { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 14px; }
.ei-comments-block h3 { margin: 0 0 8px; font-size: 14px; }
.ei-comments-block textarea { margin-top: 8px; }
.ei-notes-list { display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow-y: auto; }
.ei-note-row { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; }
.ei-note-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.ei-note-text { margin: 0; font-size: 12.5px; white-space: pre-wrap; }
/* The same rows, in the comment-icon modal, where the thread is the point
   of the dialog rather than one block among several — so it gets more
   room, and a gap before the composer underneath it. */
.qc-notes-list { max-height: 340px; margin-bottom: 12px; }

/* ── Attachments block (Edit item modal, and the quick-comment modal's own
   compact version) — screenshots & screen recordings, see app.js
   uploadItemAttachment/createAttachmentController. ───────────────────── */
.ei-attachments-block { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 14px; }
.ei-attachments-block h3 { margin: 0 0 8px; font-size: 14px; }
.ei-attachments-list { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow-y: auto; margin-bottom: 10px; }
.ei-attachment-item {
  display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 8px;
}
.ei-attachment-thumb { width: 64px; height: 44px; object-fit: cover; border-radius: 4px; background: var(--surface-2); flex-shrink: 0; }
.ei-attachment-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ei-attachment-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ei-attachment-open-link { font-size: 11px; color: var(--primary); text-decoration: none; }
.ei-attachment-open-link:hover { text-decoration: underline; }
.ei-attachment-remove-btn { flex-shrink: 0; }
.ei-attachments-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ei-attach-screenshot-label { display: inline-flex; align-items: center; }
.qc-attachments-actions { margin: 10px 0 4px; }
/* A recording in progress — the pulsing white dot mirrors the browser's own
   "you're sharing your screen" indicator, so the state reads at a glance
   even before the attach-hint text below the buttons is noticed. Generic
   over .btn-attach (not #ei-record-screen-btn specifically) now that the
   quick-comment modal's own Record screen button shares the same styling
   and behavior — see createAttachmentController in app.js. */
.btn-attach.recording {
  position: relative; padding-left: 26px;
}
.btn-attach.recording::before {
  content: ""; position: absolute; left: 10px; top: 50%; width: 8px; height: 8px; margin-top: -4px;
  border-radius: 50%; background: #fff; animation: ei-recording-pulse 1.2s ease-in-out infinite;
}
@keyframes ei-recording-pulse {
  0%, 100% { opacity: 1; } 50% { opacity: .25; }
}
.fa-preview ul { margin: 0 0 8px; padding-left: 20px; }
.fa-needs-review-toggle { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted); cursor: pointer; }
.fa-needs-review-toggle input { width: 14px; height: 14px; }

/* Icon dropdown + a live preview swatch — used when editing an existing
   category's icon from FAQ Management's category header. */
.fa-icon-picker { display: flex; align-items: center; gap: 6px; flex: 0.8; min-width: 130px; }
.fa-icon-preview { color: var(--primary); font-size: 18px; flex-shrink: 0; }
.fa-icon-picker select { flex: 1; min-width: 0; }

.fa-filter-row { display: flex; gap: 8px; margin: 10px 0 14px; flex-wrap: wrap; }
.fa-filter-row select, .fa-filter-row input {
  font-family: inherit; font-size: 12.5px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg);
}
.fa-filter-row input[type="search"] { flex: 1; min-width: 160px; }

.faq-article-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--divider, var(--border)); flex-wrap: wrap;
}
.faq-article-row:last-child { border-bottom: none; }
.faq-article-row-main h4.faq-article-title {
  margin: 4px 0 3px; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.faq-article-title:hover, .faq-article-title:focus-visible { color: var(--primary); outline: none; }
.faq-article-row-meta { margin: 0; font-size: 11.5px; color: var(--text-muted); }
.badge-status-draft { background: var(--surface-2); color: var(--text-muted); }
.badge-status-published { background: rgba(82, 196, 26, .12); color: var(--success); }
.badge-needs-review { background: rgba(201, 138, 10, .12); color: var(--warning); margin-left: 6px; }
.faq-article-row-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.faq-article-options { position: relative; }
.faq-article-options-btn { font-size: 18px; line-height: 1; padding: 7px 11px; }
.faq-article-options-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 15;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .14); min-width: 180px; max-width: 88vw;
  overflow: hidden; display: flex; flex-direction: column; padding: 6px;
}
.faq-article-options-menu a.options-menu-item { text-decoration: none; }

/* Folders view (FAQ Management) — drill down Product/Program -> Category ->
   Articles. .faq-folder-children/.faq-folder-articles indent one level
   further each; the leaf level reuses .faq-article-row (see
   faqArticleRowHTML) unchanged, just nested and slightly narrower. */
.faq-folder { border-bottom: 1px solid var(--divider, var(--border)); }
.faq-folder:last-child { border-bottom: none; }
.faq-folder-row {
  width: 100%; display: flex; align-items: center; gap: 8px; text-align: left;
  font-family: inherit; font-size: 13.5px; font-weight: 600; color: var(--text);
  background: transparent; border: none; cursor: pointer; padding: 11px 4px;
}
.faq-folder-row:hover { background: var(--surface-2); border-radius: 6px; }
.faq-folder-icon { color: var(--primary); font-size: 19px; flex-shrink: 0; }
.faq-folder-name { flex: 1; }
.faq-folder-count { font-size: 11px; font-weight: 500; color: var(--text-muted); white-space: nowrap; }
.faq-folder-children { padding-left: 22px; }
.faq-subfolder .faq-folder-row { font-size: 12.5px; font-weight: 500; }
.faq-folder-articles { padding-left: 22px; }
.faq-folder-articles .faq-article-row, .faq-folder-children .faq-folder-articles .faq-article-row { padding: 9px 0; }

/* ── Footer / version ────────────────────────────────────────────────── */
.app-footer { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-muted); text-align: center; }

[hidden] { display: none !important; }

/* ── FAQ editor: rich formatting (docs/CONTRIBUTING-docs.md §5.4) ─────
   The same tables/code/callout rules the public site uses (faq/css/faq.css),
   applied to both the "View live" preview and the Quill editing surface so
   what an author sees while writing matches what a reader gets. */
.fa-body-viewer h4 { font-size: 14px; }
.fa-body-viewer .faq-table, .ql-editor .faq-table { overflow-x: auto; margin: 0 0 12px; }
.fa-body-viewer table, .ql-editor table { border-collapse: collapse; width: 100%; font-size: 13px; }
.fa-body-viewer th, .fa-body-viewer td, .ql-editor th, .ql-editor td { border: 1px solid #d9d9d9; padding: 6px 8px; text-align: left; vertical-align: top; }
.fa-body-viewer thead th, .ql-editor thead th { background: #f2f4f5; font-weight: 700; }
/* A table's own add/remove row/column toolbar (g2Xjt3XHXy27Psbd0dF0) and
   its directly-editable cells — see faqTableToolbarHtml/FaqTableBlot in
   app.js. Both are stripped before saving (faqBodySourceForSave), so
   neither this toolbar nor the cell-focus styling below ever reaches
   .fa-body-viewer or the public site. */
.faq-table-toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.faq-table-btn {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 4px; padding: 3px 9px; font-size: 11.5px; cursor: pointer; font-family: inherit;
}
.faq-table-btn:hover { background: var(--border); }
.faq-table-btn-danger { color: var(--danger); border-color: var(--danger); }
.faq-table-btn-danger:hover { background: var(--danger); color: #fff; }
.ql-editor .faq-table th[contenteditable], .ql-editor .faq-table td[contenteditable] { cursor: text; }
.ql-editor .faq-table th[contenteditable]:focus, .ql-editor .faq-table td[contenteditable]:focus {
  outline: 2px solid var(--primary); outline-offset: -2px; background: var(--primary-tint);
}
.fa-body-viewer code, .ql-editor code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; background: #f2f4f5; border: 1px solid rgba(5, 5, 5, .06); border-radius: 4px; padding: 1px 5px; }
.fa-body-viewer pre, .fa-body-viewer pre.ql-syntax { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; background: #1f2429; color: #f2f4f5; padding: 10px 12px; border-radius: 6px; overflow-x: auto; margin: 0 0 12px; white-space: pre-wrap; }
.fa-body-viewer .callout, .ql-editor .callout { border-left: 4px solid; border-radius: 4px; padding: 8px 12px; margin: 0 0 12px; }
.fa-body-viewer .callout::before, .ql-editor .callout::before { display: block; font-weight: 700; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 3px; }
.fa-body-viewer .callout-note, .ql-editor .callout-note { background: rgba(22, 155, 194, .1); border-color: #169bc2; }
.fa-body-viewer .callout-note::before, .ql-editor .callout-note::before { content: "Note"; color: #0f7ea1; }
.fa-body-viewer .callout-important, .ql-editor .callout-important { background: #fff7e6; border-color: #faad14; }
.fa-body-viewer .callout-important::before, .ql-editor .callout-important::before { content: "Important"; color: #a86a00; }
.fa-body-viewer .callout-warning, .ql-editor .callout-warning { background: #fff1f0; border-color: #ff4d4f; }
.fa-body-viewer .callout-warning::before, .ql-editor .callout-warning::before { content: "Warning"; color: #c0272a; }
/* The callout picker is a custom format, so Quill has no label for it. */
.ql-snow .ql-picker.ql-callout { width: 96px; }
.ql-snow .ql-picker.ql-callout .ql-picker-label::before { content: "Callout"; }
.ql-snow .ql-picker.ql-callout .ql-picker-item::before { content: "None"; }
.ql-snow .ql-picker.ql-callout .ql-picker-item[data-value="note"]::before { content: "Note"; }
.ql-snow .ql-picker.ql-callout .ql-picker-item[data-value="important"]::before { content: "Important"; }
.ql-snow .ql-picker.ql-callout .ql-picker-item[data-value="warning"]::before { content: "Warning"; }
.ql-snow .ql-picker.ql-callout .ql-picker-label[data-value="note"]::before { content: "Note"; }
.ql-snow .ql-picker.ql-callout .ql-picker-label[data-value="important"]::before { content: "Important"; }
.ql-snow .ql-picker.ql-callout .ql-picker-label[data-value="warning"]::before { content: "Warning"; }

/* FAQ editor sign-in bar (faqCategories/faqArticles writes require a
   signed-in allowlisted Google account — see firestore.rules isFaqEditor) */
.faq-auth-bar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; font-size: 12.5px; color: #5b6b7a; margin: 0 0 8px; }
.faq-auth-bar .btn-small { padding: 4px 10px; font-size: 12px; }

/* Sign-in wall (js/auth-gate.js) */
.auth-gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: #f5f7f9; }
.auth-gate-card { background: #fff; border: 1px solid #d9d9d9; border-radius: 12px; padding: 32px 36px; max-width: 420px; width: 100%; text-align: center; box-shadow: 0 8px 30px rgba(0,0,0,.06); }
.auth-gate-card h1 { margin: 0 0 8px; font-size: 22px; }
.auth-gate-card p { margin: 0 0 20px; color: #5b6b7a; font-size: 14px; }
.auth-gate-card .btn-primary { font-size: 15px; padding: 10px 22px; }
.auth-gate-status { min-height: 1.4em; margin: 16px 0 0 !important; font-size: 13px; }
.auth-gate-status[data-kind="error"] { color: #c0272a; }

/* Email + password sign-in, beneath the Google button. Both routes are
   first-class: an admin can add a teammate who has no Google account at
   all, provision their Firebase Auth user, and have them set a password
   from Firebase's own reset email (see auth-gate.js and ../MCP.md). */
.auth-gate-password { text-align: left; margin-top: 4px; }
.auth-gate-password .field-label { text-align: left; }
.auth-gate-password input { width: 100%; padding: 9px 11px; border: 1px solid #d9d9d9; border-radius: 8px; font-size: 14px; background: #fff; }
.auth-gate-password .btn-ghost { width: 100%; margin-top: 12px; justify-content: center; }
.auth-gate-divider { display: flex; align-items: center; gap: 10px; margin: 20px 0 4px; color: var(--text-muted); font-size: 11.5px; }
.auth-gate-divider::before, .auth-gate-divider::after { content: ""; flex: 1; height: 1px; background: #e3e6eb; }
.link-btn { background: none; border: none; padding: 6px 0 0; color: var(--accent, #2f6df6); font-size: 12.5px; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
#auth-gate-retry { margin-top: 12px; }

/* ── Roles ───────────────────────────────────────────────────────────────
   auth-gate.js puts the signed-in person's role on <html> once membership
   resolves. "viewer" is the read-only role — firestore.rules refuses their
   writes, so rather than let them click things that then fail, the board
   says so once at the top and hides the controls that would only error. */
.readonly-banner {
  display: none; align-items: center; gap: 8px; margin: 0 0 14px;
  padding: 9px 13px; border-radius: 9px; font-size: 13px;
  background: #fff6e5; border: 1px solid #f0d9a8; color: #6b4e0e;
}
html[data-console-role="viewer"] .readonly-banner { display: flex; }
html[data-console-role="viewer"] #new-project-btn,
html[data-console-role="viewer"] .new-item-btn,
html[data-console-role="viewer"] .project-rename-btn,
html[data-console-role="viewer"] .card-move,
html[data-console-role="viewer"] .card-select-cb,
html[data-console-role="viewer"] .team-admin-block { display: none !important; }

/* ── Settings → Team & agent access ──────────────────────────────────────
   Admin-only block (hidden for everyone else by the rule above plus the
   [data-admin-only] rule here). One row per member: who they are, what they
   can do, and whether their AI agent may connect over MCP. */
html:not([data-console-role="admin"]) [data-admin-only] { display: none !important; }
.team-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 0; }
.team-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border: 1px solid #e3e6eb; border-radius: 9px; background: #fff;
}
.team-row-main { flex: 1 1 200px; min-width: 0; }
.team-row-email { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-row-name { font-size: 11.5px; color: var(--text-muted); }
.team-row select { font-size: 12.5px; padding: 5px 8px; border: 1px solid #d9d9d9; border-radius: 7px; background: #fff; }
.team-row .btn-ghost { font-size: 12px; padding: 5px 10px; }
.team-badge { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border-radius: 9999px; padding: 2px 8px; }
.team-badge-on { background: #e6f4ea; color: #1e6b32; }
.team-badge-off { background: #f1f2f4; color: #6b7280; }
.team-add-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-top: 12px; }
.team-add-row input { flex: 1 1 200px; padding: 9px 11px; border: 1px solid #d9d9d9; border-radius: 8px; font-size: 14px; }
.team-add-row select { padding: 9px 11px; border: 1px solid #d9d9d9; border-radius: 8px; font-size: 14px; background: #fff; }
.mcp-connect-box { margin-top: 12px; padding: 12px 14px; border: 1px solid #e3e6eb; border-radius: 9px; background: var(--surface-2, #f7f8fa); }
.mcp-connect-box code { display: block; font-size: 12.5px; word-break: break-all; padding: 6px 8px; background: #fff; border: 1px solid #e3e6eb; border-radius: 6px; margin: 6px 0; }
.mcp-connections { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.mcp-connection-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12.5px; padding: 8px 10px; border: 1px solid #e3e6eb; border-radius: 8px; background: #fff; }
/* Lives in the nav-drawer footer now, not the topbar (qMJeQkmhYwcXFTjeOJw0-2)
   — the drawer has room for the email on every viewport width, so this no
   longer needs to hide on mobile the way it did next to the sticky topbar. */
.topbar-user { font-size: 12.5px; color: #5b6b7a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ── Proposed FAQ revision review (faqArticles.pendingRevision) ───────── */
.badge-proposed-update { background: var(--primary-tint); color: var(--primary); margin-left: 6px; }
.badge-approved-update { background: rgba(82, 196, 26, .12); color: var(--success); margin-left: 6px; }
.fr-meta {
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px;
  background: var(--surface-2, var(--bg)); font-size: 13px; display: grid; gap: 6px;
}
.fr-meta p { margin: 0; }
.fr-meta .fr-reason { white-space: pre-wrap; }
.fr-meta .fr-golive { font-weight: 600; }
.fr-ticket { display: inline-flex; align-items: center; gap: 6px; margin: 2px 8px 2px 0; }
.fr-ticket .badge { text-transform: none; letter-spacing: 0; }
.badge-item-status-published-live, .badge-item-status-archived { background: rgba(82, 196, 26, .12); color: var(--success); }
.badge-item-status-ready-to-publish { background: var(--primary-tint); color: var(--primary); }
.badge-item-status-ready-for-testing { background: rgba(201, 138, 10, .12); color: var(--warning); }
.badge-item-status-backlog, .badge-item-status-missing { background: var(--surface-2); color: var(--text-muted); }
.fr-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.fr-changes { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; background: var(--bg); }
.fr-change-block { padding: 6px 0; border-bottom: 1px dashed var(--divider, var(--border)); font-size: 13.5px; line-height: 1.55; }
.fr-change-block:last-child { border-bottom: none; }
.fr-change-block.fr-unchanged { color: var(--text-muted); }
.fr-change-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-right: 8px; }
.fr-changes ins { background: rgba(82, 196, 26, .18); text-decoration: none; border-radius: 3px; padding: 0 2px; }
.fr-changes del { background: rgba(212, 67, 63, .16); text-decoration: line-through; border-radius: 3px; padding: 0 2px; }
.fr-skip { text-align: center; color: var(--text-muted); font-size: 12px; padding: 4px 0; }
.fr-side { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fr-pane { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; min-width: 0; background: var(--bg); }
.fr-pane h3 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.fr-pane-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.fr-pane-summary { margin: 0 0 10px; color: var(--text-muted); font-size: 13px; }
.fr-body { display: block; }
@media (max-width: 760px) { .fr-side { grid-template-columns: 1fr; } }
