:root {
  --primary: #1a56db;
  --primary-light: #e8effc;
  --accent: #10b981;
  --accent-dark: #059669;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.04);
  --hover-bg: #f1f5f9;
  --hover-border: #cbd5e1;
  --ring-bg: #e2e8f0;
  --bar-bg: #e2e8f0;
  --country-fill: #e2e8f0;
  --country-stroke: #ffffff;
  --country-hover: #cbd5e1;
  --tip-bg: #fef3c7;
  --icon-green-bg: #d1fae5;
  --modal-bg: #ffffff;
  --range-thumb-border: #ffffff;
  --dimension-financial: #22c55e;
  --dimension-medical: #ef4444;
  --dimension-mental: #8b5cf6;
  --dimension-physical: #3b82f6;
  --dimension-retirement: #10b981;
  --dimension-security: #0ea5e9;
  --dimension-social: #f59e0b;
  --dimension-time: #f43f5e;
}

[data-theme="dark"] {
  --primary: #5b8def;
  --primary-light: #1e2d4a;
  --accent: #34d399;
  --accent-dark: #10b981;
  --bg: #0f172a;
  --card: #1e293b;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: #334155;
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.4), 0 4px 10px rgba(0,0,0,0.25);
  --hover-bg: #334155;
  --hover-border: #475569;
  --ring-bg: #334155;
  --bar-bg: #334155;
  --country-fill: #334155;
  --country-stroke: #1e293b;
  --country-hover: #475569;
  --tip-bg: #422006;
  --icon-green-bg: #064e3b;
  --modal-bg: #1e293b;
  --range-thumb-border: #1e293b;
}

@media (prefers-color-scheme: dark) {
  [data-theme="system"] {
    --primary: #5b8def;
    --primary-light: #1e2d4a;
    --accent: #34d399;
    --accent-dark: #10b981;
    --bg: #0f172a;
    --card: #1e293b;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --border: #334155;
    --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.4), 0 4px 10px rgba(0,0,0,0.25);
    --hover-bg: #334155;
    --hover-border: #475569;
    --ring-bg: #334155;
    --bar-bg: #334155;
    --country-fill: #334155;
    --country-stroke: #1e293b;
    --country-hover: #475569;
    --tip-bg: #422006;
    --icon-green-bg: #064e3b;
    --modal-bg: #1e293b;
    --range-thumb-border: #1e293b;
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
.hidden { display: none; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* Header */
header {
  text-align: center;
  padding: 56px 0 32px;
}
header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}
header p {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 480px;
  margin: 0 auto;
}
.site-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
  text-decoration: none;
}
.site-logo img {
  width: 48px;
  height: 48px;
}
.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
}

/* Card */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}
.card h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card h2 .icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.icon-blue { background: var(--primary-light); }
.icon-green { background: var(--icon-green-bg); }

