/* Prompt & Purpose: shared stylesheet for the website and the Member Desk (redesign, Nov 2026).
   Source of truth: brand/web/pp.css. Copies live in website/site/assets/ and lo-toolkit/portal/app/assets/;
   run `python3 brand/web/sync.py` after editing (tests fail if a copy drifts).
   Tokens come from the approved mockups (handoff/theme.css on the review board). Brand colors: brand/README.md.
   Theme: <html data-theme="dark|light">, set before paint by pp-theme.js. */

/* ---------- Tokens ---------- */
:root, [data-theme="dark"] {
  --ground: #0F1B2D;            /* navy */
  --panel: #16263D;
  --well: #0B1524;              /* input well, a step below navy */
  --line: #2A3D5A;              /* decorative hairline */
  --ink: #FFFFFF;
  --ink-muted: #C9D2DE;
  --ink-dim: #9AA8BB;
  --amber: #E8A33D;             /* amber on dark: one main action or highlight per view */
  --on-amber: #0F1B2D;
  --cyan: #BDF4FF;              /* interactive text */
  --cyan-rim: #00E3FD;          /* focus */
  --down: #FFB4AB;
  --good: #34E39A;
  --bad: #FF5C6C;
  --warn: #E8A33D;
  --glass: rgba(22, 38, 61, 0.55);
  --glass-hi: rgba(22, 38, 61, 0.8);
  --glass-edge: rgba(255, 255, 255, 0.10);
  --glass-edge-hi: rgba(255, 255, 255, 0.18);
  --glow-amber: 0 0 32px rgba(232, 163, 61, 0.35);
  --glow-amber-strong: 0 0 40px rgba(232, 163, 61, 0.5), 0 4px 16px rgba(0, 0, 0, 0.3);
  --glow-cyan: 0 0 0 3px rgba(0, 227, 253, 0.15), 0 0 28px rgba(0, 227, 253, 0.18);
  --bar: rgba(15, 27, 45, 0.78);
  --bloom-a: rgba(232, 163, 61, 0.10);
  --bloom-b: rgba(0, 227, 253, 0.06);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}
[data-theme="light"] {
  --ground: #F5F6F2;
  --panel: #FFFFFF;
  --well: #FFFFFF;
  --line: #D5D9D0;
  --ink: #0F1B2D;
  --ink-muted: #2A3D5A;         /* 10:1 on light ground */
  --ink-dim: #5B6B80;           /* 5:1 */
  --amber: #B5761A;             /* dark amber: large text, marks and fills only */
  --on-amber: #0F1B2D;          /* navy on dark amber 4.6:1 */
  --cyan: #00616D;
  --cyan-rim: #00838F;
  --down: #B3261E;
  --good: #12945A;
  --bad: #D7263D;
  --warn: #B5761A;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-hi: rgba(255, 255, 255, 0.95);
  --glass-edge: rgba(15, 27, 45, 0.10);
  --glass-edge-hi: rgba(15, 27, 45, 0.18);
  --glow-amber: 0 0 28px rgba(181, 118, 26, 0.22);
  --glow-amber-strong: 0 0 32px rgba(181, 118, 26, 0.3), 0 4px 14px rgba(15, 27, 45, 0.12);
  --glow-cyan: 0 0 0 3px rgba(0, 131, 143, 0.18);
  --bar: rgba(245, 246, 242, 0.82);
  --bloom-a: rgba(232, 163, 61, 0.14);
  --bloom-b: rgba(0, 131, 143, 0.07);
  --shadow: 0 8px 28px rgba(15, 27, 45, 0.08);
  color-scheme: light;
}
:root {
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --r-lg: 8px; --r-xl: 12px; --r-full: 9999px;
  --gutter: 24px; --margin: 64px; --max: 1200px;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-body); color: var(--ink); line-height: 1.6;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, var(--bloom-a), rgba(0,0,0,0) 70%),
              radial-gradient(ellipse 60% 50% at 100% 100%, var(--bloom-b), rgba(0,0,0,0) 70%), var(--ground);
  background-attachment: fixed; min-height: 100vh; overflow-x: hidden;
  transition: background-color .3s, color .3s;
}
a { color: inherit; }
img, svg { max-width: 100%; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--margin); }
@media (max-width: 800px) { :root { --margin: 16px; } }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--amber); color: var(--on-amber); padding: 8px 14px; border-radius: var(--r-lg); font-weight: 700; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--cyan-rim); outline-offset: 2px; }

