/* ClientServed portal brand layer.
 *
 * Mirrors the marketing site at clientserved.com — warm-rust palette on a
 * cream ink background, Inter Tight + JetBrains Mono, glassmorphic nav,
 * ambient gradient + noise overlay. Loaded ALONGSIDE forge.css on
 * customer-facing pages; the cascade order is forge.css first (gives a
 * working dark dashboard for admin Theme Forge ops) then this file, which
 * overrides the customer-visible bits to match the marketing brand.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400;450;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --cs-bg: #FBF7F2;
  --cs-bg-2: #F5EFE6;
  --cs-bg-card: #FFFFFF;
  --cs-ink: #0F0F0E;
  --cs-ink-2: #2A2A27;
  --cs-muted: #6B665C;
  --cs-muted-2: #9A9488;
  --cs-line: rgba(15, 15, 14, 0.08);
  --cs-line-2: rgba(15, 15, 14, 0.12);

  --cs-accent: #D9552B;
  --cs-accent-2: #B83E17;
  --cs-accent-soft: #FCE7D9;
  --cs-gold: #B8882E;
  --cs-gold-soft: #F4EAD1;
  --cs-green: #2E7D5B;
  --cs-green-soft: #D9ECE1;
  --cs-blue: #25507A;
  --cs-violet: #5A4BC7;

  --cs-font-sans: 'Inter Tight', 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --cs-font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  /* cs-font-display kept as a variable so the cs-display* classes still work,
   * but pointed at Inter Tight so headings render in the original brand sans. */
  --cs-font-display: 'Inter Tight', 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  --cs-r-sm: 6px;
  --cs-r-md: 10px;
  --cs-r-lg: 14px;
  --cs-r-xl: 20px;
  --cs-r-pill: 999px;

  --cs-shadow-sm: 0 1px 2px rgba(15, 15, 14, 0.04), 0 1px 1px rgba(15, 15, 14, 0.03);
  --cs-shadow-md: 0 4px 12px rgba(15, 15, 14, 0.05), 0 2px 4px rgba(15, 15, 14, 0.04);
  --cs-shadow-lg: 0 24px 56px -18px rgba(15, 15, 14, 0.18), 0 8px 20px -10px rgba(15, 15, 14, 0.08);
  --cs-shadow-glow: 0 0 0 1px rgba(217, 85, 43, 0.18), 0 18px 50px -18px rgba(217, 85, 43, 0.45);
}

/* Scope: any page that pulls in this stylesheet swaps the dark forge dashboard
 * look for the cream marketing palette via these element-level overrides. The
 * forge.css class names (.card, .btn, .badge, etc.) keep working — they're
 * just retinted. */
html, body {
  background: var(--cs-bg);
  color: var(--cs-ink);
  font-family: var(--cs-font-sans);
  letter-spacing: -0.005em;
}

a { color: var(--cs-accent-2); }
a:hover { color: var(--cs-accent); }

h1, h2, h3 { color: var(--cs-ink); letter-spacing: -0.025em; font-weight: 500; }
h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.05; }
h2 { font-size: 1.4rem; line-height: 1.15; }
h3 { font-size: 1.05rem; line-height: 1.25; }

.muted { color: var(--cs-muted); }
.small { font-size: 0.85rem; }

/* Top nav — glassmorphic pill at the top of authenticated pages */
.topnav {
  position: relative;
  z-index: 30;
  background: rgba(251, 247, 242, 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--cs-line);
  padding: 14px 28px;
}
.topnav .brand { color: var(--cs-ink); }
.topnav .brand a { color: var(--cs-ink); font-weight: 500; }
.topnav nav a {
  color: var(--cs-muted);
  font-size: 14.5px;
  padding: 6px 12px;
  border-radius: var(--cs-r-pill);
  transition: color .15s ease, background .15s ease;
}
.topnav nav a:hover, .topnav nav a.active {
  color: var(--cs-ink);
  background: var(--cs-bg-2);
  text-decoration: none;
}
.topnav button.linklike { color: var(--cs-muted); }
.topnav button.linklike:hover { color: var(--cs-ink); }

/* User-menu dropdown — sits at the right of the topnav. Opens on hover or
 * focus (keyboard); CSS-only, no JS required. */
.cs-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
  outline: none;
}
.cs-menu__trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--cs-line);
  border-radius: var(--cs-r-pill);
  padding: 6px 12px 6px 14px;
  color: var(--cs-ink-2);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.cs-menu__trigger:hover,
