/* ══════════════════════════════════════════════════════════════════════════
   PPW BIZ PORTAL — DetailPros HQ design system
   ══════════════════════════════════════════════════════════════════════════

   Host: biz.pawsitivelyperfectwebsites.com (static/ppw-portal.html).
   Source of truth: PORTAL_DESIGN_SYSTEM_DETAILPROS.md (captured 2026-10-19
   from app.detailproshq.com). Light canvas, white cards, 1px #e3e6ec lines,
   14px card radius / 10px control radius, ONE accent (#facc15 yellow), Geist
   body + Bricolage Grotesque headings, lucide line icons at 18px.

   ── How this file works ───────────────────────────────────────────────────
   SECTION 1 defines the DetailPros tokens on :root. SECTION 2 re-points every
   legacy custom property the portal and its tab scripts still reference
   (--ppw-ink, --line, --surface-3, --text-muted, --radius …) at those tokens,
   so inline styles in portal-*.js keep resolving without a rename sweep.
   Everything after that restates the shell and the shared components in the
   new system. This stylesheet loads AFTER the page's inline <style>, so it
   wins on equal specificity.

   ── Contract with the scripts ─────────────────────────────────────────────
   Element ids, data-tab attributes, onclick handlers and the class names the
   tab scripts query (nav-link / nav-item / active / collapsed / open / rail /
   is-preview / ws-* / cms-* / hidden …) are unchanged. Restyle only.
   ══════════════════════════════════════════════════════════════════════════ */


/* ═══ SECTION 1 — DetailPros tokens ═══════════════════════════════════════ */

:root {
  /* type */
  --font-body:    "Geist", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-heading: "Bricolage Grotesque", "Geist", system-ui, sans-serif;
  --font-mono:    "Geist Mono", "SF Mono", Menlo, Consolas, monospace;

  /* surfaces */
  --background: #f6f7f9;     /* page canvas */
  --card:       #ffffff;
  --surface-3:  #fafbfc;
  --muted:      #eef0f4;     /* muted SURFACE (not text) */
  --border:     #e3e6ec;
  --border-2:   #eef0f4;
  --input:      #e3e6ec;

  /* ink */
  --foreground:        #0b0d12;
  --muted-foreground:  #697086;
  --muted-2:           #9aa1ad;

  /* secondary + primary */
  --secondary:            #eef0f4;
  --secondary-foreground: #3f4451;
  --primary:              #facc15;
  --primary-foreground:   #1a1606;
  --brand-accent:         #f3b50a;   /* hover yellow + active nav icon */
  --accent:               #fef0c3;   /* pale-yellow pills */
  --accent-foreground:    #9a6207;
  --ring:                 #facc15;

  /* status */
  --destructive:      #dc2626;
  --destructive-weak: #fcecec;
  --success:          #15a34a;
  --success-weak:     #d2f0df;
  --warning:          #bf6c0a;
  --warning-weak:     #fbf1e0;

  /* geometry + elevation */
  --radius:        10px;   /* buttons, inputs, nav items */
  --radius-card:   14px;
  --radius-pill:   999px;
  --shadow:        0 1px 2px #0d121c0a, 0 2px 8px #0d121c0d;
  --shadow-sm:     0 1px 2px #0d121c14;
  --shadow-dialog: 0 24px 60px #0d121c4d;

  /* sidebar */
  --sidebar:            #ffffff;
  --sidebar-border:     #e3e6ec;
  --sidebar-foreground: #3f4451;
  --sidebar-accent:     #eef0f4;

  /* shell metrics */
  --sidebar-w:      240px;
  --sidebar-w-rail: 48px;
  --header-h:       56px;
  --canvas-max:     1200px;
  --canvas-pad:     24px;

  /* motion */
  --ease-out: cubic-bezier(0.16, 0.84, 0.3, 1);
  --dur:      0.3s;
  --dur-fast: 0.16s;

  /* hooks read by static/portal-bugreport.js */
  --hover:       var(--secondary);
  --primary-ink: var(--primary-foreground);
  --text:        var(--foreground);

  color-scheme: light;
}

/* Dark appearance (account menu → Appearance). Same token names, dark values;
   dormant until portal-shell.js sets data-theme='dark'. */
:root[data-theme='dark'] {
  --background: #0f1115; --card: #161920; --surface-3: #1b1f27; --muted: #222731;
  --border: #2a303b; --border-2: #222731; --input: #2a303b;
  --foreground: #f3f4f6; --muted-foreground: #9aa1ad; --muted-2: #6b7280;
  --secondary: #222731; --secondary-foreground: #d1d5db;
  --accent: #3a2f0a; --accent-foreground: #fbd34d;
  --destructive-weak: #3b1414; --success-weak: #0f2d1c; --warning-weak: #3a2a0f;
  --sidebar: #161920; --sidebar-border: #2a303b; --sidebar-foreground: #d1d5db; --sidebar-accent: #222731;
  --shadow: 0 1px 2px #00000040, 0 2px 8px #00000040;
  color-scheme: dark;
}


/* ═══ SECTION 2 — legacy token bridge ══════════════════════════════════════
   Every custom property the page's inline <style> and the tab scripts
   (portal-website.js, portal-breeder.js, portal-forms.js, boards …) still
   reference, re-pointed at a DetailPros token. Add here, never restyle the
   caller. */

:root {
  /* — monolith names (previous shared stylesheet) — */
  --font-sans:      var(--font-body);
  --font-display:   var(--font-heading);
  --font-ui:        var(--font-body);
  --bg-base:        var(--background);
  --sidebar-bg:     var(--sidebar);
  --card-bg:        var(--card);
  --surface-1:      var(--background);
  --surface-2:      var(--card);
  --frost:          var(--card);
  --text-dark:      var(--foreground);
  --text-muted:     var(--muted-foreground);
  --coal:           var(--foreground);
  --mauve:          var(--muted-2);
  --border-color:   var(--border);
  --card-border:    var(--border);
  --line:           var(--border);
  --line-soft:      var(--border-2);
  --wash:           var(--secondary);
  --btn-bg:         var(--primary);
  --btn-fg:         var(--primary-foreground);
  --ok:             var(--success);
  --bad:            var(--destructive);
  --warn:           var(--warning);
  --focus:          var(--ring);

  /* — Ragnarok names (shared scripts) — */
  --bg:             var(--background);
  --surface:        var(--card);
  --surface2:       var(--surface-3);
  --primary-glow:   rgba(250, 204, 21, 0.25);
  --gold:           var(--brand-accent);
  --error:          var(--destructive);

  /* — PPW cream names (the page's own rules + breeder scripts) — */
  --ppw-cream:       var(--background);
  --ppw-paper:       var(--card);
  --ppw-paper-edge:  var(--surface-3);
  --ppw-ink:         var(--foreground);
  --ppw-ink-soft:    var(--secondary-foreground);
  --ppw-mute:        var(--muted-foreground);
  --ppw-muted:       var(--muted-foreground);
  --ppw-line:        var(--border);
  --ppw-line-soft:   var(--border-2);
  --ppw-accent:      var(--primary);
  --ppw-accent-text: var(--primary-foreground);
  --ppw-good:        var(--success);
  --ppw-warn:        var(--warning);
  --ppw-bad:         var(--destructive);
  --ppw-overlay:     var(--secondary);
}


/* ═══ SECTION 3 — base ════════════════════════════════════════════════════ */

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--background) !important;
  color: var(--foreground);
  font-family: var(--font-body);
  font-size: 16px; line-height: 24px;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4 {
  font-family: var(--font-heading); font-weight: 600;
  letter-spacing: -0.02em; color: var(--foreground); margin: 0; line-height: 1.25;
}
h1 { font-size: 21px; }
h2 { font-size: 16px; }
h3 { font-size: 15px; }
h4 { font-size: 14px; }
h1 em, h2 em, h3 em { font-style: normal; }
p { margin: 0; }
a { color: var(--foreground); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-foreground); }
button { font-family: inherit; }
strong, b { font-weight: 600; }
::selection { background: var(--accent); color: var(--foreground); }

.muted { color: var(--muted-foreground); font-size: 13px; line-height: 1.5; }
.eyebrow {
  display: block; font-family: var(--font-body); font-style: normal;
  font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted-foreground); margin: 0 0 6px;
}
.divider { height: 1px; background: var(--border-2); margin: 16px 0; }
.spacer-sm { height: 8px; }
.spacer-md { height: 16px; }
.spacer-lg { height: 24px; }
.hidden { display: none !important; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* lucide glyph helper — stroke icons at 18px everywhere */
.ico, .nav-icon {
  width: 18px; height: 18px; flex: 0 0 auto; display: inline-block;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; vertical-align: middle;
}
.ico--sm { width: 14px; height: 14px; }
.ico--lg { width: 22px; height: 22px; }


/* ═══ SECTION 4 — app shell ═══════════════════════════════════════════════ */

.portal-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  grid-template-rows: 100vh;
  transition: grid-template-columns var(--dur) var(--ease-out);
}
.portal-shell.rail { grid-template-columns: var(--sidebar-w-rail) minmax(0, 1fr); }

