/* ============================================================
   portal.css — Phase 3 portal design system.

   Lifted from wireframes/portal_v3_mockup.html (the operator-
   blessed source of truth). Scope is intentionally the auth-shell
   pages (login, onboard, settings, locked) + shared primitives.
   Dashboard-specific blocks (topnav, countdown-hero, action-list,
   activity-feed, quick-link, section-content tooling) land with
   the Vendor Cart wiring plan.

   This stylesheet is loaded ONLY from /portal/* pages. The
   marketing site keeps using assets/css/base.css and its own
   palette (--terracotta, --warm-white, --cream, --sage). The two
   palettes deliberately do not share CSS variable names.
   ============================================================ */

/* ── Design tokens (wireframe :root verbatim) ─────────────── */

/* Portal is light-only by design — every token below assumes a
   cream/paper background. Declaring `color-scheme: light` opts out
   of browser-applied auto-dark-mode (Chrome/Edge/Safari "auto dark
   theme" features, some user-agent extensions). Without this,
   transparent / low-alpha backgrounds get inverted and ghost buttons
   become invisible against a forced-dark canvas. */
:root {
  color-scheme: light;
  --bg: #F4EDDF; --paper: #FFFDF8; --paper-2: #FAF4E6;
  --ink: #1F1B18; --ink-soft: #6B5F54; --ink-faint: #9B8E80;
  --line: #2A2520; --line-soft: #D7CCB9; --line-faint: #EBE2D0;
  --navy: #21303F; --teal: #4A8590; --teal-soft: #DDEAEC;
  --coral: #C36B5A; --coral-soft: #F3DCD4; --coral-deep: #8B2E1F;
  --ivory: #F4E4D0; --sand: #E9D9B8;
  --gold: #B08A4A; --green: #5B7B4F; --red: #8B2A2A;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --display: 'Cormorant Garamond', serif;
  --body: 'DM Sans', system-ui, sans-serif;
  --sans: 'DM Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --r-sm: 4px; --r-md: 10px;
}

/* ── Reset + base ─────────────────────────────────────────── */

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }
code {
  font-family: var(--mono); font-size: 11px;
  background: var(--paper-2); padding: 1px 5px;
  border: 1px solid var(--line-faint); border-radius: 2px;
}

/* ── Page head + breadcrumb ───────────────────────────────── */

.page-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s-5);
  padding-bottom: var(--s-3);
  margin-bottom: var(--s-5);
  border-bottom: 1px solid var(--line-faint);
  flex-wrap: wrap;
}
.breadcrumb {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  color: var(--ink-faint); text-transform: uppercase;
  margin-bottom: var(--s-1);
}
.breadcrumb a { color: var(--ink-faint); }
.breadcrumb a:hover { color: var(--coral-deep); }
.page-head h1 { font-family: var(--display); font-weight: 500; font-size: 30px; line-height: 1.15; }
.page-head .meta { font-size: 12px; color: var(--ink-soft); margin-top: var(--s-1); }
.action-group { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }

/* ── Buttons ──────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
  background: transparent; color: var(--ink);
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { color: var(--coral-deep); }
.btn--primary { background: var(--navy); color: var(--paper); border-color: var(--navy); }
.btn--primary:hover { background: var(--coral-deep); border-color: var(--coral-deep); color: var(--paper); }
.btn--secondary { background: var(--paper); color: var(--ink); border-color: var(--line-soft); }
.btn--secondary:hover { border-color: var(--coral); color: var(--coral-deep); }
.btn--ghost { padding: 4px 8px; font-size: 12px; }
.btn--small { font-size: 11px; padding: 4px 10px; }
.btn--large { font-size: 14px; padding: 11px 20px; }
.btn--block { display: flex; width: 100%; justify-content: center; }
.btn--danger { color: var(--red); }
.btn--danger:hover { background: var(--red); color: var(--paper); border-color: var(--red); }
.btn--success { background: var(--green); color: var(--paper); border-color: var(--green); }
.btn--success:hover { background: #455e3c; border-color: #455e3c; color: var(--paper); }
.btn--coral { background: var(--coral); color: var(--paper); border-color: var(--coral); }
.btn--coral:hover { background: var(--coral-deep); border-color: var(--coral-deep); color: var(--paper); }

/* ── Pills (6 wireframe variants) ─────────────────────────── */

.pill {
  display: inline-block;
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.1em; padding: 2px 8px;
  border-radius: var(--r-sm);
  text-transform: uppercase; font-weight: 500;
  background: var(--bg); color: var(--ink-soft);
  border: 1px solid var(--line-soft);
}
.pill--draft   { background: var(--bg); color: var(--ink-soft); }
.pill--pending { background: var(--coral-soft); color: var(--coral-deep); border-color: var(--coral); }
.pill--good    { background: rgba(91,123,79,0.12); color: var(--green); border-color: var(--green); }
.pill--bad     { background: rgba(139,42,42,0.10); color: var(--red); border-color: var(--red); }
.pill--info    { background: var(--teal-soft); color: var(--teal); border-color: var(--teal); }
.pill--gold    { background: rgba(176,138,74,0.10); color: var(--gold); border-color: var(--gold); }

/* ── Cards + section labels ───────────────────────────────── */

.card {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: var(--s-5);
}
.card--sand { background: var(--paper-2); }
.card--flat { padding: var(--s-3) var(--s-4); }
.card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s-3); margin-bottom: var(--s-3);
}
.card-head h3 { font-family: var(--display); font-weight: 500; font-size: 19px; }
.section-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  color: var(--ink-faint); text-transform: uppercase;
  font-weight: 600;
  margin-bottom: var(--s-2);
  display: block;
}

/* ── Layout utilities ─────────────────────────────────────── */

.row { display: grid; gap: var(--s-3); }
.row-2 { grid-template-columns: 1fr 1fr; }
.row-3 { grid-template-columns: repeat(3, 1fr); }
.stack { display: flex; flex-direction: column; gap: var(--s-3); }
.stack-tight { display: flex; flex-direction: column; gap: var(--s-2); }
.inline { display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; }
.muted { color: var(--ink-faint); }
.soft { color: var(--ink-soft); }
.strong { font-weight: 500; }
.mono { font-family: var(--mono); font-size: 11px; }
.num { font-variant-numeric: tabular-nums; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-1 { margin-top: var(--s-1); } .mt-2 { margin-top: var(--s-2); } .mt-3 { margin-top: var(--s-3); } .mt-4 { margin-top: var(--s-4); } .mt-5 { margin-top: var(--s-5); }
.mb-1 { margin-bottom: var(--s-1); } .mb-2 { margin-bottom: var(--s-2); } .mb-3 { margin-bottom: var(--s-3); } .mb-4 { margin-bottom: var(--s-4); } .mb-5 { margin-bottom: var(--s-5); }
.hidden { display: none !important; }

/* ── Form fields ──────────────────────────────────────────── */

.field { display: block; margin-bottom: var(--s-3); }
.field .label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  color: var(--ink-faint); text-transform: uppercase; font-weight: 600;
  display: block; margin-bottom: 4px;
}
.field .label .req { color: var(--coral); }
.input {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--line-soft); border-radius: var(--r-sm);
  background: var(--paper-2); font-size: 13px; color: var(--ink);
  transition: border-color 0.15s, background 0.15s;
}
.input:focus { outline: none; border-color: var(--coral); background: var(--paper); }
.input::placeholder { color: var(--ink-faint); }
.help { font-size: 11px; color: var(--ink-faint); margin-top: 4px; }

/* ── Chips ────────────────────────────────────────────────── */

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; padding: 2px 8px;
  background: var(--teal-soft); color: var(--teal);
  border-radius: 999px; border: 1px solid rgba(74,133,144,0.25);
}
.chip--ghost { background: transparent; color: var(--ink-soft); border-color: var(--line-soft); }
.chip-mini {
  font-family: var(--mono); font-size: 10px; padding: 2px 8px;
  background: var(--paper); border: 1px solid var(--line-soft);
  border-radius: var(--r-sm); color: var(--ink);
}

/* ── Auth shell (login, onboard, locked) ──────────────────── */

.auth-shell {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: var(--s-5);
  background:
    radial-gradient(circle at 20% 20%, rgba(195,107,90,0.06) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(74,133,144,0.06) 0%, transparent 40%),
    var(--bg);
}
.auth-card {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: var(--s-7) var(--s-6);
  max-width: 440px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(31,27,24,0.08);
}
.auth-card--wide { max-width: 820px; }
.auth-brand { text-align: center; margin-bottom: var(--s-5); }
.auth-brand .logo {
  width: 56px; height: 56px;
  border-radius: var(--r-md);
  background: var(--navy); color: var(--paper);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 30px; font-weight: 500;
  margin-bottom: var(--s-3);
}
.auth-brand h1 { font-family: var(--display); font-weight: 500; font-size: 28px; line-height: 1.15; }
.auth-brand .sub {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em;
  color: var(--ink-faint); text-transform: uppercase; margin-top: var(--s-2);
}
.divider-or {
  text-align: center; margin: var(--s-4) 0; position: relative;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.15em;
  color: var(--ink-faint); text-transform: uppercase;
}
.divider-or::before, .divider-or::after { content: ''; position: absolute; top: 50%; width: 38%; height: 1px; background: var(--line-faint); }
.divider-or::before { left: 0; }
.divider-or::after { right: 0; }

/* ── TOTP QR (onboard) ─────────────────────────────────────── */

