*, *::before, *::after { box-sizing: border-box; }
html, body { margin:0; padding:0; background:#F7F8FA; }

.cl {
  --ink:#101C2E; --ink-2:#2A3B52; --paper:#F7F8FA; --card:#FFFFFF;
  --line:#DDE2E9; --teal:#14776F; --teal-dim:#E4F0EE; --amber:#B45715;
  --red:#B4231A; --muted:#6B7684; --tap:46px;
  font-family:'IBM Plex Sans',system-ui,-apple-system,sans-serif;
  color:var(--ink); background:var(--paper);
  max-width:920px; margin:0 auto;
  padding:0 12px 12px; line-height:1.45;
  -webkit-text-size-adjust:100%; overflow-x:hidden; touch-action:manipulation; min-height:100vh;
}
.cl h1 { margin:0; font-size:16px; font-weight:600; letter-spacing:-0.2px; }
.cl button { font-family:inherit; cursor:pointer; -webkit-tap-highlight-color:transparent; touch-action:manipulation; }
.cl input, .cl select, .cl textarea { font-size:16px !important; font-family:inherit; }
.cl .cl-step input { font-size:19px !important; }

.cl-top { display:flex; align-items:baseline; justify-content:space-between; gap:8px;
  flex-wrap:wrap; border-bottom:2px solid var(--ink);
  padding-top:calc(12px + env(safe-area-inset-top)); padding-bottom:9px; }
.cl-arc { font-family:'IBM Plex Mono',monospace; font-size:12px; color:var(--muted); }
.cl-arc b { color:var(--ink); font-weight:600; }

.cl-datebar { display:flex; gap:8px; align-items:center; margin:12px 0; }
.cl-date { flex:1; min-width:0; height:var(--tap); border:1px solid var(--line);
  border-radius:10px; padding:0 12px; font-family:'IBM Plex Mono',monospace; color:var(--ink); background:var(--card); }
.cl-flash { font-size:12px; font-weight:600; flex:none; text-align:right; max-width:46%; }

.cl-pane[hidden] { display:none; }
.cl-card { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:14px; margin-bottom:12px; }
.cl-eyebrow { font-family:'IBM Plex Mono',monospace; font-size:10px; letter-spacing:1.3px;
  text-transform:uppercase; color:var(--muted); margin-bottom:11px; }
.cl-eyebrow .hint { display:block; letter-spacing:0.2px; text-transform:none;
  font-family:'IBM Plex Sans',sans-serif; font-size:12px; margin-top:4px; line-height:1.35; }

.cl-sched { border:1px solid var(--line); border-radius:12px; background:var(--card); margin-bottom:12px; }
.cl-sched > summary { list-style:none; cursor:pointer; min-height:var(--tap); padding:0 14px;
  font-family:'IBM Plex Mono',monospace; font-size:10px; letter-spacing:1.3px; text-transform:uppercase;
  color:var(--muted); display:flex; justify-content:space-between; align-items:center; }
.cl-sched > summary::-webkit-details-marker { display:none; }
.cl-sched > summary::after { content:'show'; text-transform:none; letter-spacing:0.2px;
  font-family:'IBM Plex Sans',sans-serif; font-size:13px; color:var(--teal); }
.cl-sched[open] > summary::after { content:'hide'; }
.cl-sched ol { list-style:none; margin:0; padding:0 14px 12px; }
.cl-sched li { display:flex; gap:10px; padding:7px 0; border-top:1px solid var(--paper); font-size:14px; }
.cl-sched li:first-child { border-top:none; }
.cl-sched time { font-family:'IBM Plex Mono',monospace; font-size:13px; color:var(--teal); font-weight:600; flex:none; width:52px; }
.cl-sched .w { color:var(--ink-2); }
.cl-sched li.edge { background:linear-gradient(90deg,var(--teal-dim),transparent 75%);
  margin:0 -14px; padding-left:14px; padding-right:14px; }

.cl-grid { display:grid; grid-template-columns:1fr; gap:9px; }
.cl-field { border:1px solid var(--line); border-radius:10px; padding:9px 10px 8px; display:flex; align-items:center; gap:10px; }
.cl-field.auto { background:var(--paper); border-style:dashed; }
.cl-field > label { font-family:'IBM Plex Mono',monospace; font-size:10px; letter-spacing:0.9px;
  text-transform:uppercase; color:var(--muted); flex:1; min-width:0; }
.cl-step { display:flex; align-items:center; gap:6px; flex:none; }
.cl-step button { width:var(--tap); height:var(--tap); flex:none; border:1px solid var(--line);
  background:var(--paper); border-radius:10px; font-size:20px; line-height:1; color:var(--ink-2); font-weight:600; }
.cl-step button:active { background:var(--teal-dim); border-color:var(--teal); }
.cl-step input { width:78px; flex:none; border:none; background:transparent; text-align:center;
  font-family:'IBM Plex Mono',monospace; font-weight:600; color:var(--ink); padding:2px 0; -moz-appearance:textfield; }
.cl-step input::-webkit-outer-spin-button, .cl-step input::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.cl-step input:focus-visible { outline:2px solid var(--teal); border-radius:6px; }
@media (min-width:660px) {
  .cl-grid { grid-template-columns:repeat(3,1fr); }
  .cl-field { display:block; }
  .cl-field > label { display:block; margin-bottom:5px; }
  .cl-step input { width:100%; }
}

.cl-toggles { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:11px; }
.cl-tog { min-height:var(--tap); border:1px solid var(--line); background:var(--card); border-radius:10px;
  padding:8px 12px; font-size:14px; color:var(--ink-2); display:flex; align-items:center; gap:9px; text-align:left; }
.cl-tog::before { content:''; width:11px; height:11px; border-radius:50%; border:1.5px solid var(--line); flex:none; }
.cl-tog[aria-pressed="true"] { background:var(--teal-dim); border-color:var(--teal); color:var(--teal); font-weight:600; }
.cl-tog[aria-pressed="true"]::before { background:var(--teal); border-color:var(--teal); }
.cl-tog.wide { grid-column:1 / -1; }
.cl-tog:focus-visible { outline:2px solid var(--teal); outline-offset:2px; }

.cl-note { width:100%; margin-top:11px; border:1px solid var(--line); border-radius:10px;
  padding:11px 12px; font-family:inherit; color:var(--ink); resize:vertical; min-height:64px; }
.cl-note:focus-visible { outline:2px solid var(--teal); }

.cl-sel { width:100%; height:var(--tap); border:1px solid var(--line); border-radius:10px; padding:0 12px;
  font-family:'IBM Plex Mono',monospace; color:var(--ink); background:var(--card); -webkit-appearance:none; appearance:none; }
.cl-vol { font-family:'IBM Plex Mono',monospace; font-size:13px; color:var(--muted); margin-top:9px; }
.cl-vol b { color:var(--ink); }

.cl-ex { border:1px solid var(--line); border-radius:12px; padding:12px; margin-bottom:10px; background:var(--card); }
.cl-ex-name { font-size:15px; font-weight:600; }
.cl-last { font-family:'IBM Plex Mono',monospace; font-size:12px; color:var(--muted); margin-top:2px; }
.cl-last b { color:var(--teal); font-weight:600; }
.cl-sets { margin-top:10px; display:flex; flex-direction:column; gap:7px; }
.cl-set { display:flex; align-items:center; gap:8px; }
.cl-set .sl { font-family:'IBM Plex Mono',monospace; font-size:11px; letter-spacing:0.8px;
  text-transform:uppercase; color:var(--muted); width:38px; flex:none; }
.cl-set input { flex:1; min-width:0; height:var(--tap); border:1px solid var(--line); border-radius:10px;
  background:var(--paper); text-align:center; font-family:'IBM Plex Mono',monospace; font-weight:600;
  color:var(--ink); -moz-appearance:textfield; }
.cl-set input::-webkit-outer-spin-button, .cl-set input::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.cl-set input:focus-visible { outline:2px solid var(--teal); }
.cl-set .x { font-family:'IBM Plex Mono',monospace; font-size:13px; color:var(--muted); flex:none; }
@media (min-width:660px) { .cl-sets { display:grid; grid-template-columns:repeat(4,1fr); } }

.cl-pal { display:flex; flex-wrap:wrap; gap:7px; }
.cl-pal button { min-height:38px; border:1px solid var(--line); background:var(--card); border-radius:999px;
  padding:6px 13px; font-size:13.5px; color:var(--ink-2); display:flex; align-items:center; gap:7px; }
.cl-pal button::before { content:''; width:11px; height:11px; border-radius:3px; background:var(--sw,#DDE2E9); flex:none; }
.cl-pal button[aria-pressed="true"] { border-color:var(--ink); background:var(--ink); color:#fff; font-weight:600; }
.cl-pal button.erase::before { background:transparent; border:1.5px dashed var(--muted); }
.cl-pal button.erase[aria-pressed="true"]::before { border-color:#fff; }

.cl-blocks { margin-top:12px; display:flex; flex-direction:column; gap:5px; }
.cl-blk { border:1px solid var(--line); border-radius:10px; overflow:hidden; }
.cl-blk-row { display:flex; align-items:stretch; }
.cl-blk time { font-family:'IBM Plex Mono',monospace; font-size:12.5px; color:var(--muted);
  width:56px; flex:none; display:flex; align-items:center; justify-content:center;
  background:var(--paper); border-right:1px solid var(--line); }
.cl-blk .paint { flex:1; min-width:0; min-height:42px; border:none; background:var(--card);
  text-align:left; padding:0 12px; font-size:14px; color:var(--ink-2); display:flex; align-items:center; gap:8px; }
.cl-blk.on .paint { font-weight:600; }
.cl-blk .bn { width:100%; border:none; border-top:1px solid var(--line); padding:8px 12px;
  background:var(--paper); color:var(--ink-2); }
.cl-blk .bn:focus-visible { outline:2px solid var(--teal); outline-offset:-2px; }
.cl-blk.now { box-shadow:0 0 0 2px var(--teal); }

.cl-tgt { display:flex; align-items:center; gap:8px; margin-bottom:7px; }
.cl-tgt .tick { width:var(--tap); height:var(--tap); flex:none; border:1px solid var(--line);
  border-radius:10px; background:var(--card); font-size:17px; color:var(--line); }
.cl-tgt .tick[aria-pressed="true"] { background:var(--teal-dim); border-color:var(--teal); color:var(--teal); }
.cl-tgt input { flex:1; min-width:0; height:var(--tap); border:1px solid var(--line); border-radius:10px;
  padding:0 12px; background:var(--card); color:var(--ink); }
.cl-tgt input:focus-visible { outline:2px solid var(--teal); }
.cl-tgt.done input { color:var(--muted); text-decoration:line-through; }

.cl-bars { margin-top:4px; }
.cl-bar-row { display:flex; align-items:center; gap:9px; margin-bottom:6px; font-size:13px; }
.cl-bar-row .lb { width:96px; flex:none; color:var(--ink-2); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cl-bar-row .tr { flex:1; height:9px; background:var(--paper); border-radius:5px; overflow:hidden; }
.cl-bar-row .fl { height:100%; border-radius:5px; }
.cl-bar-row .vl { font-family:'IBM Plex Mono',monospace; font-size:12px; color:var(--muted); width:48px; text-align:right; flex:none; }

.cl-rate { display:flex; gap:7px; margin-top:4px; }
.cl-rate button { flex:1; min-height:var(--tap); border:1px solid var(--line); background:var(--card);
  border-radius:10px; font-family:'IBM Plex Mono',monospace; font-size:16px; font-weight:600; color:var(--ink-2); }
.cl-rate button[aria-pressed="true"] { background:var(--ink); border-color:var(--ink); color:#fff; }

.cl-stats { display:grid; grid-template-columns:1fr 1fr; gap:1px; background:var(--line);
  border:1px solid var(--line); border-radius:12px; overflow:hidden; margin-bottom:12px; }
@media (min-width:660px) { .cl-stats { grid-template-columns:repeat(4,1fr); } }
.cl-stat { background:var(--card); padding:12px 13px; }
.cl-stat .v { font-family:'IBM Plex Mono',monospace; font-size:22px; font-weight:600; letter-spacing:-0.5px; }
.cl-stat .k { font-family:'IBM Plex Mono',monospace; font-size:9.5px; letter-spacing:0.9px;
  text-transform:uppercase; color:var(--muted); margin-top:2px; }
.cl-ahead { color:var(--teal); } .cl-behind { color:var(--amber); }

.cl-chart svg { width:100%; height:auto; display:block; }
.cl-legend { display:flex; gap:14px; font-size:12px; color:var(--muted); margin-top:8px; flex-wrap:wrap; }
.cl-legend i { display:inline-block; width:14px; height:2px; vertical-align:middle; margin-right:5px; }

.cl-hrow { border:1px solid var(--line); border-radius:10px; padding:10px 11px; margin-bottom:8px; }
.cl-hrow .hd { display:flex; justify-content:space-between; align-items:baseline; gap:8px; }
.cl-hrow .hdate { font-family:'IBM Plex Mono',monospace; font-size:13px; font-weight:600; }
.cl-hrow .hkg { font-family:'IBM Plex Mono',monospace; font-size:18px; font-weight:600; }
.cl-hrow .hmeta { font-family:'IBM Plex Mono',monospace; font-size:12px; color:var(--muted);
  margin-top:5px; display:flex; gap:12px; flex-wrap:wrap; }
.cl-hrow .hnote { font-size:12.5px; color:var(--ink-2); margin-top:6px; }
.dot { color:var(--line); } .dot.on { color:var(--teal); }
.cl-empty { color:var(--muted); font-size:14px; padding:4px 0; }

.cl-hz { display:flex; align-items:flex-start; gap:9px; padding:9px 0; border-top:1px solid var(--paper); font-size:13.5px; }
.cl-hz:first-child { border-top:none; }
.cl-hz .pip { width:10px; height:10px; border-radius:50%; flex:none; margin-top:5px; }
.cl-hz .lbl { font-weight:600; }
.cl-hz .sub { color:var(--muted); font-size:12.5px; }
.ok { background:#14776F; } .bad { background:#B4231A; } .warn { background:#B45715; }
.cl-alert { border:1px solid var(--red); background:#FCEBE9; color:#7A1710; border-radius:12px;
  padding:12px 13px; margin-bottom:12px; font-size:13.5px; }
.cl-alert b { display:block; margin-bottom:3px; }

.cl-actions { display:grid; grid-template-columns:1fr; gap:8px; margin-top:12px; }
@media (min-width:520px) { .cl-actions { grid-template-columns:repeat(3,1fr); } }
.cl-ghost { min-height:var(--tap); border:1px solid var(--line); background:var(--card); color:var(--ink-2);
  border-radius:10px; padding:0 14px; font-size:13.5px; font-weight:500; display:flex;
  align-items:center; justify-content:center; text-decoration:none; }
.cl-ghost:active { border-color:var(--teal); color:var(--teal); }

.cl-navw { position:sticky; top:0; z-index:6; margin:0 -12px 12px;
  padding:calc(8px + env(safe-area-inset-top)) 12px 8px;
  background:rgba(247,248,250,0.94); backdrop-filter:blur(8px); border-bottom:1px solid var(--line); }
.cl-barw { position:sticky; bottom:0; z-index:5; margin:14px -12px 0;
  padding:8px 12px calc(8px + env(safe-area-inset-bottom));
  background:rgba(247,248,250,0.94); backdrop-filter:blur(8px); border-top:1px solid var(--line); }
.cl-nav { display:flex; gap:4px; background:var(--line); padding:3px; border-radius:12px; }
.cl-tab { flex:1; border:none; background:transparent; min-height:40px; border-radius:9px;
  font-size:13px; font-weight:500; color:var(--muted); padding:0 2px; }
.cl-tab[aria-selected="true"] { background:var(--card); color:var(--ink); font-weight:600; box-shadow:0 1px 2px rgba(16,28,46,.12); }
.cl-tab:focus-visible { outline:2px solid var(--teal); }
.cl-save { width:100%; min-height:var(--tap); background:var(--ink); color:#fff; border:none;
  border-radius:12px; font-size:16px; font-weight:600; }
.cl-save:active { background:var(--teal); }

/* ---- added in the rebuild: login, pending count, rejected ops ---- */
.cl-gate { max-width:420px; margin:14vh auto 0; }
.cl-gate .cl-card { text-align:left; }
.cl-gate input[type="password"] { width:100%; height:var(--tap); border:1px solid var(--line);
  border-radius:10px; padding:0 12px; background:var(--card); color:var(--ink); margin-bottom:10px; }
.cl-gate button { width:100%; min-height:var(--tap); background:var(--ink); color:#fff; border:none;
  border-radius:12px; font-size:16px; font-weight:600; }
.cl-gate .msg { color:var(--red); font-size:13px; margin-top:9px; min-height:18px; }
.cl-pending { display:inline-block; font-family:'IBM Plex Mono',monospace; font-size:11px;
  font-weight:600; color:#fff; background:var(--amber); border-radius:999px; padding:1px 7px; margin-left:6px; }
.cl-pending[hidden] { display:none; }
.cl-rejects { margin-top:9px; font-family:'IBM Plex Mono',monospace; font-size:12px; color:var(--red); }
.cl-rejects div { padding:2px 0; }
[hidden] { display:none !important; }

/* ---- General tab: the journal ---- */
.cl-jrn { border:1px solid var(--line); border-radius:12px; padding:10px 11px; margin-bottom:9px; background:var(--card); }
.cl-jrn-head { display:flex; align-items:center; gap:8px; margin-bottom:7px; }
.cl-jrn-head input[type="time"], .cl-jrn-head input.at { width:104px; flex:none; height:38px;
  border:1px solid var(--line); border-radius:9px; padding:0 9px; background:var(--paper);
  font-family:'IBM Plex Mono',monospace; font-size:14px !important; color:var(--ink-2); }
.cl-jrn-head .sp { flex:1; }
.cl-jrn-head .rm { width:38px; height:38px; flex:none; border:1px solid var(--line); background:var(--card);
  border-radius:9px; color:var(--muted); font-size:17px; line-height:1; }
.cl-jrn-head .rm:active { border-color:var(--red); color:var(--red); }
.cl-jrn textarea { width:100%; border:1px solid var(--line); border-radius:10px; padding:10px 11px;
  font-family:inherit; color:var(--ink); resize:vertical; min-height:78px; background:var(--card); }
.cl-jrn textarea:focus-visible { outline:2px solid var(--teal); }
.cl-add { width:100%; margin-top:2px; }

.cl-past { border-top:1px solid var(--paper); padding-top:9px; margin-top:9px; }
.cl-past:first-child { border-top:none; padding-top:0; margin-top:0; }
.cl-past .pd { font-family:'IBM Plex Mono',monospace; font-size:11.5px; color:var(--muted); margin-bottom:4px; }
.cl-past .pe { display:flex; gap:9px; padding:3px 0; font-size:13.5px; color:var(--ink-2); }
.cl-past .pe time { font-family:'IBM Plex Mono',monospace; font-size:12.5px; color:var(--teal);
  flex:none; width:44px; }
.cl-past .pe span { white-space:pre-wrap; }

/* ---- Save feedback ---- */
.cl-toast { margin-bottom:8px; border-radius:10px; padding:10px 12px; font-size:13.5px; font-weight:500;
  border:1px solid var(--line); background:var(--card); color:var(--ink-2); }
.cl-toast[hidden] { display:none; }
.cl-toast.ok   { border-color:var(--teal);  background:var(--teal-dim); color:#0C5A54; }
.cl-toast.warn { border-color:var(--amber); background:#FDF1E7; color:#7A3B0C; }
.cl-toast.bad  { border-color:var(--red);   background:#FCEBE9; color:#7A1710; }
