/* Lookout — tokens from design/lookout-mockup.html. Calm = grey; colour only for exceptions. */
:root {
  --bg: #f3f4f6; --surface: #ffffff; --ink: #15181c; --muted: #6a727b; --faint: #9aa2ab; --line: #e2e5e9;
  --calm: #c9cfd6; --calm-2: #dde1e6; --calm-3: #eceef1;
  --ok: #2f8a57; --late: #b9790a; --late-bg: #fbf1dc; --down: #cf3427; --down-bg: #fde9e6;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1012; --surface: #16191c; --ink: #e8ebee; --muted: #9098a1; --faint: #6c747d; --line: #262b30;
    --calm: #3a4148; --calm-2: #2b3137; --calm-3: #20252a; --ok: #5cc48a; --late: #e2a73c; --late-bg: #33280f;
    --down: #ff6a5c; --down-bg: #3a1714; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.35 var(--sans);
  padding-top: max(12px, env(safe-area-inset-top, 0px)); padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.mono, code { font-family: var(--mono); font-variant-numeric: tabular-nums; }
code { font-size: 13px; background: var(--calm-3); padding: 1px 5px; border-radius: 5px; white-space: nowrap; }
.muted { color: var(--muted); }
a { color: var(--ink); }

/* sign-in and setup */
.auth { max-width: 380px; margin: 12vh auto 0; display: grid; gap: 14px; justify-items: center; text-align: center; }
.auth h1 { margin: 4px 0 0; font-size: 26px; letter-spacing: -.01em; }
.auth p { margin: 0; }
.mark { color: var(--ink); }
.mark .mark-bg { fill: var(--ink); }
.mark .mark-dot { fill: var(--bg); }
.mark .mark-line { stroke: var(--bg); }
.form { display: grid; gap: 8px; width: 100%; text-align: left; }
.form label { font-size: 12px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; margin-top: 6px; }
.form input {
  font: 17px var(--mono); letter-spacing: .06em; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); min-height: 48px; width: 100%;
}
.form input#label { font-family: var(--sans); letter-spacing: 0; }
.form .btn { margin-top: 10px; }
.msg { min-height: 1.4em; font-size: 14px; }
.msg.err { color: var(--down); }
.quiet { font-size: 14px; color: var(--muted); }