.totp-qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 0 0 var(--s-3);
  padding: var(--s-3);
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
}
.totp-qr-label {
  font-family: var(--mono, monospace);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft, #6b6055);
}
.totp-qr {
  width: 208px;
  height: 208px;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.totp-qr svg { width: 100%; height: 100%; }

/* ── 6-square code input (login + onboard) ────────────────── */

.code-input-row {
  display: grid;
  /* Fixed cell width so the row sizes itself to its content instead
     of stretching with the parent. `aspect-ratio: 1` on each cell
     used to multiply the parent width into the cell height — inside
     `.auth-card--wide` (820px) that made each square ~130px tall and
     blew out the rest of the card. */
  grid-template-columns: repeat(6, 48px);
  gap: 6px;
  justify-content: center;
  margin: 0 auto var(--s-4);
  max-width: 100%;
}
.code-input {
  width: 48px; height: 48px; padding: 0;
  text-align: center;
  font-family: var(--display); font-size: 26px; font-weight: 500;
  border: 1px solid var(--line-soft); border-radius: var(--r-sm);
  background: var(--paper-2);
}
.code-input:focus { border-color: var(--coral); background: var(--paper); outline: none; }

/* ── Auth-method picker (radio card) ──────────────────────── */

.auth-pick {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: var(--s-3);
  padding: var(--s-3);
  margin-bottom: var(--s-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  background: var(--paper-2);
  cursor: pointer;
  transition: all 120ms;
}
.auth-pick:hover { border-color: var(--coral); background: var(--paper); }
.auth-pick input[type="radio"] { margin: 4px 0 0 0; }
.auth-pick:has(input:checked) { border-color: var(--coral); background: var(--paper); box-shadow: 0 0 0 1px var(--coral); }
.auth-pick__title { font-family: var(--display); font-weight: 500; font-size: 16px; color: var(--navy); }
.auth-pick__sub { font-size: 12px; color: var(--ink-soft); line-height: 1.4; margin-top: 2px; }

/* ── Planner-meet + invite-chain (onboard) ────────────────── */

.planner-meet {
  display: grid; grid-template-columns: 64px 1fr;
  gap: var(--s-3);
  padding: var(--s-3); background: var(--paper-2);
  border: 1px solid var(--line-faint); border-radius: var(--r-md);
}
.avatar-lg {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--coral-soft); color: var(--coral-deep);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 26px; font-weight: 500;
}
.pname { font-family: var(--display); font-weight: 500; font-size: 18px; color: var(--navy); }
.prole { font-family: var(--mono); font-size: 10px; letter-spacing: 0.15em; color: var(--ink-faint); text-transform: uppercase; margin-top: 2px; }
.pquote { font-style: italic; color: var(--ink-soft); margin-top: var(--s-2); font-size: 12px; line-height: 1.4; }

.invite-chain {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: var(--s-2) var(--s-3);
  background: var(--paper-2);
  border: 1px dashed var(--line-soft);
  border-radius: var(--r-sm);
  font-size: 11px;
}

/* ── Inline banner notices (auth pages) ───────────────────── */

.banner-err {
  background: rgba(139,42,42,0.06);
  border: 1px solid var(--red); color: var(--red);
  padding: var(--s-2) var(--s-3); border-radius: var(--r-sm);
  font-size: 12px; margin-bottom: var(--s-3);
}
.banner-info {
  background: var(--teal-soft);
  border: 1px solid var(--teal); color: var(--teal);
  padding: var(--s-2) var(--s-3); border-radius: var(--r-sm);
  font-size: 12px; margin-bottom: var(--s-3);
}
.banner-ok {
  background: rgba(91,123,79,0.08);
  border: 1px solid var(--green); color: var(--green);
  padding: var(--s-2) var(--s-3); border-radius: var(--r-sm);
  font-size: 12px; margin-bottom: var(--s-3);
}

/* ── Cart page primitives (PR 2) ──────────────────────────── */

/* Stat card (used by .budget-strip and elsewhere). Lifted verbatim
   from the wireframe. */
.stat {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: var(--s-4);
  position: relative;
}
.stat .label { font-family: var(--mono); font-size: 9px; letter-spacing: 0.15em; color: var(--ink-faint); text-transform: uppercase; margin-bottom: var(--s-2); }
.stat .value { font-family: var(--display); font-weight: 500; font-size: 32px; line-height: 1; }
.stat .meta { font-size: 11px; color: var(--ink-soft); margin-top: 4px; }
.stat .accent { position: absolute; top: 0; left: 0; width: 24px; height: 3px; background: var(--coral); border-top-left-radius: var(--r-md); }

/* Budget strip — 4-up stat cards above the cart vendor groups. */
.budget-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}
@media (max-width: 720px) { .budget-strip { grid-template-columns: 1fr 1fr; } }

/* Replacement-proposal banner. Renders only when the cart bundle's
   payload.replacement_proposals_open is non-empty. */
.replacement-banner {
  background: linear-gradient(90deg, var(--coral-soft) 0%, var(--paper-2) 100%);
  border-left: 4px solid var(--coral-deep);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  margin-bottom: var(--s-4);
}
/* Banner inline thumbnails for the OLD → NEW swap. Small 32px squares
   so they pair compactly with the label text. "Img" italic placeholder
   when the side ships no image_url. */
.replacement-banner__thumb {
  display: inline-block;
  width: 32px; height: 32px;
  background-color: var(--paper);
  border: 1px solid var(--line-soft, #d8cdb8);
  border-radius: var(--r-sm);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  vertical-align: middle;
}
.replacement-banner__thumb--empty {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--display); font-style: italic;
  font-size: 11px; color: var(--ink-faint);
}
.replacement-banner__thumb--empty::before { content: "Img"; }

/* Vendor group card (uses <details>/<summary> for collapse). */
.cart-vendor-card {
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--paper);
  margin-bottom: var(--s-3);
  overflow: hidden;
}
/* HOUSE row distinction — non-negotiable per planner-agent. Coral
   border + faint coral background tint + star pill (rendered inline
   in the PHP template before the vendor name). */
.cart-vendor-card.is-house {
  border-color: var(--coral);
  background: rgba(195,107,90,0.04);
}
.cart-vendor-card.is-house .cart-vendor-head { background: rgba(195,107,90,0.08); }

.cart-vendor-head {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: var(--s-3);
  align-items: center;
  padding: var(--s-3) var(--s-4);
  background: var(--paper-2);
  border-bottom: 1px solid var(--line-soft);
}
.cart-vendor-head__name { font-family: var(--display); font-weight: 500; font-size: 18px; color: var(--navy); }
.cart-vendor-head__meta { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; color: var(--ink-faint); text-transform: uppercase; margin-top: 2px; }
.cart-vendor-head__subtotal { font-family: var(--display); font-weight: 500; font-size: 20px; color: var(--navy); }
.cart-vendor-head__subtotal--quote { color: var(--gold); }
.cart-vendor-head__subtotal-label { font-family: var(--mono); font-size: 9px; letter-spacing: 0.15em; color: var(--ink-faint); text-transform: uppercase; display: block; margin-bottom: 2px; }

/* HOUSE pill — rendered before the vendor name on is_house groups
   (cart.php uses this for in-house vendor tagging). */
.house-pill {
  display: inline-block;
  font-family: var(--mono); font-size: 9px;
  font-weight: 600; letter-spacing: 0.12em;
  padding: 2px 8px;
  background: var(--coral-soft);
  color: var(--coral-deep);
  border: 1px solid var(--coral);
  border-radius: 999px;
  margin-right: 6px;
  vertical-align: middle;
}
/* Variant for billing-tab Monarch-services milestones — teal accent
   mirrors the wireframe's Section A treatment for planning fees,
   distinguishing them from pass-through vendor milestones at a
   glance without breaking the unified status-grouped layout (Q1c). */
