/* =============================================================================
   Prompting TSEC — redesign layer ("Werkbank")
   Loads AFTER the legacy stylesheets. Two jobs:
     1. BRIDGE  — re-point the legacy custom properties at the new semantic
                  tokens, so existing rules inherit the new palette instead of
                  being rewritten one by one.
     2. FIXES   — typography, focus, forms, buttons and the accessibility and
                  responsive defects listed in docs/design-audit/04-findings.md.
   Requires css/tokens.css to be loaded first.
   ========================================================================== */

/* ---------------------------------------------------------------------------
   1. BRIDGE — legacy variables, expressed in new tokens
   These names come from styles.css :root. Redefining them here (later in the
   cascade) re-colours everything that already uses them, in BOTH themes,
   without touching the 510 [data-theme="dark"] rules.
   -------------------------------------------------------------------------- */
:root,
body[data-theme="dark"],
:root[data-theme="dark"] {
  --brand-blue:      var(--accent);
  --light-blue:      var(--accent-hover);
  --light-blue-bg:   var(--surface-accent);
  --neutral-50:      var(--bg-page);
  --neutral-100:     var(--surface-subtle);
  --neutral-700:     var(--text-secondary);
  --success-500:     var(--success);

  --shadow-sm:       var(--shadow-raised);
  --shadow-md:       var(--shadow-raised);
  --shadow-lg:       var(--shadow-overlay);

  --dark-bg:         var(--bg-page);
  --dark-card-bg:    var(--surface);
  --darker-bg:       var(--surface-subtle);
  --dark-text:       var(--text-primary);
  --dark-muted:      var(--text-muted);
  --dark-border:     var(--border);
  --dark-input-bg:   var(--surface);
  --dark-hover:      var(--surface-subtle);
  --dark-shadow:     rgba(0, 0, 0, 0.36);
  --dark-disabled-bg:var(--disabled-bg);

  --text-color:      var(--text-primary);
  --card-bg:         var(--surface);
  --input-bg:        var(--surface);
  --border-color:    var(--border);
  --hover-bg:        var(--surface-subtle);
}
/* --text-muted exists in both systems with different meanings; the token wins. */

/* Bootstrap variables, so its components follow the theme too. */
:root {
  --bs-body-bg: var(--surface);
  --bs-body-color: var(--text-primary);
  --bs-border-color: var(--border);
  --bs-primary: var(--accent);
  --bs-link-color: var(--accent-text);
  --bs-link-hover-color: var(--accent-hover);
  --bs-secondary-color: var(--text-muted);
  --bs-tertiary-bg: var(--surface-subtle);
  --bs-emphasis-color: var(--text-primary);
}

/* ---------------------------------------------------------------------------
   2. Page ground and typography
   -------------------------------------------------------------------------- */
html { -webkit-text-size-adjust: 100%; }

html { background: var(--bg-page); }
body,
body[data-theme="dark"],
[data-theme="dark"] body {
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--selection-bg); color: var(--selection-text); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}
h3, h4, h5, h6 { letter-spacing: var(--tracking-normal); }

a { color: var(--accent-text); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }

.text-muted, small.text-muted, .form-text {
  color: var(--text-muted) !important;
}

/* ---------------------------------------------------------------------------
   3. Focus — one rule, everywhere, never removed  (WCAG 2.4.7 / 1.4.11)
   -------------------------------------------------------------------------- */
:where(a, button, input, textarea, select, summary, [tabindex], .ai-option, .suggestion-btn, .chip):focus-visible {
  outline: var(--border-width-strong) solid var(--focus-ring) !important;
  outline-offset: 2px !important;
  border-radius: var(--radius-sm);
  box-shadow: none !important;
}
.btn-primary:focus-visible,
.execute-button:focus-visible,
#analyzeButton:focus-visible { outline-offset: 3px !important; }

/* ---------------------------------------------------------------------------
   4. Motion  (WCAG 2.3.3)
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------------------------------------------------------------------
   5. Skip link + landmarks
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute; left: var(--space-4); top: var(--space-4);
  transform: translateY(-250%);
  background: var(--surface-elevated); color: var(--text-primary);
  border: var(--border-width) solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-4);
  z-index: 2000; text-decoration: none; font-weight: var(--weight-medium);
  transition: transform var(--dur-fast) var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }
.visually-hidden-focusable:not(:focus):not(:focus-within) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* ---------------------------------------------------------------------------
   6. Form controls  (fixes F15 input borders at 1.23:1, F24 centred labels,
      F35 disabled fields that look editable)
   -------------------------------------------------------------------------- */
.form-control, .form-select, input[type="text"], input[type="email"],
input[type="password"], input[type="search"], textarea, select {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--surface);
  border: var(--border-width) solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  transition: border-color var(--dur-fast) var(--ease-out);
}
.form-control:hover:not(:disabled), textarea:hover:not(:disabled) { border-color: var(--text-muted); }
.form-control:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  background-color: var(--surface);
  color: var(--text-primary);
  box-shadow: none;
}
.form-control::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 1; }

.form-control:disabled, .form-control[readonly], textarea:disabled, select:disabled {
  background-color: var(--disabled-bg);
  color: var(--disabled-text);
  border-color: var(--disabled-border);
  border-style: dashed;
  cursor: not-allowed;
  opacity: 1;
}

.form-label, label.form-label {
  display: block;
  text-align: left;
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}
.form-check-input { border-color: var(--border-strong); background-color: var(--surface); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }

/* Field-level error presentation (replaces alert()) */
.field-error {
  display: flex; align-items: flex-start; gap: var(--space-2);
  margin-top: var(--space-2);
  font-size: var(--text-sm); color: var(--error); font-weight: var(--weight-medium);
}
.field-error svg { flex: none; margin-top: 0.15em; }
.is-invalid, .form-control.is-invalid, textarea.is-invalid {
  border-color: var(--error) !important;
  border-width: var(--border-width-strong) !important;
  background-image: none !important;
}