.cs-menu:hover .cs-menu__trigger,
.cs-menu:focus-within .cs-menu__trigger {
  border-color: var(--cs-ink);
  background: var(--cs-bg-card);
}
.cs-menu__email {
  max-width: 18ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cs-menu__chevron { color: var(--cs-muted); transition: transform .15s ease; }
.cs-menu:hover .cs-menu__chevron,
.cs-menu:focus-within .cs-menu__chevron { transform: rotate(180deg); color: var(--cs-ink); }

.cs-menu__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--cs-bg-card);
  border: 1px solid var(--cs-line);
  border-radius: var(--cs-r-md);
  box-shadow: var(--cs-shadow-lg);
  padding: 6px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .12s ease, transform .12s ease, visibility 0s linear .12s;
}
.cs-menu:hover .cs-menu__panel,
.cs-menu:focus-within .cs-menu__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity .12s ease, transform .12s ease;
}
/* Hover bridge so the menu stays open while the cursor crosses the gap */
.cs-menu::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 0;
  height: 8px;
  width: 100%;
}

.cs-menu__item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: var(--cs-ink);
  font: inherit;
  font-size: 14px;
  text-align: left;
  border-radius: var(--cs-r-sm);
  cursor: pointer;
  text-decoration: none;
}
.cs-menu__item:hover,
.cs-menu__item:focus { background: var(--cs-bg-2); color: var(--cs-ink); text-decoration: none; outline: none; }
.cs-menu__item--danger { color: var(--cs-accent-2); }
.cs-menu__item--danger:hover,
.cs-menu__item--danger:focus { background: var(--cs-accent-soft); color: var(--cs-accent-2); }

.cs-menu__divider {
  height: 1px;
  background: var(--cs-line);
  margin: 6px 4px;
}
.cs-menu__label {
  font-family: var(--cs-font-mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cs-muted-2);
  padding: 8px 12px 4px;
}
.cs-menu__form { margin: 0; padding: 0; }
.cs-menu__form button { width: 100%; }

/* Container width slightly wider for the marketing-style layout */
.container { max-width: 1180px; padding: 2.5rem 1.5rem; }

/* Card surface */
.card {
  background: var(--cs-bg-card);
  border: 1px solid var(--cs-line);
  border-radius: var(--cs-r-xl);
  box-shadow: var(--cs-shadow-md);
  padding: 1.5rem;
}

/* Inputs */
input[type=text], input[type=email], input[type=password],
input[type=number], input[type=file], textarea, select {
  background: var(--cs-bg-card);
  color: var(--cs-ink);
  border: 1px solid var(--cs-line-2);
  border-radius: var(--cs-r-md);
  font-family: var(--cs-font-sans);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--cs-accent);
  box-shadow: 0 0 0 3px rgba(217, 85, 43, 0.18);
}
label { color: var(--cs-muted); }

