/* ============================================================================
   Qanary UI — Quokkai design language, hand-rolled CSS (no build step).
   Tokens mirror the Quokkai system: warm orange accent, gray neutrals, DM Serif
   Display headings, Outfit body, Caveat for personal moments, shadow+border
   cards, yellow→orange gradient reserved for hero CTAs.
   ========================================================================== */

/* ---- self-hosted fonts (latin subsets) ---- */
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/assets/outfit-variable-9bbb8353.woff2") format("woff2");
}
@font-face {
  font-family: "DM Serif Display";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/dm-serif-display-3f6a6125.woff2") format("woff2");
}
@font-face {
  font-family: "DM Serif Display";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/dm-serif-display-italic-1e5e7a9d.woff2") format("woff2");
}
@font-face {
  font-family: "Caveat";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/caveat-variable-0aa453d2.woff2") format("woff2");
}

/* ---- design tokens ---- */
:root {
  /* accent — warm orange is the only real accent */
  --accent-50: #fff7ed;
  --accent-100: #ffedd5;
  --accent-200: #fed7aa;
  --accent-300: #fdba74;
  --accent-400: #fb923c;
  --accent-500: #f97316;
  --accent-600: #ea580c;
  --accent-700: #c2410c;
  --accent-yellow: #facc15;

  /* neutrals — gray only */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* semantic */
  --green-soft: #dcfce7;
  --green-ink: #16a34a;
  --red-soft: #fee2e2;
  --red-ink: #dc2626;
  --amber-soft: #fef3c7;
  --amber-ink: #d97706;

  /* elevation — shadow + hairline border together */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);

  /* radii — soft by default; xl/2xl for cards, 3xl for hero + floating panels */
  --r-md: 0.5rem;
  --r-lg: 0.75rem;
  --r-xl: 1rem;
  --r-2xl: 1.25rem;
  --r-3xl: 1.75rem;

  --font-sans: "Outfit", ui-sans-serif, system-ui, sans-serif;
  --font-serif: "DM Serif Display", ui-serif, Georgia, serif;
  --font-hand: "Caveat", "Segoe Print", cursive;

  --gradient-accent: linear-gradient(to right, var(--accent-yellow), var(--accent-600));
}

/* ---- base ---- */
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 400 1.0625rem/1.65 var(--font-sans);
  color: var(--gray-700);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--gray-900);
  letter-spacing: 0.01em;
}
h1 { font-size: 2.35rem; line-height: 1.15; margin: 0 0 0.5rem; }
h2 { font-size: 1.6rem; line-height: 1.3; margin: 0 0 0.75rem; }
h3 { font-size: 1.3rem; margin: 0 0 0.5rem; }
a { color: var(--accent-600); text-decoration: none; transition: color 0.2s ease-in-out; }
a:hover { color: var(--accent-700); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent-500); outline-offset: 2px; border-radius: var(--r-md); }

code {
  background: var(--gray-100);
  color: var(--gray-800);
  padding: 0.1em 0.4em;
  border-radius: var(--r-md);
  font-size: 0.85em;
}
pre {
  background: var(--gray-900);
  color: var(--gray-100);
  padding: 1em 1.2em;
  border-radius: var(--r-lg);
  overflow-x: auto;
  font-size: 0.8125rem;
  line-height: 1.55;
}
pre code { background: transparent; color: inherit; padding: 0; }
.muted { color: var(--gray-500); font-weight: 400; }
h1 .muted, h2 .muted, h3 .muted {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  letter-spacing: 0;
}
.hand { font-family: var(--font-hand); font-weight: 600; }

/* ---- tables ----
   A table is a list with columns, so it's built like the dashboard's row lists:
   the header is a label track rather than a filled band, rows are separated by
   hairlines, and the hover tint is the same warm wash used everywhere else. */
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th {
  text-align: left;
  color: var(--gray-500);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  padding: 1rem 1.1rem 0.65rem;
  border-bottom: 1px solid var(--gray-200);
}
td { color: var(--gray-700); padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--gray-100); }
/* inside a padded card the outer cells align to the card's text, not to a
   phantom gutter; `table.card` is its own card, so it keeps its inset */
.card:not(table) th:first-child, .card:not(table) td:first-child { padding-left: 0; }
.card:not(table) th:last-child, .card:not(table) td:last-child { padding-right: 0; }
tbody tr:last-child td, table tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--accent-50); }
.clickable-row { cursor: pointer; }
td a { font-weight: 600; }
/* dates and other atomic values must never wrap a column into three lines */
.nowrap { white-space: nowrap; }
/* button_to emits a <form>, which stacks; a row's actions belong side by side */
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 0.4rem; }
.row-actions form { margin: 0; }

/* ---- forms ---- */
label {
  display: block;
  margin: 0.9rem 0;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--gray-700);
}
label.inline { font-weight: 400; display: flex; align-items: center; gap: 0.5rem; margin: 0.6rem 0; }
/* explanation belongs under its label, never in a parenthetical inside it */
.field-hint {
  display: block;
  margin: 0.15rem 0 0.4rem;
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--gray-500);
  max-width: 46ch;
}
.field-hint-block { margin: -0.55rem 0 0.9rem 1.65rem; }
.custom-select { position: relative; max-width: 28rem; margin-top: 0.3rem; }
.custom-select__native {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0;
}
.custom-select__trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  width: 100%; max-width: 28rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--gray-300); border-radius: var(--r-lg);
  font: inherit; font-size: 0.875rem; color: var(--gray-900);
  background: #fff; cursor: pointer; text-align: left;
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.custom-select__trigger:focus,
.custom-select__trigger[aria-expanded="true"] {
  outline: none; border-color: var(--accent-500);
  box-shadow: 0 0 0 3px rgb(249 115 22 / 0.15);
}
.custom-select__chevron {
  flex: none; color: var(--gray-500);
  width: 1rem; height: 1rem;
  transition: transform 0.15s ease-in-out;
}
@media (prefers-reduced-motion: reduce) {
  .custom-select__chevron { transition: none; }
}
.custom-select__trigger[aria-expanded="true"] .custom-select__chevron { transform: rotate(180deg); }
.custom-select__panel {
  position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0;
  max-width: 28rem; margin: 0; padding: 0.25rem; list-style: none;
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); max-height: 18rem; overflow-y: auto;
}
.custom-select__option {
  display: flex; flex-direction: column; gap: 0.15rem;
  padding: 0.5rem 0.6rem; border-radius: calc(var(--r-lg) - 4px); cursor: pointer;
}
.custom-select__option.is-active { background: var(--gray-100); }
.custom-select__option.is-selected { background: rgb(249 115 22 / 0.08); }
.custom-select__option.is-selected.is-active { background: rgb(249 115 22 / 0.14); }
.custom-select__option-name {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.875rem; font-weight: 500; color: var(--gray-900);
}
.custom-select__option.is-selected .custom-select__option-name::after {
  content: "\2713"; margin-left: auto; color: var(--accent-600); font-weight: 700;
}
.custom-select__option-desc {
  font-size: 0.8125rem; line-height: 1.4; font-weight: 400; color: var(--gray-500);
}
input[type=text], input[type=email], input[type=password], input[type=url],
input[type=number], select, textarea {
  display: block;
  width: 100%;
  max-width: 28rem;
  padding: 0.55rem 0.75rem;
  margin-top: 0.3rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--r-lg);
  font: inherit;
  font-size: 0.875rem;
  color: var(--gray-900);
  background: #fff;
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
/* a native select keeps the OS arrow, which sits next to the custom-select's own
   chevron on the same form — draw ours so every dropdown looks the same */
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 1rem;
}
input::placeholder, textarea::placeholder { color: var(--gray-400); }
input[type=text]:focus, input[type=email]:focus, input[type=password]:focus,
input[type=url]:focus, input[type=number]:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-500);
  box-shadow: 0 0 0 3px rgb(249 115 22 / 0.15);
}
input[type=checkbox] {
  width: 1rem;
  height: 1rem;
  border-radius: 0.25rem;
  accent-color: var(--accent-600);
}
/* a locked field should read as locked — muted fill + a no-go cursor, so the
   field-hint isn't the only signal it can't be edited */
input[disabled], textarea[disabled], select[disabled] {
  background: var(--gray-100);
  color: var(--gray-500);
  border-color: var(--gray-200);
  cursor: not-allowed;
}

/* ---- buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  white-space: nowrap;
  padding: 0.5rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--r-lg);
  background: #fff;
  color: var(--gray-700);
  text-decoration: none;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.4;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out,
              color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.btn:hover { background: var(--gray-50); color: var(--gray-900); text-decoration: none; }
.btn svg { width: 1rem; height: 1rem; flex: none; }
.btn-primary {
  background: var(--accent-600);
  border-color: var(--accent-600);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--accent-700); border-color: var(--accent-700); color: #fff; }
.btn-gradient {
  background: var(--gradient-accent);
  border: 0;
  border-radius: var(--r-xl);
  color: #fff;
  padding: 0.7rem 1.4rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, filter 0.2s ease-in-out;
}
.btn-gradient:hover {
  background: var(--gradient-accent);
  color: #fff;
  filter: brightness(1.06) saturate(1.08);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 10px 28px -8px var(--accent-600);
}
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8125rem; border-radius: var(--r-md); }
.btn-lg { padding: 0.7rem 1.4rem; font-size: 0.9375rem; border-radius: var(--r-xl); }
.btn-danger { color: var(--red-ink); border-color: var(--gray-300); }
.btn-danger:hover { background: var(--red-soft); border-color: var(--red-ink); color: var(--red-ink); }
/* a verdict that would do nothing to the current selection reads as unavailable */
.btn:disabled, .btn[disabled] {
  background: var(--gray-100);
  border-color: var(--gray-200);
  color: var(--gray-400);
  cursor: not-allowed;
  box-shadow: none;
}
.btn-block { display: flex; width: 100%; }
.linklike {
  background: none;
  border: none;
  color: var(--accent-600);
  cursor: pointer;
  padding: 0;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s ease-in-out;
}
.linklike:hover { color: var(--accent-700); text-decoration: underline; }
.linklike.danger { color: var(--red-ink); }
.linklike.danger:hover { color: var(--red-ink); }

/* ---- cards & panels: shadow-sm + hairline border, rounded-xl ---- */
.card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem 2rem;
  margin: 1.5rem 0;
}
.card > h2:first-child { margin-top: 0; }
/* a heading inside a card names a panel, not a page section — the dashboard set
   this scale first ("Needs you", "Top promoters"); every card now follows it */
.card h2 { font-size: 1.2rem; }
/* the sentence under a card heading, where a parenthetical aside used to sit */
.section-sub { margin: -0.4rem 0 1.1rem; color: var(--gray-500); font-size: 0.85rem; }
.access-check { width: 1.05rem; height: 1.05rem; vertical-align: -0.2em; color: var(--green-ink); }

/* a card that is nothing but a table: it fills the card, and if the columns
   outgrow the card it scrolls sideways rather than spilling past the edge */
.table-card { padding: 0; overflow: hidden; }
/* Push the Public pages column to the right: it absorbs leftover width so the
   Name/Type/Status/Affiliates columns stay compact on the left. */
.programs-table th:last-child, .programs-table td:last-child { width: 100%; text-align: right; }
.programs-table td:last-child .copy-row { text-align: left; }
.table-scroll { overflow-x: auto; }
.table-card table { margin: 0; }
/* beats `.card:not(table) td:first-child`, which would pull cells to the edge */
.card.table-card th:first-child, .card.table-card td:first-child { padding-left: 1.1rem; }
.card.table-card th:last-child, .card.table-card td:last-child { padding-right: 1.1rem; }
.card-hover { transition: box-shadow 0.2s ease-in-out; }
.card-hover:hover { box-shadow: var(--shadow-lg); }

/* ---- badges: soft pills ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.125rem 0.6rem;
  border-radius: 9999px;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0;
  background: var(--gray-100);
  color: var(--gray-600);
  white-space: nowrap;
  vertical-align: middle;
}
.badge-approved, .badge-active, .badge-paid { background: var(--green-soft); color: var(--green-ink); }
.badge-pending, .badge-pending_review, .badge-pending_verification, .badge-draft,
.badge-warn, .badge-held, .badge-processing { background: var(--amber-soft); color: var(--amber-ink); }
.badge-rejected, .badge-failed, .badge-disabled, .badge-void, .badge-canceled { background: var(--red-soft); color: var(--red-ink); }
.badge-exported, .badge-submitted, .badge-parked { background: var(--accent-50); color: var(--accent-700); }
.badge-indigo { background: var(--accent-50); color: var(--accent-700); }
/* Deliberate neutral pill for non-status metadata (enrollment source, invite-only)
   so it reads as designed rather than an unstyled leftover — bordered to sit apart
   from the flat colored status badges without borrowing a status hue. */
.badge-neutral { background: var(--gray-100); color: var(--gray-500); border: 1px solid var(--gray-200); }

/* ---- flash ---- */
.flash {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-radius: var(--r-lg);
  border: 1px solid transparent;
  margin: 0.8rem 0;
  font-size: 0.875rem;
  font-weight: 500;
}
.flash svg { width: 1.25rem; height: 1.25rem; flex: none; margin-top: 0.05rem; }
.flash-notice { background: var(--green-soft); color: #166534; border-color: #bbf7d0; }
.flash-alert { background: var(--red-soft); color: #991b1b; border-color: #fecaca; }

/* ---- verify-email bandeau: full-width strip across the top of the app ---- */
.verify-bandeau {
  flex: none;
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  padding: 0.7rem 1.5rem;
  background: var(--amber-soft);
  color: #92400e;
  border-bottom: 1px solid #fde68a;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  font-size: 1.0625rem;
  font-weight: 500;
}
.verify-bandeau svg { width: 1.25rem; height: 1.25rem; flex: none; }
.verify-bandeau strong { font-weight: 700; }
.verify-bandeau form { margin: 0; }
.verify-bandeau .verify-bandeau-action { margin-left: auto; font-weight: 600; }

/* ---- verify-email card: a warm floating card at the top of the content
   column (beside the sidebar), not a full-width strip. Reserved for the
   gentle "verify your email" nudge; the amber .verify-bandeau strip above
   stays for real warnings like a failed payment. ---- */
.verify-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 0.95rem 1.1rem;
  background: linear-gradient(135deg, #fffaf2 0%, #ffffff 60%);
  border: 1px solid var(--accent-100);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-sm);
}
.verify-card-chip {
  width: 2.6rem;
  height: 2.6rem;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--r-lg);
  background: linear-gradient(140deg, var(--accent-yellow), var(--accent-500));
  color: #fff;
  box-shadow: 0 3px 8px -2px rgba(249, 115, 22, 0.5);
}
.verify-card-chip svg { width: 1.4rem; height: 1.4rem; }
.verify-card-body { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.verify-card-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.05rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #166534;
}
.verify-card-eyebrow svg { width: 0.95rem; height: 0.95rem; flex: none; }
.verify-card-lead { font-size: 0.98rem; font-weight: 600; color: var(--gray-900); }
.verify-card-meta { font-size: 0.85rem; color: var(--gray-500); line-height: 1.4; }
.verify-card-meta strong { font-weight: 600; color: var(--accent-700); }
.verify-card form { margin: 0 0 0 auto; }
.verify-card-action {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  font-variant-numeric: tabular-nums;
  transition: border-color 0.15s, color 0.15s, transform 0.1s;
}
.verify-card-action:hover { border-color: var(--accent-300); color: var(--accent-700); }
.verify-card-action:active { transform: translateY(1px); }
.verify-card-action:disabled {
  color: var(--gray-400);
  border-color: var(--gray-200);
  box-shadow: none;
  cursor: default;
  transform: none;
}

/* ---- account shell ---- */
/* App shell owns the viewport: banners pin to the top, and the sidebar +
   main content fill the rest. Only the main content scrolls, so the sidebar
   stays full height with the account always in view. */
