:root {
  --bg: #0e1a2b; --panel: #16263d; --line: #2a3d5a; --text: #e8eef7; --muted: #8fa3bf;
  --u6: #0472b3; --u3: #ec6726; --a: #2f8f5b; --d: #c0392b; --done: #f5c84c;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { padding: 0 12px calc(env(safe-area-inset-bottom) + 16px); -webkit-tap-highlight-color: transparent; }
header { position: sticky; top: 0; z-index: 2; background: var(--bg); display: flex; align-items: center;
  justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
nav { display: flex; gap: 6px; }
button { font: inherit; color: inherit; border: 0; border-radius: 10px; cursor: pointer; }
.tab { background: var(--panel); padding: 10px 16px; font-weight: 600; }
.tab.on { background: var(--text); color: var(--bg); }
#status { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; text-align: right; }
#sync.pending { color: var(--done); }
#tokenwarn { background: var(--d); padding: 10px; border-radius: 8px; margin-top: 10px; }
.picker { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--muted); }
select { flex: 1; font: inherit; padding: 10px; border-radius: 10px; background: var(--panel); color: var(--text); border: 1px solid var(--line); }

.row { display: grid; grid-template-columns: 1fr 76px 76px; gap: 8px; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--line); }
.row .label { font-weight: 600; }
.row .label small { display: block; font-weight: 400; color: var(--muted); }
.row.next .label { color: var(--done); }
.badge { display: inline-block; min-width: 34px; text-align: center; padding: 2px 6px; border-radius: 6px;
  color: #fff; font-weight: 700; margin-right: 6px; }
.badge.U6 { background: var(--u6); } .badge.U3 { background: var(--u3); }
.big { height: 64px; font-size: 22px; font-weight: 700; display: flex; flex-direction: column;
  align-items: center; justify-content: center; line-height: 1; }
.big.A { background: var(--a); } .big.D { background: var(--d); }
.big small { font-size: 12px; font-weight: 500; margin-top: 4px; min-height: 12px; font-variant-numeric: tabular-nums; }
.big:active { transform: scale(0.96); filter: brightness(1.3); }
.big.flash { outline: 3px solid var(--done); }
#platform .big { height: 84px; font-size: 26px; }

.toggles { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 14px 0 6px; }
.seg { display: flex; background: var(--panel); border-radius: 10px; overflow: hidden; }
.seg button { background: transparent; padding: 10px 14px; border-radius: 0; font-weight: 600; }
.seg button.on { background: var(--text); color: var(--bg); }
.small { background: var(--panel); padding: 10px 14px; margin-left: auto; }
.hint { color: var(--muted); font-size: 13px; }

#recent h2 { font-size: 14px; color: var(--muted); font-weight: 600; margin: 22px 0 6px; }
#recent-list { list-style: none; padding: 0; margin: 0; }
#recent-list li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums; font-size: 14px; }
#recent-list li.deleted { opacity: .4; text-decoration: line-through; }
#recent-list li .what { flex: 1; }
#recent-list li .note { color: var(--done); }
#recent-list li button { background: var(--panel); padding: 6px 10px; }
#recent-list li .unsynced { color: var(--done); }
footer { color: var(--muted); font-size: 12px; margin-top: 16px; }