/* Dimension icon classes — used on .category-icon and card heading .icon elements */
.icon-financial { background: rgba(16,185,129,0.12); color: #10b981; }
.icon-security  { background: rgba(14,165,233,0.12); color: #0ea5e9; } /* same as .icon-sky */
.icon-medical   { background: rgba(239,68,68,0.12);  color: #ef4444; } /* same as .icon-red */
.icon-physical  { background: rgba(59,130,246,0.12); color: #3b82f6; }
.icon-mental,
.icon-purple    { background: rgba(139,92,246,0.12); color: #8b5cf6; }
.icon-social,
.icon-amber     { background: rgba(245,158,11,0.12); color: #f59e0b; }
.icon-time,
.icon-rose      { background: rgba(244,63,94,0.12);  color: #f43f5e; }

/* Form */
.form-group {
  margin-bottom: 20px;
}
.form-group:last-child {
  margin-bottom: 0;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
input[type="text"], input[type="number"], input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  font-size: 17px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  -moz-appearance: textfield;
}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.12);
}
.input-prefix {
  position: relative;
}
.input-prefix input {
  padding-left: 28px;
}
.input-prefix::before {
  content: '$';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 17px;
  font-weight: 500;
  pointer-events: none;
}
.input-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Button */
.btn-primary {
  width: 100%;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  color: white;
  background: var(--primary);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  font-family: inherit;
  margin-top: 4px;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:active { transform: scale(0.99); }

/* Results */
#results {
  display: none;
  animation: fadeUp 0.4s ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Score Ring */
.score-section {
  text-align: center;
  padding: 20px 0 8px;
}
.score-ring-wrapper {
  position: relative;
  display: inline-block;
  width: 180px;
  height: 180px;
}
.score-ring-wrapper svg {
  transform: rotate(-90deg);
}
.score-ring-bg {
  fill: none;
  stroke: var(--ring-bg);
  stroke-width: 10;
}
.score-ring-fill {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease, stroke 0.3s;
}
.score-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.score-pct {
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
}
.score-pct-suffix {
  font-size: 20px;
  font-weight: 600;
}
.score-subtext {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.score-verdict {
  font-size: 18px;
  font-weight: 600;
  margin-top: 16px;
}
.score-description {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 400px;
  margin: 6px auto 0;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 4px;
}
.stat-box {
  background: var(--bg);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}
.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}
.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Progress bar comparison */
.comparison-bar {
  margin-top: 16px;
}
.comparison-bar + .comparison-bar {
  margin-top: 24px;
}
.bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
}
.bar-header span:first-child { font-weight: 600; }
.bar-header span:last-child { color: var(--text-muted); }
.bar-track {
  height: 16px;
  background: var(--bar-bg);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}
.bar-fill {
  height: 100%;
  border-radius: 8px;
  transition: width 1s ease;
  min-width: 4px;
}
.bar-target {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 3px;
  background: var(--text);
  border-radius: 2px;
  z-index: 2;
}
.bar-target-label {
  position: absolute;
  top: -20px;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* Tip card */
.tip-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--bg);
  border-radius: 10px;
  padding: 16px;
  margin-top: 16px;
}
.tip-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  background: var(--tip-bg);
}
.tip-content h4 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}
.tip-content p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Action bar */
.action-bar {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.btn-secondary {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-family: inherit;
}
.btn-secondary:hover {
  background: var(--hover-bg);
  border-color: var(--hover-border);
}
.btn-secondary svg {
  width: 16px;
  height: 16px;
}

/* Share URL */
.share-url-box {
  display: none;
  margin-top: 12px;
  animation: fadeUp 0.3s ease;
}
.share-url-box.visible { display: block; }
.share-url-inner {
  display: flex;
  gap: 8px;
  align-items: center;
}
.share-url-inner input {
  flex: 1;
  padding: 10px 12px;
  font-size: 13px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.btn-copy {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: white;
  background: var(--primary);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
.btn-copy:hover { opacity: 0.9; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text);
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 100;
  pointer-events: none;
}
.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Footnote */
.footnote {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  padding: 24px 0 12px;
  line-height: 1.5;
}
.footnote a {
  color: var(--primary);
  text-decoration: none;
}

/* ===== Category Navigation ===== */
#categorySection {
  display: none;
  animation: fadeUp 0.4s ease;
  margin-top: 8px;
}
.section-heading {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 4px;
}
.section-subtext {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 20px;
}
.category-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.category-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.category-card--active {
  cursor: pointer;
}
.category-card--active:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--hover-border);
}
.category-card--disabled {
  opacity: 0.55;
  cursor: default;
  filter: grayscale(0.3);
}
.category-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.category-info {
  flex: 1;
  min-width: 0;
}
.category-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}
.category-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}
.category-score {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}
.badge-coming-soon {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ===== Three-Column Layout ===== */
.site-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 280px;
  min-height: 100vh;
}

.site-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.site-sidebar .nav-panel-header {
  border-bottom: 1px solid var(--border);
}

.site-layout__main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.site-layout__main .container,
.site-layout__main .page-content {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
}

.site-layout__main .dashboard-page {
  max-width: 1040px;
}

.site-aside {
  position: sticky;
  top: 0;
  height: auto;
  overflow: visible;
  background: var(--bg);
  border-left: 1px solid var(--border);
  padding: 20px 16px;
}

.aside-section {
  margin-bottom: 24px;
}