.app-body { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
.app-shell { display: flex; flex: 1; min-height: 0; }
.sidebar-col {
  width: 258px;
  flex: none;
  margin: 0.9rem 0 0.9rem 0.9rem;
  display: flex;
  flex-direction: column;
  align-self: stretch;
}
.sidebar {
  flex: 1;
  min-height: 0;
  background:
    radial-gradient(120% 55% at 12% -8%, rgba(250, 204, 21, 0.16), transparent 60%),
    linear-gradient(178deg, #fff 55%, var(--accent-50));
  border: 1px solid rgba(234, 88, 12, 0.08);
  border-radius: var(--r-3xl);
  box-shadow: var(--shadow-lg);
  padding: 1.1rem 0.55rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* The link list is the only part that scrolls; brand stays pinned at the
   top and the account cluster at the bottom of the card. */
.sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin: 0 -0.55rem;
  padding: 0 0.55rem 0.35rem;
}
/* Only while the list actually overflows (data-overflowing is toggled by the
   nav-overflow Stimulus controller) does the last row fade out to hint that it
   scrolls. When the list fits, no mask — so the last item is never dimmed. */
.sidebar-nav[data-overflowing] {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 1.4rem), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 1.4rem), transparent);
}
.sidebar-account {
  flex: none;
  margin-top: 0.75rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(234, 88, 12, 0.1);
}
.brand { display: flex; align-items: center; gap: 0.6rem; padding: 0.25rem 0.625rem 1rem; }
.brand a { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand a:hover { text-decoration: none; }
.brand-logo {
  width: 3.5rem;
  height: 3.5rem;
  flex: none;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(234, 88, 12, 0.28));
}
.brand-name {
  font-family: var(--font-sans);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--gray-900);
}
.nav-section {
  padding: 0.9rem 0.625rem 0.35rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-400);
}
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.62rem 0.8rem;
  border: 1px solid transparent;
  border-radius: var(--r-xl);
  color: var(--gray-600);
  font-size: 1.0125rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.18s ease-in-out, color 0.18s ease-in-out, border-color 0.18s ease-in-out;
}
.nav-link svg { width: 1.35rem; height: 1.35rem; flex: none; }
.nav-link:hover { background: rgba(17, 24, 39, 0.045); color: var(--gray-900); text-decoration: none; }
.nav-link.active {
  background: #fff;
  color: var(--accent-700);
  font-weight: 600;
  border-color: rgba(234, 88, 12, 0.18);
}
.nav-link.active svg { color: var(--accent-600); }
.avatar {
  width: 2.2rem;
  height: 2.2rem;
  flex: none;
  border-radius: 9999px;
  background: linear-gradient(140deg, var(--accent-yellow), var(--accent-600));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 2px 6px -2px rgba(234, 88, 12, 0.35);
}
.content { flex: 1; min-width: 0; min-height: 0; overflow-y: auto; padding: 1.75rem 3rem 4rem; max-width: 1480px; }

/* Mobile navigation: a slim top bar + hamburger that opens the sidebar as an
   off-canvas drawer. Both the bar and the scrim are desktop-hidden; the
   @media (max-width: 768px) block below turns them on and repositions the
   sidebar. */
.mobile-topbar { display: none; }
.mobile-nav-scrim { display: none; }
.mobile-nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; flex: none;
  border: 1px solid rgba(234, 88, 12, 0.15); border-radius: var(--r-lg);
  background: #fff; color: var(--gray-700); cursor: pointer;
}
.mobile-nav-toggle svg { width: 1.5rem; height: 1.5rem; }
.mobile-nav-toggle:hover { border-color: var(--accent-300); color: var(--accent-600); }

/* ---- account menu: the trigger + its popover, seated at the bottom of the
   sidebar card. The whole cell is a button that opens the menu upward; when
   open the menu docks onto the trigger so the two read as one panel. ---- */
