:root {
  --bg: #111418;
  --surface: #1b1f25;
  --surface-2: #252a32;
  --text: #e9edf1;
  --muted: #8d96a3;
  --accent: #4fd18b;
  --accent-ink: #0b2618;
  --danger: #ff6b6b;
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-tap-highlight-color: transparent;
}
.topbar {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--bg); border-bottom: 1px solid var(--surface-2);
}
.topbar h1 { font-size: 1.15rem; margin: 0; }
.icon-btn {
  background: none; border: 0; color: var(--text);
  font-size: 2rem; line-height: 1; padding: 0 8px 4px 0; cursor: pointer;
}
main { max-width: 560px; margin: 0 auto; padding: 16px; }
h2 { font-size: 1rem; color: var(--muted); font-weight: 600; margin: 24px 0 8px; }
.card h2 { margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.meta { margin: 0 0 12px; }
.empty { color: var(--muted); text-align: center; padding: 24px 0; }
.error { color: var(--danger); }

.card {
  background: var(--surface); border-radius: var(--radius);
  padding: 16px; margin: 16px 0;
  display: flex; flex-direction: column; gap: 12px;
}
label { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; color: var(--muted); flex: 1; }
input {
  font: inherit; font-size: 1.1rem; color: var(--text);
  background: var(--surface-2); border: 1px solid transparent; border-radius: 10px;
  padding: 12px; width: 100%; min-width: 0;
}
input:focus { outline: none; border-color: var(--accent); }
.row { display: flex; gap: 12px; }
.hint { margin: 0; min-height: 1.2em; }

.btn {
  display: block; width: 100%; text-align: center; cursor: pointer;
  font: inherit; font-weight: 600; color: var(--text);
  background: var(--surface-2); border: 0; border-radius: 12px; padding: 14px;
}
label.btn { flex: none; color: var(--text); font-size: 1rem; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.big { padding: 20px; font-size: 1.15rem; }
.btn.danger { background: none; color: var(--danger); }
.btn:disabled { opacity: .4; cursor: default; }
.btn:active:not(:disabled) { transform: scale(.98); }

.sessions { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.sessions a {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); border-radius: var(--radius); padding: 14px 16px;
  color: inherit; text-decoration: none;
}
.row1 { display: flex; justify-content: space-between; }
.live { color: var(--accent); font-size: .85rem; }

.group { background: var(--surface); border-radius: var(--radius); padding: 12px 16px; margin: 12px 0; }
.group h3 { margin: 0 0 8px; font-size: 1rem; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.group ol { margin: 0; padding-left: 1.4em; list-style: decimal; }
.group li { border-top: 1px solid var(--surface-2); }
.group li:first-child { border-top: 0; }
.group li::marker { color: var(--muted); }
.group li > .set {
  background: none; border: 0; color: var(--text); font: inherit;
  padding: 8px 0; cursor: pointer; text-align: left;
}
.group li > .del {
  float: right; background: none; border: 0; color: var(--muted);
  font-size: 1rem; padding: 8px 4px 8px 16px; cursor: pointer;
}
.actions { display: flex; flex-direction: column; gap: 8px; margin-top: 24px; }

#toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px;
  font-size: .9rem; transition: .2s; max-width: 90vw; text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
