/* ===== Design tokens (matches thefocussolutions.com: black + gold) ===== */
:root {
  color-scheme: dark;

  /* Brand palette */
  --gold: #CBA953;
  --gold-2: #CBB251;
  --gold-hi: #F3DB8E;
  --gold-grad: linear-gradient(135deg, #E8CF7F 0%, #CBB251 30%, #CBA953 60%, #A88A3C 100%);
  --black: #0b0b0b;
  --cream: #F3EEE2;

  --bg: var(--black);
  --surface: #121110;
  --surface-alt: #1a1814;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: var(--cream);
  --text-muted: rgba(243, 238, 226, 0.66);
  --text-faint: rgba(243, 238, 226, 0.42);

  --accent: var(--gold);
  --accent-hover: #E2C26E;
  --accent-soft: rgba(203, 169, 83, 0.12);
  --accent-line: rgba(203, 169, 83, 0.35);
  --accent-text: var(--black);
  --accent-ink: var(--gold);

  --font-heading: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-accent: "Cormorant Garamond", Georgia, serif;

  --danger: #f08a7e;
  --danger-soft: rgba(240, 138, 126, 0.10);
  --success: #7fd19b;
  --success-soft: rgba(127, 209, 155, 0.10);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 24px 60px rgba(0, 0, 0, 0.5);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
}

* {
  box-sizing: border-box;
}

/* Author rules like .btn{display:inline-flex} tie in specificity with the
   UA [hidden]{display:none} rule and win on source order — force it. */
[hidden] {
  display: none !important;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(900px 480px at 50% -120px, rgba(203, 169, 83, 0.16), transparent 70%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  accent-color: var(--gold);
}

::selection { background: rgba(203, 169, 83, 0.35); color: var(--cream); }

h1, h2, h3, h4 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

h1 { font-size: 34px; line-height: 1.1; letter-spacing: -0.035em; }
h2 { font-size: 21px; line-height: 1.25; }
h3 { font-size: 17px; }

/* gold italic accent word: <h1>Your <em>analyses</em></h1> */
h1 em, h2 em {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 500;
  font-size: 1.1em;
  letter-spacing: -0.01em;
  padding-right: .06em;
  background: linear-gradient(180deg, var(--gold-hi) 0%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

p { margin: 0 0 var(--space-3); }

a {
  color: var(--accent-ink);
  text-decoration: none;
}
a:hover {
  color: var(--gold-hi);
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }

/* ===== Layout ===== */
.page {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.container-narrow {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 var(--space-5);
}

main {
  flex: 1;
  padding: var(--space-7) 0 var(--space-8);
}

/* ===== Navbar ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(11, 11, 11, 0.78);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(90deg, transparent, rgba(203, 169, 83, 0.45) 50%, transparent) 1;
}

.navbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--cream);
}
.brand::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold-grad);
  box-shadow: 0 0 12px rgba(203, 169, 83, 0.6);
}
.brand:hover { color: var(--cream); text-decoration: none; }

/* company logo before the app name (only when assets/img/logo.* exists) */
.brand.has-logo { gap: var(--space-3); }
.brand.has-logo::before { display: none; }
.brand-logo {
  display: block;
  height: 34px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}
.brand-sep {
  width: 1px;
  height: 22px;
  background: var(--accent-line);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  font-size: 14.5px;
  font-weight: 500;
}

.nav-links a:not(.btn) { color: rgba(243, 238, 226, 0.72); }
.nav-links a:not(.btn):hover { color: var(--gold); text-decoration: none; }

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold-grad);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-menu {
  position: relative;
}

.user-menu summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.user-menu summary::-webkit-details-marker,
.user-menu summary::marker {
  display: none;
  content: "";
}

.user-menu .menu {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  min-width: 200px;
  padding: var(--space-2);
  z-index: 30;
}

.user-menu .menu-name {
  padding: var(--space-2) 10px 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.user-menu .menu a {
  display: block;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
}

.user-menu .menu a:hover {
  background: var(--accent-soft);
  color: var(--gold-hi);
  text-decoration: none;
}

.user-menu .menu hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-2) 4px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 12px 22px;
  font-size: 14.5px;
  font-weight: 700;
  font-family: var(--font-heading);
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease,
              transform 150ms ease, box-shadow 150ms ease, background-position 400ms ease;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--gold-grad);
  background-size: 200% 200%;
  background-position: 0% 50%;
  color: var(--accent-text);
  box-shadow: 0 10px 26px rgba(203, 169, 83, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-primary:hover {
  color: var(--accent-text);
  background-position: 100% 50%;
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(203, 169, 83, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-secondary {
  background: transparent;
  border-color: var(--accent-line);
  color: var(--gold);
}
.btn-secondary:hover {
  background: var(--accent-soft);
  border-color: var(--gold);
  color: var(--gold-hi);
}

.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 13px; }

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ===== Cards ===== */
.card {
  position: relative;
  background:
    radial-gradient(420px 220px at 100% 0%, rgba(203, 169, 83, 0.08), transparent 70%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.045) 0%, rgba(255, 255, 255, 0.012) 70%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.card + .card { margin-top: var(--space-5); }

/* ===== Forms ===== */
.field {
  margin-bottom: var(--space-5);
}

.field label {
  display: block;
  font-weight: 600;
  font-size: 13.5px;
  margin-bottom: var(--space-2);
  color: var(--text);
}

/* row under a field: hint on the left, link on the right (e.g. "Forgot password?") */
.field .field-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-2);
}
.field .field-foot .hint { margin-top: 0; }
.field .field-link {
  display: block;
  width: fit-content;
  margin: var(--space-2) 0 0 auto;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.field .field-foot .field-link { margin: 0; }

.field .hint {
  display: block;
  font-size: 12.5px;
  color: var(--text-faint);
  margin-top: var(--space-1);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
select,
textarea {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: #0f0e0c;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input::placeholder,
textarea::placeholder { color: var(--text-faint); }

select option { background: var(--surface); color: var(--text); }

textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.55;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(203, 169, 83, 0.18);
}

/* keep autofilled fields dark */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px #0f0e0c inset;
  caret-color: var(--text);
}

fieldset {
  border: none;
  padding: 0;
  margin: 0 0 var(--space-6);
}

fieldset legend {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  padding: 0 0 var(--space-2);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
  width: 100%;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.radio-option {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.radio-option:hover { background: var(--surface-alt); border-color: var(--border-strong); }

.radio-option input { margin-top: 4px; }

.radio-option.checked {
  border-color: var(--gold);
  background: var(--accent-soft);
}

/* ===== Alerts / flash ===== */
.alert {
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  font-size: 14px;
  margin-bottom: var(--space-4);
  border: 1px solid transparent;
}

.alert-error {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(240, 138, 126, 0.3);
}

.alert-success {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(127, 209, 155, 0.3);
}

.alert-loading {
  background: var(--accent-soft);
  color: var(--text-muted);
  border-color: var(--accent-line);
}

/* ===== Auth pages ===== */
.auth-header {
  text-align: center;
  margin-bottom: var(--space-6);
}

.auth-header h1 { font-size: 38px; }

.auth-footer {
  text-align: center;
  margin-top: var(--space-5);
  font-size: 14px;
  color: var(--text-muted);
}

/* ===== Dashboard ===== */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.page-header p { margin: 0; }

.empty-state {
  text-align: center;
  padding: var(--space-8) var(--space-5);
  color: var(--text-muted);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 70%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  transition: border-color 200ms ease, transform 200ms ease;
}

.history-item:hover { border-color: var(--accent-line); transform: translateY(-2px); }

.history-item-main a {
  font-weight: 600;
  color: var(--text);
}

.history-item-main a:hover { color: var(--gold-hi); text-decoration: none; }

.history-meta {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  margin-top: var(--space-1);
}

/* ===== Score badge ===== */
.score-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--gold);
  border-radius: var(--radius-pill);
  padding: 3px 11px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.score-badge .max { font-weight: 500; color: var(--text-faint); font-size: 11.5px; }

/* ===== Results page ===== */
.result-hero {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.result-score {
  position: relative;
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 1px solid transparent;
  background:
    radial-gradient(circle at 50% 30%, #1d1a14, var(--black)) padding-box,
    var(--gold-grad) border-box;
  box-shadow: 0 0 40px rgba(203, 169, 83, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.result-score .num {
  font-family: var(--font-heading);
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  background: linear-gradient(180deg, var(--gold-hi) 0%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.result-score .denom { font-size: 11px; color: var(--text-faint); margin-top: 3px; }

.result-section-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.result-section-title h2 { margin: 0; }

.result-section-title .icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--gold-grad);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.pill {
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--cream);
}

.suggestion-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.suggestion-list li {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
}

.suggestion-list li .marker {
  flex-shrink: 0;
  color: var(--gold);
  font-weight: 700;
  font-size: 13px;
  margin-top: 2px;
}

.headline-option {
  border: 1px solid var(--border);
  border-left: 2px solid var(--gold);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  padding: var(--space-3) var(--space-4);
  font-size: 15px;
  font-weight: 500;
  margin-bottom: var(--space-2);
}
.headline-option:last-child { margin-bottom: 0; }

.rewrite-box {
  background: var(--surface-alt);
  border-left: 2px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: var(--space-4) var(--space-5);
  font-size: 15px;
  line-height: 1.7;
  color: rgba(243, 238, 226, 0.86);
  white-space: pre-wrap;
}

.gap-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.gap-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: 14.5px;
  color: var(--text);
}

.gap-list li::before {
  content: "!";
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--danger-soft);
  border: 1px solid rgba(240, 138, 126, 0.35);
  color: var(--danger);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.section-gap { margin-bottom: var(--space-5); }

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-6) 0;
}

.spinner-overlay {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(600px 360px at 50% 45%, rgba(203, 169, 83, 0.12), transparent 70%),
    rgba(11, 11, 11, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-5);
  text-align: center;
  z-index: 50;
}

.spinner-overlay.active { display: flex; }

.spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid rgba(203, 169, 83, 0.18);
  border-top-color: var(--gold);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Wizard / stepper ===== */
.stepper {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-6);
}

.step-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.step-item .step-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.step-item .step-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-faint);
  white-space: nowrap;
  transition: color 150ms ease;
}

.step-item.active .step-circle {
  border: 2px solid var(--gold);
  color: var(--gold);
  box-shadow: 0 0 0 4px rgba(203, 169, 83, 0.12);
}
.step-item.active .step-label { color: var(--text); }

.step-item.done .step-circle {
  background: var(--gold-grad);
  border-color: transparent;
  color: var(--accent-text);
}
.step-item.done .step-label { color: var(--text-muted); }

.step-connector {
  flex: 1;
  height: 1px;
  background: var(--border-strong);
  margin: 0 var(--space-3);
  transition: background-color 150ms ease;
}
.step-connector.done { background: var(--gold); }

.upload-zone {
  border: 1.5px dashed var(--accent-line);
  border-radius: var(--radius-md);
  background: rgba(203, 169, 83, 0.03);
  padding: var(--space-6) var(--space-5);
  text-align: center;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease;
  margin-bottom: var(--space-5);
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--gold);
  background: var(--accent-soft);
}

.upload-zone-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--gold-grad);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  margin: 0 auto var(--space-3);
}

.upload-zone-text {
  margin: 0 0 4px;
  font-size: 14.5px;
}

.upload-zone-hint {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-faint);
}