.aside-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.aside-tip {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.aside-tip-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.aside-tip-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===== Mobile Top Bar (hamburger + logo, mobile only) ===== */
.mobile-topbar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  z-index: 900;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  align-items: center;
  padding: 0 12px;
  gap: 12px;
  box-shadow: var(--shadow);
}
.mobile-topbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex: 1;
  overflow: hidden;
}
.mobile-topbar-logo img {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.mobile-topbar-logo span {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Hamburger Navigation (mobile only) ===== */
.nav-hamburger {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.nav-hamburger:hover {
  background: var(--bg);
}
.nav-hamburger-icon,
.nav-hamburger-icon::before,
.nav-hamburger-icon::after {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}
.nav-hamburger-icon {
  position: relative;
}
.nav-hamburger-icon::before,
.nav-hamburger-icon::after {
  content: '';
  position: absolute;
  left: 0;
}
.nav-hamburger-icon::before { top: -6px; }
.nav-hamburger-icon::after { top: 6px; }

.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0);
  pointer-events: none;
  transition: background 0.3s ease;
}
.nav-overlay.nav-open {
  background: rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

.nav-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 300px;
  max-width: 85vw;
  height: 100%;
  background: var(--card);
  box-shadow: 4px 0 24px rgba(0,0,0,0.12);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.nav-overlay.nav-open .nav-panel {
  transform: translateX(0);
}

.nav-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.nav-panel-title {
  font-size: 16px;
  font-weight: 700;
  flex: 1;
}
.nav-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 20px;
  transition: background 0.15s;
}
.nav-close:hover { background: var(--border); }

.nav-group {
  padding: 16px 20px;
}
.nav-group + .nav-group {
  border-top: 1px solid var(--border);
}
.nav-group-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s;
}
.nav-link:hover { background: var(--bg); }
.nav-link-button {
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}
.nav-link--active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}
.nav-link--disabled {
  opacity: 0.55;
  pointer-events: none;
}
.nav-link-icon {
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-link-score {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0.9;
}
.nav-overall-ring {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-overall-ring span {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 7px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nav-link-title {
  flex: 1;
}
.nav-link-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2px 8px;
}

/* ===== Static page layout ===== */
.page-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 20px 60px;
}
.page-content h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}
.page-content h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 24px 0 8px;
}
.page-content p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 12px;
}
.page-content ul {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0 0 12px 20px;
}
.page-content a {
  color: var(--primary);
  text-decoration: none;
}
.page-content a:hover { text-decoration: underline; }

/* Page-content header (logo on subpages) */
.page-content header {
  text-align: center;
  padding: 0 0 24px;
}
.page-content .site-logo {
  display: flex;
  justify-content: center;
  text-decoration: none;
}
.page-content .site-logo img {
  width: 48px;
  height: 48px;
}

/* Changelog date labels */
.changelog-date {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
}

/* ===== Disclaimer Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal {
  background: var(--modal-bg);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  max-width: 480px;
  width: 100%;
  padding: 32px;
  position: relative;
  animation: modalSlideUp 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
}
@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.modal h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 16px;
}
.modal .btn-primary {
  margin-top: 8px;
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 18px;
  transition: background 0.15s;
}
.modal-close:hover { background: var(--border); }

/* Ad slot in disclaimer */
.ad-slot {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 16px 0 8px;
}
.ad-slot-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.ad-slot-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.ad-slot-body {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 8px;
}
.ad-slot-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}
.ad-slot-link:hover { text-decoration: underline; }

/* ===== Footer ===== */
.site-footer {
  text-align: center;
  padding: 24px 20px 32px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.footer-links a {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--primary); }
.footer-sep {
  color: var(--border);
  font-size: 13px;
}
.footer-copy {
  font-size: 11px;
  color: var(--text-muted);
}

