/* Flow — the System screen, in the house style.
   Loaded after style.css and built on its tokens and its shapes: the same
   rounded cards, pill badges, serif headlines and glyph tab bar as the Report.
   What makes it a "System" screen is what it says — QUEST, LOCKED, BUSTED —
   and the stat bars, not a different visual language. */

.sys { background: var(--bg); color: var(--text); font-family: var(--font-sans); min-height: 100vh; margin: 0; }

.sys .shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px calc(104px + env(safe-area-inset-bottom, 0px));
}

/* ---------------------------------------------------------------- panels */
.sys .panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 14px;
}
.sys .panel.quest { padding: 28px; }
.sys .panel.alert { border-left: 3px solid var(--critical); }
.sys .panel.flat { box-shadow: none; }

.sys .label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); margin: 0;
}
.sys .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sys h1, .sys h2, .sys h3 { margin: 0; font-family: var(--font-serif); font-weight: 600; }
.sys h1 { font-size: 30px; line-height: 1.15; }
.sys h2 { font-size: 22px; line-height: 1.2; }
.sys h3 { font-size: 17px; line-height: 1.3; }
.sys p { margin: 0; }
.sys .dim { color: var(--muted); }
.sys .small { font-size: 13.5px; line-height: 1.5; color: var(--text-2); }
.sys .lede { font-size: 16px; line-height: 1.5; color: var(--text-2); margin-top: 10px; }
.sys .tiny { font-size: 12px; line-height: 1.5; }
.sys .num { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ tags */
/* pills, exactly like .badge — solid = measured, outline = everything else */
.sys .tag {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; line-height: 1.5; white-space: nowrap;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border-strong);
}
.sys .tag.measured { background: var(--text); color: var(--bg); border-color: var(--text); }
.sys .tag.confirmed { background: var(--good-soft); color: var(--good); border-color: transparent; }
.sys .tag.locked { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.sys .tag.busted { color: var(--muted); }
.sys .tag.nosignal { color: var(--muted); }
.sys .meta {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
}

/* ---------------------------------------------------------------- quests */
.sys .qtitle { margin-top: 8px; }
.sys .reward { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }

/* --------------------------------------------------------------- buttons */
.sys .btnrow { display: flex; gap: 10px; margin-top: 16px; }
.sys .btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-sans); font-size: 14.5px; font-weight: 600;
  padding: 12px 20px; border-radius: 999px; cursor: pointer; text-decoration: none;
  background: transparent; color: var(--text-2); border: 1px solid var(--border-strong);
  transition: transform 0.08s ease, opacity 0.15s ease, border-color 0.15s ease;
}
@media (hover: hover) { .sys .btn:hover { color: var(--text); border-color: var(--muted); } }
.sys .btn:active { transform: scale(0.98); }
.sys .btn.primary, .sys .btn.on { background: var(--text); color: var(--bg); border-color: var(--text); }
@media (hover: hover) { .sys .btn.primary:hover { opacity: 0.88; } }
.sys .btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* ------------------------------------------------------------------ bars */
.sys .bar { height: 8px; border-radius: 999px; background: var(--surface-2); margin-top: 6px; overflow: hidden; }
.sys .fill { height: 100%; border-radius: 999px; background: var(--seq-300); }
.sys .fill.good { background: var(--good); }
.sys .fill.warn { background: var(--warning); }
.sys .fill.bad  { background: var(--critical); }

/* ---------------------------------------------------------------- levers */
.sys .lever { padding: 13px 0; border-top: 1px solid var(--border); }
.sys .lever:first-of-type { border-top: none; padding-top: 4px; }
.sys .lever.sel { background: var(--surface-2); margin: 0 -12px; padding-left: 12px; padding-right: 12px; border-radius: var(--radius-sm); }