/* The page predates the grid (fixed sidebar + margin-left main). Neutralise at
   desktop; below the drawer breakpoint position:fixed is what the drawer wants. */
@media (min-width: 768px) {
  .sidebar {
    position: relative !important; top: auto !important; left: auto !important;
    bottom: auto !important; width: auto !important; height: auto !important;
    transform: none !important;
  }
}
.main-content { margin-left: 0 !important; width: auto !important; max-width: none !important; }

/* — sidebar — */
.sidebar {
  width: auto; min-width: 0;
  background: var(--sidebar); color: var(--sidebar-foreground);
  border-right: 1px solid var(--sidebar-border);
  padding: 0 12px 12px;
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
  transition: padding var(--dur) var(--ease-out);
}

/* brand lockup: 32px icon tile + wordmark, 16px padding */
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 4px 14px; margin: 0 0 8px;
  border-bottom: 1px solid var(--border-2);
  min-height: 63px;
}
.sidebar-brand img, #brandMark { display: none !important; }   /* brand record mark stays off (PR #472) */
.brand-tile {
  width: 32px; height: 32px; flex: 0 0 auto; border-radius: 9px;
  background: var(--primary); color: var(--primary-foreground);
  display: inline-flex; align-items: center; justify-content: center;
}
.brand-tile .ico { width: 18px; height: 18px; stroke-width: 2.2; }
.sidebar-brand__text {
  font-family: var(--font-heading); font-weight: 600; font-size: 14px; line-height: 1.15;
  letter-spacing: -0.02em; color: var(--foreground); min-width: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sidebar-brand__text:empty::before { content: "Breeder Biz"; }

/* nav list */
/* The main list never shrinks: with 18 tabs the whole sidebar scrolls as one
   (overflow-y on .sidebar) rather than the bottom group riding over the list. */
.nav-links { display: flex; flex-direction: column; gap: 4px; flex: 1 0 auto; }
.nav-links--bottom {
  flex: 0 0 auto; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border-2);
}
.nav-link {
  position: relative; width: 100%; min-height: 36px;
  display: flex; align-items: center; gap: 11px;
  padding: 8px 11px; border-radius: var(--radius); border: 0; background: none;
  color: var(--sidebar-foreground); font-family: var(--font-body);
  font-size: 13.5px; font-weight: 500; line-height: 20px; text-align: left;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.nav-link .nav-icon { color: var(--muted-2); transition: color var(--dur-fast); }
.nav-link:hover { background: var(--sidebar-accent); color: var(--foreground); }
.nav-link:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.nav-link.active { background: var(--sidebar-accent); color: var(--foreground); font-weight: 600; }
.nav-link.active .nav-icon, .nav-link:hover .nav-icon { color: var(--brand-accent); }
.nav-link.active::before { content: none; }
.nav-link .chip { margin-left: auto; }
.nav-group-label {
  font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted-2); padding: 12px 11px 4px;
}

/* collapsed rail: 48px, icons centred, active = pale-yellow rounded square */
.sidebar.collapsed { padding-left: 6px; padding-right: 6px; }
.sidebar.collapsed .sidebar-brand { justify-content: center; padding-inline: 0; }
.sidebar.collapsed .sidebar-brand__text,
.sidebar.collapsed .nav-group-label,
.sidebar.collapsed .nav-link .chip { display: none !important; }
.sidebar.collapsed .nav-link {
  justify-content: center; padding: 0; gap: 0; width: 36px; height: 36px; min-height: 36px;
  margin-inline: auto; font-size: 0; overflow: hidden;
}
.sidebar.collapsed .nav-link .nav-icon { margin: 0; }
.sidebar.collapsed .nav-link.active { background: var(--accent); }
.sidebar.collapsed .nav-link.active .nav-icon { color: var(--brand-accent); }
.sidebar.collapsed .nav-links--bottom { align-items: center; }

/* — main column — */
.main-wrapper {
  display: flex; flex-direction: column; min-width: 0;
  background: var(--background); overflow-y: auto;
}

/* top bar: 56px white, 1px line, 0 16px */
.tab-top-bar {
  display: flex; align-items: center; gap: 12px;
  height: var(--header-h); min-height: var(--header-h); padding: 0 16px;
  border-bottom: 1px solid var(--border); background: var(--card);
  position: sticky; top: 0; z-index: 40;
}
/* crumb never truncates before the search pill has given up its slack */
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 0 1 auto; }
.topbar-right { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex: 0 0 auto; margin-left: auto; min-width: 0; }

.shell-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 32px; min-width: 32px; padding: 0 8px;
  background: none; border: 1px solid transparent; border-radius: var(--radius);
  color: var(--secondary-foreground); cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 500;
  line-height: 1; transition: background var(--dur-fast), color var(--dur-fast);
}
.shell-btn:hover { background: var(--secondary); color: var(--foreground); }
.shell-btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.shell-btn--menu { padding: 0 10px 0 8px; white-space: nowrap; flex: 0 0 auto; } /* never shrink: on a tight top bar the label spilled over the breadcrumb */
.shell-btn--menu .shell-btn__icon { display: inline-flex; line-height: 1; }
.shell-btn--menu .shell-btn__label { font-size: 13px; }
.shell-btn--menu.is-collapsed { background: var(--secondary); color: var(--foreground); }
.shell-btn--icon { width: 36px; height: 36px; padding: 0; position: relative; color: var(--secondary-foreground); }

/* breadcrumb: TENANT (muted) › Page (dark, 500) */
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13.5px; min-width: 0; flex: 0 1 auto; overflow: hidden; } /* the crumb truncates, not the Menu button */
.crumbs a, .crumbs span { color: var(--muted-foreground); white-space: nowrap; }
.crumbs a { text-decoration: none; cursor: pointer; }
.crumbs a:hover { color: var(--foreground); }
.crumbs .crumb-sep { color: var(--muted-2); }
.crumbs .crumb-current { color: var(--foreground); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }

/* search pill: 36px, canvas bg, 1px line, ⌘K chip */
.gsearch { position: relative; flex: 1 1 200px; max-width: 360px; min-width: 140px; margin-inline: auto; }
.gsearch__field {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 36px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--background); padding: 0 8px 0 10px; color: var(--muted-foreground);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.gsearch__field:focus-within { border-color: var(--ring); box-shadow: 0 0 0 2px var(--ring); background: var(--card); }
.gsearch__field .nav-icon { width: 16px; height: 16px; color: var(--muted-foreground) !important; }
.gsearch__field input {
  flex: 1; min-width: 0; border: none; outline: none; background: none;
  font-family: var(--font-body); font-size: 13px; color: var(--foreground); padding: 0; height: 34px;
}
.gsearch__field input::placeholder { color: var(--muted-foreground); }
.gsearch__kbd {
  font-family: var(--font-body); font-size: 11px; font-weight: 500; letter-spacing: 0.02em;
  color: var(--muted-foreground); background: var(--card); border: 1px solid var(--border);
  border-radius: 6px; padding: 1px 6px; flex: 0 0 auto; line-height: 16px;
}
.gsearch__results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60; display: none;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  max-height: 60vh; overflow-y: auto; box-shadow: var(--shadow-dialog); padding: 4px;
}
.gsearch__results.open { display: block; }
.gsearch__row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  cursor: pointer; font-size: 13.5px;
}
.gsearch__row:hover, .gsearch__row.sel { background: var(--secondary); }
.gsearch__kind {
  font-size: 11px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted-2); flex: 0 0 44px;
}
.gsearch__title { color: var(--foreground); font-weight: 500; }
.gsearch__empty { padding: 12px; color: var(--muted-foreground); font-size: 13px; }

/* bell + yellow count badge */
.bell-badge {
  position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--primary); color: var(--primary-foreground);
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
  box-shadow: 0 0 0 2px var(--card);
}
.bell-badge[hidden] { display: none; }

/* account: avatar 32 + name 13.5/600 + role 11 muted + chevron */
.acct { position: relative; flex: 0 0 auto; margin-left: 0; }
.acct__btn {
  display: flex; align-items: center; gap: 9px; background: none; height: 40px;
  border: 1px solid transparent; border-radius: var(--radius); padding: 0 6px 0 4px;
  cursor: pointer; color: var(--foreground);
}
.acct__btn:hover { background: var(--secondary); }
.acct__btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.acct__avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: 0 0 auto; overflow: hidden;
  background: var(--primary); color: var(--primary-foreground);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; letter-spacing: 0.02em;
}
.acct__avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.acct__who { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; min-width: 0; }
.acct__name { font-size: 13.5px; font-weight: 600; color: var(--foreground); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct__role { font-size: 11px; color: var(--muted-foreground); }
#acctRole { display: block; }
.acct__chev { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; color: var(--muted-2); }
.acct__menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 240px; display: none;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: 6px; box-shadow: var(--shadow-dialog);
}
.acct__menu.open { display: block; }
.acct__item {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  padding: 8px 10px; border-radius: 8px; cursor: pointer; min-height: 36px;
  color: var(--foreground); font-size: 13.5px; font-weight: 500; font-family: var(--font-body);
  text-decoration: none;
}
.acct__item:hover { background: var(--secondary); }
.acct__sec { border-top: 1px solid var(--border-2); margin-top: 6px; padding-top: 6px; }
.acct__label {
  font-size: 11px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted-2); padding: 4px 10px;
}
.acct__switch-cur { display: flex; align-items: center; gap: 6px; padding: 8px 10px; font-size: 13.5px; color: var(--foreground); }
.acct__switch-check { color: var(--success); font-weight: 600; }
.acct__switch-item[disabled] { opacity: 0.6; cursor: default; }
.acct__switch-err { padding: 4px 10px 6px; font-size: 12px; color: var(--destructive); }