/* Print styles */
@media print {
  body { background: white; }
  .site-layout { display: block; }
  .site-sidebar { display: none !important; }
  .site-aside { display: none !important; }
  .container { max-width: 100%; padding: 0; }
  .no-print { display: none !important; }
  .nav-hamburger { display: none !important; }
  .nav-overlay { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  #inputSection { display: none; }
  #results { display: block !important; }
  header { padding: 20px 0 16px; }
  .print-header { display: block !important; }
  .score-ring-fill { transition: none; }
  .bar-fill { transition: none; }
  .site-footer { display: none; }
  .modal-overlay { display: none !important; }

  .print-report-header {
    border-bottom: 2px solid var(--primary);
    padding-bottom: 16px;
    margin-bottom: 20px;
  }
  .print-report-header h2 {
    font-size: 20px;
    color: var(--primary);
  }
  .print-report-header p {
    font-size: 12px;
    color: var(--text-muted);
  }
}

.print-header { display: none; }

/* ===== Security Wealth — Domain Sections ===== */
.icon-sky { background: rgba(14,165,233,0.12); color: #0ea5e9; }
.icon-red { background: rgba(239,68,68,0.12); color: #ef4444; }

.domain-section {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
}
.domain-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg);
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  transition: background 0.15s;
}
.domain-header:hover { background: var(--hover-bg); }
.domain-icon { font-size: 18px; flex-shrink: 0; }
.domain-title { flex: 1; }
.domain-chevron {
  font-size: 12px;
  color: var(--text-muted);
  transition: transform 0.2s;
}
.domain-section.collapsed .domain-chevron {
  transform: rotate(-90deg);
}
.domain-body {
  padding: 4px 16px 16px;
}
.domain-section.collapsed .domain-body {
  display: none;
}

/* Select inputs */
select {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
}
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.12);
}