.acct-wrap { position: relative; }
.acct {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(234, 88, 12, 0.08);
  border-radius: var(--r-xl);
  padding: 0.5rem 0.6rem;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.18s ease-in-out, box-shadow 0.18s ease-in-out,
              border-color 0.18s ease-in-out, border-radius 0.18s ease-in-out;
}
.acct:hover { background: #fff; box-shadow: var(--shadow-sm); }
.acct-meta { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.acct-meta .who,
.acct-pop-account .who {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.acct-meta .mail {
  font-size: 0.78rem;
  color: var(--gray-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.acct .chev { width: 1.05rem; height: 1.05rem; flex: none; color: var(--gray-400); transition: color 0.18s ease-in-out; }

/* open: the trigger connects to the docked menu above it (top border drops,
   top corners square off) so trigger + menu read as one panel */
.sidebar-account.open .acct {
  background: #fff;
  border-color: rgba(17, 24, 39, 0.08);
  border-top-color: transparent;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  box-shadow: 0 6px 14px -8px rgba(0, 0, 0, 0.18);
}
.sidebar-account.open .acct .chev { color: var(--gray-700); }

.acct-pop {
  position: absolute;
  /* Own stacking context above <main> — on mobile the drawer overlaps page
     content, and without this the popover paints (and takes clicks) behind it. */
  z-index: 62;
  left: 0;
  right: 0;
  bottom: 100%;
  background: #fff;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-bottom: 0;
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  box-shadow: 0 -10px 24px -12px rgba(0, 0, 0, 0.2);
  padding: 0.4rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}
.sidebar-account.open .acct-pop {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}
.acct-pop-account { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.6rem; line-height: 1.25; }
.acct-pop-id { min-width: 0; display: flex; flex-direction: column; }
.acct-pop-account .plan {
  font-size: 0.78rem;
  color: var(--gray-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.acct-pop-label {
  padding: 0.35rem 0.6rem 0.2rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-400);
}
.acct-pop-you {
  padding: 0.15rem 0.6rem 0.4rem;
  font-size: 0.78rem;
  color: var(--gray-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.acct-pop-div { height: 1px; background: rgba(17, 24, 39, 0.08); margin: 0.3rem 0.25rem; }
.acct-pop form { display: contents; }
.acct-mi {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 0;
  border-radius: 0.65rem;
  background: none;
  font: inherit;
  font-size: 0.9rem;
  color: var(--gray-700);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.acct-mi svg { width: 1.15rem; height: 1.15rem; flex: none; color: var(--gray-500); transition: color 0.12s ease; }
.acct-mi:hover { background: rgba(17, 24, 39, 0.05); color: var(--gray-900); text-decoration: none; }
.acct-mi:hover svg { color: var(--gray-700); }
.acct-mi.danger:hover { background: #fef2f2; color: #dc2626; }
.acct-mi.danger:hover svg { color: #dc2626; }

/* ---- page header ----
   A title never sits loose on the page background. This is the quieter sibling
   of .dash-hero: same warm wash, less of it, so it frames the page without
   competing with the dashboard's hero band. */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 0 0 1.5rem;
  padding: 1.9rem 2rem;
  border-radius: var(--r-2xl);
  border: 1px solid rgba(234, 88, 12, 0.1);
  background: linear-gradient(135deg, #fff 0%, #fff7ed 78%, #ffedd5 150%);
  box-shadow: var(--shadow-sm);
}
.page-header > div { min-width: 0; }
/* A copy-row in the header (e.g. the portal URL on /dashboard/space) holds a long
   URL. Card copy-rows truncate with an ellipsis, but in the header that leaves a
   huge min-content that shoves the whole header off a phone screen — so here the
   URL wraps instead, keeping the Copy button on-screen. */
.page-header .copy-row { flex-wrap: wrap; }
.page-header .copy-row code { white-space: normal; overflow-wrap: anywhere; overflow: visible; }
.page-header h1 { margin: 0; }
.page-header .page-sub { margin: 0.35rem 0 0; color: var(--gray-500); font-size: 0.875rem; display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
/* same eyebrow the dashboard hero uses, so a page title is built the same way */
.page-eyebrow {
  margin: 0 0 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-700);
}
.page-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

/* ---- share panel: a label above each thing you copy ---- */
.share-links { display: flex; flex-direction: column; gap: 1.1rem; }
.share-row { margin-bottom: 1.5rem; }
.share-links .share-row { margin-bottom: 0; }
.share-label { display: block; margin-bottom: 0.4rem; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--gray-500); }
.share-snippet { margin-top: 1.5rem; }
.share-snippet .section-sub { margin: -0.15rem 0 0.5rem; }
.share-snippet pre { margin: 0; }
.share-note { margin: 0; font-size: 0.8rem; line-height: 1.6; color: var(--gray-500); border-top: 1px dashed var(--gray-200); padding-top: 1rem; }

/* ---- dashboard hero band (signature: warm blobs + geometry) ---- */
.dash-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--r-3xl);
  border: 1px solid rgba(234, 88, 12, 0.1);
  background:
    radial-gradient(75% 120% at 88% -25%, rgba(250, 204, 21, 0.4), transparent 55%),
    linear-gradient(135deg, #fff 0%, #fff7ed 62%, #ffedd5 128%);
  box-shadow: var(--shadow-md);
  padding: 3.25rem 3.5rem;
  margin-bottom: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.dash-hero-body { position: relative; z-index: 2; max-width: 34rem; }
.dash-hero-eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-600);
}
.dash-hero h1 { margin: 0 0 0.35rem; font-size: 2.85rem; }
.dash-hero-sub { margin: 0; color: var(--gray-600); font-size: 1.15rem; }
.dash-hero-sub .hand { font-size: 1.55rem; color: var(--accent-600); }
.dash-hero-actions { position: relative; z-index: 2; }

/* decorative blobs, dashed ring, floating dots */
.dash-blob, .dash-ring, .dash-dot { position: absolute; pointer-events: none; z-index: 1; }
.dash-blob { border-radius: 50%; }
.dash-blob-1 {
  width: 320px; height: 320px;
  right: -90px; bottom: -150px;
  background: radial-gradient(circle at 35% 35%, rgba(251, 146, 60, 0.32), rgba(234, 88, 12, 0.1) 70%);
}
.dash-blob-2 {
  width: 150px; height: 150px;
  right: 160px; top: -70px;
  background: radial-gradient(circle at 40% 40%, rgba(250, 204, 21, 0.5), transparent 70%);
}
.dash-ring {
  width: 88px; height: 88px;
  right: 44px; bottom: 34px;
  border-radius: 50%;
  border: 2px dashed rgba(234, 88, 12, 0.3);
}
.dash-dot-1 { width: 14px; height: 14px; border-radius: 50%; background: var(--accent-500); right: 130px; bottom: 50px; }
.dash-dot-2 { width: 10px; height: 10px; border-radius: 50%; background: var(--accent-yellow); right: 250px; bottom: 30px; }
.dash-dot-3 { width: 18px; height: 18px; border-radius: 50%; background: rgba(234, 88, 12, 0.22); right: 200px; top: 46px; }
@keyframes blob-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@media (prefers-reduced-motion: no-preference) {
  .dash-blob-1 { animation: blob-float 9s ease-in-out infinite; }
  .dash-blob-2 { animation: blob-float 7s ease-in-out infinite reverse; }
}

/* ---- stats ---- */
/* stats speak the dashboard's KPI language: serif figure, small-caps label, no
   card singled out — the numbers rank themselves, the styling shouldn't */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr));
  gap: 1rem;
  margin: 1.25rem 0 1.5rem;
}
.stat {
  position: relative;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  padding: 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow: hidden;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
/* label above figure regardless of markup order, so a card can add a footnote */
.stat-label { order: 1; }
.stat-value { order: 2; }
.stat-foot { order: 3; margin-top: -0.15rem; font-size: 0.78rem; color: var(--gray-500); }
.stat-value {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 400;
  color: var(--gray-900);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: 0.01em;
}
.stat-label {
  color: var(--gray-500);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================================================
   Dashboard redesign — adaptive home: money story + needs-you + performance.
   ========================================================================== */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; margin-bottom: 1.5rem; }
.dash-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.3rem; }
.dash-sec-head h2 { margin: 0; font-size: 1.35rem; }
.dash-eyebrow { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-700); margin-bottom: 0.2rem; }
.dash-period-plain { font-size: 0.8rem; font-weight: 600; color: var(--gray-500); }
.dash-period { font-size: 0.8rem; font-weight: 600; color: var(--gray-600); border: 1px solid var(--gray-200); border-radius: 9999px; padding: 0.3rem 0.8rem; background: #fff; }

/* money story */
.dash-money {
  background:
    radial-gradient(130% 160% at 90% -20%, rgba(250, 204, 21, 0.16), transparent 45%),
    #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-sm);
  padding: 1.6rem 1.8rem;
}
/* subgrid keeps label / figure / footnote on shared rows, so a label that wraps
   to two lines can't knock the two figures out of alignment */
.dash-flow { display: grid; grid-template-columns: 1fr auto 1fr; grid-template-rows: auto auto auto; gap: 0.35rem 1rem; margin: 0.6rem 0 1.3rem; }
.dash-step { display: grid; grid-template-rows: subgrid; grid-row: 1 / -1; align-content: start; min-width: 0; }
.dash-arrow { grid-row: 2; }
.dash-metric-label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--gray-500); }
.dash-fig { font-family: var(--font-serif); font-size: 2.2rem; line-height: 1; color: var(--gray-900); }
.dash-money.is-empty .dash-fig { color: var(--gray-400); }
.dash-foot { font-size: 0.82rem; color: var(--gray-500); }
.dash-arrow { display: inline-grid; place-items: center; }
.dash-arrow-svg { width: 26px; height: 26px; color: var(--accent-300); }
.dash-ledger { border-top: 1px solid var(--gray-100); padding-top: 1.1rem; }
.dash-ledgerbar { display: flex; height: 12px; border-radius: 9999px; overflow: hidden; margin-bottom: 0.8rem; background: var(--gray-100); }
.dash-ledgerbar i { display: block; }
.seg-paid { background: var(--green-ink); }
.seg-owed { background: var(--accent-500); }
.seg-held { background: var(--accent-yellow); }
.dash-chips { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.dash-chip { display: flex; align-items: center; font-size: 0.9rem; color: var(--gray-700); }
.dash-chip .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; margin-right: 0.5rem; }
.dash-chip b { color: var(--gray-900); font-weight: 700; }
.dash-chip small { color: var(--gray-500); }
.dash-emptyhint { font-size: 0.85rem; color: var(--gray-500); margin: 0.1rem 0 0; }

/* needs you */
.dash-needs { padding: 0; overflow: hidden; }
.dash-needs-head { display: flex; align-items: center; justify-content: space-between; padding: 1.2rem 1.5rem 0.8rem; }
.dash-needs-head h2 { margin: 0; font-size: 1.2rem; }
.dash-needs-head .cnt { font-size: 0.8rem; font-weight: 600; color: var(--gray-500); }
.dash-need { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.5rem; border-top: 1px solid var(--gray-100); }
.dash-sv { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.sv-op { background: var(--accent-500); box-shadow: 0 0 0 4px var(--accent-50); }
.sv-warn { background: var(--amber-ink); box-shadow: 0 0 0 4px var(--amber-soft); }
.sv-bad { background: var(--red-ink); box-shadow: 0 0 0 4px var(--red-soft); }
.dash-need-txt { flex: 1; min-width: 0; }
.dash-need-txt b { color: var(--gray-900); font-weight: 700; }
.dash-need-txt p { margin: 0.05rem 0 0; font-size: 0.82rem; color: var(--gray-500); }
.dash-allclear { display: flex; align-items: center; gap: 0.5rem; padding: 1.1rem 1.5rem; color: var(--green-ink); font-weight: 600; border-top: 1px solid var(--gray-100); }
.dash-allclear svg { width: 1.2rem; height: 1.2rem; flex: none; }

/* performance */
.dash-perf { margin-bottom: 1.5rem; }
.dash-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.dash-kpi { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--r-xl); box-shadow: var(--shadow-sm); padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: 0.5rem; transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out; }
.dash-kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.dash-kpi-label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--gray-500); }
.dash-kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.dash-kpi-value { font-family: var(--font-serif); font-size: 1.85rem; line-height: 1; color: var(--gray-900); }
.dash-delta { font-size: 0.75rem; font-weight: 700; padding: 0.12rem 0.45rem; border-radius: 9999px; white-space: nowrap; }
.dash-delta.up, .dash-delta.new { background: var(--green-soft); color: var(--green-ink); }
.dash-delta.down { background: var(--red-soft); color: var(--red-ink); }
.dash-delta.flat { background: var(--gray-100); color: var(--gray-500); }

/* sparkline */
.spark { width: 100%; height: 38px; display: block; }
.spark-line { fill: none; stroke: var(--accent-500); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spark-fill { fill: var(--accent-400); opacity: 0.15; stroke: none; }
.spark-dot { fill: var(--accent-600); }

/* panels: channel mix + leaderboard */
.dash-panels { display: grid; grid-template-columns: 1.15fr 1fr; gap: 1.5rem; }
.dash-panels .card { margin: 0; }
.dash-panels h2 { font-size: 1.2rem; margin: 0 0 0.3rem; }
.dash-mix .dash-kpi-label { margin-bottom: 0.4rem; display: block; }
.dash-mix-row { display: grid; grid-template-columns: 130px 1fr 3rem; align-items: center; gap: 0.8rem; margin: 0.7rem 0; font-size: 0.9rem; }
.dash-mix-nm { color: var(--gray-700); display: flex; align-items: center; gap: 0.5rem; }
.dash-mix-nm .sw { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.dash-mix-track { height: 9px; border-radius: 9999px; background: var(--gray-100); overflow: hidden; }
.dash-mix-track i { display: block; height: 100%; border-radius: 9999px; }
.dash-mix-pct { font-weight: 700; color: var(--gray-900); text-align: right; }
.dash-mix-cap { margin: 1rem 0 0; font-size: 0.8rem; color: var(--gray-500); border-top: 1px dashed var(--gray-200); padding-top: 0.8rem; }
.dash-mix-cap b { color: var(--accent-600); }
.dash-lead-row { display: flex; align-items: center; gap: 0.8rem; margin: 0.55rem 0; }
.dash-lead-rk { width: 20px; color: var(--gray-400); font-weight: 700; font-size: 0.85rem; text-align: center; flex: none; }
.dash-lead-av { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 0.75rem; flex: none; }
.dash-lead-nm { flex: 1; min-width: 0; color: var(--gray-900); font-weight: 600; font-size: 0.9rem; line-height: 1.2; }
.dash-lead-nm small { display: block; color: var(--gray-500); font-weight: 400; font-size: 0.76rem; }
.dash-lead-bar { width: 54px; height: 6px; border-radius: 9999px; background: var(--gray-100); overflow: hidden; flex: none; }
.dash-lead-bar i { display: block; height: 100%; background: var(--accent-400); }
.dash-lead-pv { font-family: var(--font-serif); color: var(--gray-900); font-size: 1rem; width: 4.6rem; text-align: right; flex: none; }

/* activation: setup tracker */
.dash-setup {
  background:
    radial-gradient(75% 120% at 90% -25%, rgba(250, 204, 21, 0.28), transparent 55%),
    linear-gradient(135deg, #fff 0%, #fff7ed 62%, #ffedd5 128%);
  border: 1px solid rgba(234, 88, 12, 0.14);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-sm);
  padding: 1.6rem 1.8rem;
}
.dash-setup-top { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.dash-setup-top h2 { margin: 0; font-size: 1.35rem; }
.dash-prog { display: flex; align-items: center; gap: 0.6rem; font-size: 0.82rem; font-weight: 700; color: var(--accent-700); white-space: nowrap; }
.dash-prog-bar { width: 110px; height: 8px; border-radius: 9999px; background: rgba(234, 88, 12, 0.15); overflow: hidden; }
.dash-prog-bar i { display: block; height: 100%; background: var(--gradient-accent); border-radius: 9999px; }
.dash-steps { display: flex; flex-direction: column; }
.dash-step-r { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0.9rem; border-radius: var(--r-lg); }
.dash-step-r + .dash-step-r { border-top: 1px solid rgba(234, 88, 12, 0.09); }
.dash-step-r.is-now, .dash-step-r.is-now + .dash-step-r { border-top: 0; }
.dash-tick { width: 24px; height: 24px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.75rem; }
.dash-tick svg { width: 14px; height: 14px; }
.dash-step-body { flex: 1; min-width: 0; }
.dash-step-body b { display: block; font-weight: 600; font-size: 0.9375rem; line-height: 1.35; }
.dash-step-body p { margin: 0.1rem 0 0; font-size: 0.8125rem; line-height: 1.4; }

/* done — collapses to a single quiet line; the tick is the only signal needed */
.dash-step-r.is-done .dash-step-body { display: flex; align-items: baseline; gap: 0.45rem; flex-wrap: wrap; }
.dash-step-r.is-done .dash-tick { background: var(--green-soft); color: var(--green-ink); }
.dash-step-r.is-done .dash-step-body b { font-weight: 500; font-size: 0.875rem; color: var(--gray-500); }
.dash-step-note { font-size: 0.8125rem; color: var(--gray-400); }
.dash-step-note::before { content: "·"; margin-right: 0.45rem; }

/* up next — the one row carrying weight */
.dash-step-r.is-now {
  background: #fff;
  border: 1px solid rgba(234, 88, 12, 0.18);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 6px 18px -10px rgba(234, 88, 12, 0.35);
  padding: 0.85rem 0.9rem;
  margin: 0.4rem 0;
}
.dash-step-r.is-now .dash-tick { background: var(--gradient-accent); color: #fff; box-shadow: 0 0 0 4px rgba(234, 88, 12, 0.1); }
.dash-step-r.is-now .dash-step-body b { color: var(--gray-900); font-weight: 700; }
.dash-step-r.is-now .dash-step-body p { color: var(--gray-600); }

/* later — legible, but plainly not your job yet */
.dash-step-r.is-todo .dash-tick { background: transparent; border: 1.5px solid var(--gray-300); color: var(--gray-400); }
.dash-step-r.is-todo .dash-step-body b { color: var(--gray-700); }
.dash-step-r.is-todo .dash-step-body p { color: var(--gray-400); }

/* activation: ghosted performance preview */
.dash-preview { position: relative; margin-bottom: 1.5rem; }
.dash-preview-note { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 2; }
.dash-preview-note span { background: #fff; border: 1px solid var(--gray-200); border-radius: 9999px; padding: 0.5rem 1.1rem; font-size: 0.85rem; font-weight: 600; color: var(--gray-600); box-shadow: var(--shadow-md); }
.dash-ghost { filter: grayscale(0.25) opacity(0.5); pointer-events: none; margin-bottom: 0; }

/* programs — a row list, not a table: each program is one object, and its type,
   attribution and currency read as one sentence about it rather than four cells.
   Heading lives inside the card, matching "Needs you". */
.dash-pgms { padding: 0; overflow: hidden; }
.dash-pgm-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.2rem 1.5rem 0.8rem; }
.dash-pgm-head h2 { margin: 0; font-size: 1.2rem; }
.dash-pgm-head .cnt { font-size: 0.8rem; font-weight: 600; color: var(--gray-500); }
/* the empty state has no rows to bleed to the card edge, so it pays back the padding */
.dash-pgms .empty-state { padding: 0.5rem 1.5rem 2rem; }
.dash-pgm-row {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1.05rem 1.5rem;
  transition: background-color 0.2s ease-in-out;
}
.dash-pgm-row { border-top: 1px solid var(--gray-100); }
.dash-pgm-row:hover, .dash-pgm-row:focus-within { background: var(--accent-50); }
.dash-pgm-tile {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: var(--r-lg);
  display: inline-grid;
  place-items: center;
  background: var(--accent-50);
  border: 1px solid rgba(234, 88, 12, 0.14);
  color: var(--accent-600);
  transition: background-color 0.2s ease-in-out;
}
/* the hover tint is --accent-50, the same wash the tile and badge sit on, so
   both flip to white to keep their edges */
.dash-pgm-row:hover .dash-pgm-tile,
.dash-pgm-row:hover .dash-pgm-nm .badge { background: #fff; }
.dash-pgm-nm .badge { transition: background-color 0.2s ease-in-out; }
.dash-pgm-tile svg { width: 1.15rem; height: 1.15rem; }
.dash-pgm-txt { min-width: 0; }
.dash-pgm-nm { display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap; }
.dash-pgm-nm a { color: var(--gray-900); font-weight: 700; font-size: 0.975rem; text-decoration: none; }
/* the name link owns the whole row, so a click anywhere opens the program */
.dash-pgm-nm a::after { content: ""; position: absolute; inset: 0; }
.dash-pgm-txt p { margin: 0.12rem 0 0; font-size: 0.82rem; color: var(--gray-500); }
.dash-pgm-go {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--gray-200);
  border-radius: 9999px;
  background: #fff;
  color: var(--gray-600);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}
.dash-pgm-go svg { width: 0.85rem; height: 0.85rem; transition: transform 0.2s ease-in-out; }
.dash-pgm-go:hover { color: var(--accent-600); border-color: var(--accent-300); }
.dash-pgm-go:hover svg { transform: translateX(2px); }
@media (prefers-reduced-motion: reduce) {
  .dash-pgm-go:hover svg { transform: none; }
}
@media (max-width: 560px) {
  .dash-pgm-row { grid-template-columns: auto 1fr; }
  .dash-pgm-go { grid-column: 2; justify-self: start; margin-top: 0.6rem; }
}

@media (max-width: 900px) {
  .dash-grid, .dash-panels { grid-template-columns: 1fr; }
  .dash-kpis { grid-template-columns: repeat(2, 1fr); }
  /* stacked: the columns no longer sit side by side, so drop the shared rows */
  .dash-flow { grid-template-columns: 1fr; grid-template-rows: none; gap: 0.9rem; }
  .dash-flow .dash-step { display: flex; flex-direction: column; gap: 0.35rem; grid-row: auto; }
  .dash-flow .dash-arrow { grid-row: auto; transform: rotate(90deg); }
}

/* ---- filter chips: pill style ---- */
.filter-row { display: flex; gap: 0.5rem; margin: 1rem 0; align-items: center; flex-wrap: wrap; }
.filter-row a {
  text-decoration: none;
  padding: 0.3rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid var(--gray-200);
  background: #fff;
  color: var(--gray-600);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: border-color 0.2s ease-in-out, color 0.2s ease-in-out, background-color 0.2s ease-in-out;
}
.filter-row a:hover { border-color: var(--accent-300); color: var(--accent-600); }
.filter-row a.active {
  background: var(--accent-600);
  border-color: var(--accent-600);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.filter-sep { color: var(--gray-300); }
.bulk-actions { margin: 1rem 0; display: flex; align-items: center; gap: 0.5rem; }
.bulk-count { font-size: 0.85rem; font-weight: 600; color: var(--gray-600); margin-right: 0.25rem; }

/* Status and tax-form filters read as one band rather than two loose rows: a
   hairline divides the two groups, and each inner row drops its own margin. */
.filters { display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap; margin: 1rem 0; }
.filters .filter-row { margin: 0; }
.filter-divider { width: 1px; align-self: stretch; min-height: 1.25rem; background: var(--gray-200); }
.filter-label { color: var(--gray-500); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

/* Contextual selection toolbar: the bulk-select controller reveals it only once
   rows are checked. The primary/danger verdicts sit apart from the tag controls,
   split by a hairline, so the two kinds of action don't read as one row. */
.select-bar {
  margin: 1rem 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.8rem 1.1rem;
  background: #fff;
  border: 1px solid var(--accent-200);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
}
/* the flex display would otherwise beat the [hidden] attribute's display:none */
.select-bar[hidden] { display: none; }
.select-bar-lead { display: flex; align-items: center; gap: 0.85rem; }
.select-bar-count { font-size: 0.9rem; font-weight: 600; color: var(--gray-900); }
/* quiet text button: an explicit way out of a selection, alongside Escape */
.select-bar-clear {
  background: none; border: none; padding: 0; cursor: pointer;
  font: inherit; font-size: 0.8125rem; font-weight: 600; color: var(--gray-500);
  transition: color 0.2s ease-in-out;
}
.select-bar-clear:hover { color: var(--accent-600); }
.select-bar-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.select-bar-div { width: 1px; align-self: stretch; min-height: 1.5rem; background: var(--gray-200); margin: 0 0.25rem; }
/* the tag field is inline here, not the full-width block a form input defaults to */
.select-bar .select-bar-input { width: 11rem; max-width: 11rem; margin: 0; padding: 0.45rem 0.7rem; }

/* promoters table: the checkbox column shrinks to its box, Balance aligns right */
.promoters-table .col-check { width: 1px; white-space: nowrap; }
.promoters-table th.col-num, .promoters-table td.col-num { text-align: right; }
.promoters-table th.col-menu, .promoters-table td.col-menu { width: 1px; white-space: nowrap; text-align: right; padding-left: 0.4rem; }

/* ---- per-row action menu (ellipsis dropdown) ---- */
.rowmenu { position: relative; display: inline-flex; }
.rowmenu-trigger {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; padding: 0;
  border: 1px solid transparent; border-radius: var(--r-md);
  background: none; color: var(--gray-500); cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.rowmenu-trigger svg { width: 1.25rem; height: 1.25rem; }
.rowmenu-trigger:hover { background: var(--gray-100); color: var(--gray-800); }
.rowmenu.open .rowmenu-trigger { background: var(--gray-100); color: var(--gray-900); border-color: var(--gray-200); }
/* placed in JS (position:fixed) so it escapes the table card's overflow clip */
.rowmenu-pop {
  position: fixed; z-index: 60; display: none;
  min-width: 12.5rem; padding: 0.35rem;
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
}
.rowmenu.open .rowmenu-pop { display: block; }
.rowmenu-copy, .rowmenu-form { display: contents; }
.rowmenu-item {
  display: flex; align-items: center; gap: 0.6rem; width: 100%;
  padding: 0.5rem 0.6rem; border-radius: calc(var(--r-lg) - 4px);
  background: none; border: none; text-align: left; cursor: pointer;
  font: inherit; font-size: 0.875rem; font-weight: 500; color: var(--gray-700);
  transition: background-color 0.12s ease, color 0.12s ease;
}
.rowmenu-item svg { width: 1.1rem; height: 1.1rem; flex: none; color: var(--gray-500); transition: color 0.12s ease; }
.rowmenu-item:hover { background: var(--gray-100); color: var(--gray-900); text-decoration: none; }
.rowmenu-item:hover svg { color: var(--gray-700); }
.rowmenu-item:disabled, .rowmenu-item[disabled] { color: var(--gray-300); background: none; cursor: not-allowed; }
.rowmenu-item:disabled svg, .rowmenu-item[disabled] svg { color: var(--gray-300); }
.rowmenu-item.danger { color: var(--red-ink); }
.rowmenu-item.danger svg { color: var(--red-ink); }
.rowmenu-item.danger:hover { background: var(--red-soft); color: var(--red-ink); }
.rowmenu-item.danger:disabled, .rowmenu-item.danger[disabled] { color: var(--gray-300); background: none; }
.rowmenu-item.danger:disabled svg { color: var(--gray-300); }
.rowmenu-div { height: 1px; background: var(--gray-100); margin: 0.3rem 0.25rem; }

/* ---- provenance & journeys (suite phase 2) ---- */
.tier-note { margin: -8px 0 16px; }
.chan-bar { background: var(--gray-100); border-radius: 999px; height: 8px; overflow: hidden; min-width: 120px; }
.chan-bar-fill { background: var(--accent-600); height: 100%; border-radius: 999px; }
.journey { list-style: none; margin: 0; padding: 0; }
.journey-touch { display: flex; gap: 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--gray-100); flex-wrap: wrap; }
.journey-touch:last-child { border-bottom: none; }
.journey-when { color: var(--gray-500); font-size: 13px; }
.journey-url { color: var(--gray-500); font-size: 13px; word-break: break-all; }
.journey-lookup { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.journey-lookup input[type="text"] { max-width: 260px; }

/* ---- onboarding checklist ---- */
.checklist { list-style: none; margin: 0.5rem 0 0; padding: 0; display: flex; flex-direction: column; }
.checklist li { display: flex; gap: 0.85rem; padding: 0.65rem 0; align-items: flex-start; }
.checklist li + li { border-top: 1px solid var(--gray-100); }
.step-dot {
  width: 1.75rem;
  height: 1.75rem;
  flex: none;
  border-radius: 9999px;
  background: var(--accent-50);
  color: var(--accent-700);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-top: 0.05rem;
}
.checklist li.done .step-dot { background: var(--green-soft); color: var(--green-ink); }
.checklist li.done .step-body { color: var(--gray-400); }
.checklist li.done .step-body a { color: var(--gray-400); }
.step-body { font-size: 0.875rem; padding-top: 0.2rem; }

/* ---- empty states ---- */
.empty-state { text-align: center; padding: 2.75rem 1.5rem; }
.empty-state-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  background: var(--accent-50);
  color: var(--accent-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}
.empty-state-icon svg { width: 1.5rem; height: 1.5rem; }
.empty-state h3 { font-family: var(--font-sans); font-weight: 600; font-size: 1rem; margin: 0 0 0.25rem; }
.empty-state p { color: var(--gray-500); font-size: 0.875rem; margin: 0 0 1rem; max-width: 30rem; margin-inline: auto; }
.empty-state-actions { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }

/* ---- reports: affiliate leaderboard + per-link share bars ---- */
/* Section 1 reuses the dashboard leaderboard rows, but as a longer ranked list:
   hairline dividers help the eye track up to 50 rows. Scoped so /dashboard's
   short leaderboard keeps its tight, borderless rhythm. */
.reports-lead .dash-lead-row { margin: 0; padding: 0.7rem 0; border-bottom: 1px solid var(--gray-100); }
.reports-lead .dash-lead-row:first-child { padding-top: 0.2rem; }
.reports-lead .dash-lead-row:last-child { padding-bottom: 0; border-bottom: none; }
.reports-lead .dash-lead-nm a { color: var(--gray-900); font-weight: 600; }
.reports-lead .dash-lead-nm a:hover { color: var(--accent-700); }

/* Section 2: a clean ranked table where the Clicks column carries a slim
   proportional bar, so relative volume reads at a glance without a chart. */
.reports-links th.share-col, .reports-links td.share-col { width: 34%; min-width: 5rem; }
.reports-links td.num, .reports-links th.num { text-align: right; font-variant-numeric: tabular-nums; }
.reports-links .share-track { display: block; height: 6px; border-radius: 9999px; background: var(--gray-100); overflow: hidden; }
.reports-links .share-track i { display: block; height: 100%; border-radius: 9999px; background: var(--accent-300); }

/* ---- copy-to-clipboard rows ---- */
.copy-row {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
  min-width: 0; /* shrink inside a flex header instead of forcing horizontal scroll */
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--r-lg);
  padding: 0.3rem 0.3rem 0.3rem 0.75rem;
  margin: 0.15rem 0;
}
.copy-row code {
  background: transparent;
  padding: 0;
  font-size: 0.8125rem;
  min-width: 0; /* lets the ellipsis truncate long URLs rather than overflow */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.copy-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid var(--gray-200);
  background: #fff;
  color: var(--gray-600);
  border-radius: var(--r-md);
  padding: 0.25rem 0.6rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease-in-out, color 0.2s ease-in-out;
}
.copy-btn:hover { border-color: var(--accent-300); color: var(--accent-600); }
.copy-btn svg { width: 0.875rem; height: 0.875rem; }
.copy-btn.copied { border-color: var(--green-ink); color: var(--green-ink); }

/* a fieldset should read as a labelled group, not a browser-default box */
fieldset { border: 0; padding: 0; margin: 0.9rem 0; min-width: 0; }
legend {
  padding: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gray-500);
}

/* ---- campaign form: two-column settings rows + upgraded components ---- */
.campaign-form { max-width: 58rem; }
/* each section is a row: label + description on the left, controls on the right */
.form-row {
  display: grid;
  grid-template-columns: 15rem minmax(0, 30rem);
  gap: 1.25rem 3rem;
  padding: 1.75rem 0;
}
/* divider sits between rows only — never above the first section */
.form-row + .form-row { border-top: 1px solid var(--gray-200); }
.form-row__title {
  margin: 0;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--gray-500);
}
.form-row__desc {
  margin: 0.5rem 0 0; font-size: 0.8rem; line-height: 1.5; color: var(--gray-500);
}
/* the first control lines up with the section title, no stray top margin */
.form-row__body > label:first-child,
.form-row__body > .field-caption:first-child { margin-top: 0; }
.form-row--actions { padding-bottom: 0.25rem; }
/* submit sits at the right edge of the controls column */
.form-row--actions .form-row__body { display: flex; justify-content: flex-end; }

/* one column on narrow screens: head stacks above its controls */
@media (max-width: 800px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 0.6rem;
    padding: 1.4rem 0;
  }
  .form-row--actions .form-row__head { display: none; }
}

/* caption for a control that isn't a single input (segmented radio group) */
.field-caption {
  display: block; margin: 0.9rem 0 0;
  font-weight: 500; font-size: 0.875rem; color: var(--gray-700);
}
/* small descriptive line under a control — quieter than a field label.
   .field-desc is always shown; .choice-desc shows only the selected option's
   line (mirrors the attribution menu) */
.field-desc,
.choice-desc {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem; line-height: 1.4; font-weight: 400; color: var(--gray-500);
}
.choice-desc { display: none; }
.segmented:has(#program_program_type_affiliate:checked) ~ .choice-desc[data-type="affiliate"],
.segmented:has(#program_program_type_referral:checked) ~ .choice-desc[data-type="referral"],
.segmented:has(#program_visibility_public:checked) ~ .choice-desc[data-visibility="public"],
.segmented:has(#program_visibility_private:checked) ~ .choice-desc[data-visibility="private"],
.segmented:has(#program_attribution_model_last_touch:checked) ~ .choice-desc[data-attribution="last_touch"],
.segmented:has(#program_attribution_model_first_touch:checked) ~ .choice-desc[data-attribution="first_touch"] {
  display: block;
}

/* segmented pill toggle (segmented helper) */
.segmented {
  display: inline-flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.35rem;
  padding: 0.25rem; background: var(--gray-100);
  border: 1px solid var(--gray-200); border-radius: var(--r-lg);
}
/* visually hidden but focusable — keeps keyboard + AT working */
.segmented__input { position: absolute; width: 1px; height: 1px; opacity: 0; margin: 0; }
.segmented__opt {
  display: inline-flex; align-items: center; justify-content: center;
  margin: 0; padding: 0.4rem 1rem; border-radius: calc(var(--r-lg) - 4px);
  font-size: 0.875rem; font-weight: 500; color: var(--gray-600);
  cursor: pointer; user-select: none;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.segmented__input:checked + .segmented__opt {
  background: #fff; color: var(--accent-700); box-shadow: var(--shadow-sm);
}
.segmented__input:focus-visible + .segmented__opt {
  outline: 2px solid var(--accent-500); outline-offset: 2px;
}

/* input with a leading URL prefix (slug) */
.field-prefix {
  display: flex; align-items: stretch; max-width: 28rem; margin-top: 0.3rem;
  background: #fff; border: 1px solid var(--gray-300);
  border-radius: var(--r-lg); overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field-prefix:focus-within {
  border-color: var(--accent-500); box-shadow: 0 0 0 3px rgb(249 115 22 / 0.15);
}
.field-prefix__lead {
  display: flex; align-items: center;
  padding: 0.55rem 0.15rem 0.55rem 0.75rem;
  color: var(--gray-500); font-size: 0.875rem; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 62%;
}
.field-prefix input {
  flex: 1; min-width: 0; max-width: none;
  margin: 0; border: 0; border-radius: 0; box-shadow: none;
  padding-left: 0.1rem;
}
.field-prefix input:focus { box-shadow: none; }

/* number input with a trailing unit adornment */
.field-unit { position: relative; display: block; max-width: 28rem; margin-top: 0.3rem; }
.field-unit input { margin-top: 0; padding-right: 3.2rem; }
.field-unit__suffix {
  position: absolute; right: 0.85rem; top: 50%; transform: translateY(-50%);
  color: var(--gray-500); font-size: 0.875rem; pointer-events: none;
}

/* two short fields side by side */
.form-grid-2 {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem; max-width: 28rem; margin-top: 1.5rem;
}
.form-grid-2 > label { margin: 0; }
@media (max-width: 640px) { .form-grid-2 { grid-template-columns: 1fr; } }

/* checkbox + its description read as one block (no card border) */
.check-card {
  display: flex; gap: 0.7rem; align-items: flex-start; max-width: 28rem;
  margin: 0.35rem 0; font-weight: 400; cursor: pointer;
}
.check-card input { margin-top: 0.15rem; flex: none; }
.check-card__title { display: block; font-weight: 600; font-size: 0.875rem; color: var(--gray-800); }
.check-card__desc { display: block; margin-top: 0.2rem; font-size: 0.8rem; line-height: 1.45; color: var(--gray-500); }

/* ---- details / add-rule disclosure ---- */
details.disclosure { margin-top: 1rem; }
/* the browser's ► marker is replaced by a chevron that rotates when open */
details.disclosure summary, .conn-help summary {
  cursor: pointer;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--accent-600);
  padding: 0.4rem 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: color 0.2s ease-in-out;
}
details.disclosure summary::-webkit-details-marker,
.conn-help summary::-webkit-details-marker { display: none; }
details.disclosure summary::before, .conn-help summary::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  flex: none;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.2s ease-in-out;
}
details.disclosure[open] summary::before, .conn-help[open] summary::before { transform: rotate(45deg); }
@media (prefers-reduced-motion: reduce) {
  details.disclosure summary::before, .conn-help summary::before { transition: none; }
}
details.disclosure summary:hover, .conn-help summary:hover { color: var(--accent-700); }
details.disclosure[open] summary { margin-bottom: 0.5rem; }
.disclosure-panel {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--r-lg);
  padding: 1rem 1.25rem;
}

/* ---- portal + public ---- */
.portal-shell { max-width: 780px; margin: 0 auto; padding: 0 1.25rem 2rem; }
.portal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 1.5rem;
}
.brand-small { font-family: var(--font-serif); font-size: 1.15rem; color: var(--gray-900); }
.powered-by { text-align: center; color: var(--gray-400); font-size: 0.8125rem; padding: 1.75rem 0 0.5rem; }
.powered-by a { color: var(--gray-500); font-weight: 500; }
.greeting { font-size: 2.1rem; }
.greeting .hand {
  font-family: var(--font-hand);
  font-weight: 600;
  font-size: 1.2em;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.share-link { font-size: 0.9rem; }

/* Account Portal card (branding editor) */
.portal-editor { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.5rem; align-items: start; }
@media (max-width: 800px) { .portal-editor { grid-template-columns: 1fr; } }
.portal-preview-label { font-size: 0.8125rem; color: var(--gray-500); margin: 0 0 0.5rem; }
.portal-preview-card { border: 1px solid var(--gray-200); border-radius: 12px; padding: 1.25rem; text-align: center; background: #fff; }
.portal-preview-card .auth-logo { max-height: 34px; margin: 0 auto 0.5rem; }
.portal-preview-card h3 { margin: 0.25rem 0; font-size: 1.05rem; }
.portal-preview-card p { font-size: 0.8125rem; color: var(--gray-500); }
.portal-preview-field { border: 1px solid var(--gray-200); border-radius: 8px; padding: 0.45rem 0.6rem; font-size: 0.8125rem; color: var(--gray-400); text-align: left; margin: 0.75rem 0 0.5rem; }
.portal-preview-btn { display: block; background: var(--brand-accent, var(--accent-600)); border-color: transparent; color: var(--brand-accent-ink, #fff); pointer-events: none; }

/* --- Affiliate space settings (spec 2026-07-10 affiliates-space) --- */
.space-editor { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
@media (max-width: 980px) { .space-editor { grid-template-columns: 1fr; } }
.space-editor-form { display: grid; gap: 16px; }
.space-preview { position: sticky; top: 24px; }
.space-preview-frame { background: #fff; border-radius: var(--r-2xl); box-shadow: var(--shadow-md); overflow: hidden; border: 1px solid var(--gray-200); }
.space-preview-topbar { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--gray-200); }
.space-preview-logo { max-height: 28px; max-width: 140px; }
.space-preview-wordmark { font-weight: 700; }
.space-preview-auth { padding: 26px 22px 18px; text-align: center; display: grid; gap: 10px; }
.space-preview-ghost { padding: 0 22px 22px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; opacity: .45; }
.space-preview-ghost .ghost-stat { height: 44px; border-radius: 10px; background: var(--gray-100); }
.space-preview-ghost .ghost-bar { grid-column: 1 / -1; height: 10px; border-radius: 6px; background: var(--brand-accent, var(--accent-600)); opacity: .35; }
.swatch-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; background: var(--sw); cursor: pointer; padding: 0; }
.swatch.is-active { border-color: var(--gray-900); box-shadow: inset 0 0 0 2px #fff; }
.swatch-custom { appearance: none; -webkit-appearance: none; background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); border: none; }
.swatch-custom::-webkit-color-swatch-wrapper { padding: 0; } .swatch-custom::-webkit-color-swatch { border: none; border-radius: 50%; opacity: 0; }
.accent-hex { width: 110px; }
.char-count { float: right; font-size: .78rem; color: var(--gray-500); }
.switch-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; cursor: pointer; }
.switch-row .switch-input { position: absolute; opacity: 0; }
.switch-row .switch { flex: 0 0 38px; height: 22px; border-radius: 11px; background: rgb(0 0 0 / .18); position: relative; transition: background .15s; margin-top: 2px; }
.switch-row .switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgb(0 0 0 / .2); }
.switch-row .switch-input:checked + .switch { background: var(--accent-600); }
.switch-row .switch-input:checked + .switch::after { left: 18px; }
.switch-row .switch-input:focus-visible + .switch { outline: 2px solid var(--accent-600); outline-offset: 2px; }
.switch-text { display: grid; } .switch-text small { color: var(--gray-500); }
.dropzone-shell { position: relative; display: block; }
.dropzone-shell .dz-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.dropzone-shell .dz-face { display: grid; justify-items: center; align-content: center; gap: 4px; min-height: 132px; padding: 22px; border: 2px dashed var(--gray-200); border-radius: var(--r-xl); text-align: center; color: var(--gray-500); box-sizing: border-box; }
.dropzone-shell .dz-face svg { width: 1.75rem; height: 1.75rem; margin-bottom: 4px; }
.dropzone-shell:hover .dz-face { border-color: var(--accent-600); color: inherit; }
/* Filled state: solid border, logo centered on a white tile, controls top-right. */
.dropzone-shell .dz-face--filled { display: none; gap: 8px; border-style: solid; }
.dropzone-shell.is-filled .dz-face--empty { display: none; }
.dropzone-shell.is-filled .dz-face--filled { display: grid; }
.dropzone-shell .dz-thumb { max-height: 72px; max-width: 72%; object-fit: contain; background: #fff; border: 1px solid var(--gray-100); border-radius: var(--r-lg); padding: 8px; box-sizing: border-box; }
.dropzone-shell .dz-caption { font-size: .8rem; color: var(--gray-500); }
.dropzone-shell .dz-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; z-index: 2; }
.dropzone-shell .dz-action { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 1px solid var(--gray-200); border-radius: var(--r-md); background: rgba(255, 255, 255, .92); color: var(--gray-500); cursor: pointer; }
.dropzone-shell .dz-action svg { width: 1rem; height: 1rem; margin: 0; }
.dropzone-shell .dz-action:hover { border-color: var(--accent-600); color: var(--accent-600); }
.dropzone-shell .dz-action--danger:hover { border-color: var(--red-ink); color: var(--red-ink); }

.portal-editor-form label { display: block; margin-top: 0.75rem; }
.accent-inputs { display: inline-flex; gap: 0.5rem; align-items: center; }
.accent-inputs input[type=color] { inline-size: 2.25rem; block-size: 2.25rem; padding: 0; border: 1px solid var(--gray-200); border-radius: 6px; cursor: pointer; }
.portal-sections { border: 1px solid var(--gray-200); border-radius: 8px; padding: 0.75rem 1rem; margin-top: 1rem; }
.portal-sections .checkbox-row { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.35rem; }

/* Account brand tokens (portal only) — fall back to Qanary orange. */
.portal-shell .btn-primary,
.portal-shell input[type=submit].btn-primary {
  background: var(--brand-accent, var(--accent-600));
  border-color: var(--brand-accent, var(--accent-600));
  color: var(--brand-accent-ink, #fff);
}
.portal-shell .btn-primary:hover,
.portal-shell input[type=submit].btn-primary:hover {
  background: var(--brand-accent-hover, var(--accent-700));
  border-color: var(--brand-accent-hover, var(--accent-700));
  color: var(--brand-accent-ink, #fff);
}
.portal-shell main a { color: var(--brand-accent, var(--accent-600)); }
.portal-shell main a:hover { color: var(--brand-accent-hover, var(--accent-700)); }
/* Interactive/focus states also carry the account's accent on the branded
   portal. The global focus/input/tab rules stay Qanary orange for the account
   app; these portal-scoped overrides adopt --brand-accent (same orange when
   unbranded, via the fallback). */
.portal-shell :focus-visible { outline-color: var(--brand-accent, var(--accent-500)); }
.portal-shell input[type=text]:focus,
.portal-shell input[type=email]:focus,
.portal-shell input[type=password]:focus,
.portal-shell input[type=url]:focus,
.portal-shell input[type=number]:focus,
.portal-shell select:focus,
.portal-shell textarea:focus {
  border-color: var(--brand-accent, var(--accent-500));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-accent, var(--accent-500)) 15%, transparent);
}
.portal-shell .filter-row a.active {
  background: var(--brand-accent, var(--accent-600));
  border-color: var(--brand-accent, var(--accent-600));
  color: var(--brand-accent-ink, #fff);
}
.portal-logo { max-height: 34px; max-width: 180px; display: block; }
.portal-support { text-align: center; font-size: 0.875rem; color: var(--gray-500); margin-top: 1.5rem; }
.portal-support a { color: var(--brand-accent, var(--accent-600)); }

/* Share hero + toolkit (spec 2026-07-10 portal-engagement) */
.share-hero { border-color: var(--brand-accent, var(--accent-200)); }
.share-hero-link code { font-size: 1rem; }
.share-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; }
.share-qr { margin-top: 0.9rem; }
.share-qr summary { cursor: pointer; color: var(--gray-500); font-size: 0.875rem; }
.share-qr svg { width: 160px; height: 160px; margin-top: 0.6rem; }

/* Combined promoter dashboard — per-campaign cards (spec 2026-07-10 Task 10) */
.your-campaigns { margin: 1.5rem 0; }
.campaign-cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.campaign-card { display: flex; flex-direction: column; gap: 0.6rem; border-color: var(--brand-accent, var(--accent-200)); }
.campaign-card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.campaign-card-head h3 { margin: 0; font-size: 1.05rem; }
.share-row { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.share-label { color: var(--gray-500); font-size: 0.8125rem; font-weight: 600; }

/* 30-day activity sparkline */
.activity-chart { width: 100%; height: 96px; display: block; }
.activity-chart rect { fill: var(--brand-accent, var(--accent-600)); opacity: 0.85; }
.activity-chart rect:hover { opacity: 1; }
.activity-chart circle { fill: var(--brand-accent-hover, var(--accent-700)); }
.activity-chart .chart-baseline { stroke: var(--gray-200); stroke-width: 1; }
.chart-summary { color: var(--gray-500); font-size: 0.875rem; margin: 0 0 0.5rem; }
.chart-months { display: flex; justify-content: space-between; font-size: 0.75rem; margin: 0.25rem 0 0; }
.chart-empty { margin: 1.25rem 0; }
.chart-earned { font-size: 0.9375rem; margin-top: 0.75rem; }

/* payout progress + milestone strip */
.payout-progress p { margin: 0 0 0.4rem; font-size: 0.9375rem; }
.progress-track { background: var(--gray-100); border-radius: 9999px; height: 10px; overflow: hidden; }
.progress-fill { background: var(--brand-accent, var(--accent-600)); height: 100%; border-radius: 9999px; transition: width 0.4s ease; }
.payout-progress-done { display: flex; align-items: center; gap: 0.4rem; color: var(--gray-900); font-weight: 500; }
.payout-progress-done svg, .milestone svg { width: 1.1rem; height: 1.1rem; flex: none; }
.milestones { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 1rem 0; }
.milestone { display: inline-flex; align-items: center; gap: 0.35rem; border: 1px solid var(--gray-200); border-radius: 9999px; padding: 0.3rem 0.8rem; font-size: 0.8125rem; color: var(--gray-500); }
.milestone.done { border-color: var(--brand-accent, var(--accent-200)); color: var(--gray-900); }
.milestone.done svg { color: var(--brand-accent, var(--accent-600)); }

/* leaderboard */
.leaderboard-rows { list-style: none; margin: 0 0 0.75rem; padding: 0; }
.leaderboard-rows li { display: flex; gap: 0.75rem; align-items: baseline; padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--gray-100); }
.leaderboard-rank { color: var(--gray-400); font-variant-numeric: tabular-nums; min-width: 2.2rem; }
.leaderboard-name { flex: 1; }
.leaderboard-count { color: var(--gray-500); font-size: 0.875rem; }
.leaderboard-you { background: color-mix(in srgb, var(--brand-accent, var(--accent-600)) 8%, transparent); border-radius: 8px; }
.leaderboard-you .leaderboard-name { font-weight: 600; }
.leaderboard-own-row { margin-top: 0.4rem; border-top: 1px dashed var(--gray-200); }
.leaderboard-toggle { font-size: 0.8125rem; }

/* ---- auth + marketing ---- */
.auth-card {
  max-width: 26.5rem;
  margin: 7vh auto 3rem;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-md);
  padding: 2rem;
}
.auth-card h1 { font-size: 1.5rem; margin: 0 0 0.35rem; }
.auth-card .lede { color: var(--gray-500); font-size: 0.9375rem; margin: 0 0 0.75rem; }
.auth-card input[type=submit], .auth-card .btn-primary { width: 100%; margin-top: 1.1rem; padding: 0.65rem 1rem; }
.auth-card .muted { font-size: 0.875rem; margin-top: 1.25rem; text-align: center; }
.password-strength { color: var(--gray-500); font-size: 0.8125rem; margin: -0.25rem 0 0; }
.password-strength.is-weak { color: var(--red-600, #b42318); }
.password-strength.is-strong { color: var(--green-600, #067647); }
.auth-card-branded { text-align: center; }
.auth-card-branded form, .auth-card-branded label { text-align: left; }
/* The public join/refer cards render under the application layout (no
   .portal-shell), so the account accent (set via portal_brand_css in the
   head) reaches their primary button and focus states here instead. Falls
   back to Qanary orange when the account hasn't set an accent. */
.auth-card-branded .btn-primary,
.auth-card-branded input[type=submit].btn-primary {
  background: var(--brand-accent, var(--accent-600));
  border-color: var(--brand-accent, var(--accent-600));
  color: var(--brand-accent-ink, #fff);
}
.auth-card-branded .btn-primary:hover,
.auth-card-branded input[type=submit].btn-primary:hover {
  background: var(--brand-accent-hover, var(--accent-700));
  border-color: var(--brand-accent-hover, var(--accent-700));
}
.auth-card-branded input:focus, .auth-card-branded textarea:focus {
  border-color: var(--brand-accent, var(--accent-500));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-accent, var(--accent-500)) 15%, transparent);
}
.auth-card-branded a { color: var(--brand-accent, var(--accent-600)); }
.auth-logo { max-height: 44px; max-width: 200px; margin: 0 auto; display: block; }
.auth-wordmark { font-family: var(--font-serif); font-size: 1.25rem; }
.auth-brand { display: flex; justify-content: center; margin-bottom: 1.25rem; }
.auth-brand a { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.auth-footnote { text-align: center; color: var(--gray-400); font-size: 0.8125rem; max-width: 26.5rem; margin: -2rem auto 3rem; }

/* eyebrow badge (marketing + shared) */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent-50);
  color: var(--accent-700);
  border: 1px solid var(--accent-100);
  border-radius: 9999px;
  padding: 0.3rem 0.9rem;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}
.eyebrow svg { width: 1rem; height: 1rem; flex: none; }
/* The hero "Works with" eyebrow carries brand marks, so let it wrap gracefully
   on narrow screens instead of overflowing the pill. */
.eyebrow-platforms { flex-wrap: wrap; justify-content: center; }
/* "Works with" sits as plain text above the pill that holds the platform marks. */
.eyebrow-lede {
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  color: var(--accent-700); font-weight: 600; font-size: 0.8125rem;
  margin-bottom: 0.65rem;
}
.eyebrow-lede svg { width: 1rem; height: 1rem; flex: none; }
.mkt-plat { display: inline-flex; align-items: center; gap: 0.3rem; }
.mkt-plat-logo { width: 1rem; height: 1rem; flex: none; }
.mkt-plat-sep { color: var(--accent-300); }
.mkt-nowrap { white-space: nowrap; }
.cta-row { display: flex; gap: 0.8rem; justify-content: center; margin: 2rem 0; flex-wrap: wrap; }

/* pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem;
  margin: 3.5rem 0 1.25rem;
  text-align: left;
  align-items: stretch;
}
.tier {
  position: relative;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem 1.4rem 1.4rem;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease-in-out, transform 0.2s ease-in-out;
}
.tier:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.tier h3 { font-family: var(--font-sans); font-weight: 600; font-size: 0.9375rem; color: var(--gray-500); margin: 0; }
.tier-hot { border: 2px solid var(--accent-600); box-shadow: var(--shadow-lg); }
.tier-badge {
  position: absolute;
  top: -0.8rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gradient-accent);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 9999px;
  padding: 0.25rem 0.75rem;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}
.tier .price { font-size: 1.75rem; font-weight: 700; color: var(--gray-900); margin: 0.35rem 0 0.75rem; }
.tier .price small { font-size: 0.875rem; font-weight: 500; color: var(--gray-500); }
.tier-features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.tier-features li { display: flex; gap: 0.5rem; align-items: flex-start; font-size: 0.8438rem; color: var(--gray-600); }
.tier-features svg { width: 1rem; height: 1rem; flex: none; color: var(--accent-500); margin-top: 0.15rem; }
/* landing tier CTAs — margin-top:auto pins them to one baseline across uneven cards */
.tier-cta { margin-top: auto; padding-top: 1.2rem; }
.tier-cta .btn { display: block; width: 100%; text-align: center; }
/* in-app billing plan chooser: same cards, tighter into the page (no hero
   above the grid to justify the marketing 3.5rem lead-in) */
.pricing-grid--billing { margin-top: 1.25rem; }
/* the tier the account is already on — reads as a settled state, not a CTA */
.tier-current {
  display: block;
  text-align: center;
  padding: 0.5rem 1rem;
  border: 1px dashed var(--gray-300);
  border-radius: var(--r-lg);
  background: var(--gray-50);
  color: var(--gray-500);
  font-size: 0.8125rem;
  font-weight: 600;
}

/* ---- vue island: rule builder ---- */
.rule-builder { display: grid; gap: 0.6rem; }
.rule-builder .row { display: flex; gap: 0.75rem; align-items: end; flex-wrap: wrap; }
.rule-builder label { margin: 0.25rem 0; font-size: 0.8125rem; }
.rule-builder select, .rule-builder input { max-width: 13rem; }

/* ---- responsive ---- */
@media (max-width: 900px) {
  .app-shell { flex-direction: column; }
  /* The full-height card folds into a single horizontal bar: brand on the
     left, the links scrolling in the middle, and the account pinned to the
     right — same three parts as the desktop column, laid on their side. */
  .sidebar-col { display: contents; }
  .sidebar {
    width: auto;
    height: auto;
    flex: none;
    flex-direction: row;
    align-items: center;
    gap: 0.25rem;
    overflow: visible;
    margin: 0.75rem 0.75rem 0;
    border-radius: var(--r-2xl);
    padding: 0.55rem 0.7rem;
  }
  .sidebar-nav {
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    overflow-y: visible;
    margin: 0;
    padding: 0;
    -webkit-mask-image: none;
    mask-image: none;
  }
  /* Horizontal fade, again only while the row actually overflows. */
  .sidebar-nav[data-overflowing] {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 1.4rem), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 1.4rem), transparent);
  }
  .dash-hero { padding: 1.75rem 1.5rem; }
  .dash-hero h1 { font-size: 1.9rem; }
  .dash-blob-1 { width: 200px; height: 200px; }
  .brand { padding: 0 0.5rem 0 0; }
  .brand-name { display: none; }
  .nav-section { display: none; }
  .nav-link { white-space: nowrap; padding: 0.45rem 0.6rem; }
  .content { padding: 1.25rem 1rem 2.5rem; }
  .sidebar-account {
    flex: none;
    margin: 0 0 0 0.4rem;
    padding: 0 0 0 0.6rem;
    border-top: none;
    border-left: 1px solid rgba(234, 88, 12, 0.1);
  }
  .sidebar-account .acct { width: auto; padding: 0.3rem 0.45rem; }
  .sidebar-account .acct-meta { display: none; }
  /* On the top bar the trigger sits at the right edge, so the menu drops
     downward as a normal rounded popover rather than docking upward. */
  .acct-pop {
    left: auto;
    right: 0;
    top: calc(100% + 0.5rem);
    bottom: auto;
    min-width: 13rem;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: var(--r-2xl);
    box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.22);
    transform: translateY(-6px);
  }
  .sidebar-account.open .acct-pop { transform: none; }
  .sidebar-account.open .acct {
    border-color: rgba(234, 88, 12, 0.08);
    border-top-color: rgba(234, 88, 12, 0.08);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-sm);
  }
}
/* Phones: the horizontal-bar sidebar above clips its own links (the nav is
   wider than the viewport with nowhere to scroll), so at <=768px we swap to a
   slim top bar + an off-canvas drawer instead. These rules override the
   horizontal-bar treatment from the 900px block for this narrower range. */
@media (max-width: 768px) {
  .app-shell { position: relative; }
  .mobile-topbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.75rem; flex: none;
    padding: 0.55rem 1rem;
    background: #fff;
    border-bottom: 1px solid rgba(234, 88, 12, 0.1);
  }
  .mobile-topbar .brand { padding: 0; }
  .mobile-topbar .brand-name { display: inline; font-size: 1.2rem; }
  .mobile-topbar .brand-logo { width: 2.25rem; height: 2.25rem; }

  /* The sidebar column becomes a fixed off-canvas drawer, sliding in from the
     left over a scrim. Reset every horizontal-bar override from the 900px
     block back to the desktop vertical layout inside the drawer. */
  .sidebar-col {
    display: flex;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 60;
    width: min(82vw, 300px);
    margin: 0;
    transform: translateX(-100%);
    /* visibility keeps the closed drawer's links out of the tab order; the
       0s/.25s delay hides it only after the slide-out finishes. */
    visibility: hidden;
    transition: transform 0.25s ease, visibility 0s 0.25s;
  }
  .app-shell.nav-open .sidebar-col { transform: translateX(0); visibility: visible; transition: transform 0.25s ease; }
  .sidebar {
    flex-direction: column;
    align-items: stretch;
    height: 100%;
    overflow: hidden;
    gap: 0;
    margin: 0;
    border-radius: 0;
    padding: 1.1rem 0.7rem;
  }
  .sidebar .brand { padding: 0.25rem 0.625rem 1rem; }
  .brand-name { display: block; }
  .nav-section { display: block; }
  .sidebar-nav {
    flex: 1 1 auto;
    flex-direction: column;
    align-items: stretch;
    overflow-x: hidden;
    overflow-y: auto;
    margin: 0 -0.7rem;
    padding: 0 0.7rem 0.35rem;
  }
  .nav-link { white-space: normal; padding: 0.62rem 0.8rem; }
  .sidebar-account {
    flex: none;
    margin: 0.75rem 0 0;
    padding: 0.85rem 0 0;
    border-top: 1px solid rgba(234, 88, 12, 0.1);
    border-left: none;
  }
  .sidebar-account .acct { width: 100%; }
  .sidebar-account .acct-meta { display: flex; }
  /* In the drawer the account trigger is docked at the BOTTOM, so undo the
     900px top-bar block's downward drop and open the menu upward again —
     otherwise it renders below the trigger, off the bottom of the screen. */
  .acct-pop {
    left: 0; right: 0;
    top: auto; bottom: calc(100% + 0.5rem);
    transform: translateY(6px);
  }
  .sidebar-account.open .acct-pop { transform: none; }

  .mobile-nav-scrim {
    display: block;
    position: fixed; inset: 0; z-index: 50;
    background: rgba(17, 24, 39, 0.45);
    opacity: 0; pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .app-shell.nav-open .mobile-nav-scrim { opacity: 1; pointer-events: auto; }
}
@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  .sidebar-col, .mobile-nav-scrim { transition: none; }
}
@media (max-width: 720px) {
  table.card { display: block; overflow-x: auto; }
  /* stacked on mobile: stretch (not the desktop row's center) so the title
     column fills the width and a long copy-row shrinks/ellipsises inside it
     instead of shrink-wrapping to its content and overflowing the viewport */
  .page-header { flex-direction: column; align-items: stretch; }
}

/* ---- marketing footer ---- */
.site-footer { margin-top: 4rem; padding: 1.5rem 0; display: flex; gap: 1.5rem; justify-content: center;
               color: var(--stone-500, #78716c); font-size: .9rem; }
.site-footer a { color: inherit; }

/* ---- legal pages ---- */
.legal-page { max-width: 44rem; margin: 3rem auto; padding: 0 1.25rem; line-height: 1.65; }
.legal-page h1 { margin-bottom: .25rem; }
.legal-page h2 { margin-top: 2rem; font-size: 1.1rem; }

/* ============================================================================
   Marketing docs (docs#show) — recipes & guides rendered from markdown
   ========================================================================== */
.docs-page { max-width: 46rem; margin: 3rem auto 5rem; padding: 0 1.25rem; line-height: 1.7; color: var(--gray-800); }
.docs-back { display: inline-block; margin-bottom: 1.5rem; color: var(--accent-600); text-decoration: none; font-weight: 600; font-size: .9rem; }
.docs-back:hover { text-decoration: underline; }
.docs-body h1 { font-size: 1.9rem; line-height: 1.15; margin: .2rem 0 1rem; letter-spacing: -.02em; }
.docs-body h2 { font-size: 1.3rem; margin: 2.4rem 0 .6rem; letter-spacing: -.01em; }
.docs-body h3 { font-size: 1.05rem; margin: 1.8rem 0 .4rem; }
.docs-body p, .docs-body li { color: var(--gray-700); }
.docs-body a { color: var(--accent-600); }
.docs-body ul, .docs-body ol { padding-left: 1.4rem; margin: .8rem 0; }
.docs-body li { margin: .3rem 0; }
.docs-body code { font-size: .88em; background: var(--gray-100); border: 1px solid var(--gray-200); border-radius: .35rem; padding: .1rem .35rem; }
.docs-body pre { background: var(--gray-900); color: #f8fafc; border-radius: .6rem; padding: 1rem 1.15rem; overflow-x: auto; margin: 1rem 0; line-height: 1.55; }
.docs-body pre code { background: none; border: 0; padding: 0; color: inherit; font-size: .85rem; }
.docs-body blockquote { border-left: 3px solid var(--accent-300); margin: 1rem 0; padding: .2rem 0 .2rem 1rem; color: var(--gray-600); }
.docs-body table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: .92rem; display: block; overflow-x: auto; }
.docs-body th, .docs-body td { border: 1px solid var(--gray-200); padding: .5rem .7rem; text-align: left; }
.docs-body th { background: var(--gray-50); }
.docs-body hr { border: 0; border-top: 1px solid var(--gray-200); margin: 2rem 0; }

/* ============================================================================
   Marketing one-pager (home#index) — scoped under .mkt
   ========================================================================== */
.mkt { background: #fffdf8; overflow-x: clip; --nav-h: 4.8rem; }
@media (min-width: 768px) { .mkt { --nav-h: 5.6rem; } }
.mkt section { scroll-margin-top: 5rem; }

/* nav — fixed so the rounded island floats over the hero on load, then
   expands to a full-width bar on scroll */
.mkt-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding: 1.4rem 1rem 0;
  background: transparent; border-bottom: 1px solid transparent;
  transition: padding 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}
.mkt-nav-inner {
  max-width: 72rem; margin: 0 auto;
  padding: 0.5rem 0.7rem 0.5rem 1rem;
  display: flex; align-items: center; gap: 1.5rem;
  /* At the very top the bar is bare: brand, links and CTA float over the hero
     with no card behind them. The island (background/blur/border/shadow) fades
     in only once scrolled — see .is-scrolled below. */
  background: transparent;
  backdrop-filter: blur(0) saturate(1); -webkit-backdrop-filter: blur(0) saturate(1);
  border: 1px solid transparent; border-radius: var(--r-3xl);
  box-shadow: none;
  transition: border-radius 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease,
              background 0.3s ease, border-color 0.3s ease,
              backdrop-filter 0.3s ease, -webkit-backdrop-filter 0.3s ease;
}
/* scrolled: condense into the floating island and tighten padding (the logo and
   wordmark shrink via the --brand-logo / --brand-name vars below) */
.mkt-nav.is-scrolled { padding-top: 0.8rem; }
.mkt-nav.is-scrolled .mkt-nav-inner {
  padding: 0.3rem 0.6rem 0.3rem 0.85rem;
  background: rgb(255 253 248 / 0.82);
  backdrop-filter: blur(12px) saturate(1.4); -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border-color: var(--gray-100);
  box-shadow: var(--shadow-lg);
}
/* Logo sizes are driven by CSS vars on .mkt-nav so the scroll-shrink state
   (toggled by the landing controller) animates the same properties. */
.mkt-nav { --brand-logo: 48px; --brand-name: 1.4rem; }
@media (min-width: 768px) { .mkt-nav { --brand-logo: 64px; --brand-name: 1.75rem; } }
.mkt-nav.is-scrolled { --brand-logo: 42px; --brand-name: 1.3rem; }
@media (min-width: 768px) { .mkt-nav.is-scrolled { --brand-logo: 48px; --brand-name: 1.45rem; } }

.mkt-brand {
  display: flex; align-items: center; gap: 0.65rem;
  font-family: var(--font-sans); color: var(--gray-900);
  transform-origin: left center;
  transition: transform 0.3s ease-in-out;
}
.mkt-brand:hover { transform: scale(1.05); }

.mkt-brand-logo {
  position: relative; flex: none; display: inline-flex;
  width: var(--brand-logo); height: var(--brand-logo);
  transition: width 0.3s ease, height 0.3s ease;
}
.mkt-brand img {
  position: relative; z-index: 1;
  width: 100%; height: 100%; object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(234, 88, 12, 0.28));
  transition: transform 0.3s ease-in-out;
}
.mkt-brand:hover img { transform: rotate(3deg); }

/* Soft warm halo behind the logo — brand yellow→orange, revealed on hover. */
.mkt-brand-glow {
  position: absolute; inset: -20%; z-index: 0;
  border-radius: 50%;
  background: var(--gradient-accent);
  filter: blur(16px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease-in-out;
}
.mkt-brand:hover .mkt-brand-glow { opacity: 0.35; }

.mkt-brand-name {
  font-size: var(--brand-name); font-weight: 700; letter-spacing: -0.02em;
  transition: font-size 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
  .mkt-brand, .mkt-brand-logo, .mkt-brand img, .mkt-brand-name { transition: none; }
  .mkt-brand:hover { transform: none; }
  .mkt-brand:hover img { transform: none; }
}
.mkt-brand:hover { text-decoration: none; color: var(--gray-900); }
.mkt-links { display: flex; gap: 1.4rem; margin-left: auto; }
.mkt-links a { color: var(--gray-600); font-size: 0.9rem; font-weight: 500; }
.mkt-links a:hover { color: var(--accent-600); text-decoration: none; }
.mkt-nav-cta { display: flex; align-items: center; gap: 1rem; }
.mkt-signin { color: var(--gray-600); font-size: 0.9rem; font-weight: 500; }

/* hero — full-bleed band; the fixed nav floats over its top, so pad content
   down past the nav while the gradient/shapes fill the space behind it */
.mkt-hero {
  position: relative; overflow: hidden; isolation: isolate;
  width: 100%; padding: calc(var(--nav-h) + 3rem) 1.25rem 4.5rem; text-align: center;
}
.mkt-hero::before {
  content: ""; position: absolute; inset: -4rem 0 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(42rem 26rem at 22% 8%, var(--accent-50), transparent 62%),
    radial-gradient(38rem 26rem at 82% 4%, #fefce8, transparent 60%);
}
.mkt-hero > * { position: relative; z-index: 2; max-width: 62rem; margin-left: auto; margin-right: auto; }

/* geometric decorations — shared by the hero (dashboard's blob/ring/dot language) */
.mkt-shape { position: absolute; z-index: 1; pointer-events: none; }
.mkt-blob { border-radius: 50%; }
.mkt-blob-1 {
  width: 340px; height: 340px; right: -90px; top: -130px;
  background: radial-gradient(circle at 35% 35%, rgba(251, 146, 60, 0.28), rgba(234, 88, 12, 0.07) 70%);
}
.mkt-blob-2 {
  width: 190px; height: 190px; left: -70px; bottom: 10px;
  background: radial-gradient(circle at 40% 40%, rgba(250, 204, 21, 0.42), transparent 70%);
}
.mkt-ring {
  width: 108px; height: 108px; left: 6%; top: 24%;
  border-radius: 50%; border: 2px dashed rgba(234, 88, 12, 0.28);
}
.mkt-square {
  width: 66px; height: 66px; right: 8%; bottom: 20%;
  border-radius: 18px; border: 2px solid rgba(234, 88, 12, 0.24); transform: rotate(18deg);
}
.mkt-dot { border-radius: 50%; }
.mkt-dot-1 { width: 16px; height: 16px; background: var(--accent-500); right: 15%; top: 30%; }
.mkt-dot-2 { width: 11px; height: 11px; background: var(--accent-yellow); left: 19%; bottom: 30%; }
.mkt-dot-3 { width: 20px; height: 20px; background: rgba(234, 88, 12, 0.18); right: 21%; bottom: 32%; }
@keyframes mkt-square-float { 0%, 100% { transform: rotate(18deg) translateY(0); } 50% { transform: rotate(24deg) translateY(-12px); } }
@media (prefers-reduced-motion: no-preference) {
  .mkt-blob-1 { animation: blob-float 10s ease-in-out infinite; }
  .mkt-blob-2 { animation: blob-float 8s ease-in-out infinite reverse; }
  .mkt-ring { animation: blob-float 12s ease-in-out infinite; }
  .mkt-square { animation: mkt-square-float 14s ease-in-out infinite; }
}
.mkt-hero h1 { font-size: clamp(2.6rem, 6.2vw, 4.5rem); line-height: 1.07; width: fit-content; max-width: 100%; margin: 0 auto 1.4rem; }
.mkt-lede { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--gray-500); max-width: 46rem; margin: 0 auto; }
.mkt-lede strong { color: var(--gray-700); }
.mkt-hand-note { margin: 0.2rem auto 0; text-align: center; }
.mkt-hand-note .hand { font-size: 1.45rem; color: var(--accent-600); display: inline-block; transform: rotate(-2deg); }
.mkt-underline { position: relative; white-space: nowrap; }
.mkt-underline svg { position: absolute; left: -2%; width: 104%; height: 0.3em; bottom: -0.16em; overflow: visible; }
.mkt-underline path {
  fill: none; stroke: var(--accent-500); stroke-width: 7; stroke-linecap: round;
  stroke-dasharray: 230; stroke-dashoffset: 230;
  animation: mkt-draw 0.9s ease-out 0.5s forwards;
}
@keyframes mkt-draw { to { stroke-dashoffset: 0; } }

/* sections */
.mkt-section { max-width: 72rem; margin: 0 auto; padding: 4.5rem 1.25rem; text-align: center; }
.mkt-h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); line-height: 1.12; margin: 0.9rem auto 2.2rem; max-width: 26ch; }
.mkt-h2 em { color: var(--accent-600); }

/* success-tax calculator */
.mkt-calc-section { padding-top: 2.5rem; }
.mkt-calc {
  position: relative; overflow: hidden;
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--r-3xl);
  box-shadow: var(--shadow-xl); max-width: 56rem; margin: 0 auto; text-align: left;
  padding: 2.2rem clamp(1.1rem, 3vw, 2.6rem) 1.6rem;
}
.mkt-calc::before {
  content: ""; position: absolute; right: -60px; top: -60px; width: 190px; height: 190px;
  border-radius: 50%; pointer-events: none; z-index: 0;
  background: radial-gradient(circle at 35% 35%, rgba(250, 204, 21, 0.16), transparent 70%);
}
.mkt-calc > * { position: relative; z-index: 1; }
.mkt-calc-label { display: block; text-align: center; font-size: 1.05rem; color: var(--gray-600); margin-bottom: 0.9rem; }
.mkt-calc-label output { font-family: var(--font-serif); font-size: 1.9rem; color: var(--gray-900); padding: 0 0.15rem; }
.mkt-calc input[type="range"] { width: 100%; height: 2rem; accent-color: var(--accent-600); cursor: pointer; }
.mkt-chart { width: 100%; height: auto; display: block; margin: 1rem 0 0.4rem; }
.mkt-chart .axis { stroke: var(--gray-200); stroke-width: 1; }
.mkt-curve-them { fill: none; stroke: var(--gray-800); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.mkt-curve-dash { fill: none; stroke: var(--gray-400); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 7 8; }
.mkt-curve-us { fill: none; stroke: var(--accent-500); stroke-width: 4; stroke-linecap: round; }
.mkt-chart text { font: 600 13px var(--font-sans); fill: var(--gray-500); }
.mkt-chart .label-us { fill: var(--accent-600); }
.mkt-chart .label-dash { fill: var(--gray-400); font-style: italic; }
.mkt-dot-them { fill: var(--gray-900); }
.mkt-dot-us { fill: var(--accent-600); }
.mkt-calc-readouts { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-top: 0.6rem; }
.mkt-readout {
  flex: 1 1 14rem; max-width: 18rem; border: 1px solid var(--gray-200);
  border-radius: var(--r-xl); padding: 0.8rem 1.1rem;
  display: flex; flex-direction: column; gap: 0.1rem;
}
.mkt-readout-us { border-color: var(--accent-200); background: var(--accent-50); }
.mkt-readout-label { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--gray-500); }
.mkt-readout-num { font-family: var(--font-serif); font-size: 1.6rem; color: var(--gray-900); }
.mkt-readout-us .mkt-readout-num { color: var(--accent-700); }
.mkt-readout-sub { font-size: 0.75rem; color: var(--gray-400); }
.mkt-readout-us .mkt-readout-sub { color: var(--accent-600); }
.mkt-taxline { text-align: center; font-size: 1.15rem; color: var(--gray-600); margin: 1.2rem 0 0.4rem; }
.mkt-taxline strong { font-family: var(--font-serif); font-weight: 400; font-size: 1.55rem; color: var(--red-ink); }
.mkt-calc-note { text-align: center; color: var(--gray-600); font-size: 0.95rem; max-width: 42rem; margin: 0.8rem auto 0; }
.mkt-calc-note + .mkt-calc-note { margin-top: 0.45rem; }
.mkt-calc-foot { text-align: center; color: var(--gray-400); font-size: 0.78rem; max-width: 40rem; margin: 0.6rem auto 0; }

/* the whole offer (pricing receipts + agent install prompt) */
.mkt-offer-lede { max-width: 46rem; margin: 0 auto 2rem; color: var(--gray-600); font-size: 1.1rem; }
.mkt-offer-lede strong { color: var(--gray-900); }
.mkt-prompt {
  max-width: 46rem; margin: 0 auto; text-align: left;
  background: var(--gray-900); border-radius: var(--r-2xl);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.mkt-prompt-bar {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.65rem 1rem; background: rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.mkt-prompt-dots { display: inline-flex; gap: 0.35rem; }
.mkt-prompt-dots i { width: 0.65rem; height: 0.65rem; border-radius: 50%; background: rgba(255, 255, 255, 0.22); }
.mkt-prompt-dots i:first-child { background: rgba(251, 146, 60, 0.75); }
.mkt-prompt-title { flex: 1; font-size: 0.8rem; letter-spacing: 0.04em; color: rgba(255, 255, 255, 0.55); }
.mkt-prompt .copy-btn { background: transparent; border-color: rgba(255, 255, 255, 0.25); color: rgba(255, 255, 255, 0.75); }
.mkt-prompt .copy-btn:hover { border-color: var(--accent-300); color: var(--accent-300); }
.mkt-prompt .copy-btn.copied { border-color: #4ade80; color: #4ade80; }
.mkt-prompt-body {
  margin: 0; padding: 1.3rem 1.4rem 1.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95rem; line-height: 1.6; color: #fef3e2;
  white-space: pre-wrap; overflow-x: auto;
}
.mkt-prompt-caret { color: var(--accent-500); font-weight: 700; margin-right: 0.35rem; }
/* twin install/operate terminals — subgrid keeps both cards + captions row-aligned */
.mkt-twin {
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto;
  gap: 1rem 1.4rem; max-width: 60rem; margin: 0 auto;
}
.mkt-twin-col { display: grid; grid-template-rows: subgrid; grid-row: span 2; gap: 1rem; }
.mkt-twin .mkt-prompt { max-width: none; margin: 0; }
.mkt-twin-cap { margin: 0; color: var(--gray-500); font-size: 0.95rem; text-align: left; }
.mkt-twin-cap code { font-size: 0.85em; }
.mkt-twin-cap strong { color: var(--gray-700); }

/* how it works */
.mkt-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; text-align: left; }
.mkt-step {
  position: relative; overflow: hidden;
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--r-2xl);
  box-shadow: var(--shadow-sm); padding: 2rem 1.8rem;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.mkt-step:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.mkt-step::after {
  content: ""; position: absolute; right: -36px; top: -36px; width: 104px; height: 104px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 32% 32%, rgba(250, 204, 21, 0.26), transparent 70%);
}
.mkt-step-num {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; justify-content: center;
  width: 3.1rem; height: 3.1rem; margin-bottom: 1rem;
  border-radius: 1rem; background: var(--gradient-accent); color: #fff;
  font-family: var(--font-serif); font-size: 1.55rem; line-height: 1;
  box-shadow: 0 6px 16px rgba(234, 88, 12, 0.28);
}
.mkt-step h3 { font-size: 1.35rem; margin-bottom: 0.4rem; }
.mkt-step p { margin: 0; color: var(--gray-500); }

/* two programs */
.mkt-programs { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; max-width: 56rem; margin: 0 auto; text-align: left; }
.mkt-program {
  position: relative; overflow: hidden;
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--r-2xl);
  box-shadow: var(--shadow-sm); padding: 1.8rem;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.mkt-program:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.mkt-program::before {
  content: ""; position: absolute; right: -44px; bottom: -44px; width: 136px; height: 136px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 40% 40%, rgba(251, 146, 60, 0.14), transparent 70%);
}
.mkt-program > * { position: relative; z-index: 1; }
.mkt-program h3 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.mkt-program p { margin: 0; color: var(--gray-500); }
.mkt-program .hand { font-size: 1.3rem; color: var(--accent-600); }
.mkt-spine-note { max-width: 44rem; margin: 1.6rem auto 0; color: var(--gray-500); }
.mkt-spine-note a { color: var(--accent-600); }

/* clickable per-platform recipe chips in the integrations section */
.mkt-recipe-links { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin: 1.4rem auto; padding: 0; max-width: 44rem; }
.mkt-recipe-links a {
  display: inline-block; padding: .4rem .85rem; border: 1px solid var(--gray-200);
  border-radius: 999px; background: #fff; color: var(--gray-700); text-decoration: none;
  font-size: .9rem; font-weight: 500; transition: border-color .15s ease, color .15s ease;
}
.mkt-recipe-links a:hover { border-color: var(--accent-400); color: var(--accent-600); }

/* everything-included feature grid */
.mkt-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; text-align: left; }
.mkt-feature {
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--r-2xl);
  box-shadow: var(--shadow-sm); padding: 1.5rem 1.4rem;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.mkt-feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.mkt-feature-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.7rem; height: 2.7rem; margin-bottom: 0.85rem;
  border-radius: 0.9rem; background: var(--accent-50); color: var(--accent-600);
  border: 1px solid var(--accent-100);
}
.mkt-feature-icon svg { width: 1.4rem; height: 1.4rem; }
.mkt-feature h3 { font-size: 1.1rem; margin-bottom: 0.35rem; }
.mkt-feature p { margin: 0; color: var(--gray-500); font-size: 0.92rem; }
.mkt-feature code { font-size: 0.85em; }
@media (max-width: 1020px) { .mkt-features { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .mkt-features { grid-template-columns: 1fr; } }

/* engineering receipts */
.mkt-receipts {
  list-style: none; padding: 0; max-width: 46rem; margin: 0 auto;
  display: flex; flex-direction: column; gap: 1rem; text-align: left;
}
.mkt-receipts li {
  display: flex; gap: 0.8rem; align-items: flex-start;
  background: #fff; border: 1px solid var(--gray-100); border-radius: var(--r-xl);
  padding: 1rem 1.2rem; box-shadow: var(--shadow-sm);
}
.mkt-receipts li > svg { width: 1.4rem; height: 1.4rem; color: var(--green-ink); flex: none; margin-top: 0.1rem; }
.mkt-receipts strong { color: var(--gray-900); }

/* pricing extras (grid/tiers reuse existing classes) */
.mkt-pricing-hand { margin: -1.2rem 0 0; }
.mkt-pricing-hand .hand { font-size: 1.5rem; color: var(--accent-600); }
.mkt-pricing-note { color: var(--gray-400); font-size: 0.85rem; max-width: 40rem; margin: 0.4rem auto 0; }

/* faq */
.mkt-faq { max-width: 44rem; margin: 0 auto; display: flex; flex-direction: column; gap: 0.7rem; text-align: left; }
.mkt-faq details { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--r-lg); padding: 0.95rem 1.2rem; }
.mkt-faq summary {
  cursor: pointer; font-weight: 600; color: var(--gray-800); list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.mkt-faq summary::-webkit-details-marker { display: none; }
.mkt-faq summary::after { content: "+"; font-size: 1.35rem; color: var(--accent-500); flex: none; }
.mkt-faq details[open] summary::after { content: "–"; }
.mkt-faq details p { margin: 0.7rem 0 0; color: var(--gray-500); }

/* closer */
.mkt-closer {
  position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(180deg, #fffdf8, var(--accent-50));
  border-top: 1px solid var(--accent-100);
  padding: 6rem 1.25rem 2rem; text-align: center;
}
.mkt-closer > * { position: relative; z-index: 1; }
.mkt-closer::before {
  content: ""; position: absolute; z-index: 0; left: 9%; top: 20%; width: 120px; height: 120px;
  border-radius: 50%; border: 2px dashed rgba(234, 88, 12, 0.24); pointer-events: none;
}
.mkt-closer::after {
  content: ""; position: absolute; z-index: 0; right: -70px; bottom: -70px; width: 280px; height: 280px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 40% 40%, rgba(251, 146, 60, 0.2), transparent 68%);
}
.mkt-closer h2 { font-size: clamp(2.4rem, 5vw, 3.8rem); margin-bottom: 0.8rem; }
.mkt-closer p { color: var(--gray-500); font-size: 1.15rem; margin: 0 0 1.8rem; }

/* scroll reveals */
.mkt-reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.mkt-reveal.is-visible { opacity: 1; transform: none; }
.mkt-steps .mkt-reveal:nth-child(2), .mkt-programs .mkt-reveal:nth-child(2),
.mkt-twin .mkt-reveal:nth-child(2),
.pricing-grid .mkt-reveal:nth-child(2) { transition-delay: 0.1s; }
.mkt-steps .mkt-reveal:nth-child(3), .pricing-grid .mkt-reveal:nth-child(3) { transition-delay: 0.2s; }
.pricing-grid .mkt-reveal:nth-child(4) { transition-delay: 0.3s; }

/* responsive + reduced motion */
@media (max-width: 860px) {
  .mkt-links { display: none; }
  /* 4.5rem top+bottom stacks to a ~144px void between sections on a phone —
     halve it so consecutive sections (e.g. the offer prompts → "Live in one
     prompt") don't read as a dead gap. */
  .mkt-section { padding-top: 2.75rem; padding-bottom: 2.75rem; }
  .mkt-steps, .mkt-programs, .mkt-twin { grid-template-columns: 1fr; }
  .mkt-twin-col { display: flex; flex-direction: column; grid-row: auto; }
  .mkt-hero { padding-top: calc(var(--nav-h) + 1.5rem); }
  .mkt-ring, .mkt-square, .mkt-dot-1, .mkt-dot-3, .mkt-blob-1 { display: none; }
  /* On narrow screens let the headline wrap instead of overflowing. */
  .mkt-nowrap { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  .mkt-reveal { opacity: 1; transform: none; transition: none; }
  .mkt-underline path { stroke-dashoffset: 0; animation: none; }
}

/* ============================================================================
   Mascot — the animated Qanary canary (shared/_mascot.html.erb).
   CSS owns only [data-part=rig]: the cheapest ambient layer, an idle bob.
   GSAP acts, the sway ticker, and gaze/blink own other, disjoint parts.
   ========================================================================= */
.qanary-mascot { display: inline-block; width: var(--mascot-size, 10rem); height: var(--mascot-size, 10rem); line-height: 0; }
.qanary-mascot svg { width: 100%; height: 100%; overflow: visible; }
.qanary-mascot [data-part="rig"] {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: mascot-bob 3.4s ease-in-out infinite;
}
@keyframes mascot-bob {
  50% { transform: scale(1.012, 0.985) translateY(0.4px); }
}
.qanary-mascot [data-part="eyes"] { transform-box: fill-box; transform-origin: 50% 55%; }
.qanary-mascot [data-part="pupils"] { transition: transform 130ms ease-out; }
.mkt-hero .qanary-mascot { display: block; margin: 0 auto 0.6rem; }
.sidebar-mascot { margin-top: auto; padding-top: 1rem; text-align: center; }
@media (prefers-reduced-motion: reduce) {
  .qanary-mascot [data-part="rig"] { animation: none; }
  .qanary-mascot [data-part="pupils"] { transition: none; }
}

/* ============================================================================
   Portal type scale — bumps CONTENT text ~15% inside the account app only:
   body copy, table/form text, input labels & hints, subtitles under headlines.
   Sidebar nav, brand, topbar, and the big stat numbers are intentionally left
   at their original sizes (they read fine already). Scoped to `.app-shell` so
   the marketing site, customer portal, and auth pages are untouched. Component
   sizes use root `rem`, which a parent font-size can't rescale, so each is
   re-declared here; appended last so it wins the cascade.
   ========================================================================= */
.app-shell { font-size: 1.2rem; }              /* base copy: ~17px → ~19px */

/* tables */
.app-shell table { font-size: 1rem; }           /* 14 → 16px */
.app-shell th { font-size: 0.8125rem; }         /* 12 → 13px */

/* forms */
.app-shell label { font-size: 1rem; }           /* 14 → 16px */
/* captions/titles that aren't <label> but should read at the same size */
.app-shell .field-caption,
.app-shell .check-card__title { font-size: 1rem; }  /* 14 → 16px, match Name */
.app-shell .field-hint { font-size: 1rem; }     /* 13 → 16px (input descriptions) */
.app-shell .custom-select__trigger,
.app-shell .custom-select__option-name { font-size: 1rem; }        /* 14 → 16px */
.app-shell .custom-select__option-desc { font-size: 0.9375rem; }  /* 13 → 15px */
.app-shell input,
.app-shell select,
.app-shell textarea { font-size: 1rem; }         /* 14 → 16px */

/* buttons & inline links */
.app-shell .btn { font-size: 1rem; }             /* 14 → 16px */
.app-shell .btn-sm { font-size: 0.9375rem; }     /* 13 → 15px */
.app-shell .btn-lg { font-size: 1.0625rem; }     /* 15 → 17px */
.app-shell .linklike { font-size: 1rem; }        /* 14 → 16px */
.app-shell .badge { font-size: 0.85rem; }        /* 12 → 13.6px */

/* flash / alert banners (e.g. verify-email notice) */
.app-shell .flash { font-size: 1rem; }           /* 14 → 16px */

/* text under headlines (page subtitles + hero sub) */
.app-shell .page-header .page-sub { font-size: 1rem; }   /* 14 → 16px */
.app-shell .dash-hero-sub { font-size: 1.125rem; }       /* 18.4 → 18px */
.app-shell .dash-hero-eyebrow { font-size: 0.82rem; }    /* 12 → 13.1px */

/* stat caption text (not the big numbers) */
.app-shell .stat-label { font-size: 0.9rem; }    /* 12.8 → 14.4px */

/* filters, checklist, empty states */
.app-shell .filter-row a { font-size: 0.9375rem; }/* 13 → 15px */
.app-shell .step-body { font-size: 1rem; }        /* 14 → 16px */
.app-shell .step-dot { font-size: 0.9375rem; }    /* 13 → 15px */
.app-shell .empty-state h3 { font-size: 1.15rem; }/* 16 → 18.4px */
.app-shell .empty-state p { font-size: 1rem; }    /* 14 → 16px */

/* provenance journeys, copy rows, code */
.app-shell .journey-when,
.app-shell .journey-url { font-size: 0.875rem; }  /* 13 → 14px */
.app-shell .copy-row code { font-size: 0.9375rem; }/* 13 → 15px */
.app-shell .copy-btn { font-size: 0.85rem; }       /* 12 → 13.6px */
.app-shell pre { font-size: 0.9375rem; }           /* 13 → 15px */

/* ---- Connections hub ---- */
.conn-section { margin-bottom: 2rem; }
.conn-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.conn-head h2 { display: flex; align-items: center; gap: 0.5rem; margin: 0; }
.dir-chip { font-size: 0.7rem; font-weight: 600; padding: 0.1rem 0.55rem; border-radius: 9999px; background: var(--gray-100); color: var(--gray-600); }
.dir-chip.in { background: var(--accent-50); color: var(--accent-700); }
.dir-chip.out { background: var(--gray-100); color: var(--gray-600); }
.conn-explainer { color: var(--gray-600); font-size: 0.875rem; margin: 0.4rem 0 1rem; max-width: 62ch; }
.conn-list { padding: 0; }
.conn-row { padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--gray-100); }
.conn-row:last-child { border-bottom: 0; }
.conn-row-top { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.conn-row-head { display: flex; align-items: center; gap: 0.5rem; }
.conn-name { font-weight: 600; font-size: 1rem; display: inline-flex; align-items: center; gap: 0.4rem; }
.conn-row-actions { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }

/* Facts get room to breathe: a labelled grid under the header line rather than a
   cramped one-liner. auto-fit lets fields flow to as many columns as fit. */
.conn-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.85rem 2rem; margin: 0.95rem 0 0; }
.conn-meta > div { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.conn-meta-wide { grid-column: span 2; }
.conn-meta dt { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--gray-400); }
.conn-meta dd { margin: 0; font-size: 0.9rem; color: var(--gray-700); }
.conn-meta dd code { font-size: 0.85rem; }
.conn-help { margin-top: 0.75rem; }
.conn-help summary { cursor: pointer; font-weight: 600; }
.conn-foot { margin-top: 0.75rem; font-size: 0.8rem; color: var(--gray-500); }

/* Account id / webhook URL are meta values, so strip copy-row's box and shrink
   its button to an icon — the heavy Developers-page pill would tower over the
   field label and value. */
.conn-meta .copy-row { background: transparent; border: 0; border-radius: 0; padding: 0; margin: 0; gap: 0.25rem; }
.conn-meta .copy-row code { font-size: 0.85rem; color: var(--gray-700); }
/* the account id is short and worth showing whole — don't let the grid cell ellipsise it */
.conn-meta-acct .copy-row, .conn-meta-acct .copy-row code { overflow: visible; text-overflow: clip; }
.conn-meta .copy-btn { border: 0; background: transparent; padding: 0.1rem; color: var(--gray-400); }
.conn-meta .copy-btn span { display: none; }
.conn-meta .copy-btn:hover { color: var(--accent-600); }
.conn-meta .copy-btn.copied { color: var(--green-ink); }

/* the section title and its explainer live inside the panel, like the dashboard's
   "Programs" card — rows then bleed to the panel's edges */
.conn-panel { padding: 0; overflow: hidden; }
.conn-panel .conn-head { align-items: flex-start; padding: 1.2rem 1.5rem 1rem; }
.conn-panel .conn-explainer { margin: 0.3rem 0 0; }
.conn-panel .conn-row { padding: 1rem 1.5rem; border-bottom: 0; border-top: 1px solid var(--gray-100); }
.conn-panel .empty-state { padding: 0.5rem 1.5rem 2rem; }
.conn-form { padding: 0.25rem 1.5rem 1.5rem; }
.conn-form h3 { font-size: 1rem; font-family: var(--font-sans); font-weight: 600; }

/* ---- billing provider chooser (/dashboard/billing_connections/new) ----
   Grouped by connect method (one-click OAuth vs paste-a-key) so the layout
   itself tells you what you're choosing between. Reuses the .conn-panel
   anatomy from /dashboard/connections so the two billing pages read as one. */
.bconn-panel { margin: 1.5rem 0; }
.bconn-head h2 { display: flex; align-items: center; gap: 0.55rem; }
.prov-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.2rem 1.5rem;
  border-top: 1px solid var(--gray-100);
}
.prov-badge {
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-lg);
  border: 1px solid var(--gray-200);
  background: var(--gray-50);
}
.prov-badge .mkt-plat-logo { width: 1.5rem; height: 1.5rem; }
/* a soft brand tint — the mono logo carries the colour, the tile just frames it */
.prov-stripe { background: #f1f0ff; border-color: #dcd9fb; }
.prov-lemon_squeezy { background: #fff8e1; border-color: #fce9a6; }
.prov-polar, .prov-paddle { background: var(--gray-50); border-color: var(--gray-200); }
.prov-main { flex: 1 1 auto; min-width: 0; }
.prov-name { font-family: var(--font-sans); font-weight: 600; font-size: 1rem; color: var(--gray-900); }
.prov-desc { margin: 0.2rem 0 0; color: var(--gray-600); font-size: 0.875rem; max-width: 56ch; }
/* OAuth rows: the connect button sits at the right, centred against the logo tile */
.prov-actions { flex: none; margin-left: auto; align-self: center; display: flex; align-items: center; gap: 0.9rem; }
.prov-opt { margin: 0; white-space: nowrap; }
/* A teased-but-not-yet-live provider: the row is dimmed and its connect control
   is swapped for a "Coming soon" pill (see billing_connections/new). */
.prov-row-soon { opacity: 0.62; }
.prov-row-soon .prov-badge { filter: grayscale(1); }
/* key rows: the form lives under the description, inside .prov-main */
.prov-form { margin-top: 0.85rem; }
.prov-form > label { margin: 0; }
.prov-form .field-hint { margin: 0.45rem 0 0; }
.prov-form .field-hint code { white-space: normal; overflow-wrap: anywhere; }
.prov-keyrow { display: flex; align-items: center; gap: 0.75rem 1rem; margin-top: 0.85rem; flex-wrap: wrap; }
.prov-keyrow label.inline { margin: 0; }
.prov-keyhint { margin: 0; }
.prov-keyrow .btn { margin-left: auto; }
.bconn-manual { margin-top: 1.5rem; }
.bconn-manual[open] { padding-bottom: 1.75rem; }
@media (max-width: 560px) {
  .prov-row { flex-wrap: wrap; }
  .prov-actions { margin-left: 0; width: 100%; }
  .prov-actions .btn { flex: 1; }
  .prov-keyrow .btn { margin-left: 0; width: 100%; }
  .prov-keyhint { order: 3; flex-basis: 100%; }
}

/* ---- drawer: a right-side panel over a scrim (the app's first modal) ----
   IMPORTANT: the controller element must carry BOTH class="drawer" and
   data-controller="drawer". The CSS selectors target .drawer.is-open, and if
   a consumer's markup omits class="drawer", nothing will open visually. ---- */
.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgb(17 24 39 / 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease-in-out;
}
.drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 61;
  width: min(30rem, 100vw);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-left: 1px solid var(--gray-200);
  box-shadow: -24px 0 60px -30px rgb(0 0 0 / 0.3);
  transform: translateX(100%);
  transition: transform 0.25s ease-in-out;
  overflow-y: auto;
}
.drawer.is-open .drawer-scrim { opacity: 1; pointer-events: auto; }
.drawer.is-open .drawer-panel { transform: translateX(0); }
@media (prefers-reduced-motion: reduce) {
  .drawer-scrim, .drawer-panel { transition: none; }
}
.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem 1.5rem 1rem;
  border-bottom: 1px solid var(--gray-100);
}
.drawer-head h2 { margin: 0; font-size: 1.2rem; }
.drawer-head .section-sub { margin: 0.25rem 0 0; }
.drawer-close {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--gray-200);
  border-radius: 9999px;
  background: #fff;
  color: var(--gray-500);
  cursor: pointer;
  transition: color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}
