/* ScaleQor component styles — built on scaleqor-tokens.css custom properties only. */

*, *::before, *::after { box-sizing: border-box; }
body { font-size: var(--text-base); }
img { max-width: 100%; }
.scq-container { max-width: 1180px; margin: 0 auto; padding: 0 var(--space-6); }

/* ---------- Buttons ---------- */
.scq-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  font-family: var(--font-display); font-weight: var(--weight-medium); font-size: var(--text-base);
  border-radius: var(--radius-md); border: 1px solid transparent; cursor: pointer;
  height: 40px; padding: 0 var(--space-5); line-height: 1; text-decoration: none;
  transition: background-color var(--duration-fast) var(--ease-calm), color var(--duration-fast) var(--ease-calm), border-color var(--duration-fast) var(--ease-calm);
  white-space: nowrap;
}
.scq-btn:disabled { opacity: .55; cursor: not-allowed; }
.scq-btn-lg { height: 48px; font-size: var(--text-md); padding: 0 var(--space-6); }
.scq-btn-sm { height: 32px; font-size: var(--text-sm); padding: 0 var(--space-4); }
.scq-btn-block { width: 100%; }
.scq-btn-primary { background: var(--interactive); color: var(--white); }
.scq-btn-primary:hover:not(:disabled) { background: var(--interactive-hover); }
.scq-btn-primary:active:not(:disabled) { background: var(--interactive-active); }
.scq-btn-ondark { background: var(--charcoal-700); color: var(--dark-text-body); border-color: var(--dark-border); }
.scq-btn-ondark:hover:not(:disabled) { background: var(--violet-600); color: var(--white); }
.scq-btn-ghost { background: transparent; color: var(--interactive); border-color: var(--border-strong); }
.scq-btn-ghost:hover:not(:disabled) { background: var(--violet-50); }
.scq-btn-text { background: transparent; color: var(--interactive); height: auto; padding: 0; border: none; font-size: var(--text-sm); }
.scq-btn-text:hover:not(:disabled) { color: var(--interactive-hover); text-decoration: underline; }
.scq-btn-text.scq-btn-danger-text { color: var(--error); }
.scq-btn-danger { background: transparent; color: var(--error); border-color: rgba(226,122,108,.4); }
.scq-btn-danger:hover:not(:disabled) { background: var(--error-bg); }

/* ---------- Cards ---------- */
.scq-card {
  background: var(--surface-card); border: 1px solid var(--border-thin); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: var(--space-6);
}
.scq-card-dark {
  background: var(--dark-surface-card); border: 1px solid var(--dark-border); border-radius: var(--radius-lg);
  padding: var(--space-6); color: var(--dark-text-body);
}
.scq-card-dark h2, .scq-card-dark h3 { color: var(--white); }

/* ---------- Forms ---------- */
.scq-field { display: flex; flex-direction: column; gap: var(--space-1); margin-bottom: var(--space-4); }
.scq-label { font-family: var(--font-display); font-weight: var(--weight-medium); font-size: var(--text-sm); color: var(--text-body); }
.scq-card-dark .scq-label { color: var(--dark-text-body); }
.scq-input, .scq-select {
  font-family: var(--font-body); font-size: var(--text-base); color: var(--text-body);
  background: var(--white); border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  height: 44px; padding: 0 var(--space-4); width: 100%;
}
.scq-input:focus, .scq-select:focus { outline: none; box-shadow: var(--shadow-focus); border-color: var(--interactive); }
.scq-input.is-invalid { border-color: var(--error); }
.scq-card-dark .scq-input, .scq-card-dark .scq-select {
  background: var(--charcoal-900); border-color: var(--dark-border); color: var(--dark-text-body);
}
.scq-select-ondark, .scq-input-ondark {
  background: var(--charcoal-900); border-color: var(--dark-border); color: var(--dark-text-body);
}
.scq-password-wrap { position: relative; }
.scq-password-wrap .scq-input { padding-right: 44px; }
.scq-password-toggle {
  position: absolute; top: 0; right: 0; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; padding: 0; cursor: pointer; color: var(--text-muted);
}
.scq-password-toggle:hover { color: var(--text-body); }
/* PR #318. The Account page's change-password fields sit on a dark card, where the light-theme greys vanish. */
.scq-card-dark .scq-password-toggle { color: var(--dark-text-muted); }
.scq-card-dark .scq-password-toggle:hover { color: var(--dark-text-body); }
.scq-password-toggle .scq-eye-closed { display: none; }
.scq-password-toggle.is-visible .scq-eye-open { display: none; }
.scq-password-toggle.is-visible .scq-eye-closed { display: block; }
.scq-hint { font-size: var(--text-xs); color: var(--text-muted); }
.scq-hint.is-invalid { color: var(--error); }
.scq-card-dark .scq-hint { color: var(--dark-text-muted); }
.scq-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.scq-checkbox-row { display: flex; align-items: flex-start; gap: var(--space-2); font-size: var(--text-sm); color: var(--text-muted); }
.scq-checkbox-row input { margin-top: 3px; }