.divider-or {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0 0 var(--space-5);
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.divider-or .line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.upload-status {
  margin-bottom: var(--space-5);
}

.wizard-step h2 {
  margin-bottom: var(--space-1);
}

.wizard-step .step-intro {
  color: var(--text-muted);
  margin-bottom: var(--space-5);
  font-size: 14.5px;
}

.wizard-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-2);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
}

.wizard-nav .spacer { flex: 1; }

.review-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.review-list li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-3) var(--space-4);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.review-list .review-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold);
}

.review-list .review-value {
  font-size: 14.5px;
  color: var(--text);
  white-space: pre-wrap;
}

.field-error {
  display: none;
  color: var(--danger);
  font-size: 12.5px;
  margin-top: var(--space-1);
}

.field.has-error input,
.field.has-error textarea {
  border-color: var(--danger);
}

.field.has-error .field-error { display: block; }

@media (max-width: 600px) {
  .step-item .step-label { display: none; }
}

/* ===== Profile / settings ===== */
.profile-hero {
  text-align: center;
}

.profile-hero .avatar {
  width: 72px;
  height: 72px;
  font-size: 24px;
  margin: 0 auto var(--space-4);
  box-shadow: 0 0 0 6px rgba(203, 169, 83, 0.12), 0 0 40px rgba(203, 169, 83, 0.25);
}

