:root {
  --bg: #f6f1ef; --surface: #fffaf8; --surface-2: #f1e8e5; --card-hover: #f7ece9;
  --ink: #2b2124; --muted: #86767b; --faint: #b9a9ad; --body: #e7dbd7;
  --brand: #d9486f;
  --ph-shed: #d9486f; --ph-bloom: #2f9e8f; --ph-radiant: #8e63e6; --ph-regrowth: #c98a2b; --ph-late: #71819a;
  --ex-show: #3f9b6e; --ex-veil: #d29a3c; --ex-cover: #8d8389; --ex-rest: #e07a95;
  --z-legs: #d9486f; --z-chest: #8e63e6; --z-midriff: #2f9e8f; --z-underarms: #4b84d6;
  --shadow: 0 10px 30px rgba(80, 40, 50, .10), 0 2px 6px rgba(80, 40, 50, .06);
  --glass: rgba(255, 250, 248, .8);
  --radius: 18px; --bar-h: 60px; --gap: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141113; --surface: #1e191c; --surface-2: #2a2327; --card-hover: #262024;
    --ink: #ece3e6; --muted: #a8989e; --faint: #6d5f64; --body: #3a3136; --brand: #ef6a8c;
    --ph-shed: #ef6a8c; --ph-bloom: #4dbfae; --ph-radiant: #a789f2; --ph-regrowth: #dfa74f; --ph-late: #8d9bb3;
    --ex-show: #5cb68a; --ex-veil: #dfa74f; --ex-cover: #7d7378; --ex-rest: #ef8aa5;
    --z-legs: #ef6a8c; --z-chest: #a789f2; --z-midriff: #4dbfae; --z-underarms: #6fa0ea;
    --shadow: 0 10px 30px rgba(0,0,0,.45), 0 2px 6px rgba(0,0,0,.3); --glass: rgba(30, 25, 28, .82);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141113; --surface: #1e191c; --surface-2: #2a2327; --card-hover: #262024;
  --ink: #ece3e6; --muted: #a8989e; --faint: #6d5f64; --body: #3a3136; --brand: #ef6a8c;
  --ph-shed: #ef6a8c; --ph-bloom: #4dbfae; --ph-radiant: #a789f2; --ph-regrowth: #dfa74f; --ph-late: #8d9bb3;
  --ex-show: #5cb68a; --ex-veil: #dfa74f; --ex-cover: #7d7378; --ex-rest: #ef8aa5;
  --z-legs: #ef6a8c; --z-chest: #a789f2; --z-midriff: #4dbfae; --z-underarms: #6fa0ea;
  --shadow: 0 10px 30px rgba(0,0,0,.45), 0 2px 6px rgba(0,0,0,.3); --glass: rgba(30, 25, 28, .82);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { height: 100%; overflow: hidden; overscroll-behavior: none; background: var(--bg);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body { height: 100%; margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.4 Inter, system-ui, -apple-system, sans-serif;
  overflow: hidden; overscroll-behavior: none; display: flex; flex-direction: column; }
img, svg, a { -webkit-user-drag: none; }
button { font: inherit; color: inherit; cursor: pointer; }
svg { display: block; }
a { color: inherit; }

.float { background: var(--glass); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-radius: var(--radius); box-shadow: var(--shadow); }

/* app bar */
.bar { margin: 12px 12px 0; height: var(--bar-h); flex: none; display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; padding: 0 12px 0 16px; position: relative; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink);
  font: 600 18px/1 Fraunces, Georgia, serif; letter-spacing: -.01em; }
.brand img { border-radius: 8px; }
.tabs { display: flex; gap: 4px; }
.tab { display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border: 0; border-radius: 99px;
  background: transparent; color: var(--muted); font-weight: 500; transition: background .15s, color .15s; }
.tab svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tab:hover { background: var(--surface-2); color: var(--ink); }
.tab[aria-selected="true"] { background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--brand); }
.bar-right { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.signal { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13px; color: var(--muted);
  padding: 0 12px; height: 32px; border-radius: 99px; background: var(--surface-2); white-space: nowrap; }
.signal:empty { display: none; }
.signal i { width: 9px; height: 9px; border-radius: 50%; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; transition: background .15s; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#theme .moon { fill: currentColor; stroke: none; }
#theme .sun { display: none; }
:root[data-theme="dark"] #theme .moon { display: none; }
:root[data-theme="dark"] #theme .sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #theme .moon { display: none; }
  :root:not([data-theme="light"]) #theme .sun { display: block; }
}
.cta { height: 40px; padding: 0 18px; border: 0; border-radius: 99px; background: var(--brand); color: #fff;
  font-weight: 600; transition: box-shadow .15s, filter .15s; white-space: nowrap; }
.cta:hover { box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 40%, transparent); filter: brightness(1.04); }
.cta-short { display: none; }