/* Range slider */
.range-group {
  margin-top: 8px;
}
.range-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.range-value {
  display: inline-block;
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  min-width: 28px;
  text-align: center;
}
input[type="range"] {
  width: 100%;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 4px;
  outline: none;
  margin-top: 8px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 3px solid var(--range-thumb-border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 3px solid var(--range-thumb-border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Gap list (Security results) */
.gap-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}
.gap-item {
  background: var(--bg);
  border-radius: 10px;
  padding: 16px;
}
.gap-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.gap-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.gap-domain {
  font-size: 14px;
  font-weight: 600;
  flex: 1;
}
.gap-score {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.gap-tip {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  padding-left: 38px;
}

/* Theme Toggle */
.theme-toggle {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
}
.theme-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.theme-btn:hover { background: var(--border); }
.theme-btn--active {
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
  font-weight: 600;
}
.theme-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Retake eligibility banner */
.retake-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  margin-bottom: 16px;
  background: var(--tip-bg);
  border: 1px solid var(--warning);
  border-radius: var(--radius);
  font-size: 14px;
}
.retake-banner-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.retake-banner-text span {
  color: var(--text-muted);
  font-size: 13px;
}
.retake-banner-btn {
  flex-shrink: 0;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.retake-banner-btn:hover { background: var(--bg); }

/* Hub Grid — Home page dimension tiles */
.hub-section {
  margin-top: 8px;
}

.hub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.hub-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}

.hub-card--active:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.hub-card--disabled {
  opacity: 0.5;
  filter: grayscale(0.3);
  cursor: default;
}

.hub-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.hub-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.hub-badge--active {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.hub-badge--soon {
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.hub-badge--score {
  font-size: 12px;
  font-weight: 700;
}

.hub-card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.hub-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

.hub-card-cta {
  font-size: 13px;
  font-weight: 600;
  margin-top: 12px;
  display: inline-block;
}

/* Hub card CTA colors per dimension */
.cta-financial,
.cta-retirement { color: #10b981; }
.cta-security   { color: #0ea5e9; }
.cta-medical    { color: #ef4444; }
.cta-physical   { color: #3b82f6; }
.cta-mental     { color: #8b5cf6; }
.cta-social     { color: #f59e0b; }
.cta-time       { color: #f43f5e; }

/* World Map */
.map-section {
  margin-top: 32px;
  margin-bottom: 8px;
}

.world-map-wrapper {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.world-map-svg {
  width: 100%;
  height: auto;
  display: block;
}

.country-path {
  fill: var(--country-fill);
  stroke: var(--country-stroke);
  stroke-width: 0.5;
  transition: fill 0.2s;
  cursor: pointer;
}

.country-path:hover {
  fill: var(--country-hover);
}

.country-path.country-active:hover {
  opacity: 0.85;
}

.map-tooltip {
  position: absolute;
  background: var(--text);
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  padding: 8px 12px;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 10;
  white-space: nowrap;
}

.map-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 16px;
}
@media (min-width: 768px) {
  .map-stats {
    justify-content: flex-start;
  }
}

.map-stat {
  text-align: center;
}

.map-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
}

.map-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Left-align hub + map section headings on desktop to match the left-aligned home hero */
@media (min-width: 768px) {
  .hub-section .section-heading,
  .hub-section .section-subtext,
  .map-section .section-heading,
  .map-section .section-subtext {
    text-align: left;
  }
}

/* Homepage hero — condensed style on desktop (sidebar provides site title context) */
header.home-hero {
  text-align: left;
}
header.home-hero h1 {
  text-align: left;
  margin-left: 0;
}
header.home-hero p {
  text-align: left;
  margin-left: 0;
}
@media (min-width: 768px) {
  header.home-hero {
    padding: 24px 0 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
  }
  header.home-hero h1 {
    font-size: 22px;
    margin-bottom: 5px;
  }
  header.home-hero p {
    font-size: 14px;
    max-width: none;
  }
}

/* Home hero eyebrow pill */
.home-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}

/* How it works steps */
.hiw-steps {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 18px;
  flex-wrap: wrap;
}
.hiw-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.hiw-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hiw-divider {
  color: var(--border);
  font-size: 16px;
  flex-shrink: 0;
}

/* Responsive — Tablet: hide right sidebar */
@media (max-width: 1024px) {
  .site-layout {
    grid-template-columns: 260px minmax(0, 1fr);
  }
  .site-aside {
    display: none;
  }
}

/* Responsive — Mobile: hide both sidebars, show top bar */
@media (max-width: 767px) {
  .site-layout {
    grid-template-columns: 1fr;
  }
  .site-sidebar {
    display: none;
  }
  .site-aside {
    display: none;
  }
  .mobile-topbar {
    display: flex;
  }
  .site-layout__main {
    padding-top: 56px;
  }
}

/* Responsive — Small mobile */
@media (max-width: 480px) {
  .container { padding: 16px 14px 48px; }
  header h1 { font-size: 24px; }
  .card { padding: 20px; }
  .stats-grid { grid-template-columns: 1fr; }
  .action-bar { flex-direction: column; }
  .score-ring-wrapper { width: 150px; height: 150px; }
  .score-pct { font-size: 32px; }
  .modal { padding: 24px; }
  .category-card { padding: 14px 16px; gap: 12px; }
  .category-icon { width: 38px; height: 38px; }
  .category-name { font-size: 14px; }
  .category-score { font-size: 18px; }
  .page-content { padding: 0 14px 48px; }
  .page-content h1 { font-size: 24px; }
  .hub-grid { grid-template-columns: 1fr; }
  .hub-card { padding: 16px; }
  .hub-card-title { font-size: 15px; }
  .map-stats { gap: 24px; }
  .map-stat-value { font-size: 18px; }
}

/* ===== User dashboard ===== */
.dashboard-kv {
  margin: 0;
}

.dashboard-page > h1 {
  margin-bottom: 12px;
}

.dashboard-page > #dashboardIntro {
  margin-bottom: 28px;
}

/* Dimensions progress header */
.dashboard-dimensions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.dashboard-dimensions-progress-label {
  font-size: 13px;
  color: var(--text-muted);
}
.dashboard-dimensions-progress-count {
  font-weight: 700;
  color: var(--text);
}
.dashboard-dimension-link--incomplete {
  opacity: 0.65;
}
.dashboard-dimension-link--incomplete:hover {
  opacity: 1;
}
.dashboard-dimension-not-started {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}
.dashboard-start-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  margin-top: 2px;
}

.dashboard-page > section.card {
  margin-bottom: 28px;
}
.dashboard-kv div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.dashboard-kv div:last-child {
  border-bottom: none;
}
.dashboard-kv dt {
  font-size: 13px;
  color: var(--text-muted);
}
.dashboard-kv dd {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.dashboard-dimensions-list {
  display: grid;
  gap: 10px;
}
.dashboard-dimension-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: color-mix(in oklab, var(--card), transparent 25%);
}
.dashboard-dimension-link:hover {
  border-color: var(--primary);
}
.dashboard-dimension-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.dashboard-dimension-icon {
  display: inline-flex;
}
.dashboard-dimension-title-wrap {
  display: grid;
  gap: 6px;
  min-width: 180px;
}
.dashboard-dimension-title {
  font-weight: 600;
  font-size: 14px;
}
.dashboard-dimension-progress {
  display: block;
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: var(--bar-bg);
  overflow: hidden;
}
.dashboard-dimension-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width 220ms ease;
}
.dashboard-dimension-meta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: right;
}

.dashboard-reminder-help {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 14px;
}
.dashboard-reminder-settings {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}
.dashboard-reminder-cadence {
  margin-top: 0;
}
.dashboard-reminder-settings label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.dashboard-reminder-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dashboard-reminder-toggle {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
}
.dashboard-reminder-notice {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: color-mix(in oklab, var(--accent), transparent 92%);
}
.dashboard-reminder-notice p {
  margin: 0;
  font-size: 14px;
}
.dashboard-reminder-due-list {
  margin: 10px 0 0;
  padding-left: 18px;
}
.dashboard-reminder-due-list li {
  margin: 6px 0;
}
.dashboard-reminder-due-list a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.dashboard-reminder-due-list a:hover {
  text-decoration: underline;
}

.dashboard-danger-zone {
  border: 1px solid color-mix(in oklab, #ef4444, var(--border) 55%);
}

.dashboard-danger-zone__text {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--text-muted);
}

.dashboard-danger-zone__btn {
  border-color: #ef4444;
  color: #ef4444;
}

.dashboard-danger-zone__btn:hover {
  background: color-mix(in oklab, #ef4444, transparent 90%);
}

.dashboard-danger-zone__status {
  min-height: 20px;
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.dashboard-danger-zone__status--success {
  color: #16a34a;
}

.dashboard-danger-zone__status--error {
  color: #dc2626;
}

@media (max-width: 900px) {
  .dashboard-dimension-link {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-dimension-title-wrap {
    min-width: 0;
    width: 100%;
  }

  .dashboard-dimension-meta {
    width: 100%;
    justify-content: space-between;
    text-align: left;
  }
}

@media (max-width: 600px) {
  .dashboard-dimension-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .dashboard-reminder-settings {
    grid-template-columns: 1fr;
  }
}

/* ===== Share score card ===== */
.share-score-card {
  overflow: hidden;
}

.share-score-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.share-score-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.share-card-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 1200 / 630;
  background: #0a0f1e;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.share-card-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  font-family: inherit;
}

.share-card-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: rgba(255,255,255,0.55);
  border-radius: 50%;
  animation: share-spin 0.8s linear infinite;
  flex-shrink: 0;
}

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

.share-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.share-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.share-card-actions .btn-primary,
.share-card-actions .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.share-card-actions .btn-primary:disabled,
.share-card-actions .btn-secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

@media (max-width: 600px) {
  .share-card-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .share-card-actions .btn-primary,
  .share-card-actions .btn-secondary {
    justify-content: center;
  }
}

/* ===== Dashboard landing (unauthenticated) ===== */

#dashboardLanding {
  background: linear-gradient(160deg, rgba(26, 86, 219, 0.08) 0%, rgba(16, 185, 129, 0.05) 100%);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 34px;
  margin: 18px 0 24px;
}

[data-theme="dark"] #dashboardLanding {
  background: linear-gradient(160deg, rgba(91, 141, 239, 0.2) 0%, rgba(52, 211, 153, 0.08) 100%);
}

.dl-hero {
  display: block;
  margin-bottom: 36px;
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

.dl-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 20px;
  padding: 4px 12px;
  margin-bottom: 14px;
}

.dl-headline {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text);
  margin: 0 0 12px;
}

.dl-desc {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0 0 24px;
}

.dl-login-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow);
}

.dl-login-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.dl-login-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.dl-login-input {
  flex: 1;
  padding: 12px 14px;
  border: 1.5px solid var(--hover-border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.3;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  min-width: 0;
}

.dl-login-input::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

.dl-login-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.12);
}

