:root {                    /* default: Royal — royal blue & gold */
  --bg: #0d1322; --panel: #15203a; --panel2: #1d2b4e; --line: #2b3c66;
  --text: #e9ecf5; --muted: #96a2c4; --accent: #d9b45b;
  --up: #66c98a; --down: #e0716f;
}
html[data-theme="ember"] {
  --bg: #111318; --panel: #191c24; --panel2: #222633; --line: #2a2f3c;
  --text: #eae7e0; --muted: #9298a8; --accent: #e5a558;
  --up: #69c98a; --down: #e0716f;
}
html[data-theme="ice"] {
  --bg: #0d1418; --panel: #141d23; --panel2: #1c2830; --line: #263540;
  --text: #e4ebee; --muted: #8fa3ad; --accent: #56c3dc;
  --up: #69c98a; --down: #e0716f;
}
html[data-theme="nocturne"] {
  --bg: #141020; --panel: #1c1730; --panel2: #262040; --line: #322a52;
  --text: #eae6f2; --muted: #9d94b8; --accent: #a78bda;
  --up: #69c98a; --down: #e0716f;
}
html[data-theme="paper"] { /* light */
  --bg: #f5f2ec; --panel: #fdfbf7; --panel2: #ece6d8; --line: #d8d1c0;
  --text: #29261f; --muted: #7a7468; --accent: #8a6d1d;
  --up: #1a8f4a; --down: #c04543;
}
:root {
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  --up-soft: color-mix(in srgb, var(--up) 14%, transparent);
  --down-soft: color-mix(in srgb, var(--down) 14%, transparent);
  --radius: 14px;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  max-width: 640px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 14px)
           calc(env(safe-area-inset-right) + 16px)
           calc(env(safe-area-inset-bottom) + 28px)
           calc(env(safe-area-inset-left) + 16px);
  -webkit-tap-highlight-color: transparent;
}
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
.theme-row { margin-top: 26px; display: flex; align-items: center; gap: 12px; justify-content: center; }
.theme-label { color: var(--muted); font-size: 0.75rem; }
.theme-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); padding: 0; }
.theme-dot.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.foot-note { color: var(--muted); font-size: 0.72rem; text-align: center; margin-top: 8px; line-height: 1.5; }

/* ---------- Bell app styles (theme vars only) ---------- */
html { color-scheme: dark; }
html[data-theme="paper"] { color-scheme: light; }

/* header */
.hdr { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hdr-title { display: flex; align-items: baseline; gap: 9px; min-width: 0; }
.hdr h1 { font-size: 1.35rem; letter-spacing: 0.01em; }
.hdr .sub { color: var(--muted); font-size: 0.75rem; }
.hdr-btn {
  color: var(--accent); font-size: 0.8rem; padding: 6px 11px; flex: none;
  border: 1px solid var(--line); border-radius: 9px; background: var(--panel);
}
.caveat { color: var(--muted); font-size: 0.72rem; line-height: 1.45; margin: 8px 0 14px; }

/* panels */
.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px;
}
.sec-label {
  color: var(--muted); font-size: 0.68rem; text-transform: uppercase;
  letter-spacing: 0.14em; margin-bottom: 9px;
}
.sec-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; }
.sec-head .sec-label { margin-bottom: 0; }
.empty {
  border: 1px dashed var(--line); border-radius: 10px; padding: 14px;
  color: var(--muted); font-size: 0.8rem; text-align: center; line-height: 1.5;
}