/* ---------------------------------------------------------------------------
   7. Buttons — three tiers plus destructive
   -------------------------------------------------------------------------- */
.btn {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  border-radius: var(--radius-sm);
  min-height: 2.5rem;
  padding: var(--space-2) var(--space-4);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  line-height: 1.2;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.btn-primary {
  background-color: var(--accent); border-color: var(--accent); color: var(--text-on-accent);
}
.btn-primary:hover:not(:disabled) { background-color: var(--accent-hover); border-color: var(--accent-hover); color: var(--text-on-accent); }
.btn-primary:active:not(:disabled) { background-color: var(--accent-active); border-color: var(--accent-active); color: var(--text-on-accent); }
.btn-secondary, .btn-light, .btn-outline-secondary {
  background-color: var(--surface); border-color: var(--border-strong); color: var(--text-primary);
}
.btn-secondary:hover:not(:disabled), .btn-light:hover:not(:disabled), .btn-outline-secondary:hover:not(:disabled) {
  background-color: var(--surface-subtle); border-color: var(--border-strong); color: var(--text-primary);
}
.btn-danger { background-color: var(--surface); border-color: var(--error-border); color: var(--error); }
.btn-danger:hover:not(:disabled) { background-color: var(--error-subtle); border-color: var(--error); color: var(--error); }
.btn:disabled, .btn[disabled], .btn.disabled {
  background-color: var(--disabled-bg) !important;
  border-color: var(--disabled-border) !important;
  color: var(--disabled-text) !important;
  opacity: 1;
  cursor: not-allowed;
}
/* Text that explains WHY a primary action is unavailable (F28). */
.btn-blocked-reason {
  display: block; margin-top: var(--space-2);
  font-size: var(--text-sm); color: var(--text-muted);
}

/* ---------------------------------------------------------------------------
   8. Surfaces, notes, badges
   -------------------------------------------------------------------------- */
.card, .modal-content {
  background-color: var(--surface);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  box-shadow: none;
}
.modal-content { border-radius: var(--radius-lg); box-shadow: var(--shadow-overlay); background-color: var(--surface-elevated); }
.modal-header, .modal-footer { border-color: var(--border-subtle); background: transparent; }
.modal-backdrop.show { background-color: var(--overlay-scrim); opacity: 1; }

.note {
  display: flex; gap: var(--space-3); align-items: flex-start;
  padding: var(--space-3) var(--space-4);
  border: var(--border-width) solid var(--info-border);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  background: var(--info-subtle);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.note svg { flex: none; margin-top: 0.15em; color: var(--info); }
.note strong { color: var(--text-primary); }
.note--success { border-color: var(--success-border); background: var(--success-subtle); }
.note--success svg { color: var(--success); }
.note--warning { border-color: var(--warning-border); background: var(--warning-subtle); }
.note--warning svg { color: var(--warning); }
.note--error   { border-color: var(--error-border); background: var(--error-subtle); }
.note--error svg { color: var(--error); }

.alert { border-radius: var(--radius-sm); border-width: var(--border-width); border-left-width: 3px; font-size: var(--text-sm); }
.alert-info    { background: var(--info-subtle);    border-color: var(--info-border);    color: var(--text-secondary); }
.alert-success { background: var(--success-subtle); border-color: var(--success-border); color: var(--text-secondary); }
.alert-danger  { background: var(--error-subtle);   border-color: var(--error-border);   color: var(--text-secondary); }
.alert-warning { background: var(--warning-subtle); border-color: var(--warning-border); color: var(--text-secondary); }

.badge { border-radius: var(--radius-xs); font-weight: var(--weight-semibold); font-size: var(--text-xs); }
.badge.bg-primary { background-color: var(--accent-subtle) !important; color: var(--accent-text); border: var(--border-width) solid var(--accent-border); }

/* Bootstrap tooltips had no dark rule at all (F20). */
.tooltip-inner {
  background-color: var(--surface-elevated);
  color: var(--text-primary);
  border: var(--border-width) solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-overlay);
  font-size: var(--text-sm);
  text-align: left;
  max-width: 22rem;
  padding: var(--space-2) var(--space-3);
}
.tooltip .tooltip-arrow::before { border-top-color: var(--border-strong); border-bottom-color: var(--border-strong); border-left-color: var(--border-strong); border-right-color: var(--border-strong); }
.tooltip.show { opacity: 1; }

/* ---------------------------------------------------------------------------
   9. Marketing pages — landing
   Replaces the tinted hero, the alternating bands and the emoji card icons with
   a quiet, sectioned document. The serif is used for display type only.
   -------------------------------------------------------------------------- */
.display,
.hero h1,
.section-subtitle {
  font-family: var(--font-serif);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
}

.top-nav-bar {
  background: var(--surface);
  border-bottom: var(--border-width) solid var(--border);
  min-height: 3.5rem;
  padding-inline: var(--space-5);
  gap: var(--space-3);
  position: sticky; top: 0; z-index: 30;
}
.top-nav-bar .btn { min-height: 2.25rem; }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem;
  padding: 0;
  background: transparent;
  border: var(--border-width) solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0;
}
.theme-toggle:hover { background: var(--surface-subtle); color: var(--text-primary); border-color: var(--border); }
.theme-toggle svg { display: block; }

.hero {
  background: var(--bg-page);
  padding-block: var(--space-9) var(--space-8);
  border-bottom: var(--border-width) solid var(--border);
}
.hero::before, .hero::after, .hero-shape, .cta-shape, .how-it-works-bg-pattern { display: none !important; }
.hero h1 { font-size: var(--text-4xl); max-width: 18ch; color: var(--text-primary); }
.hero .lead, .hero p { color: var(--text-secondary); font-size: var(--text-lg); max-width: 54ch; }
.eyebrow {
  font-size: var(--text-xs); font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide); text-transform: uppercase;
  color: var(--text-muted); margin: 0 0 var(--space-2);
}

