/* ══════════════════════════════════════════════════════════════════════════
   PORTAL MONOLITH — shared design language for the client portals
   ══════════════════════════════════════════════════════════════════════════

   ONE stylesheet, both client hosts:
     valhalla.deftech.app              → Def Tech Ops corporate clients
     biz.pawsitivelyperfectwebsites.com → PPW breeder clients

   This is the SAME Monolith language as the Architect staff dashboard
   (static/index.html): achromatic, 2px radius, hairline borders, ink as the
   only accent, cream ground. Ported here so the client portals and the staff
   app read as one product.

   ── How this file works ───────────────────────────────────────────────────
   The two portals were written against two DIFFERENT legacy token sets:
     client-portal.html → dark "Ragnarok"  (--bg, --surface, --primary, --gold…)
     ppw-portal.html    → warm cream       (--ppw-cream, --ppw-ink, --ppw-line…)

   Rather than hand-edit ~4,500 lines of existing rules, SECTION 2 re-points
   every one of those legacy names at a Monolith token. Existing rules that say
   `background: var(--surface)` keep working and quietly become Monolith. That
   makes this conversion reversible (delete the link tag) and keeps the diff
   reviewable.

   ⚠️ Load this AFTER each portal's inline <style> block so it wins on
   equal specificity.

   ── Brand ─────────────────────────────────────────────────────────────────
   Monolith is achromatic BY DESIGN — the Architect carries no colour at all,
   and state is expressed with ink + fill + weight, never hue. The portals keep
   that. Per-brand identity therefore lives in exactly three places, injected
   as tokens by portal-shell.js from GET /api/portal/brand:

       --brand-mark      the logo image URL
       --brand-name      the wordmark string (rendered via JS, not CSS)
       --brand-accent    ONE accent, used only for focus rings + the active dot

   Do NOT add a fourth. If a brand needs more colour than that, it needs a
   conversation, not a token. See CLIENT_PORTAL_CONSOLIDATION_PLAN.md.
   ══════════════════════════════════════════════════════════════════════════ */


/* ═══ SECTION 1 — Monolith tokens (mirrors index.html :root) ═══════════════ */

:root {
  /* type — system stack, no webfont, no build step. Inter is the fallback
     face and is already loaded by both portals. */
  --font-sans:    "Helvetica Neue", Helvetica, "Inter", Arial, sans-serif;
  --font-display: "Helvetica Neue", Helvetica, "Inter", Arial, sans-serif;
  --font-mono:    "SF Mono", "Menlo", "Consolas", monospace;

  /* ground — DTO warm near-white */
  --bg-base:   #fbfaf9;
  --sidebar-bg:#fbfaf9;
  --card-bg:   #fbfaf9;
  --surface-1: #fbfaf9;
  --surface-2: #fbfaf9;
  --surface-3: #f1efec;   /* inset  — wash over ground */
  --frost:     #ffffff;   /* raised — ground-raised    */

  /* ink */
  --text-dark:  #0a0a0b;  /* PRIMARY text */
  --text-muted: #77777c;
  --coal:       #0a0a0b;
  --mauve:      #a0a0a4;  /* soft secondary */

  /* hairlines */
  --border-color:   rgba(10, 10, 11, 0.14);
  --card-border:    rgba(10, 10, 11, 0.14);
  --sidebar-border: rgba(10, 10, 11, 0.075);
  --line:           rgba(10, 10, 11, 0.14);
  --line-soft:      rgba(10, 10, 11, 0.075);
  --wash:           rgba(10, 10, 11, 0.035);

  /* accent = ink. "Restraint as the accent." */
  --btn-bg: #0a0a0b;
  --btn-fg: #fbfaf9;

  /* semantic status — achromatic, separated by VALUE not hue, so they still
     read at a glance in greyscale and for colour-blind users. */
  --ok:   #a0a0a4;
  --bad:  #0a0a0b;
  --warn: #52525a;

  /* geometry + motion */
  --radius:      2px;
  --radius-pill: 999px;
  --ease-out:    cubic-bezier(0.16, 0.84, 0.3, 1);
  --dur:         0.4s;
  --dur-fast:    0.22s;

  /* shell metrics */
  --sidebar-w:      220px;
  --sidebar-w-rail: 64px;
  --header-h:       56px;

  /* brand hooks — portal-shell.js overwrites these per host. The defaults are
     deliberately neutral so an unbranded/unknown host renders as plain ink
     rather than leaking one brand's identity onto another's portal. */
  --brand-accent: #0a0a0b;

  color-scheme: light;
}