.stat-row {
  display: flex;
  gap: var(--space-6);
}

.stat-tile .stat-num {
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--gold);
}

.stat-tile .stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.card-danger {
  border-color: rgba(240, 138, 126, 0.3);
}

.card-danger h2 {
  color: var(--danger);
}

.settings-section-gap {
  margin-bottom: var(--space-3);
}

/* ===== Admin ===== */
.container-wide { max-width: 1120px; }

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.admin-stats .card + .card { margin-top: 0; }

.stat-sub {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.stat-num-sm { font-size: 18px; line-height: 1.55; }

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.tabs {
  display: inline-flex;
  gap: var(--space-1);
  padding: var(--space-1);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}

.tab {
  padding: 7px 18px;
  border-radius: var(--radius-pill);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-muted);
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { background: var(--gold-grad); color: var(--accent-text); }

.admin-search {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}
.admin-search input { width: 240px; padding: 9px 14px; border-radius: var(--radius-pill); }

.admin-result-note { font-size: 14px; }

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  white-space: nowrap;
}

.data-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: rgba(203, 169, 83, 0.05); }
.data-table .strong { font-weight: 600; }
.data-table .nowrap { white-space: nowrap; }
.data-table .num { text-align: center; }
.data-table .actions { text-align: right; white-space: nowrap; font-weight: 600; }
.data-table .clip { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-table .small { font-size: 12.5px; }

.status {
  display: inline-block;
  padding: 2px 11px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.status-done { background: var(--accent-soft); color: var(--gold); border: 1px solid var(--accent-line); }
.status-pending { background: var(--surface-alt); color: var(--text-muted); border: 1px solid var(--border-strong); }
.status-failed { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(240, 138, 126, 0.3); }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  margin-top: var(--space-5);
  font-size: 14px;
}

.admin-back { margin-bottom: var(--space-4); font-size: 14px; font-weight: 600; }

.admin-user-head {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.avatar-lg { width: 56px; height: 56px; font-size: 20px; }

.admin-section-title { margin: var(--space-6) 0 var(--space-4); }

.admin-inputs summary {
  cursor: pointer;
  list-style: none;
}
.admin-inputs summary::-webkit-details-marker { display: none; }
.admin-inputs summary h2 { display: inline; margin: 0; }
.admin-inputs summary::after { content: "Show"; float: right; font-size: 13px; font-weight: 600; color: var(--gold); }
.admin-inputs[open] summary::after { content: "Hide"; }
.admin-inputs[open] summary { margin-bottom: var(--space-4); }

@media (max-width: 800px) {
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-search { width: 100%; }
  .admin-search input { flex: 1; width: auto; min-width: 0; }
}

footer.site-footer {
  text-align: center;
  padding: var(--space-6) var(--space-5);
  background: var(--black);
  border-top: 1px solid transparent;
  border-image: linear-gradient(90deg, transparent, rgba(203, 169, 83, 0.45) 50%, transparent) 1;
  color: var(--text-faint);
  font-size: 12.5px;
}
.footer-inner { max-width: 720px; margin: 0 auto; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 12px;
  margin: 0 0 var(--space-3);
  font-size: 13.5px;
  font-weight: 600;
}
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--gold); text-decoration: none; }
.footer-disclaimer { margin: 0; line-height: 1.6; }