/* stage */
.stage { flex: 1; min-height: 0; padding: var(--gap) 12px 0; display: flex; }
.view { flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; gap: var(--gap); }
.foot { flex: none; text-align: center; font-size: 12px; color: var(--faint); padding: 8px 12px 10px; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--brand); }
.empty { margin: auto; color: var(--muted); font-size: 15px; }

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; min-height: 0; min-width: 0;
  display: flex; flex-direction: column; }
.card-h { font: 600 15px/1.2 Inter, sans-serif; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.kicker { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--c, var(--muted)); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 99px; font-size: 13px; font-weight: 500; background: var(--surface-2); white-space: nowrap; }
.chip.tint { background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); }
.chip.wear { background: color-mix(in srgb, var(--ex-show) 16%, transparent); color: var(--ex-show); }
.chip.layer { background: color-mix(in srgb, var(--ex-veil) 16%, transparent); color: var(--ex-veil); }
.chip.skip { background: var(--surface-2); color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }
.pill { height: 32px; padding: 0 14px; border-radius: 99px; border: 0; background: var(--surface-2); font-weight: 500; }
.pill:hover { background: var(--card-hover); }

/* answer row */
.answer { flex: none; display: flex; align-items: baseline; gap: 18px; padding: 2px 8px; flex-wrap: wrap; }
.answer h2 { margin: 0; font: 600 28px/1.1 Fraunces, Georgia, serif; letter-spacing: -.01em; }
.answer p { margin: 0; color: var(--muted); font-size: 15px; }
.hl { color: var(--brand); }

.grid3 { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0,1.05fr) minmax(0,1fr) minmax(0,1.05fr); gap: var(--gap); }
.grid2 { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0,1.5fr) minmax(0,1fr); gap: var(--gap); }