/* Dark palette — same token names, dark values. Dormant until something sets
   data-theme='dark'; the account menu's Appearance switcher wires this up. */
:root[data-theme='dark'] {
  --bg-base:#060607; --sidebar-bg:#060607; --card-bg:#0e0e10;
  --surface-1:#060607; --surface-2:#0e0e10; --surface-3:#141416; --frost:#0e0e10;
  --text-dark:#fafafa; --text-muted:#6e6e72; --coal:#fafafa; --mauve:#4a4a4e;
  --border-color:rgba(250,250,250,0.11); --card-border:rgba(250,250,250,0.11);
  --sidebar-border:rgba(250,250,250,0.06);
  --line:rgba(250,250,250,0.11); --line-soft:rgba(250,250,250,0.06);
  --wash:rgba(250,250,250,0.045);
  --btn-bg:#fafafa; --btn-fg:#0a0a0b;
  --ok:#6e6e72; --bad:#fafafa; --warn:#9a9a9e;
  --brand-accent:#fafafa;
  color-scheme: dark;
}


/* ═══ SECTION 2 — legacy token bridge ══════════════════════════════════════
   Every custom property the two portals already reference, re-pointed at a
   Monolith token. This is what converts the existing rules in place.
   Enumerated from an exhaustive grep of both files — if a new legacy name
   appears, add it here rather than restyling the rule that uses it.        */

:root {
  /* — client-portal.html (Ragnarok / dark) — */
  --bg:           var(--bg-base);
  --surface:      var(--card-bg);
  --surface2:     var(--surface-3);
  --border:       var(--border-color);
  --primary:      var(--text-dark);
  --primary-glow: rgba(10, 10, 11, 0.12);
  --gold:         var(--text-muted);   /* gold was decorative — demote to dim ink */
  --text:         var(--text-dark);
  --success:      var(--ok);
  --error:        var(--bad);
  --warning:      var(--warn);

  /* — ppw-portal.html (warm cream) — */
  --ppw-cream:       var(--bg-base);
  --ppw-paper:       var(--card-bg);
  --ppw-paper-edge:  var(--surface-3);
  --ppw-ink:         var(--text-dark);
  --ppw-ink-soft:    var(--text-dark);
  --ppw-mute:        var(--text-muted);
  --ppw-line:        var(--border-color);
  --ppw-line-soft:   var(--line-soft);
  --ppw-accent:      var(--btn-bg);
  --ppw-accent-text: var(--btn-fg);
  --ppw-good:        var(--ok);
  --ppw-warn:        var(--warn);
  --ppw-bad:         var(--bad);
  --ppw-overlay:     var(--wash);

  /* — shared / ambiguous — */
  --font-ui: var(--font-sans);
}

/* The Ragnarok body treatment was five stacked gradients (purple + gold ambient
   glows, a 44px grid, a diagonal base). Monolith is a flat cream ground —
   flatten it here rather than hunting the original declaration. */
html, body {
  background: var(--bg-base) !important;
  color: var(--text-dark);
  font-family: var(--font-sans);
}

/* The Valhalla login screen used a full-bleed photographic background
   (valhalla-bg.jpg) under a dark scrim. Monolith has no photographic
   surfaces — the login is a plain ground with a hairline card. */
#loginScreen {
  background-image: none !important;
  background: var(--bg-base) !important;
}

/* These four rules can't be fixed by the token bridge above: the originals
   hardcode literal values (#fff, rgba(0,0,0,0.5), 20px) rather than reading a
   custom property, so there is no token to re-point. They're restated here. */
.login-card {
  border-radius: var(--radius) !important;
  border: 1px solid var(--border-color) !important;
  background: var(--card-bg) !important;
  box-shadow: none !important;          /* was a 80px black drop shadow */
}
.login-card h1 {
  color: var(--text-dark) !important;   /* was #fff — invisible on cream */
  font-weight: 275; letter-spacing: -0.02em;
}
.login-card p { color: var(--text-muted); }