/* ===== Public front page ===== */
.landing-hero {
  max-width: 720px;
  margin: var(--space-6) auto var(--space-8);
  text-align: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 var(--space-5);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.eyebrow::before,
.eyebrow::after { content: ""; width: 32px; height: 1px; background: var(--gold); }
.landing-hero h1 {
  font-size: clamp(36px, 5.4vw, 58px);
  line-height: 1.04;
  margin-bottom: var(--space-5);
}
.landing-lead {
  max-width: 600px;
  margin: 0 auto var(--space-6);
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1.6;
}
.landing-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
}
.landing-actions .btn { padding: 15px 28px; font-size: 15.5px; }
.landing-note {
  margin: var(--space-4) 0 0;
  color: var(--text-faint);
  font-size: 13.5px;
}

.landing-section { margin-bottom: var(--space-8); }
.landing-section > h2 {
  text-align: center;
  font-size: clamp(26px, 3.4vw, 38px);
  letter-spacing: -0.03em;
  margin-bottom: var(--space-6);
}

.landing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}
.landing-grid .card + .card { margin-top: 0; }
.landing-card { padding: var(--space-5); }
.landing-card h3 { margin: var(--space-3) 0 var(--space-1); font-size: 18px; }
.landing-card p { margin: 0; font-size: 14.5px; }
.landing-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--gold-grad);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
}

