/* ==========================================================================
   skin.css — marketing-site reskin for the dashboard shell (ADDITIVE ONLY)

   Source of truth: ~/grand-slam-page (index.html / styles.css / script.js) —
   near-black #0a0a0d dark theme, faint 1px graph-grid backdrop, indigo
   accent, Inter UI font, Instrument Serif italic accent headings, pill
   badges, that button style, persistent light/dark toggle.

   How this works: every skinned page already loads /theme.css, which
   defines a --w-* custom-property token system consumed throughout the
   dashboard markup (buttons, pills, cards, nav, status chips, forms) and
   already flips between a light default and a `body.dark` / `html.dark`
   dark variant via a shared localStorage key ("dashboard-dark"). This file
   does NOT introduce a second token system or touch any markup/class names
   — it overrides the *values* of the existing --w-* tokens so the whole
   dashboard reads as the same product as the marketing site, then layers a
   few purely-cosmetic additions (graph-grid backdrop, font swap, pill/CTA
   polish, accent-serif page titles, and the pinned theme-toggle button
   skin.js installs next to each page's wordmark/title).

   Link this AFTER /theme.css so these overrides win the cascade. Nothing
   here renames a class or restructures a layout. */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600;700&family=Instrument+Serif:ital@0;1&display=swap');

/* ---------- token overrides: light (default state, no .dark) ---------- */
:root {
  --w-bg: #ffffff;
  --w-surface: #ffffff;
  --w-ink: #0f1222;
  --w-body: #4b5063;
  --w-muted: #8a8fa3;
  --w-accent: #2f4bd8;
  --w-accent-ink: #ffffff;
  --w-accent-soft: rgba(47, 75, 216, 0.08);
  --w-accent-tint: rgba(47, 75, 216, 0.10);
  --w-border: rgba(15, 18, 34, 0.10);
  /* One corner size, 8px (2026-10-23, moved here from ui-v2.css so pages
     draw with it from the first frame). */
  --w-radius: 8px;
  --w-radius-sm: 8px;
  --w-shadow: 0 1px 2px rgba(15, 18, 34, 0.05), 0 12px 32px rgba(15, 18, 34, 0.10);
  --w-font: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --w-font-accent: "Instrument Serif", Georgia, "Times New Roman", serif;

  --w-glow: radial-gradient(46% 40% at 50% 8%, rgba(47, 75, 216, 0.14) 0%, rgba(47, 75, 216, 0.04) 52%, transparent 76%);
  --w-glow-soft: radial-gradient(120% 120% at 50% -40%, rgba(47, 75, 216, 0.08) 0%, transparent 70%);

  --w-pill-neutral-bg: rgba(47, 75, 216, 0.08);
  --w-pill-neutral-ink: #4b5063;
  --w-upsell-grad: linear-gradient(135deg, #2f4bd8, #243cb8);
  --w-sparkline: #2f4bd8;

  --skin-grid-line: rgba(15, 18, 34, 0.06);
}

/* ---------- token overrides: dark (body.dark / html.dark) ---------- */
body.dark, html.dark {
  --w-bg: #0a0a0d;
  --w-surface: #121218;
  --w-ink: #f5f5f7;
  --w-body: #b7b8c4;
  --w-muted: #7a7c8c;
  --w-accent: #7d98ff;
  --w-accent-ink: #0a0a0d;
  --w-accent-soft: rgba(47, 75, 216, 0.16);
  --w-accent-tint: rgba(47, 75, 216, 0.16);
  --w-border: rgba(255, 255, 255, 0.10);
  --w-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 20px 48px rgba(0, 0, 0, 0.45);
  --w-font: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --w-font-accent: "Instrument Serif", Georgia, "Times New Roman", serif;

  --w-glow: radial-gradient(46% 40% at 50% 8%, rgba(47, 75, 216, 0.22) 0%, rgba(47, 75, 216, 0.06) 52%, transparent 76%);
  --w-glow-soft: radial-gradient(120% 120% at 50% -40%, rgba(47, 75, 216, 0.14) 0%, transparent 70%);

  --w-pill-neutral-bg: rgba(255, 255, 255, 0.08);
  --w-pill-neutral-ink: #b7b8c4;
  --w-status-completed-bg: rgba(34, 197, 94, 0.16);
  --w-status-completed-ink: #4ade80;
  --w-status-processing-bg: rgba(242, 184, 75, 0.16);
  --w-status-processing-ink: #f2b84b;
  --w-status-failed-bg: rgba(255, 107, 107, 0.16);
  --w-status-failed-ink: #ff6b6b;
  --w-upsell-grad: linear-gradient(135deg, #2f4bd8, #243cb8);
  --w-sparkline: #7d98ff;

  --skin-grid-line: rgba(255, 255, 255, 0.05);
}

/* ---------- base ---------- */
body {
  font-family: var(--w-font) !important;
  transition: background 0.2s ease, color 0.2s ease;
}
input, textarea, select, button { font-family: var(--w-font); }

/* Dark-mode form controls: theme.css already forces surface/ink backgrounds
   on body.dark inputs — nothing more needed here. */

/* Faint 1px graph-grid backdrop (matches grand-slam .hero-grid), sitting
   behind everything, above the existing glow layer, purely decorative. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--skin-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--skin-grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 0%, #000 0%, transparent 80%);
  mask-image: radial-gradient(70% 60% at 50% 0%, #000 0%, transparent 80%);
}

/* ---------- accent headings (Instrument Serif, upright like showfirst.app's
   headings since 2026-10-23; the italic stays loaded for any page that asks) ---------- */
h1 {
  /* Dashboard cleanup (Hannah, 7 Nov 2026): one clean sans everywhere,
     titles in a medium weight instead of the serif. --w-font-accent stays
     defined for any page that asks for it by name. */
  font-family: var(--w-font);
  font-style: normal;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ---------- buttons: match the marketing site's .btn-primary treatment ---------- */
.w-btn, .btn, .btn-primary, .btn-small {
  border-radius: var(--w-radius-sm) !important;
  font-weight: 600;
}
.w-btn-primary {
  /* Follows the button's own color (Hannah 9/16: "there should not be a
     purple shadow" under RuufPro's orange button). */
  box-shadow: 0 8px 24px -6px color-mix(in srgb, var(--w-accent) 45%, transparent);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.w-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px -6px color-mix(in srgb, var(--w-accent) 55%, transparent);
}
.w-btn-primary:disabled, .w-btn-primary[aria-disabled="true"] {
  transform: none;
  box-shadow: none;
}

/* ---------- pill / badge polish ---------- */
.pill, .toggle-pill, .nav-item .soon, [class*="status-"], [class$="-pill"], .w-step-pill {
  border-radius: 999px;
}

/* ==========================================================================
   Pinned theme toggle (installed by skin.js next to each page's
   wordmark/title, top-left, same spot on every page). Works whether the
   button is a brand-new one we create (create.html, pricing.html) or an
   existing native toggle we've repositioned in place (dashboard.html and
   the rest, which already ship a working dark-mode toggle wired to the
   same localStorage key — we only move + restyle it, never rewrite its
   click logic). ========================================================== */

.skin-toggle-anchor {
  display: flex;
  align-items: center;
  gap: 10px;
}

.skin-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 999px;
  border: 1px solid var(--w-border);
  background: var(--w-surface);
  color: var(--w-muted);
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.skin-theme-toggle:hover {
  color: var(--w-ink);
  border-color: var(--w-accent);
  transform: translateY(-1px);
}
.skin-theme-toggle .skin-icon { width: 18px; height: 18px; }
/* Match grand-slam-page exactly: dark mode shows the sun (click it to go
   light), light mode shows the moon (click it to go dark). */
.skin-theme-toggle .skin-icon-sun { display: none; }
.skin-theme-toggle.is-dark .skin-icon-moon { display: none; }
.skin-theme-toggle.is-dark .skin-icon-sun { display: block; }

/* Existing native toggle buttons (the sidebar-footer "Dark mode" row, or
   lead-gen-new's header-toggle) get pinned to the top instead and
   compacted down to the same circular icon-only look, without touching
   their markup or click handlers. */
.skin-toggle-pinned {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  max-width: 34px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  justify-content: center !important;
  gap: 0 !important;
  border: 1px solid var(--w-border);
  background: var(--w-surface) !important;
  flex: none !important;
}
.skin-toggle-pinned .toggle-pill,
.skin-toggle-pinned > span:not(.ic) {
  display: none !important;
}
.skin-toggle-pinned .ic {
  width: auto !important;
  font-size: 15px;
  line-height: 1;
}

@media (max-width: 640px) {
  .skin-theme-toggle, .skin-toggle-pinned { width: 30px; height: 30px; }
}

/* ---------- page titles + hand-set corners (2026-10-23) ----------
   Moved here from ui-v2.css, which loads only after the session request,
   so titles drew at each page's own size for a moment and then jumped
   (Hannah: "the word appears smaller for a tiny second"). One title size,
   32px, on every main page; the wizards and Site agent keep their compact
   top-bar titles. :root lifts these over each page's own `.page-head h1`. */
:root .page-head h1,
:root .home-head h1,
:root .batch-head h1,
:root .site-head h1,
:root .sf-head h1 { font-size: 28px; line-height: 1.1; letter-spacing: -0.02em; font-weight: 600; }
:root .rt-selbar,
:root .drawer-logo, :root .drawer-logo-fallback,
:root .drawer-action-btn,
:root .drawer-footer-icon,
:root .wr-share-url,
:root .pt-demo-select { border-radius: 8px; }


/* ==========================================================================
   Dashboard cleanup (Hannah, 7 Nov 2026; approved page by page on the
   review artifacts). Shared pieces every page uses:
   - plain white page: no graph-grid backdrop, no top glow
   - .sf-head: title on the left, tabs right under it, chips/buttons right
   - .sf-tabs: the homepage's tab look (pale slate box, soft blue selected)
   - .sf-chip, .sf-tip, .sf-toolbar, .sf-select, .sf-search, .sf-iconbtn
   Rule from her review: never stack two tab bars; a bar that switches
   screens sits under the title, status filters become a .sf-select menu.
   ========================================================================== */
body::after { display: none !important; }
body::before { display: none !important; }

.sf-head { display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; flex-wrap: wrap; margin: 0 0 22px; }
.sf-head h1 { margin: 0; color: var(--w-ink); }
.sf-head h1 + .sf-tabs { margin-top: 14px; }
/* A flex item never shrinks below its content unless min-width is 0, so the
   title block grew to the tab bar's full width (499px on Settings at 375px,
   UI regression page_overflow, 7 Nov). Cap it at the row so the tab bar's own
   max-width + overflow-x scroll takes over. */
.sf-head > * { min-width: 0; max-width: 100%; }
.sf-head-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.sf-tabs { display: inline-flex; gap: 2px; background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 12px; padding: 4px; max-width: 100%; overflow-x: auto; }
.sf-tabs > a, .sf-tabs > button, .sf-tabs > span {
  display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 9px;
  border: 0; background: transparent; color: #6b7280; font: 600 14px/1 var(--w-font);
  white-space: nowrap; cursor: pointer; text-decoration: none; }
.sf-tabs > a:hover, .sf-tabs > button:hover { color: var(--w-ink); }
.sf-tabs > .is-on, .sf-tabs > [aria-selected="true"], .sf-tabs > [aria-current="page"] {
  background: #eef1fd; color: #2f4bd8; box-shadow: 0 0 0 1px #d5dcf9; }
.sf-tabs.sf-tabs-sm > a, .sf-tabs.sf-tabs-sm > button, .sf-tabs.sf-tabs-sm > span {
  height: 30px; padding: 0 11px; font-size: 13px; }

.sf-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--w-border);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; color: var(--w-body);
  white-space: nowrap; font-variant-numeric: tabular-nums; background: var(--w-surface); }
.sf-chip b { color: var(--w-ink); font-weight: 700; }
.sf-chip a { color: var(--w-accent); font-weight: 600; text-decoration: none; margin-left: 2px; }
.sf-chip a:hover { text-decoration: underline; }

.sf-tip { position: relative; display: inline-grid; place-items: center; width: 16px; height: 16px;
  border-radius: 50%; border: 1px solid var(--w-border); color: var(--w-muted); font: 600 10px/1 var(--w-font);
  cursor: help; flex: none; vertical-align: middle; }
.sf-tip .sf-pop { position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
  width: 260px; background: var(--w-ink); color: #fff; font: 400 12px/1.45 var(--w-font); text-align: left;
  border-radius: 8px; padding: 9px 11px; box-shadow: 0 10px 24px -12px rgba(0,0,0,.4); z-index: 30;
  display: none; white-space: normal; letter-spacing: 0; text-transform: none; }
.sf-tip:hover .sf-pop, .sf-tip:focus .sf-pop, .sf-tip:focus-within .sf-pop { display: block; }

.sf-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  flex-wrap: wrap; margin: 0 0 12px; }
.sf-toolbar-left, .sf-toolbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.sf-count { color: var(--w-muted); font-size: 13px; }
.sf-count b { color: var(--w-ink); font-weight: 700; }
.sf-select { appearance: none; -webkit-appearance: none; border: 1px solid var(--w-border); border-radius: 9px;
  padding: 8px 32px 8px 12px; font: 500 13.5px/1.2 var(--w-font); color: var(--w-ink); background:
  var(--w-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a8fa3' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; cursor: pointer; }
.sf-search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--w-border); border-radius: 9px;
  padding: 0 12px; width: 280px; max-width: 100%; background: var(--w-surface); }
.sf-search svg { width: 15px; height: 15px; stroke: var(--w-muted); fill: none; stroke-width: 1.8; flex: none; }
.sf-search input { border: 0; outline: 0; padding: 9px 0; width: 100%; font: 400 13.5px var(--w-font);
  color: var(--w-ink); background: transparent; }
.sf-iconbtn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--w-border);
  border-radius: 9px; color: var(--w-muted); background: var(--w-surface); cursor: pointer; padding: 0; }
.sf-iconbtn:hover { color: var(--w-ink); }
.sf-iconbtn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round; }

/* Help pops in a page header open downward (upward is cut off at the top). */
.sf-head .sf-tip .sf-pop { bottom: auto; top: calc(100% + 8px); }
.sf-head-right .sf-tip .sf-pop { left: auto; right: -8px; transform: none; }