.scq-switch { position: relative; display: inline-flex; align-items: center; width: 40px; height: 22px; flex: none; }
.scq-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.scq-switch-track { position: absolute; inset: 0; background: var(--border-strong); border-radius: var(--radius-full); transition: background var(--duration-fast) var(--ease-calm); }
.scq-switch-thumb { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--white); box-shadow: var(--shadow-sm); transition: transform var(--duration-fast) var(--ease-calm); }
.scq-switch input:checked ~ .scq-switch-track { background: var(--interactive); }
.scq-switch input:checked ~ .scq-switch-thumb { transform: translateX(18px); }
.scq-card-dark .scq-switch-track { background: var(--charcoal-700); }

/* ---------- Badges / pills ---------- */
.scq-pill {
  display: inline-flex; align-items: center; gap: 6px; border-radius: var(--radius-full);
  font-family: var(--font-display); font-weight: var(--weight-medium); font-size: 11px;
  padding: 3px 10px; border: 1px solid transparent; line-height: 1.4; white-space: nowrap;
}
.scq-pill-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; }
.scq-badge-fact { color: var(--claim-fact); background: rgba(82,199,147,.13); border-color: rgba(82,199,147,.35); }
.scq-badge-infer { color: var(--claim-infer); background: rgba(141,160,236,.13); border-color: rgba(141,160,236,.35); }
.scq-badge-rec { color: var(--claim-rec); background: rgba(232,197,99,.13); border-color: rgba(232,197,99,.35); }
.scq-badge-ask { color: var(--claim-ask); background: rgba(227,185,79,.13); border-color: rgba(227,185,79,.35); }
.scq-badge-miss { color: var(--claim-miss); background: rgba(226,122,108,.13); border-color: rgba(226,122,108,.35); }
.scq-badge-neutral { color: var(--dark-text-muted); background: var(--charcoal-700); border-color: var(--dark-border); }
.scq-badge-verified { color: var(--claim-fact); background: rgba(82,199,147,.13); border-color: rgba(82,199,147,.35); }
.scq-badge-unverified { color: var(--claim-ask); background: rgba(227,185,79,.13); border-color: rgba(227,185,79,.35); }

/* ---------- Auth pages (Static SSR, light) ---------- */
.scq-auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--space-6); background: var(--canvas); }
.scq-auth-shell { width: 100%; max-width: 460px; }
.scq-auth-logo { display: flex; justify-content: center; margin-bottom: var(--space-5); }
.scq-auth-logo img { height: 32px; }
.scq-auth-card { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: var(--space-7) var(--space-6); }
.scq-auth-card-center { text-align: center; }
.scq-auth-card h1 { font-size: var(--text-xl); margin: 0 0 var(--space-2); }
.scq-auth-sub { color: var(--text-muted); font-size: var(--text-sm); margin: 0 0 var(--space-5); }
.scq-auth-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--violet-50); color: var(--violet-600); display: flex; align-items: center; justify-content: center; margin: 0 auto var(--space-4); }
.scq-auth-footer { text-align: center; font-size: var(--text-sm); color: var(--text-muted); margin-top: var(--space-5); }
.scq-auth-divider { border: none; border-top: 1px solid var(--border-thin); margin: var(--space-5) 0; }
.scq-callout { background: var(--violet-50); border: 1px solid var(--violet-100); border-radius: var(--radius-md); padding: var(--space-4); margin-bottom: var(--space-4); }
.scq-callout-row { display: flex; justify-content: space-between; gap: var(--space-3); font-size: var(--text-sm); }

/* ---------- Marketing / public ---------- */
.scq-nav { position: sticky; top: 0; z-index: 20; background: var(--white); border-bottom: 1px solid var(--border-thin); height: 64px; display: flex; align-items: center; }
.scq-nav-inner { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.scq-nav-links { display: flex; align-items: center; gap: var(--space-6); }
.scq-nav-links a { color: var(--text-body); text-decoration: none; font-family: var(--font-display); font-weight: var(--weight-medium); font-size: var(--text-sm); }
.scq-hero { padding: var(--space-9) 0; }
.scq-eyebrow { font-family: var(--font-display); font-weight: var(--weight-semibold); font-size: var(--text-xs); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--violet-600); }