/* Same root cause as .login-card h1: these headings were hardcoded #fff for
   the old dark portal theme, so on the cream Monolith background they render
   white-on-white and vanish (e.g. the Billing page's "Billing" and "Payment
   History"). Make them ink. The .leadgen / .seo-pitch pitch cards keep their
   own dark backgrounds, so their white gradient titles are deliberately left
   alone. */
.page-header h2,
.welcome-banner h3,
.file-drive-card h3 {
  color: var(--text-dark) !important;
}

/* — sign-in typography, both hosts —
   Valhalla's login was already token-driven, but PPW's ships two display
   faces of its own: 'Editors Note' (the brandmark, h1–h4) and 'Symphony Pro'
   (body default, .eyebrow, .nav-item). Those win on the login screen because
   they're set on `html, body` and on element selectors, neither of which the
   token bridge above can reach.

   Scoped to #loginScreen ON PURPOSE. The rest of the PPW portal keeps its
   serif until the display-face question in CLIENT_PORTAL_CONSOLIDATION_PLAN.md
   is decided — this rule is about the two sign-in pages matching each other,
   not about retiring PPW's brand voice. Widen the scope here if that decision
   later goes to "convert everything". */
#loginScreen,
#loginScreen h1, #loginScreen h2, #loginScreen h3, #loginScreen h4,
#loginScreen .brandmark,
#loginScreen .brandmark .mark,
#loginScreen .brandmark .pet,
#loginScreen .eyebrow,
#loginScreen .muted,
#loginScreen input, #loginScreen button {
  font-family: var(--font-display) !important;
  font-style: normal !important;        /* .mark/.pet/.eyebrow were italic */
}

/* The brand lockup is the login's h1 equivalent on PPW (Valhalla uses a real
   <h1>), so give it the same weight/tracking as `.login-card h1` above. */
#loginScreen .brandmark,
#loginScreen .brandmark .mark {
  font-weight: 275;
  letter-spacing: -0.02em;
  color: var(--text-dark);
}
#loginScreen .brandmark .pet { color: var(--text-muted); font-weight: 300; }

/* PPW sets `em, i { font-style: italic }` as a bare element rule, so the
   <em> inside the lockup ("<em>Pawsitively</em> Perfect") and the "or" in the
   divider stayed italic even once the face was corrected — the rules above
   target the parents, which an element selector on the child out-ranks.
   Monolith has no italics; flatten them so the lockup reads as one word. */
#loginScreen em, #loginScreen i, #loginScreen .login-or span {
  font-style: normal !important;
}

/* "Business Manager" carried an inline font-size:2.3rem, which made a script
   face the largest thing on the page. Monolith's eyebrow idiom is small mono
   with wide tracking (cf. .card-eyebrow, .stat-label) — restate it here, and
   !important the size because the inline style would otherwise win. */
#loginScreen .eyebrow {
  font-family: var(--font-mono) !important;
  font-size: 0.62rem !important;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

#loginScreen h2 { font-weight: 275; letter-spacing: -0.02em; color: var(--text-dark); }

/* #loginMark shares the sidebar lockup's treatment (see data-mark-treatment
   above) so the login and the shell always agree. */
#loginMark { object-fit: contain; }


/* ═══ SECTION 3 — app shell: the super navigation ══════════════════════════
   Structure ported from the Architect (index.html): brand lockup, nav rail
   with collapse, breadcrumb, global search, account menu.                  */

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

/* — legacy layout neutralisation —
   Both portals predate this grid. They laid the shell out manually:
     .sidebar      position:fixed, top:<header height>, explicit width
     .main-content margin-left:220px to clear that fixed sidebar
   A fixed-position child is removed from the grid flow, so column 1 collapsed
   and the whole app stacked into the 220px track. Undo both here — the grid
   is the single source of layout truth now.
   Scoped to the desktop breakpoint: BELOW it, position:fixed is exactly what
   the mobile drawer wants, so the media query in Section 7 re-establishes it. */
@media (min-width: 861px) {
  .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;   /* was 220px, clearing the old fixed sidebar */
  width: auto !important;
  max-width: none !important;
}

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