.drawer-close:hover { color: var(--accent-600); border-color: var(--accent-300); }
.drawer-close svg { width: 1rem; height: 1rem; }
.drawer-body { padding: 1.4rem 1.5rem; flex: 1; }
.drawer-foot {
  padding: 1rem 1.5rem 1.4rem;
  border-top: 1px solid var(--gray-100);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* ---- dropzone ---- */
.dropzone {
  display: grid;
  place-items: center;
  gap: 0.5rem;
  padding: 2.25rem 1.25rem;
  text-align: center;
  border: 1.5px dashed var(--gray-300);
  border-radius: var(--r-xl);
  background: var(--gray-50);
  cursor: pointer;
  transition: border-color 0.2s ease-in-out, background-color 0.2s ease-in-out;
}
.dropzone:hover { border-color: var(--accent-300); background: var(--accent-50); }
.dropzone.is-dragging { border-color: var(--accent-500); background: var(--accent-50); }
.dropzone.has-error { border-color: var(--red-ink); }
.dropzone-icon {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  background: var(--accent-50);
  color: var(--accent-600);
}
.dropzone-icon svg { width: 1.35rem; height: 1.35rem; }
.dropzone-lead { font-weight: 600; color: var(--gray-900); font-size: 0.9375rem; }
.dropzone-lead b { color: var(--accent-600); }
.dropzone-meta { font-size: 0.78rem; color: var(--gray-500); }
.dropzone-input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }

.dropzone-preview {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--r-xl);
  background: #fff;
}
/* The class rule above out-specifies the UA [hidden] default, so the "0%"
   preview chip paints before a file is picked. Restore hidden with a matching
   specificity that beats the display:flex. */
.dropzone-preview[hidden] { display: none; }
.dropzone-thumb { width: 2.75rem; height: 2.75rem; border-radius: var(--r-lg); object-fit: cover; flex: none; background: var(--gray-100); }
.dropzone-file { flex: 1; min-width: 0; }
.dropzone-file b { display: block; font-size: 0.875rem; color: var(--gray-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropzone-file small { font-size: 0.78rem; color: var(--gray-500); }
.dropzone-track { margin-top: 0.4rem; height: 6px; border-radius: 9999px; background: var(--gray-100); overflow: hidden; }
.dropzone-track i { display: block; height: 100%; background: var(--gradient-accent); border-radius: 9999px; transition: width 0.15s linear; }
.dropzone-pct { font-size: 0.72rem; font-weight: 600; color: var(--gray-500); flex: none; }
.dropzone-error { margin: 0.5rem 0 0; font-size: 0.8rem; color: var(--red-ink); }
/* The prompt's icon and text are decorative: a pointer crossing them fires
   dragleave on the zone and flickers the highlight, so they ignore the pointer. */
.dropzone-icon, .dropzone-lead, .dropzone-meta { pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
  .dropzone, .dropzone-track i { transition: none; }
}

/* ---- asset rows ---- */
.asset-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}
.asset-head h2 { margin: 0; font-size: 1.2rem; }
.asset-head .section-sub { margin: 0.25rem 0 0; }
.asset-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--gray-200);
  border-radius: var(--r-xl);
  overflow: hidden;
}
.asset-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 0.9rem 1.1rem;
  text-align: left;
  background: #fff;
  border: 0;
  border-top: 1px solid var(--gray-100);
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
}
.asset-row:first-child { border-top: 0; }
.asset-row:hover, .asset-row:focus-visible { background: var(--accent-50); outline: none; }
.asset-tile {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: var(--r-lg);
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  background: var(--accent-50);
  border: 1px solid rgba(234, 88, 12, 0.14);
  color: var(--accent-600);
  transition: background-color 0.2s ease-in-out;
}
.asset-row:hover .asset-tile { background: #fff; }
.asset-tile svg { width: 1.15rem; height: 1.15rem; }
.asset-tile-img { width: 100%; height: 100%; object-fit: cover; }
.asset-txt { min-width: 0; }
.asset-txt b { display: block; color: var(--gray-900); font-weight: 700; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-txt small { color: var(--gray-500); font-size: 0.8rem; }
.asset-go {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  flex: none;
  border-radius: 9999px;
  border: 1px solid var(--gray-200);
  background: #fff;
  color: var(--gray-500);
  transition: color 0.2s ease-in-out, border-color 0.2s ease-in-out, transform 0.2s ease-in-out;
}
.asset-go svg { width: 0.85rem; height: 0.85rem; }
.asset-row:hover .asset-go { color: var(--accent-600); border-color: var(--accent-300); transform: translateX(2px); }
@media (prefers-reduced-motion: reduce) {
  .asset-row:hover .asset-go { transform: none; }
}

/* ---- asset inspect pane ---- */
.asset-inspect-media { display: grid; place-items: center; padding: 1.5rem; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--r-xl); margin-bottom: 1.25rem; }
.asset-inspect-media img { max-width: 100%; max-height: 14rem; border-radius: var(--r-lg); }
.asset-inspect-glyph { display: inline-grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: 9999px; background: var(--accent-50); color: var(--accent-600); }
.asset-inspect-glyph svg { width: 1.5rem; height: 1.5rem; }
.asset-inspect-facts { display: grid; grid-template-columns: 6rem 1fr; gap: 0.5rem 1rem; margin: 0 0 1.25rem; font-size: 0.875rem; }
.asset-inspect-facts dt { color: var(--gray-500); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; align-self: center; }
.asset-inspect-facts dd { margin: 0; color: var(--gray-900); }
.asset-inspect-body { white-space: pre-wrap; word-break: break-word; font-size: 0.82rem; max-height: 12rem; overflow-y: auto; }
.asset-inspect-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ---- celebration: a centered modal for billing plan changes ---- */
.celebration { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; }
.celebration:not(.is-open) { pointer-events: none; }
.celebration-scrim {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgb(17 24 39 / 0.45);
  opacity: 0;
  transition: opacity 0.25s ease-in-out;
}
.celebration.is-open .celebration-scrim { opacity: 1; }
.celebration-particles { position: fixed; inset: 0; z-index: 82; pointer-events: none; overflow: hidden; }
.celebration-confetto {
  position: fixed;
  top: 0;
  left: 0;
  width: 0.7rem;
  height: 0.9rem;
  border-radius: 2px;
  will-change: transform, opacity;
}
.celebration-card {
  position: relative;
  z-index: 83;
  width: min(30rem, calc(100vw - 2.5rem));
  padding: 2rem 2rem 1.75rem;
  text-align: center;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-2xl);
  opacity: 0;
  transform: translateY(10px) scale(0.97);
  transition: opacity 0.28s ease-out, transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.celebration.is-open .celebration-card { opacity: 1; transform: none; }
.celebration-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 2rem;
  height: 2rem;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--gray-200);
  border-radius: 9999px;
  background: #fff;
  color: var(--gray-500);
  cursor: pointer;
  transition: color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}