/* ---------- Logo: [ Prompt & Purpose ]. Brackets match the text; only the & is amber (brand/README.md) ---------- */
.logo { display: inline-flex; align-items: center; gap: .32em; min-height: 44px; font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.logo svg { width: .55em; height: 2.1em; flex: none; }
.logo svg path { fill: none; stroke: currentColor; stroke-width: 7; stroke-linecap: square; }
.logo .amp { color: var(--amber); }
.logo.sm { font-size: 17px; }

/* Text stand-in used in some mockups; kept so mockup markup ports cleanly */
.mark { font-family: var(--font-display); font-weight: 600; font-size: 18px; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.mark .br { font-family: var(--font-mono); font-weight: 400; color: var(--ink); }
.mark .amp { color: var(--amber); }

/* ---------- Header bar ---------- */
.bar { position: sticky; top: 0; z-index: 50; background: var(--bar); backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%); border-bottom: 1px solid var(--glass-edge); }
.bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 68px; }
.nav { display: flex; gap: 22px; align-items: center; }
.nav a, .btn { white-space: nowrap; }
.nav a { font-size: 14px; font-weight: 500; color: var(--ink-muted); text-decoration: none; }
.nav a:hover, .nav a[aria-current] { color: var(--ink); }
.bar-right { display: flex; align-items: center; gap: 16px; }
/* Small screens: the nav folds into a Menu button (the mockups hid it with no way in) */
.nav-menu { display: none; position: relative; }
.nav-menu > summary { list-style: none; cursor: pointer; font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); border: 1px solid var(--glass-edge-hi); background: var(--glass); border-radius: var(--r-full); padding: 8px 14px; min-height: 36px; }
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu[open] > summary { color: var(--ink); border-color: var(--amber); }
.nav-menu .nav-panel { position: absolute; right: 0; top: calc(100% + 10px); min-width: 240px; display: grid; gap: 2px; padding: 10px; border-radius: var(--r-xl); background: var(--glass-hi); backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%); border: 1px solid var(--glass-edge-hi); box-shadow: var(--shadow); }
.nav-menu .nav-panel a { padding: 10px 12px; border-radius: var(--r-lg); text-decoration: none; color: var(--ink-muted); font-weight: 500; }
.nav-menu .nav-panel a:hover { background: var(--glass); color: var(--ink); }
@media (max-width: 1400px) { .nav { gap: 16px; } .bar .wrap { gap: 18px; } }
@media (max-width: 1240px) { .nav { display: none; } .nav-menu { display: block; } }
@media (max-width: 520px) { .bar .wrap { gap: 10px; } .bar-right { gap: 8px; } .bar-right .btn-hide-sm { display: none; } .bar .logo { font-size: 17px; } .nav-menu > summary { padding: 8px 11px; } }
@media (max-width: 380px) { .bar .logo { font-size: 15px; } .bar .wrap { padding: 0 12px; } }

/* ---------- Theme switch: Auto / Light / Dark (built by pp-theme.js into [data-pp-theme-switch]) ---------- */
.pp-theme { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-full); background: var(--glass); border: 1px solid var(--glass-edge-hi); }
.pp-theme button { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-dim); background: none; border: 0; border-radius: var(--r-full); padding: 5px 9px; min-height: 28px; cursor: pointer; }
.pp-theme button svg { width: 13px; height: 13px; flex: none; max-width: none; }
.pp-theme button:hover { color: var(--ink); }
.pp-theme button[aria-checked="true"] { color: var(--ink); background: var(--glass-hi); box-shadow: inset 0 0 0 1px var(--glass-edge-hi); }
@media (max-width: 720px) { .pp-theme .pp-theme-l { display: none; } .pp-theme button { padding: 6px 8px; } }
/* In the header the switch shows icons only (labels on hover/title) until the screen is wide enough for everything */
@media (max-width: 1520px) { .bar .pp-theme .pp-theme-l { display: none; } .bar .pp-theme button { padding: 6px 8px; } }