.section { padding-block: var(--space-8); }
.section.bg-light { background: var(--bg-page) !important; border-block: var(--border-width) solid var(--border); }
.section-title {
  font-size: var(--text-xs); font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide); text-transform: uppercase;
  color: var(--text-muted);
}
.section-subtitle { font-size: var(--text-2xl); color: var(--text-primary); }

/* Feature cards: no emoji icons, no shadows, one border. */
.card-icon { display: none; }
#features .card, .section .card {
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: none;
}
#features .card-body { text-align: left !important; padding: var(--space-5); }
#features .card-title { font-size: var(--text-lg); color: var(--text-primary); }
#features .card-text { color: var(--text-secondary); font-size: var(--text-sm); }

/* The three "choose a guide" cards */
#mainSelection.cards { gap: var(--space-5); }
#mainSelection .card { box-shadow: none; border: var(--border-width) solid var(--border); border-radius: var(--radius-md); }
#mainSelection .card:hover { border-color: var(--border-strong); transform: none; box-shadow: none; }
#mainSelection .card h2 { font-size: var(--text-lg); color: var(--text-primary); }
#mainSelection .card p { color: var(--text-secondary); font-size: var(--text-sm); }
#mainSelection .card img { max-height: 2.5rem; width: auto; }
.beta-badge {
  background: var(--surface-subtle); color: var(--text-secondary);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-xs); font-size: var(--text-2xs);
  font-weight: var(--weight-semibold); letter-spacing: var(--tracking-wide);
}

/* Numbered process flow */
.process-step { border: none; background: transparent; box-shadow: none; }
.process-content { background: transparent; border: none; box-shadow: none; padding: 0 0 var(--space-5) 0; }
.process-content h3 { font-size: var(--text-md); color: var(--text-primary); margin-bottom: var(--space-1); }
.process-content p { color: var(--text-secondary); font-size: var(--text-sm); }
.step-number {
  background: var(--surface); color: var(--text-secondary);
  border: var(--border-width) solid var(--border-strong);
  font-family: var(--font-mono); font-size: var(--text-xs); font-weight: var(--weight-medium);
  width: 1.5rem; height: 1.5rem;
  display: grid; place-items: center;
}

/* Closing call to action: a bordered panel, not a full-bleed saturated band.
   This is also what removes the 2.03:1 blue-on-blue heading in dark mode (F16). */
.section.cta {
  background: var(--surface) !important;
  border-block: var(--border-width) solid var(--border);
  color: var(--text-primary);
}
.section.cta h2 { color: var(--text-primary) !important; font-family: var(--font-serif); }
.section.cta .lead, .section.cta p { color: var(--text-secondary) !important; }
.section.cta .btn-light {
  background: var(--accent); border-color: var(--accent); color: var(--text-on-accent);
}
.section.cta .btn-light:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--text-on-accent); }

/* Footer */
.footer {
  background: var(--surface);
  border-top: var(--border-width) solid var(--border);
  padding-block: var(--space-6);
  font-size: var(--text-sm);
}
.footer-title { font-size: var(--text-sm); color: var(--text-primary); margin-bottom: var(--space-2); }
.footer-links a {
  color: var(--text-secondary); text-decoration: none;
  display: inline-block; padding-block: 4px;   /* keeps the 24px target height */
}
.footer-links a:hover { color: var(--text-primary); text-decoration: underline; }
.copyright { color: var(--text-muted); border-top: var(--border-width) solid var(--border-subtle); padding-top: var(--space-4); margin-top: var(--space-5); }

/* Hero illustration: the SVG was a light-mode asset sitting on a near-black
   ground in dark mode (F16/theme). Give it a surface of its own in both. */
.hero-illustration { background: var(--surface-accent); border: var(--border-width) solid var(--accent-border); border-radius: var(--radius-md); }

@media (max-width: 46rem) {
  .hero { padding-block: var(--space-7) var(--space-6); }
  .hero h1 { font-size: var(--text-2xl); }
  .section { padding-block: var(--space-7); }
  .top-nav-bar { padding-inline: var(--space-4); }
}

/* ---------------------------------------------------------------------------
   10. Dark-mode reconciliation
   The legacy stylesheets contain 510 [data-theme="dark"] rules. Many pair a
   BACKGROUND taken from --brand-blue with a light FOREGROUND, which was safe
   when --brand-blue was a dark blue in both themes but is not once the accent
   is re-picked for dark ground. Rather than editing 16 files, the affected
   selector families are re-paired here, at matching specificity, later in the
   cascade. Each pair is <accent surface> + <ink that belongs on it>.
   -------------------------------------------------------------------------- */
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] .btn-primary:focus,
[data-theme="dark"] .lang-switch.btn-primary,
[data-theme="dark"] .submit-button,
[data-theme="dark"] .execute-button,
[data-theme="dark"] .section.cta .btn-light {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--text-on-accent);
}
[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] .submit-button:hover,
[data-theme="dark"] .section.cta .btn-light:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--text-on-accent);
}

/* Outline / ghost treatments keep the accent as TEXT on the page ground. */
[data-theme="dark"] .btn-outline,
[data-theme="dark"] .btn-outline-primary,
[data-theme="dark"] .btn-outline:hover,
[data-theme="dark"] .btn-outline-primary:hover {
  color: var(--accent-text);
  border-color: var(--accent-border);
  background-color: transparent;
}
[data-theme="dark"] .btn-outline:hover,
[data-theme="dark"] .btn-outline-primary:hover { background-color: var(--accent-subtle); }

