/* Forge Ideas — "Redline Editorial — App" design system
   Fonts (Space Grotesk + Plus Jakarta Sans) are served from assets/fonts/ — no
   third-party font requests, so visitors' IP addresses aren't sent to Google.
   The legacy --rlf-* variable names are kept: view templates reference them in
   inline styles, and workspace branding overrides --rlf-red / --ws-accent at
   runtime, so every accent below derives from --rlf-red. */
@font-face{font-family:Plus Jakarta Sans;font-style:normal;font-weight:400 700;font-display:swap;src:url(../fonts/plus-jakarta-sans-latin-ext.woff2) format("woff2");unicode-range:u+0100-02ba,u+02bd-02c5,u+02c7-02cc,u+02ce-02d7,u+02dd-02ff,u+0304,u+0308,u+0329,u+1d00-1dbf,u+1e00-1e9f,u+1ef2-1eff,u+2020,u+20a0-20ab,u+20ad-20c4,u+2113,u+2c60-2c7f,u+a720-a7ff}
@font-face{font-family:Plus Jakarta Sans;font-style:normal;font-weight:400 700;font-display:swap;src:url(../fonts/plus-jakarta-sans-latin.woff2) format("woff2");unicode-range:u+00??,u+0131,u+0152-0153,u+02bb-02bc,u+02c6,u+02da,u+02dc,u+0304,u+0308,u+0329,u+2000-206f,u+20ac,u+2122,u+2191,u+2193,u+2212,u+2215,u+feff,u+fffd}
@font-face{font-family:Space Grotesk;font-style:normal;font-weight:500 700;font-display:swap;src:url(../fonts/space-grotesk-latin-ext.woff2) format("woff2");unicode-range:u+0100-02ba,u+02bd-02c5,u+02c7-02cc,u+02ce-02d7,u+02dd-02ff,u+0304,u+0308,u+0329,u+1d00-1dbf,u+1e00-1e9f,u+1ef2-1eff,u+2020,u+20a0-20ab,u+20ad-20c4,u+2113,u+2c60-2c7f,u+a720-a7ff}
@font-face{font-family:Space Grotesk;font-style:normal;font-weight:500 700;font-display:swap;src:url(../fonts/space-grotesk-latin.woff2) format("woff2");unicode-range:u+00??,u+0131,u+0152-0153,u+02bb-02bc,u+02c6,u+02da,u+02dc,u+0304,u+0308,u+0329,u+2000-206f,u+20ac,u+2122,u+2191,u+2193,u+2212,u+2215,u+feff,u+fffd}


:root {
  /* Brand */
  --rlf-red:        #CC2B1B;          /* crimson — overridden per workspace */
  --rlf-red-dark:   color-mix(in srgb, var(--rlf-red) 82%, #000);  /* follows workspace accent */
  --rlf-dark:       #1E1E1E;          /* ink-primary */
  --rlf-grey:       #575757;          /* ink-secondary */
  --rlf-light-grey: #F9F8F6;          /* surface-canvas */
  --rlf-white:      #FFFFFF;          /* surface-card */
  --rlf-border:     #E5E3DF;          /* border-hairline */
  --rlf-shadow:     0 1px 2px rgba(30,30,30,0.04);
  --rlf-shadow-md:  0 6px 24px rgba(30,30,30,0.10);

  --ink-muted:      #8A8A8A;
  --surface-panel:  #F3F3F3;
  --accent-tint:    color-mix(in srgb, var(--rlf-red) 8%, #fff);
  --accent-tint-2:  color-mix(in srgb, var(--rlf-red) 16%, #fff);
  --accent-ring:    color-mix(in srgb, var(--rlf-red) 22%, transparent);

  --font-display: 'Space Grotesk', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body:    'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Status colours */
  --status-idea:       #16a34a;
  --status-learning:   #2563eb;
  --status-needs:      #d97706;
  --status-parked:     #6b7280;
  --status-founder:    #7c3aed;
  --status-draft:      #9ca3af;

  /* Stage colours */
  --stage-done:    var(--rlf-red);
  --stage-active:  var(--rlf-red);
  --stage-pending: #DEDBD6;

  --radius:     6px;
  --radius-sm:  4px;
  --gap:        16px;
  --gap-lg:     24px;

  --nav-h:      58px;
  --sidebar-w:  240px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; overflow-x: hidden; }
/* No page-level sideways panning on phones (iOS lets a 'fixed' tab bar drift
   when anything overflows). 'clip' — unlike 'hidden' on body — keeps the sticky
   header / pinned CTAs working. */
@supports (overflow: clip) { html, body { overflow-x: clip; } }
img, video, table { max-width: 100%; }
.card, .idea-card, .notice { overflow-wrap: anywhere; }
details > table { display: block; overflow-x: auto; }

body {
  font-family: var(--font-body);
  background: var(--rlf-light-grey);
  color: var(--rlf-dark);
  line-height: 1.55;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.has-nav {
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 8px); /* bottom nav clearance */
}
::selection { background: var(--rlf-red); color: #fff; }

/* ── Typography ─────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--rlf-dark); letter-spacing: -0.015em; }
h1 { font-size: 1.625rem; font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.25rem; font-weight: 700; line-height: 1.25; }
h3 { font-size: 1rem; font-weight: 700; line-height: 1.3; }
p  { font-size: 0.9375rem; color: var(--rlf-grey); }
button, input, select, textarea { font-family: inherit; }
input[type=checkbox], input[type=radio], input[type=range] { accent-color: var(--rlf-red); }

/* ── App Shell ──────────────────────────────────────────── */
.app-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--rlf-light-grey) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--rlf-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: env(safe-area-inset-top) var(--gap) 0;
  height: calc(56px + env(safe-area-inset-top));
}
/* min-width:0 lets the flex children shrink so a long title can truncate
   instead of pushing past the header / the help button on the right */
.app-header-left  { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; overflow: hidden; }
.app-title        { font-family: var(--font-display); font-size: 1.0625rem; font-weight: 700; color: var(--rlf-dark); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -0.01em; }
#headerActions    { flex: none; }
#helpBtn          { background: var(--rlf-white) !important; font-family: var(--font-display); }
.app-logo-red     { color: var(--rlf-red); font-weight: 700; font-size: 1.1rem; letter-spacing: -0.02em; }
.app-logo-mark    { display: block; flex-shrink: 0; max-height: 26px; width: auto; order: 2; padding-left: 10px; border-left: 1px solid var(--rlf-border); }
.app-logo-mark[src$="logo-mark.svg"] { display: none; }   /* default mark: new wordmark replaces it */
.header-back-btn { order: 0; }
.app-title { order: 3; }
.app-wordmark-img { display: block; height: 40px; width: auto; }
/* Always show the Forge logo in the phone header (app.js hides the wordmark on
   titled pages via an inline style — overridden here, JS untouched). On titled
   pages the workspace logo steps aside and the wordmark shrinks to make room. */
.app-wordmark { display: block !important; }
.app-header-left:has(.app-title:not([style*="none"])) .app-logo-mark { display: none; }
.app-header-left:has(.app-title:not([style*="none"])) .app-title { padding-left: 10px; border-left: 1px solid var(--rlf-border); }
/* Capture / Enhance have their own page heading, so the header matches the Idea
   Bank: Forge logo | client logo (no duplicate title). */
body:has(#captureStep_input) .app-header .app-title { display: none !important; }
body:has(#captureStep_input) .app-header-left .app-logo-mark:not([src$="logo-mark.svg"]) { display: block; }
.app-wordmark     { font-family: var(--font-display); font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1; order: 1; flex: none; }
.app-wordmark-forge { color: var(--rlf-red); }
.app-wordmark-ideas { color: var(--rlf-dark); }

.header-back-btn {
  background: none; border: none; cursor: pointer;
  color: var(--rlf-dark); padding: 8px; margin-left: -8px; display: none;
  border-radius: 50%;
}
.header-back-btn:hover { background: var(--surface-panel); }
.header-back-btn.visible { display: flex; align-items: center; }

/* ── Bottom Nav (phones) / Sidebar (desktop) ────────────── */
.nav-brand { display: none; }
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: var(--rlf-white);
  border-top: 1px solid var(--rlf-border);
  display: flex; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  transform: translateZ(0); -webkit-transform: translateZ(0);  /* own layer: stays pinned on iOS */
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 4px; position: relative;
  text-decoration: none; color: var(--rlf-grey);
  font-family: var(--font-display);
  font-size: 0.625rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  transition: color 0.15s;
  min-height: 48px;
}
.nav-item::before {
  content: ''; position: absolute; top: 0; left: 28%; right: 28%; height: 3px;
  border-radius: 0 0 3px 3px; background: transparent; transition: background 0.15s;
}
.nav-item.active, .nav-item:hover { color: var(--rlf-red); }
.nav-item.active::before { background: var(--rlf-red); }
.nav-item svg { width: 19px; height: 19px; }

/* ── Main Content ────────────────────────────────────────── */
.app-content { max-width: 640px; margin: 0 auto; padding: var(--gap); }
.page-header { margin-bottom: var(--gap-lg); }
.page-header h1 { margin-bottom: 4px; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--rlf-white);
  border: 1px solid var(--rlf-border);
  border-radius: var(--radius);
  padding: var(--gap);
  box-shadow: var(--rlf-shadow);
}
.card + .card, .card + .section { margin-top: 12px; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius-sm);
  font-family: var(--font-display); font-size: 0.8125rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
  cursor: pointer; border: 1.5px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.05s;
  text-decoration: none; white-space: nowrap;
  min-height: 48px;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.btn-primary   { background: var(--rlf-red); color: #fff; border-color: var(--rlf-red); }
.btn-primary:hover { background: var(--rlf-red-dark); border-color: var(--rlf-red-dark); }
.btn-secondary { background: var(--rlf-white); color: var(--rlf-dark); border-color: var(--rlf-dark); }
.btn-secondary:hover { background: var(--rlf-dark); color: #fff; }
.btn-ghost     { background: var(--rlf-white); color: var(--rlf-dark); border-color: var(--rlf-border); }
.btn-ghost:hover { border-color: var(--rlf-dark); background: var(--rlf-white); }
.btn-sm        { padding: 7px 14px; font-size: 0.75rem; min-height: 36px; letter-spacing: 0.06em; }
.btn-full      { width: 100%; }
.btn:disabled  { opacity: 0.45; cursor: not-allowed; }

/* "Find similar" pill — compact, accent-tinted, with a connected-nodes glyph. */
.btn-similar {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  font-family: var(--font-display); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em;
  color: var(--rlf-red); background: var(--accent-tint);
  border: 1px solid var(--accent-tint-2);
  cursor: pointer; white-space: nowrap; min-height: 32px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-similar:hover { background: var(--accent-tint-2); border-color: var(--rlf-red); }
.btn-similar:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-family: var(--font-display);
  font-size: 0.6875rem; font-weight: 700;
  color: var(--rlf-dark); margin-bottom: 8px;
  text-transform: uppercase; letter-spacing: 0.1em;
}
.form-label .required { color: var(--rlf-red); margin-left: 2px; }
.form-helper { font-size: 0.8125rem; color: var(--rlf-grey); margin-bottom: 8px; line-height: 1.5; }
.form-input, .form-textarea, .form-select {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--rlf-border); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 1rem; color: var(--rlf-dark);
  background: var(--rlf-white);
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none; min-height: 48px;
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--ink-muted); }
.form-select {
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23575757' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--rlf-red);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.form-textarea { resize: vertical; min-height: 110px; line-height: 1.55; }
.char-count    { font-family: var(--font-display); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.04em; color: var(--ink-muted); text-align: right; margin-top: 4px; }
.char-count.over { color: var(--rlf-red); }

/* ── Status Badges (pills) ───────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-family: var(--font-display); font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.01em; text-transform: capitalize; line-height: 1.3;
  background: var(--surface-panel); color: var(--rlf-grey);
  white-space: nowrap;
}
.badge[class*="badge-"]::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none;
}
.badge-idea_bank         { background: #E7F6EC; color: #15803d; }
.badge-learning_log      { background: #E6EEFD; color: #1d4ed8; }
.badge-needs_input       { background: #FDF1DC; color: #b45309; }
.badge-parked            { background: #EFEFEF; color: #4b5563; }
.badge-founder_candidate { background: #F0EAFE; color: #6d28d9; }
.badge-draft             { background: #F1F0EE; color: #6b7280; }
.badge-archived          { background: #F1F0EE; color: #6b7280; }

/* ── Stage Progress ──────────────────────────────────────── */
.stage-tracker {
  display: flex; align-items: center; gap: 0;
  overflow-x: auto; padding: 4px 0; margin-bottom: var(--gap);
}
.stage-step {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 4px; min-width: 52px;
}
.stage-dot {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--stage-pending); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 0.6875rem; font-weight: 700; position: relative;
}
.stage-step.done  .stage-dot { background: var(--stage-done); }
.stage-step.active .stage-dot { background: var(--stage-active); box-shadow: 0 0 0 3px var(--accent-ring); }
.stage-step.failed .stage-dot { background: #b91c1c; }
.stage-label { font-family: var(--font-display); font-size: 0.625rem; font-weight: 700; color: var(--rlf-grey); text-align: center; text-transform: uppercase; letter-spacing: 0.08em; }
.stage-step.done  .stage-label,
.stage-step.active .stage-label { color: var(--rlf-red); }
.stage-step.failed .stage-label { color: #b91c1c; }
.stage-line { flex: 1; height: 2px; background: var(--stage-pending); min-width: 12px; }
.stage-step.done ~ .stage-line, .stage-step.done + .stage-step .stage-line { background: var(--stage-done); }

/* ── IDEA Journey Stepper (Input → Develop → Enhance → Assess) ───
   Segmented progress bar: each step is a bar with its label beneath. */
.idea-stepper {
  display: flex; align-items: stretch; gap: 6px;
  margin-bottom: var(--gap); padding: 2px 0 4px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.idea-stepper-step {
  flex: 1 1 0; min-width: 64px; display: flex; flex-direction: column;
  align-items: flex-start; gap: 6px; position: relative;
}
.idea-stepper-step::before {
  content: ''; display: block; width: 100%; height: 4px; border-radius: 4px;
  background: var(--stage-pending);
}
.idea-stepper-step.complete::before, .idea-stepper-step.current::before { background: var(--stage-done); }
.idea-stepper-connector { display: none; }
.idea-stepper-step.complete ~ .idea-stepper-connector,
.idea-stepper-connector.complete { background: var(--stage-done); }
.idea-stepper-letter { display: none; }
.idea-stepper-step.complete .idea-stepper-letter { background: var(--stage-done); }
.idea-stepper-step.current .idea-stepper-letter { background: var(--stage-active); }
.idea-stepper-word {
  font-family: var(--font-display);
  font-size: 0.6875rem; font-weight: 700; color: var(--ink-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  white-space: nowrap; display: flex; align-items: center; gap: 4px;
}
.idea-stepper-step.complete .idea-stepper-word { color: var(--rlf-dark); }
.idea-stepper-step.complete .idea-stepper-word::after { content: '✓'; color: var(--rlf-red); font-size: 0.75rem; }
.idea-stepper-step.current .idea-stepper-word { color: var(--rlf-red); }
.idea-stepper-step.current .idea-stepper-word::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--rlf-red);
}

/* ── Accordion (White-box reasoning) ────────────────────── */
.accordion { border: 1px solid var(--rlf-border); border-radius: var(--radius); overflow: hidden; background: var(--rlf-white); }
.accordion + .accordion { margin-top: 8px; }
.accordion-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--gap); cursor: pointer; min-height: 52px;
  background: var(--rlf-white); border: none; width: 100%;
  font-family: inherit; text-align: left;
}
.accordion-header:hover { background: var(--surface-panel); }
.accordion-title { font-family: var(--font-display); font-size: 0.9375rem; font-weight: 700; color: var(--rlf-dark); }
.accordion-icon  { font-size: 1.2rem; color: var(--rlf-grey); transition: transform 0.2s; }
.accordion.open .accordion-icon { transform: rotate(180deg); }
.accordion-body { padding: var(--gap); border-top: 1px solid var(--rlf-border); display: none; }
.accordion.open .accordion-body { display: block; }

/* ── Evidence Panel ──────────────────────────────────────── */
.evidence-item {
  padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--rlf-border);
  border-left: 3px solid var(--rlf-border);
  background: var(--rlf-white);
  margin-bottom: 8px; font-size: 0.875rem;
}
.evidence-item.high           { border-left-color: var(--status-idea); }
.evidence-item.directional    { border-left-color: var(--status-learning); }
.evidence-item.anecdotal      { border-left-color: var(--status-needs); }
.evidence-item.assumption     { border-left-color: var(--rlf-red); }
.evidence-item.needs_validation { border-left-color: var(--ink-muted); }
.evidence-source  { font-family: var(--font-display); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rlf-grey); margin-bottom: 4px; }
.evidence-content { color: var(--rlf-dark); line-height: 1.55; }
.evidence-grade   { font-family: var(--font-display); font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }

/* ── Idea Card Fields ────────────────────────────────────── */
.idea-card { border: 1px solid var(--rlf-border); border-radius: var(--radius); overflow: hidden; background: var(--rlf-white); }
/* Stacked: title on its own line (wraps freely), then an actions row below —
   so a long headline never squeezes or pushes the Improve/branding controls. */
.idea-card-header {
  background: var(--rlf-dark); color: #fff; padding: 18px var(--gap);
  display: flex; flex-direction: column; align-items: stretch; gap: 12px;
  border-bottom: 3px solid var(--rlf-red);
}
.idea-card-header h2 { color: #fff; font-size: 1.25rem; overflow-wrap: anywhere; }
.idea-card-header-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.idea-card-body { padding: var(--gap); background: var(--rlf-white); }
.card-field { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--rlf-border); }
.card-field:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.card-field-label {
  font-family: var(--font-display);
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--rlf-grey); margin-bottom: 6px;
}
.card-field-value {
  font-size: 0.9375rem; color: var(--rlf-dark); line-height: 1.6;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 6px 8px; margin: 0 -8px; cursor: text; min-height: 44px;
  transition: border-color 0.15s, background 0.15s;
  white-space: pre-wrap; word-break: break-word; overflow-wrap: break-word;
}
.card-field-value:hover  { border-color: var(--rlf-border); }
.card-field-value:focus  { outline: none; border-color: var(--rlf-red); background: var(--accent-tint); }
.card-field-value[contenteditable="true"]:empty::before {
  content: attr(data-placeholder); color: var(--ink-muted); font-style: italic;
}
.idea-card-footer {
  background: var(--rlf-dark); color: color-mix(in srgb, var(--rlf-red) 70%, #fff);
  padding: 10px var(--gap); text-align: center;
  font-family: var(--font-display);
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ── FORGE Score ─────────────────────────────────────────── */
.forge-scores { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.forge-score-item { text-align: center; }
.forge-score-bar  { height: 5px; background: var(--rlf-border); border-radius: 3px; margin-bottom: 6px; overflow: hidden; }
.forge-score-fill { height: 100%; border-radius: 3px; background: var(--rlf-red); transition: width 0.4s; }
.forge-score-num  { font-family: var(--font-display); font-size: 1.375rem; font-weight: 700; color: var(--rlf-dark); letter-spacing: -0.02em; }
.forge-score-lbl  { font-family: var(--font-display); font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--rlf-grey); font-weight: 700; }

/* ── Idea List Items ─────────────────────────────────────── */
.idea-list-item {
  background: var(--rlf-white); border: 1px solid var(--rlf-border);
  border-radius: var(--radius); padding: 16px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  text-decoration: none; color: inherit; cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.idea-list-item:hover { border-color: var(--rlf-dark); }
.idea-list-item + .idea-list-item { margin-top: 10px; }
/* overflow-wrap + min-width:0 (set inline on the wrapper) let a long title
   wrap instead of pushing into the action buttons on narrow screens */
.idea-list-title   { font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--rlf-dark); margin-bottom: 4px; overflow-wrap: anywhere; letter-spacing: -0.01em; line-height: 1.3; }
.idea-list-meta    { font-size: 0.8125rem; color: var(--rlf-grey); }
.idea-list-chevron { color: var(--ink-muted); flex-shrink: 0; margin-top: 2px; }

/* On phones the "Similar" pill collapses to just its icon so the action group
   stays narrow and never overlaps the title. */
@media (max-width: 480px) {
  .btn-similar { padding: 6px 8px; }
  .btn-similar .btn-similar-label { display: none; }
}

/* ── Photo Upload ────────────────────────────────────────── */
.photo-upload-area {
  border: 1.5px dashed #CFCBC4; border-radius: var(--radius);
  padding: 24px; text-align: center; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--surface-panel);
}
.photo-upload-area:hover, .photo-upload-area.dragover {
  border-color: var(--rlf-red); background: var(--accent-tint);
}
.photo-preview { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.photo-thumb { width: 76px; height: 76px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--rlf-border); }

/* ── Question Card (coaching) ────────────────────────────── */
.question-card {
  background: var(--rlf-white); border: 1px solid var(--rlf-border);
  border-radius: var(--radius); padding: var(--gap);
  border-left: 3px solid var(--rlf-red);
}
.question-num   { font-family: var(--font-display); font-size: 0.6875rem; font-weight: 700; color: var(--rlf-red); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 6px; }
.question-text  { font-family: var(--font-display); font-size: 1.0625rem; font-weight: 700; color: var(--rlf-dark); margin-bottom: 6px; line-height: 1.35; letter-spacing: -0.01em; }
.question-why   { font-size: 0.8125rem; color: var(--rlf-grey); margin-bottom: 12px; }

/* ── AI Loading State ────────────────────────────────────── */
.ai-loading {
  display: flex; flex-direction: column; align-items: center;
  padding: 40px 24px; gap: 14px; text-align: center;
}
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--rlf-border);
  border-top-color: var(--rlf-red);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.ai-loading-label { font-family: var(--font-display); font-size: 0.875rem; font-weight: 600; color: var(--rlf-grey); letter-spacing: 0.01em; }