/* Pill buttons matching marketing-site ink-on-cream feel */
.btn {
  background: transparent;
  color: var(--cs-ink);
  border: 1px solid var(--cs-line-2);
  border-radius: var(--cs-r-pill);
  padding: 9px 18px;
  font-weight: 500;
  font-family: var(--cs-font-sans);
  transition: all .18s ease;
}
.btn:hover { border-color: var(--cs-ink); background: var(--cs-bg-card); }
.btn.primary {
  background: var(--cs-ink);
  color: #FBF7F2;
  border-color: var(--cs-ink);
  box-shadow: 0 6px 16px -8px rgba(15, 15, 14, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.btn.primary:hover {
  background: var(--cs-accent);
  border-color: var(--cs-accent);
  transform: translateY(-1px);
  box-shadow: var(--cs-shadow-glow);
}

/* Pricing-card surfaces — explicitly cream/white so they don't inherit the
 * dark forge --panel that the inline pricing styles used to set. */
.tier-card {
  background: var(--cs-bg-card);
  border: 1px solid var(--cs-line);
  border-radius: var(--cs-r-lg);
}
.tier-card.highlight {
  background: linear-gradient(180deg, rgba(217, 85, 43, 0.06), var(--cs-bg-card) 60%);
  border-color: var(--cs-accent);
  box-shadow: var(--cs-shadow-glow);
}
.tier-badge { background: var(--cs-accent); color: #fff; }
.tier-features li { border-bottom-color: var(--cs-line); color: var(--cs-ink); }
.tier-features li:before { color: var(--cs-green); }
.tier-tagline { color: var(--cs-muted); }
.tier-price .period, .tier-price .annual-note { color: var(--cs-muted); }
.cycle-toggle {
  background: var(--cs-bg-card);
  border-color: var(--cs-line);
}
.cycle-toggle button { color: var(--cs-muted); }
.cycle-toggle button.active {
  background: var(--cs-ink);
  color: #FBF7F2;
}

/* Badges — translate the dark-theme color hints to brand variants */
.badge { background: var(--cs-bg-2); border-color: var(--cs-line); color: var(--cs-ink-2); }
.badge.ok { color: var(--cs-green); background: var(--cs-green-soft); border-color: rgba(46, 125, 91, 0.3); }
.badge.warn { color: var(--cs-gold); background: var(--cs-gold-soft); border-color: rgba(184, 136, 46, 0.3); }
.badge.err { color: var(--cs-accent-2); background: var(--cs-accent-soft); border-color: rgba(217, 85, 43, 0.3); }
.badge.accent { color: var(--cs-accent-2); background: var(--cs-accent-soft); border-color: rgba(217, 85, 43, 0.3); }
.badge.info { color: var(--cs-blue); background: rgba(37, 80, 122, 0.08); border-color: rgba(37, 80, 122, 0.25); }

/* Table styling on light surface */
table th { color: var(--cs-muted); font-weight: 500; letter-spacing: .06em; }
table td, table th { border-bottom-color: var(--cs-line); }
tr:hover td { background: rgba(15, 15, 14, 0.02); }

/* Flash messages — softer in brand colors */
.flash.ok { background: var(--cs-green-soft); border: 1px solid rgba(46, 125, 91, 0.3); color: var(--cs-green); }
.flash.error { background: var(--cs-accent-soft); border: 1px solid rgba(217, 85, 43, 0.3); color: var(--cs-accent-2); }

/* Login-card layout (signup, login, verify, reset) */
.login-card {
  background: var(--cs-bg-card);
  border: 1px solid var(--cs-line);
  border-radius: var(--cs-r-xl);
  box-shadow: var(--cs-shadow-lg);
  padding: 2.5rem;
}

/* Standalone customer-card surface (still used by the customer dashboard) */
.customer-card {
  background: var(--cs-bg-card);
  border: 1px solid var(--cs-line);
  border-radius: var(--cs-r-xl);
  box-shadow: var(--cs-shadow-md);
}

/* Tags / monospace chips */
.tag {
  font-family: var(--cs-font-mono);
  background: var(--cs-bg-2);
  color: var(--cs-accent-2);
  border-color: var(--cs-line);
}

/* Ambient brand background (fixed gradient + noise overlay) */
.cs-ambient {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(1000px 600px at 85% -10%, rgba(217, 85, 43, 0.08), transparent 60%),
    radial-gradient(800px 500px at 0% 20%, rgba(184, 136, 46, 0.05), transparent 60%);
}
.cs-noise {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.18;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/></svg>");
}
.cs-page { position: relative; z-index: 2; }

/* New: dashboard hero & wizard pattern */
.cs-hero {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px;
  align-items: center; padding: 2.5rem 0 1.5rem;
}
@media (max-width: 800px) { .cs-hero { grid-template-columns: 1fr; gap: 24px; } }
.cs-hero h1 { font-size: clamp(36px, 5vw, 56px); line-height: 1.02; }
.cs-eyebrow {
  font-family: var(--cs-font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cs-muted);
}

/* Onboarding stepbar — the 5 cards ARE the progress indicator.
 * Each card encodes its own state (done / active / upcoming) and a short
 * connector line bridges adjacent cards so they read as a single rail. */
.cs-stepbar {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 2rem;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  position: relative;
}
.cs-stepbar__card {
  position: relative;
  background: var(--cs-bg-card);
  border: 1px solid var(--cs-line);
  border-radius: var(--cs-r-md);
  padding: 1rem .9rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  text-align: left;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease, opacity .15s ease;
}
.cs-stepbar__card:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -14px;
  top: 50%;
  width: 14px;
  height: 2px;
  background: var(--cs-line-2);
  transform: translateY(-50%);
}
.cs-stepbar__card.is-done::after   { background: var(--cs-green); }
.cs-stepbar__card.is-active::after { background: var(--cs-accent); }
.cs-stepbar__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  background: var(--cs-bg-2);
  color: var(--cs-muted);
}
.cs-stepbar__card.is-done .cs-stepbar__num   { background: var(--cs-green); color: #fff; }
.cs-stepbar__card.is-active .cs-stepbar__num { background: var(--cs-accent); color: #fff; }
.cs-stepbar__card.is-active {
  border-color: var(--cs-accent);
  box-shadow: 0 6px 24px rgba(217, 85, 43, .10);
}
.cs-stepbar__card.is-upcoming { opacity: .6; }
.cs-stepbar__title {
  font-weight: 600;
  color: var(--cs-ink);
  font-size: .95rem;
  line-height: 1.2;
}
.cs-stepbar__hint {
  font-size: .78rem;
  color: var(--cs-muted);
  line-height: 1.3;
}

@media (max-width: 800px) {
  .cs-stepbar { grid-template-columns: 1fr; gap: 8px; }
  .cs-stepbar__card::after { display: none; }
}

.cs-step-card { padding: 2rem; min-height: 280px; }
.cs-step-card h2 { margin-top: 0; }
.cs-step-card .hint { color: var(--cs-muted); margin-bottom: 1.5rem; }
.cs-step-actions { margin-top: 1.5rem; display: flex; gap: 12px; flex-wrap: wrap; }

/* Status pill used on dashboard sub card */
.cs-status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--cs-r-pill);
  font-size: 12px; font-weight: 500;
}
.cs-status.ok { background: var(--cs-green-soft); color: var(--cs-green); }
.cs-status.warn { background: var(--cs-gold-soft); color: var(--cs-gold); }
.cs-status.err { background: var(--cs-accent-soft); color: var(--cs-accent-2); }
.cs-status.dot::before {
  content: ""; display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: currentColor;
}

/* Pre / log blocks (used by audit viewer) */
.cs-log {
  font-family: var(--cs-font-mono); font-size: 12.5px;
  background: var(--cs-bg-2); color: var(--cs-ink-2);
  border: 1px solid var(--cs-line); border-radius: var(--cs-r-md);
  padding: 1rem; overflow-x: auto;
}


/* ===========================================================================
 * EDITORIAL LAYER
 *
 * Type pairing, masthead band, portrait hero, hairline rules, ledger panels,
 * stat blocks, plan tiles, vertical accent rail, page-load stagger.
 *
 * Built on top of the existing brand system — does not override the public
 * .card / .btn / .badge APIs that legacy templates rely on. Anything new is
 * prefixed cs- so old templates keep rendering exactly as they used to.
 * =========================================================================== */

/* Display serif scale — reserved for moments that earn it. */
.cs-display {
  font-family: var(--cs-font-display);
  font-weight: 400;
  font-optical-sizing: auto;
  letter-spacing: -0.022em;
  line-height: 1.02;
  color: var(--cs-ink);
}
.cs-display--xl { font-size: clamp(44px, 6vw, 76px); letter-spacing: -0.032em; line-height: .98; }
.cs-display--lg { font-size: clamp(34px, 4.4vw, 52px); }
.cs-display--md { font-size: clamp(26px, 2.8vw, 36px); }
.cs-display--sm { font-size: clamp(20px, 1.8vw, 24px); }
.cs-display--italic { font-style: italic; font-weight: 400; }

/* Mono micro-label, used for eyebrows, metadata keys, ledger column heads. */
.cs-label {
  font-family: var(--cs-font-mono);
  font-size: 10.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--cs-muted);
  font-weight: 500;
}
.cs-label--ink { color: var(--cs-ink); }
.cs-label--accent { color: var(--cs-accent-2); }

