/* Sarah's valueVibes — a phone-first, iOS-shaped surface.
   Grouped inset lists, one tint, system type, tabular numbers, light by
   default and dark when the phone is. Nothing decorative. */

:root {
  --bg: #F2F2F7;
  --card: #FFFFFF;
  --label: #000000;
  --label2: rgba(60, 60, 67, 0.6);
  --label3: rgba(60, 60, 67, 0.3);
  --sep: rgba(60, 60, 67, 0.29);
  --tint: #007AFF;
  --tint-soft: rgba(0, 122, 255, 0.12);
  --green: #34C759;
  --green-soft: rgba(52, 199, 89, 0.14);
  --red: #FF3B30;
  --red-soft: rgba(255, 59, 48, 0.12);
  --orange: #FF9500;
  --fill: rgba(120, 120, 128, 0.12);
  --fill2: rgba(120, 120, 128, 0.2);
  --bar: rgba(249, 249, 249, 0.92);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --card: #1C1C1E; --label: #FFFFFF;
    --label2: rgba(235, 235, 245, 0.6); --label3: rgba(235, 235, 245, 0.3);
    --sep: rgba(84, 84, 88, 0.6); --tint: #0A84FF; --tint-soft: rgba(10, 132, 255, 0.18);
    --green: #30D158; --green-soft: rgba(48, 209, 88, 0.16);
    --red: #FF453A; --red-soft: rgba(255, 69, 58, 0.16); --orange: #FF9F0A;
    --fill: rgba(120, 120, 128, 0.24); --fill2: rgba(120, 120, 128, 0.32);
    --bar: rgba(22, 22, 24, 0.92); --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --card: #1C1C1E; --label: #FFFFFF;
  --label2: rgba(235, 235, 245, 0.6); --label3: rgba(235, 235, 245, 0.3);
  --sep: rgba(84, 84, 88, 0.6); --tint: #0A84FF; --tint-soft: rgba(10, 132, 255, 0.18);
  --green: #30D158; --green-soft: rgba(48, 209, 88, 0.16);
  --red: #FF453A; --red-soft: rgba(255, 69, 58, 0.16); --orange: #FF9F0A;
  --fill: rgba(120, 120, 128, 0.24); --fill2: rgba(120, 120, 128, 0.32);
  --bar: rgba(22, 22, 24, 0.92); --shadow: none; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--label);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  font-size: 17px; line-height: 1.35; -webkit-font-smoothing: antialiased;
}
a { color: var(--tint); text-decoration: none; }
button { font: inherit; }
.num, .v, .big { font-variant-numeric: tabular-nums; }

/* ── Screen ── */
.screen {
  max-width: 640px; margin: 0 auto; padding: 0 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  padding-bottom: calc(49px + env(safe-area-inset-bottom) + 32px);
}
.ltitle { font-size: 34px; font-weight: 700; letter-spacing: -0.4px; line-height: 1.15; margin: 10px 0 2px; }
.sub { font-size: 15px; color: var(--label2); margin: 0; }
.sub b { color: var(--label); font-weight: 600; }