/* ── Toast ───────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px); left: 50%; transform: translateX(-50%); z-index: 400; display: flex; flex-direction: column; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast {
  background: var(--rlf-dark); color: #fff; padding: 12px 18px;
  border-radius: var(--radius); font-size: 0.875rem; font-weight: 500;
  box-shadow: var(--rlf-shadow-md); pointer-events: auto;
  animation: slideUp 0.2s ease, fadeOut 0.3s ease 2.7s forwards;
}
.toast.error { background: var(--rlf-red); }
@keyframes slideUp  { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform: translateY(0); } }
@keyframes fadeOut  { to { opacity: 0; } }

/* ── Decision Panel ──────────────────────────────────────── */
.decision-grid {
  display: grid; grid-template-columns: 1fr; gap: 8px;
}
.decision-option {
  border: 1.5px solid var(--rlf-border); border-radius: var(--radius);
  padding: 14px 16px; cursor: pointer; text-align: left;
  transition: border-color 0.15s, background 0.15s;
  background: var(--rlf-white); font-family: inherit;
  display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center;
  min-height: 60px;
}
.decision-option:hover  { border-color: var(--rlf-dark); }
.decision-option.selected { border-color: var(--rlf-red); background: var(--accent-tint); box-shadow: inset 0 0 0 1px var(--rlf-red); }
.decision-option-icon   { font-size: 1.375rem; grid-row: span 2; }
.decision-option-label  { font-family: var(--font-display); font-size: 0.9375rem; font-weight: 700; color: var(--rlf-dark); }
.decision-option-desc   { font-size: 0.8125rem; color: var(--rlf-grey); margin-top: 1px; }
.decision-option-founder:hover   { border-color: var(--status-founder); }
.decision-option-founder.selected { border-color: var(--status-founder); background: #F5F1FF; box-shadow: inset 0 0 0 1px var(--status-founder); }

/* ── Bottom Sheet (lightbulb modal) ─────────────────────── */
.bottom-sheet-overlay {
  position: fixed; inset: 0;
  background: rgba(20,20,20,0.5);
  z-index: 300; display: none;
  animation: fadeInOverlay 0.2s ease;
}
.bottom-sheet-overlay.open { display: block; }
.bottom-sheet {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--rlf-white);
  border-radius: 20px 20px 0 0;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  z-index: 301;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32,0.72,0,1);
  max-height: 88dvh; overflow-y: auto;
  box-shadow: none; visibility: hidden;
}
.bottom-sheet.open { transform: translateY(0); box-shadow: 0 -8px 32px rgba(0,0,0,0.14); visibility: visible; }
.bottom-sheet-handle {
  width: 40px; height: 5px;
  background: #D9D6D0;
  border-radius: 3px;
  margin: 0 auto 14px;
}
.bottom-sheet-header {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 14px; border-bottom: 1px solid var(--rlf-border);
  font-family: var(--font-display);
}
@keyframes fadeInOverlay { from { opacity:0 } to { opacity:1 } }

/* ── Evaluator Avatars ───────────────────────────────────── */
.evaluator-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface-panel);
  border: 1px solid var(--rlf-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; flex-shrink: 0;
  overflow: hidden;
}
.evaluator-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.evaluator-avatar.sm { width: 32px; height: 32px; font-size: 0.9rem; }
.evaluator-avatar.md { width: 40px; height: 40px; font-size: 1.1rem; }
.evaluator-avatar.lg { width: 56px; height: 56px; font-size: 1.5rem; }

/* ── Quick Start Banner ──────────────────────────────────── */
.quick-start-banner {
  background: var(--surface-panel);
  border: none;
  border-left: 3px solid var(--rlf-red);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: var(--gap);
}

/* ── App patterns (eyebrows, section labels, notices, pinned CTA) ── */
.eyebrow {
  font-family: var(--font-display); font-size: 0.6875rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--rlf-red); margin-bottom: 6px;
}
.section-label {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  font-family: var(--font-display); font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--rlf-dark);
  margin: 22px 2px 10px;
}
.section-label span { color: var(--ink-muted); font-weight: 600; letter-spacing: 0.06em; }
.meta-caps { font-family: var(--font-display); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); }
.notice { border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; border: 1px solid var(--rlf-border); background: var(--rlf-white); }
.notice-warn { background: #FFF8EC; border-color: #F6DDB0; border-left: 3px solid var(--status-needs); }
.notice-title { font-family: var(--font-display); font-size: 0.9375rem; font-weight: 700; color: #92400e; }
.notice-body { font-size: 0.8125rem; color: #9a5b0c; margin: 4px 0 10px; }
.capture-main { border-top: 3px solid var(--rlf-red); }
/* Context & details: tap a row to expand its field */
.opt-fields { display: flex; flex-direction: column; gap: 8px; }
.opt-field { background: var(--rlf-white); border: 1px solid var(--rlf-border); border-radius: var(--radius); overflow: hidden; }
.opt-field[open] { border-color: var(--rlf-dark); }
.opt-field > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; min-height: 64px; }
.opt-field > summary::-webkit-details-marker { display: none; }
.opt-icon { flex: none; width: 38px; height: 38px; border-radius: var(--radius-sm); background: var(--surface-panel); color: var(--rlf-grey); display: flex; align-items: center; justify-content: center; }
.opt-field[open] .opt-icon { background: var(--accent-tint); color: var(--rlf-red); }
.opt-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.opt-label { font-family: var(--font-display); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rlf-grey); }
.opt-preview { font-size: 0.9375rem; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opt-preview.filled { color: var(--rlf-dark); }
.opt-chevron { flex: none; color: var(--ink-muted); font-size: 1.5rem; line-height: 1; transition: transform 0.2s; }
.opt-field[open] .opt-chevron { transform: rotate(90deg); }
.opt-body { padding: 0 16px 16px; }
.opt-body .form-textarea { min-height: 96px; }
.capture-spark { font-size: 1.0625rem; min-height: 150px; border-color: transparent; background: var(--surface-panel); }
.capture-spark:focus { background: var(--rlf-white); }
.completeness-card { margin: 14px 0 16px; }
.progress-track { background: var(--surface-panel); border-radius: 999px; height: 8px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: var(--rlf-red); transition: width 0.4s; }
/* Primary action pinned above the tab bar on phones (sticks to the bottom of
   its step while that step is on screen). */
.sticky-cta {
  position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); z-index: 20;
  margin-top: 18px; padding: 10px 10px 14px; margin-left: -10px; margin-right: -10px;
  background: color-mix(in srgb, var(--rlf-light-grey) 94%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-radius: var(--radius);
}
.sticky-cta .btn-primary { box-shadow: 0 6px 18px color-mix(in srgb, var(--rlf-red) 28%, transparent); }
.sticky-cta .btn-primary:disabled { box-shadow: none; }
.sticky-cta-hint { text-align: center; margin: 8px 0 0; }

/* ── Review: 4Ps score hero, recommendation, decision, export ── */
.score-card { padding: 18px 16px; }
.score-card-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--rlf-border); }
.score-big { font-family: var(--font-display); font-size: 3rem; font-weight: 700; line-height: 1; letter-spacing: -0.04em; color: var(--rlf-red); margin-top: 4px; }
.score-big span { font-size: 1.25rem; color: var(--rlf-grey); letter-spacing: 0; margin-left: 4px; }
.score-scale { font-size: 0.75rem; color: var(--ink-muted); line-height: 1.5; max-width: 300px; }
.score-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.score-tile { display: block; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; border: 1px solid var(--rlf-border); border-radius: var(--radius-sm); padding: 12px; background: var(--rlf-white); transition: border-color 0.15s, background 0.15s, box-shadow 0.15s; }
.score-tile:hover { border-color: var(--rlf-dark); }
.score-tile.is-active { border-color: var(--rlf-red); background: var(--accent-tint); box-shadow: inset 0 0 0 1px var(--rlf-red); }
.score-tile-top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; margin-bottom: 10px; font-family: var(--font-display); }
.score-tile-top span { font-size: 0.875rem; font-weight: 700; color: var(--rlf-dark); }
.score-tile-top strong { font-size: 0.9375rem; color: var(--rlf-dark); }
.seg-bar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.seg-bar i { display: block; height: 5px; border-radius: 3px; background: var(--rlf-border); }
.seg-bar i.on { background: var(--rlf-red); }
.reco-callout { margin-top: 14px; padding: 12px 14px; background: var(--surface-panel); border-left: 3px solid var(--rlf-red); border-radius: var(--radius-sm); }
.reco-title { font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--rlf-dark); margin-top: 4px; text-transform: none; }
.score-details { margin-top: 10px; }
.score-detail { padding: 14px; background: var(--surface-panel); border-radius: var(--radius-sm); border-left: 3px solid var(--rlf-red); }
.score-detail-label { font-family: var(--font-display); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.04em; color: var(--rlf-red); }
.score-detail-num { font-family: var(--font-display); font-weight: 700; font-size: 1rem; flex: none; }
.chip-muted { display: inline-block; font-family: var(--font-display); font-size: 0.6875rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--surface-panel); color: var(--rlf-grey); }
.decision-card { border-top: 3px solid var(--rlf-red); scroll-margin-top: 72px; }
.export-block { border: 1px solid var(--rlf-border); border-radius: var(--radius); padding: 14px; background: var(--rlf-light-grey); }
.export-block-title { font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--rlf-dark); }

/* ── Idea Bank: filter pills, tools, idea cards, FAB ──────── */
/* Filter buttons keep their btn / btn-primary / btn-ghost classes (BankView.setFilter
   rewrites them); the pill look comes from this container. */