/* canvas: #f6f7f9, 24px padding, ≤1200 centred, 16px between cards */
main { padding: var(--canvas-pad) 0 8px; }
.wrap { max-width: var(--canvas-max); margin: 0 auto; padding-inline: var(--canvas-pad); }
#tab-website .wrap { max-width: 1800px; margin-inline: 0; padding-inline: clamp(16px, 2vw, 32px); }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > * { flex: 1 1 0; min-width: 280px; }
.dash-cards { align-items: stretch; }
.dash-cards > .card { flex: 1 1 0; min-width: 260px; display: flex; flex-direction: column; }
.dash-cards > .card > .card-foot { margin-top: auto; }
.row + .row { margin-top: 16px; }

/* page footer */
.portal-foot {
  background: transparent; border-top: 1px solid var(--border); padding: 20px 0; margin-top: 24px;
}
.portal-foot .muted { font-size: 12px; }
.portal-foot a { color: var(--muted-foreground); }


/* ═══ SECTION 5 — components ══════════════════════════════════════════════ */

/* — cards — */
.card {
  position: relative; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 16px; box-shadow: none;
}
.card + .card { margin-top: 16px; }
.row > .card + .card, .dash-cards > .card + .card, .lg-grid > .card + .card { margin-top: 0; }
.card .card, .card .cms-photos, .card .list-item { background: var(--card); }
.card-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: -16px -16px 16px; padding: 12px 16px; border-bottom: 1px solid var(--border-2);
  min-height: 48px;
}
.card-head h2, .card h2, .card h3 { font-family: var(--font-heading); font-weight: 600; font-size: 16px; line-height: 1.3; letter-spacing: -0.02em; margin: 0; }
.card-head .muted { font-size: 12px; }
.card-foot {
  margin: 16px -16px -16px; padding: 12px 16px; border-top: 1px solid var(--border-2);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
}
.card-foot .muted { font-size: 12px; }
.card--pagehead { padding: 24px; }
.card-title { font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-foreground); margin-bottom: 8px; }
.card-value { font-family: var(--font-heading); font-size: 28px; font-weight: 600; letter-spacing: -0.02em; color: var(--foreground); line-height: 1.1; }
.card-sub { font-size: 12px; color: var(--muted-foreground); margin-top: 4px; }

/* highlighted card ("Most popular"): 2px yellow border + pill tag on the top edge */
.card--highlight, .ppw-tier--highlight { border: 2px solid var(--primary); }
.card__tag {
  position: absolute; top: 0; left: 50%; transform: translate(-50%, -50%);
  background: var(--primary); color: var(--primary-foreground); border-radius: 999px;
  padding: 2px 10px; font-size: 11px; font-weight: 600; white-space: nowrap;
}

/* page head: the per-tab hero becomes a 24px page-head card */
.wrap.hero {
  width: calc(100% - (2 * var(--canvas-pad))); max-width: calc(var(--canvas-max) - (2 * var(--canvas-pad)));
  margin: 0 auto 16px; padding: 24px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card);
}
#tab-website .wrap.hero { max-width: calc(1800px - 64px); margin-inline: clamp(16px, 2vw, 32px); width: auto; }
.hero h1 { font-size: 21px; margin: 0; }
.hero .eyebrow { margin-bottom: 6px; }
.hero .sub { font-size: 14px; line-height: 1.55; color: var(--muted-foreground); margin-top: 6px; max-width: 64ch; }
.hero-quote-line { font-style: normal; }
.hero-quote-line:empty { display: none; }
a.eyebrow--site { color: var(--muted-foreground); text-decoration: none; cursor: default; display: inline-flex; align-items: center; gap: 5px; }
a.eyebrow--site[href] { cursor: pointer; }
a.eyebrow--site[href]:hover { color: var(--accent-foreground); text-decoration: underline; text-underline-offset: 3px; }
a.eyebrow--site[href]::after { content: "\2197"; font-size: 0.9em; }

/* dashboard welcome card: 64px yellow initials tile + name + pale-yellow role pill */
.welcome-card { display: flex; align-items: center; gap: 18px; }
.welcome-avatar {
  width: 64px; height: 64px; border-radius: 50%; flex: 0 0 auto;
  background: var(--primary); color: var(--primary-foreground);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; letter-spacing: 0.01em;
}
.welcome-avatar { overflow: hidden; }
.welcome-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.welcome-body { min-width: 0; flex: 1 1 auto; }
.welcome-body h1 { font-size: 21px; }
.welcome-body .sub { margin-top: 4px; }
.welcome-body .pill { margin-top: 10px; }