/* — brand lockup — */
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 2px 6px 16px; margin-bottom: 6px;
  border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-brand img {
  width: 26px; height: 26px; display: block; flex: 0 0 auto;
  object-fit: contain;
}
/* Ink treatment — opt-in per brand via data-mark-treatment="ink", set by
   portal-shell.js from the brand record. Suits line art on a white plate
   (grayscale kills the hue, multiply drops the plate onto the cream ground).
   It is NOT applied by default: on a mark with its own solid background it
   flattens the artwork into a grey block. */
:root[data-mark-treatment='ink'] .sidebar-brand img,
:root[data-mark-treatment='ink'] #loginMark {
  filter: grayscale(1) contrast(1.2) brightness(0.5);
  mix-blend-mode: multiply;
}
:root[data-theme='dark'][data-mark-treatment='ink'] .sidebar-brand img,
:root[data-theme='dark'][data-mark-treatment='ink'] #loginMark {
  /* On dark, multiply would render the mark black-on-black. Screen instead. */
  filter: grayscale(1) contrast(1.1) brightness(1.9);
  mix-blend-mode: screen;
}
.sidebar-brand__text {
  font-family: var(--font-display); font-weight: 500; font-size: 1.02em;
  letter-spacing: -0.01em; color: var(--text-dark); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}

/* — nav rows — */
.nav-links { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-link {
  position: relative;
  /* left padding reserves room for the active dot so the icon column stays
     aligned whether or not the row is active */
  padding: 12px 16px 12px 22px;
  border-radius: 0; border-bottom: none;
  color: var(--text-muted); font-weight: 500; font-size: 0.72em;
  text-decoration: none;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; transition: background var(--dur-fast), color var(--dur-fast);
  background: none; border: 0; width: 100%; text-align: left;
  font-family: var(--font-display);
}
.nav-link:hover { background: var(--wash); color: var(--text-dark); }
.nav-link:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: -2px; }

/* Active state: a small ink dot pinned to the left edge. No underline, no
   fill, no border — the Monolith active-link treatment. */
.nav-link.active { background: transparent; color: var(--text-dark); font-weight: 700; }
.nav-link.active::before {
  content: ''; position: absolute; left: 6px; top: 50%;
  transform: translateY(-50%);
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand-accent);
}

.nav-icon {
  width: 16px; height: 16px; flex: 0 0 auto; opacity: 1;
  fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}
.nav-link.active .nav-icon { stroke-width: 1.8; }

/* Section labels between nav groups */
.nav-group-label {
  font-family: var(--font-mono); font-size: 0.6em; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--mauve);
  padding: 16px 16px 6px 22px;
}

/* — collapsed rail — */
.sidebar.collapsed { padding-left: 8px; padding-right: 8px; }
.sidebar.collapsed .sidebar-brand { justify-content: center; padding-inline: 0; }
.sidebar.collapsed .sidebar-brand__text,
.sidebar.collapsed .nav-group-label,
.sidebar.collapsed .sidebar-footer { display: none !important; }
/* The nav LABEL is a bare text node, not an element, so no selector can hide
   it — font-size:0 collapses it and the icon restores its own size. */
.sidebar.collapsed .nav-link {
  justify-content: center; padding-left: 0; padding-right: 0; gap: 0;
  font-size: 0; white-space: nowrap; overflow: hidden;
}
.sidebar.collapsed .nav-link .nav-icon { margin: 0; }
.sidebar.collapsed .nav-link.active::before { left: 2px; }

/* — sidebar footer — */
.sidebar-footer {
  margin-top: auto; display: flex; justify-content: space-around;
  padding-top: 20px; border-top: 1px solid var(--sidebar-border);
}
.footer-icon {
  color: var(--text-muted); cursor: pointer; transition: color var(--dur-fast);
  background: none; border: 0; padding: 4px;
}
.footer-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor;
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.footer-icon:hover { color: var(--text-dark); }


/* ═══ SECTION 4 — top bar: breadcrumb, search, account ════════════════════ */

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

.tab-top-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; min-height: var(--header-h);
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-base);
  position: sticky; top: 0; z-index: 40;
}

