/* Built on the IBM Bob reference: near-black navy, one blue accent, cards that
 * are a title over hairline-divided rows, and a lot of air. That page is calm,
 * which is the right register -- an emergency screen that shouts from the first
 * frame has nothing left when something is actually overdue.
 *
 * What is not borrowed is the type scale. Bob is a marketing page read at desk
 * distance; this is read at arm's length by someone whose hands are busy, so
 * the clock and the buttons are far larger than anything on the reference, and
 * amber and red are reserved strictly for state. */

:root {
  --bg: #0a0d16;
  --nav: #0c101b;
  --card: #141a26;
  --card-2: #1a2130;
  --line: #222b3c;
  --hair: #1c2433;
  --ink: #f4f6fa;
  --dim: #8b93a5;
  --faint: #626b7d;
  --blue: #3b5bfd;
  --due: #f0a92b;
  --due-bg: #241a08;
  --due-line: #4a3611;
  --ok: #2ecc71;
  --alarm: #ef4444;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 "IBM Plex Sans", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}

[hidden] { display: none !important; }

/* ------------------------------------------------------------------- chrome */

.banner {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--due-line);
  background: var(--due-bg);
  color: var(--due);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px 16px;
  text-align: center;
  cursor: pointer;
}

/* Bob's nav: hairline rule, the wordmark split across two weights, quiet links
   sitting to the left of one pill. */
.top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top));
  background: var(--nav);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: baseline; gap: 7px; font-size: 17px; }
.brand .light { color: var(--dim); font-weight: 400; }
.brand .bold { font-weight: 700; letter-spacing: -0.01em; }

.top-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.top .link:only-of-type { margin-left: auto; }

.link {
  background: transparent;
  border: 0;
  color: var(--dim);
  font: inherit;
  font-size: 14px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  min-height: 42px;
}

.link:hover { color: var(--ink); background: rgba(255, 255, 255, 0.05); }
.link.pill { box-shadow: inset 0 0 0 1px var(--line); padding: 9px 16px; }

/* -------------------------------------------------------------- ready screen */

.ready-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 30px;
  padding: 34px 18px;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
}