/* ── Grouped inset lists ── */
.group { margin-top: 26px; }
.group-h {
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--label2); padding: 0 16px 7px; display: flex; justify-content: space-between; align-items: baseline;
}
.group-h a { text-transform: none; letter-spacing: 0; font-size: 15px; }
.group-f { font-size: 13px; color: var(--label2); padding: 7px 16px 0; line-height: 1.4; }
.card { background: var(--card); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.card + .card { margin-top: 10px; }
.row {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 44px; padding: 10px 16px; color: inherit;
}
.row:not(:first-child)::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 0.5px; background: var(--sep);
}
.row .t { flex: 1; min-width: 0; }
.row .l { display: block; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .s { display: block; font-size: 13px; color: var(--label2); margin-top: 1px; }
.row .s.wrap { white-space: normal; }
.row .v { font-size: 17px; white-space: nowrap; text-align: right; }
.row .v small { display: block; font-size: 13px; color: var(--label2); font-weight: 400; }
.row .v.pos { color: var(--green); }
.row .v.neg { color: var(--red); }
.row .v.muted, .row.muted .l, .row.muted .v { color: var(--label2); }
.row.link { cursor: pointer; }
.row.link:active { background: var(--fill); }
.row .chev { width: 8px; height: 14px; flex: none; color: var(--label3); }
.glyph { width: 22px; height: 22px; flex: none; display: inline-block; }
.row.sec { padding-top: 6px; padding-bottom: 6px; min-height: 0; background: var(--fill); }
.row.sec .l { font-size: 13px; color: var(--label2); }
.row.sec .v { font-size: 13px; color: var(--label2); }

/* ── Hero ── */
.hero { padding: 16px; }
.hero .big { font-size: 34px; font-weight: 700; letter-spacing: -0.5px; line-height: 1.1; }
.hero .big.ok { color: var(--green); }
.hero .big.warn { color: var(--red); }
.hero .state { font-size: 15px; color: var(--label2); margin-top: 4px; }
.hero .state b { color: var(--label); font-weight: 600; }
.stat-row { display: flex; gap: 10px; }
.stat { flex: 1; padding: 12px 14px; }
.stat .k { font-size: 13px; color: var(--label2); }
.stat .n { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; margin-top: 2px; }
.stat .n.ok { color: var(--green); }
.stat .n.warn { color: var(--red); }

/* ── Pills, tags ── */
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--fill); color: var(--label2); vertical-align: middle; }
.pill.ok { background: var(--green-soft); color: var(--green); }
.pill.warn { background: var(--red-soft); color: var(--red); }
.pill.tint { background: var(--tint-soft); color: var(--tint); }
.pill.orange { background: rgba(255, 149, 0, 0.14); color: var(--orange); }

