/*
 * Atlas redesign v2 — app shell.
 *
 * Design tokens align with licentium.ai (the marketing site) so the
 * brand reads consistently across landing → product → email. Cream
 * background, violet accent, Bricolage Grotesque + Inter + JetBrains
 * Mono. Italic violet accent for emphasis in display headings.
 *
 * This stylesheet covers the *new* surfaces only — sidebar, panels,
 * dashboard cards, chip buttons, depth segment, hero. Result-page
 * components (.verdict-row, .finding-card, .rewrite-card, etc.)
 * still live in style.css so the existing main.js render code keeps
 * working unchanged; we only update tokens there to align colours.
 */

:root {
  /* ─── colour ─── */
  --bg:           #f3f1ec;
  --bg-card:      #ffffff;
  --bg-soft:      #ebe7df;
  --bg-deep:      #181715;
  --ink:          #1a1a1a;
  --ink-2:        #3a3a3a;
  --muted:        #8a8581;
  --muted-2:      #b5b0aa;
  --rule:         #e3dfd7;
  --rule-strong:  #d4cfc6;

  --violet:       #6927DA;
  --violet-dark:  #5215c4;
  --violet-soft:  #ece4ff;
  --violet-edge:  #d3c2ff;

  --teal:         #1ea683;
  --amber:        #d99c1f;
  --red:          #c54545;

  /* severity pill backgrounds */
  --sev-block:    #f6dadc;
  --sev-block-ink:#9b1d1d;
  --sev-review:   #f7e9c5;
  --sev-review-ink:#7a5a0d;
  --sev-pass:     #cdebde;
  --sev-pass-ink: #1a6f57;

  /* ─── typography ─── */
  --font-display: 'Bricolage Grotesque', 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body:    'Inter', 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'SFMono-Regular', Menlo, Consolas, monospace;

  /* ─── geometry ─── */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-pill: 999px;

  --sidebar-w: 256px;

  --shadow-card: 0 1px 2px rgba(20, 18, 14, 0.04), 0 4px 16px rgba(20, 18, 14, 0.04);
}

/* ─── reset-light ─── */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }


/* ─────────── APP SHELL ─────────── */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-main {
  flex: 1;
  min-width: 0; /* flex item shrink fix */
  padding: 56px 64px 80px;
  overflow-x: hidden;
}

/* Send-for-Review modal (Dima 2026-04-28). Two tabs (external email
   vs team member), generated share link with copy button, all isolated
   in one popover so the rest of the redesign keeps its airy spacing. */
.share-modal-card { max-width: 520px; }
.share-modal-hint { font-size: 13px; color: var(--muted); line-height: 1.55; margin: 0 0 16px; }
.share-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); margin-bottom: 18px; }
.share-tab {
  flex: 1;
  padding: 10px 14px 12px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: color 0.12s, border-color 0.12s;
}
.share-tab:hover { color: var(--ink-2); }
.share-tab--active { color: var(--violet); border-bottom-color: var(--violet); }
.share-tab-tier {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--violet-soft);
  color: var(--violet);
}
.share-tab-tier--ent { background: rgba(20, 18, 14, 0.08); color: var(--ink); }
.share-tab-panel[hidden] { display: none; }
.share-result {
  margin-top: 18px;
  padding: 14px 16px;
  background: var(--violet-soft);
  border-radius: 10px;
}
.share-result-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--violet-dark);
  margin-bottom: 6px;
}
.share-result-row { display: flex; gap: 8px; align-items: center; }
.share-result-row .auth-input { flex: 1; font-family: var(--font-mono); font-size: 12px; }
.share-result-status { margin-top: 8px; font-size: 12px; color: var(--violet-dark); }

/* Active-shares list inside the Send-for-Review modal — Egor B38.
   Lists every link the owner has previously generated for this review,
   each row with a Revoke button. Same visual language as
   .share-result; rendered just below it so a freshly created link
   shows up there without needing to reopen the modal. */