/* Tinted chips and category pills */
[data-theme="dark"] .category-button,
.category-button {
  background-color: var(--surface-subtle);
  color: var(--text-primary);
  border: var(--border-width) solid var(--border);
}
[data-theme="dark"] .category-button:hover,
[data-theme="dark"] .category-button.active,
.category-button:hover, .category-button.active {
  background-color: var(--surface-accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

/* Inputs: styles-main.css sets a 1px #e2e8f0 border at equal specificity, and
   styles-auth.css re-tints it in dark. Both measured ~1.2:1 (F15). */
.form-control, .form-control:not(:focus),
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-control:not(:focus),
.auth-card .form-control,
[data-theme="dark"] .auth-card .form-control {
  border: var(--border-width) solid var(--border-strong);
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  color: var(--text-primary);
}
.form-control:focus,
[data-theme="dark"] .form-control:focus,
.auth-card .form-control:focus {
  border-color: var(--accent);
  box-shadow: none;
  background-color: var(--surface);
  color: var(--text-primary);
}
.form-control:disabled, [data-theme="dark"] .form-control:disabled,
.form-control[readonly], [data-theme="dark"] .form-control[readonly] {
  background-color: var(--disabled-bg);
  color: var(--disabled-text);
  border-color: var(--disabled-border);
  border-style: dashed;
}

/* Links: Bootstrap's #0d6efd measured 4.3:1 light / 3.87:1 dark (F16). */
a, a:visited,
[data-theme="dark"] a,
.auth-links a, .auth-card a,
[data-theme="dark"] .auth-links a, [data-theme="dark"] .auth-card a {
  color: var(--accent-text);
}
a:hover, [data-theme="dark"] a:hover { color: var(--accent-hover); }

/* A visited anchor has higher specificity than .btn-primary in the generic link
   rule above. Keep CTA text paired with its solid button surface in both themes. */
a.btn-primary, a.btn-primary:visited,
a.btn-primary:hover, a.btn-primary:active,
[data-theme="dark"] a.btn-primary,
[data-theme="dark"] a.btn-primary:visited,
[data-theme="dark"] a.btn-primary:hover,
[data-theme="dark"] a.btn-primary:active,
.section.cta a.btn-light, .section.cta a.btn-light:visited,
.section.cta a.btn-light:hover, .section.cta a.btn-light:active {
  color: var(--text-on-accent);
}

/* Password-requirement rows: state must not rest on colour alone (F18). */
.requirement, .password-requirements li, .requirement-item {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}
.requirement.valid, .requirement-item.valid { color: var(--success); }
.requirement.invalid, .requirement-item.invalid { color: var(--text-secondary); }
[data-theme="dark"] .requirement.valid, [data-theme="dark"] .requirement-item.valid { color: var(--success); }
[data-theme="dark"] .requirement, [data-theme="dark"] .requirement-item { color: var(--text-secondary); }

/* Disabled submit buttons stay legible even though 1.4.3 exempts them. */
.btn:disabled, .btn[disabled], button:disabled,
[data-theme="dark"] .btn:disabled, [data-theme="dark"] button:disabled,
.submit-button:disabled, [data-theme="dark"] .submit-button:disabled {
  background-color: var(--disabled-bg) !important;
  border-color: var(--disabled-border) !important;
  color: var(--disabled-text) !important;
  opacity: 1 !important;
  cursor: not-allowed;
}

/* Auth pages: the card is a surface, labels are left-aligned (F24). */
.auth-card, .auth-container .card {
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: none;
}
.auth-card h1, .auth-card h2 { color: var(--text-primary); font-size: var(--text-2xl); }
.auth-card .form-label, .auth-card label { text-align: left; }
.auth-card .text-center .form-label { text-align: left; }

/* ---------------------------------------------------------------------------
   11. Landing hero — brand and worked example
   -------------------------------------------------------------------------- */
.nav-brand {
  display: inline-flex; align-items: center; gap: var(--space-2);
  text-decoration: none; color: var(--text-primary);
  font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight);
  white-space: nowrap; margin-right: var(--space-4);
}
.nav-brand:hover { color: var(--text-primary); }
.nav-brand__mark {
  width: 1.5rem; height: 1.5rem; flex: none;
  border-radius: var(--radius-xs); background: var(--accent);
  color: var(--text-on-accent);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: var(--text-xs); font-weight: var(--weight-bold);
}
.nav-brand__suffix { color: var(--text-muted); font-weight: var(--weight-regular); }

.hero-example {
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}
.hero-example__title { font-size: var(--text-lg); color: var(--text-primary); margin: 0 0 var(--space-4); font-family: var(--font-sans); letter-spacing: var(--tracking-normal); }
.hero-example__caption {
  font-size: var(--text-xs); font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide); text-transform: uppercase;
  color: var(--text-muted); margin: var(--space-4) 0 var(--space-2);
}
.hero-example__caption:first-of-type { margin-top: 0; }
.hero-example__code {
  background: var(--surface-subtle);
  border: var(--border-width) solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: var(--leading-loose);
  color: var(--text-primary);
  white-space: pre-wrap;
  overflow-x: auto;
}
.hero-example__code--before { color: var(--text-secondary); }
.hero-example__code strong { color: var(--text-secondary); font-family: var(--font-sans); font-weight: var(--weight-semibold); }

/* The how-it-works artwork is a light-mode SVG; give it its own surface so it
   never sits directly on a near-black ground. */
.how-it-works-video-container,
.how-it-works-video {
  background: var(--surface-accent);
  border: var(--border-width) solid var(--accent-border);
  border-radius: var(--radius-md);
}

@media (max-width: 46rem) {
  .nav-brand__name { display: none; }
  .nav-brand { margin-right: var(--space-2); }
  .hero-example { padding: var(--space-4); }
}

/* .btn-secondary carries the wizard's "Terug" action; its dark border resolved
   to --border (decorative, 1.8:1) rather than --border-strong. Pin both themes. */