/* ---------- App shell (Interactive Server: Portal + Admin) ---------- */
.scq-shell { display: flex; min-height: 100vh; background: var(--dark-surface-page); color: var(--dark-text-body); }
.scq-rail { width: 76px; flex: none; background: var(--dark-surface-page); border-right: 1px solid var(--dark-border); display: flex; flex-direction: column; align-items: center; padding: var(--space-4) 0; position: sticky; top: 0; height: 100vh; }
.scq-rail-logo { width: 36px; height: 36px; margin-bottom: var(--space-6); }
.scq-rail-btn {
  width: 44px; height: 44px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center;
  color: var(--dark-text-muted); background: transparent; border: none; text-decoration: none; margin-bottom: var(--space-2); cursor: pointer; position: relative;
}
.scq-rail-btn:hover { color: var(--white); }
/* The rail is thirteen unlabelled icons, and the founder who commissioned it could not find the
   endpoint-health page in it. The native title tooltip arrives about a second late and sits where
   the cursor is; this names the destination immediately, beside the icon it belongs to. */
.scq-rail-btn::after {
  content: attr(title); position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  background: var(--dark-surface-raised, #1c1c24); color: var(--white); border: 1px solid var(--dark-border);
  border-radius: var(--radius-md); padding: 6px 10px; font-size: var(--text-xs); line-height: 1.2;
  white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .08s ease; z-index: 40;
}
.scq-rail-btn:hover::after, .scq-rail-btn:focus-visible::after { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .scq-rail-btn::after { transition: none; } }
/* PR #297. The tooltip above needs a hover, which a phone or tablet never delivers - there the rail was a
   column of unlabelled icons. Where there is no hover (or the screen is narrow) the same title text
   becomes a caption under each icon instead. */
@media (max-width: 768px), (hover: none) {
  .scq-rail { overflow-y: auto; }
  .scq-rail-btn { width: 64px; height: auto; min-height: 44px; padding: 6px 2px; flex-direction: column; gap: 2px; }
  .scq-rail-btn::after {
    position: static; transform: none; opacity: 1; background: none; border: none; padding: 0;
    font-size: 10px; line-height: 1.15; white-space: normal; text-align: center; overflow-wrap: anywhere;
  }
}
.scq-rail-btn.active { background: var(--violet-600); color: var(--white); }
.scq-rail-btn[disabled] { opacity: .4; cursor: default; }
.scq-rail-spacer { margin-top: auto; }
/* Second-level admin nav. The rail carries five sections; these are the pages inside one. */
.scq-section-tabs { display: flex; gap: var(--space-4); flex-wrap: wrap; border-bottom: 1px solid var(--dark-border); margin-bottom: var(--space-5); }
.scq-section-tab {
  padding: 0 0 var(--space-3); color: var(--dark-text-muted); text-decoration: none; font-size: var(--text-sm);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.scq-section-tab:hover { color: var(--white); }
.scq-section-tab.active { color: var(--white); border-bottom-color: var(--violet-600); }
.scq-rail-dot { position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold-500); }

.scq-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.scq-topbar { height: 60px; flex: none; border-bottom: 1px solid var(--dark-border); display: flex; align-items: center; justify-content: space-between; padding: 0 var(--space-6); }
.scq-topbar-left { display: flex; align-items: center; gap: var(--space-2); font-family: var(--font-display); font-weight: var(--weight-semibold); }
.scq-topbar-sub { color: var(--dark-text-muted); font-weight: var(--weight-regular); font-size: var(--text-sm); }
.scq-topbar-right { display: flex; align-items: center; gap: var(--space-4); font-size: var(--text-sm); color: var(--dark-text-muted); position: relative; }
.scq-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--violet-600); color: var(--white);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: var(--weight-semibold); font-size: var(--text-sm);
  border: none; cursor: pointer;
}
/* The avatar menu is a <details>, not a Blazor toggle: layouts render statically, so a click handler in one
   never fired and the menu could not be opened. <summary> is the avatar; the browser owns open/closed. */
.scq-avatar-menu { position: relative; }
.scq-avatar-menu > summary { list-style: none; }
.scq-avatar-menu > summary::-webkit-details-marker { display: none; }
.scq-user-menu { position: absolute; top: 48px; right: 0; width: 230px; background: var(--dark-surface-card); border: 1px solid var(--dark-border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: var(--space-2); z-index: 30; }
.scq-user-menu-header { padding: var(--space-3); border-bottom: 1px solid var(--dark-border); margin-bottom: var(--space-2); }
.scq-user-menu a, .scq-user-menu button { display: block; width: 100%; text-align: left; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); color: var(--dark-text-body); text-decoration: none; background: none; border: none; font-size: var(--text-sm); cursor: pointer; }
.scq-user-menu a:hover, .scq-user-menu button:hover { background: var(--charcoal-700); }
.scq-admin-pill { background: var(--gold-100); color: var(--gold-600); }