.dl-login-input:disabled {
  opacity: 0.55;
}

.dl-login-btn {
  white-space: nowrap;
  flex-shrink: 0;
  width: auto;
  margin-top: 0;
  padding: 12px 18px;
}

.dl-turnstile-slot {
  flex-basis: 100%;
  min-height: 66px;
}

.dl-login-note {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  transition: color 0.2s;
}

/* Dashboard landing — two-column layout on wide screens */
@media (min-width: 700px) {
  .dl-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 32px;
    align-items: start;
  }
  .dl-eyebrow,
  .dl-headline,
  .dl-desc,
  .dl-login-box {
    grid-column: 1;
  }
  .dl-radar-col {
    grid-column: 2;
    grid-row: 1 / 6;
    margin-top: 0;
    align-self: center;
  }
}

/* Radar preview column */
.dl-radar-col {
  position: relative;
  margin-top: 24px;
}

.dl-radar-wrap {
  position: relative;
  padding-top: 18px;
}

.dl-radar-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 20px;
  z-index: 1;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(26, 86, 219, 0.35);
}

.dl-radar-svg-box {
  width: 100%;
  aspect-ratio: 1200 / 630;
  background: #04080f;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.dl-radar-svg-box svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Benefits grid */
.dl-benefits {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-bottom: 4px;
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}
@media (min-width: 640px) {
  .dl-benefits {
    grid-template-columns: repeat(3, 1fr);
  }
}

.dl-benefit {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.dl-benefit:hover {
  border-color: var(--hover-border);
  box-shadow: var(--shadow);
}

.dl-benefit-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.dl-benefit-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.dl-benefit-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* Responsive */
@media (max-width: 960px) {
  .dl-headline {
    font-size: 22px;
  }
}

@media (max-width: 640px) {
  #dashboardLanding {
    padding: 22px;
  }

  .dl-benefits {
    grid-template-columns: 1fr;
  }

  .dl-login-row {
    flex-direction: column;
  }

  .dl-login-btn {
    width: 100%;
    text-align: center;
  }
}

/* Email input error state — override :focus with doubled specificity */
.dl-login-input--error,
.dl-login-input--error:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

/* Login note color variants — doubled specificity to beat base rule */
.dl-login-note.dl-login-note--error {
  color: var(--danger);
}

.dl-login-note.dl-login-note--success {
  color: var(--accent);
  font-weight: 600;
}

/* Login box success / error ring */
.dl-login-box--sent {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.dl-login-box--error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08);
  transition: border-color 0.25s, box-shadow 0.25s;
}