/* — buttons: 32px, radius 10, 14px/500 — */
.btn, .btn-primary, .btn-secondary, .btn-outline, .btn-ghost, .notif-cta, .btn-upgrade,
.login-btn, .cms-back, .ph-add, .task-btn, .dfield-del, .nav-btn, .ph-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 32px; padding: 0 14px; border-radius: var(--radius) !important;
  border: 1px solid transparent; font-family: var(--font-body);
  font-size: 14px; font-weight: 500; line-height: 1; letter-spacing: 0; text-transform: none;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
}
.btn, .btn-primary, .notif-cta, .btn-upgrade {
  background: var(--primary); color: var(--primary-foreground); border-color: var(--primary);
}
.btn:hover, .btn-primary:hover, .notif-cta:hover, .btn-upgrade:hover { background: var(--brand-accent); border-color: var(--brand-accent); color: var(--primary-foreground); filter: none; }
.btn:active, .btn-primary:active { transform: translateY(1px); }
.btn:disabled, .btn-primary:disabled, .btn-secondary:disabled, .btn-ghost:disabled, button.btn[disabled] { opacity: 0.55; cursor: default; transform: none; }
.btn-secondary, .btn-outline, .login-btn--quiet, .cms-back, .ph-add, .task-btn, .dfield-del, .nav-btn, .ph-btn {
  background: var(--background); color: var(--foreground); border-color: var(--border);
}
.btn-secondary:hover, .btn-outline:hover, .login-btn--quiet:hover, .cms-back:hover, .ph-add:hover,
.task-btn:hover, .dfield-del:hover, .nav-btn:hover:not(:disabled), .ph-btn:hover:not(:disabled) {
  background: var(--secondary); border-color: var(--border); color: var(--foreground);
}
.btn-ghost { background: transparent; color: var(--foreground); border-color: transparent; }
.btn-ghost:hover { background: var(--secondary); color: var(--foreground); }
.btn-danger, .btn.danger, .btn--destructive, .ph-btn--del:hover:not(:disabled), .nav-btn--del:hover:not(:disabled), .task-btn.danger:hover {
  background: var(--destructive); color: #fff; border-color: var(--destructive);
}
.btn:focus-visible, .btn-primary:focus-visible, .btn-secondary:focus-visible, .btn-ghost:focus-visible,
.btn-link:focus-visible, .btn-link-inline:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.btn.login-btn--quiet { background: var(--background); color: var(--foreground); border-color: var(--border); }
.btn.login-btn--quiet:hover { background: var(--secondary); }
.task-btn, .nav-btn, .ph-btn, .dfield-del { height: 30px; padding: 0 10px; font-size: 13px; }
.nav-btn, .dfield-del { width: 30px; padding: 0; }
.ph-btn { height: 26px; font-size: 12px; padding: 0 6px; }
.ph-btn--del { color: var(--destructive); }
.nav-btn--del { color: var(--destructive); }
.ph-add { margin-top: 12px; }
.btn.dfield-save { padding: 0 14px; }
.notif-cta { height: 28px; padding: 0 12px; font-size: 12.5px; font-weight: 600; }
.notif-item.urgent .notif-cta { background: var(--destructive); border-color: var(--destructive); color: #fff; }
.btn-upgrade { background: var(--primary); }

/* text buttons: ghost, 32px, no underline rule */
.btn-link, .btn-link-inline {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px;
  background: none; border: 0; border-bottom: 0; border-radius: var(--radius);
  color: var(--foreground); font-family: var(--font-body); font-size: 13.5px; font-weight: 500;
  letter-spacing: 0; cursor: pointer; text-decoration: none;
}
.btn-link:hover, .btn-link-inline:hover { background: var(--secondary); color: var(--foreground); border-bottom: 0; }
.btn-link.danger { color: var(--destructive); }
.btn-link.danger:hover { background: var(--destructive-weak); }
.card-foot .btn-link { margin-right: -10px; }
.card-head .btn-link { margin-right: -6px; }
.login-btn { width: 100%; margin: 0; height: 36px; }
.login-btn[disabled] { opacity: 0.6; cursor: default; }

/* — pills / chips: 11px/500, 999px, 2px 8px — */
.pill, .chip, .nav-badge, .seg__n, .ws-pv-chip, .cms-type__n {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-body); font-size: 11px; font-weight: 500; line-height: 16px;
  letter-spacing: 0; text-transform: none; padding: 2px 8px; border-radius: var(--radius-pill) !important;
  border: 1px solid transparent; white-space: nowrap; font-variant-numeric: tabular-nums;
  background: var(--secondary); color: var(--secondary-foreground);
}
.pill .ico, .chip .ico { width: 12px; height: 12px; }
.pill.good, .chip--good, .pill--success  { background: var(--success-weak); color: #116b35; }
.pill.warn, .chip--warn, .pill--warning  { background: var(--warning-weak); color: var(--warning); }
.pill.bad,  .chip--bad,  .pill--danger   { background: var(--destructive-weak); color: var(--destructive); }
.pill--accent, .chip--accent, .pill--primary { background: var(--accent); color: var(--accent-foreground); }
.pill--yellow, .chip--solid { background: var(--primary); color: var(--primary-foreground); }
.chip--strong { background: var(--foreground); color: var(--card); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
button.chip { cursor: pointer; }
button.chip:hover { background: var(--border); }
button.chip[aria-pressed="true"], .chip.is-on { background: var(--accent); color: var(--accent-foreground); }
.chip__sub { color: inherit; opacity: 0.75; font-size: 11px; }
.chip__x { border: none; background: none; cursor: pointer; padding: 0 0 0 2px; font-size: 13px; line-height: 1; color: inherit; }
.chip__x:hover { color: var(--destructive); }
.nav-badge--group { background: var(--foreground); color: var(--card); }
.ws-pv-chip:empty { display: none; }
.cms-type__n { padding: 0 6px; line-height: 16px; }

/* — segmented control: #eef0f4 track, selected white + shadow-sm — */
.subtabs, .seg, .ws-seg, .ws-pv-devices {
  display: inline-flex; gap: 2px; padding: 3px; margin: 0 0 16px;
  background: var(--secondary); border: 0; border-radius: var(--radius);
  max-width: 100%; overflow-x: auto; flex-wrap: nowrap;
}
.subtab, .seg__btn, .ws-seg-btn, .ws-pv-devices button {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
  margin: 0; background: transparent; border: 0 !important; border-radius: 8px !important;
  font-family: var(--font-body); font-size: 13px; font-weight: 500; letter-spacing: 0;
  color: var(--muted-foreground); cursor: pointer; white-space: nowrap; line-height: 1;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.subtab:hover, .seg__btn:hover, .ws-seg-btn:hover, .ws-pv-devices button:hover { color: var(--foreground); background: transparent; }
.subtab.active, .seg__btn.is-on, .ws-seg-btn.active, .ws-pv-devices button.active {
  background: var(--card); color: var(--foreground); box-shadow: var(--shadow-sm);
}
.ws-seg { display: none; }
.ws-pv-devices { margin: 0; }
.seg__n { background: transparent; padding: 0; color: inherit; opacity: 0.7; }

/* — inputs: 36px, white, 1px #e3e6ec, radius 10, 2px yellow ring — */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label, .field-label, .form-label, label.muted {
  display: block; font-family: var(--font-body); font-size: 13px; font-weight: 500; letter-spacing: 0;
  text-transform: none; color: var(--foreground); margin: 0 0 4px; line-height: 1.3;
}
.field label .muted, .field-label .muted { font-weight: 400; color: var(--muted-foreground); }
.field--required > label::after, .field-label--required::after { content: " *"; color: var(--destructive); }
.field-hint, .hd-hint { margin: 6px 0 0; font-size: 12px; color: var(--muted-foreground); line-height: 1.4; }
.input, .ppw-input, textarea, select,
input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="number"],
input[type="url"], input[type="search"], input[type="date"] {
  font-family: var(--font-body); font-size: 14px; line-height: 20px; color: var(--foreground);
  background: var(--card); border: 1px solid var(--input); border-bottom-color: var(--input);
  border-radius: var(--radius) !important; padding: 7px 10px; height: 36px; outline: none;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
  width: 100%; max-width: 100%;
}
.ppw-input { background: var(--card); }
textarea, textarea.input, textarea.ppw-input { height: auto; min-height: 96px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
select { appearance: none; -webkit-appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23697086' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center; }
.input::placeholder, .ppw-input::placeholder, textarea::placeholder, input::placeholder { color: var(--muted-2); opacity: 1; font-family: var(--font-body); }
.input:focus, .ppw-input:focus, textarea:focus, select:focus, input:focus {
  border-color: var(--ring); box-shadow: 0 0 0 2px var(--ring); background: var(--card);
}
.input[aria-invalid="true"], input[aria-invalid="true"] { border-color: var(--destructive); }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; accent-color: var(--primary); margin: 0; }
input[type="file"] { height: auto; padding: 6px; }
.task-add { display: flex; gap: 8px; margin: 0 0 14px; }
.task-add .input { flex: 1; }
.task-add .btn { flex: 0 0 auto; }
.cms-form .input, .cms-form textarea, .cms-form select { font-size: 14px; padding: 7px 10px; }
.cms-form textarea { padding: 8px 10px; }
.cms-fields { gap: 14px; }

/* — lists: 12px rows, 1px #eef0f4 — */
.list { display: flex; flex-direction: column; gap: 0; }
.list-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--border-2); }
.list-item:last-child { border-bottom: 0; }
.list-item .body { flex: 1; min-width: 0; }
.list-item .body strong { display: block; font-weight: 500; font-size: 14px; color: var(--foreground); line-height: 1.4; }
.list-item .body small { color: var(--muted-foreground); font-size: 12px; display: block; margin-top: 2px; line-height: 1.4; }
.task-row .task-actions, .ev-row .ev-actions { display: flex; gap: 6px; margin-left: auto; align-items: center; }
.kvp { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border-2); font-size: 14px; }
.kvp:last-child { border-bottom: 0; }
.kvp .k { color: var(--muted-foreground); }
.kvp .v { color: var(--foreground); font-weight: 500; text-align: right; }
.big-number { font-family: var(--font-heading); font-weight: 600; font-size: 32px; line-height: 1; letter-spacing: -0.02em; }
.stat-row { display: flex; flex-wrap: wrap; gap: 12px; border: 0; margin: 0 0 16px; }
.stat { flex: 1 1 140px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--card); }
.stat:last-child { border-right: 1px solid var(--border); }
.stat__n { font-family: var(--font-heading); font-weight: 600; font-size: 24px; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat__l { font-family: var(--font-body); font-size: 11px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-foreground); margin-top: 6px; }

/* feature lists: green checks */
.ppw-tier-list { list-style: none; padding: 0; margin: 0; }
.ppw-tier-list li { position: relative; padding: 8px 0 8px 24px; font-size: 14px; line-height: 1.45; color: var(--foreground); border-bottom: 1px solid var(--border-2); }
.ppw-tier-list li:last-child { border-bottom: 0; }
.ppw-tier-list li::before { content: ''; position: absolute; left: 0; top: 11px; width: 16px; height: 16px; background-repeat: no-repeat;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2315a34a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M20 6 9 17l-5-5'/></svg>"); }
.ppw-tier-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.ppw-tier { position: relative; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--card); padding: 20px; }
.ppw-tier-name { font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-foreground); margin-bottom: 8px; }
.ppw-tier-price { font-family: var(--font-heading); font-size: 30px; font-weight: 600; letter-spacing: -0.02em; color: var(--foreground); line-height: 1; margin-bottom: 14px; }
.ppw-tier-unit { font-family: var(--font-body); font-size: 13px; font-weight: 400; color: var(--muted-foreground); margin-left: 3px; font-style: normal; }
.ppw-tier .btn-primary { width: 100%; }
.ppw-seo-pitch { padding: 24px; }
.ppw-seo-pitch h2 { font-family: var(--font-heading) !important; font-size: 21px !important; font-weight: 600 !important; }
.lg-price-card { text-align: center; padding: 24px; }
.lg-price-amt { font-family: var(--font-heading); font-size: 36px; font-weight: 600; letter-spacing: -0.02em; color: var(--foreground); line-height: 1; }
.lg-price-unit { font-size: 14px; color: var(--muted-foreground); margin-left: 4px; font-style: normal; }
.lg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.lg-grid .card + .card { margin-top: 0; }
.lg-feat h3 { margin: 0 0 6px; font-size: 15px; }
.lg-feat p { font-size: 13px; line-height: 1.5; }

/* notifications (dashboard) */
.notif-bar { display: none; border-left: 3px solid var(--warning); }
.notif-bar.has-urgent { border-left-color: var(--destructive); }
.notif-bar.shown { display: block; }
.notif-bar h2 { color: var(--foreground); font-size: 16px; }
.notif-list { display: flex; flex-direction: column; gap: 8px; }
.notif-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 12px; border-radius: var(--radius); font-size: 13.5px; color: var(--foreground);
  background: var(--warning-weak); border: 1px solid transparent;
}
.notif-item.urgent { background: var(--destructive-weak); }
.notif-item .notif-meta { color: var(--muted-foreground); font-size: 12px; }