.btn-secondary, [data-theme="dark"] .btn-secondary,
.btn-light, [data-theme="dark"] .btn-light,
.btn-outline-secondary, [data-theme="dark"] .btn-outline-secondary {
  border-color: var(--border-strong);
  background-color: var(--surface);
  color: var(--text-primary);
}
.btn-secondary:hover, [data-theme="dark"] .btn-secondary:hover,
.btn-light:hover, [data-theme="dark"] .btn-light:hover {
  background-color: var(--surface-subtle);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

/* Guide-page example tags: a solid surface reads the same in both themes and
   removes the translucent-tint stacking the legacy rules relied on. */
.tag, [data-theme="dark"] .tag {
  background-color: var(--accent-subtle);
  color: var(--accent-text);
  border: var(--border-width) solid var(--accent-border);
  border-radius: var(--radius-xs);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  padding: var(--space-1) var(--space-2);
}

/* ---------------------------------------------------------------------------
   12. Wizard
   -------------------------------------------------------------------------- */
.wizard-main { display: block; width: 100%; }

/* App bar */
.appbar {
  background: var(--surface);
  border-bottom: var(--border-width) solid var(--border);
  position: sticky; top: 0; z-index: 40;
  width: 100%;
  margin-bottom: var(--space-5);
}
.appbar__inner {
  display: flex; align-items: center; gap: var(--space-3);
  min-height: 3.5rem; min-width: 0;
  max-width: var(--container-app); margin-inline: auto;
  padding-inline: var(--space-5);
}
.appbar__end { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.meter {
  display: inline-flex; align-items: baseline; gap: var(--space-2);
  font-size: var(--text-sm); color: var(--text-secondary);
  background: var(--surface-subtle);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-3);
  text-decoration: none; white-space: nowrap;
}
.meter:hover { border-color: var(--border-strong); color: var(--text-primary); }
.meter__value { font-family: var(--font-mono); font-weight: var(--weight-medium); color: var(--text-primary); }
.meter--low { border-color: var(--warning-border); background: var(--warning-subtle); }
.meter--low .meter__value { color: var(--warning); }

/* The working column: the wizard ran full-bleed at ~180 characters a line. */
#promptGenerator,
.wizard-container,
#result {
  max-width: var(--container-app);
  margin-inline: auto;
  width: 100%;
}
.wizard-step .step-content,
.wizard-step .form-card { max-width: 100%; }
.wizard-step .form-control,
.wizard-step textarea { max-width: var(--measure-form); }

/* One level of surface nesting: the panel, then wells inside it. */
.wizard-step, #result {
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  box-shadow: none;
}
.wizard-step .form-card,
.wizard-step .option-card {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  margin-bottom: var(--space-6);
}
/* An option-card with no content was rendering as a stray tinted bar (F33). */
.wizard-step .option-card:empty,
.wizard-step .form-card:empty { display: none; }

.wizard-header { text-align: left; margin-bottom: var(--space-5); }
.wizard-header h3 {
  font-size: var(--text-xl); color: var(--text-primary);
  display: flex; align-items: center; gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.wizard-header h3:focus { outline: none; }
.wizard-header p { text-align: left; color: var(--text-secondary); font-size: var(--text-sm); max-width: var(--measure-prose); margin: 0; }
.field-hint { display: block; font-size: var(--text-sm); color: var(--text-muted); margin-top: var(--space-2); max-width: var(--measure-prose); }

/* Progress */
.wizard-progress { margin-bottom: var(--space-5); }
.wizard-progress__meta {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: var(--space-2) var(--space-4); margin-bottom: var(--space-2);
  font-size: var(--text-sm); color: var(--text-muted);
}
.wizard-progress__meta strong { color: var(--text-primary); font-weight: var(--weight-semibold); }
.wizard-progress__track { display: flex; gap: var(--space-1); list-style: none; margin: 0; padding: 0; height: 0.25rem; }
.wizard-progress__seg { flex: 1; background: var(--border); border-radius: var(--radius-xs); }
.wizard-progress__seg.is-done { background: var(--accent); }
.wizard-progress__seg.is-current { background: var(--accent); opacity: 0.55; }

/* Assistant / detail-level / experience choices as real radios */
.ai-choice { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--space-3); }
.choice {
  position: relative; display: flex; align-items: center; gap: var(--space-2);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: var(--space-3) var(--space-4);
  cursor: pointer; margin: 0;
  transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.choice:hover { border-color: var(--border-strong); background: var(--surface-subtle); }
.choice input[type="radio"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice__dot {
  width: 1rem; height: 1rem; flex: none; border-radius: var(--radius-full);
  border: var(--border-width-strong) solid var(--border-strong); background: var(--surface);
}
.choice__label { font-weight: var(--weight-medium); color: var(--text-primary); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--surface-accent); border-width: var(--border-width-strong); padding: calc(var(--space-3) - 1px) calc(var(--space-4) - 1px); }
.choice:has(input:checked) .choice__dot { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px var(--surface); }
.choice:has(input:focus-visible) { outline: var(--border-width-strong) solid var(--focus-ring); outline-offset: 2px; }

.writing-style-options {
  border: 0; padding: 0; margin: var(--space-3) 0 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3);
}
.writing-style-choice { align-items: flex-start; min-width: 0; }
.writing-style-choice .choice__dot { margin-top: 0.2rem; }
.writing-style-choice__body { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; width: 100%; }
.writing-style-choice__top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); color: var(--text-primary); }
.writing-style-choice__level { color: var(--text-muted); font-size: var(--text-xs); font-weight: var(--weight-semibold); text-transform: uppercase; letter-spacing: 0.04em; }
.writing-style-choice__description { color: var(--text-secondary); font-size: var(--text-sm); line-height: 1.45; }
.style-cost {
  flex: none; color: var(--accent-text); background: var(--surface-accent);
  border: var(--border-width) solid var(--accent-border); border-radius: var(--radius-xs);
  padding: 0.1rem var(--space-2); font-size: var(--text-xs); font-weight: var(--weight-semibold);
}
.writing-style-disclaimer { color: var(--text-muted); font-size: var(--text-xs); margin: var(--space-2) 0 0; }