.house-pill--monarch {
  background: rgba(91, 138, 138, 0.15);
  color: #1f4a4a;
  border-color: var(--teal, #5B8A8A);
}

/* Capability pills — render one per active flag on rental_vendor
   groups. Service/venue/house always have both capability flags false. */
.capability-pill {
  display: inline-block;
  font-family: var(--mono); font-size: 9px;
  font-weight: 600; letter-spacing: 0.1em;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  text-transform: uppercase;
}
.capability-pill--rental   { background: var(--teal-soft);            color: var(--teal);        border: 1px solid var(--teal); }
.capability-pill--merchant { background: rgba(195,107,90,0.10);       color: var(--coral-deep);  border: 1px solid var(--coral); }

/* Vendor status pill — derived from envelope vendor_status enum
   (PENDING / PROPOSAL_SENT / CONTRACT_SIGNED / CANCELLED / etc). */
.vendor-status-pill {
  font-family: var(--mono); font-size: 9px;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 2px;
}
.vendor-status-pill.signed   { background: rgba(91,123,79,0.16);   color: var(--green); }
.vendor-status-pill.proposal { background: rgba(176,138,74,0.16);  color: var(--gold); }
.vendor-status-pill.pending  { background: var(--paper-2);          color: var(--ink-faint); border: 1px solid var(--line-soft); }
.vendor-status-pill.declined { background: rgba(139,42,42,0.14);    color: var(--red); }
.vendor-status-pill.cancelled { background: rgba(139,42,42,0.14);   color: var(--red); }

/* Cart line — single item row. `align-items: start` anchors every
   column to the top of the row. Without it, expanding the comment
   thread (which lives in column 2 and can grow to a few hundred px)
   vertically centers everything else — pushing the qty + price out
   to "the middle of the chat" instead of staying next to the line
   item name. The thumb gets a small `margin-top: 2px` so it visually
   centers on the name baseline. */
.cart-line {
  display: grid;
  grid-template-columns: 64px 1fr auto auto;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  align-items: start;
  border-bottom: 1px solid var(--line-faint);
}
.cart-line__thumb { margin-top: 2px; }
.cart-line__qty,
.cart-line__total { margin-top: 2px; }
.cart-line:last-child { border-bottom: 0; }
.cart-line:hover { background: var(--paper-2); }
/* When the bundle ships no image for this line, collapse the thumb
   column entirely — the wireframe explicitly suppresses placeholders
   on the client cart (placeholders only exist on the planner side). */
.cart-line.cart-line--no-thumb { grid-template-columns: 1fr auto auto; }

/* Replacement-pending row — bundle ships is_leaving=true while the
   operator has flagged this row for swap and the client hasn't yet
   accepted/declined on /vendor-cart-proposal.php. Coral left-stripe
   + faint background tint signals "this row is in transition." */
.cart-line.cart-line--leaving {
  background: rgba(195, 107, 90, 0.06);
  border-left: 3px solid var(--coral, #c36b5a);
}
.cart-line.cart-line--leaving:hover { background: rgba(195, 107, 90, 0.10); }
.cart-line__leaving-stripe {
  display: inline-block;
  font-family: var(--mono); font-size: 9px; font-weight: 600;
  letter-spacing: 0.15em; color: var(--coral-deep);
  background: rgba(195, 107, 90, 0.14);
  border: 1px solid var(--coral);
  border-radius: var(--r-sm);
  padding: 1px 6px;
  margin-bottom: 4px;
  text-transform: uppercase;
}

/* Newly-swapped-in row — coral-tinted stripe + the inline "↺ Change
   my mind" affordance below. Visible for 7 days after the client
   accepts a replacement; the bundle drops `revert_lineage` once the
   window closes so the stripe + button disappear automatically. */
.cart-line.cart-line--swapped-in {
  background: rgba(91, 138, 138, 0.04);
  border-left: 3px solid var(--teal, #5b8a8a);
}
.cart-line__swapped-in-stripe {
  display: inline-block;
  font-family: var(--mono); font-size: 9px; font-weight: 600;
  letter-spacing: 0.15em; color: var(--teal, #5b8a8a);
  background: rgba(91, 138, 138, 0.10);
  border: 1px solid var(--teal, #5b8a8a);
  border-radius: var(--r-sm);
  padding: 1px 6px;
  margin-bottom: 4px;
  text-transform: uppercase;
}
.cart-line__revert {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 6px; font-size: 12px;
}
.cart-line__revert-btn {
  background: none; border: 0; padding: 0;
  color: var(--coral-deep); font-size: 11px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  text-decoration: underline; text-decoration-style: dotted;
}
.cart-line__revert-btn:hover { text-decoration-style: solid; }
.cart-line__revert-form {
  grid-column: 2 / -1;
  margin-top: 8px; padding: 10px;
  background: rgba(195, 107, 90, 0.08);
  border: 1px solid var(--coral);
  border-radius: var(--r-sm);
}
.cart-line__revert-form textarea {
  font-family: inherit; font-size: 13px;
  padding: 6px 8px;
  border: 1px solid var(--line-soft); border-radius: var(--r-sm);
}

/* Collapsible per-line comment thread (replaces the always-visible
   inline thread shipped pre-2026-05-28). Summary shows comment count
   + a red "N unread" badge when sessionStorage's last-seen marker is
   older than at-least-one non-self comment. Opening the disclosure
   stamps a fresh last-seen → badge clears.
   Lives inside the cart-line name+sub wrapper div (NOT in a grid
   cell) so the toggle sits directly under the sub-event chips —
   uniform placement across rental / service / venue / merchant lines. */
.cart-thread {
  display: block;
  margin-top: var(--s-2);
}
.cart-thread__summary {
  list-style: none;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: var(--paper-2, #faf4e6);
  border: 1px solid var(--line-soft, #d8cdb8);
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px; line-height: 1;
  color: var(--ink-soft, #6b6055);
  user-select: none;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.cart-thread__summary::-webkit-details-marker { display: none; }
.cart-thread__summary::marker { content: ''; }
.cart-thread__summary:hover {
  background: var(--paper, #fff);
  border-color: var(--coral, #c36b5a);
  color: var(--coral-deep, #8b2e1f);
}
.cart-thread__chev {
  display: inline-block;
  font-size: 9px;
  transition: transform 0.15s;
  color: var(--ink-faint);
}
.cart-thread[open] .cart-thread__chev { transform: rotate(180deg); }
.cart-thread__icon { font-size: 12px; line-height: 1; }
.cart-thread__label { font-family: inherit; }
/* Total-count pill — sits next to the label, shows "N". Same circular
   pill geometry as .cart-thread__unread but neutral colors so it
   reads as "thread size" not "unread". */
.cart-thread__count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 18px;
  padding: 0 7px;
  background: var(--paper, #fff);
  border: 1px solid var(--line-soft, #d8cdb8);
  border-radius: 999px;
  font-family: var(--mono, monospace);
  font-variant-numeric: tabular-nums;
  font-size: 10px;
  color: var(--ink-soft, #6b6055);
  line-height: 1;
}
.cart-thread__unread {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px;
  padding: 0 6px;
  margin-left: 2px;
  background: #d63b3b;
  color: #fff;
  border-radius: 999px;
  font-family: var(--mono, monospace);
  font-variant-numeric: tabular-nums;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 0 0 1.5px var(--paper, #fff);
}
.cart-thread__unread[hidden] { display: none; }

/* ─────────────── Group-chat bubble styles ───────────────
   Shared by every portal page that renders chat bubbles
   (cart.php cart-line threads, proposals.php proposal-row
   threads, billing.php milestone + contract threads, layout.php
   per-primitive threads, rsvp.php per-guest threads). Was
   formerly inline only in proposals.php — meaning cart-line
   bubbles had NO avatar size constraint and rendered the
   profile pic at native size (full image embed). Hoisted
   here 2026-05-28 so every surface gets the same circle. */
.prop-thread__row { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 10px; }
.prop-thread__row--me { flex-direction: row-reverse; }
.prop-thread__avatar {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display, var(--display, serif));
  font-weight: 500;
  font-size: 14px;
  overflow: hidden;
  background: var(--cream, #E9D9B8);
  color: var(--ink, #1F1B18);
}
.prop-thread__avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.prop-thread__avatar--planner {
  background: rgba(91, 138, 138, 0.20);
  color: #1f4a4a;
  border: 1px solid var(--teal, #5B8A8A);
}
.prop-thread__avatar--other {
  background: var(--cream, #E9D9B8);
  color: var(--ink, #1F1B18);
}
.prop-thread__bubble-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 75%;
}
.prop-thread__bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.prop-thread__bubble--me {
  background: var(--coral, #C36B5A);
  color: var(--paper, #FFFDF8);
  border-bottom-right-radius: 4px;
}
.prop-thread__bubble--planner {
  background: rgba(91, 138, 138, 0.18);
  color: var(--ink, #1F1B18);
  border-bottom-left-radius: 4px;
}
.prop-thread__bubble--other {
  background: var(--cream, #E9D9B8);
  color: var(--ink, #1F1B18);
  border-bottom-left-radius: 4px;
}
/* Bubble-body images uploaded via paste / drop / 📎 — cap their
   width so a 4000px screenshot doesn't blow out the row. Images
   stay inside the bubble; profile pics live in the .prop-thread__avatar
   circle to the side. These two are NOT the same thing. */
.prop-thread__bubble img,
.bill-bubble-img {
  max-width: 100%;
  max-height: 320px;
  height: auto;
  display: block;
  margin: 6px 0;
  border-radius: 6px;
}
.prop-thread__meta {
  font-family: var(--mono, monospace);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--ink-faint, #9B8E80);
  text-transform: uppercase;
  padding: 0 4px;
  margin-top: 3px;
}
.prop-thread__meta--right { text-align: right; }
.prop-thread__meta-name { font-weight: 700; color: var(--ink-soft, #6B5F54); }
.prop-thread__meta-role,
.prop-thread__meta-time { margin-left: 4px; font-weight: 400; }
.cart-thread__body {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--paper-2, #faf4e6);
  border-left: 3px solid var(--coral-soft, rgba(195, 107, 90, 0.3));
  border-radius: var(--r-sm);
  font-size: 12px;
  line-height: 1.45;
}
.cart-thread__chat .cart-thread__msg + .cart-thread__msg {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--line-faint);
}
.cart-thread__form { margin-top: 10px; }
.cart-thread__form textarea {
  width: 100%; min-height: 60px;
  padding: 6px 8px;
  border: 1px solid var(--line-soft); border-radius: var(--r-sm);
  font-family: inherit; font-size: 13px;
  resize: vertical;
}
.cart-thread__form .actions {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 6px;
}
/* Document attachment chip — renders inside chat bubbles when the
   message carries a non-image attachment (markdown `[label](url)`). */
.cart-thread__doc {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--r-sm);
  text-decoration: none;
  color: inherit;
  font-size: 12px;
  margin: 4px 0;
}
.cart-thread__doc:hover { background: var(--paper); }
.cart-line__thumb {
  width: 64px; height: 64px;
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background-size: cover; background-position: center;
}
.cart-line__thumb-placeholder {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em;
  color: var(--ink-faint); text-transform: uppercase;
}
.cart-line__name { font-weight: 500; color: var(--navy); }
.cart-line__sub {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.08em; color: var(--ink-faint);
  margin-top: 4px;
  display: flex; gap: 4px; flex-wrap: wrap; align-items: center;
}
.cart-line__qty { font-family: var(--mono); font-size: 11px; color: var(--ink-soft); text-align: center; min-width: 56px; }
.cart-line__qty .qty-num { font-family: var(--display); font-weight: 500; font-size: 18px; color: var(--navy); display: block; }
.cart-line__total { font-family: var(--display); font-weight: 500; font-size: 16px; color: var(--navy); text-align: right; min-width: 80px; }
.cart-line__quote { font-family: var(--mono); font-size: 9px; color: var(--coral-deep); letter-spacing: 0.1em; text-transform: uppercase; }

/* Per-row SALE chip — rendered next to item name when is_sale=true.
   Coral mono-caps to match the MERCHANT vendor pill. */
.sale-chip {
  display: inline-block;
  font-family: var(--mono); font-size: 9px;
  font-weight: 600; letter-spacing: 0.12em;
  padding: 1px 6px;
  background: rgba(195,107,90,0.12);
  color: var(--coral-deep);
  border: 1px solid var(--coral);
  border-radius: var(--r-sm);
  margin-left: 8px;
  vertical-align: middle;
  text-transform: uppercase;
}

/* Comment thread under a cart line. Indented to align with the row
   content (skipping the thumb column via grid-column 2 / -1). */
.cart-line-comment-thread {
  grid-column: 2 / -1;
  margin-top: var(--s-2);
  padding: var(--s-2) var(--s-3);
  background: var(--paper-2);
  border-left: 3px solid var(--coral-soft);
  border-radius: var(--r-sm);
  font-size: 12px;
  line-height: 1.45;
}
.cart-line-comment-thread .cmt-who    { font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; color: var(--ink-faint); text-transform: uppercase; }
.cart-line-comment-thread .cmt-body   { margin-top: 4px; color: var(--ink); }
.cart-line-comment-thread .cmt-actions { margin-top: var(--s-1); }
.cart-line-comment-thread .cmt-actions a,
.cart-line-comment-thread .cmt-actions button { color: var(--coral-deep); font-size: 11px; background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }

/* Inline comment form — collapsed by default; expanded by JS toggle
   on the "Comment" / "Reply" action link. */
.cart-line-comment-form {
  grid-column: 2 / -1;
  margin-top: var(--s-2);
  padding: var(--s-2) var(--s-3);
  background: var(--paper-2);
  border: 1px dashed var(--line-soft);
  border-radius: var(--r-sm);
}
.cart-line-comment-form textarea {
  width: 100%; min-height: 60px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft); border-radius: var(--r-sm);
  background: var(--paper); font: inherit; font-size: 13px;
  resize: vertical;
  margin-bottom: var(--s-2);
}
.cart-line-comment-form .actions { display: flex; gap: var(--s-2); justify-content: flex-end; }

/* Empty-vendor-group message (items[] is empty). */
.cart-empty-group {
  padding: var(--s-4);
  color: var(--ink-soft);
  font-size: 13px;
  text-align: center;
}

/* Catering — grouped Meals subsection inside a catering vendor card.
   Mirrors the planner's meal_lineup pattern: header row with count +
   subtotal, then a compact list of per-meal rows showing name + sub-
   event chips + RSVP-driven "N attending" + price math. */
.cart-meals {
  margin: var(--s-3) var(--s-4);
  padding: var(--s-3);
  background: var(--paper-2, #FAF4E6);
  border: 1px solid var(--line-soft, #D7CCB9);
  border-radius: var(--r-sm, 6px);
}
.cart-meals__head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: var(--s-3);
  margin-bottom: var(--s-2);
}
.cart-meals__label {
  font-family: var(--mono, monospace);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-soft, #6B5F54);
}
.cart-meals__meta {
  font-family: var(--mono, monospace);
  font-size: 11px;
  color: var(--ink-soft, #6B5F54);
}
.cart-meals__meta strong { color: var(--teal, #5B8A8A); }
.cart-meals__quote { color: var(--coral-deep, #8B2E1F); font-style: italic; }
.cart-meals__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cart-meals__row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-2);
  padding: 6px 8px;
  background: var(--paper, #FFFDF8);
  border-radius: 4px;
  font-size: 13px;
}
.cart-meals__row--buffet { border-left: 2px solid var(--gold, #b08a4a); }
.cart-meals__name { font-weight: 600; }
.cart-meals__buffet-pill {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  background: rgba(176,138,74,0.18);
  color: var(--gold, #b08a4a);
  border-radius: 9px;
  font-family: var(--mono, monospace);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cart-meals__attending {
  margin-left: auto;
  font-family: var(--mono, monospace);
  font-size: 11px;
  color: var(--ink-faint, #9B8E80);
}
.cart-meals__attending.is-attending { color: var(--teal, #5B8A8A); font-weight: 600; }
.cart-meals__price {
  font-family: var(--mono, monospace);
  font-size: 12px;
  color: var(--ink, #1F1B18);
  white-space: nowrap;
}
.cart-meals__price strong { color: var(--navy, #1F1B18); }
.cart-meals__price-meta { color: var(--ink-faint, #9B8E80); font-size: 10px; margin-left: 2px; }

/* Grand-total footer card. */
.cart-grand-total {
  padding: var(--s-3) var(--s-4);
  margin-top: var(--s-4);
}
.cart-grand-total__label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.15em; color: var(--ink-faint); text-transform: uppercase; }
.cart-grand-total__value { font-family: var(--display); font-weight: 500; font-size: 28px; color: var(--navy); margin-top: 2px; }
.cart-grand-total__value .muted { font-size: 14px; }

/* Budget bar component (above the vendor groups). Used on /cart and
   later on /proposals. Stacked segments visualize where each dollar
   sits against the operator-set total budget. */
.budget-bar-card {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: var(--s-4);
  margin-bottom: var(--s-4);
}
.budget-bar-card__head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: var(--s-3);
  flex-wrap: wrap; gap: var(--s-2);
}
.budget-bar-card__head h2 { font-family: var(--display); font-weight: 500; font-size: 20px; color: var(--navy); }
.budget-bar-card__head .mono { font-family: var(--mono); font-size: 10px; letter-spacing: 0.15em; color: var(--ink-faint); text-transform: uppercase; }
.budget-bar {
  position: relative;
  height: 28px;
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  overflow: hidden;
  display: flex;
}
.budget-bar__seg { height: 100%; position: relative; }
.budget-bar__seg.paid      { background: var(--green); }
.budget-bar__seg.committed { background: var(--teal); }
.budget-bar__seg.estimated {
  background: repeating-linear-gradient(45deg,
    var(--gold) 0, var(--gold) 6px,
    rgba(176,138,74,0.6) 6px, rgba(176,138,74,0.6) 12px);
}
.budget-bar__seg.over-budget { background: var(--coral-deep); border-left: 2px solid var(--red); }
.budget-bar::before, .budget-bar::after { content: ''; position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255,255,255,0.35); pointer-events: none; }
.budget-bar::before { left: 50%; }
.budget-bar::after  { left: 75%; }

.budget-bar-ticks {
  position: relative;
  height: 16px; margin-top: 4px;
  font-family: var(--mono); font-size: 9px;
  color: var(--ink-faint); letter-spacing: 0.05em;
}
.budget-bar-ticks > span { position: absolute; top: 0; white-space: nowrap; }
.budget-bar-ticks .tick-end { right: 0; transform: none; }

.budget-bar-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: var(--s-3);
  margin-top: var(--s-3); padding-top: var(--s-3);
  border-top: 1px solid var(--line-faint);
}
@media (max-width: 600px) { .budget-bar-stats { grid-template-columns: 1fr 1fr; } }
.budget-bar-stats__cell { display: flex; flex-direction: column; gap: 4px; }
.budget-bar-stats__label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.15em; color: var(--ink-faint); text-transform: uppercase; display: inline-flex; align-items: center; gap: 6px; }
.budget-bar-stats__label::before { content: ''; width: 10px; height: 10px; border-radius: 2px; border: 1px solid var(--line-soft); }
.budget-bar-stats__cell.paid      .budget-bar-stats__label::before { background: var(--green); border-color: var(--green); }
.budget-bar-stats__cell.committed .budget-bar-stats__label::before { background: var(--teal); border-color: var(--teal); }
.budget-bar-stats__cell.estimated .budget-bar-stats__label::before { background: repeating-linear-gradient(45deg, var(--gold) 0 3px, rgba(176,138,74,0.6) 3px 6px); border-color: var(--gold); }
.budget-bar-stats__cell.budget    .budget-bar-stats__label::before { background: var(--paper-2); }
.budget-bar-stats__value { font-family: var(--display); font-weight: 500; font-size: 22px; color: var(--navy); font-variant-numeric: tabular-nums; }
.budget-bar-stats__value.is-pending { font-style: italic; color: var(--ink-faint); font-size: 18px; }
.budget-bar-stats__sub { font-size: 11px; color: var(--ink-soft); }

/* Side-by-side replacement-proposal page (portal/vendor-cart-proposal.php) */
.rp-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-4);
  margin: var(--s-4) 0;
}
.rp-compare__arrow {
  text-align: center;
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.2em; color: var(--ink-faint);
  text-transform: uppercase;
  padding: var(--s-2);
  grid-column: 1 / -1;
}
.rp-side {
  background: var(--paper);
  border: 2px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: var(--s-4);
}
.rp-side.is-old { border-color: var(--line-soft); opacity: 0.85; }
.rp-side.is-new { border-color: var(--coral); }
.rp-side h3 { font-family: var(--display); font-weight: 500; font-size: 18px; color: var(--navy); margin-bottom: var(--s-3); }
.rp-side__item-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line-faint); font-size: 13px; }
.rp-side__item-row:last-child { border-bottom: 0; }
.rp-side__item-name { color: var(--ink); }
.rp-side__item-meta { font-family: var(--mono); font-size: 11px; color: var(--ink-soft); }
.rp-side__total { display: flex; justify-content: space-between; padding-top: var(--s-3); margin-top: var(--s-3); border-top: 1px solid var(--line-soft); font-weight: 500; color: var(--navy); }
.rp-savings { text-align: center; font-family: var(--display); font-size: 18px; padding: var(--s-3); }
.rp-savings--positive { color: var(--green); }
.rp-savings--negative { color: var(--coral-deep); }
@media (max-width: 720px) {
  .rp-compare { grid-template-columns: 1fr; }
}

/* ── RSVP page primitives (PR 3) ─────────────────────────── */

/* Page-level table wrapper for the per-guest matrix view. Scrolls
   horizontally on narrow viewports rather than wrapping (the cells
   are dense, wrapping would mangle them). */
.rsvp-table-wrap {
  overflow-x: auto;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  margin-bottom: var(--s-4);
}

/* Shared with the wireframe — bare-bones table styling lifted verbatim. */
.line-item-table { width: 100%; }
.line-item-table th {
  background: var(--paper-2);
  padding: 10px 14px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em;
  color: var(--ink-faint); text-transform: uppercase;
  font-weight: 600;
  text-align: left;
}
.line-item-table td { padding: 12px 14px; border-bottom: 1px solid var(--line-faint); vertical-align: top; }
.line-item-table tr:last-child td { border-bottom: 0; }
.line-item-table tr:hover td { background: var(--paper-2); }
.line-item-table .item-name { font-weight: 500; }
.line-item-table .item-desc { font-size: 12px; color: var(--ink-soft); margin-top: 3px; }
.line-item-table th.rsvp-col, .line-item-table td.rsvp-col { text-align: center; }
.line-item-table th.rsvp-col { white-space: nowrap; }

/* Per-cell RSVP status pip — sits in each sub-event column. */
.rsvp-cell {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  font-family: var(--mono); font-size: 11px; font-weight: 600;
}
.rsvp-cell.yes      { background: rgba(91,123,79,0.18);  color: var(--green); }
.rsvp-cell.no       { background: rgba(139,42,42,0.15);  color: var(--red); }
.rsvp-cell.maybe    { background: rgba(176,138,74,0.18); color: var(--gold); }
.rsvp-cell.awaiting { background: var(--bg);             color: var(--ink-faint); }
.rsvp-cell.na       { background: transparent;            color: var(--line-soft); }

/* Household section divider — separates groups inside the table.
   Styled as a wide span that spans every column. */
.rsvp-household-row td {
  background: var(--paper-2);
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.15em; color: var(--ink-faint);
  text-transform: uppercase;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line-soft);
}

/* Filter chip bar (read-only counts in PR 3). */
.filter-bar {
  display: flex; align-items: center; gap: var(--s-2);
  flex-wrap: wrap;
  padding: var(--s-3);
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  margin-bottom: var(--s-3);
}

/* "View-only" notice strip — explains the comment-as-flag pattern. */
.view-only-note {
  background: var(--paper-2);
  border-left: 3px solid var(--teal);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  margin-bottom: var(--s-3);
  font-size: 13px; line-height: 1.5;
}

/* Inline comment thread under a guest row. */
.rsvp-thread {
  background: var(--paper-2);
  border-left: 3px solid var(--coral-soft);
  border-radius: var(--r-sm);
  padding: var(--s-2) var(--s-3);
  margin-top: var(--s-2);
  font-size: 12px; line-height: 1.45;
}
.rsvp-thread .cmt-who { font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; color: var(--ink-faint); text-transform: uppercase; }
.rsvp-thread .cmt-body { margin-top: 4px; color: var(--ink); }
.rsvp-thread .cmt-actions { margin-top: var(--s-1); }
.rsvp-thread .cmt-actions button {
  background: none; border: 0; padding: 0;
  color: var(--coral-deep); font-size: 11px;
  font-family: inherit; cursor: pointer;
}

.rsvp-comment-form {
  margin-top: var(--s-2);
  padding: var(--s-2) var(--s-3);
  background: var(--paper-2);
  border: 1px dashed var(--line-soft);
  border-radius: var(--r-sm);
}
.rsvp-comment-form textarea {
  width: 100%; min-height: 60px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft); border-radius: var(--r-sm);
  background: var(--paper); font: inherit; font-size: 13px;
  resize: vertical; margin-bottom: var(--s-2);
}
.rsvp-comment-form .actions { display: flex; gap: var(--s-2); justify-content: flex-end; }

/* CSV-upload modal head — wireframe's <h2> + close button row. The
   .modal-head and .modal-body classes are wireframe-local; the
   stricter portal.css uses .modal-header / .modal-body / .modal-footer
   per the modal pattern. We accept both vocabularies via this rule. */
.modal-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: var(--s-4) var(--s-5) var(--s-3);
  border-bottom: 1px solid var(--line-faint);
  margin-bottom: var(--s-3);
}
.modal-head h2 { font-family: var(--display); font-weight: 500; font-size: 20px; color: var(--navy); }
.modal-head .close-x { background: transparent; border: 0; font-size: 18px; cursor: pointer; color: var(--ink-soft); padding: 4px 8px; }
.modal-head .close-x:hover { color: var(--coral-deep); }

/* Per-row meal-choice + dietary line, indented under the guest name. */
.rsvp-meal-line {
  display: block;
  font-size: 11px;
  color: var(--ink-soft);
  margin-top: 3px;
  font-family: var(--mono);
  letter-spacing: 0.05em;
}

/* ── Layout / Seating primitives (PR 4) ───────────────────── */

/* Sub-event tab bar — each tab is a link. Active tab uses
   --navy underline + bolder weight; inactive tabs are muted. */
.layout-tabs {
  display: flex; gap: var(--s-2); flex-wrap: wrap;
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--line-faint);
  margin-bottom: var(--s-4);
}
.layout-tabs a {
  padding: 8px 14px;
  font-size: 13px; color: var(--ink-soft);
  border-radius: var(--r-sm);
  text-decoration: none;
  background: transparent;
  border: 1px solid var(--line-soft);
}
.layout-tabs a:hover { color: var(--coral-deep); border-color: var(--coral); }
.layout-tabs a.is-active {
  background: var(--navy); color: var(--paper); border-color: var(--navy);
  font-weight: 500;
}

/* Active sub-event header strip — venue space + counts. */
.layout-subevent-meta {
  display: flex; gap: var(--s-3); align-items: baseline;
  flex-wrap: wrap;
  margin-bottom: var(--s-3);
  font-size: 13px; color: var(--ink-soft);
}
.layout-subevent-meta .venue-name {
  font-family: var(--display); font-weight: 500; font-size: 18px;
  color: var(--navy);
}
.layout-subevent-meta .num { font-family: var(--mono); color: var(--ink); }

/* Floor-plan viewer card. */
.floor-plan-viewer {
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: var(--s-3);
  margin-bottom: var(--s-4);
  text-align: center;
  overflow: hidden;
}
.floor-plan-viewer img {
  max-width: 100%; height: auto;
  border-radius: var(--r-sm);
  background: var(--paper);
}
.floor-plan-placeholder {
  background: var(--paper-2);
  border: 2px dashed var(--line-soft);
  border-radius: var(--r-md);
  padding: var(--s-7) var(--s-5);
  margin-bottom: var(--s-4);
  text-align: center;
  color: var(--ink-faint);
}
.floor-plan-placeholder .icon {
  font-size: 32px; opacity: 0.5; margin-bottom: var(--s-3);
}
.floor-plan-placeholder h3 {
  font-family: var(--display); font-weight: 500; font-size: 18px;
  color: var(--ink); margin-bottom: var(--s-2);
}
.floor-plan-placeholder p { font-size: 13px; max-width: 480px; margin: 0 auto; line-height: 1.5; }

/* Side-panel table list. */
.seating-table-list {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: var(--s-4);
}
.seating-table-list .head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: var(--s-3) var(--s-4);
  background: var(--paper-2);
  border-bottom: 1px solid var(--line-soft);
}
.seating-table-list .head h3 { font-family: var(--display); font-weight: 500; font-size: 17px; color: var(--navy); }
.seating-table-list .head .count { font-family: var(--mono); font-size: 10px; letter-spacing: 0.15em; color: var(--ink-faint); text-transform: uppercase; }

.seating-table-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  align-items: start;
  border-bottom: 1px solid var(--line-faint);
}
.seating-table-row:last-of-type { border-bottom: 0; }
.seating-table-row:hover { background: var(--paper-2); }
/* Tables with capacity > assignments.length: dimmed (visual cue for
   empty seats). Spec field-note line 149-150. */
.seating-table-row.is-not-full .seating-table-row__main { opacity: 0.75; }

.seating-table-row__label {
  font-family: var(--display); font-weight: 500; font-size: 16px; color: var(--navy);
}
.seating-table-row__cap {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em;
  color: var(--ink-faint); text-transform: uppercase;
  margin-left: 8px;
}
.seating-table-row__assignments {
  font-size: 13px; color: var(--ink-soft); margin-top: 4px; line-height: 1.5;
}
.seating-table-row__assignments .empty {
  font-style: italic; color: var(--ink-faint);
}

/* Comment thread inside a table row (reuses cart-line-comment-thread
   look but unindented since the table row already has columns). */
.layout-thread {
  grid-column: 1 / -1;
  margin-top: var(--s-2);
  padding: var(--s-2) var(--s-3);
  background: var(--paper-2);
  border-left: 3px solid var(--coral-soft);
  border-radius: var(--r-sm);
  font-size: 12px; line-height: 1.45;
}
.layout-thread .cmt-who { font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; color: var(--ink-faint); text-transform: uppercase; }
.layout-thread .cmt-body { margin-top: 4px; color: var(--ink); }
.layout-thread .cmt-actions { margin-top: var(--s-1); }
.layout-thread .cmt-actions button {
  background: none; border: 0; padding: 0;
  color: var(--coral-deep); font-size: 11px;
  font-family: inherit; cursor: pointer;
}

.layout-comment-form {
  grid-column: 1 / -1;
  margin-top: var(--s-2);
  padding: var(--s-2) var(--s-3);
  background: var(--paper-2);
  border: 1px dashed var(--line-soft);
  border-radius: var(--r-sm);
}
.layout-comment-form textarea {
  width: 100%; min-height: 60px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft); border-radius: var(--r-sm);
  background: var(--paper); font: inherit; font-size: 13px;
  resize: vertical; margin-bottom: var(--s-2);
}
.layout-comment-form .actions { display: flex; gap: var(--s-2); justify-content: flex-end; }

/* General-feedback card — standing affordance below the table list
   on every sub-event tab. Different border accent (teal) to
   distinguish from per-table threads (coral). */
.general-feedback-card {
  background: var(--paper);
  border: 1px solid var(--teal);
  border-left: 3px solid var(--teal);
  border-radius: var(--r-md);
  padding: var(--s-4);
  margin-bottom: var(--s-4);
}
.general-feedback-card .head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: var(--s-3);
}
.general-feedback-card .head h3 { font-family: var(--display); font-weight: 500; font-size: 17px; color: var(--navy); }
.general-feedback-card .head .meta { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; color: var(--ink-faint); text-transform: uppercase; }
.general-feedback-card .thread-empty {
  font-size: 13px; color: var(--ink-faint); font-style: italic; margin-bottom: var(--s-2);
}

/* ── Documents primitives (PR 5) ──────────────────────────── */

/* Page summary strip — totals + last-published pill. */
.docs-summary {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: var(--s-3);
  margin-bottom: var(--s-4);
  font-size: 13px; color: var(--ink-soft);
}
.docs-summary .lead {
  font-family: var(--display); font-weight: 500; font-size: 18px;
  color: var(--navy);
}

/* Compact row used for every non-awaiting document (signed contracts,
   quotes, COIs). Icon + body + status pill + download. */
.doc-row {
  display: grid;
  grid-template-columns: 48px 1fr auto auto;
  gap: var(--s-3); align-items: center;
  padding: var(--s-3) var(--s-4);
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  margin-bottom: var(--s-2);
}
.doc-row:hover { border-color: var(--coral); }

.doc-ico {
  width: 48px; height: 48px;
  border-radius: var(--r-sm);
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
}
.doc-ico--pdf { background: var(--coral); color: var(--paper); border-color: var(--coral); }

.doc-name {
  font-weight: 500; color: var(--navy);
  font-size: 14px; line-height: 1.4;
}
.doc-meta {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.08em; color: var(--ink-faint);
  text-transform: uppercase;
  margin-top: 3px;
}

/* Inline document-type chips before doc names. The wireframe uses
   slightly different colors per type (Quote=gold, Contract=green,
   Misc=ghost) — replicate verbatim. */
.doc-type-chip {
  display: inline-block;
  font-family: var(--mono); font-size: 9px;
  font-weight: 600; letter-spacing: 0.12em;
  padding: 1px 7px;
  border-radius: var(--r-sm);
  margin-right: 6px;
  vertical-align: middle;
  text-transform: capitalize;
}
.doc-type-chip--quote    { background: #f5d97a;        color: #5c3d00; border: 1px solid #5c3d00; }
.doc-type-chip--contract { background: #cfe9d0;        color: #1f5128; border: 1px solid #1f5128; }
.doc-type-chip--misc     { background: var(--paper-2); color: var(--ink-soft); border: 1px solid var(--line-soft); }

/* Awaiting-signature expanded card — header strip + signers list +
   stacked iframes. Coral border to draw the eye. */
.sig-card {
  border: 2px solid var(--coral);
  border-radius: var(--r-md);
  background: var(--paper);
  margin-bottom: var(--s-4);
  overflow: hidden;
}
.sig-card__head {
  display: flex; justify-content: space-between; gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: rgba(195,107,90,0.06);
  border-bottom: 1px solid var(--line-faint);
  align-items: center;
}
.sig-card__head-main { display: flex; gap: var(--s-3); align-items: center; }

.signers-list {
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line-faint);
}
.signers-list .section-label { margin-top: 0; }
.signer-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--s-3);
  padding: 8px 0;
  border-top: 1px dashed var(--line-faint);
}
.signer-row:first-of-type { border-top: 0; }
.signer-row .who {
  font-size: 13px;
}
.signer-row .who strong { color: var(--navy); }
.signer-row .who .email {
  font-family: var(--mono); font-size: 10px;
  color: var(--ink-faint); margin-left: 6px;
}

.signer-status-pill {
  font-family: var(--mono); font-size: 9px;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 2px 8px; border-radius: var(--r-sm);
}
.signer-status-pill.pending  { background: var(--coral-soft); color: var(--coral-deep); border: 1px solid var(--coral); }
.signer-status-pill.viewed   { background: var(--teal-soft);  color: var(--teal);       border: 1px solid var(--teal); }
.signer-status-pill.signed   { background: rgba(91,123,79,0.12);  color: var(--green); border: 1px solid var(--green); }
.signer-status-pill.declined { background: rgba(139,42,42,0.10);  color: var(--red);   border: 1px solid var(--red); }

/* Iframe shell per signer — 560px height per the wireframe. Renders
   eversign's hosted signer UI inline. JS load-detect reveals the
   .link-out-fallback button if the iframe fails to load (typical
   cause: CSP frame-ancestors blocks framing). */
.iframe-host {
  position: relative;
  background: #fafafa;
  border-top: 1px solid var(--line-faint);
  padding: var(--s-3);
}
.iframe-host__caption {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.12em; color: var(--ink-soft);
  text-transform: uppercase;
  margin-bottom: var(--s-2);
  display: flex; justify-content: space-between; align-items: center;
}
.iframe-host iframe {
  display: block; width: 100%; height: 560px; border: 0;
  background: #fff;
  border-radius: var(--r-sm);
}
.link-out-fallback {
  display: none;   /* JS toggles to flex on iframe load failure */
  flex-direction: column;
  align-items: center; justify-content: center;
  gap: var(--s-2);
  padding: var(--s-7) var(--s-4);
  background: var(--paper-2);
  border: 1px dashed var(--line-soft);
  border-radius: var(--r-sm);
  min-height: 220px;
  text-align: center;
}
.link-out-fallback.is-revealed { display: flex; }
.link-out-fallback .reason {
  font-size: 12px; color: var(--ink-soft); max-width: 380px;
}

/* Bottom-of-card explainer strip — "after signing, eversign emails
   Jessica..." */
.sig-card__footer {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.05em; color: var(--ink-soft);
  padding: var(--s-2) var(--s-4);
  background: var(--paper-2);
  margin: 0;
}

/* ── Billing primitives (PR 6) ────────────────────────────── */

.billing-breakdown {
  font-size: 13px; color: var(--ink-soft);
  margin-top: var(--s-1);
}
.billing-breakdown li {
  list-style: none;
  display: flex; justify-content: space-between; gap: var(--s-3);
  padding: 2px 0;
  max-width: 360px;
}
.billing-breakdown li.is-house { color: var(--coral-deep); font-weight: 500; }

.milestone-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: var(--s-3); align-items: center;
  padding: var(--s-3) var(--s-4);
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--line-soft);
  border-radius: var(--r-md);
  margin-bottom: var(--s-2);
}
.milestone-row:hover { border-color: var(--coral); }
.milestone-row.is-paid     { border-left-color: var(--green); }
.milestone-row.is-due-soon { border-left-color: var(--gold); }
.milestone-row.is-overdue  { border-left-color: var(--coral-deep); background: rgba(195,107,90,0.03); }
.milestone-row.is-upcoming { border-left-color: var(--line-soft); }

.milestone-row__main { display: grid; grid-template-columns: 1fr; gap: 2px; }
.milestone-row__name { font-weight: 500; color: var(--navy); font-size: 14px; }
.milestone-row__name .house-pill { margin-right: 6px; }
.milestone-row__meta { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; color: var(--ink-faint); text-transform: uppercase; }
.milestone-row__amount { font-family: var(--display); font-weight: 500; font-size: 18px; color: var(--navy); text-align: right; min-width: 100px; }
.milestone-row__amount .currency { font-size: 11px; color: var(--ink-faint); }

/* Expanded forms (payment-confirmation, comment) — collapsed by
   default, revealed by JS toggle. */
.milestone-form {
  grid-column: 1 / -1;
  margin-top: var(--s-2);
  padding: var(--s-3);
  background: var(--paper-2);
  border: 1px dashed var(--line-soft);
  border-radius: var(--r-sm);
}
.milestone-form .row-2 { gap: var(--s-3); }
.milestone-form .actions { display: flex; gap: var(--s-2); justify-content: flex-end; margin-top: var(--s-2); }
.milestone-form select, .milestone-form input[type="text"], .milestone-form input[type="number"] {
  padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: var(--r-sm);
  background: var(--paper); font: inherit; font-size: 13px; width: 100%;
}
.milestone-form textarea {
  width: 100%; min-height: 60px; padding: 8px 10px;
  border: 1px solid var(--line-soft); border-radius: var(--r-sm);
  background: var(--paper); font: inherit; font-size: 13px;
  resize: vertical; margin-bottom: var(--s-2);
}

.milestone-thread {
  grid-column: 1 / -1;
  margin-top: var(--s-2);
  padding: var(--s-2) var(--s-3);
  background: var(--paper-2);
  border-left: 3px solid var(--coral-soft);
  border-radius: var(--r-sm);
  font-size: 12px; line-height: 1.45;
}
.milestone-thread .cmt-who  { font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; color: var(--ink-faint); text-transform: uppercase; }
.milestone-thread .cmt-body { margin-top: 4px; color: var(--ink); }

/* ── Timeline / Checklist primitives (PR 6) ───────────────── */

/* Tabs reuse .layout-tabs visual shape — alias for clarity. */
.timeline-tabs { /* same as .layout-tabs */ }

.checklist-bucket {
  margin-bottom: var(--s-4);
}
.checklist-bucket__head {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.15em; color: var(--ink-faint);
  text-transform: uppercase; font-weight: 600;
  margin-bottom: var(--s-2);
  padding-bottom: var(--s-1);
  border-bottom: 1px solid var(--line-faint);
}

.task-row {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: var(--s-3); align-items: start;
  padding: var(--s-3) var(--s-4);
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  margin-bottom: var(--s-2);
}
.task-row:hover { border-color: var(--coral); }
.task-row.is-done { background: var(--paper-2); }
.task-row.is-done .task-row__label { color: var(--ink-faint); text-decoration: line-through; }

.task-row__check {
  display: inline-block;
  width: 22px; height: 22px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-soft);
  background: var(--paper);
  position: relative; cursor: pointer;
  transition: all 100ms;
}
.task-row__check.is-done { background: var(--green); border-color: var(--green); }
.task-row__check.is-done::after {
  content: '✓'; color: var(--paper);
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: bold;
}
.task-row__check[disabled], .task-row__check.is-disabled {
  cursor: not-allowed; opacity: 0.55;
}
.task-row__check[disabled]:hover, .task-row__check.is-disabled:hover { border-color: var(--line-soft); }

.task-row__main { display: grid; grid-template-columns: 1fr; gap: 3px; }
.task-row__label { font-size: 14px; color: var(--navy); }
.task-row__meta {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.08em; color: var(--ink-faint);
  text-transform: uppercase;
}
.task-row__assignee {
  display: inline-block;
  padding: 1px 6px; border-radius: var(--r-sm);
  background: var(--paper-2); color: var(--ink-soft);
  border: 1px solid var(--line-soft);
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.12em;
  text-transform: uppercase;
}
.task-row__assignee.is-mine { background: var(--coral-soft); color: var(--coral-deep); border-color: var(--coral); }

.task-row__actions { display: flex; gap: var(--s-1); }
.task-row__thread {
  grid-column: 2 / -1;
  margin-top: var(--s-2);
  padding: var(--s-2) var(--s-3);
  background: var(--paper-2);
  border-left: 3px solid var(--coral-soft);
  border-radius: var(--r-sm);
  font-size: 12px; line-height: 1.45;
}
.task-row__thread .cmt-who  { font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; color: var(--ink-faint); text-transform: uppercase; }
.task-row__thread .cmt-body { margin-top: 4px; color: var(--ink); }
.task-row__form {
  grid-column: 2 / -1;
  margin-top: var(--s-2);
  padding: var(--s-2) var(--s-3);
  background: var(--paper-2);
  border: 1px dashed var(--line-soft);
  border-radius: var(--r-sm);
}
.task-row__form textarea {
  width: 100%; min-height: 50px; padding: 6px 10px;
  border: 1px solid var(--line-soft); border-radius: var(--r-sm);
  background: var(--paper); font: inherit; font-size: 12px;
  resize: vertical; margin-bottom: var(--s-2);
}

/* Day-of timeline rows — gantt-ish (no actual bar viz, just time +
   label). Simpler than the wireframe's gantt mock but adequate for
   the spec's data shape. */
.gantt-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: var(--s-3); align-items: start;
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line-faint);
}
.gantt-row:last-child { border-bottom: 0; }
.gantt-row:hover { background: var(--paper-2); }
.gantt-row__time { font-family: var(--mono); font-size: 12px; color: var(--ink); font-variant-numeric: tabular-nums; }
.gantt-row__time .end { display: block; font-size: 10px; color: var(--ink-faint); margin-top: 2px; }
.gantt-row__label { font-size: 14px; color: var(--navy); font-weight: 500; }
.gantt-row__actor {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.08em; color: var(--ink-faint);
  text-transform: uppercase; margin-top: 3px;
}
.gantt-row__icon {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper-2);
  font-size: 11px; color: var(--ink-soft);
}

.gantt-subevent-head {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.15em; color: var(--ink-faint);
  text-transform: uppercase; font-weight: 600;
  padding: var(--s-3) var(--s-4) var(--s-2);
  background: var(--paper-2);
  border-bottom: 1px solid var(--line-soft);
}
.gantt-subevent { background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--r-md); margin-bottom: var(--s-3); overflow: hidden; }

/* ── Contacts primitives (PR 6) ─────────────────────────────
   Group → contact parent/child layout. Group header is bigger +
   more prominent (display font), and a coral left rule under the
   header continues down through every child card so the parent/child
   relationship is visible at a glance. Card padding tightened to
   reduce vertical airspace between rows.
*/

.contacts-group {
  margin-bottom: var(--s-4);
  padding-left: var(--s-2);
  border-left: 2px solid var(--coral-soft, rgba(195,107,90,0.18));
}
.contacts-group__head {
  font-family: var(--display, serif);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--ink, #1F1B18);
  margin: 0 0 var(--s-2) calc(-1 * var(--s-2));
  padding-left: var(--s-2);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 4px;
}
.contacts-group__head .count {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.contact-card {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: var(--s-3);
  padding: 8px 12px;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  margin-bottom: 4px;
  margin-left: var(--s-3);
  align-items: center;
}
.contact-card:hover { border-color: var(--coral); }
.contact-card.is-self {
  background: rgba(195,107,90,0.04);
  border-color: var(--coral);
}
.contact-card.is-invite-pending { opacity: 0.65; }

.contact-card__avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--coral-soft); color: var(--coral-deep);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 16px; font-weight: 500;
}
.contact-card__avatar.kind-planner          { background: var(--teal-soft); color: var(--teal); }
.contact-card__avatar.kind-portal_member    { background: var(--coral-soft); color: var(--coral-deep); }
.contact-card__avatar.kind-venue            { background: rgba(176,138,74,0.18); color: var(--gold); }
.contact-card__avatar.kind-rental_vendor,
.contact-card__avatar.kind-service_provider { background: var(--paper-2); color: var(--ink-soft); border: 1px solid var(--line-soft); }

.contact-card__main { display: grid; grid-template-columns: 1fr; gap: 2px; }
.contact-card__name { font-family: var(--display); font-weight: 500; font-size: 15px; color: var(--navy); line-height: 1.25; }
.contact-card__name .you-tag { font-size: 11px; color: var(--coral-deep); margin-left: 6px; }
.contact-card__role {
  font-family: var(--mono); font-size: 9px;
  letter-spacing: 0.15em; color: var(--ink-faint);
  text-transform: uppercase; margin-top: 2px;
}
.contact-card__meta {
  font-size: 12px; color: var(--ink-soft);
  margin-top: 4px;
  display: flex; gap: var(--s-3); flex-wrap: wrap;
}
.contact-card__meta a { color: var(--coral-deep); }
.contact-card__meta .mono { font-family: var(--mono); font-size: 11px; color: var(--ink-soft); }
.contact-card__availability {
  font-style: italic; color: var(--ink-soft); font-size: 12px;
  margin-top: var(--s-1);
}

.contact-card__actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* Comment thread under a contact card. */
.contact-thread {
  grid-column: 2 / -1;
  margin-top: var(--s-2);
  padding: var(--s-2) var(--s-3);
  background: var(--paper-2);
  border-left: 3px solid var(--coral-soft);
  border-radius: var(--r-sm);
  font-size: 12px; line-height: 1.45;
}
.contact-thread .cmt-who  { font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; color: var(--ink-faint); text-transform: uppercase; }
.contact-thread .cmt-body { margin-top: 4px; color: var(--ink); }
.contact-form {
  grid-column: 2 / -1;
  margin-top: var(--s-2);
  padding: var(--s-2) var(--s-3);
  background: var(--paper-2);
  border: 1px dashed var(--line-soft);
  border-radius: var(--r-sm);
}
.contact-form textarea {
  width: 100%; min-height: 50px; padding: 6px 10px;
  border: 1px solid var(--line-soft); border-radius: var(--r-sm);
  background: var(--paper); font: inherit; font-size: 12px;
  resize: vertical; margin-bottom: var(--s-2);
}
.contact-form .actions { display: flex; gap: var(--s-2); justify-content: flex-end; }

/* ── Settings-page session/notification row primitives ────── */

.settings-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--s-2) 0;
  border-bottom: 1px solid var(--line-faint);
}
.settings-row:last-child { border-bottom: 0; }
.settings-row .lbl { font-size: 13px; }
.settings-row .meta { font-size: 11px; color: var(--ink-faint); }

/* ── Modal overlay (lifted verbatim from wireframe) ───────── */

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(31,27,24,0.55);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: var(--s-5);
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--paper); border-radius: var(--r-md);
  box-shadow: 0 12px 40px rgba(31,27,24,0.20);
  width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto;
}
.modal-header { padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--line-faint); }
.modal-header h3 { font-family: var(--display); font-weight: 500; font-size: 20px; }
.modal-header .sub { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.modal-body { padding: var(--s-4) var(--s-5); }
.modal-footer {
  padding: var(--s-3) var(--s-5);
  border-top: 1px solid var(--line-faint);
  background: var(--paper-2);
  display: flex; align-items: center; justify-content: flex-end;
  gap: var(--s-2);
}

/* ── Toast (lifted verbatim) ──────────────────────────────── */

.toast {
  position: fixed; bottom: 20px; right: 20px;
  background: var(--navy); color: var(--paper);
  padding: 10px 16px; border-radius: var(--r-sm);
  font-size: 12px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  transform: translateY(10px);
  z-index: 200;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ── Mobile reflow ─────────────────────────────────────────── */

@media (max-width: 720px) {
  .row-2 { grid-template-columns: 1fr; }
  .auth-card { padding: var(--s-5) var(--s-4); }
  .auth-card--wide .row-2 { grid-template-columns: 1fr; }
  .code-input-row { gap: 4px; }
  .code-input { font-size: 22px; }
}


/* ============================================================
   CHAT-BUBBLE THREADS (shared)
   Used by billing milestones, contract cards, layout tables, and
   the general-feedback panels. Originally inlined in billing.php;
   lifted here in 2026-05-27 so layout.php picks them up too.
   ============================================================ */

.bill-thread-disclosure { margin-top: 4px; }
.bill-thread-summary {
  /* Unified pill — matches .cart-thread__summary so every comment
     toggle across the portal renders identically. */
  cursor: pointer;
  font-size: 12px;
  color: var(--ink-soft, #6b6055);
  padding: 4px 10px;
  background: var(--paper-2, #faf4e6);
  border: 1px solid var(--line-soft, #d8cdb8);
  border-radius: 999px;
  list-style: none;
  display: inline-flex; align-items: center; gap: 6px;
  user-select: none;
  line-height: 1;
}
.bill-thread-summary:hover { color: var(--coral-deep); border-color: var(--coral, #c36b5a); background: var(--paper, #fff); }
.bill-thread-summary::-webkit-details-marker { display: none; }
.bill-thread-summary::marker { content: ''; }
.bill-thread-summary .count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 18px;
  padding: 0 7px;
  background: var(--paper, #fff);
  border: 1px solid var(--line-soft, #d8cdb8);
  border-radius: 999px;
  font-family: var(--mono, monospace);
  font-variant-numeric: tabular-nums;
  font-size: 10px;
  color: var(--ink-soft, #6b6055);
  line-height: 1;
}
.bill-thread-summary__client-pill {
  font-family: var(--mono); font-size: 9px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--coral-deep); background: var(--coral-soft);
  padding: 1px 5px; border-radius: 3px;
}

.bill-thread-chat {
  margin-top: 6px; padding: 12px;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  display: flex; flex-direction: column; gap: 12px;
  max-height: 420px;
  overflow-y: auto;
}
.bill-bubble-row {
  display: flex; gap: 8px;
  align-items: flex-end;
}
.bill-bubble-row--right { justify-content: flex-end; }
.bill-bubble-row--left  { justify-content: flex-start; }
.bill-bubble-wrap {
  display: flex; flex-direction: column;
  max-width: 75%;
  min-width: 0;
}
.bill-bubble-row--left .bill-bubble-wrap { align-items: flex-start; }
.bill-bubble-row--right .bill-bubble-wrap { align-items: flex-end; }
.bill-bubble {
  padding: 5px 10px;
  font-size: 12.5px;
  line-height: 1.35;
  white-space: pre-wrap;
  word-wrap: break-word;
  word-break: break-word;
  /* Shrink to content; the wrap's max-width caps any longer text.
     Without this, the bubble stretches to the wider sibling meta
     line, producing a giant bubble around a one-word message. */
  width: fit-content;
  max-width: 100%;
}
.bill-bubble--operator {
  background: var(--coral);
  color: #fff;
  border-radius: 14px 14px 4px 14px;
}
.bill-bubble--client {
  background: var(--paper-2);
  color: var(--ink);
  border: 1px solid var(--line-soft);
  border-radius: 14px 14px 14px 4px;
}
.bill-bubble-meta {
  margin: 4px 0 0 6px;
  font-size: 9px;
  letter-spacing: 0.08em;
}
.bill-bubble-meta--right { text-align: right; margin: 4px 6px 0 0; }
.bill-bubble-avatar {
  width: 22px; height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px;
  font-weight: 600;
}
.bill-bubble-avatar--operator {
  background: var(--coral-deep);
  color: #fff;
}
.bill-bubble-avatar--client {
  background: var(--paper-2);
  color: var(--ink);
  border: 1px solid var(--line-soft);
}

/* Inline images rendered from `![alt](url)` markdown in comment
   bodies — bounded so a large screenshot doesn't blow out the bubble. */
.bill-bubble-img {
  display: block;
  max-width: 100%;
  max-height: 320px;
  margin-top: 6px;
  border-radius: 8px;
  cursor: zoom-in;
}
.bill-bubble-img:first-child { margin-top: 0; }

/* Reply form */
.bill-thread-reply {
  margin-top: 8px;
  display: flex; gap: 8px; align-items: flex-end;
  padding: 8px;
  background: var(--paper-2);
  border-radius: 6px;
}
.bill-thread-reply__textarea {
  flex: 1;
  resize: vertical;
  min-height: 36px;
  font-family: inherit;
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: var(--paper);
  color: var(--ink);
}
.bill-thread-reply__textarea.is-dragover {
  border: 2px dashed var(--coral) !important;
  background: var(--coral-soft) !important;
}
.bill-thread-reply__buttons {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.bill-thread-reply__file-label {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 6px;
  cursor: pointer;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  font-size: 16px;
  user-select: none;
  transition: background 0.15s;
}
.bill-thread-reply__file-label:hover {
  background: var(--paper-2);
  border-color: var(--coral);
}
.bill-thread-reply__file-label.is-uploading {
  opacity: 0.6; cursor: wait;
}
.bill-thread-reply__caption {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

/* Document attachment chip in chat bubbles. Renders inline below
   text content; clickable to open the doc in a new tab. The icon +
   name stack horizontally with a subtle border to read as a
   contained pill. */
.bill-bubble-doc {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 4px 10px 4px 8px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  font-size: 12px;
  color: var(--ink);
  text-decoration: none;
  max-width: 100%;
}
.bill-bubble-doc:hover {
  border-color: var(--coral);
  color: var(--coral-deep);
}
.bill-bubble-doc__icon { font-size: 14px; flex-shrink: 0; }
.bill-bubble-doc__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.bill-bubble-doc:first-child { margin-top: 0; }
/* Inside an operator bubble (coral bg), the chip needs lighter
   contrast since rgba paper-on-coral reads muddy. */
.bill-bubble--operator .bill-bubble-doc {
  background: rgba(255, 253, 248, 0.95);
  border-color: rgba(255, 253, 248, 0.4);
}

/* Unread red-dot in disclosure summary — shows when latest-planner-at
   on the <details> is newer than the browser's seen-at for this
   thread (sessionStorage). Hidden by default; portal-thread.js
   toggles `hidden` on/off. */
.bill-thread-summary__unread {
  width: 8px; height: 8px;
  background: #d83a3a;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--paper);
  display: inline-block;
}
/* Explicit hidden-attr override — the class rule above sets
   `display: inline-block` at the same specificity as `[hidden]`, so
   without this rule the browser's default `[hidden] { display: none }`
   loses on cascade order and the dot stays visible even when the
   server pre-renders the hidden attribute (or portal-thread.js
   re-applies it on toggle). */
.bill-thread-summary__unread[hidden] { display: none; }

/* ============================================================
   LAYOUT PAGE — two-column shell (wireframe #page-seating)
   ============================================================ */
.seating-shell-portal {
  display: grid;
  grid-template-columns: 1fr 340px;
  align-items: stretch;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  overflow: hidden;
  margin: 0 0 var(--s-4);
}
@media (max-width: 920px) {
  .seating-shell-portal { grid-template-columns: 1fr; }
  .seating-panel { border-left: 0 !important; border-top: 1px solid var(--line-soft); }
}

.canvas-wrap {
  position: relative;
  background: var(--paper-2);
  overflow: hidden;
  /* Pin the canvas to the TOP of its grid cell. Never center it
     vertically — any leftover space in the panel column lives
     under the last panel-group, not above the canvas. */
  display: block;
  align-self: start;
}
/* Canvas takes its natural aspect from the published SVG's viewBox
   (1200x800 by default). aspect-ratio + width:100% lets the canvas
   grow with the column; the panel column stretches to match via
   align-items: stretch on the grid. */
.layout-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(215,204,185,0.4) 1px, transparent 1px),
    linear-gradient(90deg, rgba(215,204,185,0.4) 1px, transparent 1px);
  background-size: 20px 20px;
  overflow: hidden;
  display: block;
}
.layout-canvas > svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Direct-on-SVG hover + selected. The published SVG's
   <g class="seating-table"> + <g class="floor-primitive"> are the
   click targets — JS adds .is-selected on click. Hover GLOWS the
   whole <g> via filter:drop-shadow so non-rect/ellipse shapes (paths,
   custom primitives) get the indication too. Selected = brighter
   glow + thicker stroke. */
.layout-canvas .seating-table,
.layout-canvas .floor-primitive {
  cursor: pointer;
  transition: filter 160ms ease;
}
/* Background-mode primitives + text-label kinds are decorative —
   never clickable on the portal. Hover glow + selection ring
   suppressed by the pointer-events: none. */
.layout-canvas .floor-primitive.is-background,
.layout-canvas .floor-primitive.is-text-label {
  pointer-events: none; cursor: default;
}
.layout-canvas .seating-table:hover,
.layout-canvas .floor-primitive:not(.is-background):hover {
  filter: drop-shadow(0 0 6px rgba(195,107,90,0.55));
}
.layout-canvas .seating-table:hover > .table-shape,
.layout-canvas .seating-table:hover > ellipse,
.layout-canvas .seating-table:hover > rect,
.layout-canvas .seating-table:hover > path,
.layout-canvas .floor-primitive:not(.is-background):hover > .table-shape,
.layout-canvas .floor-primitive:not(.is-background):hover > ellipse,
.layout-canvas .floor-primitive:not(.is-background):hover > rect,
.layout-canvas .floor-primitive:not(.is-background):hover > path {
  stroke: var(--coral, #c36b5a);
  stroke-width: 2.2;
}
.layout-canvas .seating-table.is-selected,
.layout-canvas .floor-primitive.is-selected {
  filter: drop-shadow(0 0 10px rgba(195,107,90,0.75));
}
.layout-canvas .seating-table.is-selected > .table-shape,
.layout-canvas .seating-table.is-selected > ellipse,
.layout-canvas .seating-table.is-selected > rect,
.layout-canvas .seating-table.is-selected > path,
.layout-canvas .floor-primitive.is-selected > .table-shape,
.layout-canvas .floor-primitive.is-selected > ellipse,
.layout-canvas .floor-primitive.is-selected > rect,
.layout-canvas .floor-primitive.is-selected > path {
  stroke: var(--coral, #c36b5a);
  stroke-width: 2.6;
}
/* (Old .layout-prim overlay strategy retired — the published SVG is
   now inlined into #layout-canvas and the planner's own <g> elements
   are the click targets. See `.layout-canvas .seating-table` above.) */

/* Right-side panel — server-rendered, one block per primitive
   (hidden by default; JS toggles `is-active`). Height comes from the
   grid's align-items: stretch — matches the canvas exactly. */
.seating-panel {
  background: var(--paper-2);
  border-left: 1px solid var(--line-soft);
  display: flex; flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.seating-panel-section { display: none; flex-direction: column; flex: 1; min-height: 0; }
.seating-panel-section.is-active { display: flex; }
.seating-panel-head {
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line-soft);
  background: var(--paper);
}
.seating-panel-head h3 {
  font-family: var(--display); font-weight: 500; font-size: 20px;
  color: var(--navy); margin: 0;
}
.seating-panel-head .meta {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.15em;
  color: var(--ink-faint); text-transform: uppercase; margin-top: 4px;
}
.seating-panel-head .chip-pill {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 10px;
  background: var(--coral-soft);
  color: var(--coral-deep);
  border: 1px solid var(--coral);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
}
.seating-panel-body {
  padding: var(--s-3) var(--s-4);
  flex: 1;
  overflow-y: auto;
}
.seating-panel-body h6.section-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.15em;
  color: var(--ink-faint); text-transform: uppercase;
  margin: var(--s-3) 0 var(--s-2);
}
.seating-panel-body h6.section-label:first-child { margin-top: 0; }

/* Seated-guest list inside a table panel. */
.seated-list { display: flex; flex-direction: column; gap: 4px; }
.seated-row {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 8px; align-items: center;
  padding: 5px 8px;
  background: var(--paper);
  border: 1px solid var(--line-faint);
  border-radius: var(--r-sm);
  font-size: 12px;
}
.seated-row .num {
  font-family: var(--mono); font-size: 10px;
  color: var(--ink-faint); text-align: center;
}
.seated-row .name { font-weight: 500; color: var(--navy); }
.seated-row .role {
  font-family: var(--mono); font-size: 9px;
  letter-spacing: 0.1em; color: var(--ink-faint);
  text-transform: uppercase;
}
.seated-row.is-empty .name {
  font-style: italic; color: var(--ink-faint); font-weight: 400;
}

/* Rentals list inside a panel. */
.table-rentals { display: flex; flex-direction: column; gap: 6px; }
.table-rental-row {
  display: grid; grid-template-columns: 1fr auto;
  gap: var(--s-2); align-items: center;
  padding: 6px var(--s-2);
  background: var(--paper);
  border: 1px solid var(--line-faint);
  border-radius: var(--r-sm);
  font-size: 12px;
}
.table-rental-row .rental-name {
  font-weight: 500; color: var(--navy);
}
.table-rental-row .rental-sub {
  font-family: var(--mono); font-size: 9px;
  letter-spacing: 0.06em; color: var(--ink-faint);
  margin-top: 2px;
}
.table-rental-row .rental-qty {
  font-family: var(--mono); font-size: 11px;
  color: var(--ink-soft);
}

/* ============================================================
   LAYOUT PAGE — item thumbnail grid + lightbox + general thread
   ============================================================ */
/* Items list — vertical stack, one row per item. Mini thumb on left,
   name + vendor stacked to the right. Click the row (or specifically
   the thumb) opens the lightbox gallery. */
.layout-item-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: var(--s-3);
}
.layout-item-card {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: var(--s-2);
  align-items: center;
  padding: 6px 8px;
  background: var(--paper);
  border: 1px solid var(--line-faint);
  border-radius: var(--r-sm);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  width: 100%;
  transition: border-color 120ms, background 120ms;
}
.layout-item-card:hover { border-color: var(--coral, #c36b5a); background: var(--paper-2); }
.layout-item-card[data-gallery-disabled="1"] { cursor: default; }
.layout-item-card[data-gallery-disabled="1"]:hover { border-color: var(--line-faint); background: var(--paper); }
.layout-item-thumb {
  width: 40px; height: 40px;
  background-color: var(--paper-2);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 2px;
  border: 1px solid var(--line-soft);
  display: block;
}
.layout-item-thumb--empty {
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--ink-faint);
  background-color: var(--paper-2);
  background-image: none;
}
.layout-item-meta {
  display: flex; flex-direction: column; gap: 1px;
  min-width: 0;
  line-height: 1.3;
}
.layout-item-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.layout-item-vendor {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Lightbox modal — fixed full-screen overlay. Image + caption +
   prev/next + close button. Arrow-key cycling handled in JS. */
.layout-lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(31, 27, 24, 0.85);
  display: flex; align-items: center; justify-content: center;
  padding: var(--s-5);
}
.layout-lightbox[hidden] { display: none; }
.layout-lightbox__figure {
  margin: 0;
  max-width: 90vw; max-height: 90vh;
  display: flex; flex-direction: column;
  align-items: center; gap: var(--s-3);
}
.layout-lightbox__figure img {
  max-width: 100%; max-height: 80vh;
  object-fit: contain;
  background: var(--paper);
  border-radius: var(--r-sm);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
.layout-lightbox__figure figcaption {
  color: var(--paper);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  max-width: 80vw;
}
.layout-lightbox__close,
.layout-lightbox__nav {
  position: absolute;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--paper);
  cursor: pointer;
  font-size: 24px;
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background-color 120ms;
}
.layout-lightbox__close:hover,
.layout-lightbox__nav:hover { background: rgba(255, 255, 255, 0.28); }
.layout-lightbox__close { top: var(--s-4); right: var(--s-4); }
.layout-lightbox__nav--prev { left: var(--s-4); top: 50%; transform: translateY(-50%); }
.layout-lightbox__nav--next { right: var(--s-4); top: 50%; transform: translateY(-50%); }

/* General-feedback thread — wireframe-faithful full-width, all rows
   left-aligned (avatar + bubble). Matches portal_v3_mockup.html
   #page-seating .general-feedback. */
.layout-overall-thread {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: var(--s-4) var(--s-5);
  margin: 0;
}
.layout-overall-thread__head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: var(--s-3); flex-wrap: wrap;
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--line-faint);
  margin-bottom: var(--s-3);
}
.layout-overall-thread__head h3 {
  font-family: var(--display); font-weight: 500;
  font-size: 22px; color: var(--navy); margin: 0;
}
.layout-overall-thread__head .mono { font-size: 12px; }

.layout-overall-thread__list {
  display: flex; flex-direction: column; gap: var(--s-3);
  margin-bottom: var(--s-3);
}
.layout-overall-thread__row {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: var(--s-3);
  align-items: flex-start;
}
.layout-overall-thread__avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 600; font-size: 13px;
  color: var(--ink-soft);
}
.layout-overall-thread__avatar.is-planner {
  background: var(--coral-soft, rgba(195,107,90,0.18));
  border-color: var(--coral, #c36b5a);
  color: var(--coral-deep, #8a3f30);
}
.layout-overall-thread__avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.layout-overall-thread__bubble {
  padding: var(--s-2) var(--s-3);
  background: var(--paper);
  border: 1px solid var(--line-faint);
  border-radius: var(--r-sm);
}
.layout-overall-thread__who {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.12em; color: var(--ink-faint);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.layout-overall-thread__body {
  font-size: 14px; line-height: 1.5; color: var(--ink);
}
.layout-overall-thread__body img {
  max-width: 100%; max-height: 320px;
  border-radius: var(--r-sm); margin-top: 6px;
  display: block;
}

.layout-overall-thread__form textarea {
  width: 100%; min-height: 80px;
  padding: var(--s-3);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  background: var(--paper);
  font: inherit; font-size: 14px;
  resize: vertical;
}
.layout-overall-thread__post-row {
  display: flex; align-items: center; gap: var(--s-2);
  margin-top: var(--s-2);
}
.layout-overall-thread__post-row .mono { flex: 1; font-size: 11px; }
.layout-overall-thread__file-label {
  cursor: pointer;
  display: inline-flex;
}

/* ============================================================
   LAYOUT PAGE — panel content groups (stronger headers + grouping)
   ============================================================ */
/* Kill any ambient gap above the active panel section's head. */
.seating-panel-section {
  margin: 0; padding: 0;
}
.seating-panel-section.is-active {
  align-self: stretch;
  justify-content: flex-start;
}
.seating-panel-head {
  margin: 0;
  padding: var(--s-3) var(--s-4);
}
.seating-panel-head h3,
.seating-panel-head .meta,
.seating-panel-head .chip-pill {
  margin-top: 0;
}
.seating-panel-body {
  padding: var(--s-3) var(--s-4) var(--s-4);
}

/* A panel-group is a single titled section inside the panel body
   (Items / Guests / Comments / seat preview). Each is visually
   contained so the header clearly owns its child block. */
.panel-group {
  margin-bottom: var(--s-3);
  background: var(--paper);
  border: 1px solid var(--line-faint);
  border-radius: var(--r-sm);
  padding: var(--s-2) var(--s-3) var(--s-3);
}
.panel-group:last-child { margin-bottom: 0; }
/* The seat-preview group needs no chrome — the SVG is its own card. */
.panel-group--seat-preview {
  background: transparent;
  border: 0;
  padding: 0;
  margin-bottom: var(--s-3);
}

/* Strong, present section header inside each panel-group. Bigger,
   darker, and underlined so the visual hierarchy is obvious. */
.panel-group > .section-label,
.panel-group .section-label:first-child {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--navy, var(--ink));
  text-transform: uppercase;
  margin: 0 0 var(--s-2);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-faint);
}

/* =============================================================
 * MOBILE RESPONSIVE (2026-05-30) — phones < 640px wide.
 * =============================================================
 *
 * Pre-launch mobile pass. The portal had only desktop-leaning
 * breakpoints (600px, 720px, 920px). This block handles the
 * critical cart-panel layouts + tap-target sizing for phones.
 *
 * Scope: cart.php is the highest-traffic mobile surface (clients
 * review their cart on phones constantly). Modal, button, and pill
 * sizing also improve lookbook + billing + proposal pages because
 * they share the same primitives.
 */
@media (max-width: 640px) {

  /* Cart vendor card header — was a 4-column grid (name + status
   * pills + capability pills + caret), collapsed unreadably onto a
   * single line on phones. Stack vertically with the name on top
   * and metadata pills wrapping below. */
  .cart-vendor-head {
    grid-template-columns: 1fr !important;
    gap: var(--s-2);
  }
  .cart-vendor-head > * {
    grid-column: 1;
  }

  /* Cart line — was 64px thumb + 1fr name + auto qty + auto total
   * in 4 columns. On phones, stack vertically: thumb + name in row,
   * then qty + total in a second row underneath. */
  .cart-line {
    grid-template-columns: 56px 1fr;
    grid-template-rows: auto auto;
    row-gap: var(--s-1);
  }
  .cart-line__name {
    grid-column: 2;
    grid-row: 1;
  }
  .cart-line__qty,
  .cart-line__total {
    grid-column: 1 / -1;
    text-align: left;
    padding-top: 4px;
  }
  .cart-line__qty {
    grid-row: 2;
  }
  .cart-line__total {
    grid-row: 3;
    font-weight: 600;
    border-top: 1px solid var(--line-faint);
    padding-top: 6px;
  }
  /* Comment form spans full width on phones. */
  .cart-line-comment-form,
  .cart-line__revert-form {
    grid-column: 1 / -1;
  }

  /* Modal overlay padding reduced + modal width pinned to 96vw so
   * the dialog isn't pinched on 360px screens. */
  .modal-overlay {
    padding: var(--s-2);
  }
  .modal-body,
  .modal {
    max-width: 96vw;
    width: 96vw;
  }
  /* Billing signature iframe modal — needs nearly full screen on
   * phones for the signature pad to be usable. */
  .sign-modal__panel {
    width: 98vw !important;
    max-width: 98vw;
  }

  /* Touch-target hardening. Apple's HIG + Google's Material spec
   * both recommend 44×44 minimum. Bump the small buttons + status
   * pills so a thumb can hit them without zooming. */
  .btn,
  .btn--small,
  .btn--ghost {
    min-height: 44px;
    padding: 10px 14px;
  }
  .btn--small {
    font-size: 13px;
  }
  .vendor-status-pill,
  .pill.row-popover-trigger {
    padding: 8px 12px;
    font-size: 11px;
    min-height: 36px;  /* slightly under 44 because they sit beside
                           other 44px controls — visual balance > strict
                           thumb-friendliness for compact info chips */
  }

  /* Budget strip — drops from 2-up grid (set at 720px) all the way
   * to single column for phones. */
  .budget-strip {
    grid-template-columns: 1fr !important;
    gap: var(--s-3);
  }

  /* Toast — was bottom-right + 12px font. On mobile, soft keyboard
   * pushes content up; toasts at bottom-20 get covered. Raise to
   * bottom-60 and full-width pad so the message is readable. */
  .save-toast,
  .toast {
    bottom: 60px;
    left: var(--s-3);
    right: var(--s-3);
    text-align: center;
    font-size: 12px;
  }
}