.share-active {
  margin-top: 18px;
  padding: 14px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--ink-edge, rgba(20, 18, 14, 0.08));
  border-radius: 10px;
}
.share-active[hidden] { display: none; }
.share-active-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.share-active-list { display: flex; flex-direction: column; gap: 8px; }
.share-active-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--ink-edge, rgba(20, 18, 14, 0.08));
  border-radius: 8px;
}
.share-active-meta { min-width: 0; flex: 1; }
.share-active-recipient {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.share-active-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.share-active-status {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.share-active-status--ok { color: var(--violet-dark, #5215c4); }
.share-active-status--off { color: var(--muted); }
.btn-revoke-share {
  padding: 6px 12px;
  background: none;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}
.btn-revoke-share:hover { background: #fef2f2; border-color: #ef4444; }
.btn-revoke-share:disabled { opacity: 0.6; cursor: default; }

/* Send-for-Review trigger in history detail */
.btn-share-review {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: var(--violet-soft);
  border: 1px solid var(--violet-edge);
  border-radius: var(--r-md);
  color: var(--violet-dark);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.btn-share-review:hover { background: #d8c7ff; border-color: var(--violet-dark); }
.btn-share-review[disabled] { opacity: 0.5; cursor: not-allowed; }


/* Footer disclaimer (Illia design fix 2026-04-28) — sits at the bottom
   of every Atlas app surface. Same legal copy as the auth modal so the
   user sees it whether they're logged in or not. */
.app-footer {
  margin-top: 64px;
  padding: 24px 0 0;
  border-top: 1px solid var(--rule);
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 880px;
}
.app-footer p { margin: 0; }
.app-footer a {
  color: var(--ink-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.app-footer a:hover { color: var(--violet); }


/* ─────────── SIDEBAR (DESKTOP) ─────────── */

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg);
  border-right: 1px solid var(--rule);
  padding: 32px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1 0 auto;
}

.sidebar-logo {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 0 8px;
}
.sidebar-logo-word {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.04em;
  color: var(--ink);
}
.sidebar-logo-sep {
  color: var(--muted-2);
  font-weight: 400;
  font-size: 18px;
}
.sidebar-logo-sub {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.sidebar-section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--muted-2);
  text-transform: uppercase;
  padding: 16px 8px 6px;
}
.sidebar-section-label:first-child { padding-top: 0; }

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  font-size: 14px;
  color: var(--ink-2);
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
}
.sidebar-link:hover {
  background: var(--bg-soft);
  color: var(--ink);
}
.sidebar-link[aria-current="page"] {
  background: var(--ink);
  color: var(--bg);
}
.sidebar-link[aria-current="page"]:hover {
  background: var(--ink);
  color: var(--bg);
}

.sidebar-link .kbd,
.sidebar-link .badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.sidebar-link[aria-current="page"] .kbd,
.sidebar-link[aria-current="page"] .badge {
  color: var(--muted-2);
}
.sidebar-link .badge:empty { display: none; }

/* Same specificity as `[hidden]{display:none}` (UA stylesheet) means the
   class wins and the `hidden` attribute is ignored. Without these rules,
   non-admin users keep seeing the "Admin console" sidebar entry even
   though `_toggleAdminLink(false)` set `hidden = true` on the elements
   (Dima 2026-05-04 — same pattern as the avatar fix). */
.sidebar-link[hidden],
.sidebar-section-label[hidden],
.sidebar-upgrade-btn[hidden] { display: none !important; }

.sidebar-upgrade-btn {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  background: var(--violet);
  color: #ffffff;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 0.15s, transform 0.1s;
}
.sidebar-upgrade-btn:hover { background: var(--violet-dark); transform: translateY(-1px); }
.sidebar-upgrade-btn[hidden] { display: none; }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 8px;
  border-top: 1px solid var(--rule);
}
.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--violet-soft);
  color: var(--violet);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0;
}
.sidebar-user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-plan {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

.sidebar-anon-cta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 8px;
  border-top: 1px solid var(--rule);
}
.sidebar-anon-cta button {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  background: var(--bg);
  color: var(--ink);
  transition: background 0.15s;
}
.sidebar-anon-cta button:hover { background: var(--bg-soft); }
.sidebar-anon-cta button.primary { background: var(--ink); color: var(--bg); }
.sidebar-anon-cta button.primary:hover { background: #000; }

/* Hide auth-ui.js's legacy #header-auth output. It still renders
   inside #sidebar-user-slot to keep its onclick handlers wired up
   (login/signup/logout/plan/history), but visually we replace it
   with a clean app.js-rendered .sidebar-user card. The legacy
   buttons are clicked programmatically by the new card's actions
   to avoid duplicating modal/auth logic. */
#header-auth { display: none !important; }


/* ─────────── DRAWER (MOBILE) ─────────── */

.drawer-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  border: 1px solid var(--rule);
  background: var(--bg-card);
  z-index: 60;
  align-items: center;
  justify-content: center;
}
.drawer-toggle svg { width: 18px; height: 18px; stroke: var(--ink); }

.drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 14, 0.45);
  z-index: 40;
  opacity: 0;
  transition: opacity 0.2s;
}
.drawer-backdrop.is-open { display: block; opacity: 1; }


/* ─────────── PANELS (ROUTED) ─────────── */

.panel { display: none; }
.panel.is-active { display: block; }


/* ─────────── HERO (ATLAS · MARKETING REVIEW) ─────────── */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 24px;
}

.display-h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(40px, 4.6vw, 60px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  color: var(--ink);
  margin: 0 0 16px 0;
  font-variation-settings: "opsz" 60;
}
.display-h1 .accent {
  color: var(--violet);
  font-style: italic;
  font-weight: 700;
}

.display-h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 14px 0;
}
.display-h2 .accent {
  color: var(--violet);
  font-style: italic;
}

.lead {
  font-size: 16px;
  color: var(--ink-2);
  max-width: 640px;
  margin: 0 0 40px 0;
}


/* ─────────── NEW REVIEW FORM ─────────── */

.field-group { margin-bottom: 24px; }

.field-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.field-label-counter {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted-2);
  font-weight: 500;
}
.field-label-counter.over { color: var(--red); }

.text-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--bg-card);
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.12s, box-shadow 0.12s;
  resize: vertical;
}
.text-input:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 3px var(--violet-soft);
}
.text-input::placeholder { color: var(--muted-2); }

textarea.text-input { min-height: 180px; line-height: 1.55; }
textarea.text-input--sm { min-height: 90px; }

select.text-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'><path d='M1 1l4 4 4-4' stroke='%238a8581' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 44px;
}


/* ─────────── CHIPS (ADD CONTEXT) ─────────── */

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px 9px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--bg-card);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.chip:hover {
  border-color: var(--violet-edge);
  color: var(--ink);
}
.chip-icon {
  color: var(--violet);
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
}
.chip.is-set {
  background: var(--violet-soft);
  border-color: var(--violet-edge);
  color: var(--violet-dark);
}
.chip.is-set .chip-icon { color: var(--violet-dark); }

.chip-clear {
  display: none;
  margin-left: 4px;
  padding: 0 6px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
}
.chip.is-set .chip-clear { display: inline-flex; align-items: center; }
.chip-clear:hover { color: var(--red); }

/* Locked chip — feature exists in Pro/Base but the user's plan can't
   reach it. Visible (so they know what they'd get) but unmistakably
   not testable. Click opens the plan panel. Illia 2026-04-27. */