.scq-profile-tabs { display: flex; gap: var(--space-5); border-bottom: 1px solid var(--dark-border); margin-bottom: var(--space-5); }
.scq-profile-tab {
  display: inline-block; padding: 0 0 var(--space-3); font-weight: var(--weight-medium); font-size: var(--text-sm);
  color: var(--dark-text-muted); text-decoration: none; border-bottom: 2px solid transparent; cursor: pointer;
}
.scq-profile-tab:hover { color: var(--dark-text-body); }
.scq-profile-tab.active { color: var(--gold-500); border-bottom-color: var(--gold-500); }
.scq-profile-tab.is-locked { color: var(--dark-text-muted); opacity: .6; cursor: default; }
/* PR #297. Why a tab is locked was a title tooltip only, which a touch screen never shows. The greyed tab
   now says so in words; opacity went from .45 to .6 so those words stay legible. */
.scq-tab-note { margin-left: var(--space-2); font-size: var(--text-xs); font-weight: var(--weight-regular); }


.scq-body { flex: 1; padding: var(--space-6); overflow-x: hidden; }
/* No outer cap. A fixed 1100px left roughly 300px of a 1500px screen empty while the leads table
   scrolled horizontally INSIDE it — the widest content on the page fighting for room next to blank
   space. Tables, charts and card grids should use the screen.

   Prose still needs a measure, so paragraphs get one here rather than the whole page being narrowed
   to suit them. This is a stylesheet rule, so a page that sets its own inline max-width still wins —
   several already do (66ch, 64ch, 640px) and those choices are preserved. Anything wider than a
   paragraph — table, grid, card row — is untouched and fills the width.

   72ch is around 90 characters at this size: wider than the classic 66 because this is dense admin
   copy read in short bursts, not long-form text. */
.scq-body-inner { max-width: none; }
.scq-body-inner p { max-width: 72ch; }

.scq-support-banner { background: #3A2E12; color: #E3B94F; padding: var(--space-3) var(--space-6); display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }

/* ---------- Dashboard layout ---------- */
.scq-dash-grid { display: grid; grid-template-columns: 1fr 316px; gap: var(--space-6); align-items: start; }
@media (max-width: 900px) { .scq-dash-grid { grid-template-columns: 1fr; } }
.scq-section-card { margin-bottom: var(--space-5); }
.scq-section-head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: var(--space-3); margin-bottom: var(--space-2); border-bottom: 1px solid var(--dark-border); }
.scq-section-head h2 { margin: 0; font-size: var(--text-md); color: var(--white); }
.scq-section-source { font-size: var(--text-xs); color: var(--dark-text-muted); }

/* ---------- Claim rows ---------- */
.scq-claim-row { display: flex; gap: var(--space-4); padding: var(--space-4) 0; border-bottom: 1px solid var(--dark-border); align-items: flex-start; }
.scq-claim-row:last-child { border-bottom: none; }
.scq-claim-main { flex: 1; min-width: 0; }
.scq-claim-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.scq-claim-label { font-family: var(--font-display); font-weight: var(--weight-semibold); font-size: 13.5px; color: var(--white); }
.scq-claim-value { font-size: var(--text-base); color: var(--dark-text-body); margin: 2px 0 4px; }
.scq-claim-value.is-struck { text-decoration: line-through; color: var(--dark-text-muted); }
.scq-claim-source { font-size: var(--text-xs); color: var(--dark-text-muted); }
.scq-claim-actions { flex: none; display: flex; align-items: center; gap: var(--space-3); }
.scq-resolved-tag { display: inline-flex; align-items: center; gap: 4px; font-size: var(--text-xs); font-weight: var(--weight-medium); }
.scq-resolved-tag.good { color: var(--claim-fact); }
.scq-resolved-tag.muted { color: var(--dark-text-muted); }

/* ---------- Sidebar ---------- */
.scq-sidebar { position: sticky; top: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); }
.scq-progress-track { height: 8px; background: var(--charcoal-700); border-radius: var(--radius-full); overflow: hidden; }
.scq-progress-fill { height: 100%; background: var(--violet-500); border-radius: var(--radius-full); transition: width var(--duration-slow) var(--ease-calm); }
.scq-progress-label { font-size: var(--text-sm); color: var(--dark-text-muted); margin-top: var(--space-2); }
.scq-progress-open { display: flex; align-items: center; gap: 8px; margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--dark-border); font-size: var(--text-sm); }
.scq-gold-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold-500); flex: none; }