/* build progress track */
.stage-track { display: flex; gap: 0; margin: 12px 0 4px; }
.stage { flex: 1; position: relative; padding-top: 22px; text-align: center; font-size: 12px; color: var(--muted-foreground); }
.stage::before { content: ''; position: absolute; top: 6px; left: 0; right: 0; height: 2px; background: var(--border); }
.stage:first-child::before { left: 50%; }
.stage:last-child::before { right: 50%; }
.stage::after { content: ''; position: absolute; top: 2px; left: 50%; transform: translateX(-50%); width: 10px; height: 10px; border-radius: 50%; background: var(--card); border: 2px solid var(--border); }
.stage.done::after { background: var(--primary); border-color: var(--primary); }
.stage.current::after { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 3px var(--accent); }
.stage.done, .stage.current { color: var(--foreground); }
.stage.current { font-weight: 600; }

/* threads / bubbles (Help Desk, Gemma) */
.thread { display: flex; flex-direction: column; gap: 12px; max-height: 360px; overflow-y: auto; padding-right: 4px; }
.msg { display: flex; flex-direction: column; max-width: 78%; }
.msg.them { align-self: flex-start; }
.msg.me { align-self: flex-end; text-align: right; }
.msg .bubble { background: var(--secondary); padding: 10px 12px; border: 0; border-radius: 12px; font-size: 14px; line-height: 1.5; color: var(--foreground); }
.msg.me .bubble { background: var(--accent); color: var(--foreground); }
.msg .meta { font-size: 11px; color: var(--muted-foreground); margin-top: 4px; }
.msg .bubble.gm-typing { color: var(--muted-foreground); font-style: italic; }
.hd-actions { display: flex; justify-content: flex-end; margin-top: 4px; }
.hd-actions .btn { min-width: 120px; }
.gemma-thread { min-height: 96px; }
.gemma-reply:not(:empty) { margin-top: 14px; padding: 12px 14px; background: var(--secondary); border-radius: var(--radius); font-size: 14px; line-height: 1.5; }
.gemma-head-right { display: inline-flex; align-items: center; gap: 10px; }
.tut-video { display: block; width: 100%; max-width: 960px; aspect-ratio: 8 / 5; background: #111; border: 1px solid var(--border); border-radius: var(--radius); }
.tut.is-target { box-shadow: 0 0 0 2px var(--primary); border-radius: var(--radius-card); }

/* empty states: muted 13px, centred, one secondary button */
.empty-state, .cms-empty, .drive-empty, .nav-empty, .bd-empty { text-align: center; color: var(--muted-foreground); font-size: 13px; }
.empty-state { padding: 40px 24px; }
.empty-state h2 { font-size: 16px; margin-bottom: 6px; color: var(--foreground); }
.empty-state p { max-width: 440px; margin: 0 auto; }
.empty-state .btn, .empty-state .btn-primary { margin-top: 14px; background: var(--background); color: var(--foreground); border-color: var(--border); }
.empty-state .btn:hover, .empty-state .btn-primary:hover { background: var(--secondary); }
.cms-empty { min-height: 40vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.drive-empty { padding: 32px 4px; }
.nav-empty { padding: 18px 14px; border: 1px dashed var(--border); border-radius: var(--radius); }

/* toasts: bottom-right white card */
.toast, .ws-toast, .portal-toast {
  position: fixed; right: 16px; bottom: 16px; z-index: 200; max-width: 360px;
  background: var(--card); color: var(--foreground); border: 1px solid var(--border);
  border-radius: var(--radius-card); box-shadow: var(--shadow-dialog); padding: 12px 14px;
  font-size: 13px; line-height: 1.45;
}

/* dialog: blurred backdrop, 448px white panel, 14px radius, 16px padding */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; padding: 16px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(13, 18, 28, 0.45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: modalFade 0.15s ease-out;
}
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  position: relative; width: 100%; max-width: 448px; max-height: calc(100vh - 32px); overflow: auto;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card) !important;
  padding: 16px; font-family: var(--font-body); box-shadow: var(--shadow-dialog);
}
.modal-card h2 { font-size: 16px; margin: 0 28px 2px 0; }
.modal-card > .muted { font-size: 13px; }
.modal-close {
  position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: 8px; font-size: 18px; line-height: 1;
  color: var(--muted-foreground); cursor: pointer;
}
.modal-close:hover { background: var(--secondary); color: var(--foreground); }
.pbr-panel { --muted: var(--muted-foreground); }   /* portal-bugreport.js reads --muted as a text colour */

/* tables */
table { border-collapse: collapse; width: 100%; }
th {
  font-family: var(--font-body); font-size: 11px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted-foreground); text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border);
}
td { padding: 10px; border-bottom: 1px solid var(--border-2); font-size: 13.5px; color: var(--foreground); }
.seo-tbl th { font-size: 11px; font-weight: 500; color: var(--muted-foreground); }
.seo-tbl-title { font-family: var(--font-heading); font-size: 15px; font-weight: 600; }
.seo-stat { border: 1px solid var(--border); border-radius: var(--radius-card); padding: 14px 16px; background: var(--card); }
.seo-stat-val { font-family: var(--font-heading); font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.seo-stat-label { font-size: 11px; font-weight: 500; letter-spacing: 0.06em; color: var(--muted-foreground); }
.seo-conn-status.on, .seo-conn-status.on .dot { color: var(--success); }
.seo-conn-status.on .dot { background: var(--success); }
.form-detail dt { font-family: var(--font-body); font-size: 11px; font-weight: 500; letter-spacing: 0.06em; color: var(--muted-foreground); }

/* breeding stock grid */
.dog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; padding: 4px 0 8px; }
.dog-card { display: flex; flex-direction: column; align-items: center; gap: 8px; background: none; border: 0; padding: 0; cursor: pointer; text-align: center; font-family: inherit; }
.dog-card__photo { display: block; width: 100%; aspect-ratio: 1 / 1; border-radius: var(--radius-card); background-size: cover; background-position: center; background-color: var(--secondary); border: 1px solid var(--border); transition: border-color var(--dur-fast), transform var(--dur-fast), box-shadow var(--dur-fast); }
.dog-card__photo--empty { background-color: var(--surface-3); }
.dog-card:hover .dog-card__photo { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.dog-card:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; border-radius: var(--radius-card); }
.dog-card__name { font-family: var(--font-body); font-size: 13.5px; font-weight: 500; color: var(--foreground); line-height: 1.2; }
.dog-card--add .dog-card__plus { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 1 / 1; border-radius: var(--radius-card); border: 1.5px dashed var(--border); color: var(--muted-foreground); font-size: 28px; font-weight: 300; background: var(--card); }
.dog-card--add .dog-card__name { color: var(--muted-foreground); }
.dog-detail { max-width: 760px; }
.dog-detail-hero__img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; display: block; border: 1px solid var(--border); background: var(--secondary); }
.dogs-actions { margin: 0 0 16px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.dog-webtoggle { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--foreground); margin: 0 0 16px; cursor: pointer; }
.dog-webtoggle input, .ph-web input { accent-color: var(--primary); }
.ph-web { font-size: 11px; color: var(--muted-foreground); }
.ph-img { border: 1px solid var(--border); border-radius: var(--radius); background: var(--secondary); }
.ph-cell.is-cover .ph-img { outline: 2px solid var(--primary); outline-offset: 1px; }
.ph-main { background: var(--primary); color: var(--primary-foreground); font-family: var(--font-body); font-size: 10px; font-weight: 600; letter-spacing: 0.04em; border-radius: 6px; }
.ph-cover-badge { font-family: var(--font-body); }
.dog-detail .cms-form__foot.dog-form__foot { background: var(--card); }
.dog-unsaved { color: var(--warning); }
.dfield-fixed { font-family: var(--font-body); font-weight: 500; font-size: 13.5px; }
.cms-form__kicker { font-family: var(--font-body); font-size: 11px; font-weight: 500; letter-spacing: 0.08em; }
.cms-form__title { font-family: var(--font-heading); font-size: 21px; font-weight: 600; line-height: 1.2; }
.cms-form__foot { border-top: 1px solid var(--border-2); }
.cms-photos { border-top: 1px solid var(--border-2); }
.cms-errors { border: 1px solid var(--destructive); background: var(--destructive-weak); border-radius: var(--radius); padding: 12px 14px; font-size: 13.5px; }