.filter-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; margin: 0 -16px 12px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chips .btn { border-radius: 999px; min-height: 38px; padding: 7px 14px; font-size: 0.8125rem; text-transform: none; letter-spacing: 0.01em; flex: none; }
.filter-chips .btn-primary { background: var(--rlf-dark); border-color: var(--rlf-dark); color: #fff; box-shadow: none; }
.filter-chips .btn-ghost { background: var(--rlf-white); border-color: var(--rlf-border); color: var(--rlf-dark); }
.filter-chips .btn span { opacity: 0.6 !important; margin-left: 2px; }
/* Admin tabs: same pill treatment, targeted by attribute (admin.js untouched) */
.btn[data-admin-tab] { border-radius: 999px; min-height: 38px; padding: 7px 14px; font-size: 0.8125rem; text-transform: none; letter-spacing: 0.01em; flex: none; }
.btn-primary[data-admin-tab] { background: var(--rlf-dark); border-color: var(--rlf-dark); color: #fff; }
.btn-ghost[data-admin-tab] { background: var(--rlf-white); border-color: var(--rlf-border); color: var(--rlf-dark); }
.bank-tools { display: flex; gap: 8px; margin-bottom: 16px; align-items: center; }
.bank-tools .form-input { min-height: 44px; padding-top: 9px; padding-bottom: 9px; font-size: 0.9375rem; }
.bank-item { display: block; padding: 16px; }
.bank-item-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.bank-item .idea-list-title { font-size: 1.0625rem; margin-bottom: 2px; }
.bank-item .idea-list-meta { margin-bottom: 2px; }
.bank-item-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--rlf-border); }
.bank-score { font-family: var(--font-display); font-size: 0.875rem; font-weight: 700; color: var(--rlf-dark); display: inline-flex; align-items: center; gap: 4px; }
.bank-score-lbl { font-size: 0.625rem; letter-spacing: 0.1em; color: var(--ink-muted); }
.mini4p { display: inline-flex; align-items: stretch; gap: 3px; height: 20px; margin-right: 4px; }
.mini4p i { display: block; width: 5px; border-radius: 2px; background: linear-gradient(to top, currentColor var(--h), #E4E1DB var(--h)); }
.bank-score.good { color: #15803d; }
.bank-score.mid  { color: #b45309; }
.bank-score.low  { color: var(--rlf-grey); }
.bank-score.none { font-family: var(--font-body); font-weight: 500; font-size: 0.8125rem; color: var(--ink-muted); }
.bank-date { font-size: 0.8125rem; color: var(--ink-muted); }
.bank-item-actions { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.bank-item-actions .btn-sm { min-height: 30px; height: 30px; min-width: 30px; padding: 0 8px; border-radius: 50%; font-size: 0.8125rem; }
.bank-item-actions .btn-sm svg { width: 14px; height: 14px; }
.bank-item-actions .btn-similar { min-height: 30px; height: 30px; padding: 0 9px; font-size: 0.6875rem; }
.bank-item-actions .btn-similar svg { width: 13px; height: 13px; }
.bank-item-actions .btn-sm:not(.icon-only):has(> :not(svg)) { border-radius: 999px; }
.bank-match { flex: none; font-family: var(--font-display); font-size: 0.6875rem; font-weight: 700; color: #1d4ed8; background: #E6EEFD; border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.fab {
  position: fixed; right: 18px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 18px); z-index: 90;
  width: 58px; height: 58px; border-radius: 16px; border: none; cursor: pointer;
  background: var(--rlf-red); color: #fff; font-size: 2rem; font-weight: 300; line-height: 1;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--rlf-red) 35%, transparent);
  display: flex; align-items: center; justify-content: center;
}
.fab:hover { background: var(--rlf-red-dark); }

/* ── Utility ─────────────────────────────────────────────── */
.text-red   { color: var(--rlf-red); }
.text-grey  { color: var(--rlf-grey); }
.text-small { font-size: 0.8125rem; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: var(--gap); }
.mt-3 { margin-top: var(--gap-lg); }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: var(--gap); }
.divider { border: none; border-top: 1px solid var(--rlf-border); margin: var(--gap) 0; }
.empty-state { text-align: center; padding: 48px 24px; color: var(--rlf-grey); }
.empty-state svg { margin-bottom: 12px; opacity: 0.4; }
.row { display: flex; gap: var(--gap); align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; }

/* Editable AI suggestion box (Improve card) — the user can tweak the suggested
   text before applying it. */
.sug-editable { cursor: text; outline: none; }
.sug-editable:focus { border-color: var(--rlf-red) !important; box-shadow: 0 0 0 2px var(--accent-ring); }

/* #enhance heading row: heading + description on the left, Explore/completeness
   controls on the right. Stacks vertically on phones so the text isn't squashed
   into a narrow column beside the controls. */
.enhance-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.enhance-head-text { flex: 1; min-width: 0; }
.enhance-head-controls { display: flex; align-items: center; gap: 8px; flex: none; }
@media (max-width: 560px) {
  .enhance-head { flex-direction: column; align-items: stretch; }
  .enhance-head-controls { justify-content: space-between; }
}
.hidden { display: none !important; }

/* ── Login Page ──────────────────────────────────────────── */
.login-page {
  min-height: 100dvh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px; background: var(--rlf-light-grey);
}
.login-brand { text-align: center; margin-bottom: 32px; }
.login-brand-name { font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; color: var(--rlf-dark); display: flex; align-items: center; justify-content: center; gap: 8px; letter-spacing: -0.02em; }
.login-brand-forge { color: var(--rlf-red); }
.login-brand-ideas { color: var(--rlf-dark); }
.login-brand-sub { font-size: 0.875rem; color: var(--rlf-grey); margin-top: 6px; }
.login-card { background: var(--rlf-white); border: 1px solid var(--rlf-border); border-top: 3px solid var(--rlf-red); border-radius: var(--radius); padding: 28px 24px; width: 100%; max-width: 400px; box-shadow: var(--rlf-shadow-md); }
.login-wordmark { display: block; height: 96px; width: auto; margin: 0 auto; }
.login-eyebrow { font-family: var(--font-display); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--rlf-red); margin-bottom: 8px; }
.login-demo { margin-top: 22px; text-align: center; font-size: 0.875rem; color: var(--rlf-grey); }
.login-demo a { color: var(--rlf-red); font-weight: 700; text-decoration: none; border-bottom: 1.5px solid currentColor; }
.login-footer { margin-top: 14px; text-align: center; font-size: 0.75rem; color: var(--ink-muted); }
.login-footer a { color: inherit; }

/* ── Landing Page (legacy in-app page, no longer routed to) ── */
.landing-page {
  min-height: 100dvh; background: var(--rlf-light-grey);
  display: flex; justify-content: center; overflow-x: hidden;
}
.landing-inner { width: 100%; max-width: 720px; padding: 32px 20px 48px; }
.landing-hero { text-align: center; padding: 8px 0 28px; }
.landing-hero .login-brand-name { justify-content: center !important; margin-bottom: 20px; }
.landing-headline {
  font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; color: var(--rlf-dark);
  line-height: 1.2; margin-bottom: 12px; letter-spacing: -0.01em;
}
.landing-subhead { font-size: 0.9375rem; color: var(--rlf-grey); line-height: 1.55; max-width: 520px; margin: 0 auto 24px; }
.landing-cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.landing-cta-row-bottom { margin-top: 8px; }
.landing-section { margin-top: 28px; }
.landing-section-title {
  font-family: var(--font-display); font-size: 0.8125rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--rlf-grey); text-align: center; margin-bottom: 16px;
}
.landing-stepper-wrap { margin-bottom: 16px; pointer-events: none; }
.landing-idea-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.landing-idea-card {
  background: var(--rlf-white); border: 1px solid var(--rlf-border); border-radius: var(--radius);
  padding: 16px 14px; text-align: center;
}
.landing-idea-letter {
  width: 30px; height: 30px; border-radius: 50%; background: var(--rlf-red); color: #fff;
  font-weight: 700; font-size: 0.875rem; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 8px;
}
.landing-idea-word { font-weight: 700; font-size: 0.875rem; color: var(--rlf-dark); margin-bottom: 6px; }
.landing-idea-card p { font-size: 0.8125rem; color: var(--rlf-grey); line-height: 1.45; }
.landing-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.landing-chip {
  background: var(--rlf-white); border: 1px solid var(--rlf-border); border-radius: 999px;
  padding: 6px 14px; font-size: 0.8125rem; color: var(--rlf-dark); font-weight: 500;
}
.landing-trust {
  margin-top: 32px; text-align: center; font-size: 0.8125rem; color: var(--rlf-grey);
  padding: 16px; border-top: 1px solid var(--rlf-border);
}

@media (max-width: 560px) {
  .landing-idea-grid { grid-template-columns: repeat(2, 1fr); }
  .landing-headline { font-size: 1.5rem; }
  .landing-cta-row { flex-direction: column; align-items: stretch; }
  .landing-cta-row .btn { width: 100%; }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (min-width: 640px) {
  .forge-scores { gap: 16px; }
  .decision-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Desktop: bottom nav becomes a left sidebar ──────────── */
@media (min-width: 1024px) {
  body.has-nav { padding-bottom: 0; padding-left: var(--sidebar-w); }
  .bottom-nav {
    top: 0; right: auto; bottom: 0; width: var(--sidebar-w); height: auto;
    flex-direction: column; align-items: stretch; gap: 2px;
    border-top: none; border-right: 1px solid var(--rlf-border);
    padding: 20px 12px 20px;
  }
  .nav-brand {
    display: block; padding: 4px 10px 24px; margin-bottom: 8px;
    border-bottom: 1px solid var(--rlf-border);
  }
  .nav-brand img { display: block; height: 64px; width: auto; }
  .nav-item {
    flex: none; flex-direction: row; justify-content: flex-start; gap: 12px;
    padding: 0 14px; min-height: 46px; border-radius: var(--radius-sm);
    font-size: 0.8125rem; letter-spacing: 0.06em;
  }
  .nav-item::before { top: 8px; bottom: 8px; left: 0; right: auto; width: 3px; height: auto; border-radius: 0 3px 3px 0; }
  .nav-item:hover { background: var(--surface-panel); color: var(--rlf-dark); }
  .nav-item.active { background: var(--accent-tint); color: var(--rlf-red); }
  #logoutNavItem { margin-top: auto; }
  .app-header { padding-left: 32px; padding-right: 32px; }
  .app-header .app-wordmark { display: none !important; }
  .app-header-left:has(.app-title:not([style*="none"])) .app-title { padding-left: 0; border-left: none; }
  .app-content { max-width: 880px; padding: 28px 32px 48px; }
  .toast-container { bottom: 28px; left: calc(50% + var(--sidebar-w) / 2); }
  .sticky-cta { bottom: 16px; }
  .fab { display: none; }
  .filter-chips { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; flex-wrap: wrap; overflow: visible; }
  /* Sheets become centred dialogs on wide screens */
  .bottom-sheet {
    left: 50%; right: auto; bottom: 50%; width: min(560px, calc(100vw - 64px));
    border-radius: 12px; padding: 16px 24px 24px;
    transform: translate(-50%, 60%); opacity: 0; pointer-events: none;
    transition: transform 0.25s cubic-bezier(0.32,0.72,0,1), opacity 0.2s;
    max-height: 80dvh;
  }
  .bottom-sheet.open { transform: translate(-50%, 50%); opacity: 1; pointer-events: auto; box-shadow: var(--rlf-shadow-md); }
  .bottom-sheet-handle { display: none; }
}

/* ── System Console: Model test tab (super_admin, desktop only) ── */
.tl-narrow { display: none; }
@media (max-width: 1023px) {
  #systemNavItem { display: none !important; }
  #reportsNavItem { display: none !important; }
  .sys-console { display: none; }
  .tl-narrow { display: block; }
}
@media (min-width: 1024px) {
  .app-content:has(.sys-console) { max-width: 1440px; }
}
.tl-tabs { display: flex; gap: 6px; margin-bottom: 16px; overflow-x: auto; }
.tl-table-wrap { overflow-x: auto; padding: 0; }
.tl-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.tl-table th { font-family: var(--font-display); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rlf-grey); text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--rlf-border); white-space: nowrap; }
.tl-table td { padding: 10px 14px; border-bottom: 1px solid var(--rlf-border); vertical-align: top; }
.tl-table tbody tr:last-child td { border-bottom: none; }
.tl-table .num { text-align: right; white-space: nowrap; }
.tl-table tbody tr[onclick] { cursor: pointer; }
.tl-table tbody tr[onclick]:hover { background: var(--accent-tint); }
.tl-idea-title { font-weight: 600; color: var(--rlf-dark); }
.tl-summary tr.is-orig td { background: var(--surface-panel); }
.tl-sort { width: auto; }

.tl-card summary { cursor: pointer; }
.tl-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin-top: 12px; }