/* ---------- Table (admin) ---------- */

/* Real <table> elements on the dark consoles. Three pages carried class="scq-table" while no
   such rule existed, so all three rendered as unstyled browser default: no header rule, no row
   separators, columns touching. Only visible by looking at the pages. */
.scq-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); color: var(--dark-text-body); font-variant-numeric: tabular-nums; }
.scq-table th {
  text-align: left; font-size: var(--text-xs); text-transform: uppercase;
  letter-spacing: var(--tracking-label); color: var(--dark-text-muted); font-weight: var(--weight-medium);
  padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--dark-border); white-space: nowrap;
}
.scq-table td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--dark-border); }
.scq-table tbody tr:last-child td { border-bottom: none; }
.scq-table tbody tr:hover td { background: var(--charcoal-900); }
.scq-table-scroll { overflow-x: auto; }
.scq-table th.num, .scq-table td.num { text-align: right; white-space: nowrap; }
.scq-toolbar { display: flex; gap: var(--space-4); align-items: center; flex-wrap: wrap; margin-bottom: var(--space-5); color: var(--dark-text-body); }
.scq-sub { color: var(--dark-text-muted); margin-bottom: var(--space-4); }
.scq-sub strong { color: var(--white); }
/* PR #298. Used by pages but defined nowhere, so they fell back to the browser default (dark heading text on
   the dark shell). scq-h1 matches the inline style the other admin pages give their <h1>; scq-h2 is the
   section heading under it; scq-notice is a neutral status line in the gold-edged card style of "Needs your
   attention" (NeedsReview shows both confirmations and errors in it, so it carries no success/error colour). */
.scq-h1 { color: var(--white); margin-bottom: 4px; }
.scq-h2 { color: var(--white); font-size: var(--text-md); margin: var(--space-5) 0 var(--space-2); }
.scq-notice {
  background: var(--dark-surface-card); border: 1px solid var(--dark-border); border-left: 3px solid var(--gold-500);
  border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); font-size: var(--text-sm); color: var(--dark-text-body);
}
.scq-table-card { padding: 0; overflow: hidden; }
.scq-table-head, .scq-table-row {
  display: grid; grid-template-columns: 2.1fr 1fr 1.1fr 1.5fr 1fr 150px; gap: var(--space-3);
  padding: var(--space-4) var(--space-5); align-items: center;
}
.scq-table-head { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: var(--tracking-label); color: var(--dark-text-muted); border-bottom: 1px solid var(--dark-border); }
.scq-sort { background: transparent; border: none; padding: 0; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; text-align: left; cursor: pointer; }
.scq-sort:hover { color: var(--white); }
.scq-sort-arrow { opacity: .6; }
.scq-table-row { border-bottom: 1px solid var(--dark-border); }
.scq-table-row:last-child { border-bottom: none; }
.scq-table-owner { font-size: var(--text-xs); color: var(--dark-text-muted); }
.scq-table-actions { display: flex; gap: var(--space-3); }
.scq-stage-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.scq-stage-queued { background: var(--dark-text-muted); }
.scq-stage-crawling { background: var(--claim-infer); }
.scq-stage-draft { background: var(--claim-rec); }
.scq-stage-validation { background: var(--violet-500); }
.scq-stage-validated { background: var(--claim-fact); }
.scq-bar-track { width: 110px; height: 6px; background: var(--charcoal-700); border-radius: var(--radius-full); overflow: hidden; }
.scq-bar-fill { height: 100%; background: var(--violet-500); }
.scq-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); margin-bottom: var(--space-5); }
@media (max-width: 900px) { .scq-kpi-grid { grid-template-columns: 1fr 1fr; } }
.scq-kpi-card { padding: var(--space-5); }
.scq-kpi-card.highlight { border-color: var(--gold-500); }
.scq-kpi-value { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: var(--weight-semibold); color: var(--white); }
.scq-kpi-label { font-size: var(--text-sm); color: var(--dark-text-muted); }
.scq-kpi-delta { font-size: var(--text-xs); color: var(--dark-text-muted); margin-top: var(--space-1); }