.shell-btn {
  background: none; border: 1px solid var(--border-color);
  border-radius: var(--radius); color: var(--text-dark); cursor: pointer;
  padding: 6px 8px; line-height: 1; font-size: 0.95em;
  transition: border-color var(--dur) var(--ease-out);
}
.shell-btn:hover { border-color: var(--text-dark); background: var(--wash); }

/* — breadcrumb — */
.crumbs { display: flex; align-items: center; gap: 7px; font-size: 0.9em; min-width: 0; }
.crumbs a, .crumbs span { color: var(--text-muted); white-space: nowrap; }
.crumbs a { text-decoration: none; cursor: pointer; }
.crumbs a:hover { color: var(--text-dark); text-decoration: underline; }
.crumbs .crumb-sep { color: var(--mauve); }
.crumbs .crumb-current {
  color: var(--text-dark); font-weight: 500;
  overflow: hidden; text-overflow: ellipsis;
}

/* — global search — */
.gsearch { position: relative; flex: 0 1 420px; margin-inline: auto; }
.gsearch__field {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: 1px solid var(--border-color); border-radius: 10px;
  background: var(--frost); padding: 5px 12px; margin-block: 3px;
}
.gsearch__field:focus-within { border-color: var(--text-dark); }
.gsearch__field input {
  flex: 1; border: none; outline: none; background: none;
  font-family: var(--font-sans); font-size: 0.9em; color: var(--text-dark);
  padding: 0; height: 26px; line-height: 26px;   /* trim the box ~20% shorter */
}
.gsearch__kbd {
  font-family: var(--font-mono); font-size: 0.68em; letter-spacing: 0.06em;
  color: var(--text-muted); border: 1px solid var(--border-color);
  border-radius: var(--radius); padding: 2px 5px; flex: 0 0 auto;
}
.gsearch__results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  background: var(--frost); border: 1px solid var(--border-color);
  border-radius: var(--radius); max-height: 60vh; overflow-y: auto; display: none;
  box-shadow: 0 10px 30px rgba(10,10,11,0.10);
}
.gsearch__results.open { display: block; }
.gsearch__row {
  display: flex; align-items: baseline; gap: 10px; padding: 9px 12px;
  cursor: pointer; border-bottom: 1px solid var(--line-soft);
}
.gsearch__row:last-child { border-bottom: 0; }
.gsearch__row:hover, .gsearch__row.sel { background: var(--wash); }
.gsearch__kind {
  font-family: var(--font-mono); font-size: 0.66em; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--mauve); flex: 0 0 62px;
}
.gsearch__title { color: var(--text-dark); font-size: 0.9em; }
.gsearch__empty { padding: 14px 12px; color: var(--text-muted); font-size: 0.86em; }

/* — account menu — */
.acct { position: relative; flex: 0 0 auto; margin-left: auto; }
.acct__btn {
  display: flex; align-items: center; gap: 9px; background: none;
  border: 1px solid transparent; border-radius: var(--radius);
  padding: 4px 7px; cursor: pointer; color: var(--text-dark);
}
.acct__btn:hover { border-color: var(--border-color); background: var(--wash); }
.acct__avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  background: var(--btn-bg); color: var(--btn-fg);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72em; font-weight: 600; letter-spacing: 0.02em;
}
.acct__who { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.acct__name { font-size: 0.8em; font-weight: 500; color: var(--text-dark); }
.acct__role { font-size: 0.68em; color: var(--text-muted); }
.acct__chev { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.acct__menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60;
  min-width: 230px; display: none;
  background: var(--frost); border: 1px solid var(--border-color);
  border-radius: var(--radius); padding: 6px;
  box-shadow: 0 10px 30px rgba(10,10,11,0.10);
}
.acct__menu.open { display: block; }
.acct__item {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  padding: 8px 10px; border-radius: var(--radius); cursor: pointer;
  color: var(--text-dark); font-size: 0.82em; font-family: var(--font-sans);
}
.acct__item:hover { background: var(--wash); }
.acct__sec { border-top: 1px solid var(--line-soft); margin-top: 6px; padding-top: 6px; }
.acct__label {
  font-family: var(--font-mono); font-size: 0.62em; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--mauve); padding: 4px 10px;
}


/* ═══ SECTION 5 — content surfaces ════════════════════════════════════════
   Cards, tables, buttons, chips — restated in Monolith so the portal body
   matches the shell rather than sitting in the old theme underneath it.   */

