:root {
  --bg: #f2f2f7; --card: #ffffff; --card-2: #f6f6f9; --text: #111114; --muted: #6e6e78; --line: #e4e4ea;
  --green: #22b35e; --yellow: #e8a500; --red: #e5484d; --orange: #ff7a2f; --indigo: #6c5ce7; --blue: #2f80ed;
  --band: rgba(108, 92, 231, .12); --track: #ececf1; --okband: rgba(34, 179, 94, .14);
  --radius: 22px; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04); --glass: rgba(255,255,255,.82);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #000000; --card: #141416; --card-2: #1c1c1f; --text: #f5f5f7; --muted: #8e8e98; --line: #2a2a2e;
  --green: #30d158; --yellow: #ffd60a; --red: #ff453a; --orange: #ff9f0a; --indigo: #8e7dff; --blue: #4ea1ff;
  --band: rgba(142, 125, 255, .16); --track: #26262a; --shadow: none; --glass: rgba(20,20,22,.82);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 15px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
.shell { max-width: 560px; margin: 0 auto; padding: 12px 16px calc(96px + env(safe-area-inset-bottom)); }

.top { display: flex; align-items: center; gap: 8px; padding: 6px 0 14px; }
.when { flex: 1; text-align: center; }
.when small { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: 11px; font-weight: 600; }
.when h1 { margin: 2px 0 0; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.nav { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--card); font-size: 24px; line-height: 1; cursor: pointer; }
.nav:disabled { opacity: .3; cursor: default; }

.card { background: var(--card); border-radius: var(--radius); padding: 18px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card h2 { margin: 0; font-size: 17px; font-weight: 700; }
.card .head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.card .head small, .label { color: var(--muted); font-size: 12px; }
.notice p { margin: 0; color: var(--muted); text-align: center; }
.hint { color: var(--muted); font-size: 12px; margin: 10px 0 0; }

.rings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 18px 10px 16px; }
.ring { text-align: center; min-width: 0; }
.ring svg { width: 100%; max-width: 120px; display: block; margin: 0 auto; }
.ring .val { font-size: 25px; font-weight: 700; letter-spacing: -.02em; fill: var(--text); }
.ring .unit { font-size: 11px; fill: var(--muted); }
.ring h3 { margin: 6px 0 0; font-size: 13px; font-weight: 600; }
.ring .zone { font-size: 12px; font-weight: 600; }
.summary { margin: 4px 4px 0; font-size: 14px; color: var(--muted); text-align: center; grid-column: 1 / -1; }

.zone-green { color: var(--green); } .zone-yellow { color: var(--yellow); } .zone-red { color: var(--red); }
.zone-orange { color: var(--orange); } .zone-indigo { color: var(--indigo); } .zone-muted { color: var(--muted); }

.bio { padding: 12px 0; border-top: 1px solid var(--line); }
.bio:first-of-type { border-top: 0; padding-top: 0; }
.bio .row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.big { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.big span { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.delta { font-size: 13px; font-weight: 600; text-align: right; }
.delta small { display: block; font-weight: 400; color: var(--muted); }
.spark { width: 100%; height: 64px; display: block; margin-top: 8px; }

.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--card-2); }
.chip.zone-green { background: color-mix(in srgb, var(--green) 16%, transparent); }
.chip.zone-yellow { background: color-mix(in srgb, var(--yellow) 18%, transparent); }
.chip.zone-red { background: color-mix(in srgb, var(--red) 16%, transparent); }
.chip.zone-orange { background: color-mix(in srgb, var(--orange) 16%, transparent); }

.macros { display: grid; gap: 10px; margin-top: 14px; }
.macro .row { display: flex; justify-content: space-between; font-size: 13px; }
.bar { height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; margin-top: 4px; }
.bar i { display: block; height: 100%; border-radius: 4px; }