/* ---------- Type ---------- */
.eyebrow { font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-dim); margin: 0 0 16px; }
.eyebrow.amber { color: var(--amber); }
[data-theme="light"] .eyebrow.amber { color: var(--ink-muted); }
[data-theme="light"] .eyebrow.amber::before { content: ""; display: inline-block; width: 18px; height: 2px; background: var(--amber); vertical-align: middle; margin-right: 10px; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; color: var(--ink); }
.h-xl { font-size: clamp(40px, 6vw, 68px); line-height: 1.05; font-weight: 700; letter-spacing: -0.035em; }
.h-lg { font-size: clamp(30px, 4vw, 44px); line-height: 1.12; font-weight: 600; letter-spacing: -0.02em; }
.h-md { font-size: 22px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; }
.hl { color: var(--amber); }
[data-theme="dark"] .glow-text { text-shadow: 0 0 40px rgba(232, 163, 61, 0.25); }
.lead { font-size: 19px; line-height: 1.6; color: var(--ink-muted); max-width: 620px; }
.muted { color: var(--ink-muted); } .dim { color: var(--ink-dim); }
.mono { font-family: var(--font-mono); }
.link { color: var(--cyan); }

/* ---------- Buttons ---------- */
.btn { font-family: var(--font-display); font-size: 15px; font-weight: 600; letter-spacing: .01em; min-height: 48px; padding: 0 22px; border-radius: var(--r-lg); border: 1px solid transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; transition: all .3s cubic-bezier(.4,0,.2,1); }
.btn-primary { background: var(--amber); color: var(--on-amber); box-shadow: var(--glow-amber); }
.btn-primary:hover { box-shadow: var(--glow-amber-strong); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--cyan); border-color: var(--cyan); }
.btn-ghost:hover { box-shadow: var(--glow-cyan); }
.btn-quiet { background: var(--glass); color: var(--ink); border-color: var(--glass-edge-hi); }
.btn-quiet:hover { background: var(--glass-hi); }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: 14px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- Glass card ---------- */
.card { background: var(--glass); backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%); border: 1px solid var(--glass-edge); border-radius: var(--r-xl); padding: var(--gutter); position: relative; overflow: hidden; box-shadow: var(--shadow); }
.card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, rgba(255,255,255,0), var(--glass-edge-hi), rgba(255,255,255,0)); pointer-events: none; }
.card.active { border-color: var(--amber); box-shadow: var(--glow-amber), var(--shadow); background: var(--glass-hi); }
.card h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.card p { margin: 0; color: var(--ink-muted); font-size: 15px; }

/* ---------- Badge, pill, tag ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: var(--r-full); border: 1px solid var(--glass-edge-hi); color: var(--ink-muted); background: var(--glass); }
.badge.hot { background: var(--amber); color: var(--on-amber); border-color: transparent; }
.badge.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--cyan-rim); box-shadow: 0 0 8px var(--cyan-rim); }
.badge.good { color: var(--good); border-color: currentColor; }
.badge.bad { color: var(--bad); border-color: currentColor; }
.badge.warn { color: var(--warn); border-color: currentColor; }
.pill { font-family: var(--font-display); font-size: 14px; font-weight: 500; padding: 6px 16px; min-height: 34px; border-radius: var(--r-full); background: transparent; color: var(--ink-muted); border: 1px solid var(--line); cursor: pointer; }
.pill[aria-pressed="true"], .pill[aria-selected="true"] { color: var(--ink); border-color: var(--amber); background: var(--glass-hi); box-shadow: var(--glow-amber); }
.tag { font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dim); }

/* ---------- Forms ---------- */
.input, .select, .textarea { width: 100%; font-family: var(--font-body); font-size: 16px; min-height: 48px; padding: 0 16px; background: var(--well); color: var(--ink); border: 1px solid var(--glass-edge-hi); border-radius: var(--r-lg); }
.textarea { padding: 12px 16px; min-height: 110px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--ink-dim); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--cyan-rim); box-shadow: var(--glow-cyan); }
.input[aria-invalid="true"] { border-color: var(--bad); }
label.field { display: grid; gap: 6px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim); }
.consent { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; font-size: 13px; line-height: 1.5; color: var(--ink-muted); }
.consent input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--amber); }
.msg { font-size: 14px; padding: 10px 14px; border-radius: var(--r-lg); border: 1px solid var(--glass-edge-hi); background: var(--glass); }
.msg.ok { border-color: var(--good); } .msg.err { border-color: var(--bad); }