.celebration-close:hover { color: var(--accent-600); border-color: var(--accent-300); }
.celebration-close svg { width: 1rem; height: 1rem; }
.celebration-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-500);
}
.celebration-eyebrow--ok { color: var(--green-ink); }
.celebration-eyebrow svg { width: 1rem; height: 1rem; }
.celebration-title { margin: 0.6rem 0 0.4rem; font-size: 1.9rem; line-height: 1.1; }
.celebration-lead { margin: 0 0 1.25rem; color: var(--gray-600); }
.celebration-unlocked {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: grid;
  gap: 0.6rem;
  text-align: left;
}
.celebration-unlocked li { display: flex; align-items: flex-start; gap: 0.6rem; color: var(--gray-800); }
.celebration-unlocked svg { width: 1.1rem; height: 1.1rem; flex: none; margin-top: 0.15rem; color: var(--green-ink); }
.celebration-cta { width: 100%; justify-content: center; }
@media (prefers-reduced-motion: reduce) {
  .celebration-scrim, .celebration-card { transition: none; }
  .celebration.is-open .celebration-card { opacity: 1; transform: none; }
}

/* ============================================================
   Platform admin console (layouts/admin.html.erb). Reuses the
   merchant shell wholesale; only the static sidebar footer and a
   couple of layout helpers below are admin-specific. No new colors.
   ============================================================ */
.admin-whoami { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.6rem 0.75rem; }
.admin-foot-links { display: flex; flex-direction: column; gap: 0.15rem; }

/* Responsive multi-column split for overview/detail pages. */
.admin-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1.25rem; align-items: start; }
.admin-grid-2 > * { margin: 0; }

/* Compact key/value list for record detail. */
.admin-dl { display: grid; grid-template-columns: minmax(9rem, auto) 1fr; gap: 0.4rem 1.25rem; margin: 0; align-items: baseline; }
.admin-dl dt { color: var(--gray-500); font-size: 0.85rem; }
.admin-dl dd { margin: 0; color: var(--gray-900); overflow-wrap: anywhere; }

/* Money figure emphasized in a stat/summary context. */
.admin-money-list { display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; margin: 0.25rem 0 0; }
.admin-money-list b { font-family: var(--font-serif); font-size: 1.15rem; color: var(--gray-900); }