button.chip.chip--locked,
.chip-row button.chip.chip--locked {
  background-color: #ece4ff !important;
  background: #ece4ff !important;
  border: 1px dashed #6927DA !important;
  color: #5215c4 !important;
  cursor: pointer !important;
}
button.chip.chip--locked:hover,
.chip-row button.chip.chip--locked:hover {
  background-color: #d8c7ff !important;
  background: #d8c7ff !important;
  border-color: #5215c4 !important;
  color: #5215c4 !important;
}
.chip--locked .chip-icon {
  color: var(--violet);
  font-size: 11px;
}
.chip--locked .chip-clear { display: none !important; }
.chip--locked::after {
  content: attr(data-locked-tier);
  margin-left: 6px;
  padding: 2px 7px;
  font-size: 9px;
  font-weight: 700;
  background: var(--violet);
  color: #fff;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Bonus chip — feature is normally locked for this plan, but the user
   has remaining bonus credits that unlock it for this single review.
   Visually different from .chip--locked: warm gradient background +
   "Bonus" pill instead of "Pro", 🎁 icon. Click triggers the normal
   file-picker / popover flow (NOT a redirect to /billing). Дима 2026-05-08. */
button.chip.chip--bonus,
.chip-row button.chip.chip--bonus {
  background: linear-gradient(135deg, #ece4ff 0%, #fff5db 100%) !important;
  border: 1px solid #c084fc !important;
  color: #5215c4 !important;
  cursor: pointer !important;
}
button.chip.chip--bonus:hover,
.chip-row button.chip.chip--bonus:hover {
  background: linear-gradient(135deg, #d8c7ff 0%, #ffe9b8 100%) !important;
  border-color: #8b5cf6 !important;
}
.chip--bonus .chip-icon {
  font-size: 13px;
  color: var(--violet-dark, #5215c4);
}
.chip--bonus::after {
  content: attr(data-bonus-tier) " · BONUS";
  margin-left: 6px;
  padding: 2px 7px;
  font-size: 9px;
  font-weight: 700;
  background: linear-gradient(135deg, #6927DA 0%, #fbbf24 100%);
  color: #fff;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}


/* ─────────── CHIP POPOVER ─────────── */

.chip-popover {
  position: absolute;
  z-index: 50;
  min-width: 320px;
  max-width: 460px;
  background: var(--bg-card);
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-md);
  box-shadow: 0 8px 32px rgba(20, 18, 14, 0.12);
  padding: 16px;
  display: none;
}
.chip-popover.is-open { display: block; }
.chip-popover-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  margin: 0 0 10px 0;
}
.chip-popover-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
.chip-popover-actions button {
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--rule);
  background: var(--bg);
  color: var(--ink);
}
.chip-popover-actions button.primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.chip-popover-actions button.primary:hover { background: #000; }


/* ─────────── DEPTH SEGMENT ─────────── */

.depth-segment {
  display: flex;
  padding: 4px;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--bg-card);
}
.depth-option {
  flex: 1;
  position: relative;
  text-align: center;
}
.depth-option input { position: absolute; opacity: 0; pointer-events: none; }
.depth-option-label {
  display: block;
  padding: 11px 14px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.depth-option:hover .depth-option-label { color: var(--ink); }
.depth-option input:checked + .depth-option-label {
  background: var(--ink);
  color: var(--bg);
}
.depth-option input:disabled + .depth-option-label {
  color: var(--muted-2);
  cursor: not-allowed;
}


/* ─────────── FORM-FOOTER ─────────── */

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: end;
}
/* When a column is hidden (e.g. Depth selector for Free/Base/anon —
   they only have one preset), collapse to a single column so the
   visible field stretches the full width instead of leaving a void. */
.form-row:has(> .field-group[hidden]) {
  grid-template-columns: 1fr;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 32px;
}

.latency-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.latency-hint::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background 0.15s, transform 0.1s;
}
.btn-primary:hover { background: #000; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-primary .arrow { transition: transform 0.15s; }
.btn-primary:hover .arrow { transform: translateX(2px); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 18px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: border-color 0.12s, background 0.12s;
}
.btn-ghost:hover { background: var(--bg-card); border-color: var(--ink); }


/* ─────────── DASHBOARD ─────────── */

.dashboard-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 40px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 20px 22px;
}
.stat-card-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 10px;
  line-height: 1.3;
}
.stat-card-value {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink);
  margin-bottom: 8px;
  font-variation-settings: "opsz" 36;
}
.stat-card-value .accent { color: var(--violet); font-style: italic; font-weight: 800; }
.stat-card-value .denom { color: var(--muted); font-size: 22px; font-weight: 600; }
.stat-card-foot {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.stat-card-foot.up { color: var(--teal); }
.stat-card-foot.down { color: var(--teal); } /* lower risk score = green */

.content-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: start;
}

.content-card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 22px 24px;
}
.content-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.content-card-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
  margin: 0;
}
.content-card-link {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--violet);
  font-weight: 600;
}

.review-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--rule);
}
.review-row:first-of-type { border-top: 0; padding-top: 0; }
.review-row:last-of-type { padding-bottom: 0; }
.review-row-title {
  flex: 1;
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.review-row-time {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.sev-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.sev-pill--block  { background: var(--sev-block); color: var(--sev-block-ink); }
.sev-pill--review { background: var(--sev-review); color: var(--sev-review-ink); }
.sev-pill--pass   { background: var(--sev-pass); color: var(--sev-pass-ink); }


/* ─────────── DASHBOARD SIDE CARDS ─────────── */

.month-card .stat-card-value { font-size: 32px; }
.month-progress {
  height: 4px;
  background: var(--rule);
  border-radius: var(--r-pill);
  overflow: hidden;
  margin: 14px 0 8px;
}
.month-progress-fill {
  height: 100%;
  background: var(--violet);
  transition: width 0.3s;
}
.month-resets {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 18px;
}

.plan-mini-card {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.plan-mini-card-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.plan-mini-card-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.upgrade-mini-card {
  background: var(--violet-soft);
  border: 1px solid var(--violet-edge);
  border-radius: var(--r-md);
  padding: 14px 16px;
}
.upgrade-mini-card-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--violet-dark);
  margin: 0 0 6px 0;
}
.upgrade-mini-card-body {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.45;
  margin: 0 0 10px 0;
}
.upgrade-mini-card-link {
  display: inline-flex;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--violet);
  text-transform: uppercase;
}