.card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 18px;
}
.card-title {
  font-size: 0.68em; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px;
}
.card-value {
  font-size: 1.9em; font-weight: 275; letter-spacing: -0.03em;
  color: var(--text-dark); line-height: 1.1;
}
.card-sub { font-size: 0.72em; color: var(--text-muted); margin-top: 4px; }

/* Monolith geometry is a 2px corner, everywhere. Both portals shipped pill and
   12–20px radii on their controls, set directly on the component classes, so
   these have to be restated rather than inherited from `button`. `.chip` is
   the ONE deliberate exception — it stays a pill. */
button, .btn,
.btn-primary, .btn-secondary, .btn-outline, .btn-ghost, .btn-link,
input, textarea, select,
.card, .modal-card {
  border-radius: var(--radius) !important;
}
.chip { border-radius: var(--radius-pill) !important; }

button, .btn {
  font-family: var(--font-sans);
  cursor: pointer; transition: border-color var(--dur-fast), background var(--dur-fast);
}
.btn-primary {
  background: var(--btn-bg); color: var(--btn-fg);
  border: 1px solid var(--btn-bg); padding: 9px 16px; font-size: 0.82em;
}
.btn-primary:hover { background: var(--text-muted); border-color: var(--text-muted); }
.btn-secondary {
  background: none; color: var(--text-dark);
  border: 1px solid var(--border-color); padding: 9px 16px; font-size: 0.82em;
}
.btn-secondary:hover { border-color: var(--text-dark); background: var(--wash); }

input, textarea, select {
  font-family: var(--font-sans); color: var(--text-dark);
  background: var(--frost); border: 1px solid var(--border-color);
  border-radius: var(--radius); padding: 9px 10px; font-size: 0.85em;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--text-dark);
}

table { border-collapse: collapse; width: 100%; }
th {
  font-family: var(--font-mono); font-size: 0.64em; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--mauve); text-align: left;
  padding: 8px 10px; border-bottom: 1px solid var(--border-color); font-weight: 500;
}
td {
  padding: 10px; border-bottom: 1px solid var(--line-soft);
  font-size: 0.84em; color: var(--text-dark);
}

/* Status chips — achromatic. Separated by FILL and WEIGHT, not hue, so they
   survive greyscale and colour-blindness. Never add a coloured variant. */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 0.62em; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 3px 8px;
  border-radius: var(--radius-pill); border: 1px solid var(--border-color);
  color: var(--text-muted); background: none;
}
.chip--solid { background: var(--btn-bg); color: var(--btn-fg); border-color: var(--btn-bg); }
.chip--strong { color: var(--text-dark); border-color: var(--text-dark); font-weight: 600; }


/* ═══ SECTION 6 — retired Valhalla ornament ═══════════════════════════════
   The dark hero (lightning mark, "Enter Valhalla.", the animated dot) was
   Def-Tech-specific ornament on a photographic ground. It cannot appear on a
   PPW breeder's portal, and Monolith has no photographic surfaces — so it is
   replaced by a plain greeting header on BOTH hosts.                       */

.valhalla-hero,
.hero-lightning,
.hero-eyebrow,
.hero-title,
.hero-quote,
.hero-enter,
.enter-dot { display: none !important; }

.portal-greeting {
  padding: 28px 0 22px; border-bottom: 1px solid var(--line-soft); margin-bottom: 22px;
}
.portal-greeting__hi {
  font-size: 1.7em; font-weight: 275; letter-spacing: -0.03em;
  color: var(--text-dark); text-transform: none;
}
.portal-greeting__sub { font-size: 0.82em; color: var(--text-muted); margin-top: 6px; }


/* ═══ SECTION 7 — responsive ══════════════════════════════════════════════ */

/* The drawer hamburger is mobile-only; the collapse rail is desktop-only.
   Neither carries an inline style, so these rules are the single source of
   truth for which one is showing. */
#hamburgerBtn { display: none; }

.sidebar-overlay {
  position: fixed; inset: 0; background: rgba(10,10,11,0.35);
  opacity: 0; pointer-events: none; transition: opacity var(--dur-fast); z-index: 49;
}
.sidebar-overlay.open { opacity: 1; pointer-events: auto; }

