:root {
  --paper: #f8fafc;
  --ink: #102033;
  --muted: #526170;
  --line: rgba(16, 32, 51, .12);
  --navy: #102033;
  --green: #146c43;
  --mint: #dff5ea;
  --teal: #16869a;
  --amber: #c98118;
  --amber-soft: #fff4df;
  --rose: #c4455a;
  --rose-soft: #fdebed;
  --slate: #526170;
  --white: #ffffff;
  --surface: rgba(255, 255, 255, .88);
  --shadow: 0 18px 48px rgba(16, 32, 51, .12);
  --button-shadow: 0 12px 26px rgba(20, 108, 67, .20);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,.76), rgba(235,241,247,.95)),
    linear-gradient(90deg, rgba(16,32,51,.025) 1px, transparent 1px),
    linear-gradient(180deg, rgba(16,32,51,.025) 1px, transparent 1px);
  background-size: auto, 28px 28px, 28px 28px;
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, textarea, select { font: inherit; }
button {
  color: inherit;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}
button:active { transform: translateY(1px) scale(.99); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(22, 134, 154, .24);
  outline-offset: 2px;
}

.app-shell {
  width: min(100%, 540px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 16px 118px;
  background:
    linear-gradient(180deg, rgba(248,250,252,.96), rgba(242,246,249,.98) 36%, #edf3f6 100%),
    linear-gradient(90deg, rgba(16,32,51,.025) 1px, transparent 1px);
  background-size: auto, 24px 24px;
  box-shadow: 0 0 70px rgba(16, 32, 51, .16);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 2px 18px;
}

.brand-lock {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 12px 28px rgba(16, 32, 51, .24);
  font-weight: 800;
}

.lock-shackle {
  position: absolute;
  top: 7px;
  width: 18px;
  height: 14px;
  border: 3px solid rgba(255,255,255,.82);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
}

.lock-body { padding-top: 12px; }

.life-home-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 66px;
  height: 40px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 12px 28px rgba(16, 32, 51, .24);
  font-size: .76rem;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
}

.life-home-button span {
  font-size: .94rem;
  line-height: 1;
}

.life-home-button b {
  font: inherit;
}

.topbar h1, .section-heading h2, .hero-band h2, .info-band h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: 1.34rem;
  line-height: 1.1;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--teal);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.icon-button {
  margin-left: auto;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--navy);
  font-weight: 800;
}

.view { display: none; }
.view.active { display: block; }

.hero-band,
.section-block,
.progress-band,
.info-band {
  margin: 0 0 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-band {
  display: grid;
  gap: 14px;
  background:
    linear-gradient(135deg, rgba(16,32,51,.98), rgba(20,108,67,.92)),
    var(--navy);
  color: var(--white);
}

.hero-band .eyebrow { color: #b9f0d4; }
.hero-band p { color: rgba(255,255,255,.78); }
.hero-band h2 { font-size: 1.88rem; line-height: 1.06; }

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-heading h2, .info-band h2 {
  font-size: 1.12rem;
  line-height: 1.18;
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.metric-grid, .choice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.metric-card, .mini-card, .feature-card, .item-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.metric-card {
  padding: 12px 10px;
  min-height: 82px;
}

.metric-value {
  display: block;
  font-size: 1.16rem;
  font-weight: 850;
}

.metric-label {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.25;
}

.action-list, .card-list, .goal-list {
  display: grid;
  gap: 10px;
}

.empty-state {
  margin: 0;
  padding: 16px;
  border: 1px dashed var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, .58);
}

.action-row {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.action-row h3, .item-card h3, .feature-card h3, .mini-card h3 {
  margin: 0 0 5px;
  font-size: .96rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--teal);
}
.status-dot.green { background: var(--green); }
.status-dot.amber { background: var(--amber); }
.status-dot.rose { background: var(--rose); }

.progress-item { margin-top: 12px; }
.progress-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  font-size: .86rem;
  font-weight: 750;
}
.progress-top span:last-child { color: var(--muted); font-weight: 650; }
.progress-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(82, 97, 112, .16);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: var(--value);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--teal));
}

.stacked-form {
  display: grid;
  gap: 12px;
}
.stacked-form.compact { gap: 10px; }

label, fieldset {
  display: grid;
  gap: 7px;
  margin: 0;
  border: 0;
  padding: 0;
}

label span, legend, .control-label {
  color: var(--navy);
  font-size: .82rem;
  font-weight: 800;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  padding: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  padding: 9px 11px;
  font-size: .84rem;
  font-weight: 750;
}
.chip.active {
  border-color: rgba(20, 108, 67, .45);
  background: var(--mint);
  color: var(--green);
}

.primary-button, .secondary-button, .quiet-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 10px 14px;
  font-weight: 850;
}

.primary-button {
  background: var(--green);
  color: var(--white);
  box-shadow: var(--button-shadow);
}
.secondary-button {
  background: var(--navy);
  color: var(--white);
}
.quiet-button {
  border-color: var(--line);
  background: var(--white);
  color: var(--navy);
}
.wide { width: 100%; }

.result-panel:empty { display: none; }

.choice-stack {
  display: grid;
  gap: 10px;
}

.choice-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.choice-card strong {
  display: block;
  margin-bottom: 5px;
}

.item-card {
  padding: 13px;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: #edf3f6;
  color: var(--slate);
  padding: 4px 8px;
  font-size: .72rem;
  font-weight: 800;
}
.tag.green { background: var(--mint); color: var(--green); }
.tag.amber { background: var(--amber-soft); color: #80500c; }
.tag.rose { background: var(--rose-soft); color: var(--rose); }

.topic-group + .topic-group { margin-top: 12px; }
.topic-title {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.feature-card, .mini-card {
  padding: 13px;
}
.feature-card.warning {
  background: linear-gradient(180deg, var(--amber-soft), #fff);
  border-color: rgba(201, 129, 24, .24);
}

.plain-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.5;
}

.privacy-receipt {
  display: grid;
  gap: 8px;
  padding: 13px;
  border: 1px solid rgba(20, 108, 67, .22);
  border-radius: 8px;
  background: var(--mint);
}
.privacy-receipt h3 { margin: 0; }

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  width: min(calc(100% - 22px), 520px);
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 18px 48px rgba(16, 32, 51, .20);
  transform: translateX(-50%);
  backdrop-filter: blur(14px);
}

.nav-item {
  display: grid;
  place-items: center;
  gap: 3px;
  min-width: 0;
  min-height: 52px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 800;
}
.nav-item span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: rgba(82, 97, 112, .12);
  color: var(--slate);
}
.nav-item.active {
  background: var(--navy);
  color: var(--white);
}
.nav-item.active span {
  background: rgba(255,255,255,.16);
  color: var(--white);
}

@media (max-width: 430px) {
  .app-shell { padding: 14px 12px 112px; }
  .metric-grid { grid-template-columns: 1fr; }
  .choice-grid, .form-grid { grid-template-columns: 1fr; }
  .hero-band h2 { font-size: 1.58rem; }
  .bottom-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nav-item { min-height: 44px; }
}