/* ─────────── ANON DASHBOARD BANNER (Egor B65) ─────────── */
.dash-anon-banner {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px;
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--violet-soft, #ece4ff) 0%, var(--bg-card, #fff) 100%);
  border: 1px solid var(--violet-edge, #d3c2ff);
  border-radius: var(--r-md, 12px);
  flex-wrap: wrap;
}
.dash-anon-banner-copy { flex: 1; min-width: 280px; }
.dash-anon-banner-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--violet-dark, #5215c4);
  margin-bottom: 6px;
}
.dash-anon-banner-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 12px;
  line-height: 1.25;
}
.dash-anon-banner-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 13px;
  color: var(--ink-2);
}
.dash-anon-banner-list li {
  position: relative;
  padding-left: 18px;
  margin: 4px 0;
}
.dash-anon-banner-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--violet-dark, #5215c4);
  font-weight: 600;
}
.dash-anon-banner-ctas {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* ─────────── BONUS CREDITS BANNER (May 2026 — Licentium gift tier) ─────────── */

/* The bonus banner advertises the "tier-preview" credits Licentium gives
   for free with each paid plan: 3 Pro reviews on Base, 3 Enterprise
   reviews on Pro. Designed to feel like a gift — gradient that flows
   from the brand violet into a warm gold, soft glow, gift-icon. The
   exhausted state drops the gold and dims to muted violet so users
   still see the badge but understand the credits are spent. */

.bonus-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  margin-bottom: 18px;
  background: linear-gradient(135deg, #6927DA 0%, #8b5cf6 45%, #fbbf24 100%);
  color: #ffffff;
  border-radius: var(--r-md, 12px);
  box-shadow: 0 8px 24px -10px rgba(105, 39, 218, 0.45),
              0 2px 6px rgba(105, 39, 218, 0.25);
  position: relative;
  overflow: hidden;
  flex-wrap: wrap;
}
/* HTML `hidden` attribute would normally apply browser-default
   `display: none`, but `.bonus-banner { display: flex }` above has
   the same specificity and comes later in the file, so it wins.
   Result: setting `hidden = true` in JS did nothing, the banner
   stayed visible on Enterprise / Free / anon. Fix the override
   explicitly (Дима 2026-05-09 — same pattern as
   `.auth-pp-row[hidden]` rule in style.css). */
.bonus-banner[hidden] { display: none !important; }
.bonus-banner::after {
  /* subtle shine sweep — purely decorative */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.18) 45%,
    rgba(255,255,255,0) 65%);
  transform: translateX(-100%);
  animation: bonusShine 6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes bonusShine {
  0%, 100% { transform: translateX(-100%); }
  40%, 60% { transform: translateX(100%); }
}
.bonus-banner-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}
.bonus-banner-copy {
  flex: 1;
  min-width: 220px;
  z-index: 1;
}
.bonus-banner-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.bonus-banner-body {
  font-size: 13px;
  line-height: 1.45;
  opacity: 0.94;
}
.bonus-banner-body strong {
  font-weight: 600;
  color: #fff8d8;
}
.bonus-banner-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.95);
  color: var(--violet-dark, #5215c4);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.15s ease;
  z-index: 1;
}
.bonus-banner-cta:hover {
  background: #ffffff;
  transform: translateY(-1px);
}

/* exhausted state — credits used up this month */
.bonus-banner--exhausted {
  background: linear-gradient(135deg, #6b6280 0%, #8a7da3 100%);
  box-shadow: 0 4px 14px -6px rgba(107, 98, 128, 0.4);
}
.bonus-banner--exhausted::after { display: none; }
.bonus-banner--exhausted .bonus-banner-icon { opacity: 0.7; }
.bonus-banner--exhausted .bonus-banner-body strong { color: #fde4a8; }

/* result-page badge — appears next to verdict when this review was
   powered by a bonus credit (free Pro/Enterprise tier on a lower plan) */
.bonus-tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #6927DA 0%, #fbbf24 100%);
  color: #ffffff;
  border-radius: 999px;
  vertical-align: middle;
  box-shadow: 0 2px 6px -2px rgba(105, 39, 218, 0.5);
}

/* compare-plans matrix bonus row highlighting */
.compare-plans .bonus-row {
  background: linear-gradient(90deg,
    rgba(105, 39, 218, 0.04) 0%,
    rgba(251, 191, 36, 0.06) 100%);
}
.compare-plans .bonus-row .feature-name {
  color: var(--violet-dark, #5215c4);
}

/* ─────────── ADMIN AUDIT LOG (Egor B52) ─────────── */

/* CSS-grid table — five columns, monospaced timestamp, breaks
   gracefully on narrow viewports. The header row reuses the same
   grid template so columns align without explicit widths. */
.audit-table {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg-card);
}
.audit-row {
  display: grid;
  grid-template-columns: 160px 130px 1fr 1fr 1.4fr;
  gap: 12px;
  padding: 10px 14px;
  font-size: 13px;
  align-items: start;
  border-bottom: 1px solid var(--rule);
}
.audit-row:last-child { border-bottom: none; }
.audit-row--head {
  background: var(--bg-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.audit-row-when {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.audit-row-action {
  font-weight: 600;
  color: var(--ink);
}
.audit-row-actor,
.audit-row-target {
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-all;
}
.audit-row-diff {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
}
@media (max-width: 720px) {
  .audit-row { grid-template-columns: 1fr 1fr; }
  .audit-row--head { display: none; }
  .audit-row-when { grid-column: 1 / -1; }
  .audit-row-diff { grid-column: 1 / -1; }
}

/* ─────────── HISTORY / TEMPLATES / SAVED LISTS ─────────── */

.list-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  background: var(--bg-card);
  border-radius: var(--r-md);
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.list-row:hover {
  border-color: var(--violet-edge);
}
.list-row-meta {
  flex: 1;
  min-width: 0;
}
.list-row-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-row-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.list-row-action {
  flex-shrink: 0;
}

.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--rule);
  border-radius: var(--r-md);
}
.empty-state h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
  margin: 0 0 8px 0;
}
.empty-state p { margin: 0 auto; max-width: 420px; }
.empty-state .btn-primary { margin-top: 18px; }

.coming-soon-badge {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--violet-soft);
  color: var(--violet-dark);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-left: 10px;
  vertical-align: middle;
}