@media (max-width: 860px) {
  .portal-shell, .portal-shell.rail { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset-block: 0; left: 0; z-index: 50;
    width: var(--sidebar-w); transform: translateX(-100%);
    transition: transform var(--dur-fast) var(--ease-out);
  }
  .sidebar.open { transform: translateX(0); }
  .gsearch { display: none; }              /* search moves behind the ⌘K sheet */
  .acct__who { display: none; }            /* avatar only */
  .tab-top-bar { padding-inline: 14px; }
  #hamburgerBtn { display: inline-flex; }
  #sidebarCollapseBtn { display: none; }   /* no rail on a drawer layout */
}

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


/* =========================================================================
   PPW BIZ PORTAL - customizations (migrated from the ppw-portal.html inline
   <style id="ppw-nav-overrides"> block). PPW-only deviations from the base
   portal styling; valhalla-portal.css is unaffected. Side-nav: white
   background (light theme), 25% tighter item spacing, +15% desktop nav text.
   Plus the "Your site" eyebrow -> live-link styling in the Website hero.
   ========================================================================= */
:root { --sidebar-bg: #ffffff; }                 /* was #fbfaf9; dark theme (0,2,0) still wins */
.nav-links { gap: 3px; }                          /* was 4px  (-25%) */
.nav-link  { padding: 9px 16px 9px 22px; }        /* vertical 12px -> 9px (-25%) */
@media (min-width: 861px) {                       /* desktop only; mobile drawer unchanged */
  .nav-link { font-size: 0.828em; }               /* was 0.72em (+15%) */
}
/* "Your site" eyebrow -> live link to the client's own website (href set by portal-website.js) */
a.eyebrow--site { color: inherit; text-decoration: none; cursor: default; display: inline-flex; align-items: center; gap: 5px; transition: color .15s; }
a.eyebrow--site[href] { cursor: pointer; }
a.eyebrow--site[href]:hover { color: var(--ppw-ink); text-decoration: underline; text-underline-offset: 3px; }
a.eyebrow--site[href]::after { content: "\2197"; font-size: .9em; margin-left: 1px; }

/* Preview (JT design check): white background on the Gemma AI input card. */
#wsPane-gemma .card:first-child { background: var(--card-bg); }

/* Gemma "Upgrade" button (Lovable-style pill) + header layout */
.gemma-head-right { display: inline-flex; align-items: center; gap: 14px; }
.btn-upgrade {
  font-family: inherit; font-weight: 600; font-size: 0.82rem;
  padding: 7px 16px; border-radius: 999px; cursor: pointer; border: 0; color: #fff;
  background: linear-gradient(135deg, #7c5cff, #b16cff);
}
.btn-upgrade:hover { filter: brightness(1.06); }
.btn-upgrade:focus-visible { outline: 2px solid var(--focus, #9A7A34); outline-offset: 2px; }

/* Breeding Dogs + content-editor forms — smaller, tighter text.
   The dog-name h2 (up to 2.1rem) and 1rem/14px inputs read "way too big" on
   both phone and desktop; scope the reduction to the .cms-form so the rest of
   the portal is unchanged. */
.cms-form__title { font-size: clamp(1.2rem, 2.1vw, 1.5rem); line-height: 1.12; }
.cms-form__head  { margin-bottom: 14px; }
.cms-form .input, .cms-form textarea, .cms-form select { font-size: 0.9rem; padding: 10px 12px; }
.cms-fields { gap: 12px; }
@media (max-width: 720px) {
  .cms-form { padding: 14px 14px 22px; }
  .cms-form__title { font-size: 1.2rem; }
}

/* Breeding Dogs — clickable card grid (photo + call name), Dollface-style. */
.dog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 16px; padding: 4px 0 10px; }
.dog-card { display: flex; flex-direction: column; align-items: center; gap: 9px; 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: 999px; background-size: cover; background-position: center; background-color: var(--ppw-overlay); border: 1px solid var(--ppw-line-soft); transition: border-color .16s, transform .16s; }
.dog-card__photo--empty { background-color: var(--ppw-cream); }
.dog-card:hover .dog-card__photo { border-color: var(--ppw-ink); transform: translateY(-2px); }
.dog-card:focus-visible { outline: 2px solid var(--focus, #9A7A34); outline-offset: 3px; border-radius: 12px; }
.dog-card__name { font-family: var(--font-display, Georgia, serif); font-size: 1.05rem; color: var(--ppw-ink); line-height: 1.15; }
.dog-card--add .dog-card__plus { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 1 / 1; border-radius: 999px; border: 1.5px dashed var(--ppw-line); color: var(--ppw-mute); font-size: 2rem; font-weight: 300; }
.dog-card--add .dog-card__name { color: var(--ppw-mute); }
.dog-detail { max-width: 760px; }
@media (max-width: 720px) {
  .dog-grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 14px 12px; }
  .dog-card__name { font-size: 0.95rem; }
}

/* Breeding Dogs — import action + show-on-website toggle */
.dogs-actions { margin: 0 0 16px; display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.dog-webtoggle { display: flex; align-items: center; gap: 9px; font-size: 0.9rem; color: var(--ppw-ink); margin: 0 0 18px; cursor: pointer; }
.dog-webtoggle input { width: 16px; height: 16px; accent-color: var(--ppw-good); }

/* ── Boxes: white backgrounds + smaller Noto Serif box titles; no sidebar icon ── */
.card { background: var(--card-bg); }
.card .card, .card .cms-photos, .card .list-item { background: var(--card-bg); }
.card h2, .card-head h2, .card h3 {
  font-family: 'Noto Serif', Georgia, 'Times New Roman', serif;
  font-weight: 500; font-size: 1.2rem; line-height: 1.25; letter-spacing: 0;
}
.sidebar-brand img, #brandMark { display: none !important; }

/* Per-photo "show on website" toggle under each dog photo */
.ph-web { display: flex; align-items: center; gap: 5px; font-size: 0.68rem; color: var(--ppw-mute); margin-top: 5px; cursor: pointer; }
.ph-web input { width: 14px; height: 14px; accent-color: var(--ppw-good); }

/* SEO — connectors + Search Console/Analytics window */
.seo-conn-row { display:grid; grid-template-columns: 1fr auto; gap:4px 16px; align-items:center; padding:14px 0; border-bottom:1px solid var(--ppw-line,#ececec); }
.seo-conn-row:last-child { border-bottom:0; }
.seo-conn-name { font-weight:600; }
.seo-conn-status { display:inline-flex; align-items:center; gap:8px; font-size:0.9rem; color:var(--ppw-muted,#8a8a8a); }
.seo-conn-status .dot { width:9px; height:9px; border-radius:50%; background:#ccc; }
.seo-conn-status.on { color: var(--ppw-good,#2e9e5b); }
.seo-conn-status.on .dot { background: var(--ppw-good,#2e9e5b); }
.seo-conn-detail { grid-column:1 / -1; font-size:0.82rem; }
.seo-stats { display:grid; grid-template-columns: repeat(auto-fit,minmax(140px,1fr)); gap:14px; margin:6px 0 20px; }
.seo-stat { border:1px solid var(--ppw-line,#ececec); border-radius:10px; padding:16px 18px; }
.seo-stat-val { font-size:1.9rem; font-weight:300; line-height:1; letter-spacing:-0.02em; }
.seo-stat-label { font-size:0.72rem; text-transform:uppercase; letter-spacing:0.06em; color:var(--ppw-muted,#8a8a8a); margin-top:8px; }
.seo-tbl-title { font-family:'Noto Serif',Georgia,serif; font-size:1.05rem; font-weight:500; margin:6px 0 8px; }
.seo-tbl-wrap { overflow-x:auto; margin-bottom:18px; }
.seo-tbl { width:100%; border-collapse:collapse; font-size:0.88rem; }
.seo-tbl th, .seo-tbl td { text-align:left; padding:8px 10px; border-bottom:1px solid var(--ppw-line,#f2f2f2); }
.seo-tbl th { font-size:0.68rem; text-transform:uppercase; letter-spacing:0.05em; color:var(--ppw-muted,#8a8a8a); font-weight:700; }
.seo-tbl td.num, .seo-tbl th.num { text-align:right; font-variant-numeric: tabular-nums; }
.seo-tbl td:first-child { max-width:340px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