/* Body voice tweaks for editorial pages (a hair larger, looser line). */
.cs-prose { font-size: 15px; line-height: 1.6; color: var(--cs-ink-2); }
.cs-prose--muted { color: var(--cs-muted); }
.cs-prose--lead { font-size: 17px; line-height: 1.5; color: var(--cs-ink-2); max-width: 62ch; }

/* Page masthead — site name + breadcrumb + section number, set as a printed
 * dossier header. Sits above the main content with a hairline below. */
.cs-mast {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  padding: 8px 0 22px;
  border-bottom: 1px solid var(--cs-line);
  margin-bottom: 32px;
}
.cs-mast__crumbs {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--cs-font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cs-muted);
}
.cs-mast__crumbs a { color: var(--cs-muted); }
.cs-mast__crumbs a:hover { color: var(--cs-ink); text-decoration: none; }
.cs-mast__crumbs .sep { opacity: .5; }
.cs-mast__title { margin: 14px 0 0; }
.cs-mast__sub { color: var(--cs-muted); margin: 10px 0 0; font-size: 14.5px; max-width: 56ch; }
.cs-mast__meta {
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  font-family: var(--cs-font-mono); font-size: 11.5px; color: var(--cs-muted);
  text-align: right;
}
.cs-mast__meta strong { font-weight: 500; color: var(--cs-ink); }
@media (max-width: 760px) {
  .cs-mast { grid-template-columns: 1fr; }
  .cs-mast__meta { align-items: flex-start; text-align: left; }
}

/* Hairline rule with optional inline label, like a section break. */
.cs-rule {
  display: flex; align-items: center; gap: 14px;
  margin: 40px 0 22px;
}
.cs-rule::before, .cs-rule::after {
  content: ""; flex: 1; height: 1px; background: var(--cs-line);
}
.cs-rule__label {
  font-family: var(--cs-font-mono); font-size: 10.5px;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--cs-muted-2);
}
.cs-rule--left::before { display: none; }
.cs-rule--solo { margin: 28px 0; }
.cs-rule--solo::after { display: none; }