/* ---------- Competitor changes (PR #364) ---------- */
.scq-change-row { display: grid; grid-template-columns: 96px 1fr auto; gap: var(--space-3); align-items: baseline; padding: var(--space-3) 0; border-bottom: 1px solid var(--dark-border); }
.scq-change-row:last-child { border-bottom: none; }
.scq-change-text { font-size: var(--text-sm); margin: 4px 0 0; overflow-wrap: anywhere; }

/* ---------- Field lock rows ---------- */
.scq-lock-row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4) 0; border-bottom: 1px solid var(--dark-border); }
.scq-lock-row:last-child { border-bottom: none; }
.scq-lock-main { flex: 1; min-width: 0; }
.scq-lock-label { font-weight: var(--weight-semibold); color: var(--white); font-size: var(--text-sm); }
.scq-lock-value { font-size: var(--text-sm); color: var(--dark-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scq-lock-status { font-size: var(--text-xs); color: var(--dark-text-muted); width: 170px; text-align: right; }
.scq-lock-icon { color: var(--gold-500); }
.scq-onboard-locked { border: 1px dashed var(--violet-200); background: var(--violet-50); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); display: flex; align-items: center; gap: var(--space-2); color: var(--ink-600); font-size: var(--text-sm); }

/* ---------- Confidence ring ---------- */
.scq-ring {
  --pct: 0;
  width: 104px; height: 104px; border-radius: 50%; position: relative; flex: none;
  background: conic-gradient(var(--violet-500) calc(var(--pct) * 3.6deg), var(--charcoal-700) 0deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 10px), #000 calc(100% - 9px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 10px), #000 calc(100% - 9px));
}
.scq-ring-spin {
  background: conic-gradient(var(--violet-600) 100deg, var(--violet-100) 0deg);
  animation: scq-spin 1.1s linear infinite;
}
@keyframes scq-spin { to { transform: rotate(360deg); } }
.scq-ring-wrap { position: relative; display: flex; align-items: center; justify-content: center; }
.scq-ring-value { position: absolute; font-family: var(--font-display); font-weight: var(--weight-semibold); font-size: var(--text-lg); color: var(--white); }

/* ---------- Pipeline stage list ---------- */
.scq-stage-list { display: flex; flex-direction: column; gap: var(--space-4); }
.scq-stage-item { display: flex; align-items: center; gap: var(--space-3); }
.scq-stage-circle { width: 24px; height: 24px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; border: 2px solid var(--dark-border); color: var(--dark-text-muted); }
.scq-stage-circle.done { background: var(--violet-600); border-color: var(--violet-600); color: var(--white); }
.scq-stage-circle.active { border-color: var(--violet-500); animation: scq-pulse 1.4s ease-in-out infinite; }
@keyframes scq-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(90,86,167,.4); } 50% { box-shadow: 0 0 0 6px rgba(90,86,167,0); } }
.scq-joblog { background: var(--charcoal-900); border-radius: var(--radius-md); padding: var(--space-4); font-family: 'Consolas', 'SFMono-Regular', monospace; font-size: var(--text-xs); color: var(--dark-text-muted); line-height: 1.8; white-space: pre-wrap; }

/* ---------- Toast ---------- */
.scq-toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: var(--charcoal-800); color: var(--white); padding: var(--space-3) var(--space-5); border-radius: var(--radius-full); box-shadow: var(--shadow-lg); font-size: var(--text-sm); z-index: 100; animation: scq-up .25s var(--ease-calm); }
@keyframes scq-up { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Dialog ---------- */
.scq-dialog-backdrop { position: fixed; inset: 0; background: rgba(18,17,36,.55); display: flex; align-items: center; justify-content: center; z-index: 90; padding: var(--space-4); }
.scq-dialog { background: var(--dark-surface-card); border: 1px solid var(--dark-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: var(--space-6); width: 100%; max-width: 440px; color: var(--dark-text-body); }
.scq-dialog h3 { color: var(--white); margin-top: 0; }
.scq-dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-3); margin-top: var(--space-5); }

/* ---------- Feedback FAB ---------- */
.scq-feedback-fab { position: fixed; bottom: var(--space-6); right: var(--space-6); width: 56px; height: 56px; border-radius: 50%; background: var(--violet-600); color: var(--white); border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--shadow-lg); z-index: 80; transition: background-color var(--duration-fast) var(--ease-calm); }
.scq-feedback-fab:hover { background: var(--interactive-hover); }

/* ---------- Misc ---------- */
.scq-empty { text-align: center; color: var(--dark-text-muted); padding: var(--space-7) 0; }
.scq-danger-zone { border: 1px solid rgba(226,122,108,.4); border-radius: var(--radius-lg); padding: var(--space-5); background: rgba(226,122,108,.06); }
.scq-danger-zone h3 { color: var(--error); margin-top: 0; }
.scq-link-muted { color: var(--dark-text-muted); font-size: var(--text-sm); text-decoration: none; }
.scq-link-muted:hover { color: var(--white); }