@media (max-width: 54rem) {
  .writing-style-options { grid-template-columns: 1fr; }
}

/* Experience cards: they did not stack on a phone and the third was clipped (F25) */
.experience-options, .experience-container, .output-structure-options {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: var(--space-3);
}

/* Suggestions */
.suggestion-buttons { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.suggestion-btn {
  font-size: var(--text-sm); text-align: left;
  background: var(--surface); color: var(--text-primary);
  border: var(--border-width) solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  min-height: 2rem; cursor: pointer;
}
.suggestion-btn:hover { background: var(--surface-accent); border-color: var(--accent-border); }
.suggestions-empty {
  font-size: var(--text-sm); color: var(--text-muted);
  background: var(--surface-subtle);
  border: var(--border-width) dashed var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-3); margin: var(--space-2) 0 0;
}
.refresh-btn .counter, .counter {
  background: var(--surface-subtle); color: var(--text-secondary);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-xs);
  font-size: var(--text-xs); font-weight: var(--weight-medium);
  padding: 0 var(--space-1);
}

/* Step navigation */
.step-navigation {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3);
  margin-top: var(--space-6); padding-top: var(--space-5);
  border-top: var(--border-width) solid var(--border-subtle);
}
.step-navigation .btn-primary { margin-left: auto; }
.btn-cost {
  font-size: var(--text-xs); font-weight: var(--weight-regular);
  opacity: 0.85; padding-left: var(--space-1);
}
/* The six unlabelled dots are replaced by the progress bar above. */
.step-indicator, .step-dots { display: none !important; }

/* The analogy panel: kept, but out of the task path (F27) */
.wizard-intro { margin-bottom: var(--space-5); }
.wizard-intro .analogy-container, .wizard-intro .hero-section { font-size: var(--text-sm); }

@media (max-width: 46rem) {
  .appbar__inner { padding-inline: var(--space-4); min-height: 3.25rem; }
  .nav-brand__name { display: none; }
  .wizard-step, #result { padding: var(--space-4); border-radius: var(--radius-sm); }
  .experience-options, .experience-container, .output-structure-options { grid-template-columns: minmax(0, 1fr); }
  .step-navigation { position: sticky; bottom: 0; background: var(--surface);
    margin: var(--space-5) calc(var(--space-4) * -1) calc(var(--space-4) * -1);
    padding: var(--space-3) var(--space-4); border-top: var(--border-width) solid var(--border); z-index: 10; }
  .step-navigation .btn { flex: 1 1 0; min-width: 0; }
  .step-navigation .btn-primary { margin-left: 0; }
  .btn-blocked-reason { flex: 1 1 100%; margin-top: 0; }
}

/* ---------------------------------------------------------------------------
   13. Wizard — corrections to legacy rules that outrank the base layer
   -------------------------------------------------------------------------- */

/* generate.css:127 removes the input border and tints the field with
   --light-blue-bg. That produced a borderless blue block instead of a field. */
.wizard-step .form-card .form-control,
.wizard-step .form-card .form-control:focus,
.wizard-step .option-card .form-control,
[data-theme="dark"] .wizard-step .form-card .form-control,
[data-theme="dark"] .wizard-step .form-card .form-control:focus {
  background-color: var(--surface);
  border: var(--border-width) solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  color: var(--text-primary);
}
.wizard-step .form-card .form-control:focus,
[data-theme="dark"] .wizard-step .form-card .form-control:focus { border-color: var(--accent); }

/* generate.css:114 gives every form-card/option-card its own surface + radius,
   which stacked cards three deep. Flatten to a single panel. */
.wizard-step .form-card,
.wizard-step .option-card,
[data-theme="dark"] .wizard-step .form-card,
[data-theme="dark"] .wizard-step .option-card {
  background-color: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none !important;
  padding: 0;
}
.wizard-step .form-card:hover,
.wizard-step .option-card:hover { box-shadow: none !important; }

/* Disabled primary: Bootstrap's --bs-btn-disabled-* wins over a plain rule. */
.btn.btn-primary:disabled, .btn.btn-primary[disabled],
.step-navigation .btn.btn-primary:disabled,
[data-theme="dark"] .btn.btn-primary:disabled {
  --bs-btn-disabled-bg: var(--disabled-bg);
  --bs-btn-disabled-border-color: var(--disabled-border);
  --bs-btn-disabled-color: var(--disabled-text);
  background-color: var(--disabled-bg) !important;
  border-color: var(--disabled-border) !important;
  color: var(--disabled-text) !important;
}

/* Step navigation: Terug left, Volgende right, the reason on its own line. */
.step-navigation { justify-content: flex-start; }
.step-navigation .btn-blocked-reason { flex: 1 1 100%; order: 10; margin-top: 0; }

/* The analogy is teaching material, not part of the task. It stays on the
   entry screen as a compact aside and is removed once the wizard starts. */
#header-container.wizard-intro {
  max-width: var(--container-app);
  margin: 0 auto var(--space-5);
  width: 100%;
}
#header-container.wizard-intro .hero-section {
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  text-align: left !important;
  box-shadow: none;
}
#header-container.wizard-intro h1,
#header-container.wizard-intro h2 { font-size: var(--text-lg); }
#header-container.wizard-intro .analogy-container,
#header-container.wizard-intro blockquote,
#header-container.wizard-intro p { font-size: var(--text-sm); color: var(--text-secondary); }
#header-container.wizard-intro img { max-height: 2rem; width: auto; }
body.wizard-running #header-container.wizard-intro { display: none; }

/* The floating back arrow overlapped the app bar. */
#backToMainButton { display: none; }