/* Ledger — a plain horizontal list of label/value pairs separated by hairlines.
 * Used in metadata strips, replacing the old dl.kv look on info-dense panels. */
.cs-ledger {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--cs-line);
  border: 1px solid var(--cs-line);
  border-radius: var(--cs-r-md);
  overflow: hidden;
}
.cs-ledger__cell {
  background: var(--cs-bg-card);
  padding: 14px 16px 16px;
  display: flex; flex-direction: column; gap: 6px;
  min-width: 0;
}
.cs-ledger__key {
  font-family: var(--cs-font-mono); font-size: 10.5px;
  letter-spacing: .16em; text-transform: uppercase; color: var(--cs-muted);
}
.cs-ledger__val {
  font-size: 15.5px; color: var(--cs-ink); font-weight: 500;
  letter-spacing: -.005em; word-break: break-word;
}
.cs-ledger__val--mono { font-family: var(--cs-font-mono); font-size: 13.5px; font-weight: 400; }
.cs-ledger__val--display { font-family: var(--cs-font-display); font-size: 22px; font-weight: 400; letter-spacing: -.012em; }

/* Stat tile — a compact card for a single big number with a serif voice. */
.cs-stat {
  background: var(--cs-bg-card);
  border: 1px solid var(--cs-line);
  border-radius: var(--cs-r-lg);
  padding: 18px 18px 16px;
  display: flex; flex-direction: column; gap: 6px;
  position: relative; overflow: hidden;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.cs-stat__label {
  font-family: var(--cs-font-mono); font-size: 10.5px;
  letter-spacing: .16em; text-transform: uppercase; color: var(--cs-muted);
}
.cs-stat__value {
  font-family: var(--cs-font-display); font-size: clamp(28px, 3vw, 36px);
  line-height: 1; letter-spacing: -.018em; color: var(--cs-ink); font-weight: 400;
}
.cs-stat__hint { font-size: 12.5px; color: var(--cs-muted); margin-top: 2px; }
.cs-stat--accent::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--cs-accent);
}

/* Status portrait — replaces the tiny pill on the site detail page with a
 * proper subscription banner. Tinted to the state. */
.cs-portrait {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 28px;
  padding: 28px 28px 26px;
  border-radius: var(--cs-r-xl);
  border: 1px solid var(--cs-line);
  background: var(--cs-bg-card);
  position: relative; overflow: hidden;
  box-shadow: var(--cs-shadow-md);
}
.cs-portrait::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(420px 220px at 92% -10%, rgba(217, 85, 43, 0.07), transparent 60%),
    radial-gradient(380px 200px at 0% 110%, rgba(184, 136, 46, 0.05), transparent 60%);
  pointer-events: none;
}
.cs-portrait > * { position: relative; }
.cs-portrait--ok { border-color: rgba(46, 125, 91, 0.32); }
.cs-portrait--ok::before {
  background: radial-gradient(420px 220px at 92% -10%, rgba(46, 125, 91, 0.08), transparent 60%);
}
.cs-portrait--warn { border-color: rgba(184, 136, 46, 0.4); }
.cs-portrait--warn::before {
  background: radial-gradient(420px 220px at 92% -10%, rgba(184, 136, 46, 0.10), transparent 60%);
}
.cs-portrait--err { border-color: rgba(217, 85, 43, 0.45); }
.cs-portrait--err::before {
  background: radial-gradient(420px 220px at 92% -10%, rgba(217, 85, 43, 0.10), transparent 60%);
}
.cs-portrait__plan {
  display: flex; flex-direction: column; gap: 10px;
}
.cs-portrait__plan-name {
  font-family: var(--cs-font-display); font-weight: 400;
  font-size: clamp(34px, 4.5vw, 52px); line-height: 1;
  letter-spacing: -.025em; color: var(--cs-ink); margin: 0;
}
.cs-portrait__plan-name em {
  font-style: italic; color: var(--cs-accent-2); font-weight: 400;
}
.cs-portrait__meta {
  display: flex; gap: 18px; flex-wrap: wrap;
  margin-top: 6px;
}
.cs-portrait__meta-cell {
  display: flex; flex-direction: column; gap: 2px;
}
.cs-portrait__meta-cell .k {
  font-family: var(--cs-font-mono); font-size: 10.5px;
  letter-spacing: .16em; text-transform: uppercase; color: var(--cs-muted);
}
.cs-portrait__meta-cell .v {
  font-size: 14px; color: var(--cs-ink-2); font-weight: 500;
}
.cs-portrait__actions {
  display: flex; flex-direction: column; align-items: flex-end; justify-content: center;
  gap: 12px;
}
.cs-portrait__actions .btn { min-width: 180px; text-align: center; }
@media (max-width: 760px) {
  .cs-portrait { grid-template-columns: 1fr; padding: 22px; }
  .cs-portrait__actions { align-items: stretch; }
  .cs-portrait__actions .btn { min-width: 0; }
}

