/* Slate. Colours and sizes from the approved mockup (Main, Record, Unlock). No inline styles anywhere: the CSP
   allows this file only, and the few sizes worked out at run time are set through CSSOM. */
:root {
  --bg: #0B0D10;
  --card: #15181D;
  --text: #F2F4F7;
  --muted: #9BA3AE;
  --dim: #8A93A0;
  --line: #22262D;
  --green: #5ED6A0;
  --green-fill: #3FBF85;
  --orange: #F59E5B;
  --orange-fill: #E8823A;
  --blue: #3D7BF2;
  --blue-soft: #8CB8FF;
  --blue-bg: #14213A;
  --blue-line: #2A4A85;
  --tabbar: #0F1215;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; }
a { color: inherit; }

.app {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 480px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 16px calc(100px + env(safe-area-inset-bottom));
}

h1 { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -0.5px; }
h2 { margin: 0; font-size: 20px; font-weight: 650; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pad { padding: 0 4px; }
.up { color: var(--green); }
.down { color: var(--orange); }
.flat { color: var(--text); }
.note { margin: 0; padding: 10px 14px; border-radius: 14px; background: var(--blue-bg); border: 1px solid var(--blue-line);
  color: var(--blue-soft); font-size: 14px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 60px 20px; color: var(--muted);
  text-align: center; }

.head { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 44px; }
.head-side { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0;
  border-radius: 22px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:active { background: var(--card); }
.back svg { transform: scaleX(-1); }

.card { background: var(--card); border-radius: 22px; padding: 18px; border: 0; color: var(--text); text-align: left;
  width: 100%; }
.list { padding: 0; display: flex; flex-direction: column; }

/* Status pill */
.pill { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 14px; background: var(--card);
  border: 1px solid #1E3A2E; }
.pill-dot { width: 10px; height: 10px; border-radius: 5px; flex: none; background: var(--green); box-shadow: 0 0 0 4px #1E3A2E; }
.pill-warn { border-color: #4A2F1B; }
.pill-warn .pill-dot { background: var(--orange); box-shadow: 0 0 0 4px #4A2F1B; }
.pill-text { display: flex; flex-direction: column; font-size: 14px; font-weight: 600; min-width: 0; }
.pill-text small { font-weight: 500; color: var(--muted); }
.pill-time { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; }

/* Today hero */
.hero { display: flex; flex-direction: column; gap: 16px; padding: 20px; }
.hero-row { display: flex; align-items: center; gap: 16px; }
.hero-nums { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hero-big { font-size: 54px; font-weight: 700; letter-spacing: -1.5px; line-height: 1; font-variant-numeric: tabular-nums; }
.hero-sub { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ring { position: relative; width: 72px; height: 72px; flex: none; }
.ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-label strong { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ring-label small { font-size: 9px; font-weight: 600; color: var(--muted); }
.ring-on { stroke: var(--green-fill); }
.ring-off { stroke: #3A2A1F; }
.ring-none { stroke: #262A31; }
.ring-blue { stroke: #5B8DEF; }

.week { display: flex; flex-direction: column; gap: 8px; }
.week-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--muted);
  font-variant-numeric: tabular-nums; }
.bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: end; }
.bar { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bar-up { height: 34px; width: 100%; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid #2A2F37; }
.bar-down { height: 34px; width: 100%; display: flex; align-items: flex-start; justify-content: center; margin-top: -4px; }
.bar-fill { width: 70%; max-width: 24px; border-radius: 5px; }
.bar-fill.up { background: var(--green-fill); }
.bar-fill.down { background: var(--orange-fill); }
.bar-label { font-size: 11px; font-weight: 500; color: var(--muted); }
.bar-label.now { font-weight: 700; color: var(--text); }

/* All-time line */
.alltime { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; cursor: pointer; }
.alltime-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.alltime-num { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.alltime-num small { font-size: 13px; font-weight: 600; }
.spark { width: 100%; height: 56px; display: block; }
.chart { width: 100%; height: 120px; display: block; }
.zero { stroke: #2A2F37; stroke-width: 1; stroke-dasharray: 3 3; }
.stroke { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.stroke.up { stroke: var(--green); }
.stroke.down { stroke: var(--orange); }
.stroke.flat { stroke: var(--muted); }
.area { stroke: none; }
.area.up { fill: rgba(63, 191, 133, 0.2); }
.area.down { fill: rgba(232, 130, 58, 0.2); }
.area.flat { fill: transparent; }
.dot { stroke: var(--card); stroke-width: 2; }
.dot.up { fill: var(--green); }
.dot.down { fill: var(--orange); }
.dot.flat { fill: var(--muted); }
.chart-axis { display: flex; justify-content: space-between; }

/* A card waiting */
.banner { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; background: var(--blue-bg);
  border: 1px solid var(--blue-line); color: var(--text); text-align: left; cursor: pointer; width: 100%; }
.banner-n { width: 34px; height: 34px; border-radius: 17px; background: var(--blue); color: #FFFFFF; display: flex;
  align-items: center; justify-content: center; font-size: 16px; font-weight: 700; flex: none; }
.banner-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.banner-text strong { font-size: 16px; font-weight: 650; }
.banner-text span { font-size: 14px; color: var(--blue-soft); font-variant-numeric: tabular-nums; }
.banner svg { color: var(--blue-soft); flex: none; }

/* Rows */
.open, .log { display: flex; flex-direction: column; gap: 10px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 0 4px;
  font-size: 15px; font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 12px; padding: 14px 18px; }
.row + .row { border-top: 1px solid var(--line); }
.row-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.row-title { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.row-sub { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-variant-numeric: tabular-nums; }
.row-side strong, .row > strong { font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tag { padding: 2px 8px; border-radius: 8px; font-size: 12px; font-weight: 600; }
.tag-yours { background: var(--blue-bg); color: var(--blue-soft); }
.tag-desk { background: #22262D; color: var(--muted); }

/* Record */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--card); }
.seg-btn { min-width: 44px; min-height: 36px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent;
  color: var(--muted); font-size: 15px; font-weight: 600; cursor: pointer; }
.seg-btn[aria-pressed="true"] { background: #2A2F37; color: var(--text); }
.app > .seg { align-self: flex-start; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile { background: var(--card); border-radius: 18px; padding: 14px 10px; display: flex; flex-direction: column;
  align-items: center; gap: 4px; text-align: center; }
.tile-ring { position: relative; width: 58px; height: 58px; }
.tile-pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 14px;
  font-weight: 700; font-variant-numeric: tabular-nums; }
.tile-big { font-size: 20px; font-weight: 700; line-height: 58px; font-variant-numeric: tabular-nums; }
.tile-label { font-size: 13px; font-weight: 600; }
.split { display: flex; flex-direction: column; padding: 6px 0; }
.split + .split { border-top: 1px solid var(--line); }
.split-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 15px; font-variant-numeric: tabular-nums; }
.card > .section-head { padding: 0 0 6px; }
.day { display: flex; flex-direction: column; gap: 8px; }
.day-head { display: flex; justify-content: space-between; padding: 6px 4px 0; font-size: 14px; font-weight: 600;
  color: var(--muted); font-variant-numeric: tabular-nums; }

/* The approve sheet */
.shade { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); display: flex; align-items: flex-end;
  justify-content: center; z-index: 10; }
.sheet { width: 100%; max-width: 480px; background: var(--card); border-radius: 24px 24px 0 0; display: flex;
  flex-direction: column; gap: 14px; padding: 18px 18px calc(24px + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; }
.sheet-head > div { display: flex; flex-direction: column; gap: 2px; }
.legs { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.legs li { padding: 10px 0; font-size: 16px; font-weight: 600; }
.legs li + li { border-top: 1px solid var(--line); }
.sheet-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sheet-nums div { display: flex; flex-direction: column; gap: 2px; }
.sheet-nums strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.sheet-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.sheet-status { margin: 0; min-height: 20px; font-size: 15px; font-weight: 600; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 18px;
  border: 0; border-radius: 16px; font-size: 17px; font-weight: 650; cursor: pointer; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn-go { background: var(--blue); color: #FFFFFF; }
.btn-stop { background: #2A1D14; color: var(--orange); }
.btn-quiet { background: #22262D; color: var(--text); }
.wide { width: 100%; }

/* Getting in */
.unlock { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 60px 8px 0; text-align: center; }
.unlock-mark { width: 84px; height: 84px; border-radius: 22px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #3D7BF2, #1F3F9E); color: #F2F4F7; }
.unlock .muted { margin: 0; max-width: 320px; font-size: 16px; }
.field { width: 100%; min-height: 50px; padding: 0 16px; border-radius: 14px; border: 1px solid #2A2F37; background: var(--card);
  color: var(--text); font-size: 17px; }
.unlock-status { margin: 0; min-height: 22px; font-size: 15px; color: var(--blue-soft); }

/* Settings */
.set { display: flex; flex-direction: column; gap: 10px; }
.set h2 { font-size: 17px; }
.set p { margin: 0; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 15px; }
.set-status { margin: 0; padding: 0 4px; font-size: 15px; color: var(--blue-soft); }

/* Tab bar */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); background: var(--tabbar); border-top: 1px solid var(--line); }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 44px;
  text-decoration: none; color: var(--dim); font-size: 10px; font-weight: 600; }
.tab[aria-current="page"] { color: var(--text); }