/* content editor browser (desktop) */
.cms-browser { border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--card); min-height: 60vh; overflow: hidden; }
.cms-col--types, .cms-col--list { border-right: 1px solid var(--border-2); }
.cms-type { font-family: var(--font-body); font-size: 13.5px; font-weight: 500; color: var(--secondary-foreground); border-radius: var(--radius); padding: 8px 10px; }
.cms-type:hover { color: var(--foreground); background: var(--secondary); }
.cms-type.active { color: var(--foreground); background: var(--secondary); font-weight: 600; }
.cms-search { border-bottom: 1px solid var(--border-2); }
.cms-listfoot { border-bottom: 1px solid var(--border-2); }
.cms-row { border-bottom: 1px solid var(--border-2); }
.cms-row:hover { background: var(--secondary); }
.cms-row.active { background: var(--accent); }
.cms-row.active .cms-row__name, .cms-row.active .cms-row__sub, .cms-row.active .cms-row__grip { color: var(--foreground); }
.cms-row__thumb { border-radius: 8px; background: var(--secondary); }
.cms-row__thumb--empty { border: 1px solid var(--border-2); }
.cms-row__name { font-family: var(--font-body); font-size: 13.5px; font-weight: 500; }
.cms-row__sub { font-size: 12px; }
.cms-row.is-dragging { background: var(--card); }
.cms-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; font-size: 13px; }
.cms-mhome__title, .cms-msub { font-family: var(--font-body); font-size: 11px; font-weight: 500; letter-spacing: 0.08em; }
.cms-mrow, .cms-mhead__title { font-family: var(--font-body); }
.cms-mhead { border-bottom: 1px solid var(--border-2); }
.nav-h { font-family: var(--font-body); font-size: 11px; font-weight: 500; letter-spacing: 0.08em; }
.nav-box { border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--card); }
.nav-row { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.nav-label { font-family: var(--font-body); font-size: 14px; font-weight: 500; border-radius: 8px; }
.nav-label:focus { border-color: var(--ring); background: var(--card); box-shadow: 0 0 0 2px var(--ring); }
.nav-url { border: 1px solid var(--border); border-radius: 8px; background: var(--card); height: 30px; }
.nav-children .nav-children { border-left: 2px solid var(--border-2); }
.nav-formerr, .nav-row__err { color: var(--destructive); }

/* drive browser */
.drive-crumbs { font-family: var(--font-body); font-size: 13px; }
.drive-crumbs button { color: var(--muted-foreground); text-decoration-color: var(--border); }
.drive-crumbs .here { color: var(--foreground); font-weight: 500; }
.drive-tile { border-radius: var(--radius); }
.drive-tile:hover { background: var(--secondary); border-color: var(--border); }
.drive-tile:focus-visible { outline: 2px solid var(--ring); }
.drive-thumb { border-radius: 8px; background: var(--secondary); }
.drive-name { font-family: var(--font-body); font-size: 13.5px; font-weight: 500; }
.drive-meta { font-family: var(--font-body); font-size: 11.5px; color: var(--muted-foreground); }

/* account page avatar */
.acct-hero { display: flex; align-items: center; gap: 18px; }
.acct-photo { position: relative; width: 64px; height: 64px; flex: 0 0 auto; border-radius: 50%; overflow: hidden; cursor: pointer; padding: 0; border: 0; background: var(--primary); color: var(--primary-foreground); }
.acct-photo__ph { font-family: var(--font-body); font-size: 22px; font-weight: 700; letter-spacing: 0.01em; }
.acct-photo__scrim { background: rgba(11, 13, 18, 0.28); }
.acct-photo:hover .acct-photo__scrim, .acct-photo:focus-visible .acct-photo__scrim { background: rgba(11, 13, 18, 0.45); }
.acct-photo__scrim svg { width: 20px; height: 20px; fill: #fff; }
.acct-hero > div .eyebrow { margin-bottom: 4px; }

/* Breeding stock / nav group leftovers */
.nav-group__items .nav-subitem { padding-left: 40px; }
.ws-usage-bar { height: 6px; background: var(--secondary); border-radius: 4px; overflow: hidden; }
.ws-usage-bar > span { display: block; height: 100%; background: var(--primary); }
#wsPane-gemma .card:first-child { background: var(--card); }

/* MSA signature box */
#msaPreview { border: 1px solid var(--border) !important; border-radius: var(--radius) !important; background: var(--surface-3) !important; }
#msaSigCanvas { border-radius: var(--radius); }
.modal-card > div[style*="border:1px solid var(--ppw-ink)"] { border-color: var(--border) !important; border-radius: var(--radius) !important; }


/* ═══ SECTION 6 — Website Editor preview shell (#677/#679/#682/#683) ══════
   Layout logic unchanged — restyled with the new tokens only. */

#tab-website.is-preview .page-header { display: none; }
#tab-website.is-preview {
  display: flex; flex-direction: column; min-height: 0;
  height: calc(100dvh - var(--header-h, 56px) - 56px);
  min-height: 520px;
}
#tab-website.is-preview > .hero, #tab-website.is-preview > .spacer-lg { display: none; }
#tab-website.is-preview > .wrap:not(.hero) { flex: 1 1 auto; min-height: 0; max-width: none; width: 100%; padding-inline: 0; display: flex; flex-direction: column; }
#tab-website.is-preview #websiteBody { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
#tab-gemma.is-preview .page-header, #tab-gemma.is-preview > .hero, #tab-gemma.is-preview > .spacer-lg { display: none; }
#tab-gemma.is-preview.active {
  display: flex; flex-direction: column; min-height: 520px;
  height: calc(100dvh - var(--header-h, 56px) - 56px);
}
#tab-gemma.is-preview > .wrap:not(.hero) { flex: 1 1 auto; min-height: 0; max-width: none; width: 100%; padding-inline: 0; display: flex; flex-direction: column; }
#tab-gemma.is-preview #gemmaDashSubtabs { flex: 0 0 auto; align-self: flex-start; margin: 0 16px 12px; }
#tab-gemma.is-preview #gdPane-ai:not([hidden]) { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
#tab-gemma.is-preview #gdPane-plans:not([hidden]) { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 16px; }
#wsPreviewShell[data-kind="gemma"] #wsPane-cms { display: none !important; }
.ws-preview-shell {
  display: grid; grid-template-columns: minmax(320px, 380px) minmax(0, 1fr); gap: 16px;
  grid-template-rows: minmax(0, 1fr);
  flex: 1 1 auto; min-height: 0; overflow: hidden; padding: 0 16px 16px;
}
.ws-left, .ws-right {
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
  border: 1px solid var(--border); border-radius: var(--radius-card);
  background: var(--card); overflow: hidden;
}
.ws-seg { gap: 2px; padding: 3px; margin: 8px; border-bottom: 0; }
.ws-seg-btn { flex: 1 1 0; }
.ws-seg-pane { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 12px; }
.ws-seg-pane[hidden] { display: none; }
#wsPreviewShell #wsPane-gemma .card { border: 0; background: transparent; padding: 0; box-shadow: none; }
#wsPreviewShell #wsPane-gemma .card-head { margin: 0 0 12px; padding: 0 0 10px; }
#wsPreviewShell #wsPane-gemma .card-head h2 { font-size: 15px; }
#wsPreviewShell #wsPane-gemma #gemmaThread { max-height: none; }
#wsPreviewShell #wsPane-cms .cms-browser, #wsPreviewShell #wsPane-cms .cms-browser-flat { min-height: 0; }
#wsPreviewShell #wsPane-cms .cms-browser { grid-template-columns: minmax(0, 1fr); border: 0; border-radius: 0; }
#wsPreviewShell #wsPane-cms .cms-bar { margin-bottom: 8px; font-size: 12.5px; }
.ws-pv-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--card); }
.ws-pv-page {
  flex: 0 1 200px; min-width: 110px; height: 32px; font: inherit; font-size: 13px; font-weight: 500;
  padding: 0 28px 0 10px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); color: var(--foreground);
}
.ws-pv-devices { display: inline-flex; border: 0; overflow: hidden; }
.ws-pv-devices button { border-left: 0 !important; font-size: 12.5px; height: 26px; padding: 0 10px; }
.ws-pv-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  background: var(--background); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0; font: inherit; font-size: 14px; line-height: 1; color: var(--secondary-foreground); cursor: pointer;
}
.ws-pv-icon:hover { color: var(--foreground); background: var(--secondary); }
.ws-pv-open .eyebrow--site { margin: 0; text-transform: none; letter-spacing: 0; font-size: 13px; }
.ws-pv-spacer { flex: 1 1 auto; }
.ws-pv-stage { flex: 1 1 auto; min-height: 0; position: relative; display: flex; justify-content: center; align-items: stretch; background: var(--background); overflow: hidden; }
.ws-pv-stage[data-dev="tablet"], .ws-pv-stage[data-dev="phone"] { padding: 12px; }
.ws-pv-frame-wrap { width: 100%; height: 100%; background: #fff; transition: width var(--dur) var(--ease-out); }
.ws-pv-stage[data-dev="tablet"] .ws-pv-frame-wrap, .ws-pv-stage[data-dev="phone"] .ws-pv-frame-wrap { max-width: 100%; border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden; }
.ws-pv-stage[data-dev="tablet"] .ws-pv-frame-wrap { width: 768px; }
.ws-pv-stage[data-dev="phone"] .ws-pv-frame-wrap { width: 390px; }
.ws-pv-frame-wrap iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.ws-pv-note {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 2;
  font-size: 12.5px; color: var(--foreground); background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 12px; white-space: nowrap; box-shadow: var(--shadow);
}
.ws-pv-note[hidden] { display: none; }
.ws-pv-foot { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted-foreground); }
.ws-pv-foot[hidden] { display: none; }
.ws-pv-foot .btn-link { font-size: inherit; padding: 0; height: auto; }
/* ── Website Editor in the preview shell: ONE level at a time at every width (Sanity Studio's
   drill-in). The phone's is-l1 / is-l2 / is-l3 pattern (.cms-mhome list -> a collection's records ->
   one document, with a ← header), promoted from <=720px to the whole shell: click Puppies and the
   column becomes the puppies list ("‹ Puppies"), click a puppy and it becomes the form ("‹ Aspen");
   ← goes back one level. The same rules the phone block applies, scoped to the shell. */