/* ─── Template + Saved-finding cards ─── */
.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.lib-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  transition: border-color 0.12s, transform 0.1s;
}
.lib-card:hover { border-color: var(--violet-edge); }
.lib-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.25;
  word-break: break-word;
}
.lib-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.lib-card-badge {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--bg);
  border: 1px solid var(--rule);
  color: var(--ink-2);
}
.lib-card-badge--violet {
  background: var(--violet-soft);
  border-color: var(--violet-edge);
  color: var(--violet-dark);
}
.lib-card-note {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lib-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--rule);
}
.lib-card-actions button {
  flex: 1;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--rule);
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.lib-card-actions button.primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.lib-card-actions button.primary:hover { background: #000; }
.lib-card-actions button:hover { background: var(--bg-card); border-color: var(--violet-edge); color: var(--violet-dark); }
.lib-card-actions button.danger:hover { border-color: rgba(155, 29, 29, 0.4); color: var(--sev-block-ink); }

/* Saved-finding excerpt block — italic quote style */
.lib-card-excerpt {
  position: relative;
  padding: 10px 14px 10px 16px;
  background: var(--bg-soft);
  border-radius: var(--r-sm);
  font-style: italic;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.5;
  border-left: 2px solid var(--violet-edge);
  word-wrap: break-word;
}
.lib-card-issue {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* Bookmark icon on finding-cards (post-rendered into result page) */
.finding-bookmark {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s, transform 0.1s;
  padding: 0;
}
.finding-bookmark:hover {
  background: var(--violet-soft);
  border-color: var(--violet-edge);
  color: var(--violet);
}
.finding-bookmark:active { transform: scale(0.95); }
.finding-bookmark.is-saved {
  background: var(--violet);
  border-color: var(--violet);
  color: #fff;
}
.finding-bookmark.is-saved:hover {
  background: var(--violet-dark);
  border-color: var(--violet-dark);
  color: #fff;
}
.finding-bookmark svg { width: 14px; height: 14px; }
.finding-card { padding-right: 56px; }  /* room for the bookmark */


/* ─────────── FEEDBACK FABs (Idea + Report, stacked) ─────────── */

.btn-report-fab,
.btn-feature-fab {
  position: fixed;
  right: 24px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  background: var(--ink);
  color: var(--bg);
  border: none;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  z-index: 30;
  box-shadow: 0 4px 16px rgba(20, 18, 14, 0.18);
  transition: transform 0.15s;
}
/* Stacked: Report stays at the original bottom-right anchor, Idea
   sits directly above with an 8px gap (FAB height ~40px + spacing). */
.btn-report-fab  { bottom: 24px; }
.btn-feature-fab { bottom: 72px; }
.btn-report-fab:hover,
.btn-feature-fab:hover { transform: translateY(-2px); }
.btn-report-fab[hidden],
.btn-feature-fab[hidden] { display: none; }


/* ─────────── MOBILE (≤ 900px): drawer + tighten ─────────── */

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 280px;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.22s ease-out;
    box-shadow: 4px 0 24px rgba(20, 18, 14, 0.08);
  }
  .sidebar.is-open { transform: translateX(0); }

  .drawer-toggle { display: inline-flex; }

  .app-main {
    padding: 72px 24px 56px;
  }

  .dashboard-head {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  .stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .content-row { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; gap: 16px; }
  .form-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .form-footer .btn-primary {
    justify-content: center;
  }
}

@media (max-width: 600px) {
  .app-main { padding: 64px 16px 48px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 16px; }
  .stat-card-value { font-size: 30px; }
  .display-h1 { font-size: 36px; }
  .display-h2 { font-size: 26px; }
  .chip { padding: 8px 12px 8px 10px; font-size: 12px; }
}


/* ════════════════════════════════════════════════════════════
 * Phase 2 — RESULT PAGE
 *
 * Restyles the components that main.js renders into #result so
 * the verdict / findings / rewrites land in the same brand
 * language as the rest of the new shell. Selectors mirror what
 * main.js emits (verdict-row, finding-card, rewrite-card, etc.)
 * — we don't change main.js, just override style.css's older
 * rules from below in the cascade.
 * ════════════════════════════════════════════════════════════ */

#result { display: block; }

#result > * + * { margin-top: 18px; }

.fade-in {
  animation: atlasFadeIn 0.32s ease-out both;
}
@keyframes atlasFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ─── Recovered banner ─── */
.recovered-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: var(--violet-soft);
  border: 1px solid var(--violet-edge);
  border-radius: var(--r-md);
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
}
.recovered-banner svg {
  flex-shrink: 0;
  color: var(--violet);
  margin-top: 2px;
}


/* ─── Quoted input (the marketing copy the user submitted) ─── */
.result-quote {
  position: relative;
  padding: 18px 22px 18px 36px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  font-style: italic;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.result-quote::before {
  content: "\201C";
  position: absolute;
  top: 8px;
  left: 14px;
  font-family: var(--font-display);
  font-size: 32px;
  color: var(--violet);
  line-height: 1;
}


/* Section heading + copy-row used by Findings / Disclosures / etc. */
.section-block { margin-top: 8px; }
.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.section-heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 14px 0 10px 0;
}
.section-heading-row .section-heading { margin: 0; }

.btn-copy-sm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
}
.btn-copy-sm:hover {
  background: var(--bg-card);
  border-color: var(--violet-edge);
  color: var(--violet-dark);
}

/* Disclosure / deep-notes lists */
.disclosure-list,
.deep-notes-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.disclosure-list li,
.deep-notes-list li {
  position: relative;
  padding: 10px 14px 10px 32px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.55;
}
.disclosure-list li::before,
.deep-notes-list li::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 17px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--violet);
}

/* High-risk word chips */
.risk-words-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.risk-word-tag {
  display: inline-flex;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: var(--sev-block);
  color: var(--sev-block-ink);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* "Upgrade to Pro" inline links + hints */
.upgrade-link {
  font-weight: 700;
  color: var(--violet);
  text-decoration: none;
  margin-left: 4px;
}
.upgrade-link:hover { text-decoration: underline; }

.upgrade-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  background: var(--violet-soft);
  border: 1px solid var(--violet-edge);
  border-radius: var(--r-md);
  font-size: 13px;
  color: var(--ink-2);
}
.upgrade-hint svg { color: var(--violet); flex-shrink: 0; }