/* ── Buttons ── */
.btn {
  display: block; width: 100%; border: 0; border-radius: 12px; padding: 14px 16px;
  font-size: 17px; font-weight: 600; color: var(--tint); background: var(--card); cursor: pointer;
}
.btn.primary { background: var(--tint); color: #fff; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn:active { filter: brightness(0.92); }
.mini { border: 0; border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 600; color: var(--tint); background: var(--tint-soft); cursor: pointer; white-space: nowrap; }
.mini.quiet { color: var(--label2); background: var(--fill); }
.mini:disabled { opacity: 0.5; }
.actions { display: flex; gap: 6px; flex: none; }

/* ── Segmented control ── */
.seg { display: flex; background: var(--fill); border-radius: 9px; padding: 2px; }
.seg label { flex: 1; position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.seg span {
  display: block; text-align: center; font-size: 13px; font-weight: 500; padding: 7px 2px;
  border-radius: 7px; color: var(--label); cursor: pointer;
}
.seg input:checked + span { background: var(--card); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
@media (prefers-color-scheme: dark) { .seg input:checked + span { background: #636366; } }
.seg input:focus-visible + span { outline: 2px solid var(--tint); }

/* ── Forms ── */
.textarea {
  display: block; width: 100%; border: 0; border-radius: 10px; background: var(--card);
  padding: 12px 16px; font: inherit; color: var(--label); min-height: 96px; resize: vertical; box-shadow: var(--shadow);
}
.textarea:focus { outline: 2px solid var(--tint); }
.textarea.inset { border-radius: 0; box-shadow: none; }
.field { display: block; width: 100%; border: 0; border-radius: 12px; background: var(--card); padding: 14px 16px; font: inherit; font-size: 22px; letter-spacing: 0.12em; text-align: center; color: var(--label); }
.field:focus { outline: 2px solid var(--tint); }

/* ── Sliders ── */
.lever { padding: 12px 16px 14px; }
.lever .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.lever .top .l { font-size: 17px; }
.lever .top .v { font-size: 17px; font-weight: 600; }
.lever .n { font-size: 13px; color: var(--label2); margin-top: 2px; }
.lever input[type="range"] { width: 100%; margin: 10px 0 0; accent-color: var(--tint); height: 28px; }

/* ── Checks and meters ── */
.check .glyph.ok { color: var(--green); }
.check .glyph.no { color: var(--label3); }
.meter { height: 4px; border-radius: 2px; background: var(--fill2); overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; background: var(--green); }

/* ── The house: three flat houses, one colour per plan ── */
.hue-base    { --h: #2DB37A; }
.hue-middle  { --h: #3B82F6; }
.hue-stretch { --h: #8E5CF6; }
.hue-done    { --h: #34C759; }
.levers { position: relative; }
.houses {
  position: sticky; top: max(6px, env(safe-area-inset-top)); z-index: 6;
  display: flex; align-items: flex-end; justify-content: space-around; gap: 6px; margin: 0 0 14px; padding: 8px 10px 8px;
  background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border: 0.5px solid var(--sep); border-radius: 14px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}
.hcell { flex: 1; min-width: 0; text-align: center; color: var(--h); --sz: 0.8; position: relative; z-index: 1; }
.hbox { height: 86px; display: flex; align-items: flex-end; justify-content: center; }
.hs-house { width: 96px; height: 80px; transform: scale(var(--sz)); transform-origin: bottom center; transition: transform 0.35s cubic-bezier(.2,.9,.3,1.2); }
.hname { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--h); margin-top: 5px; font-weight: 700; }
.hprice { font-size: 17px; font-weight: 700; letter-spacing: -0.3px; color: var(--label); line-height: 1.2; }
.hdelta { font-size: 11px; color: var(--label2); min-height: 14px; }
.hdelta.up { color: var(--green); }
.hdelta.down { color: var(--red); }
@media (max-width: 380px) { .hprice { font-size: 14px; } .hs-house { width: 80px; height: 67px; } .hbox { height: 72px; } }
.ground { position: absolute; left: 10px; right: 10px; bottom: 54px; height: 4px; border-radius: 2px; background: var(--fill2); }
.hcell.pop .hbox { animation: pop 0.3s ease-out; }
.tier.hue-base, .tier.hue-middle, .tier.hue-stretch { box-shadow: inset 4px 0 0 var(--h), var(--shadow); }
.tname { display: flex; align-items: center; gap: 10px; }
.tname .badge.sm svg { width: 20px; height: 17px; }
.strip .cell .k { color: var(--h); }
@media (prefers-reduced-motion: reduce) { .hs-house { transition: none; } .hcell.pop .hbox { animation: none; } }

/* ── Tier cards (house) ── */
.tier { padding: 16px; }
.tier .name { display: flex; justify-content: space-between; align-items: center; }
.tier .name b { font-size: 17px; }
.tier .price { font-size: 30px; font-weight: 700; letter-spacing: -0.4px; margin-top: 6px; }
.tier .when { font-size: 15px; color: var(--label2); margin-top: 2px; }
.tier .note { font-size: 15px; margin-top: 10px; line-height: 1.4; }
.biz { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--fill); }
.biz.you { background: var(--tint-soft); }
.biz.floor { background: var(--fill); }
.biz.over { background: var(--fill); }
.biz-row span span { color: var(--label2); }
.biz.sizing { background: transparent; border: 0.5px solid var(--sep); }
.biz-row.sum { border-top: 0.5px solid var(--sep); margin-top: 4px; padding-top: 7px; }
.biz-row.sum b { font-weight: 700; }
.biz-text { font-size: 14px; line-height: 1.45; color: var(--label); }
.biz.you .biz-h { color: var(--tint); }
.biz-h { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--label2); font-weight: 600; margin-bottom: 4px; }
.biz-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 14px; padding: 3px 0; }
.biz-row span { color: var(--label2); }
.biz-row b { font-weight: 600; white-space: nowrap; }
.biz-row b small { font-weight: 400; color: var(--label2); font-size: 12px; }
.tier .checks { margin: 12px 0 0; padding: 0; list-style: none; }
.tier .checks li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; font-size: 15px; }
.tier .checks li .glyph { flex: none; margin-top: 1px; }
.tier .checks li small { display: block; color: var(--label2); font-size: 13px; }
.tier .checks li.ok .glyph { color: var(--green); }
.tier .checks li.no .glyph { color: var(--label3); }

/* ── Values: one colour per value, a badge, pills that fill, a bar that fills ──
   The one place the app is allowed a little play. Kept quiet: flat colour,
   no mascots, a 120ms pop on a choice, and the Duolingo pressed-edge button. */
.hue-labor   { --h: #F0883E; }
.hue-honesty { --h: #3B82F6; }
.hue-earth   { --h: #34A853; }
.hue-fees    { --h: #E0A800; }
.hue-privacy { --h: #8E5CF6; }
.hue-local   { --h: #E8508A; }
.badge {
  width: 40px; height: 40px; border-radius: 12px; flex: none; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--h) 16%, transparent); color: var(--h);
}
.badge svg { width: 23px; height: 23px; }
.badge.sm { width: 30px; height: 30px; border-radius: 9px; }
.badge.sm svg { width: 18px; height: 18px; }
.vcard .card { transition: box-shadow 0.25s, background 0.25s; }
.vcard.set .card { box-shadow: inset 4px 0 0 var(--h), var(--shadow); }
.vcard.set .badge { background: var(--h); color: #fff; }
.vhead { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px 10px; }
.vt { flex: 1; min-width: 0; }
.vtitle { font-size: 17px; font-weight: 600; line-height: 1.25; }
.vdesc { font-size: 13px; color: var(--label2); margin-top: 2px; line-height: 1.4; }
.opts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 0 12px 14px; }
.opt { position: relative; }
.opt input { position: absolute; inset: 0; opacity: 0; margin: 0; }
.opt span {
  display: block; text-align: center; font-size: 13px; font-weight: 600; padding: 9px 4px; border-radius: 999px;
  background: var(--fill); color: var(--label2); cursor: pointer; line-height: 1.15;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.opt input:checked + span { background: var(--h); color: #fff; }
.opt.lv-0 input:checked + span { background: var(--fill2); color: var(--label); }
.opt.lv-3 input:checked + span { box-shadow: 0 3px 0 color-mix(in srgb, var(--h) 70%, #000); }
.opt input:focus-visible + span { outline: 2px solid var(--h); outline-offset: 2px; }
.opt span:active { transform: scale(0.97); }
.pill.hued { background: color-mix(in srgb, var(--h) 16%, transparent); color: var(--h); }
.pill.hued.strong { background: var(--h); color: #fff; }
.progress { display: flex; align-items: center; gap: 12px; margin: 18px 0 2px; }
.segs { flex: 1; display: flex; gap: 4px; }
.segs .seg { display: block; flex: 1; height: 8px; border-radius: 4px; background: var(--fill2); transition: background 0.3s, transform 0.3s; }
.segs .seg.on { background: var(--h); }
.progress .count { font-size: 13px; font-weight: 600; color: var(--label2); font-variant-numeric: tabular-nums; white-space: nowrap; }
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.08); } 100% { transform: scale(1); } }
.pop { animation: pop 0.22s ease-out; }
.btn.duo { box-shadow: 0 4px 0 color-mix(in srgb, var(--tint) 65%, #000); transition: transform 0.08s, box-shadow 0.08s; }
.btn.duo:active { transform: translateY(3px); box-shadow: 0 1px 0 color-mix(in srgb, var(--tint) 65%, #000); filter: none; }
@media (prefers-reduced-motion: reduce) { .pop { animation: none; } .vcard .card, .opt span, .segs .seg { transition: none; } }

/* ── Tab bar ── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  height: calc(49px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--sep); display: flex; justify-content: center;
}
.tabbar .inner { display: flex; width: 100%; max-width: 640px; }
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 10px; font-weight: 500; color: var(--label2); padding-top: 4px;
}
.tab svg { width: 26px; height: 26px; }
.tab.active { color: var(--tint); }
.tab:active { opacity: 0.6; }

/* ── Toast ── */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(49px + env(safe-area-inset-bottom) + 14px); z-index: 11;
  background: var(--label); color: var(--bg); font-size: 14px; font-weight: 600;
  padding: 8px 14px; border-radius: 999px; opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
.toast.show { opacity: 0.92; }

/* ── Footer ── */
.foot { font-size: 13px; color: var(--label2); margin: 28px 16px 0; line-height: 1.45; }

/* ── Welcome ── */
.welcome { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; }
.welcome .mark { width: 72px; height: 72px; border-radius: 18px; background: #2F6B55; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 38px; font-weight: 700; margin: 0 auto 18px; }
.welcome h1 { text-align: center; font-size: 28px; margin: 0; }
.welcome p { text-align: center; color: var(--label2); font-size: 15px; margin: 6px 0 24px; }
.welcome .err { color: var(--red); text-align: center; font-size: 15px; margin-top: 10px; }