@keyframes cmsSlideFwd { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes cmsSlideBack { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
#wsPreviewShell #wsPane-cms .cms-slide-fwd { animation: cmsSlideFwd .18s ease-out; }
#wsPreviewShell #wsPane-cms .cms-slide-back { animation: cmsSlideBack .18s ease-out; }
@media (prefers-reduced-motion: reduce) {
  #wsPreviewShell #wsPane-cms .cms-slide-fwd, #wsPreviewShell #wsPane-cms .cms-slide-back { animation: none; }
}
#wsPreviewShell #wsPane-cms .cms-browser, #wsPreviewShell #wsPane-cms .cms-browser-flat { overflow: visible !important; }
#wsPreviewShell #wsPane-cms .cms-browser { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
#wsPreviewShell #wsPane-cms .cms-browser-flat { flex-direction: column; }
#wsPreviewShell #wsPane-cms .cms-col--types { display: none; }
#wsPreviewShell #wsPane-cms .cms-col--list { border-right: none; }

#wsPreviewShell #wsPane-cms .is-l1 > :not(.cms-mhome) { display: none; }
#wsPreviewShell #wsPane-cms .is-l1 .cms-mhome { display: block; }
#wsPreviewShell #wsPane-cms .cms-mhome__title { margin: 0; padding: 14px 16px 6px; font-size: 12px; font-weight: 500; color: var(--muted-foreground); }
#wsPreviewShell #wsPane-cms .cms-mlist { display: flex; flex-direction: column; }
#wsPreviewShell #wsPane-cms .cms-mrow {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px;
  padding: 0 12px 0 16px; background: none; border: none; border-radius: 0; border-bottom: 1px solid var(--border-2);
  text-align: left; cursor: pointer; font-size: 15px; color: var(--foreground);
}
#wsPreviewShell #wsPane-cms .cms-mrow:active { background: var(--secondary, var(--muted)); }
#wsPreviewShell #wsPane-cms .cms-mrow__label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#wsPreviewShell #wsPane-cms .cms-mrow__n { font-size: 13px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
#wsPreviewShell #wsPane-cms .cms-mrow__chev { font-size: 22px; line-height: 1; color: var(--muted-2); }
#wsPreviewShell #wsPane-cms .cms-msub { margin: 0; padding: 20px 16px 6px; font-size: 12px; font-weight: 500; color: var(--muted-foreground); border-bottom: 1px solid var(--border-2); }

#wsPreviewShell #wsPane-cms .cms-mhead { display: flex; align-items: center; gap: 6px; min-height: 52px; padding: 0 8px; border-bottom: 1px solid var(--border); }
#wsPreviewShell #wsPane-cms .cms-mhead__back, #wsPreviewShell #wsPane-cms .cms-mhead__add {
  flex: 0 0 auto; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: var(--radius); cursor: pointer; font-size: 20px; line-height: 1; color: var(--foreground); padding: 0;
}
#wsPreviewShell #wsPane-cms .cms-mhead__add { font-size: 26px; font-weight: 300; }
#wsPreviewShell #wsPane-cms .cms-mhead__back:active, #wsPreviewShell #wsPane-cms .cms-mhead__add:active { background: var(--secondary, var(--muted)); }
#wsPreviewShell #wsPane-cms .cms-mhead__spacer { flex: 0 0 40px; }
#wsPreviewShell #wsPane-cms .cms-mhead__title {
  flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-align: center; font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--foreground);
}

#wsPreviewShell #wsPane-cms .is-l2 .cms-col--form { display: none; }
#wsPreviewShell #wsPane-cms .cms-search { padding: 10px 12px; }
#wsPreviewShell #wsPane-cms .cms-search .input { width: 100%; font-size: 16px; min-height: 40px; }
#wsPreviewShell #wsPane-cms .cms-row { gap: 12px; padding: 10px 16px; min-height: 60px; }
#wsPreviewShell #wsPane-cms .cms-row__thumb { width: 44px; height: 44px; border-radius: 8px; }
#wsPreviewShell #wsPane-cms .cms-row__name { font-size: 15px; font-weight: 600; white-space: normal; }
#wsPreviewShell #wsPane-cms .cms-row__sub { display: none; }
#wsPreviewShell #wsPane-cms .cms-row__st { display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 12px; color: var(--muted-foreground); text-transform: capitalize; }
#wsPreviewShell #wsPane-cms .cms-row__dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; background: var(--muted-2); }
#wsPreviewShell #wsPane-cms .st-available .cms-row__dot, #wsPreviewShell #wsPane-cms .st-active .cms-row__dot { background: var(--success); }
#wsPreviewShell #wsPane-cms .st-reserved .cms-row__dot, #wsPreviewShell #wsPane-cms .st-planned .cms-row__dot, #wsPreviewShell #wsPane-cms .st-upcoming .cms-row__dot { background: var(--warning); }
#wsPreviewShell #wsPane-cms .st-sold .cms-row__dot, #wsPreviewShell #wsPane-cms .st-past .cms-row__dot, #wsPreviewShell #wsPane-cms .st-retired .cms-row__dot { background: var(--muted-2); }
#wsPreviewShell #wsPane-cms .st-sire .cms-row__dot { background: #5A7A9E; }
#wsPreviewShell #wsPane-cms .st-dam  .cms-row__dot { background: #B06A7E; }
#wsPreviewShell #wsPane-cms .cms-listfoot { padding: 12px 16px; text-align: left; }

#wsPreviewShell #wsPane-cms .is-l3 .cms-col--list { display: none; }
#wsPreviewShell #wsPane-cms .is-l3 .cms-back { display: none; }
#wsPreviewShell #wsPane-cms .cms-form { padding: 14px 14px 22px; }
#wsPreviewShell #wsPane-cms .cms-form__head { margin-bottom: 20px; }
#wsPreviewShell #wsPane-cms .cms-form__title { font-size: 20px; }
#wsPreviewShell #wsPane-cms .cms-fields { grid-template-columns: minmax(0, 1fr); gap: 20px; }
#wsPreviewShell #wsPane-cms .cms-form__foot { justify-content: flex-start; }

#wsPreviewShell #wsPane-cms .nav-cols { grid-template-columns: minmax(0, 1fr); gap: 16px; }
#wsPreviewShell #wsPane-cms .nav-addtoggle { display: block; margin: 0 0 12px; font-size: 15px; }
#wsPreviewShell #wsPane-cms .nav-ed:not(.is-add) .nav-add { display: none; }
#wsPreviewShell #wsPane-cms .nav-ed.is-add .nav-struct { display: none; }
#wsPreviewShell #wsPane-cms .nav-row { padding: 10px; gap: 8px; }
#wsPreviewShell #wsPane-cms .nav-row__main { flex: 1 1 calc(100% - 44px); }
#wsPreviewShell #wsPane-cms .nav-label { font-size: 15px; padding: 8px; }
#wsPreviewShell #wsPane-cms .nav-btns { margin-left: 0; flex: 1 1 auto; justify-content: flex-end; gap: 8px; }
#wsPreviewShell #wsPane-cms .nav-btn { width: 40px; height: 40px; font-size: 14px; }
#wsPreviewShell #wsPane-cms .nav-grip { font-size: 20px; padding: 10px 6px; }
#wsPreviewShell #wsPane-cms .nav-newtab { min-height: 40px; font-size: 13.5px; }
#wsPreviewShell #wsPane-cms .nav-newtab input { width: 20px; height: 20px; }
#wsPreviewShell #wsPane-cms .nav-pick { min-height: 40px; font-size: 15px; }
#wsPreviewShell #wsPane-cms .nav-pick input { width: 20px; height: 20px; }
#wsPreviewShell #wsPane-cms .nav-children .nav-children { margin-left: 12px; padding-left: 8px; }
#wsPreviewShell #wsPane-cms .nav-url { font-size: 15px; padding: 8px; }
#wsPreviewShell #wsPane-cms .nav-box .input { font-size: 16px; min-height: 40px; }
#wsPreviewShell #wsPane-cms .cms-mrow:hover { background: var(--secondary, var(--muted)); }
/* the header stays pinned while the level scrolls under it (the pane's own padding is 12px) */
#wsPreviewShell #wsPane-cms .cms-mhead { position: sticky; top: -12px; z-index: 3; margin: -12px -12px 0; padding: 0 20px; background: var(--card); }