/* Inline button spinner */
.dl-btn-spinner {
  display: none;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: dl-spin 0.65s linear infinite;
  margin-right: 7px;
  vertical-align: -2px;
  flex-shrink: 0;
}

.dl-btn-spinner--active {
  display: inline-block;
}

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

/* Turnstile slot loading placeholder */
.dl-turnstile-loading {
  display: inline-block;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.65;
  padding: 6px 2px;
}

/* Contact form */
#contactForm textarea {
  display: block;
  width: 100%;
  padding: 12px 14px;
  font-size: 17px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  resize: vertical;
}
#contactForm textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.12);
}
#contactSubmitBtn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
.contact-status {
  margin-top: 12px;
  min-height: 1.2em;
  font-size: 14px;
}
.contact-status--success {
  color: #059669;
}
.contact-status--error {
  color: #b91c1c;
}

/* ======================================================
   Rankings page
   ====================================================== */

/* Summary stats row */
.rankings-summary {
  display: flex;
  gap: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 28px;
}

.rankings-stat {
  flex: 1;
  padding: 20px 16px;
  text-align: center;
  border-right: 1px solid var(--border);
}
.rankings-stat:last-child { border-right: none; }

.rankings-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}

.rankings-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Section wrapper */
.rankings-section {
  margin-bottom: 36px;
}

.rankings-section .section-heading,
.rankings-section .section-subtext {
  text-align: left;
}

/* Dimension rows */
.rdim-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.rdim-row:last-child { border-bottom: none; }