/* Prompt result: mono at a reading measure, keys in small caps (F4). */
#generatedPrompt, .prompt-result-container #generatedPrompt {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: var(--leading-loose);
  color: var(--text-primary);
  background: var(--surface-subtle);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-5);
  max-width: var(--measure-prose);
  overflow-x: auto;
}
.prompt-result-title, #promptTitle {
  font-family: var(--font-sans);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  max-width: var(--measure-prose);
}
.result-title { font-size: var(--text-2xl); margin-bottom: var(--space-1); }

/* The step-1 recap collapsed to a ~90px column on a phone (F26). */
.original-description-row { display: flex; gap: var(--space-3); align-items: flex-start; }
.original-description-label { min-width: 0; }
@media (max-width: 46rem) {
  .original-description-row { flex-direction: column; gap: var(--space-1); }
  .original-description-label { white-space: normal; }
}

/* .step-content inherited --light-blue-bg, painting the whole field area as a
   tinted block. The panel is the surface; its content sits directly on it. */
.wizard-step .step-content,
[data-theme="dark"] .wizard-step .step-content {
  background-color: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}
/* The outer #promptGenerator was a second card around the step card. */
#promptGenerator, #wizardSteps {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

/* ---------------------------------------------------------------------------
   14. Result page
   The four peer actions were purple, green, amber and red while Copy — the
   whole point of the page — was a grey ghost link below the fold (F4).
   -------------------------------------------------------------------------- */
#result { max-width: var(--container-app); }
#result .prompt-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; border: none; padding: 0; margin-bottom: var(--space-4); }
#result .prompt-header p { color: var(--text-secondary); font-size: var(--text-md); }

.result-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.result-actions .btn-copy { min-height: 2.75rem; padding-inline: var(--space-5); font-size: var(--text-md); }
.result-actions__feedback:empty { display: none; }
.result-actions__feedback {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-sm); font-weight: var(--weight-medium);
  color: var(--success);
  background: var(--success-subtle);
  border: var(--border-width) solid var(--success-border);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
}

/* The prompt reads at a measure; the container follows it so the panel does not
   leave a wide empty gutter. */
.prompt-result-container {
  background: transparent; border: none; box-shadow: none; padding: 0;
  max-width: var(--measure-prose);
}
#generatedPrompt .prompt-section-title,
#generatedPrompt strong:first-child { color: var(--text-secondary); }

/* Secondary and ghost actions, replacing the four saturated colours. */
.prompt-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3);
  margin-top: var(--space-5); padding-top: var(--space-5);
  border-top: var(--border-width) solid var(--border-subtle);
  justify-content: flex-start;
}
.btn.execute-button, .btn.regenerate-button, .btn.restart-button,
[data-theme="dark"] .btn.execute-button,
[data-theme="dark"] .btn.regenerate-button,
[data-theme="dark"] .btn.restart-button {
  background-image: none;
  box-shadow: none;
}
.btn-ghost, .btn.btn-ghost {
  background-color: transparent; border-color: transparent; color: var(--text-secondary);
}
.btn-ghost:hover, .btn.btn-ghost:hover { background-color: var(--surface-subtle); color: var(--text-primary); border-color: transparent; }
.btn.restart-button, .btn.restart-button:hover { color: var(--text-secondary); }
.beta-tag {
  background: var(--surface-subtle); color: var(--text-secondary);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-xs); font-size: var(--text-2xs);
  font-weight: var(--weight-semibold); padding: 0 var(--space-1);
  text-transform: none; letter-spacing: var(--tracking-normal);
}

/* The old fixed toast landed near the footer, far from the button that caused
   it. Feedback now renders next to the action; keep the legacy node hidden. */
#copySuccess { display: none !important; }

.copy-info { color: var(--text-muted); font-size: var(--text-xs); max-width: var(--measure-prose); }
.prompt-disclaimer { max-width: var(--measure-prose); }

@media (max-width: 46rem) {
  .result-actions .btn-copy { flex: 1 1 100%; }
  .prompt-actions .btn { flex: 1 1 100%; justify-content: center; }
}

/* Mono runs narrower per character than the sans measure; give the prompt a
   width that fits ~80 mono characters instead of 68 proportional ones. */
.prompt-result-container { max-width: 46rem; }
#generatedPrompt, .prompt-result-container #generatedPrompt {
  max-width: none;
  background: var(--surface-subtle);
}
.prompt-disclaimer, .copy-info { max-width: 46rem; }
/* Unexplained decorative dot in the prompt corner. */
.prompt-result-container::before, .prompt-result-container::after,
#generatedPrompt::before, #generatedPrompt::after { display: none !important; }
#result .prompt-result-title, #result #promptTitle { max-width: 46rem; }

/* ---------------------------------------------------------------------------
   15. Notices — the in-page replacement for alert()
   -------------------------------------------------------------------------- */