.btn {
  font: inherit; font-weight: 600; font-size: 16px; min-height: 48px; padding: 10px 18px; border-radius: 12px; border: 0;
  cursor: pointer; width: 100%; max-width: 380px;
}
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.ghost { background: var(--calm-3); color: var(--ink); width: auto; min-height: 40px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: progress; }
.btn:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* dashboard (Phase 1 first-run) */
.wrap { max-width: 640px; margin: 0 auto; display: grid; gap: 14px; }
.verdict { background: var(--surface); border-radius: 16px; padding: 14px 16px; display: grid; gap: 10px; }
.vhead { display: flex; align-items: center; gap: 12px; }
.verdict > *, .vhead > div { min-width: 0; } /* long verdict lines wrap instead of widening the page at 390 px */
.vword, .vline { overflow-wrap: anywhere; }
.vword { font-size: 26px; font-weight: 700; letter-spacing: -.01em; line-height: 1.1; }
.vline { font-size: 15px; color: var(--muted); }
.vmeta { font-size: 12px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.btn.ghost.sm.refresh { min-height: 32px; padding: 4px 12px; font-size: 13px; border-radius: 9px; }
.glyph.unk { color: var(--faint); flex: none; }
.sec { background: var(--surface); border-radius: 14px; padding: 12px 14px; display: grid; gap: 10px; }
.sec h2 { margin: 0; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.self { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 14px; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- dashboard (Phase 2; components from design/lookout-mockup.html) ---------- */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { display: block; }
.c-ok { color: var(--ok); } .c-down { color: var(--down); } .c-late { color: var(--late); } .c-faint { color: var(--faint); } .c-calm { color: var(--calm); } .c-white { color: #fff; }
.g-tick { stroke: var(--surface); }
.f-calm { fill: var(--calm); } .f-calm2 { fill: var(--calm-2); } .f-calm3 { fill: var(--calm-3); } .f-ink { fill: var(--ink); } .f-down { fill: var(--down); } .f-late { fill: var(--late); } .f-none { fill: none; }
.s-calm { stroke: var(--calm); } .s-down { stroke: var(--down); } .s-faint { stroke: var(--faint); } .s-surface { stroke: var(--surface); }
.t-muted { fill: var(--muted); font: 11px var(--sans); } .t-faint { fill: var(--faint); font: 700 11px var(--sans); }
.sec h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sec h2 .aside { text-transform: none; letter-spacing: 0; font-weight: 400; }
body.is-stale .dim { filter: grayscale(1); opacity: .45; }
.stale { background: var(--ink); color: var(--bg); border-radius: 14px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; }
.stale b { font-size: 17px; display: block; }
.verdict.v-down { background: var(--down-bg); }
.verdict.v-late { background: var(--late-bg); }
.wit { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px 4px 6px; border-radius: 999px; background: var(--calm-3); font-size: 13px; }
.chip.c-down, .chip.k-down { background: var(--down); color: #fff; }
.chip.k-late { background: var(--late); color: #fff; }
.chip.k-unk { background: transparent; border: 1px dashed var(--faint); color: var(--muted); }
.chip .ok-mark { color: var(--ok); }
.incident { box-shadow: inset 0 0 0 2px var(--down); }
.path { overflow-x: auto; }
.path svg { min-width: 330px; width: 100%; height: auto; }
.since { display: grid; gap: 4px; }
.since svg { width: 100%; height: 8px; }
.hb-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.hb-age { font-size: 28px; font-weight: 600; }
.hb-age.k-late { color: var(--late); } .hb-age.k-down { color: var(--down); }
.hb-bar { width: 100%; height: 22px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.note { font-size: 12px; color: var(--muted); }
.axis { display: flex; justify-content: space-between; font-size: 10px; color: var(--faint); }
.strip { display: grid; grid-template-columns: repeat(24, 1fr); gap: 1.5px; height: 14px; }
.strip60 { display: grid; grid-template-columns: repeat(60, 1fr); gap: 1px; height: 12px; }
.cell { border-radius: 2px; background: var(--calm); }
.cell.deg { background: var(--late); }
.cell.down { background: var(--down); }
.cell.none { background: transparent; box-shadow: inset 0 0 0 1px var(--calm); }
.cell.part { background: linear-gradient(to top, var(--calm) 45%, transparent 45%); box-shadow: inset 0 0 0 1px var(--calm); }
.cell.edge { background: repeating-linear-gradient(135deg, var(--calm-2) 0 2px, transparent 2px 5px); box-shadow: inset 0 0 0 1px var(--calm-2); }
.cell.unk { background: repeating-linear-gradient(135deg, var(--calm-2) 0 2px, transparent 2px 5px); }
.lane { display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 6px; }
.lane.wide { grid-template-columns: 62px 1fr; }
.lane .k { font-size: 10px; color: var(--faint); letter-spacing: .04em; text-transform: uppercase; }
.apps { display: grid; gap: 4px; }
.app { display: grid; gap: 4px; padding: 8px 0; border-top: 1px solid var(--line); cursor: pointer; }
.app:first-of-type { border-top: 0; }
.app:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.ahead { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.aname { font-weight: 600; font-size: 16px; }
.ahead .spark { margin-left: auto; }
.ms { font-size: 12px; color: var(--muted); min-width: 52px; text-align: right; }
.dlane { display: grid; grid-template-columns: repeat(24, 1fr); height: 12px; font-size: 10px; line-height: 12px; text-align: center; color: var(--ink); }
.dlane .rb { color: var(--late); font-weight: 700; } .dlane .dn { color: var(--down); font-weight: 700; }
.lag { font-size: 11px; padding: 2px 6px; border-radius: 6px; background: var(--late-bg); color: var(--late); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ahead > .aname, .ahead > .btn, .ahead > svg { flex-shrink: 0; }
/* A problem row on a phone: the problem and its button win over the sparkline (was 414 px wide at 390). */
@media (max-width: 480px) { .ahead:has(.btn.fix, .lag) .spark { display: none; } .ahead:has(.btn.fix, .lag) .ms { margin-left: auto; } }
.checking { font-size: 11px; padding: 2px 6px; border-radius: 6px; border: 1px dashed var(--late); color: var(--late); }
.detail { display: grid; gap: 6px; padding: 6px 0 2px 36px; font-size: 13px; min-width: 0; }
.detail .mono { overflow-wrap: anywhere; }
.newdot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink); display: inline-block; flex: none; }
.svcs { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.svc { border-radius: 10px; background: var(--calm-3); padding: 8px 6px; display: grid; justify-items: center; gap: 4px; min-height: 58px; text-align: center; }
.svc .n { font-size: 11px; color: var(--muted); line-height: 1.15; overflow-wrap: anywhere; }
.svc.crit { box-shadow: inset 0 0 0 1.5px var(--calm); }
.svc.s-down { background: var(--down); } .svc.s-down .n { color: #fff; }
.svc.s-late { background: var(--late-bg); } .svc.s-late .n { color: var(--late); }
.svc.s-unk { background: transparent; border: 1px dashed var(--faint); box-shadow: none; }
.day { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; padding-top: 4px; }
.ev { display: grid; grid-template-columns: 44px 18px 1fr auto; gap: 8px; align-items: center; min-height: 32px; }
.ev .t { font-size: 12px; color: var(--muted); }
.ev .w { font-size: 14px; display: flex; gap: 6px; align-items: center; min-width: 0; }
.ev.info .w { color: var(--muted); }
.empty { font-size: 14px; color: var(--muted); }
.mini { display: inline-flex; align-items: center; gap: 6px; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
@media (prefers-reduced-motion: no-preference) { .cell, .svc, .chip { transition: background-color .15s ease-out; } }
.svcs .empty { grid-column: 1 / -1; }
.pushbox { display: grid; gap: 8px; } .pushbox .btn.primary { width: auto; display: inline-flex; align-items: center; gap: 8px; } .ev .d { display: flex; gap: 4px; color: var(--muted); }

/* ---------- v1.1: How to fix ---------- */
.btn.fix { width: auto; min-height: 36px; padding: 6px 12px; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; background: var(--ink); color: var(--bg); border-radius: 10px; }
.v-down .btn.fix, .incident .btn.fix { background: var(--down); color: #fff; }
.btn.fix.sm { min-height: 28px; padding: 3px 9px; font-size: 12px; border-radius: 8px; background: var(--calm-3); color: var(--ink); }
button.svc { font: inherit; border: 0; cursor: pointer; color: inherit; }
button.svc:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.svc .fixhint { font-size: 10px; text-decoration: underline; }
.ov { position: fixed; inset: 0; z-index: 50; background: rgba(8, 10, 12, .55); display: flex; align-items: flex-end; justify-content: center;
  padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
.sheet { background: var(--surface); color: var(--ink); width: 100%; max-width: 600px; max-height: 88vh; overflow: auto; border-radius: 20px 20px 0 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 14px; }
@media (min-width: 700px) { .ov { align-items: center; } .sheet { border-radius: 20px; } }
.sheet h3 { margin: 0; font-size: 20px; display: flex; align-items: center; gap: 10px; }
.sheet .x { margin-left: auto; background: var(--calm-3); color: var(--ink); border: 0; border-radius: 50%; width: 34px; height: 34px; font-size: 16px; cursor: pointer; flex: none; }
.sheet .intro { margin: 0; font-size: 14px; color: var(--muted); }
.guide { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.guide li { display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: start; }
.guide .gi { width: 32px; height: 32px; border-radius: 9px; background: var(--calm-3); display: grid; place-items: center; color: var(--ink); }
.guide .gt { display: grid; gap: 6px; font-size: 15px; min-width: 0; }
.where { font-size: 11px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.cmd { display: flex; align-items: center; gap: 8px; background: var(--calm-3); border-radius: 8px; padding: 6px 6px 6px 10px; min-width: 0; }
.cmd code { background: none; padding: 0; font-size: 12px; overflow-x: auto; white-space: nowrap; flex: 1; min-width: 0; }
.cmd button { font: inherit; font-size: 12px; border: 0; border-radius: 6px; background: var(--surface); color: var(--ink); padding: 5px 9px; cursor: pointer; flex: none; }
.guide a { color: var(--ink); font-weight: 600; }
.gnote { font-size: 13px; color: var(--late); }
/* v2 one-tap fixes */
.fixbox { display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: var(--calm-3); }
.steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.steps li { display: flex; gap: 10px; align-items: center; font-size: 15px; }
.steps li.st-todo { color: var(--muted); }
.fp { font-size: 22px; letter-spacing: .06em; margin: 0; }
.sheet .form input { font: 17px var(--mono); padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); min-height: 48px; width: 100%; }

/* v3: vitals + Coming up */
.vitals { display: grid; gap: 8px; }
.vgrid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.vgrid.is-old { opacity: .55; }
@media (min-width: 560px) { .vgrid { grid-template-columns: 1fr 1fr; column-gap: 18px; } }
.vrow { display: grid; grid-template-columns: 1fr 72px; gap: 2px 10px; align-items: center; }
.vtop { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; }
.vtop .k { font-size: 10px; color: var(--faint); letter-spacing: .04em; text-transform: uppercase; }
.vbar { width: 100%; height: 14px; display: block; }
.f-latebg { fill: var(--late-bg); } .f-downbg { fill: var(--down-bg); }
.cal { width: 100%; height: auto; display: block; }
.xrows { display: grid; gap: 2px; }
.xrow { display: grid; grid-template-columns: 18px 1fr auto auto; gap: 8px; align-items: center; min-height: 32px; }
.xl { font-size: 14px; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.flag { font-size: 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 0 4px; }
.dleft { font-size: 13px; text-align: right; min-width: 44px; }
button.chip { border: 0; font: inherit; font-size: 13px; color: inherit; cursor: pointer; }
button.chip.k-late, button.chip.k-down { color: #fff; }

/* v4: snooze, privacy */
.vbtns { display: inline-flex; gap: 6px; flex-shrink: 0; }
.vbtns .btn, .snoozed .btn { white-space: nowrap; }
.snoozed { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; padding: 6px 10px; border-radius: 10px; background: var(--late-bg); color: var(--ink); }
.chips.privacy { margin-bottom: 4px; }