/* Visual recs (rare path — image marketing analysis) */
.visual-recs-card {
  padding: 22px 24px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
}


/* ─── Verdict row + risk score ─── */
.verdict-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 16px;
  align-items: stretch;
}
@media (max-width: 600px) {
  .verdict-row { grid-template-columns: 1fr; }
}

.verdict-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  border-radius: var(--r-md);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.015em;
  border: 1px solid var(--rule);
}
.verdict-badge svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.verdict-badge--block {
  background: var(--sev-block);
  color: var(--sev-block-ink);
  border-color: rgba(155, 29, 29, 0.18);
}
.verdict-badge--warn {
  background: var(--sev-review);
  color: var(--sev-review-ink);
  border-color: rgba(122, 90, 13, 0.20);
}
.verdict-badge--pass {
  background: var(--sev-pass);
  color: var(--sev-pass-ink);
  border-color: rgba(26, 111, 87, 0.20);
}

/* main.js emits .risk-badge for the right-hand "Risk score: X / 100" */
.risk-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 24px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-align: center;
}
.risk-badge strong {
  display: inline-block;
  margin: 0 4px 0 6px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  color: var(--violet);
  letter-spacing: -0.02em;
}


/* ─── Jurisdiction + summary text rows ─── */
.jurisdiction-text {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.55;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
}
.jurisdiction-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.10em;
  color: var(--violet);
  text-transform: uppercase;
  margin-right: 6px;
}

.summary-text {
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.6;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
}

/* WP-truncation pill (when only first N pages of PDF parsed) */
.wp-truncated {
  display: inline-block;
  margin-left: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--amber);
  letter-spacing: 0.02em;
}


/* ─── Findings list ─── */
.findings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.finding-card {
  position: relative;
  padding: 18px 22px 18px 24px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--rule);
  border-radius: var(--r-md);
}
.finding-card--block,
.finding-card--blocker { border-left-color: var(--red); }
.finding-card--high    { border-left-color: var(--red); }
.finding-card--medium  { border-left-color: var(--amber); }
.finding-card--low     { border-left-color: var(--teal); }

.finding-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
/* main.js emits .severity-tag (not .finding-severity) — matching that. */
.severity-tag {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.severity-tag--block,
.severity-tag--blocker { background: var(--sev-block); color: var(--sev-block-ink); }
.severity-tag--high    { background: var(--sev-block); color: var(--sev-block-ink); }
.severity-tag--medium  { background: var(--sev-review); color: var(--sev-review-ink); }
.severity-tag--low     { background: var(--sev-pass); color: var(--sev-pass-ink); }
.finding-confidence {
  display: inline-flex;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: lowercase;
  border: 1px solid var(--rule);
  color: var(--muted);
  background: var(--bg);
}
.finding-confidence--high   { color: var(--teal); border-color: rgba(30, 166, 131, 0.30); }
.finding-confidence--medium { color: var(--amber); border-color: rgba(217, 156, 31, 0.30); }
.finding-confidence--low    { color: var(--muted); border-color: var(--rule); }

.finding-excerpt {
  position: relative;
  padding: 10px 14px 10px 18px;
  background: var(--bg-soft);
  border-radius: var(--r-sm);
  font-style: italic;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 10px;
  border-left: 2px solid var(--violet-edge);
}

.finding-body {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.55;
  margin-bottom: 10px;
}
.finding-body:last-child { margin-bottom: 0; }

.finding-sub-list {
  list-style: none;
  margin: 8px 0 0 0;
  padding: 0;
  border-top: 1px dashed var(--rule);
  padding-top: 10px;
}
.finding-sub-list li {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
  padding: 4px 0;
}
.finding-sub-angle {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--violet);
  font-weight: 600;
  text-transform: uppercase;
}

/* Legal basis (main.js emits this when plan has legal_reasoning) */
.legal-basis {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
}
.legal-basis-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.10em;
  color: var(--violet);
  text-transform: uppercase;
  margin-right: 6px;
}

/* Client comment (Pro+ only — Dasha-style commentary) */
.client-comment {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--violet-soft);
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
  font-style: italic;
}
.client-comment-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.10em;
  color: var(--violet-dark);
  text-transform: uppercase;
  margin-right: 6px;
  font-style: normal;
}

.finding-citations {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
}
.finding-citations-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.finding-citations-entry {
  margin-top: 8px;
  padding-left: 10px;
  border-left: 2px solid var(--rule);
}
.finding-citations-entry--legacy { border-left-color: var(--rule); }
.finding-citations-source {
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 500;
}
.finding-citations-source a { color: var(--violet); text-decoration: underline; text-decoration-color: var(--violet-edge); }
.finding-citations-source a:hover { text-decoration-color: var(--violet); }
.finding-citations-quote {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  line-height: 1.45;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ─── Findings upgrade banner (severity-gated paywall hint) ─── */
.findings-upgrade-banner {
  padding: 14px 16px 14px 18px;
  background: var(--violet-soft);
  border: 1px solid var(--violet-edge);
  border-left: 3px solid var(--violet);
  border-radius: var(--r-md);
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
}
.findings-upgrade-banner--soft {
  background: var(--bg-soft);
  border-color: var(--rule);
  border-left-color: var(--muted-2);
}
.findings-upgrade-banner strong { color: var(--violet-dark); font-weight: 700; }


/* ─── Rewrite card ─── */
.rewrite-card {
  padding: 22px 24px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
}
.rewrite-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.rewrite-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
}
.rewrite-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  margin-bottom: 14px;
  overflow-x: auto;
}
.rewrite-tab {
  flex: 1;
  padding: 9px 14px;
  background: transparent;
  border: none;
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}
.rewrite-tab:hover { color: var(--ink); }
.rewrite-tab--active {
  background: var(--ink);
  color: var(--bg);
}

.rewrite-panel { display: none; }
.rewrite-panel--active { display: block; }