/* Site card — replaces the homogenous .card on the customer dashboard with
 * a more typographically rich tile. */
.cs-sitecard {
  position: relative;
  display: block;
  padding: 22px 22px 20px;
  background: var(--cs-bg-card);
  border: 1px solid var(--cs-line);
  border-radius: var(--cs-r-xl);
  text-decoration: none; color: inherit;
  box-shadow: var(--cs-shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  overflow: hidden;
}
.cs-sitecard:hover {
  transform: translateY(-2px);
  box-shadow: var(--cs-shadow-lg);
  border-color: var(--cs-line-2);
  text-decoration: none; color: inherit;
}
.cs-sitecard::before {
  content: ""; position: absolute; left: 0; top: 22px; bottom: 22px; width: 3px;
  background: var(--cs-line); border-radius: 0 3px 3px 0;
  transition: background .18s ease, top .18s ease, bottom .18s ease;
}
.cs-sitecard:hover::before { background: var(--cs-accent); top: 12px; bottom: 12px; }
.cs-sitecard--ok::before    { background: var(--cs-green); }
.cs-sitecard--warn::before  { background: var(--cs-gold); }
.cs-sitecard--err::before   { background: var(--cs-accent-2); }
.cs-sitecard__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-left: 12px; }
.cs-sitecard__name {
  font-family: var(--cs-font-display); font-weight: 400;
  font-size: 22px; line-height: 1.1; letter-spacing: -.018em;
  color: var(--cs-ink); margin: 0;
}
.cs-sitecard__slug {
  font-family: var(--cs-font-mono); font-size: 11.5px;
  color: var(--cs-muted); margin-top: 6px;
}
.cs-sitecard__body {
  margin-top: 18px; padding-left: 12px;
  display: flex; align-items: baseline; gap: 12px; justify-content: space-between;
}
.cs-sitecard__metric {
  font-family: var(--cs-font-display); font-size: 26px; line-height: 1;
  color: var(--cs-ink); letter-spacing: -.012em;
}
.cs-sitecard__metric .of { font-size: 14px; color: var(--cs-muted); margin-left: 4px; font-family: var(--cs-font-sans); }
.cs-sitecard__hint { font-size: 12.5px; color: var(--cs-muted); padding-left: 12px; margin: 14px 0 0; }

/* Plan tile — replaces the inline-styled tier-card grid on site_billing.
 * Three columns by default, stacks on mobile, the highlight tile sits on
 * a darker ink panel for inversion. */
.cs-plans {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px; align-items: stretch; margin-top: 20px;
}
@media (max-width: 960px) { .cs-plans { grid-template-columns: 1fr; } }