.hero { font-size: clamp(30px, 7.5vw, 46px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.12; }
.hero-sub { margin: 12px auto 0; color: var(--dim); font-size: 15.5px; max-width: 40ch; line-height: 1.5; }

.field-q { font-size: 15px; color: var(--dim); margin-bottom: 11px; }

/* Bob's segmented control, opened into a grid because six options do not fit
   on one row at phone width. */
.birth-opts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.birth-opt {
  min-height: 48px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}

.birth-opt:hover { color: var(--ink); background: rgba(255, 255, 255, 0.04); }
.birth-opt.on { background: var(--blue); color: #fff; font-weight: 650; }
/* "Not known" is the safe default and a real answer, but it is not the
   recommended one, so it reads as chosen without looking like the action. */
.birth-opt.on.unknown { background: var(--card-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }

.field-why { margin-top: 11px; font-size: 13px; color: var(--faint); min-height: 19px; line-height: 1.45; }

.huge {
  width: 100%;
  min-height: 118px;
  border: 0;
  border-radius: 16px;
  background: var(--alarm);
  color: #fff;
  font: inherit;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
}

.huge:active { transform: scale(0.99); }
.start-help { margin: 13px 0 0; color: var(--faint); font-size: 13.5px; line-height: 1.45; }
.sub { color: var(--faint); font-size: 13px; text-wrap: balance; }

/* ------------------------------------------------------------ running screen */

/* The clock stays put while the cards scroll. Losing sight of the elapsed time
   is the one thing this screen cannot afford. */
.clockface {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 20px 16px 14px;
  text-align: center;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.elapsed {
  font-size: clamp(66px, 20vw, 128px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.since { margin-top: 5px; color: var(--dim); font-size: 13.5px; }

.progress-row { margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.pip { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.pip.done { background: var(--ok); }
.pip.due { background: var(--due); }
.progress-text { margin-left: 6px; font-size: 12px; color: var(--faint); }

.windows { padding: 14px 16px 0; display: grid; gap: 9px; }

.win {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 12px;
  padding: 13px 15px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--card);
}

.win-label { font-size: 15px; font-weight: 600; }
.win-value { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ok); }
.win-note { grid-column: 1 / -1; font-size: 12.5px; color: var(--faint); line-height: 1.45; }

.win-bar { grid-column: 1 / -1; height: 5px; border-radius: 999px; background: var(--hair); overflow: hidden; margin-top: 4px; }
.win-bar i { display: block; height: 100%; background: var(--ok); }
.win-low .win-bar i { background: var(--due); }
.win-low .win-value { color: var(--due); }
.win-shut { border-color: #56231f; background: #20100e; }
.win-shut .win-bar i { background: var(--alarm); }
.win-shut .win-value { color: var(--alarm); }
.win-unknown .win-value { color: var(--faint); font-weight: 600; font-size: 14px; }

.due-area { padding: 14px 16px 0; display: grid; gap: 11px; }

.due-card {
  background: var(--due-bg);
  border: 1px solid var(--due-line);
  border-radius: 14px;
  padding: 16px;
}

/* A step nobody has answered for minutes should not look like one that became
   due a second ago. */
.due-card.late { border-color: #6d2b1e; background: #251310; }
.due-card.late .due-when { color: #ff8a5c; }
.due-card.very-late { border-color: var(--alarm); background: #2b120f; box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.3); }
.due-card.very-late .due-when { color: var(--alarm); }

.due-when { font-size: 11.5px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--due); font-weight: 700; }
.due-label { margin: 7px 0 0; font-size: 22px; font-weight: 650; letter-spacing: -0.015em; line-height: 1.22; }
.due-note { margin: 8px 0 0; color: var(--dim); font-size: 14px; line-height: 1.45; }

.due-actions { display: flex; gap: 10px; margin-top: 15px; }

.due-actions button {
  flex: 1;
  min-height: 60px;
  border-radius: 11px;
  border: 0;
  font: inherit;
  font-size: 17px;
  font-weight: 650;
  cursor: pointer;
}

.act-done { background: var(--ok); color: #06240f; }
.act-skip { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--dim); }
.act-skip:hover { color: var(--ink); }

.calm {
  margin: 4px 16px 0;
  padding: 24px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: center;
  background: var(--card);
}

.calm-head { font-size: 17px; font-weight: 600; color: var(--ok); }
.calm-sub { margin-top: 7px; font-size: 14px; color: var(--dim); }

.upnext {
  margin-top: auto;
  padding: 15px 16px;
  color: var(--dim);
  font-size: 14px;
  border-top: 1px solid var(--line);
}

.upnext b { color: var(--ink); font-weight: 600; }

.notebar { display: flex; gap: 8px; padding: 0 16px 16px; }

.notebar input {
  flex: 1;
  min-height: 50px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  font: inherit;
  padding: 0 15px;
}

.notebar input::placeholder { color: var(--faint); }
.notebar input:focus { outline: 0; border-color: var(--blue); }

.notebar button {
  min-height: 50px;
  padding: 0 22px;
  border: 0;
  border-radius: 11px;
  background: var(--card-2);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* --------------------------------------------------------------- the record */

.record-body { padding: 22px 16px 40px; max-width: 700px; width: 100%; margin: 0 auto; }
.record-body h2 { margin: 0 0 5px; font-size: 23px; letter-spacing: -0.02em; }

pre {
  margin: 15px 0;
  padding: 17px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow-x: auto;
  font: 13px/1.65 "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink);
  white-space: pre;
}

.wide {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 11px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 650;
  cursor: pointer;
}

/* --------------------------------------------------------------- about sheet */

.sheet { position: fixed; inset: 0; background: rgba(4, 6, 11, 0.76); display: grid; place-items: end center; z-index: 10; }

.sheet-inner {
  width: min(680px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px 18px 0 0;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
}

.sheet-inner h2 { margin: 0 0 13px; font-size: 21px; letter-spacing: -0.02em; }
.sheet-inner h3 { margin: 20px 0 7px; font-size: 15px; }
.sheet-inner p, .sheet-inner li { color: #bcc4d2; font-size: 14.5px; line-height: 1.55; }
.sheet-inner p { margin: 0 0 10px; }
.sheet-inner ul { margin: 0 0 10px; padding-left: 19px; }
.sheet-inner li { margin-bottom: 6px; }
.sheet-inner strong { color: var(--ink); }
.sheet-inner .wide { margin-top: 16px; }

.warn {
  border-left: 3px solid var(--due);
  background: var(--due-bg);
  padding: 13px 15px;
  border-radius: 0 11px 11px 0;
  color: #f0dcb2 !important;
}

@media (min-width: 720px) {
  .due-area, .windows { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
}