.rdim-rank {
  width: 24px;
  min-width: 24px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  padding-top: 2px;
  text-align: right;
}

.rdim-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.rdim-body {
  flex: 1;
  min-width: 0;
}

.rdim-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.rdim-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.rdim-label:hover { color: var(--primary); }

.rdim-avg {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.rdim-avg--none {
  color: var(--text-muted);
  font-weight: 400;
}

.rdim-bar-track {
  height: 6px;
  background: var(--bar-bg);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 5px;
}

.rdim-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.rdim-count {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.rdim-diff {
  font-size: 11px;
  font-weight: 600;
}

/* Country rows */
.rcountry-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.rcountry-row:last-child { border-bottom: none; }

.rcountry-body { flex: 1; min-width: 0; }

.rcountry-name {
  font-size: 14px;
  font-weight: 600;
}

.rcountry-code {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}

/* Empty / loading states */
.rankings-empty,
.rankings-loading {
  padding: 20px 0;
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}

/* "Take more assessments" link */
.rankings-take-more {
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
}

.rankings-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.rankings-link:hover { text-decoration: underline; }

/* Home page map section CTA */
.map-rankings-cta {
  margin-top: 16px;
  text-align: center;
}
@media (min-width: 768px) {
  .map-rankings-cta { text-align: left; }
}

.map-rankings-link {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  padding: 8px 16px;
  border: 1px solid var(--primary);
  border-radius: 20px;
  transition: background 0.15s, color 0.15s;
}
.map-rankings-link:hover {
  background: var(--primary);
  color: #fff;
}

/* Sidebar rankings link subtle separator */
.nav-link--rankings {
  margin-top: 4px;
  border-top: 1px solid var(--border);
  padding-top: 10px !important;
}

/* Guides nav link */
.nav-link--guides {
  font-weight: 500;
}

/* Responsive: stack summary stats on small screens */
@media (max-width: 480px) {
  .rankings-summary {
    flex-direction: column;
  }
  .rankings-stat {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 14px 16px;
  }
  .rankings-stat:last-child { border-bottom: none; }
  .rankings-stat-value { font-size: 20px; }
}

/* Left-align rankings section headings on desktop */
@media (min-width: 768px) {
  .rankings-section .section-heading,
  .rankings-section .section-subtext {
    text-align: left;
  }
}


/* Guides */
.guide-breadcrumb { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.guide-cta-wrap { margin-top: 32px; }
.guide-cta-sub-wrap { margin-top: 16px; }
.guide-cta-link { color: var(--primary); font-weight: 600; }
.guide-back-link { color: var(--text-muted); font-size: 14px; }
.guide-disclaimer { margin-top: 32px; }
.guide-disclaimer-text { font-size: 13px; color: var(--text-muted); }
.guides-hero {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 20px;
  align-items: center;
  margin-bottom: 12px;
}
.guides-hero-meta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.guides-hero-count {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin: 0 0 8px;
}
.guides-hero-copy {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0;
}
.guides-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin: 24px 0 32px; }
.guide-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.page-content .guide-card:hover,
.page-content .guide-card:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 10px 28px rgba(0,0,0,0.09);
  transform: translateY(-2px);
  text-decoration: none;
  outline: none;
}
.page-content .guide-card:hover .guide-card-title,
.page-content .guide-card:focus-visible .guide-card-title,
.page-content .guide-card:hover .guide-card-desc,
.page-content .guide-card:focus-visible .guide-card-desc,
.page-content .guide-card:hover .guide-card-tag,
.page-content .guide-card:focus-visible .guide-card-tag {
  text-decoration: none;
}
.guide-card-icon { font-size: 28px; margin-bottom: 10px; display: block; }
.guide-card-title { font-size: 17px; font-weight: 650; margin-bottom: 8px; color: var(--text); }
.guide-card-desc { font-size: 14px; color: var(--text-muted); line-height: 1.65; margin: 0; flex: 1; }
.guide-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
}
.guides-intro { font-size: 15px; color: var(--text-muted); line-height: 1.7; margin-bottom: 8px; max-width: 72ch; }
.guides-section-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin: 32px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }

@media (max-width: 900px) {
  .guides-hero { grid-template-columns: 1fr; }
}