.landing-steps {
  list-style: none;
  max-width: 640px;
  margin: 0 auto;
  padding: 0;
  counter-reset: lstep;
  border-top: 1px solid var(--accent-line);
}
.landing-steps li {
  counter-increment: lstep;
  display: grid;
  grid-template-columns: 52px 1fr;
  column-gap: var(--space-4);
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--border);
}
.landing-steps li::before {
  content: counter(lstep, decimal-leading-zero);
  grid-row: 1 / span 2;
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 40px;
  line-height: 0.9;
  background: linear-gradient(180deg, var(--gold-hi) 0%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.landing-steps strong { font-size: 17px; }
.landing-steps span { color: var(--text-muted); font-size: 14.5px; }

.landing-trust { max-width: 720px; margin: 0 auto var(--space-6); text-align: center; }
.landing-trust p { margin: 0; }

/* ===== Legal pages ===== */
.legal .card h2 { margin: var(--space-6) 0 var(--space-3); font-size: 19px; }
.legal .card ul { margin: 0 0 var(--space-3); padding-left: 20px; }
.legal .card li { margin-bottom: var(--space-2); color: var(--text-muted); }
.legal .card li strong { color: var(--text); }
.legal .card p { color: var(--text-muted); }

@media (max-width: 700px) {
  .landing-grid { grid-template-columns: 1fr; }
  .field .field-foot { flex-direction: column; gap: var(--space-2); }
  .field .field-foot .field-link { margin-left: auto; }
}

@media (max-width: 600px) {
  .container, .container-narrow { padding: 0 var(--space-4); }
  main { padding: var(--space-6) 0 var(--space-7); }
  h1 { font-size: 28px; }
  .auth-header h1 { font-size: 30px; }
  .card { padding: var(--space-5); }
  .result-hero { flex-direction: column; align-items: flex-start; gap: var(--space-4); }
  .page-header { flex-direction: column; align-items: flex-start; }
  .nav-links { gap: var(--space-4); font-size: 13.5px; }
  .brand-logo { height: 28px; }
  /* small screens: logo only, the app name would crowd the nav */
  .brand.has-logo .brand-sep,
  .brand.has-logo span:last-child { display: none; }
}