/* ---------- Investor report (PR #363) ---------- */
.scq-investor { display: flex; flex-direction: column; gap: var(--space-5); font-variant-numeric: tabular-nums; }
.scq-investor-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-4); flex-wrap: wrap; }
/* Value and Breadth: both panes are rendered, so a print carries both; the tab only hides one on screen. */
.scq-investor-pane { display: flex; flex-direction: column; gap: var(--space-5); }
.scq-investor-pane.is-hidden { display: none; }
.scq-investor-tab { background: none; border-width: 0 0 2px; font-family: inherit; }
.scq-investor-pane .scq-kpi-grid { margin-bottom: 0; }
.scq-investor-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: var(--space-5); }
.scq-investor-row > .scq-card-dark, .scq-investor-breadth > .scq-card-dark { display: flex; flex-direction: column; gap: var(--space-3); }
.scq-investor-note { margin: 0; font-size: var(--text-sm); line-height: 1.55; color: var(--dark-text-muted); }
/* "Not enough data yet" and its kind: gold, so a missing measurement never reads as a measured zero. */
.scq-investor-placeholder { font-size: var(--text-sm); color: var(--claim-ask); }
.scq-investor-figure { font-family: var(--font-display); font-weight: var(--weight-semibold); color: var(--white); white-space: nowrap; }
.scq-investor-line { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-4); padding: var(--space-3) 0; border-bottom: 1px solid var(--dark-border); font-size: var(--text-sm); }
.scq-investor-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--space-3); }
.scq-investor-tile { background: var(--charcoal-900); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); }
.scq-investor-tile-value { font-family: var(--font-display); font-size: var(--text-xl); font-weight: var(--weight-semibold); color: var(--white); }
.scq-investor-panel-title { margin: 0; font-size: var(--text-md); }
.scq-investor-bar-row { display: grid; grid-template-columns: minmax(140px, 220px) minmax(0, 1fr) minmax(56px, auto); gap: var(--space-4); align-items: center; font-size: var(--text-sm); }
.scq-investor-bar-row .scq-investor-figure { text-align: right; }
.scq-investor-bar { height: 18px; background: var(--charcoal-900); border-radius: var(--radius-sm); overflow: hidden; }
.scq-investor-bar-fill { height: 100%; background: var(--violet-500); }
.scq-investor-weeks { display: flex; align-items: flex-end; gap: var(--space-3); border-bottom: 1px solid var(--dark-border); padding-top: var(--space-4); }
.scq-investor-week { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: var(--space-1); padding-bottom: var(--space-2); text-align: center; }
.scq-investor-weeks-flush { gap: 0; padding-top: 0; }
/* PR #489: the running-total line sits over the same equal columns as the figures under it (no gap, so each point is over its figure). */
.scq-investor-line-chart { position: relative; height: 140px; }
.scq-investor-line-chart svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.scq-investor-line-chart polyline { fill: none; stroke: var(--gold-500); stroke-width: 2.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.scq-investor-line-dot { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--gold-500); }
.scq-investor-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.scq-investor-breadth { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-4); }
.scq-investor-foot { display: flex; justify-content: space-between; gap: var(--space-5); flex-wrap: wrap; border-top: 1px solid var(--dark-border); padding-top: var(--space-4); font-size: var(--text-xs); color: var(--dark-text-muted); }
/* Printed (or saved as PDF from the print dialog) on white paper: the console chrome goes, the dark cards turn
   light, and the bars keep their colour. Scoped to pages holding the report, so no other page's print changes. */