/* ------------------------------------------------------------------ form */
.sys .grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }
.sys .fieldset { margin-top: 12px; }
.sys .f { display: flex; flex-direction: column; gap: 5px; }
.sys .f label { font-size: 11px; color: var(--muted); }
.sys .f input {
  width: 100%; font-family: var(--font-serif); font-size: 20px; text-align: center;
  padding: 10px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-variant-numeric: tabular-nums;
}
.sys .f input:focus { outline: 2px solid var(--seq-300); outline-offset: 1px; }
.sys .f input::placeholder { color: var(--muted); opacity: 0.45; font-family: var(--font-sans); font-size: 15px; }
.sys .f .sub { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

.sys .status { font-size: 13px; margin-top: 12px; min-height: 18px; color: var(--muted); }
.sys .status.ok { color: var(--good); }
.sys .status.err { color: var(--critical); }

/* ---------------------------------------------------------------- trends */
.sys .trends { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; margin-top: 16px; }
.sys .trend { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sys .trend .tileval { font-family: var(--font-sans); font-weight: 600; font-size: 22px; }
.sys .delta { font-size: 12px; color: var(--muted); }
.sys .delta.up { color: var(--good); }
.sys .delta.down { color: var(--warning); }
.sys .spark { width: 100%; height: 36px; margin-top: 6px; display: block; }
.sys .spark-base { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.sys .spark-bar { fill: var(--muted); opacity: 0.45; }
.sys .spark-now { fill: var(--text); }
.sys .spark.big { height: 96px; }
.sys .trend { cursor: pointer; border-radius: var(--radius-sm); padding: 8px; margin: -8px; transition: background 0.15s ease; }
.sys .trend.open { background: var(--surface-2); }
@media (hover: hover) { .sys .trend:hover { background: var(--surface-2); } }
.sys .trend:focus-visible { outline: 2px solid var(--seq-300); outline-offset: 1px; }
.sys .bodyrow { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.sys .detail { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.sys .detail .spark { margin-top: 10px; }
.sys .detail .tileval { font-family: var(--font-sans); font-weight: 600; }

/* recovery score — the one hero figure on the page */
.sys .herofig { font-family: var(--font-sans); font-weight: 600; font-size: 52px; line-height: 1.05; margin: 2px 0; }
.sys .scorechart { width: 100%; height: 90px; margin-top: 12px; display: block; overflow: visible; }
.sys .scorechart .ref { stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.sys .scorechart .dot { stroke: var(--muted); stroke-opacity: 0.55; stroke-width: 6; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.sys .scorechart .dot-now { stroke: var(--text); stroke-width: 8; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.sys .scorechart .avgline { fill: none; stroke: var(--seq-300); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }

/* ---------------------------------------------------------- this morning */
.sys .alerts { margin-top: 16px; }
.sys .alert-item {
  display: flex; gap: 14px; width: 100%; text-align: left; cursor: pointer;
  padding: 14px 0; background: none; border: 0; border-top: 1px solid var(--border);
  font: inherit; color: inherit;
}
.sys .alert-item:first-child { border-top: none; padding-top: 4px; }
.sys .alert-item:focus-visible { outline: 2px solid var(--seq-300); outline-offset: 2px; border-radius: var(--radius-sm); }
.sys .alert-check {
  flex: none; width: 24px; height: 24px; margin-top: 1px; border-radius: 50%;
  border: 1.5px solid var(--border-strong); display: flex; align-items: center; justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}
@media (hover: hover) { .sys .alert-item:hover .alert-check { border-color: var(--muted); } }
.sys .alert-item.done .alert-check { background: var(--good); border-color: var(--good); }
.sys .alert-item.done .alert-check::after { content: "✓"; color: var(--bg); font-size: 14px; font-weight: 700; }
.sys .alert-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sys .alert-do { font-size: 16px; font-weight: 600; line-height: 1.4; color: var(--text); }
.sys .alert-item.done .alert-do { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--border-strong); }
.sys .alert-item.done .alert-why { color: var(--muted); }

/* ------------------------------------------------------------ last night */
.sys .tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.sys .tile { display: flex; flex-direction: column; gap: 4px; }
.sys .tileval { font-family: var(--font-serif); font-size: 24px; line-height: 1.1; }
.sys .tilekey { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* ------------------------------------------------------- quiet disclosure */
.sys .why { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.sys .more { margin-top: 26px; }
.sys .morebtn {
  display: block; text-align: center; padding: 12px; margin-bottom: 14px;
  font-size: 13px; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: 999px;
}
.sys .more[open] > .morebtn { color: var(--text-2); }

.sys .row > * { min-width: 0; }
.sys details > summary { cursor: pointer; list-style: none; }
.sys details > summary::-webkit-details-marker { display: none; }
.sys .fold-sign::after { content: "+"; color: var(--muted); font-size: 18px; line-height: 1; }
.sys details[open] > summary .fold-sign::after { content: "–"; }
.sys .skel { text-align: center; color: var(--muted); padding: 40px 0; font-size: 14px; }

/* --------------------------------------------------------------------- you */
/* the person model: one row per thing Flow knows, each wearing its basis */
.sys .summary { font-family: var(--font-serif); font-size: 19px; line-height: 1.45; color: var(--text); margin-top: 10px; }
.sys .pgroup { margin-top: 20px; }
.sys .gtitle { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2); margin: 0 0 2px; }
.sys .prow {
  display: grid; grid-template-columns: minmax(96px, 30%) 1fr; gap: 2px 14px; align-items: start;
  width: 100%; padding: 10px 0; margin: 0; border: 0; border-top: 1px solid var(--border);
  background: none; font: inherit; color: inherit; text-align: left;
}
.sys .prow.tap { cursor: pointer; }
@media (hover: hover) { .sys .prow.tap:hover .pv { text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; } }
.sys .prow:focus-visible { outline: 2px solid var(--seq-300); outline-offset: 2px; border-radius: var(--radius-sm); }
.sys .pkey { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; font-size: 13px; line-height: 1.35; color: var(--muted); padding-top: 1px; }
.sys .pkey .tag { font-size: 9.5px; padding: 1px 6px; letter-spacing: 0.05em; }
.sys .pval { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sys .pv { font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--text); }
.sys .tag.prior { background: transparent; border-style: dashed; color: var(--muted); }
.sys .notyet { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--border); }
.sys .chip.chip-prior { border-style: dashed; border-color: var(--muted); }
.sys .chip[disabled] { opacity: 0.5; cursor: default; }
.sys .linkbtn {
  background: none; border: 0; padding: 4px 0; font: inherit; font-size: 13px; cursor: pointer;
  color: var(--text-2); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px;
}
@media (hover: hover) { .sys .linkbtn:hover { color: var(--text); } }
.sys .rel { padding: 16px 0; border-top: 1px solid var(--border); }
.sys .rel:first-child { border-top: 0; }
.sys .rel .bar { margin-top: 10px; height: 6px; }
.sys .hday { display: grid; grid-template-columns: 84px 1fr; gap: 2px 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.sys .hday:first-of-type { margin-top: 10px; }

/* the daily check-in — compact enough to sit half and half beside the recovery
   score on a phone: label over five 26px dots, a 2×2 of places */
.sys .checkin .row { gap: 6px; }
.sys .scale { display: grid; grid-template-columns: 1fr; gap: 4px; margin-top: 10px; }
.sys .scale-key { font-size: 12px; font-weight: 600; color: var(--text-2); }
/* five dots share the row and shrink with it — half a 375px phone still fits */
.sys .dots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; max-width: 190px; }
.sys .dot5 {
  width: 100%; aspect-ratio: 1; padding: 0; border-radius: 50%; border: 1.5px solid var(--border-strong);
  background: var(--surface); color: var(--text-2); font: 600 12px var(--font-sans); cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.1s ease;
}
@media (hover: hover) { .sys .dot5:hover { border-color: var(--muted); } }
.sys .dot5:active { transform: scale(0.93); }
.sys .dot5.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.sys .dot5:focus-visible { outline: 2px solid var(--seq-300); outline-offset: 2px; }
.sys .places { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 12px; }
.sys .chip.mini { justify-content: center; padding: 6px 4px; font-size: 12.5px; min-width: 0; }
.sys .ci-done { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.sys .ci-row { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 8px; }
.sys .ci-row > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.sys .ci-num { font-family: var(--font-sans); font-weight: 600; font-size: 30px; line-height: 1; }
.sys .ci-key { font-size: 13px; font-weight: 600; color: var(--text); }

/* how you say you feel | how your body did — half and half */
.sys .split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-bottom: 14px; }
.sys .split > .panel { margin-bottom: 0; padding: 16px 14px; }
.sys .scorecard .herofig { font-size: 44px; margin: 6px 0 2px; }
.sys .scorecard .scorechart { height: 58px; margin-top: 10px; }
/* on a small phone the two halves stack — side by side they were cramped ("phone UI chopped") */
@media (max-width: 480px) {
  .sys .split { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 600px) {
  .sys .split > .panel { padding: 20px; }
  .sys .scale { grid-template-columns: 52px 1fr; align-items: center; gap: 8px; }
  .sys .dot5 { font-size: 13px; }
  .sys .dots { gap: 6px; }
}

/* why you're tired: one bar per kind, the lead one in the accent */
.sys .tired-row { display: grid; grid-template-columns: 76px 1fr; gap: 10px; align-items: start; margin-top: 12px; }
.sys .tired-key { font-size: 13.5px; color: var(--text-2); line-height: 1.3; }
.sys .tired-key.lead { font-weight: 700; color: var(--text); }
.sys .tired-row .bar { margin-top: 5px; margin-bottom: 4px; }
.sys .fill.quiet { background: var(--border-strong); }
.sys .notyet .linkbtn { font-size: inherit; padding: 0; color: var(--muted); }
@media (hover: hover) { .sys .notyet .linkbtn:hover { color: var(--text); } }

/* how you work: one line per thing that's specific to this person */
.sys .manual { margin-top: 8px; }
.sys .mline { padding: 13px 0; border-top: 1px solid var(--border); }
.sys .mline:first-child { border-top: 0; padding-top: 6px; }
.sys .mline summary { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start; }
.sys .mtext { font-size: 15.5px; line-height: 1.45; color: var(--text); }
.sys .mline .tag { font-size: 9.5px; padding: 1px 6px; margin-top: 3px; }
.sys .you-tag { align-self: flex-start; font-size: 9.5px; padding: 1px 6px; }

/* notifications: a tap on one lands here, its question first and outlined */
.sys .panel.asked { box-shadow: 0 0 0 2px var(--seq-300); }
.sys .cafs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.sys .caf-answer { font-size: 20px; font-weight: 600; margin-top: 6px; }
.sys .notify-card .ntitle { font-family: var(--font-serif); font-size: 19px; line-height: 1.35; margin-top: 6px; }
.sys .nrows { margin-top: 4px; }
.sys .nrow { display: grid; grid-template-columns: minmax(0, 1fr) auto 52px; gap: 10px; align-items: center;
             padding: 10px 0; border-top: 1px solid var(--border); }
.sys .nrow:first-child { border-top: 0; }
.sys .nkey { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.sys .nlabel { font-size: 14px; font-weight: 600; color: var(--text); }
.sys .ntime { font: 600 14px var(--font-sans); color: var(--text); background: var(--surface);
              border: 1px solid var(--border-strong); border-radius: 10px; padding: 6px 8px; min-width: 0; }
@media (min-width: 600px) { .sys .cafs { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.sys .lates { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; margin-top: 10px; }
.sys .late .ntitle { font-family: var(--font-serif); font-size: 21px; line-height: 1.3; margin-top: 4px; }
.sys .chip.invite { padding: 6px 12px; font-weight: 600; white-space: nowrap; }
.sys .typecard .typename { font-family: var(--font-serif); font-size: 34px; line-height: 1.15; margin-top: 6px; }

/* /connect/fitbit: a picture of Google's warning, so it's familiar when it shows */
.sys .gwarn { background: #ffffff; color: #202124; border-radius: 12px; padding: 16px 16px 14px; margin-top: 10px;
              font-family: Roboto, Arial, sans-serif; border: 1px solid var(--border); }
.sys .gwarn .gw-icon { color: #d93025; font-size: 28px; line-height: 1; }
.sys .gwarn .gw-title { font-size: 18px; margin: 8px 0 4px; color: #202124; }
.sys .gwarn .gw-body { font-size: 13px; color: #5f6368; line-height: 1.45; }
.sys .gwarn .gw-row { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.sys .gwarn .gw-adv { font-size: 14px; color: #3c4043; text-decoration: underline; padding: 2px 6px;
                      outline: 3px solid #f29900; outline-offset: 3px; border-radius: 4px; }
.sys .gwarn .gw-back { background: #4285f4; color: #ffffff; padding: 6px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; }

/* your patterns: one plain sentence each, the body's reason under it */
.sys .pat { padding: 14px 0; border-top: 1px solid var(--border); }
.sys .pat:first-child { border-top: 0; padding-top: 10px; }
.sys .pat-head { font-family: var(--font-serif); font-size: 20px; line-height: 1.3; color: var(--text); }
.sys .pat-why { margin-top: 6px; color: var(--text-2); }
.sys .panel[class*="check-"] .ntitle { font-family: var(--font-serif); font-size: 20px; line-height: 1.3; }
.sys .setup-buttons { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.sys .setup-buttons .btn { font-size: 17px; padding: 16px; }
.sys .finding-head { font-family: var(--font-serif); font-size: 22px; font-weight: 400; line-height: 1.3; margin-top: 8px; color: var(--text); }
.sys .h3 { font-size: 17px; line-height: 1.3; }
.sys .setup-buttons.many { display: grid; grid-template-columns: 1fr 1fr; }
.sys .setup-buttons.many .btn { font-size: 15px; padding: 14px 8px; }

/* ---- touchable pieces on You (2026-10-07): segmented switch, rhythm drawing, the lever, tap-open patterns */
.sys .seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; gap: 2px; }
.sys .seg button { border: 0; background: none; padding: 6px 13px; border-radius: 999px; cursor: pointer;
  font: 600 13px var(--font-sans); color: var(--muted); }
.sys .seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14); }
.sys .seg button:focus-visible, .sys .acc-btn:focus-visible, .sys .rh-svg:focus-visible { outline: 2px solid var(--seq-500); outline-offset: 2px; }
.sys .rh-svg { width: 100%; height: auto; display: block; margin-top: 14px; touch-action: pan-y; }
.sys .rh-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; }
.sys .rh-head .label { white-space: nowrap; }
.sys .rh-svg text { font-family: var(--font-sans); fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.sys .rh-svg .lab { fill: var(--text-2); font-size: 12.5px; font-weight: 600; }
.sys .rh-svg .rh-hit { cursor: pointer; }
.sys .rh-svg .s-awake { fill: var(--surface-2); }
.sys .rh-svg .s-sleep { fill: var(--seq-500); opacity: 0.3; }
.sys .rh-svg .s-sharp { fill: var(--good); }
.sys .rh-svg .s-dip { fill: var(--warning); }
.sys .rh-svg .s-mel { fill: var(--discover); opacity: 0.6; }
.sys .rh-svg .rh-now { stroke: var(--text); stroke-width: 2.5; stroke-linecap: round; }
.sys .rh-clock { font-family: var(--font-serif); font-size: 18px; line-height: 1.3; color: var(--text); margin-top: 8px; }
.sys .rh-facts { margin-top: 6px; }
.sys .rh-svg .rh-on { stroke: var(--text); stroke-width: 2; }
.sys .rh-svg .rh-bar { fill: var(--muted); opacity: 0.45; }
.sys .rh-svg .rh-bar.rh-late { fill: var(--warning); opacity: 1; }
.sys .rh-svg .rh-bar.rh-sel { fill: var(--seq-500); opacity: 1; }
.sys .rh-svg .rh-ref { stroke: var(--muted); stroke-dasharray: 3 4; }
.sys .rh-read { min-height: 22px; margin-top: 10px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.sys .lever-big { font-family: var(--font-serif); font-size: 40px; line-height: 1; }
.sys .rangebar { position: relative; display: block; height: 30px; margin-top: 8px; }
.sys .rangebar .rb-track { position: absolute; left: 0; right: 0; top: 13px; height: 4px; border-radius: 2px; background: var(--border-strong); }
.sys .rangebar .rb-band { position: absolute; top: 7px; height: 16px; border-radius: 8px; background: var(--seq-500); opacity: 0.35; transition: left 0.3s ease, width 0.3s ease, opacity 0.2s; }
.sys .rangebar .rb-pt { position: absolute; top: 3px; width: 4px; height: 24px; border-radius: 2px; background: var(--seq-500); transition: left 0.3s ease; }
.sys .acc { border-top: 1px solid var(--border); }
.sys .acc:first-child { border-top: 0; }
.sys .acc-btn { width: 100%; text-align: left; background: none; border: 0; padding: 12px 0; cursor: pointer; color: inherit;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; font: inherit; }
.sys .acc-btn::after { content: "+"; color: var(--muted); font-size: 20px; line-height: 1.2; }
.sys .acc[data-open="true"] .acc-btn::after { content: "–"; }
.sys .acc-body { display: none; padding-bottom: 12px; }
.sys .acc[data-open="true"] .acc-body { display: block; }
@media (prefers-reduced-motion: reduce) { .sys .rangebar .rb-band, .sys .rangebar .rb-pt { transition: none; } }

/* ---- your read: the card deck (end of setup, and from You) */
.sys .story { display: flex; flex-direction: column; gap: 14px; outline: none; }
.sys .story:focus-visible { outline: 2px solid var(--seq-500); outline-offset: 4px; border-radius: 12px; }
.sys .story-dots { display: flex; gap: 0; align-items: center; margin-left: -6px; }
/* a 24px tap target around a small visible pill */
.sys .story-dot { min-width: 24px; height: 24px; border: 0; padding: 0 3px; background: none; cursor: pointer; display: grid; place-items: center; }
.sys .story-dot::before { content: ""; width: 8px; height: 8px; border-radius: 4px; background: var(--border-strong); transition: width 0.2s; }
.sys .story-dot[aria-current="true"]::before { width: 22px; background: var(--text); }
.sys .story-stage { min-height: 290px; }
.sys .story-card { display: flex; flex-direction: column; gap: 10px; animation: story-in 0.25s ease; }
.sys .story-head { font-family: var(--font-serif); font-size: 25px; line-height: 1.25; color: var(--text); }
.sys .story-big { font-family: var(--font-serif); font-size: 54px; line-height: 1; color: var(--seq-500); }
.sys .story-nav { display: flex; justify-content: space-between; gap: 10px; }
.sys .story-nav .btn { min-width: 96px; }
@keyframes story-in { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .sys .story-card { animation: none; } .sys .story-dot::before { transition: none; } }
.sys dialog.story-dlg { width: min(560px, calc(100vw - 24px)); max-height: 92vh; overflow: auto; border: 0; border-radius: 18px;
  padding: 18px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.sys dialog.story-dlg::backdrop { background: rgba(0, 0, 0, 0.45); }
.sys dialog.story-dlg .story { margin-top: 12px; }

/* ---- ask flow: a question in plain words, the answer from your own nights.
   In the page's flow, not pinned: on an iPhone the field then rides above the
   keyboard by itself, and the tab bar already steps aside while typing. */
.sys .ask-log { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.sys .ask-log:empty { display: none; }
.sys .ask-q { align-self: flex-end; max-width: 85%; background: var(--surface-2); color: var(--text);
  padding: 10px 14px; border-radius: 18px 18px 4px 18px; font-size: 15.5px; line-height: 1.45;
  white-space: pre-wrap; overflow-wrap: anywhere; scroll-margin-top: 16px; }
.sys .ask-a { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px; }
.sys .ask-text { margin-top: 6px; font-size: 16px; line-height: 1.55; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.sys .ask-a.err .ask-text, .sys .ask-a.wait .ask-text { color: var(--muted); }
.sys .ask-a.wait .ask-text { animation: ask-pulse 1.4s ease-in-out infinite; }
@keyframes ask-pulse { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .sys .ask-a.wait .ask-text { animation: none; } }
.sys .ask-suggest { margin-top: 20px; }
.sys .ask-suggest:empty { display: none; }
.sys .ask-suggest .chip { text-align: left; }
.sys .ask-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 16px; padding: 5px 5px 5px 16px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 24px; }
.sys .ask-form:focus-within { border-color: var(--seq-300); box-shadow: 0 0 0 2px var(--seq-100); }
.sys .ask-form textarea { flex: 1; min-width: 0; resize: none; border: 0; outline: 0; background: transparent;
  color: var(--text); font: inherit; font-size: 16px; line-height: 1.4; padding: 9px 0; max-height: 132px; }
.sys .ask-form .btn { flex: 0 0 auto; padding: 10px 18px; }
.sys .ask-foot { margin-top: 10px; text-align: center; }
.sys .ask-foot .linkbtn { font-size: 12px; padding: 0; }
.sys .ask-entry .chip-row { margin-top: 10px; }
.sys .ask-entry .chip { text-decoration: none; }

/* ---- setup's last step: home-screen steps as pictures (iPhone in Safari) */
.sys .howto { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.sys .howto-step { display: grid; grid-template-columns: 24px 28px 1fr; gap: 10px; align-items: start; font-size: 15.5px; line-height: 1.4; }
.sys .howto-n { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); color: var(--text-2);
  font: 700 12.5px var(--font-sans); display: grid; place-items: center; }
.sys .howto-icon { color: var(--seq-500); display: grid; place-items: center; height: 24px; }
.sys .howto-sub { display: block; margin-top: 2px; }

/* ---- Today: what Flow is learning about you, one line and a bar */
.sys .learning .learn-q { font-family: var(--font-serif); font-size: 18px; line-height: 1.3; color: var(--text); margin-top: 6px; }
.sys .learning .bar { margin-top: 10px; }