.rewrite-text {
  padding: 16px 18px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  font-size: 14px;
  color: var(--ink);
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.rewrite-copy {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  transition: background 0.12s, border-color 0.12s;
}
.rewrite-copy:hover { background: var(--bg-card); border-color: var(--violet-edge); color: var(--violet-dark); }

.experimental-tag {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--violet-soft);
  color: var(--violet-dark);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}


/* ─── Limit-reached + connection-lost cards (errors) ─── */
.error-card,
.limit-card {
  padding: 22px 24px;
  background: var(--sev-block);
  border: 1px solid rgba(155, 29, 29, 0.18);
  border-radius: var(--r-md);
  color: var(--sev-block-ink);
}
.error-card strong,
.limit-card h3 {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  margin: 0 0 6px 0;
  color: var(--sev-block-ink);
}
.error-card .error-body,
.limit-card p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--sev-block-ink);
  opacity: 0.85;
  margin: 0;
}
.btn-report-error {
  margin-top: 12px;
  padding: 9px 16px;
  background: var(--sev-block-ink);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}


/* ─── New-review reset button (post-result) ─── */
.btn-new-review {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 22px;
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.btn-new-review:hover { background: #000; }


/* ════════════════════════════════════════════════════════════
 * Loading skeleton + SSE stage display
 * ════════════════════════════════════════════════════════════ */

.skeleton-wrap {
  padding: 22px 24px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
}

.loading-stage {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--violet-soft);
  border: 1px solid var(--violet-edge);
  border-radius: var(--r-sm);
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--violet-dark);
  font-weight: 500;
}
.loading-stage-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--violet);
  flex-shrink: 0;
  animation: atlasPulse 1.4s ease-in-out infinite;
}
@keyframes atlasPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.85); }
}
.loading-stage-text { flex: 1; }

.skeleton {
  background: linear-gradient(90deg, var(--bg-soft) 0%, #efebe2 50%, var(--bg-soft) 100%);
  background-size: 200% 100%;
  animation: atlasShimmer 1.6s ease-in-out infinite;
  border-radius: var(--r-sm);
  height: 16px;
  margin-bottom: 10px;
}
@keyframes atlasShimmer {
  0%   { background-position: -100% 0; }
  100% { background-position: 100% 0; }
}
.skeleton--wide  { width: 80%; }
.skeleton--bar   { width: 50%; height: 12px; }
.skeleton--card  { height: 64px; margin-top: 12px; }


/* ─── Submit button loading state (style.css uses .is-loading + inner spans) ─── */
.btn-check__loading {
  display: none;
  align-items: center;
  gap: 8px;
}
.btn-check.is-loading .btn-check__label,
.btn-check.is-loading .arrow { display: none; }
.btn-check.is-loading .btn-check__loading { display: inline-flex; }

.dot-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: atlasPulse 1.4s ease-in-out infinite;
  display: inline-block;
}


/* ─── Usage tag below submit ─── */
.usage-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
}


/* ─── Tooltips (used by main.js tooltip helper) ─── */
.tooltip-wrap {
  display: inline-block;
  position: relative;
  margin-left: 4px;
}
.tooltip-q {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--rule-strong);
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-mono);
  cursor: help;
  vertical-align: middle;
}
.tooltip-text {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-deep);
  color: #fff;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: 12px;
  line-height: 1.4;
  white-space: normal;
  width: 240px;
  text-align: left;
  z-index: 30;
  display: none;
  box-shadow: 0 4px 16px rgba(20, 18, 14, 0.18);
}
.tooltip-wrap:hover .tooltip-text,
.tooltip-q:focus + .tooltip-text { display: block; }

/* ═══════════════ Compare plans (full feature matrix) ═══════════════ */
.compare-plans { margin-top: 56px; }
.compare-plans-head { margin-bottom: 24px; }
.compare-plans-head .display-h2 { margin: 0 0 6px; }
.compare-plans-head .lead { margin: 0; color: var(--muted); }

