:root {
  --font-ui: "Helvetica Neue", Helvetica, "Arial Nova", Aptos, Arial, sans-serif;
  --font-display: "Bodoni 72", "Bodoni MT", Didot, "Iowan Old Style", Georgia, serif;
  --bg: #edf1f5;
  --surface: #fbfcfd;
  --surface-2: #e7ecf1;
  --ink: #0a2238;
  --muted: #52697b;
  --line: #cdd5dd;
  --accent: #076582;
  --accent-2: #1759b0;
  --metal: #aeb9c4;
  --soft: #e0e8ed;
  --warn: #a87933;
  --danger: #ad5148;
  --shadow: 0 20px 50px rgba(5, 28, 47, .09);
  --sidebar: #071a2b;
  --sidebar-ink: #eef3f6;
  --radius: 18px;
  font-family: var(--font-ui);
}

body {
  background:
    radial-gradient(circle at 82% 5%, rgba(179, 192, 202, .22), transparent 29%),
    linear-gradient(135deg, #f7f8fa 0%, var(--bg) 46%, #e1e7ec 100%);
  font-family: var(--font-ui);
}

body[data-theme="warm"] {
  --bg: #f3f3f0;
  --surface: #ffffff;
  --surface-2: #eaeeef;
  --ink: #102b3c;
  --muted: #728189;
  --line: #d3d8d8;
  --accent: #17647a;
  --accent-2: #6c8794;
  --metal: #bdc5c7;
  --soft: #e2eff1;
  --warn: #9e7b42;
  --sidebar: #0d3040;
  --sidebar-ink: #f4f6f4;
  --shadow: 0 20px 55px rgba(19, 49, 60, .09);
}

body[data-theme="dark"] {
  --bg: #06111d;
  --surface: #0d1f2e;
  --surface-2: #142a3a;
  --ink: #f7fbff;
  --muted: #c4d2dc;
  --line: #3b5366;
  --accent: #48c7d8;
  --accent-2: #75aaff;
  --metal: #c6d0d8;
  --soft: #173346;
  --warn: #d5b26c;
  --danger: #df8177;
  --sidebar: #030b13;
  --sidebar-ink: #eef4f7;
  --shadow: 0 22px 60px rgba(0, 0, 0, .4);
  background: radial-gradient(circle at 78% 2%, #173248 0%, #06111d 38%, #040b13 100%);
}

.sidebar {
  background: linear-gradient(180deg, var(--sidebar) 0%, color-mix(in srgb, var(--sidebar), #163c54 28%) 100%);
  border-right: 1px solid rgba(212, 223, 231, .18);
  box-shadow: 12px 0 40px rgba(3, 19, 31, .12);
}

.brand-mark {
  border-radius: 50%;
  background: linear-gradient(145deg, #f5f7f8, #8898a8 48%, #e3e8ec);
  color: #0b2b42;
  font-size: 21px;
  font-weight: 500;
  box-shadow: inset 0 1px 1px #fff, 0 7px 20px rgba(0, 0, 0, .22);
}

.brand strong {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .2px;
}

.brand span {
  font-size: 8px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.profile-card {
  background: rgba(236, 243, 247, .07);
  border-color: rgba(207, 219, 227, .15);
  border-radius: 13px;
  backdrop-filter: blur(10px);
}

.avatar {
  border-radius: 50%;
  background: linear-gradient(145deg, #bcc8d1, #718595);
  color: #092035;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .55);
}

.nav-label {
  font-size: 8px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.nav-item {
  border-radius: 9px;
  font-size: 12px;
  letter-spacing: .15px;
}

.nav-item > span { color: #b8c4cd; }

.nav-item.active {
  background: linear-gradient(90deg, rgba(183, 200, 211, .17), rgba(183, 200, 211, .07));
  color: #f3f6f8;
  font-weight: 600;
  box-shadow: inset 2px 0 #b8c6d0;
}

.nav-item .count {
  background: linear-gradient(145deg, #cad2d8, #8999a7);
  color: #0b2235;
  box-shadow: inset 0 1px rgba(255, 255, 255, .6);
}

.privacy-card {
  background: rgba(183, 200, 211, .07);
  border-color: rgba(183, 200, 211, .16);
  border-radius: 12px;
}

.privacy-head { color: #d8e1e7; }
.privacy-head span {
  background: linear-gradient(145deg, #c7d2da, #8798a6);
  color: #092033;
}

.main { position: relative; }
.main::before {
  content: "";
  position: fixed;
  right: -120px;
  top: -150px;
  width: 560px;
  height: 560px;
  border: 1px solid color-mix(in srgb, var(--metal), transparent 72%);
  border-radius: 50%;
  box-shadow:
    0 0 0 45px color-mix(in srgb, var(--metal), transparent 93%),
    0 0 0 90px color-mix(in srgb, var(--metal), transparent 96%);
  pointer-events: none;
}

.topbar,
.theme-lab,
.view { position: relative; }

.topbar h1,
.hero-card h2,
.section-hero h2,
.generic-view h2,
.drawer h2 {
  font-family: var(--font-display);
  font-weight: 500;
}

.topbar h1 {
  font-size: 34px;
  letter-spacing: -.35px;
}

.eyebrow {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

.search-button,
.round-button,
.theme-lab {
  background: color-mix(in srgb, var(--surface), transparent 4%);
  border-color: var(--line);
  border-radius: 10px;
  backdrop-filter: blur(12px);
}

.theme-lab {
  border-radius: 12px;
  box-shadow: 0 9px 30px rgba(8, 31, 48, .04);
}

.theme-lab strong {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
}

.theme-lab span { font-size: 9px; }

.theme-choice {
  background: linear-gradient(145deg, var(--surface), var(--surface-2));
  border-radius: 8px;
  font-size: 9px;
  letter-spacing: .2px;
}

.theme-choice.active {
  border-color: var(--metal);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--metal), transparent 15%), 0 5px 14px rgba(12, 39, 58, .08);
}

.swatch { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45); }
.swatch.calm { background: linear-gradient(135deg, #071a2b 50%, #b9c4cd 50%); }
.swatch.warm { background: linear-gradient(135deg, #f4f3ee 50%, #17647a 50%); }
.swatch.dark { background: linear-gradient(135deg, #030b13 50%, #91a8b6 50%); }

.hero-card,
.balance-card,
.panel,
.attention-card,
.section-hero,
.generic-view {
  border-color: color-mix(in srgb, var(--line), var(--metal) 28%);
  border-radius: 16px;
}

.hero-card,
.tax-hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(128deg, color-mix(in srgb, var(--surface), transparent 0%) 0%, color-mix(in srgb, var(--soft), transparent 4%) 100%);
}

.hero-card::after,
.tax-hero::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -92px;
  bottom: -122px;
  border: 1px solid color-mix(in srgb, var(--metal), transparent 30%);
  border-radius: 50%;
  box-shadow: 0 0 0 25px color-mix(in srgb, var(--metal), transparent 88%);
}

.hero-card h2 { letter-spacing: -.3px; }

.primary {
  background: linear-gradient(135deg, #0b3048, var(--accent));
  border-color: #6f8797;
  border-radius: 9px;
  box-shadow: inset 0 1px rgba(255, 255, 255, .18), 0 8px 18px rgba(8, 42, 64, .15);
}

body[data-theme="dark"] .primary { color: #071725; }

.secondary,
.ghost {
  border-radius: 9px;
  background: linear-gradient(145deg, var(--surface), var(--surface-2));
}

.progress-orbit {
  background: conic-gradient(#8e9eaa calc(var(--progress) * 1%), color-mix(in srgb, var(--line), transparent 10%) 0);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35), 0 10px 35px rgba(8, 31, 48, .08);
}

.attention-icon,
.assistant-orb,
.generic-icon {
  border-radius: 50%;
  background: linear-gradient(145deg, #e8edf0, #aebbc5);
  color: #173c54;
  box-shadow: inset 0 1px #fff;
}

.attention-card.urgent { border-left-color: #8598a8; }

.year-tabs button,
.task-check,
.service-icon,
.prompt-row button,
.assistant-panel form {
  border-radius: 9px;
}

.year-tabs button.active {
  border-color: #8e9eaa;
  background: linear-gradient(145deg, var(--surface), var(--soft));
  color: var(--ink);
  box-shadow: inset 0 -2px #7f929f;
}

.meter i { background: linear-gradient(90deg, #61798a, #bbc6ce); }

@media (max-width: 760px) {
  .main::before { display: none; }
  .topbar h1 { font-size: 25px; }
}

.health-hero {
  background: linear-gradient(125deg, var(--surface), color-mix(in srgb, var(--soft), var(--surface) 25%));
}

.health-notice {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 13px;
  align-items: center;
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface), transparent 5%);
}

.health-notice > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #e8edf0, #aebbc5);
  color: #173c54;
}

.health-notice strong,
.health-notice p { display: block; margin: 0; }
.health-notice strong { font-size: 11px; }
.health-notice p { color: var(--muted); font-size: 9px; line-height: 1.5; margin-top: 3px; }
.health-notice button { border: 0; background: transparent; color: var(--accent); font-size: 9px; font-weight: 700; }

.health-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 11px;
  margin-bottom: 17px;
}

.health-metrics article {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(8, 31, 48, .04);
}

.health-metrics span,
.health-metrics strong,
.health-metrics small { display: block; }
.health-metrics span { color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: 1.2px; }
.health-metrics strong { margin: 8px 0 5px; font-family: var(--font-display); font-size: 19px; font-weight: 500; }
.health-metrics small { color: var(--muted); font-size: 8px; }

.health-layout {
  display: grid;
  grid-template-columns: 1.35fr .75fr;
  gap: 17px;
}

.pill.silver { background: var(--surface-2); color: var(--accent); border: 1px solid var(--line); }

.checkin-row {
  display: grid;
  grid-template-columns: 35px 1fr auto;
  gap: 11px;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.checkin-row:last-child { border-bottom: 0; }
.checkin-number { width: 29px; height: 29px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); font-size: 10px; font-weight: 800; }
.checkin-row strong, .checkin-row p { display: block; margin: 0; }
.checkin-row strong { font-size: 11px; }
.checkin-row p { color: var(--muted); font-size: 9px; margin-top: 4px; }
.checkin-row .secondary { padding: 8px 10px; }
.due { color: var(--muted); font-size: 8px; }

.signals-panel .signal {
  display: grid;
  grid-template-columns: 9px 1fr;
  gap: 10px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.signal i { width: 7px; height: 7px; border-radius: 50%; background: #a66c52; margin-top: 4px; box-shadow: 0 0 0 4px rgba(166, 108, 82, .1); }
.signal.calm-signal i { background: #6b8c82; box-shadow: 0 0 0 4px rgba(107, 140, 130, .1); }
.signal strong, .signal p { display: block; margin: 0; }
.signal strong { font-size: 10px; }
.signal p { color: var(--muted); font-size: 9px; line-height: 1.45; margin-top: 4px; }

.health-privacy {
  margin-top: 17px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.health-privacy h3 { margin: 0 0 5px; font-size: 15px; }
.health-privacy p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 9px; }

.check-question {
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 15px 0;
  margin: 0;
}

.check-question legend { font-size: 11px; font-weight: 700; line-height: 1.45; padding: 0; margin-bottom: 10px; }
.answer-scale { display: flex; flex-wrap: wrap; gap: 7px; }
.answer-scale label,
.relief-options label {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 9px;
  padding: 8px 9px;
  font-size: 9px;
  cursor: pointer;
}

.answer-scale label:has(input:checked),
.relief-options label:has(input:checked) {
  border-color: var(--metal);
  box-shadow: inset 0 0 0 1px var(--metal);
  color: var(--ink);
}

.answer-scale input,
.relief-options input { margin: 0 5px 0 0; accent-color: var(--accent); }
.work-scale { display: grid; grid-template-columns: 1fr; gap: 8px; }
.work-scale span { color: var(--muted); font-size: 8px; }
.work-scale input { width: 100%; accent-color: var(--accent); }
.work-scale output { font-family: var(--font-display); font-size: 18px; }
.adaptive-block { margin: 15px 0; padding: 14px; border: 1px solid color-mix(in srgb, var(--metal), var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--soft), transparent 22%); }
.adaptive-block .check-question:last-child { border-bottom: 0; }
.relief-options { display: flex; flex-wrap: wrap; gap: 7px; }
.safety-question { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 16px 0; }
.wellbeing-result { margin: 15px 0; padding: 14px; border-left: 3px solid var(--accent); border-radius: 9px; background: var(--surface-2); }
.wellbeing-result.hidden { display: none; }
.wellbeing-result.safety { border-color: #b34e48; background: color-mix(in srgb, #b34e48, var(--surface) 90%); }
.wellbeing-result strong { display: block; font-size: 12px; }
.wellbeing-result p { margin: 6px 0; }
.wellbeing-result small { color: var(--muted); font-size: 8px; }
.install-app {
  width: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(231, 238, 243, .18);
  border-radius: 11px;
  background: rgba(231, 238, 243, .08);
  color: var(--sidebar-ink);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .2px;
}
.install-app:hover { background: rgba(231, 238, 243, .13); }
.install-app.hidden { display: none; }

@media (max-width: 900px) {
  .health-metrics { grid-template-columns: repeat(2, 1fr); }
  .health-layout { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .health-metrics { grid-template-columns: 1fr; }
  .health-notice { grid-template-columns: 38px 1fr; }
  .health-notice button { grid-column: 2; text-align: left; padding: 0; }
  .health-privacy { align-items: flex-start; flex-direction: column; }
}