.cs-plan {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--cs-bg-card);
  border: 1px solid var(--cs-line);
  border-radius: var(--cs-r-xl);
  padding: 28px 26px 26px;
  box-shadow: var(--cs-shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.cs-plan:hover {
  transform: translateY(-2px);
  box-shadow: var(--cs-shadow-md);
  border-color: var(--cs-line-2);
}
.cs-plan--featured {
  background: var(--cs-ink);
  border-color: var(--cs-ink);
  color: #FBF7F2;
  box-shadow: 0 30px 60px -24px rgba(15, 15, 14, 0.5);
}
.cs-plan--featured:hover { box-shadow: 0 36px 70px -20px rgba(15, 15, 14, 0.55); }
.cs-plan__badge {
  position: absolute; top: -10px; left: 26px;
  background: var(--cs-accent); color: #fff;
  font-family: var(--cs-font-mono); font-size: 10px;
  letter-spacing: .2em; text-transform: uppercase; font-weight: 500;
  padding: 5px 10px; border-radius: var(--cs-r-pill);
  box-shadow: 0 6px 14px -6px rgba(217, 85, 43, 0.6);
}
.cs-plan__name {
  font-family: var(--cs-font-display); font-weight: 400;
  font-size: 26px; line-height: 1.1; letter-spacing: -.018em;
  margin: 0;
}
.cs-plan--featured .cs-plan__name { color: #FBF7F2; }
.cs-plan__name em { font-style: italic; color: var(--cs-accent-2); }
.cs-plan--featured .cs-plan__name em { color: #F4C9B0; }
.cs-plan__tag { color: var(--cs-muted); font-size: 13.5px; margin: 8px 0 0; min-height: 2.6em; line-height: 1.4; }
.cs-plan--featured .cs-plan__tag { color: rgba(251, 247, 242, 0.65); }
.cs-plan__price {
  display: flex; align-items: baseline; gap: 6px;
  margin: 22px 0 6px;
}
.cs-plan__price .amount {
  font-family: var(--cs-font-display); font-size: 56px; line-height: .9;
  letter-spacing: -.032em; color: var(--cs-ink); font-weight: 400;
}
.cs-plan--featured .cs-plan__price .amount { color: #FBF7F2; }
.cs-plan__price .period {
  font-family: var(--cs-font-mono); font-size: 12px;
  color: var(--cs-muted); letter-spacing: .04em;
}
.cs-plan--featured .cs-plan__price .period { color: rgba(251, 247, 242, 0.55); }
.cs-plan__price-note {
  font-size: 12.5px; color: var(--cs-muted); min-height: 1.4em;
}
.cs-plan--featured .cs-plan__price-note { color: rgba(251, 247, 242, 0.55); }
.cs-plan__features {
  list-style: none; padding: 0; margin: 22px 0 26px; flex: 1;
  display: flex; flex-direction: column; gap: 0;
  border-top: 1px solid var(--cs-line);
}
.cs-plan--featured .cs-plan__features { border-top-color: rgba(251, 247, 242, 0.12); }
.cs-plan__features li {
  padding: 12px 0; border-bottom: 1px solid var(--cs-line);
  font-size: 13.5px; color: var(--cs-ink-2);
  display: flex; align-items: flex-start; gap: 10px;
}
.cs-plan--featured .cs-plan__features li {
  color: rgba(251, 247, 242, 0.86);
  border-bottom-color: rgba(251, 247, 242, 0.12);
}
.cs-plan__features li::before {
  content: ""; flex-shrink: 0; width: 14px; height: 14px; margin-top: 3px;
  border-radius: 50%; background: var(--cs-green-soft);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'><path d='M3.5 7.5l2.2 2.2L10.5 4.5' fill='none' stroke='%232E7D5B' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-position: center; background-repeat: no-repeat;
}
.cs-plan--featured .cs-plan__features li::before {
  background-color: rgba(244, 201, 176, 0.18);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'><path d='M3.5 7.5l2.2 2.2L10.5 4.5' fill='none' stroke='%23F4C9B0' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}
.cs-plan__cta { margin-top: auto; }
.cs-plan__cta .btn { width: 100%; text-align: center; padding: 12px 18px; font-size: 14.5px; }
.cs-plan--featured .cs-plan__cta .btn.primary {
  background: var(--cs-accent); border-color: var(--cs-accent); color: #fff;
}
.cs-plan--featured .cs-plan__cta .btn.primary:hover {
  background: #FBF7F2; border-color: #FBF7F2; color: var(--cs-ink);
  transform: translateY(-1px);
}

/* Cycle toggle — segmented control. Cleaner styling than the inline version. */
.cs-cycle {
  display: inline-flex; align-items: center; gap: 0;
  border: 1px solid var(--cs-line);
  border-radius: var(--cs-r-pill);
  padding: 4px;
  background: var(--cs-bg-card);
  box-shadow: var(--cs-shadow-sm);
}
.cs-cycle button {
  background: none; border: 0; cursor: pointer;
  padding: 8px 18px; font: inherit;
  font-size: 13.5px; color: var(--cs-muted);
  border-radius: var(--cs-r-pill);
  transition: background .15s ease, color .15s ease;
}
.cs-cycle button:hover { color: var(--cs-ink); }
.cs-cycle button.active {
  background: var(--cs-ink); color: #FBF7F2;
}
.cs-cycle .save-tag {
  font-family: var(--cs-font-mono); font-size: 9.5px;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--cs-accent-2); margin-left: 6px;
}
.cs-cycle button.active .save-tag { color: #F4C9B0; }

/* Section block — heading + description, used at the top of a content
 * group when you want a labeled subhead but don't want a card around it. */
.cs-section-head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: end; gap: 20px;
  margin: 0 0 18px;
}
.cs-section-head h2 {
  font-family: var(--cs-font-display); font-weight: 400;
  font-size: 28px; letter-spacing: -.02em; line-height: 1.05;
  margin: 6px 0 0;
}
.cs-section-head .desc {
  color: var(--cs-muted); font-size: 14px; margin: 8px 0 0; max-width: 56ch;
}

/* Empty state — bigger, more deliberate than .empty inside a flat card. */
.cs-empty {
  text-align: center;
  padding: 56px 24px;
  border: 1px dashed var(--cs-line-2);
  border-radius: var(--cs-r-xl);
  background:
    radial-gradient(420px 200px at 50% 0%, rgba(217, 85, 43, 0.04), transparent 60%),
    var(--cs-bg-card);
}
.cs-empty__mark {
  font-family: var(--cs-font-display); font-style: italic; font-weight: 400;
  font-size: 56px; line-height: 1; color: var(--cs-accent);
  margin-bottom: 14px;
}
.cs-empty h2 {
  font-family: var(--cs-font-display); font-weight: 400;
  font-size: 26px; letter-spacing: -.018em; margin: 0 0 8px;
}
.cs-empty p { color: var(--cs-muted); margin: 0 0 20px; max-width: 42ch; margin-left: auto; margin-right: auto; }

/* Status — refined version of cs-status with a softer dot and tighter type. */
.cs-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 10px;
  border-radius: var(--cs-r-pill);
  font-family: var(--cs-font-mono);
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  font-weight: 500;
}
.cs-pill::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.6);
}
.cs-pill.ok    { color: var(--cs-green);    background: var(--cs-green-soft); }
.cs-pill.warn  { color: var(--cs-gold);     background: var(--cs-gold-soft); }
.cs-pill.err   { color: var(--cs-accent-2); background: var(--cs-accent-soft); }
.cs-pill.info  { color: var(--cs-blue);     background: rgba(37, 80, 122, 0.10); }
.cs-pill.neutral { color: var(--cs-muted);  background: var(--cs-bg-2); }
.cs-pill--lg { padding: 8px 16px 8px 14px; font-size: 12px; gap: 10px; }
.cs-pill--lg::before { width: 7px; height: 7px; }

/* Page-load stagger — a single delight moment, not a parade.
 * Children of [data-stagger] fade up in sequence. */
@keyframes cs-rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
[data-stagger] > * {
  animation: cs-rise .55s cubic-bezier(.2, .7, .2, 1) both;
}
[data-stagger] > *:nth-child(1) { animation-delay: 0ms; }
[data-stagger] > *:nth-child(2) { animation-delay: 70ms; }
[data-stagger] > *:nth-child(3) { animation-delay: 140ms; }
[data-stagger] > *:nth-child(4) { animation-delay: 210ms; }
[data-stagger] > *:nth-child(5) { animation-delay: 280ms; }
[data-stagger] > *:nth-child(6) { animation-delay: 350ms; }
[data-stagger] > *:nth-child(7) { animation-delay: 420ms; }
[data-stagger] > *:nth-child(8) { animation-delay: 490ms; }
@media (prefers-reduced-motion: reduce) {
  [data-stagger] > * { animation: none; }
}

/* Small screen-reader-only helper, used on iconographic markers. */
.cs-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* Action toolbar — used at the top-right of admin pages. */
.cs-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

/* Soft-divided strip used by table-rows-as-cards (admin sites list). */
.cs-strip {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 16px; align-items: center;
  padding: 18px 22px; background: var(--cs-bg-card);
  border: 1px solid var(--cs-line);
  border-radius: var(--cs-r-lg);
  text-decoration: none; color: inherit;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
  position: relative;
}
.cs-strip + .cs-strip { margin-top: 8px; }
.cs-strip:hover {
  border-color: var(--cs-ink); transform: translateY(-1px);
  box-shadow: var(--cs-shadow-md); text-decoration: none; color: inherit;
}
.cs-strip__name {
  font-family: var(--cs-font-display); font-size: 20px; line-height: 1.1;
  letter-spacing: -.012em; color: var(--cs-ink);
}
.cs-strip__sub {
  font-family: var(--cs-font-mono); font-size: 11.5px;
  color: var(--cs-muted); margin-top: 4px;
}
.cs-strip__cell { font-size: 13.5px; color: var(--cs-ink-2); min-width: 0; }
.cs-strip__cell .k {
  display: block; font-family: var(--cs-font-mono); font-size: 10px;
  letter-spacing: .16em; text-transform: uppercase; color: var(--cs-muted);
  margin-bottom: 3px;
}
@media (max-width: 760px) {
  .cs-strip { grid-template-columns: 1fr; gap: 12px; }
}

/* Refined card variants */
.cs-card-quiet {
  background: var(--cs-bg-card);
  border: 1px solid var(--cs-line);
  border-radius: var(--cs-r-xl);
  padding: 24px;
  box-shadow: var(--cs-shadow-sm);
}
.cs-card-feature {
  background:
    linear-gradient(180deg, rgba(217, 85, 43, 0.04), transparent 50%),
    var(--cs-bg-card);
  border: 1px solid rgba(217, 85, 43, 0.22);
  border-radius: var(--cs-r-xl);
  padding: 24px;
  box-shadow: var(--cs-shadow-md);
}

/* Decorative section number — set in display italic, used at the start of
 * an editorial section. Pair with cs-section-head for the most impact. */
.cs-numeral {
  font-family: var(--cs-font-display); font-style: italic; font-weight: 400;
  color: var(--cs-accent-2); font-size: 14px; letter-spacing: .04em;
  margin-right: 6px;
}