.notice-host {
  display: flex; flex-direction: column; gap: var(--space-2);
  max-width: var(--container-app);
  margin-inline: auto;
  width: 100%;
}
.notice-host:empty { display: none; }
.notice-host:not(:empty) { margin-bottom: var(--space-4); }
.notice { align-items: flex-start; }
.notice__text { margin: 0; flex: 1; max-width: none; color: inherit; }
.notice__close {
  flex: none; background: transparent; border: 0; cursor: pointer;
  color: var(--text-muted); padding: var(--space-1);
  border-radius: var(--radius-xs); line-height: 0;
  min-width: 1.5rem; min-height: 1.5rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.notice__close:hover { background: var(--surface); color: var(--text-primary); }

/* ---------------------------------------------------------------------------
   16. Dialogs
   -------------------------------------------------------------------------- */
.modal-title { font-size: var(--text-lg); font-weight: var(--weight-semibold); color: var(--text-primary); }
.modal-lede { color: var(--text-secondary); font-size: var(--text-sm); max-width: var(--measure-prose); }
.modal-header { padding: var(--space-5) var(--space-5) var(--space-4); }
.modal-body { padding: var(--space-5); }
.modal-footer { padding: var(--space-4) var(--space-5); background: var(--surface-subtle); gap: var(--space-3); }
.modal-footer .btn-ghost { margin-right: auto; }
.btn-close {
  filter: none; opacity: 1;
  background: transparent;
  border-radius: var(--radius-xs);
  min-width: 1.75rem; min-height: 1.75rem;
}
[data-theme="dark"] .btn-close { filter: invert(1) grayscale(1) brightness(1.6); }

/* Question blocks inside the dialog used the second green accent. */
.question-block, .personal-question {
  background: var(--surface-subtle);
  border: var(--border-width) solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
}
.question-block + .question-block, .personal-question + .personal-question { margin-top: var(--space-3); }
.question-label, .question-block strong, .personal-question strong {
  color: var(--accent-text); font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}
#personalQuestionsContainer textarea { max-width: none; }
/* The third question was clipped with no scroll affordance. */
.modal-dialog-scrollable .modal-body { max-height: 65vh; overflow-y: auto; }

/* styles-main.css:1255 forces a flat 50% black backdrop with !important, and on a
   long page Bootstrap's backdrop stops at the viewport height, leaving the rest
   of the page undimmed. Pin it to the full viewport in both themes. */
.modal-backdrop, .modal-backdrop.show {
  background-color: var(--overlay-scrim) !important;
  opacity: 1 !important;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
}

/* ---------------------------------------------------------------------------
   17. Profile
   -------------------------------------------------------------------------- */
.profile-container { max-width: var(--container-app); margin-inline: auto; padding-block: var(--space-6); }
.profile-card, .profile-container .card {
  background: var(--surface); border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md); box-shadow: none;
}
.profile-form .form-label, .profile-container .form-label { text-align: left; }
.profile-container .nav-tabs { border-bottom: var(--border-width) solid var(--border); gap: var(--space-1); }
.profile-container .nav-tabs .nav-link {
  color: var(--text-secondary); border: none; border-bottom: 2px solid transparent;
  border-radius: 0; padding: var(--space-2) var(--space-3); font-weight: var(--weight-medium);
  background: transparent;
}
.profile-container .nav-tabs .nav-link:hover { color: var(--text-primary); background: var(--surface-subtle); }
.profile-container .nav-tabs .nav-link.active {
  color: var(--accent-text); border-bottom-color: var(--accent); background: transparent;
}
/* The credit balance is the reason most people open this page. */
#apiCredits {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: var(--text-3xl); font-weight: var(--weight-medium);
  color: var(--text-primary); margin: 0;
}
.api-credits-info .card { background: var(--surface-subtle); }
.danger-zone {
  margin-top: var(--space-7); padding-top: var(--space-5);
  border-top: var(--border-width) solid var(--border);
}
.danger-zone h4 { color: var(--text-primary); font-size: var(--text-lg); }
.danger-zone p { color: var(--text-secondary); font-size: var(--text-sm); max-width: var(--measure-prose); }
.home-link { display: inline-flex; margin-top: var(--space-6); }

/* ---------------------------------------------------------------------------
   18. Auth confirmation and verification banner
   -------------------------------------------------------------------------- */
.auth-confirm { text-align: left; padding: var(--space-6) var(--space-5); }
.auth-confirm__mark {
  width: 3rem; height: 3rem; border-radius: var(--radius-md);
  background: var(--accent-subtle); color: var(--accent-text);
  border: var(--border-width) solid var(--accent-border);
  display: grid; place-items: center; margin-bottom: var(--space-4);
}
.auth-confirm h1, .auth-card h1, .auth-confirm h1.text-3xl {
  font-size: var(--text-2xl); color: var(--text-primary) !important;
  text-align: left; margin-bottom: var(--space-3);
}
.auth-confirm p { color: var(--text-secondary); font-size: var(--text-md); margin-bottom: var(--space-3); }
.auth-confirm__addr { color: var(--text-primary); font-family: var(--font-mono); font-size: 0.95em; overflow-wrap: anywhere; }
.auth-confirm__bonus {
  background: var(--success-subtle); border: var(--border-width) solid var(--success-border);
  border-radius: var(--radius-sm); padding: var(--space-3); color: var(--text-secondary) !important;
  font-size: var(--text-sm) !important;
}
.auth-confirm__hint { font-size: var(--text-sm) !important; color: var(--text-muted) !important; }
.auth-confirm__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-5); }

.verify-banner {
  max-width: var(--container-site); margin: var(--space-5) auto 0;
  align-items: center; gap: var(--space-3);
}
.verify-banner__text { flex: 1; }
.verify-banner__text strong { display: block; color: var(--text-primary); }
.verify-banner__cta { flex: none; }
@media (max-width: 46rem) {
  .verify-banner { flex-wrap: wrap; margin-inline: var(--space-4); }
  .verify-banner__cta { width: 100%; justify-content: center; }
}

/* Suggestion chips: the dark rule used a 10 %-alpha white border (1.35:1), so
   the chips had no perceivable boundary. Chips are controls — 1.4.11 applies. */
.suggestion-btn, [data-theme="dark"] .suggestion-btn,
.suggestion-buttons .suggestion-btn,
[data-theme="dark"] .suggestion-buttons .suggestion-btn {
  background-color: var(--surface);
  border: var(--border-width) solid var(--border-strong);
  color: var(--text-primary);
}
.suggestion-btn:hover, [data-theme="dark"] .suggestion-btn:hover,
.suggestion-buttons .suggestion-btn:hover {
  background-color: var(--surface-accent);
  border-color: var(--accent-border);
  color: var(--text-primary);
}
.suggestion-btn.selected, [data-theme="dark"] .suggestion-btn.selected {
  background-color: var(--surface-accent);
  border-color: var(--accent);
  border-width: var(--border-width-strong);
  color: var(--accent-text);
  font-weight: var(--weight-medium);
}
