/* ============================================================
   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) ─────────────── */

:root {
  --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; }

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

.code-input-row {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px;
  margin-bottom: var(--s-4);
}
.code-input {
  aspect-ratio: 1; 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);
}

/* 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. */
.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;
}

/* 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. */
.cart-line {
  display: grid;
  grid-template-columns: 64px 1fr auto auto;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  align-items: center;
  border-bottom: 1px solid var(--line-faint);
}
.cart-line:last-child { border-bottom: 0; }
.cart-line:hover { background: var(--paper-2); }
.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;
}

/* 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) ───────────────────────────── */

.contacts-group {
  margin-bottom: var(--s-5);
}
.contacts-group__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-3);
  display: flex; align-items: baseline; justify-content: space-between;
}
.contacts-group__head .count {
  color: var(--ink-soft);
}

.contact-card {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: var(--s-3);
  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);
  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: 56px; height: 56px; 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: 22px; 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: 17px; color: var(--navy); }
.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; }
}
