:root {
  --bg: #0d0d0d;          /* page plane (dataviz dark) */
  --surface: #1a1a19;     /* chart/card surface */
  --surface2: #232322;
  --line: #2c2c2a;
  --ink: #ffffff;         /* primary ink */
  --ink2: #c3c2b7;        /* secondary */
  --muted: #898781;
  --safe: #0ca30c;        /* status: good */
  --exposed: #d03b3b;     /* status: critical */
  --warn: #fab219;        /* status: warning */
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
  padding-bottom: env(safe-area-inset-bottom);
}

/* honesty banner */
.honesty {
  background: #23201a; border-bottom: 1px solid var(--line); color: var(--ink2);
  font-size: 12px; line-height: 1.5; padding: 10px 14px; display: flex; gap: 10px;
}
.honesty b { color: var(--ink); }
.honesty button {
  flex: none; background: transparent; border: 0; color: var(--muted);
  font-size: 20px; line-height: 1; cursor: pointer; align-self: flex-start;
}

/* top bar */
#topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--bg); z-index: 10;
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand .dot {
  width: 15px; height: 15px; border-radius: 50%; border: 3px solid var(--exposed); flex: none;
}
.brand strong { letter-spacing: 3px; font-size: 15px; }
.loc { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.loc .coords { font-family: ui-monospace, monospace; color: var(--ink2); }

button.ghost {
  background: var(--surface2); color: var(--ink); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 12px; font-size: 13px; cursor: pointer;
}
button.ghost:active { background: var(--line); }
button.primary {
  width: 100%; background: var(--exposed); color: #fff; border: 0;
  border-radius: 10px; padding: 13px; font-size: 15px; font-weight: 600; cursor: pointer;
}

#main { max-width: 640px; margin: 0 auto; padding: 14px; }

/* hero status card */
.status {
  border-radius: 16px; padding: 22px 18px; margin-bottom: 16px;
  border: 1px solid var(--line); background: var(--surface); text-align: center;
}
.status-state { font-size: 34px; font-weight: 800; letter-spacing: .5px; line-height: 1.1; }
.status-sub { margin-top: 8px; font-size: 15px; color: var(--ink2); line-height: 1.45; }
.status-count { margin-top: 12px; font-size: 13px; color: var(--muted); }
.status-count .flag { font-size: 15px; }
.status.exposed { background: rgba(208,59,59,.14); border-color: var(--exposed); }
.status.exposed .status-state { color: #ff6b6b; }
.status.safe { background: rgba(12,163,12,.13); border-color: var(--safe); }
.status.safe .status-state { color: #4cd94c; }
.status.status-unknown .status-state { color: var(--ink2); font-size: 22px; }

/* blocks */
.block { margin-bottom: 20px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.block-head h2 { font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin: 0; font-weight: 600; }
.legend { font-size: 12px; color: var(--muted); }
.lg { font-size: 14px; vertical-align: -1px; }
.lg-exp { color: var(--exposed); } .lg-clr { color: #3a3a38; }

/* timeline */
.timeline {
  position: relative; height: 46px; border-radius: 8px; overflow: hidden;
  background: #26261f; border: 1px solid var(--line);   /* "clear" base */
}
.timeline .band {   /* exposed span */
  position: absolute; top: 0; bottom: 0; background: var(--exposed);
  border-left: 1px solid rgba(0,0,0,.35); border-right: 1px solid rgba(0,0,0,.35);
  cursor: pointer;
}
.timeline .band.sel { outline: 2px solid #fff; outline-offset: -2px; }
.timeline .now {
  position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--warn); z-index: 3;
}
.timeline .now::before {
  content: ""; position: absolute; top: -4px; left: -3px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--warn);
}
.axis { position: relative; height: 16px; margin-top: 3px; }
.axis .tick { position: absolute; transform: translateX(-50%); font-size: 10px; color: var(--muted); font-family: ui-monospace, monospace; }

/* list rows */
.list { display: flex; flex-direction: column; gap: 8px; }
.row {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 12px; display: flex; flex-direction: column; gap: 3px;
}
.row.sel { border-color: var(--warn); }
.row.row-clear {
  background: rgba(12,163,12,.08); border-color: rgba(12,163,12,.25);
}
.rdur-clear { color: var(--safe); }
.clear-label { color: var(--safe); font-weight: 600; }
.row .rtop { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.rtime { font-family: ui-monospace, monospace; font-size: 14px; }
.rdur { font-size: 12px; color: var(--warn); flex: none; }
.rmeta { font-size: 12px; color: var(--muted); }
.rmeta .flag { font-size: 14px; }
.chip { font-size: 11px; padding: 1px 6px; border-radius: 5px; background: var(--surface2); color: var(--ink2); margin-left: 4px; }

/* fields */
.fld { display: block; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.fld select, .fld input {
  display: block; width: 100%; margin-top: 5px; background: var(--surface);
  color: var(--ink); border: 1px solid var(--line); border-radius: 8px;
  padding: 11px; font-size: 16px;   /* 16px: no iOS zoom-on-focus */
}
.manual-row { display: flex; gap: 10px; }
.manual-row .fld { flex: 1; }
.muted { color: var(--muted); font-size: 12px; line-height: 1.5; }

#foot { max-width: 640px; margin: 0 auto; padding: 18px 14px 30px; color: var(--muted); font-size: 11px; line-height: 1.6; border-top: 1px solid var(--line); }
[hidden] { display: none !important; }