@media print {
  body:has(.scq-investor) .scq-rail, body:has(.scq-investor) .scq-topbar, body:has(.scq-investor) .scq-section-tabs,
  body:has(.scq-investor) .scq-feedback-fab, .scq-no-print { display: none !important; }
  body:has(.scq-investor), body:has(.scq-investor) .scq-shell, body:has(.scq-investor) .scq-body { background: #fff; min-height: 0; padding: 0; }
  .scq-investor, .scq-investor * { color: #111 !important; }
  .scq-investor .scq-card-dark, .scq-investor .scq-investor-tile { background: #fff; border: 1px solid #ccc; break-inside: avoid; }
  .scq-investor-bar, .scq-investor-bar-fill, .scq-investor-line-dot { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .scq-investor-pane.is-hidden { display: flex; }
  .scq-investor-row { grid-template-columns: 1fr 1fr; }
}

/* ---------- PR #574: each person's appearance (Account page) ----------
   PortalLayout and AdminLayout put data-theme / data-text-weight / data-text-size on .scq-shell only when the person
   chose something; with none, nothing below applies and the dark shell is exactly as before. The light theme re-points
   the shell's dark tokens (redefined here, on the shell, because aliases on :root resolve there); the icon rail stays
   Midnight Violet, the brand anchor from the founder's mockup (2026-10-15). */
.scq-shell[data-theme="light"] {
  color-scheme: light;
  --charcoal-900: #F8F9FC; --charcoal-800: #FFFFFF; --charcoal-700: #E4E3F2;
  --dark-surface-page: #F8F9FC; --dark-surface-card: #FFFFFF; --dark-surface-raised: #F1F1F8; --dark-border: #E4E3F2;
  --dark-text-body: #25243A; --dark-text-muted: #5D5C72; --ui-text-strong: #25243A;
  --claim-fact: #15803D; --claim-infer: #3B5BDB; --claim-rec: #7A5F12; --claim-ask: #7A5F12; --claim-miss: #B3402F;
  /* Champagne gold is text on a dark surface; on white it fails contrast (active tabs, scores), so it deepens here. */
  --gold-500: #846611; --gold-600: #6E5714;
  --ui-ok-text: #15803D; --ui-warn-text: #8A6410; --ui-bad-text: #B91C1C; --ui-callout-bg: #FDF3E1; --ui-callout-text: #6E5714;
}
.scq-shell[data-theme="light"] .scq-rail { background: #2C2A63; border-right-color: #2C2A63; }
.scq-shell[data-theme="light"] .scq-rail-btn { color: #C9C8E4; }
.scq-shell[data-theme="light"] .scq-rail-btn:hover { color: #FFFFFF; }
.scq-shell[data-theme="light"] .scq-rail-btn::after { background: #2C2A63; color: #FFFFFF; border-color: #2C2A63; }
@media (max-width: 768px), (hover: none) { .scq-shell[data-theme="light"] .scq-rail-btn::after { background: none; color: #C9C8E4; } }
/* Text the shell's rules make white for a dark surface. */
.scq-shell[data-theme="light"] :is(.scq-card-dark h2, .scq-card-dark h3, .scq-section-tab:hover, .scq-section-tab.active,
  .scq-section-head h2, .scq-claim-label, .scq-sub strong, .scq-h1, .scq-h2, .scq-sort:hover, .scq-kpi-value, .scq-lock-label,
  .scq-ring-value, .scq-dialog h3, .scq-link-muted:hover, .scq-investor-figure, .scq-investor-tile-value, .scq-toast) { color: var(--ui-text-strong); }
.scq-shell[data-theme="light"] .scq-btn-ondark { color: #403D88; border-color: #C9C8E4; }
.scq-shell[data-theme="light"] .scq-btn-ondark:hover:not(:disabled) { color: #FFFFFF; }

/* Text weight: how heavy and how dark the words are. Regular (or no choice) is today's look. */
.scq-shell[data-text-weight="light"] { font-weight: 300; --weight-regular: 300; }
.scq-shell[data-text-weight="bold"] { font-weight: 700; --weight-regular: 700; --weight-medium: 700; --weight-semibold: 700; }
.scq-shell[data-theme="light"][data-text-weight="light"] { --dark-text-body: #4A4960; --dark-text-muted: #6B6A80; --ui-text-strong: #3A3950; }
.scq-shell[data-theme="light"][data-text-weight="bold"] { --dark-text-body: #000000; --dark-text-muted: #2B2A3A; --ui-text-strong: #000000; }
.scq-shell:not([data-theme="light"])[data-text-weight="light"] { --dark-text-body: #B9B8CC; --dark-text-muted: #8C8BA6; }
.scq-shell:not([data-theme="light"])[data-text-weight="bold"] { --dark-text-body: #FFFFFF; --dark-text-muted: #C9C8E4; }

/* Text size: the type scale, one step down or up. Medium (or no choice) is today's size. */
.scq-shell[data-text-size="small"] { font-size: 14px; --text-xs: 11px; --text-sm: 12px; --text-base: 14px; --text-md: 16px; --text-lg: 18px; --text-xl: 22px; --text-2xl: 27px; --text-3xl: 34px; }
.scq-shell[data-text-size="large"] { font-size: 17px; --text-xs: 14px; --text-sm: 15px; --text-base: 17px; --text-md: 19px; --text-lg: 23px; --text-xl: 27px; --text-2xl: 34px; --text-3xl: 42px; }