/* now strip */
.now { display: flex; justify-content: space-between; align-items: center; gap: 12px 18px; flex-wrap: wrap; }
.now-status { display: flex; align-items: center; gap: 9px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.live { background: var(--up); box-shadow: 0 0 0 4px var(--up-soft); }
.now-label { font-size: 0.9rem; font-weight: 650; letter-spacing: 0.07em; }
.now-label.off { color: var(--muted); }
.clocks { display: flex; gap: 18px; }
.clock .lbl { color: var(--muted); font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.12em; }
.clock .val { font-size: 1.12rem; }
.clock .csub { color: var(--muted); font-size: 0.68rem; }

/* next up chips */
.chip {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel2);
  padding: 8px 11px; margin-bottom: 8px;
}
.chip:last-child { margin-bottom: 0; }
.chip.soon { border-color: var(--accent); background: var(--accent-soft); }
.chip-l { min-width: 0; }
.chip-name { font-size: 0.84rem; line-height: 1.25; }
.chip-tag { color: var(--muted); font-size: 0.68rem; margin-top: 1px; }
.chip-r { text-align: right; flex: none; }
.chip-cd { font-size: 1rem; }
.chip-when { color: var(--muted); font-size: 0.66rem; margin-top: 1px; }

/* week */
.week-day { display: flex; gap: 10px; padding: 7px 0; }
.week-day + .week-day { border-top: 1px solid var(--line); }
.week-head { width: 56px; flex: none; color: var(--muted); font-size: 0.72rem; padding-top: 1px; }
.week-day.today .week-head { color: var(--accent); font-weight: 650; }
.week-evs { display: flex; flex-wrap: wrap; gap: 3px 12px; min-width: 0; }
.week-ev { font-size: 0.72rem; line-height: 1.4; }
.week-ev .t { color: var(--muted); }
.week-none { color: var(--muted); font-size: 0.72rem; }
.mk { color: var(--accent); }
@media (min-width: 560px) {
  .week-wrap { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
  .week-day { display: block; padding: 0; }
  .week-day + .week-day { border-top: none; }
  .week-head { width: auto; margin-bottom: 5px; }
  .week-evs { display: block; }
  .week-ev { display: block; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* custom events */
.cust-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 9px 0; border-top: 1px solid var(--line);
}
.cust-info { min-width: 0; }
.cust-name { font-size: 0.84rem; }
.cust-row.past .cust-name { color: var(--muted); }
.cust-sched { color: var(--muted); font-size: 0.7rem; margin-top: 1px; }
.del-btn {
  color: var(--muted); font-size: 0.74rem; border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 10px; flex: none;
}
.del-btn.arm { color: var(--down); border-color: var(--down); background: var(--down-soft); }

/* add form */
.form {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px; margin-top: 10px; display: grid; gap: 9px;
}
input, select {
  font-size: 16px; font-family: inherit; color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0;
}
.form-row { display: flex; gap: 8px; align-items: center; }
.form-row > * { flex: 1; }
.tz-fixed { flex: none; color: var(--muted); font-size: 0.8rem; padding: 0 3px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { flex: 1; padding: 8px; font-size: 0.8rem; color: var(--muted); background: var(--panel); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.sel { color: var(--accent); background: var(--accent-soft); }
.btn {
  border: 1px solid var(--line); border-radius: 9px; padding: 8px 14px;
  font-size: 0.84rem; color: var(--text); background: var(--panel);
}
.btn.primary { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.btn.small { padding: 5px 11px; font-size: 0.76rem; }
.err { color: var(--down); font-size: 0.75rem; }

/* settings */
.set-row {
  display: flex; justify-content: space-between; align-items: center; gap: 8px 10px;
  padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap;
}
.set-info { flex: 1 1 200px; min-width: 0; }
.set-name { font-size: 0.84rem; }
.set-row.off .set-name { color: var(--muted); }
.set-meta { color: var(--muted); font-size: 0.7rem; margin-top: 1px; }
.set-ctl { display: flex; align-items: center; gap: 9px; flex: none; }
.set-ctl input[type="time"] { width: auto; padding: 6px 8px; font-family: var(--mono); }
.switch {
  position: relative; width: 42px; height: 24px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel2); flex: none;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--muted); transition: left 0.15s;
}
.switch.on { border-color: var(--accent); background: var(--accent-soft); }
.switch.on::after { left: 20px; background: var(--accent); }
.reset-btn { color: var(--muted); font-size: 0.72rem; text-decoration: underline; padding: 3px; }