/* a document open (level 3) gets the wider column; lists and menus stay 380px */
@media (min-width: 900px) {
  .ws-preview-shell[data-kind="website"][data-editing="1"] { grid-template-columns: minmax(360px, 440px) minmax(0, 1fr); }
}
@media (max-width: 899px) {
  #tab-website.is-preview { height: auto; min-height: 0; }
  #tab-website.is-preview #websiteBody { display: block; }
  #tab-website.is-preview > .wrap:not(.hero) { display: block; }
  #tab-gemma.is-preview.active { height: auto; min-height: 0; }
  #tab-gemma.is-preview > .wrap:not(.hero), #tab-gemma.is-preview #gdPane-ai:not([hidden]) { display: block; }
  /* Phone / stacked: ONE full-screen pane at a time, like Lovable's mobile editor. The shell is a
     contained, viewport-high column: Edit | Preview toggle pinned on top, the editor scrolls inside,
     and Preview swaps the whole pane to the framed site (page picker + Publish in its own bar). */
  .ws-preview-shell {
    display: flex; flex-direction: column; flex: none; gap: 8px; overflow: hidden;
    height: calc(100dvh - var(--header-h, 56px) - 40px); min-height: 420px;
  }
  .ws-seg { display: inline-flex; flex: 0 0 auto; }
  .ws-left { flex: 1 1 auto; min-height: 0; }
  .ws-preview-shell .ws-right { display: none; }
  .ws-preview-shell[data-seg="preview"] .ws-left { flex: 0 0 auto; }
  .ws-preview-shell[data-seg="preview"] .ws-left .ws-seg-pane { display: none; }
  .ws-preview-shell[data-seg="preview"] .ws-right { display: flex; flex: 1 1 auto; min-height: 0; height: auto; }
}
@media (max-width: 720px) {
  /* a phone IS the phone preview: no width toggle, so the bar fits in two short rows */
  .ws-pv-devices { display: none; }
  .ws-pv-bar { padding: 6px 8px; gap: 6px; }
  .ws-pv-page { flex: 1 1 120px; }
  #wsPreviewShell #wsPane-cms .cms-bar { position: static; display: flex; padding: 8px 0; border-top: 0; background: transparent; }
  #wsPreviewShell #wsPane-cms.is-l3, #wsPreviewShell #wsPane-cms.is-dirty { padding-bottom: 0; }
  #wsPane-cms .cms-bar { background: var(--card); border-top: 1px solid var(--border); }
}


/* ═══ SECTION 7 — login ═══════════════════════════════════════════════════ */

#loginScreen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 32px 16px; background: var(--background) !important; background-image: none !important;
}
#loginScreen .login-card {
  width: 100%; max-width: 440px; background: var(--card) !important;
  border: 1px solid var(--border) !important; border-radius: var(--radius-card) !important;
  padding: 32px 28px; box-shadow: var(--shadow) !important;
}
#loginScreen .brandmark {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  margin: 0 0 20px; font-family: var(--font-heading) !important; font-weight: 600; font-size: 18px;
  letter-spacing: -0.02em; color: var(--foreground); font-style: normal !important;
}
#loginScreen .brandmark::before {
  content: ''; width: 48px; height: 48px; border-radius: 12px; background: var(--primary);
  background-repeat: no-repeat; background-position: center; background-size: 26px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1606' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='4' r='2'/><circle cx='18' cy='8' r='2'/><circle cx='20' cy='16' r='2'/><path d='M9 10a5 5 0 0 1 5 5v3.5a3.5 3.5 0 0 1-6.84 1.045Q6.52 17.48 4.46 16.84A3.5 3.5 0 0 1 5.5 10Z'/></svg>");
}
#loginScreen .brandmark .mark, #loginScreen .brandmark .pet { font-family: inherit !important; font-style: normal !important; font-weight: inherit; }
#loginScreen h2 { font-size: 21px !important; margin-bottom: 4px; }
#loginScreen h3 { font-size: 16px !important; }
#loginScreen .muted { font-size: 13px; }
#loginScreen em, #loginScreen i, #loginScreen .login-or span { font-style: normal !important; }
#loginScreen .eyebrow { font-size: 11px !important; }
.login-or { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted-foreground); margin: 18px 0; }
.login-or::before, .login-or::after { content: ''; flex: 1; height: 1px; background: var(--border-2); }
#loginError { color: var(--destructive); font-size: 13px; min-height: 1.3em; margin-top: 10px; }
#magicLinkMsg { font-size: 13px; }
#magicLinkMsg:not(:empty) { margin-top: 12px; }
.login-quiet { text-align: center; margin: 6px 0 0; font-size: 13px; }
#loginMark { object-fit: contain; }
.muted-link { color: var(--muted-foreground); font-size: 13px; cursor: pointer; }
.muted-link:hover { color: var(--foreground); }


/* ═══ SECTION 8 — mobile (<768px) ═════════════════════════════════════════ */

#hamburgerBtn { display: none; }
.sidebar-overlay {
  position: fixed; inset: 0; background: rgba(13, 18, 28, 0.45);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity var(--dur-fast); z-index: 49;
}
.sidebar-overlay.open { opacity: 1; pointer-events: auto; }

@media (max-width: 767px) {
  :root { --canvas-pad: 16px; }
  .portal-shell, .portal-shell.rail { grid-template-columns: minmax(0, 1fr); grid-template-rows: 100dvh; }
  .sidebar, .sidebar.collapsed {
    position: fixed; inset-block: 0; left: 0; z-index: 50;
    width: 280px; max-width: 86vw; padding: 0 12px 12px;
    transform: translateX(-100%); transition: transform var(--dur-fast) var(--ease-out);
    box-shadow: var(--shadow-dialog);
  }
  .sidebar.open { transform: translateX(0); }
  /* a collapsed rail state must not leak into the drawer */
  .sidebar.collapsed .sidebar-brand__text { display: block !important; }
  .sidebar.collapsed .nav-link { justify-content: flex-start; padding: 8px 11px; gap: 11px; width: 100%; height: auto; min-height: 40px; font-size: 13.5px; }
  .sidebar.collapsed .nav-link.active { background: var(--sidebar-accent); }
  .sidebar.collapsed .nav-link .chip { display: inline-flex !important; }
  .nav-link { min-height: 40px; }
  .nav-links { gap: 4px; }

  .tab-top-bar { padding: 0 12px; gap: 8px; }
  .topbar-left { flex: 1 1 auto; }
  .topbar-right { flex: 0 0 auto; }
  .crumbs { flex: 0 1 auto; }
  .gsearch { margin-inline: 0 0; }
  #hamburgerBtn { display: inline-flex; width: 40px; height: 40px; padding: 0; }
  #sidebarCollapseBtn { display: none; }
  .acct__who { display: none; }
  .acct__chev { display: none; }
  .acct__btn { padding: 0 4px; height: 40px; }
  .shell-btn--icon { width: 40px; height: 40px; }

  /* search folds to an icon; focus expands it over the bar */
  .gsearch { flex: 0 0 40px; margin-inline: auto 0; }
  .gsearch__field { width: 40px; height: 40px; padding: 0; justify-content: center; background: transparent; border-color: transparent; }
  .gsearch__field input, .gsearch__kbd { display: none; }
  .gsearch__field .nav-icon { width: 18px; height: 18px; color: var(--secondary-foreground) !important; }
  .gsearch:focus-within { position: absolute; left: 12px; right: 12px; top: 8px; flex: none; z-index: 61; }
  .gsearch:focus-within .gsearch__field { width: 100%; padding: 0 10px; justify-content: flex-start; background: var(--card); border-color: var(--ring); }
  .gsearch:focus-within .gsearch__field input { display: block; }

  main { padding-top: 16px; }
  .wrap.hero { padding: 16px; }
  .card { padding: 16px; }
  .card--pagehead { padding: 16px; }
  .card-head { flex-wrap: wrap; gap: 6px 12px; }
  .card-head > .btn, .card-head > .btn-link, .card-head > .btn-primary, .card-head > .btn-secondary { flex: 1 1 100%; margin: 0; justify-content: center; }
  .card-foot { flex-direction: column; align-items: stretch; }
  .card-foot .btn, .card-foot .btn-primary, .card-foot .btn-secondary, .card-foot .btn-link { width: 100%; margin: 0; justify-content: center; }
  .row > *, .dash-cards > .card { min-width: 0; flex-basis: 100%; }
  .row { gap: 16px; }
  .welcome-card { align-items: flex-start; }
  .welcome-avatar { width: 56px; height: 56px; font-size: 20px; }
  .btn, .btn-primary, .btn-secondary, .btn-ghost, .login-btn, .notif-cta { min-height: 40px; }
  .input, .ppw-input, select, input[type="text"], input[type="email"], input[type="tel"], input[type="password"] { height: 40px; }
  .subtab, .seg__btn { height: 34px; }
  .task-add { flex-wrap: wrap; }
  .task-add .btn { flex: 1 1 100%; }
  .ppw-tier-grid, .lg-grid { grid-template-columns: minmax(0, 1fr); }
  .acct-hero { flex-direction: row; }
  .modal-card { padding: 16px; }
  .toast, .ws-toast, .portal-toast { left: 16px; right: 16px; max-width: none; }
  .portal-foot .wrap { flex-direction: column; align-items: flex-start !important; gap: 6px !important; }
  table { display: block; overflow-x: auto; }
}
@media (max-width: 479px) {
  #crumbRoot, .crumbs .crumb-sep { display: none; }
}

/* Respect reduced-motion: keep the state changes, drop the travel. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