.list { margin: 0; padding: 0; list-style: none; }
.list li { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.list li:first-child { border-top: 0; padding-top: 0; }
.list .mark { width: 20px; flex: none; text-align: center; color: var(--muted); }
.list .done { color: var(--muted); text-decoration: line-through; }
.list .meta { color: var(--muted); font-size: 12px; }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pair .card { margin-bottom: 12px; }
.footer { color: var(--muted); font-size: 12px; text-align: center; margin-top: 16px; line-height: 1.6; }
.footer button { background: none; border: 0; color: var(--blue); cursor: pointer; padding: 6px; }
.limits { margin: 8px 0 0; padding-left: 16px; color: var(--muted); font-size: 12px; }
.split { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.list .mark.zone-green { color: var(--green); } .list .mark.zone-orange { color: var(--orange); }

/* tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 8px;
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); background: var(--glass);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); border-top: 1px solid var(--line); z-index: 5; }
.tabbar button { flex: 1; max-width: 200px; border: 0; background: none; padding: 6px 0; border-radius: 14px; color: var(--muted);
  font-size: 12px; font-weight: 600; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tabbar .ico { font-size: 18px; line-height: 1; }
.tabbar button[aria-pressed="true"] { color: var(--text); background: var(--card-2); }

/* period switch */
.period { display: flex; background: var(--card); border-radius: 14px; padding: 4px; gap: 4px; margin-bottom: 12px; box-shadow: var(--shadow); }
.period button { flex: 1; border: 0; background: none; border-radius: 10px; padding: 8px 0; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
.period button[aria-pressed="true"] { background: var(--text); color: var(--bg); }

/* overview */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tiles > div { background: var(--card-2); border-radius: 14px; padding: 10px 12px; min-width: 0; }
.tiles b { display: block; font-size: 24px; margin-top: 2px; letter-spacing: -.02em; }
.tiles .label { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mix { display: flex; height: 10px; border-radius: 5px; overflow: hidden; margin-top: 14px; background: var(--track); gap: 2px; }
.mix i { display: block; height: 100%; }
.mixkey { display: flex; justify-content: space-between; font-size: 12px; margin-top: 6px; font-weight: 600; }

.group { margin: 22px 4px 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.metric .big { font-size: 28px; }
.deltaline { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.deltaline .right { margin-left: auto; }
.trend { font-size: 13px; font-weight: 700; }
.nodata { color: var(--muted); font-size: 12px; margin-top: 10px; }
.center { text-align: center; }
.axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }
.axis.even span { flex: 1; text-align: center; }

/* health */
.upload .btn { display: block; text-align: center; background: var(--text); color: var(--bg); border-radius: 14px; padding: 12px; font-weight: 600; cursor: pointer; }
.upload input { display: none; }
.upload .btn.busy { opacity: .5; pointer-events: none; }
.bodygrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bodygrid > div { background: var(--card-2); border-radius: 14px; padding: 10px 12px; min-width: 0; }
.bodygrid b { display: block; font-size: 22px; margin-top: 2px; letter-spacing: -.02em; }
.bodygrid b span { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.bodygrid .spark { height: 36px; margin-top: 4px; }
.lab { border-top: 1px solid var(--line); padding: 12px 0; }
.lab:first-of-type { border-top: 0; padding-top: 0; }
.lab .row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.lab .name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.lab .value { font-weight: 700; white-space: nowrap; }
.lab .value span { font-weight: 500; color: var(--muted); font-size: 12px; margin-left: 2px; }
.lab .spark { height: 44px; }
.lab details { margin-top: 6px; font-size: 12px; color: var(--muted); }
.lab summary { cursor: pointer; }
.lab ol { margin: 6px 0 0; padding-left: 18px; }
.search { width: 100%; border: 1px solid var(--line); background: var(--card-2); border-radius: 12px; padding: 10px 12px; font: inherit; color: var(--text); margin-bottom: 12px; }

/* ===== Premium light (2026-10-18): soft pastel tiles, white cards, forest + lime accents ===== */
:root, :root[data-theme="dark"] {
  --bg: #f3f3f0; --card: #ffffff; --card-2: #f3f3f0; --text: #141815; --muted: #80857f; --line: #e8e9e4;
  --green: #3a9a57; --yellow: #d79b00; --red: #e0533f; --orange: #f08a3c; --indigo: #1e4b2e; --blue: #3c86b5;
  --forest: #1e4b2e; --forest-2: #2f6b42; --lime: #c9f25e;
  --mint: #dcefd3; --sky: #d5eaf3; --butter: #f6eec4; --peach: #f6ddd0;
  --band: rgba(201, 242, 94, .32); --okband: rgba(58, 154, 87, .14); --track: #e9eae5;
  --radius: 28px; --shadow: 0 1px 1px rgba(20,24,21,.03), 0 10px 30px -12px rgba(20,24,21,.12); --glass: rgba(255,255,255,.9);
  color-scheme: light;
}
body { font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif; letter-spacing: -.005em; }
.shell { padding-top: 18px; }
.when small { color: var(--muted); font-weight: 500; letter-spacing: .02em; text-transform: none; font-size: 13px; }
.when h1 { font-size: 30px; font-weight: 600; letter-spacing: -.035em; }
.nav { width: 42px; height: 42px; background: var(--card); box-shadow: var(--shadow); font-size: 22px; color: var(--text); }
.card { border: 0; box-shadow: var(--shadow); padding: 20px; }
.card h2 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.big { font-size: 40px; font-weight: 600; letter-spacing: -.045em; line-height: 1.05; }
.big span { font-weight: 500; }
.metric .big { font-size: 34px; }
.label, .hint { color: var(--muted); }
.tint-sky { background: var(--sky); } .tint-peach { background: var(--peach); }
.tint-butter { background: var(--butter); } .tint-mint { background: var(--mint); }
.tint-sky .spark rect, .tint-sky .bio { border-color: rgba(20,24,21,.08); }
.tint-pair .card:first-child { background: var(--mint); } .tint-pair .card:last-child { background: var(--sky); }
.tint-sky .hint, .tint-peach .hint, .tint-butter .hint, .tint-mint .hint, .tint-sky .label, .tint-mint .meta { color: #59605a; }
/* hero: deep green card with lime rings */
.rings { background: linear-gradient(150deg, var(--forest-2), var(--forest) 70%); color: #fff; padding: 22px 12px 18px; }
.rings svg circle:first-of-type { stroke: rgba(255,255,255,.14); }
.rings svg circle + circle { stroke: var(--lime); }
.ring .val { fill: #fff; font-weight: 600; font-size: 26px; }
.ring .unit { fill: rgba(255,255,255,.7); }
.ring h3 { color: rgba(255,255,255,.85); font-weight: 500; font-size: 12px; }
.ring .zone { color: var(--lime) !important; font-weight: 600; }
.summary { color: rgba(255,255,255,.88); font-size: 14px; }
.bio { border-top: 1px solid rgba(20,24,21,.08); }
.chip { background: rgba(255,255,255,.75); border: 0; font-weight: 600; padding: 5px 12px; }
.chip.zone-green { background: var(--mint); color: var(--forest); } .chip.zone-yellow { background: var(--butter); color: #7a5a00; }
.chip.zone-orange { background: var(--peach); color: #9a4a17; } .chip.zone-red { background: #fbd9d2; color: #b23a26; }
.lab .chip { background: #fbd9d2; color: #b23a26; }
.tiles > div, .bodygrid > div { background: var(--card-2); border: 0; border-radius: 20px; }
.bodygrid > div:nth-child(4n+1) { background: var(--mint); } .bodygrid > div:nth-child(4n+2) { background: var(--sky); }
.bodygrid > div:nth-child(4n+3) { background: var(--butter); } .bodygrid > div:nth-child(4n+4) { background: var(--peach); }
.tiles b, .bodygrid b { font-size: 26px; font-weight: 600; letter-spacing: -.04em; }
.group { color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: .02em; text-transform: none; margin: 26px 6px 10px; }
.bar { background: rgba(20,24,21,.07); height: 8px; }
.period { background: var(--card); border: 0; box-shadow: var(--shadow); border-radius: 18px; }
.period button { border-radius: 14px; }
.period button[aria-pressed="true"] { background: var(--forest); color: #fff; }
.upload { background: linear-gradient(150deg, var(--forest-2), var(--forest) 70%); color: #fff; }
.upload h2 { color: #fff; } .upload .head small, .upload .hint { color: rgba(255,255,255,.75); }
.upload .btn { background: var(--lime); color: var(--forest); border: 0; border-radius: 18px; font-weight: 600; padding: 14px; }
.search { border: 0; background: var(--card); box-shadow: var(--shadow); border-radius: 18px; padding: 13px 16px; }
.lab { border-top: 1px solid var(--line); }
.lab .value { font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.list li { border-top: 1px solid rgba(20,24,21,.07); }
.notice { background: var(--butter); }
/* floating white tab bar, dark-green active pill */
.tabbar { left: 14px; right: 14px; bottom: calc(10px + env(safe-area-inset-bottom)); padding: 6px; border: 0; border-radius: 26px;
  background: rgba(255,255,255,.92); box-shadow: 0 12px 34px -10px rgba(20,24,21,.25); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.tabbar button { color: var(--muted); font-weight: 500; border-radius: 20px; padding: 8px 0; }
.tabbar button[aria-pressed="true"] { background: var(--forest); color: #fff; }
.footer button { color: var(--forest); font-weight: 600; }

/* checkup review */
.review .lead { font-size: 15px; margin: 0 0 6px; }
.review .urgent { background: #fbd9d2; color: #b23a26; border-radius: 14px; padding: 10px 12px; font-weight: 600; }
.review .topic { border-top: 1px solid var(--line); padding: 12px 0 2px; }
.review .topic .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.review .topic p { margin: 6px 0 0; }
.review .topic .chip { background: var(--sky); color: #1f4b63; }
.review details { margin-top: 8px; font-size: 13px; }
.review summary { cursor: pointer; color: var(--forest); font-weight: 600; }
.review ol { margin: 6px 0 0; padding-left: 20px; }