.tl-grid { width: 100%; border-collapse: collapse; }
.tl-grid th { font-family: var(--font-display); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rlf-grey); text-align: left; padding: 0 8px 8px 0; }
.tl-grid td { padding: 4px 8px 4px 0; }
.tl-grid .chk { text-align: center; width: 120px; }
.tl-grid input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--rlf-red); }
.tl-grid-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; }

.tl-batch { border-top: 1px solid var(--rlf-border); padding: 10px 0 4px; }
.tl-batch-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.tl-pick { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 6px 0; font-size: 0.875rem; cursor: pointer; }
.tl-pick input { width: 18px; height: 18px; accent-color: var(--rlf-red); }
.tl-chip { font-size: 0.6875rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-panel); color: var(--rlf-grey); }
.tl-chip.is-complete { background: rgba(34,197,94,0.12); color: #15803d; }
.tl-chip.is-running  { background: rgba(245,158,11,0.14); color: #b45309; }
.tl-chip.is-failed   { background: rgba(239,68,68,0.1); color: #dc2626; }

.tl-delta { font-size: 0.75rem; font-weight: 700; margin-left: 6px; }
.tl-delta.is-up   { color: #15803d; }
.tl-delta.is-down { color: #dc2626; }
.tl-delta.is-same { color: var(--ink-muted); }

/* Side-by-side columns: scroll inside the box only; column heads stay pinned. */
.tl-compare { display: flex; gap: 12px; overflow: auto; max-height: calc(100dvh - 140px); padding-bottom: 4px; align-items: flex-start; }
.tl-col { flex: 0 0 340px; background: var(--rlf-white); border: 1px solid var(--rlf-border); border-radius: var(--radius); }
.tl-col.is-orig { border-color: var(--rlf-dark); }
.tl-col-head { position: sticky; top: 0; z-index: 1; background: inherit; border-bottom: 1px solid var(--rlf-border); border-radius: var(--radius) var(--radius) 0 0; padding: 10px 14px; }
.tl-col.is-orig .tl-col-head { background: var(--surface-panel); }
.tl-col-model { font-family: var(--font-display); font-weight: 700; font-size: 0.9375rem; color: var(--rlf-dark); margin: 2px 0; word-break: break-word; }
.tl-col-body { padding: 12px 14px; font-size: 0.875rem; line-height: 1.55; color: var(--rlf-dark); }
.tl-col-body p { margin: 0 0 8px; }
.tl-col-foot { border-top: 1px solid var(--rlf-border); padding: 10px 14px 12px; }
.tl-verdict { display: flex; gap: 6px; margin-bottom: 8px; }
.tl-verdict .btn { flex: 1; }
.tl-notes { width: 100%; resize: vertical; font-size: 0.8125rem; }
.tl-total { font-family: var(--font-display); margin-bottom: 8px; }
.tl-total strong { font-size: 1.75rem; }
.tl-total span { color: var(--rlf-grey); }
.tl-p { border-top: 1px solid var(--rlf-border); padding: 6px 0; }
.tl-p summary { display: flex; justify-content: space-between; cursor: pointer; font-weight: 600; }
.tl-p > div { padding-top: 6px; color: var(--rlf-grey); }
.tl-conclusion { font-weight: 600; }
.tl-list { margin: 6px 0; }
.tl-list summary { cursor: pointer; font-weight: 600; font-size: 0.8125rem; }
.tl-list ul { margin: 6px 0 0; padding-left: 18px; font-size: 0.8125rem; color: var(--rlf-grey); }
.tl-list li { margin-bottom: 6px; }
.tl-list a { color: var(--rlf-red); word-break: break-word; }
.tl-error { color: #dc2626; font-size: 0.8125rem; word-break: break-word; }
.tl-wait { display: flex; align-items: center; gap: 10px; color: var(--rlf-grey); }
.tl-wait .spinner { width: 18px; height: 18px; margin: 0; }

/* ── System Console: Health tab ──────────────────────────── */
.sys-summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border-left: 4px solid #15803d; }
.sys-summary.is-warn { border-left-color: #d97706; }
.sys-summary.is-fail { border-left-color: #dc2626; }
.sys-summary-title { font-family: var(--font-display); font-weight: 700; font-size: 1.0625rem; color: var(--rlf-dark); margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.sys-summary-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sys-group h3 { margin-bottom: 4px; }
.sys-check { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--rlf-border); }
.sys-check:first-of-type { border-top: none; }
.sys-check-main { flex: 1; min-width: 0; }
.sys-check-name { font-weight: 600; font-size: 0.875rem; color: var(--rlf-dark); }
.sys-badge { flex: none; display: inline-block; min-width: 64px; text-align: center; font-family: var(--font-display); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em; padding: 3px 8px; border-radius: 999px; background: var(--surface-panel); color: var(--rlf-grey); }
.sys-badge.is-ok   { background: rgba(34,197,94,0.12); color: #15803d; }
.sys-badge.is-warn { background: rgba(245,158,11,0.14); color: #b45309; }
.sys-badge.is-fail { background: rgba(239,68,68,0.1); color: #dc2626; }
.sys-items { margin-top: 6px; }
.sys-items summary { cursor: pointer; font-size: 0.8125rem; font-weight: 600; }
.sys-items ul { margin: 6px 0 0; padding-left: 18px; font-size: 0.8125rem; color: var(--rlf-grey); }
.sys-items li { margin-bottom: 4px; word-break: break-word; }
.sys-log-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sys-log-tools .form-select { width: auto; }
.sys-noise { display: flex; align-items: center; gap: 6px; }
.sys-noise input { accent-color: var(--rlf-red); }
.sys-log { max-height: 480px; overflow: auto; margin: 0; padding: 12px; background: #1E1E1E; color: #d6d6d6; border-radius: var(--radius-sm); font-size: 0.75rem; line-height: 1.5; white-space: pre-wrap; word-break: break-all; }
.sys-log .is-err { color: #ff8a80; }

/* ── System Console: Models in use & Usage tabs ──────────── */
.sys-note { border-left: 4px solid #d97706; font-size: 0.875rem; }
.sys-matrix td { min-width: 170px; }
.sys-matrix td.is-off .sys-model { color: var(--ink-muted); text-decoration: line-through; }
.sys-group-row td { background: var(--surface-panel); font-family: var(--font-display); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rlf-grey); padding-top: 6px; padding-bottom: 6px; }
.sys-th-sub { font-weight: 500; text-transform: capitalize; letter-spacing: 0; color: var(--ink-muted); }
.sys-model { font-weight: 600; color: var(--rlf-dark); }
.sys-src.is-warn { color: #b45309; font-weight: 600; }
.sys-flag { margin-top: 4px; font-size: 0.75rem; color: #b45309; }
.sys-periods { margin-bottom: 12px; }
.sys-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.sys-tile { background: var(--rlf-white); border: 1px solid var(--rlf-border); border-radius: var(--radius); padding: 14px 16px; }
.sys-tile-num { font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; color: var(--rlf-dark); line-height: 1.2; margin: 4px 0 2px; }
.sys-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.sys-two > .card { margin-top: 0; }   /* side by side, so no stacking gap */
.sys-chart { display: grid; grid-template-columns: 48px 1fr; grid-template-rows: 180px auto; column-gap: 8px; }
.sys-chart-axis { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; font-size: 0.6875rem; color: var(--ink-muted); transform: translateY(-0.5em); height: calc(100% + 1em); }
.sys-chart-plot { position: relative; display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--rlf-border); }
.sys-grid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed var(--rlf-border); pointer-events: none; }
.sys-bar-col { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; cursor: default; outline: none; position: relative; }
.sys-bar-col:hover, .sys-bar-col:focus-visible { background: var(--accent-tint); }
.sys-bar { width: min(60%, 36px); background: var(--rlf-red); border-radius: 4px 4px 0 0; }
.sys-chart-x { display: flex; gap: 2px; font-size: 0.6875rem; color: var(--ink-muted); padding-top: 6px; }
.sys-chart-x span { flex: 1; text-align: center; }
.sys-tip { position: absolute; top: 4px; transform: translateX(-50%); background: var(--rlf-dark); color: #fff; font-size: 0.75rem; padding: 6px 10px; border-radius: var(--radius-sm); white-space: nowrap; pointer-events: none; z-index: 2; box-shadow: var(--rlf-shadow-md); }

/* ── Reports: 4Ps map ────────────────────────────────────── */
.rp-chips { margin-bottom: 12px; }
.rp-layout { display: grid; grid-template-columns: minmax(0, 620px) minmax(280px, 1fr); gap: 16px; align-items: start; }
.rp-layout > .card { margin-top: 0; }   /* side by side, so no stacking gap */
.rp-chart-card { padding: 12px; }
.rp-chart { position: relative; }
.rp-chart svg { display: block; width: 100%; height: auto; }
.rp-best { fill: var(--accent-tint); }
.rp-grid { stroke: var(--rlf-border); stroke-width: 1; stroke-dasharray: 3 4; }
.rp-mid { stroke: var(--ink-muted); stroke-width: 1.5; stroke-dasharray: 6 4; }
.rp-axis { stroke: var(--rlf-grey); stroke-width: 1; }
.rp-tick { font-size: 11px; fill: var(--ink-muted); font-family: var(--font-body); }
.rp-axis-title { font-size: 12px; fill: var(--rlf-grey); font-weight: 600; font-family: var(--font-display); }
.rp-quad-label { font-size: 11px; fill: var(--ink-muted); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; font-family: var(--font-display); }
.rp-pt { cursor: pointer; outline: none; }
.rp-hit { fill: transparent; }
.rp-dot { fill: var(--rlf-red); fill-opacity: 0.85; stroke: var(--rlf-white); stroke-width: 2; }
.rp-pt:hover .rp-dot, .rp-pt:focus-visible .rp-dot { fill-opacity: 1; }
.rp-pt.is-selected .rp-dot { fill-opacity: 1; stroke: var(--rlf-dark); stroke-width: 2.5; }
.rp-count { fill: #fff; font-size: 11px; font-weight: 700; font-family: var(--font-display); pointer-events: none; }
.rp-tip { position: absolute; transform: translate(-50%, calc(-100% - 10px)); background: var(--rlf-dark); color: #fff; font-size: 0.75rem; line-height: 1.45; padding: 8px 10px; border-radius: var(--radius-sm); white-space: pre-line; max-width: 320px; width: max-content; pointer-events: none; z-index: 2; box-shadow: var(--rlf-shadow-md); }
.rp-tip.is-right { transform: translate(-90%, calc(-100% - 10px)); }
.rp-tip:not(.is-right) { transform: translate(-10%, calc(-100% - 10px)); }
.rp-side h3 { margin: 0; }
.rp-quad-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--rlf-border); }
.rp-quad-row.is-top .rp-quad-name { color: var(--rlf-red); }
.rp-quad-name { font-weight: 700; font-size: 0.875rem; color: var(--rlf-dark); }
.rp-quad-n { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--rlf-dark); }
.rp-idea { padding: 10px 0; border-top: 1px solid var(--rlf-border); }
.rp-idea-title { font-weight: 600; font-size: 0.875rem; margin-bottom: 4px; }
.rp-idea-title a { color: var(--rlf-dark); text-decoration: underline; text-decoration-color: var(--rlf-border); }
.rp-idea-title a:hover { color: var(--rlf-red); }
.rp-pscores { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 0.75rem; color: var(--rlf-grey); margin-top: 4px; }
.rp-pscores strong { color: var(--rlf-dark); }
.tl-table tr.is-selected td { background: var(--accent-tint); }

/* ── Passwords & account ─────────────────────────────────── */
.login-forgot { margin-top: 14px; text-align: center; }
.link-btn {
  background: none; border: none; padding: 4px 2px; cursor: pointer;
  font-family: var(--font-body); font-size: 0.875rem; font-weight: 600;
  color: var(--rlf-red); text-decoration: underline; text-underline-offset: 3px;
}
.login-forgot-panel { margin-top: 16px; padding-top: 18px; border-top: 1px solid var(--rlf-border); }
.forgot-sent {
  margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: #E7F6EC; color: #14532d; font-size: 0.875rem; line-height: 1.5; overflow-wrap: anywhere;
}
.pw-wrap { position: relative; }
.pw-wrap .form-input { padding-right: 72px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  min-height: 36px; padding: 0 10px; border: none; background: none; cursor: pointer;
  font-family: var(--font-display); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--rlf-grey);
}
.pw-checklist { list-style: none; margin: -4px 0 18px; padding: 0; font-size: 0.8125rem; color: var(--rlf-grey); }
.pw-checklist li { display: flex; gap: 8px; align-items: baseline; padding: 2px 0; line-height: 1.45; }
.pw-checklist li[data-check]::before { content: '○'; flex: none; width: 1em; text-align: center; color: var(--ink-muted); }
.pw-checklist li.ok { color: #15803d; }
.pw-checklist li.ok::before { content: '✓'; color: #15803d; font-weight: 700; }
.pw-checklist .pw-note { margin-top: 4px; font-size: 0.75rem; color: var(--ink-muted); }
.pw-error {
  margin: -6px 0 16px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--accent-tint); color: var(--rlf-red-dark); font-size: 0.8125rem; line-height: 1.5;
}
.account-stack { display: grid; gap: var(--gap); max-width: 760px; }
.account-stack > .card, .account-stack > .accordion { margin-top: 0; }   /* the grid gap spaces them */
.account-details { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; align-items: baseline; }
.account-details dt { font-family: var(--font-display); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rlf-grey); }
.account-details dd { margin: 0; overflow-wrap: anywhere; font-family: var(--font-display); font-size: 1rem; font-weight: 600; color: var(--rlf-dark); letter-spacing: -0.01em; }
.account-pw .accordion-header { text-align: left; gap: 12px; padding: 16px var(--gap); }
.account-pw-sub { display: block; margin-top: 2px; font-size: 0.8125rem; color: var(--rlf-grey); font-weight: 400; }
.account-pw .accordion-icon { font-size: 1.25rem; line-height: 1; }
.account-idea-count {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 5px 12px; border-radius: 999px; background: var(--accent-tint); color: var(--rlf-red);
  font-family: var(--font-display); font-size: 0.8125rem; font-weight: 700;
}
.badge-user-active     { background: #E7F6EC; color: #15803d; }
.badge-user-pending    { background: #E6EEFD; color: #1d4ed8; }
.badge-user-expired    { background: #FDF1DC; color: #b45309; }
.badge-user-mustchange { background: #FDF1DC; color: #b45309; }
.badge-user-inactive   { background: #F1F0EE; color: #6b7280; }
.badge[class*="badge-user-"] { text-transform: none; }
/* Users list on phones: details full width, actions in a wrapping row below */
@media (max-width: 560px) {
  .user-row { flex-direction: column; align-items: stretch; }
  .user-row-actions { flex-direction: row !important; flex-wrap: wrap; }
  .user-row-actions > * { flex: 1 1 auto; max-width: none !important; }
}

/* Admin → Audit on phones: each run becomes a small labelled card instead of
   a six-column table (inline table styles are overridden here). */
@media (max-width: 640px) {
  .audit-summary { grid-template-columns: repeat(2, 1fr) !important; row-gap: 16px !important; }
  .audit-table thead { display: none; }
  .audit-table, .audit-table tbody { display: block; }
  .audit-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; padding: 14px 16px; }
  .audit-table td { display: block; padding: 0 !important; text-align: left !important; max-width: none !important; min-width: 0; overflow-wrap: anywhere; }
  .audit-table td.audit-idea { grid-column: 1 / -1; white-space: normal !important; overflow: visible !important; font-family: var(--font-display); font-weight: 700; font-size: 0.9375rem; color: var(--rlf-dark); }
  .audit-table td.audit-idea .text-small { font-family: var(--font-body); font-weight: 400; margin-top: 2px; }
  .audit-table td.audit-stage, .audit-table td.audit-model { grid-column: 1 / -1; }
  .audit-table td.audit-stage div { max-width: none !important; white-space: normal !important; }
  .audit-table td[data-label]::before {
    content: attr(data-label); display: block; margin-bottom: 3px;
    font-family: var(--font-display); font-size: 0.625rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-muted);
  }
  .audit-table td[colspan] { grid-column: 1 / -1; text-align: center !important; padding: 12px 0 !important; }
}

/* Idea Bank: who created each idea (initials), and the tools row on phones */
.bank-owner {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  min-width: 26px; height: 26px; padding: 0 6px; border-radius: 999px;
  background: var(--surface-panel); color: var(--rlf-grey);
  font-family: var(--font-display); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em;
}
.bank-owner.mine { background: var(--accent-tint); color: var(--rlf-red); }
@media (max-width: 560px) {
  .bank-tools { flex-wrap: wrap; }
  .bank-tools #sessionSearch { flex: 1 1 100% !important; }
  .bank-tools .form-select { flex: 1 1 0 !important; min-width: 0; }
}

/* ── Tags (Idea Bank + Admin → Tags) — always the workspace colour ── */
.tag-chip { display: inline-flex; align-items: center; max-width: 100%; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; line-height: 1.4; color: var(--rlf-red); background: var(--accent-tint); border: 1px solid var(--accent-tint-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.idea-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.idea-tags:empty { display: none; }
button.tag-pick { font-family: inherit; cursor: pointer; min-height: 32px; padding: 5px 12px; font-size: 0.8125rem; }
button.tag-pick:hover { border-color: var(--rlf-red); }
button.tag-pick.is-on { background: var(--rlf-red); border-color: var(--rlf-red); color: #fff; }
button.tag-pick:disabled { opacity: 0.6; cursor: wait; }
.tag-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -6px 0 16px; }
.tag-filter-label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-muted); margin-right: 2px; }
.tag-filter-clear { background: none; border: 0; padding: 6px 4px; font: inherit; font-size: 0.8125rem; color: var(--ink-muted); text-decoration: underline; cursor: pointer; }
.tag-editor { margin-top: 12px; padding: 12px; border-radius: 10px; background: var(--accent-tint); border: 1px solid var(--accent-tint-2); cursor: default; }
.tag-editor[hidden] { display: none; }
.tag-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; font-size: 0.8125rem; color: var(--rlf-dark); }
.tag-editor-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-editor .tag-pick:not(.is-on) { background: #fff; }
.tag-admin-list { display: flex; flex-direction: column; gap: 8px; }
.tag-admin-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tag-admin-row .form-input { flex: 1 1 200px; min-width: 0; }
.tag-admin-count { min-width: 64px; }
.tag-admin-actions { display: inline-flex; gap: 4px; margin-left: auto; }

/* ── Reports → Who it's for / Problems (report_themes.js) ── */
.th-runbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.th-runbar .btn { margin-left: auto; }
.th-stale { font-size: 0.75rem; font-weight: 600; color: var(--rlf-red); background: var(--accent-tint); border-radius: 999px; padding: 3px 10px; }
.th-summary { margin-bottom: 16px; }
.th-summary p { margin: 0; font-size: 0.9375rem; line-height: 1.6; color: var(--rlf-dark); }
.th-label { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 4px; }
.th-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 16px; align-items: start; }
.th-layout > .card, .th-layout > div > .card { margin-top: 0; }
.th-cat + .th-cat { margin-top: 16px; }
.th-theme { border-top: 1px solid var(--rlf-border); padding: 8px 0; }
.th-theme-head, .th-cat-row { display: grid; grid-template-columns: minmax(140px, 220px) 1fr 32px 64px; align-items: center; gap: 12px; width: 100%; background: none; border: 0; padding: 6px 4px; font: inherit; text-align: left; cursor: pointer; border-radius: 6px; color: var(--rlf-dark); }
.th-cat-row { grid-template-columns: minmax(110px, 160px) 1fr 28px; }
.th-theme-head:hover, .th-cat-row:hover, .th-cat-row.is-on, .th-theme.is-open .th-theme-head { background: var(--accent-tint); }
.th-theme-name { font-weight: 700; font-size: 0.875rem; }
.th-cat-name { font-size: 0.8125rem; }
.th-bar { height: 10px; background: color-mix(in srgb, var(--rlf-border) 60%, #fff); border-radius: 999px; overflow: hidden; }
.th-bar i { display: block; height: 100%; background: var(--rlf-red); border-radius: 999px; }
.th-cat-row.is-on .th-cat-name { font-weight: 700; color: var(--rlf-red); }
.th-n { font-family: var(--font-display); font-weight: 700; text-align: right; }
.th-avg { font-family: var(--font-display); font-weight: 700; text-align: right; line-height: 1.1; }
.th-avg small { display: block; font-family: var(--font-body); font-weight: 400; font-size: 0.6875rem; color: var(--ink-muted); }
.th-desc { padding: 0 4px 4px; }
.th-ideas { margin: 6px 4px 4px; border-left: 3px solid var(--accent-tint-2); padding-left: 12px; }
.th-idea { display: grid; grid-template-columns: 1fr auto 80px; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--rlf-border); }
.th-idea:first-child { border-top: 0; }
.th-score { text-align: right; font-size: 0.8125rem; color: var(--rlf-grey); }
.th-score strong { color: var(--rlf-dark); }

/* ── Workspace switcher (super_admin; workspace_switch.js) ── */
#headerActions { display: flex; align-items: center; gap: 8px; }
.ws-pill { display: inline-flex; align-items: center; gap: 6px; max-width: 46vw; height: 32px; padding: 0 10px 0 12px; border-radius: 999px; border: 1px solid var(--rlf-border); background: var(--rlf-white); color: var(--rlf-dark); font: inherit; font-size: 0.8125rem; cursor: pointer; }
.ws-pill:hover { border-color: var(--rlf-red); }
.ws-pill.is-away { border-color: var(--rlf-red); background: var(--accent-tint); color: var(--rlf-red); }
.ws-pill-label { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-muted); }
.ws-pill.is-away .ws-pill-label { color: inherit; opacity: 0.75; }
.ws-pill-name { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-pill svg { flex: none; }
.ws-banner { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 8px var(--gap); background: var(--rlf-red); color: #fff; font-size: 0.8125rem; text-align: center; }
.ws-banner strong { color: #fff; }
.ws-banner button { background: #fff; color: var(--rlf-red); border: 0; border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 0.75rem; font-weight: 700; cursor: pointer; }
.ws-menu { position: fixed; top: calc(52px + env(safe-area-inset-top)); right: 12px; z-index: 300; width: min(320px, calc(100vw - 24px)); max-height: 70vh; overflow-y: auto; background: var(--rlf-white); border: 1px solid var(--rlf-border); border-radius: 12px; box-shadow: var(--rlf-shadow-md); padding: 6px 0; }
.ws-menu-head { padding: 8px 14px; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); }
.ws-menu-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 14px; background: none; border: 0; font: inherit; font-size: 0.9375rem; text-align: left; color: var(--rlf-dark); cursor: pointer; }
.ws-menu-item:hover:not(:disabled) { background: var(--accent-tint); }
.ws-menu-item:disabled { cursor: default; font-weight: 700; }
.ws-menu-item > span:first-child { flex: 1; min-width: 0; }
.ws-tag { flex: none; font-size: 0.6875rem; font-weight: 700; border-radius: 999px; padding: 2px 8px; background: var(--rlf-light-grey); color: var(--rlf-grey); }
.ws-tag.is-cur { background: var(--accent-tint); color: var(--rlf-red); }
.ws-menu-foot { padding: 8px 14px 6px; border-top: 1px solid var(--rlf-border); margin-top: 4px; font-size: 0.75rem; color: var(--ink-muted); line-height: 1.45; }
@media (max-width: 560px) { .ws-pill-label { display: none; } body.has-ws-pill .app-logo-mark { display: none !important; } }

/* ── Persona avatars: library icons, picker, question askers, field owners ── */
.evaluator-avatar .av-lib { width: 100%; height: 100%; display: block; }
.evaluator-avatar:has(.av-lib) { background: none; border: 0; }
.evaluator-avatar.xs { width: 22px; height: 22px; font-size: 0.6875rem; }
.config-item-title { display: flex; align-items: center; gap: 8px; }
.config-item-avatar { display: inline-flex; flex: none; }
.av-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.av-pick { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px 6px; border: 1px solid var(--rlf-border); border-radius: 8px; background: var(--rlf-white); font: inherit; cursor: pointer; }
.av-pick:hover { border-color: var(--rlf-red); }
.av-pick.is-on { border-color: var(--rlf-red); background: var(--accent-tint); box-shadow: inset 0 0 0 1px var(--rlf-red); }
.av-pick .evaluator-avatar.sm { width: 36px; height: 36px; }
.av-pick-label { font-size: 0.6875rem; color: var(--rlf-grey); text-align: center; line-height: 1.2; }
.q-asker { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; text-transform: none; letter-spacing: normal; }
.q-asker-text { min-width: 0; line-height: 1.25; }
.q-asker-name { font-weight: 700; font-size: 0.8125rem; color: var(--rlf-dark); }
.q-asker-field { font-size: 0.75rem; color: var(--ink-muted); }
.field-owner { display: inline-flex; flex: none; margin-right: 6px; }
.field-label-left { display: flex; align-items: center; }

/* ── Persona scope + ownership hints (Admin → AI Config persona form) ── */
.persona-scope { display: grid; gap: 8px; }
.persona-scope-opt { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--rlf-border); border-radius: 8px; cursor: pointer; font-size: 0.875rem; line-height: 1.4; }
.persona-scope-opt:has(input:checked) { border-color: var(--rlf-red); background: var(--accent-tint); }
.persona-scope-opt input { margin-top: 3px; flex: none; }
.persona-warn { margin-top: 8px; padding: 8px 10px; border-radius: 6px; background: #FEF3C7; color: #92400E; font-size: 0.8125rem; line-height: 1.4; }
.field-map-owner { margin-left: auto; font-size: 0.6875rem; color: var(--ink-muted); text-align: right; }

/* Share button after the PDF is built but the browser needed a fresh tap */
#btnShareCard.is-ready { background: var(--rlf-red); border-color: var(--rlf-red); color: #fff; }

/* ── Sparks backlog (sparks.js) + Capture hooks ── */
.sp-card { margin-bottom: 12px; }
.sp-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.sp-chip { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--rlf-red); background: var(--accent-tint); border-radius: 999px; padding: 3px 9px; }
.sp-chip-warn { color: #92400E; background: #FEF3C7; }
.sp-date { margin-left: auto; font-size: 0.75rem; color: var(--ink-muted); }
.sp-main { display: flex; gap: 14px; align-items: flex-start; }
.sp-thumb { flex: none; width: 84px; height: 84px; border-radius: 8px; overflow: hidden; border: 1px solid var(--rlf-border); background: var(--rlf-light-grey); }
.sp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-body { min-width: 0; flex: 1; }
.sp-title { margin: 0 0 6px; font-size: 1rem; }
.sp-line { font-size: 0.875rem; line-height: 1.5; color: var(--rlf-dark); margin-bottom: 4px; }
.sp-k { display: block; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-muted); }
.sp-text { font-size: 0.875rem; line-height: 1.5; color: var(--rlf-dark); white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden; }
.sp-from { margin-top: 6px; font-size: 0.75rem; color: var(--ink-muted); }
.sp-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--rlf-border); }
.sp-reading { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.sp-reading .spinner { flex: none; }
.sp-save { margin-top: 6px; }
.sp-save.is-saved { color: var(--rlf-red); border-color: var(--rlf-red); background: var(--accent-tint); }
.sp-paper-link { display: inline-flex; align-items: center; gap: 8px; margin: 10px 0 4px; padding: 6px 2px; background: none; border: 0; font: inherit; font-size: 0.875rem; font-weight: 600; color: var(--rlf-red); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.sp-photo-note { margin: 6px 0 12px; font-size: 0.8125rem; border-left: 3px solid var(--rlf-red); }

/* ── On/off switch (Admin → Models → Image generation) ── */
.img-switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; flex: none; font-weight: 700; font-size: 0.875rem; color: var(--rlf-dark); }
.img-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.img-switch-track { position: relative; width: 44px; height: 26px; border-radius: 999px; background: var(--rlf-border); transition: background 0.15s; }
.img-switch-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.2); transition: transform 0.15s; }
.img-switch input:checked + .img-switch-track { background: var(--rlf-red); }
.img-switch input:checked + .img-switch-track::after { transform: translateX(18px); }
.img-switch input:focus-visible + .img-switch-track { outline: 2px solid var(--rlf-red); outline-offset: 2px; }
.img-switch.is-disabled { opacity: 0.5; cursor: not-allowed; }

/* Follow-up questions panel: avatars of everyone asking this round, overlapped */
.panel-avatars { display: flex; flex: none; }
.panel-avatars .evaluator-avatar + .evaluator-avatar { margin-left: -10px; box-shadow: 0 0 0 2px var(--rlf-white); }

/* ── System → Health → Screen tests (screen_tests.js) ── */
.st-history { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.st-run { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--rlf-border); border-radius: 8px; background: var(--rlf-white); font: inherit; font-size: 0.8125rem; cursor: pointer; }
.st-run.is-on { border-color: var(--rlf-red); box-shadow: inset 0 0 0 1px var(--rlf-red); }
.st-summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.st-results { display: flex; flex-direction: column; gap: 8px; }
.st-result { border: 1px solid var(--rlf-border); border-radius: 8px; padding: 10px 12px; }
.st-result.is-fail { border-color: rgba(239,68,68,0.35); background: rgba(239,68,68,0.03); }
.st-result-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.st-detail { margin-top: 6px; color: var(--rlf-dark); }
.st-shot { display: block; margin-top: 8px; max-width: 320px; max-height: 240px; border: 1px solid var(--rlf-border); border-radius: 6px; cursor: zoom-in; background: var(--rlf-light-grey); }

/* ── Innovation Profiles (profiles.js; Review recommended sections; Model test lens) ── */
.pf-current { margin: 10px 0; padding: 10px 12px; border-left: 3px solid var(--rlf-red); background: var(--rlf-off-white, #f8f7f5); border-radius: 0 6px 6px 0; }
.pf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 10px 0; }
.pf-block { margin: 10px 0; }
.pf-block-title { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rlf-grey); margin-bottom: 4px; }
.pf-text { font-size: 0.8125rem; line-height: 1.5; white-space: pre-line; }
.pf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-chip { display: inline-block; padding: 3px 9px; border: 1px solid var(--rlf-border); border-radius: 999px; font-size: 0.75rem; color: var(--rlf-grey); background: var(--rlf-white); }
.pf-chip.is-rec { border-color: var(--rlf-red); color: var(--rlf-red); font-weight: 600; }
.pf-details { margin-top: 8px; }
.pf-details summary { cursor: pointer; font-size: 0.8125rem; font-weight: 600; color: var(--rlf-grey); }
.pf-list { display: flex; flex-direction: column; gap: 8px; }
.pf-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--rlf-border); border-radius: 8px; background: var(--rlf-white); }
.pf-row.is-open { border-color: var(--rlf-red); }
.pf-editor { padding: 14px; border: 1px solid var(--rlf-border); border-top: none; border-radius: 0 0 8px 8px; margin-top: -8px; background: var(--rlf-white); }
.pf-editor .form-textarea { font-size: 0.8125rem; line-height: 1.45; }
.pf-h { font-size: 0.875rem; margin: 14px 0 8px; }
.pf-sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px 20px; }
.pf-sec { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.8125rem; }
.pf-sec > span { flex: 1; min-width: 0; }
.pf-sec .form-select { flex: 0 0 170px; width: 170px; padding-top: 4px; padding-bottom: 4px; }
.pf-modes { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.pf-mode { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8125rem; cursor: pointer; }
.pf-oldnote { padding: 8px 10px; margin-bottom: 12px; border-radius: 6px; background: #fff7e6; font-size: 0.8125rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pf-history { display: flex; flex-direction: column; gap: 4px; }
.pf-hist-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 6px 8px; border-radius: 6px; }
.pf-hist-row.is-on { background: var(--rlf-off-white, #f8f7f5); }
.rv-rec { position: relative; padding-left: 20px; }
.rv-rec::before, .rv-rec-dot { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--rlf-red); }
.rv-rec::before { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); }
.rv-rec-legend { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--rlf-grey); margin: -2px 0 8px; }
.rv-run-profile { font-size: 0.75rem; color: var(--rlf-grey); margin-bottom: 6px; }
.rv-illustrative { font-size: 0.6875rem; font-weight: 600; color: #8a5a00; margin-top: 3px; }
.tl-lens { font-weight: 500; color: var(--rlf-grey); }
.pf-row.is-retired { opacity: 0.65; }
.pf-retire { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--rlf-border); }
.pf-new { border-color: var(--rlf-red); }
.rv-routes-row { gap: 12px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--rlf-border); }
.rv-routes-row #btnReviewRoutes { flex-shrink: 0; }

/* ── Persona avatar images (avatar_images.js) ── */
.ai-lib { display: flex; flex-direction: column; gap: 8px; }
.ai-lib-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--rlf-border); border-radius: 8px; background: var(--rlf-white); flex-wrap: wrap; }
.ai-lib-item .evaluator-avatar { width: 44px; height: 44px; flex-shrink: 0; overflow: hidden; }
.ai-lib-item .evaluator-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ai-lib-name { font-weight: 600; overflow-wrap: anywhere; }
.ai-lib-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.av-pick-upload .evaluator-avatar { background: transparent; border: 1.5px dashed var(--rlf-border); color: var(--rlf-grey); }
.av-crop-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, 0.5); display: flex; align-items: center; justify-content: center; padding: 16px; }
.av-crop { background: var(--rlf-white); border-radius: 12px; padding: 18px; width: 100%; max-width: 360px; max-height: calc(100vh - 32px); overflow-y: auto; }
.av-crop-stage { position: relative; width: 100%; max-width: 280px; aspect-ratio: 1; margin: 0 auto; overflow: hidden; border-radius: 8px; background: #eee; touch-action: none; }
.av-crop-stage canvas { width: 100%; height: 100%; display: block; cursor: grab; }
.av-crop-stage canvas:active { cursor: grabbing; }
.av-crop-ring { position: absolute; inset: 0; z-index: 1; border-radius: 50%; pointer-events: none;
  /* exactly the saved circle: a white outline just inside it (dark edge so it shows on light images too),
     and grey shading outside it — visible on top of any image */
  box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 3px rgba(0, 0, 0, 0.55), 0 0 0 999px rgba(120, 120, 120, 0.65); }
/* 4Ps score tiles: the owning persona's avatar beside the P (review.js) */
.score-tile-top { align-items: center; }
.score-tile-label { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.score-tile-label .evaluator-avatar.xs { width: 22px; height: 22px; }
.score-tile-label > span { white-space: nowrap; }
.score-tile-bottom { display: flex; align-items: center; gap: 8px; }
.score-tile-bottom .seg-bar { flex: 1; min-width: 0; }
.score-tile-bottom strong { font-family: var(--font-display); font-size: 0.9375rem; color: var(--rlf-dark); white-space: nowrap; }

/* ── Workspace set-up guide (setup_guide.js) ── */
.sg-card { border-left: 3px solid var(--rlf-red); }
.sg-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.sg-step { display: flex; gap: 14px; align-items: flex-start; }
.sg-step-num { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--rlf-red); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); }
.sg-step-body { min-width: 0; flex: 1; }
.sg-step-body h3 { margin: 2px 0 6px; }
.sg-add-url { display: flex; gap: 8px; margin: 8px 0 12px; }
.sg-add-url .form-input { flex: 1; min-width: 0; }
.sg-docs { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.sg-doc { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--rlf-border); border-radius: 8px; cursor: pointer; overflow-wrap: anywhere; }
.sg-doc input { margin-top: 3px; accent-color: var(--rlf-red); }
.sg-note { background: var(--surface-panel, #f6f5f3); padding: 8px 10px; border-radius: 6px; }
.sg-busy { display: flex; gap: 12px; align-items: center; }
.sg-error { border-left: 3px solid var(--rlf-red); margin-bottom: 12px; }
.sg-h { margin: 18px 0 8px; font-size: 0.9375rem; }
.sg-block { border: 1px solid var(--rlf-border); border-radius: 8px; padding: 12px; margin-bottom: 10px; background: var(--rlf-white); }
.sg-block .form-textarea { margin-top: 8px; font-size: 0.8125rem; line-height: 1.5; }
.sg-tick { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.sg-tick input { width: 18px; height: 18px; accent-color: var(--rlf-red); }
.sg-current { margin-top: 6px; }
.sg-current summary { cursor: pointer; font-size: 0.8125rem; color: var(--rlf-grey); font-weight: 600; }
.sg-current > div { margin-top: 6px; white-space: pre-line; color: var(--rlf-grey); }
.sg-title { font-weight: 600; padding: 4px 8px; }
.sg-persona-head { display: flex; gap: 10px; align-items: center; }
.sg-persona-head .sg-title { flex: 1; min-width: 0; }
.sg-persona-sum { margin-top: 6px; }
.sg-persona-action { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sg-persona-action .form-select { flex: 1; min-width: 200px; max-width: 100%; }
.sg-grid-wrap { overflow-x: auto; margin-bottom: 12px; }
.sg-grid { border-collapse: collapse; font-size: 0.8125rem; min-width: 100%; }
.sg-grid th, .sg-grid td { border-bottom: 1px solid var(--rlf-border); padding: 6px 8px; text-align: center; }
.sg-grid th { white-space: nowrap; font-size: 0.75rem; }
.sg-grid th:first-child, .sg-grid td:first-child { text-align: left; }
@media (max-width: 560px) { .sg-grid th, .sg-grid td { padding: 6px 3px; } .sg-grid td:first-child { font-size: 0.75rem; } }
.sg-grid input { width: 18px; height: 18px; accent-color: var(--rlf-red); }
.sg-apply { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rlf-border); }

/* Review: assessed-with notice and whole-idea persona reviews (review.js) */
.rv-assessed-note { font-size: 0.8125rem; line-height: 1.5; padding: 10px 12px; margin-bottom: 12px; border-left: 3px solid #d97706; background: #fff8eb; border-radius: 0 6px 6px 0; }
.rv-pr-ps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }

/* Copy personas from another workspace (persona_copy.js) */
.pc-panel { border: 1px solid var(--rlf-red); border-radius: 8px; padding: 12px; margin-bottom: 12px; background: var(--rlf-white); }
.pc-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.pc-item { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border: 1px solid var(--rlf-border); border-radius: 8px; cursor: pointer; }
.pc-item input { width: 18px; height: 18px; accent-color: var(--rlf-red); flex-shrink: 0; }
.pc-check { border-left: 3px solid #d97706; background: #fff8eb; padding: 8px 10px; border-radius: 0 6px 6px 0; }
.pc-check .text-small { margin-top: 3px; line-height: 1.45; }

/* Card headings with action buttons: the text keeps a sensible width and the
   buttons drop onto their own line on narrow screens (Admin → AI Config). */
.card-head-wrap { flex-wrap: wrap; gap: 10px 12px; align-items: flex-start; }
.card-head-wrap > div:first-child { flex: 1 1 260px; min-width: 0; }
@media (max-width: 560px) { .card-head-wrap > :last-child:not(:first-child) { flex: 1 1 100%; justify-content: flex-start !important; } }
/* Model test: web search engine choice under the Web tick box (test.js) */
.tl-engine { display: block; margin: 6px auto 0; width: auto; max-width: 130px; font-size: 0.75rem; padding: 3px 6px; }

/* ── 4Ps score overrides (Review, Idea Bank, Reports) ── */
.ov-mark { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--rlf-red); color: #fff; flex: none; vertical-align: middle; }
.ov-mark.sm { width: 15px; height: 15px; margin-left: 4px; }
.ov-mark.sm svg { width: 9px; height: 9px; }
.score-tile-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.ov-btn { display: inline-flex; align-items: center; gap: 6px; }
.ov-box { background: var(--accent-tint); border: 1px solid var(--accent-ring); border-radius: var(--radius); padding: 10px 12px; }
.ov-box-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ov-was { font-size: 0.8125rem; color: var(--rlf-grey); }
.ov-moved { margin-top: 6px; font-size: 0.8125rem; color: var(--status-needs); font-weight: 600; }
.ov-reason { margin-top: 6px; font-family: var(--font-display); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--rlf-red-dark); }
.ov-note { margin-top: 2px; font-size: 0.875rem; line-height: 1.5; color: var(--rlf-dark); white-space: pre-wrap; }
.ov-by { margin-top: 4px; font-size: 0.75rem; color: var(--ink-muted); }
.ov-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.ov-history { margin-top: 8px; border-top: 1px solid var(--accent-ring); padding-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.ov-score-row { display: flex; align-items: center; gap: 12px; }
.ov-score-row input[type="range"] { flex: 1; min-width: 0; accent-color: var(--rlf-red); }
.ov-score-row .form-input { width: 76px; flex: none; text-align: center; }

/* ── Deep research (Review) ── */
.dr-panel { margin-bottom: 10px; }
.dr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .dr-grid { grid-template-columns: 1fr; } }
.dr-sec { margin-top: 10px; }
.dr-text { white-space: pre-wrap; line-height: 1.55; margin-top: 2px; }
.dr-list { margin: 4px 0 0 18px; display: flex; flex-direction: column; gap: 4px; }
.dr-sources { margin: 4px 0 0 20px; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.dr-brief { margin-top: 12px; }
.dr-brief pre { white-space: pre-wrap; font-size: 0.75rem; background: var(--surface-panel); padding: 10px; border-radius: var(--radius-sm); max-height: 360px; overflow: auto; }

/* ── Splash video (phones, signed out — assets/js/views/splash.js) ── */
.splash { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; background: #D8D8D7; transition: opacity 0.4s ease; }
.splash.splash-out { opacity: 0; pointer-events: none; }
.splash-video { width: 100%; height: auto; max-height: 100%; display: block; -webkit-mask-image: linear-gradient(transparent, #000 9%, #000 91%, transparent); mask-image: linear-gradient(transparent, #000 9%, #000 91%, transparent); }
.splash-skip { position: absolute; left: 0; right: 0; bottom: calc(24px + env(safe-area-inset-bottom)); text-align: center; font-size: 0.8125rem; color: rgba(0, 0, 0, 0.45); }