.compare-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 14px;
  min-width: 760px;
}
.compare-table thead th {
  text-align: left;
  vertical-align: bottom;
  padding: 28px 20px 24px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg-card);
  position: relative;
}
.compare-table thead th.feature-col {
  width: 30%;
  min-width: 200px;
}
.compare-table thead th.plan-col {
  width: 17.5%;
  min-width: 160px;
  text-align: center;
}
.compare-table thead th.plan-col--highlighted {
  background: var(--violet-soft);
  border-left: 1px solid var(--violet-edge);
  border-right: 1px solid var(--violet-edge);
  border-top: 1px solid var(--violet-edge);
  border-radius: 12px 12px 0 0;
}
.plan-badge {
  display: inline-block;
  padding: 3px 9px;
  background: var(--violet);
  color: #fff;
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
  border-radius: 999px;
  margin-bottom: 10px;
}
.plan-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}
.plan-price {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.plan-price .plan-period {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 2px;
}
.plan-tagline {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.compare-table tbody td,
.compare-table tbody th {
  padding: 14px 20px;
  border-top: 1px solid var(--rule);
  vertical-align: middle;
}
.compare-table tbody th.feature-name {
  text-align: left;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--bg-soft);
}
.compare-table tbody td {
  text-align: center;
  color: var(--ink);
}
.compare-table tbody td.cell-yes {
  color: var(--teal);
  font-weight: 700;
  font-size: 17px;
}
.compare-table tbody td.cell-no {
  color: var(--muted-2);
}
.compare-table tbody tr:hover td:not([data-cta]),
.compare-table tbody tr:hover th.feature-name { background: rgba(105, 39, 218, 0.03); }

/* Highlighted Pro column carries through tbody too */
.compare-table tbody td:nth-child(4) {
  background: rgba(236, 228, 255, 0.4);
  border-left: 1px solid var(--violet-edge);
  border-right: 1px solid var(--violet-edge);
}

/* CTA row */
.compare-cta-row td { padding: 22px 14px 26px !important; }
.compare-cta-row td:nth-child(4) {
  border-bottom: 1px solid var(--violet-edge);
  border-radius: 0 0 12px 12px;
}
.compare-cta {
  display: inline-block;
  width: 100%;
  max-width: 180px;
  padding: 11px 14px;
  border: 1px solid var(--rule-strong);
  background: var(--bg-card);
  color: var(--ink);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 120ms, color 120ms, border-color 120ms;
}
.compare-cta:hover:not(:disabled) {
  background: var(--bg-soft);
  border-color: var(--ink-2);
}
.compare-cta:disabled,
.compare-cta--current {
  cursor: default;
  opacity: 0.55;
  background: var(--bg-soft);
  border-color: var(--rule);
  color: var(--muted);
}
.compare-cta--primary {
  background: var(--violet);
  color: #fff;
  border-color: var(--violet);
}
.compare-cta--primary:hover:not(:disabled) {
  background: var(--violet-dark);
  border-color: var(--violet-dark);
  color: #fff;
}
.compare-cta--ghost {
  background: transparent;
  border-color: var(--ink-2);
  color: var(--ink);
}

/* ═══════════════ FAQ ═══════════════ */
.faq-section { margin-top: 56px; }
.faq-head { margin-bottom: 24px; }
.faq-head .display-h2 { margin: 0; }

.faq-list {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 14px;
  overflow: hidden;
}
.faq-item { border-top: 1px solid var(--rule); }
.faq-item:first-child { border-top: 0; }

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 24px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: background 120ms;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 400;
  color: var(--violet);
  flex-shrink: 0;
  width: 22px;
  text-align: center;
  line-height: 1;
  transition: transform 200ms;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item summary:hover { background: var(--bg-soft); }
.faq-item[open] summary { background: var(--violet-soft); color: var(--violet-dark); }
.faq-item p {
  margin: 0;
  padding: 0 24px 22px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 720px;
}
.faq-item p a { color: var(--violet); text-decoration: underline; }

@media (max-width: 720px) {
  .compare-plans, .faq-section { margin-top: 40px; }
  .compare-table thead th { padding: 18px 12px; }
  .compare-table tbody td,
  .compare-table tbody th { padding: 12px; }
  .plan-name { font-size: 18px; }
  .plan-price { font-size: 22px; }
  .faq-item summary { padding: 14px 18px; font-size: 14px; }
  .faq-item p { padding: 0 18px 16px; }
}

/* ═══════════════ Beta banner (soft-launch) ═══════════════ */
.beta-banner {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 9px 18px;
  background: linear-gradient(90deg, var(--violet) 0%, #8b50e0 100%);
  color: #fff;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.4;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 12px rgba(105, 39, 218, 0.18);
}
.beta-banner[hidden] { display: none; }
.beta-banner-pill {
  display: inline-block;
  padding: 2px 9px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.beta-banner-text {
  flex: 1;
  text-align: center;
  max-width: 720px;
}
.beta-banner-text a,
.beta-banner-link {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
  background: transparent;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.beta-banner-text a:hover,
.beta-banner-link:hover { opacity: 0.85; }
.beta-banner-close {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
}
.beta-banner-close:hover {
  background: rgba(255, 255, 255, 0.16);
}
@media (max-width: 720px) {
  .beta-banner {
    font-size: 12px;
    padding: 8px 12px;
    gap: 8px;
  }
  .beta-banner-text { text-align: left; }
}

/* ═══════════════ Profile editor (Settings) ═══════════════ */
.profile-editor {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 28px;
  margin-bottom: 20px;
}
.profile-editor[hidden] { display: none; }

.profile-editor-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  align-items: flex-start;
}

.avatar-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}
.avatar-circle {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 2px dashed var(--rule-strong);
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.avatar-circle:hover {
  border-color: var(--violet);
  background: var(--violet-soft);
}
.avatar-circle--dragover {
  border-color: var(--violet);
  background: var(--violet-soft);
  border-style: solid;
}
.avatar-initials {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 40px;
  color: var(--ink-2);
  letter-spacing: -0.02em;
}
.avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Same specificity as the rule above — browser default [hidden]{display:none}
   would lose to .avatar-image{display:block}, leaving an empty <img> showing
   the broken-image placeholder over the initials. Be explicit. */
.avatar-image[hidden] { display: none !important; }
.avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 14, 0.55);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}
.avatar-circle:hover .avatar-overlay,
.avatar-circle--dragover .avatar-overlay { opacity: 1; }

.avatar-actions {
  display: flex;
  gap: 14px;
  margin-top: 4px;
}
.avatar-actions .btn-link {
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  border: none;
  color: var(--violet);
  padding: 0;
  text-decoration: none;
}
.avatar-actions .btn-link:hover { color: var(--violet-dark); text-decoration: underline; }
.avatar-actions .btn-link--danger { color: var(--red, #c54545); }
.avatar-actions .btn-link--danger:hover { color: #8a2828; }
.avatar-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.profile-fields {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.profile-fields .auth-field { margin: 0; }
.profile-fields .auth-input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px 14px;
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.12s;
}
.profile-fields .auth-input:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 3px var(--violet-soft);
}
.profile-fields .auth-input:disabled {
  background: var(--bg-soft);
  color: var(--muted);
  cursor: not-allowed;
}
.profile-fields textarea.auth-input {
  resize: vertical;
  min-height: 70px;
  line-height: 1.5;
}
.profile-fields label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.profile-field-hint {
  font-size: 11px;
  color: var(--muted);
  margin: 6px 0 0;
}

.profile-error {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #7f1d1d;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
}
.profile-error[hidden] { display: none; }

.profile-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.profile-saved {
  font-size: 13px;
  color: var(--teal, #1ea683);
  font-weight: 600;
  animation: profile-saved-fade 0.25s ease-out;
}
.profile-saved[hidden] { display: none; }
@keyframes profile-saved-fade {
  from { opacity: 0; transform: translateX(-4px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Sidebar avatar that swaps initials for a real image */
.sidebar-user-avatar--img {
  padding: 0;
  overflow: hidden;
}
.sidebar-user-avatar--img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 720px) {
  .profile-editor { padding: 18px; }
  .profile-editor-row {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .avatar-circle { width: 110px; height: 110px; }
  .avatar-initials { font-size: 32px; }
}