/* phase card */
.phase-top { display: flex; align-items: center; gap: 18px; flex: 1; min-height: 0; }
.ring { width: min(250px, 46%); max-height: 100%; aspect-ratio: 1; flex: none; }
.ring-track { fill: none; stroke: var(--surface-2); stroke-width: 18; }
.ring-seg { fill: none; stroke-linecap: butt; }
.ring-seg.fut { opacity: .28; }
.ring-now { fill: var(--surface); stroke-width: 4; }
.ring-day { text-anchor: middle; font: 600 30px Fraunces, serif; fill: var(--ink); }
.ring-ph { text-anchor: middle; font: 600 15px Inter, sans-serif; }
.phase-meta { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.phase-hair { font: 600 19px/1.25 Fraunces, Georgia, serif; }
.traits { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; margin-top: 14px; }
.trait { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.dots { display: flex; gap: 4px; }
.dots i { width: 14px; height: 6px; border-radius: 3px; background: var(--surface-2); }
.dots i.on { background: var(--c); }
.profile { margin: 14px 0 0; font-size: 14px; line-height: 1.5; color: var(--ink); opacity: .85; }

/* body card */
.body-wrap { flex: 1; min-height: 0; display: flex; justify-content: center; }
.body { height: 100%; width: auto; max-width: 100%; }
.body .bp { fill: var(--body); }
.body .bl { font-size: 9px; fill: var(--faint); text-anchor: middle; }
.zones { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.zone { display: grid; grid-template-columns: 12px 1fr auto auto 64px; align-items: center; gap: 10px; font-size: 13px; padding: 4px 2px; }
.zone b { font-weight: 600; }
.zone .sw { width: 10px; height: 10px; border-radius: 50%; }
.zd { color: var(--muted); font-variant-numeric: tabular-nums; }
.zp { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 3px; color: var(--muted); min-width: 64px; justify-content: flex-end; }
.zp svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.ex { text-align: center; font-size: 12px; font-weight: 600; padding: 3px 0; border-radius: 99px; min-width: 56px; display: inline-block; }
.ex-show { color: var(--ex-show); background: color-mix(in srgb, var(--ex-show) 15%, transparent); }
.ex-veil { color: var(--ex-veil); background: color-mix(in srgb, var(--ex-veil) 15%, transparent); }
.ex-cover { color: var(--ex-cover); background: color-mix(in srgb, var(--ex-cover) 15%, transparent); }
.ex-rest { color: var(--ex-rest); background: color-mix(in srgb, var(--ex-rest) 15%, transparent); }

/* look card */
.look-card { gap: 14px; }
.look-card .card-h { margin-bottom: 0; }
.lk { display: flex; flex-direction: column; gap: 8px; }
.lk-h { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.ic { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; }
.ic svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.ic.ok { color: var(--ex-show); background: color-mix(in srgb, var(--ex-show) 16%, transparent); }
.ic.mid { color: var(--ex-veil); background: color-mix(in srgb, var(--ex-veil) 16%, transparent); }
.ic.acc { color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }
.ic.no { color: var(--muted); background: var(--surface-2); }
.lk-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.palette { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.palette i { width: 22px; height: 22px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.palette span { margin-left: 6px; }
.care { margin: 0; font-size: 13px; line-height: 1.5; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); color: var(--ink); }

/* rhythm */
.chart-box { flex: 1; min-height: 0; position: relative; }
.chart-box .chart { position: absolute; inset: 0; }
.band { opacity: .07; }
.band-t { font: 600 12px Inter, sans-serif; text-anchor: middle; }
.ax { font: 500 11px Inter, sans-serif; fill: var(--faint); text-anchor: middle; }
.ax.y { text-anchor: end; }
.today-t { fill: var(--ink); font-weight: 600; }
.today-l { stroke: var(--ink); stroke-opacity: .35; stroke-dasharray: 3 4; }
.ln { fill: none; stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.ln.fut { stroke-dasharray: 2 6; opacity: .7; }
.ln.glow { stroke: var(--ph-radiant); } .ln.nest { stroke: var(--ph-regrowth); } .ln.tender { stroke: var(--ph-shed); }
.legend { display: flex; gap: 14px; font-size: 12px; font-weight: 500; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 6px; }
.lg { width: 12px; height: 4px; border-radius: 2px; display: inline-block; }
.lg.glow { background: var(--ph-radiant); } .lg.nest { background: var(--ph-regrowth); } .lg.tender { background: var(--ph-shed); }
.hist { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: space-around; gap: 6px; }
.hrow { display: grid; grid-template-columns: 74px 1fr 30px; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.hrow.now { color: var(--ink); font-weight: 600; }
.hbar { display: flex; gap: 2px; height: 12px; }
.hbar i { height: 100%; border-radius: 3px; opacity: .85; }
.hl-n { text-align: right; font-variant-numeric: tabular-nums; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.stats div { background: var(--surface-2); border-radius: 12px; padding: 10px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.stats b { font: 600 22px Fraunces, serif; }
.stats span { font-size: 12px; color: var(--muted); }

/* calendar */
.cal-wrap { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: var(--gap); }
.cal-card { padding: 14px 16px; }
.cal-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.cal-head h2 { margin: 0 6px; min-width: 9.5em; text-align: center; font: 600 22px/1 Fraunces, Georgia, serif; }
.cal-head .pill { margin-left: auto; }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; font-size: 12px; color: var(--faint); font-weight: 600; text-align: center; padding-bottom: 6px; }
.cal-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cd { position: relative; border: 0; border-radius: 12px; padding: 6px 8px; text-align: left; display: flex; flex-direction: column;
  background: color-mix(in srgb, var(--c) 15%, var(--surface)); transition: background .15s; min-height: 0; overflow: hidden; }
.cd:hover { background: color-mix(in srgb, var(--c) 24%, var(--surface)); }
.cd.proj { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 10%, var(--surface)) 0 6px, var(--surface) 6px 12px); }
.cd.proj:hover { background: color-mix(in srgb, var(--c) 18%, var(--surface)); }
.cd.muted { opacity: .45; }
.cd.today { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c) 70%, transparent); }
.cd.sel { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--ink) 35%, transparent); }
.cd-n { font-weight: 600; font-size: 14px; }
.cd-c { position: absolute; top: 7px; right: 9px; font-size: 11px; font-weight: 600; color: var(--c); }
.cd-w { margin-top: auto; display: flex; gap: 4px; }
.wx { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.wx.done { background: var(--zc); }
.wx.booked { box-shadow: inset 0 0 0 2.5px var(--zc); }
.wx.predicted { box-shadow: inset 0 0 0 1.5px var(--zc); opacity: .7; }
.side { gap: 14px; }
.side-date { font: 600 19px/1.2 Fraunces, Georgia, serif; }
.side-ph { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--c) 14%, transparent); }
.side-ph b { color: var(--c); font-size: 16px; }
.side-ph span { font-size: 13px; color: var(--muted); }
.side-wx { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.side-wx span { display: flex; align-items: center; gap: 8px; }
.side .zones { margin-top: 0; }
.side .zone { grid-template-columns: 12px 1fr auto 64px; }
.legend.col { margin-top: auto; flex-wrap: wrap; gap: 8px 14px; }
.legend.col .lg { width: 10px; height: 10px; border-radius: 3px; }

/* framework */
.analogy { flex: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--gap); }
.analogy div { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.analogy span { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.analogy b { font-weight: 600; font-size: 14px; }
.phases { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--gap); }
.ph-card { gap: 10px; padding: 16px; }
.ph-h { display: flex; align-items: baseline; justify-content: space-between; }
.ph-h b { font: 600 22px Fraunces, serif; color: var(--c); }
.ph-h span { font-size: 12px; color: var(--muted); font-weight: 600; }
.ph-card .phase-hair { font-size: 16px; }
.ph-card .traits { grid-template-columns: 1fr; margin-top: 2px; gap: 6px; }
.ph-card .profile { margin: 0; font-size: 13px; }
.ph-card .palette { margin-top: auto; flex-wrap: wrap; }
.ph-card .palette span { flex-basis: 100%; margin: 4px 0 0; }
.zone-rules { flex: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.zone-rules div { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 9px 12px; white-space: nowrap; overflow: hidden; }
.zone-rules b { color: var(--ink); font-size: 13px; margin-right: 4px; }
.zone-rules .ex { min-width: 0; padding: 2px 7px; font-size: 11px; }

/* phones and short windows: normal page scroll */
@media (max-width: 1100px) {
  .grid3 { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .look-card { grid-column: span 2; }
  .phases { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .analogy, .zone-rules { grid-template-columns: repeat(3, 1fr); }
  .signal { display: none; }
}
@media (max-width: 1100px), (max-height: 620px) {
  body { overflow-y: auto; height: auto; min-height: 100%; }
  html { overflow: auto; }
  .stage { display: block; padding-bottom: 4px; }
  .grid3, .grid2, .phases, .cal-wrap { flex: none; }
  .side .lk .chips { flex-wrap: wrap; }
  .body-wrap { height: 300px; flex: none; }
  .cal-grid { grid-auto-rows: 64px; }
  .chart-box { height: 280px; flex: none; }
}
@media (max-width: 760px) {
  .bar { height: auto; grid-template-columns: 1fr auto; row-gap: 6px; padding: 10px 10px 8px 14px; }
  .tabs { grid-column: 1 / -1; grid-row: 2; overflow-x: auto; scrollbar-width: none; }
  .tab { padding: 0 12px; }
  .cta-long { display: none; } .cta-short { display: inline; }
  .grid3, .grid2, .cal-wrap { grid-template-columns: minmax(0,1fr); }
  .stage { padding: 12px 10px 0; }
  .chip { white-space: normal; height: auto; min-height: 28px; padding: 4px 12px; }
  .zone { grid-template-columns: 12px 1fr auto auto 56px; gap: 8px; }
  .cal-head h2 { min-width: 0; font-size: 19px; }
  .cd { padding: 4px 5px; } .cd-c { display: none; } .cal-grid { gap: 4px; grid-auto-rows: 54px; }
  .zone-rules div { white-space: normal; flex-wrap: wrap; }
  .look-card { grid-column: auto; }
  .phases, .analogy, .zone-rules { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .answer h2 { font-size: 24px; }
  .phase-top { flex-direction: column; align-items: flex-start; }
  .ring { width: 190px; }
}