/* ---------- Sections and layout ---------- */
section { padding: 96px 0; }
.sec-head { max-width: 720px; margin-bottom: 40px; }
.sec-head p { margin: 14px 0 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } section { padding: 64px 0; } }
.hr { border: 0; border-top: 1px solid var(--line); margin: 0; }
.num { font-family: var(--font-mono); font-size: 13px; color: var(--ink-dim); letter-spacing: .04em; }
.check { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.check li { padding-left: 26px; position: relative; color: var(--ink-muted); font-size: 15px; }
.check li::before { content: "✓"; position: absolute; left: 0; color: var(--cyan); font-weight: 700; }

/* ---------- Reading layout (privacy, text messaging terms) ---------- */
.read { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; align-items: start; padding: 56px 0 96px; }
.read .toc { position: sticky; top: 92px; display: grid; gap: 4px; font-size: 14px; }
.read .toc a { color: var(--ink-dim); text-decoration: none; padding: 4px 0 4px 12px; border-left: 2px solid var(--line); }
.read .toc a:hover, .read .toc a[aria-current] { color: var(--ink); border-left-color: var(--amber); }
.prose { max-width: 720px; color: var(--ink-muted); font-size: 16px; }
.prose h2 { font-size: 24px; margin: 40px 0 12px; scroll-margin-top: 88px; }
.prose h3 { font-size: 18px; margin: 24px 0 8px; }
.prose a { color: var(--cyan); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 12px 0; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim); font-weight: 500; }
@media (max-width: 900px) { .read { grid-template-columns: 1fr; gap: 24px; } .read .toc { position: static; } }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); padding: 40px 0 56px; font-size: 14px; color: var(--ink-dim); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: center; }
footer a { color: var(--ink-muted); text-decoration: none; margin-right: 20px; display: inline-block; padding: 4px 0; }
footer .wrap > div:last-child { display: flex; flex-wrap: wrap; column-gap: 0; }
footer a:hover { color: var(--ink); }

/* ---------- Member Desk shell: top bar, side menu, content ---------- */
.desk-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-dim); padding-left: 16px; margin-left: 16px; border-left: 1px solid var(--line); }
.user { display: flex; align-items: center; gap: 10px; }
.av { width: 32px; height: 32px; border-radius: 50%; background: var(--panel); border: 1px solid var(--glass-edge-hi); display: grid; place-items: center; font-family: var(--font-display); font-size: 13px; font-weight: 600; flex: none; }
.user small { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--ink-dim); }
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 20px; align-items: start; padding-top: 16px; }
.side { position: sticky; top: 76px; display: grid; gap: 4px; padding: 14px 10px; border-radius: var(--r-xl); background: var(--glass); border: 1px solid var(--glass-edge); max-height: calc(100vh - 92px); overflow: auto; }
.side .sg { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-dim); padding: 12px 10px 4px; }
.side a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; text-decoration: none; color: var(--ink-muted); font-size: 14px; font-weight: 500; }
.side a:hover { background: var(--glass-hi); color: var(--ink); }
.side a.on, .side a[aria-current] { background: var(--glass-hi); color: var(--ink); box-shadow: inset 2px 0 0 var(--amber); }
.side a .mi { width: 22px; height: 22px; flex: none; display: grid; place-items: center; font-family: var(--font-mono); font-size: 10px; color: var(--ink-dim); border: 1px solid var(--glass-edge-hi); border-radius: 6px; }
.side a .mi svg { width: 22px; height: 22px; }
.side a .tagnew { margin-left: auto; font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em; color: var(--on-amber); background: var(--amber); border-radius: 999px; padding: 1px 6px; }
.grp { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-dim); margin: 0 0 12px; }
.kpi .lab { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-dim); margin-bottom: 8px; }
.kpi .val { font-family: var(--font-display); font-size: 36px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.kpi .val small { font-size: 16px; color: var(--ink-dim); font-weight: 500; }
.kpi .d { font-family: var(--font-mono); font-size: 12px; color: var(--cyan); margin-top: 4px; }
.kpi .d.dn { color: var(--down); }
.kpi .f { font-size: 12px; color: var(--ink-dim); margin-top: 2px; }
@media (max-width: 1000px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; }
  .side .sg { display: none; }
  .desk-label { display: none; }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .btn-primary:hover { transform: none; }
}
@media print {
  body { background: #fff; }
  .bar, .side, .pp-theme, .nav-menu { display: none !important; }
  .card { box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
}
