:root {
  --bg: #0f1115; --card: #181b22; --line: #2a2f3a; --text: #e8eaef; --muted: #9aa3b2;
  --accent: #5b8cff; --accent-2: #2f6bff; --ok: #3fbf7f; --bad: #ff6b6b; --gold: #f2c14e;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
main { max-width: 760px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.5rem; margin: 8px 0 16px; }
h2 { font-size: 1.05rem; margin: 0 0 12px; color: var(--muted); font-weight: 600; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: #12151b; }
.brand { color: var(--text); text-decoration: none; font-weight: 700; }
.top nav { display: flex; align-items: center; gap: 14px; }
.top nav form { margin: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 16px; }
.narrow { max-width: 420px; margin: 40px auto; }
label { display: block; font-size: .9rem; color: var(--muted); margin-bottom: 12px; }
input[type=email], input[type=password], input[type=text], input[type=date], input[type=number], input[type=time], select {
  display: block; width: 100%; margin-top: 4px; padding: 11px 12px; font-size: 16px;
  color: var(--text); background: #0d0f13; border: 1px solid var(--line); border-radius: 10px; }
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
button { font: inherit; font-weight: 600; padding: 11px 18px; border: 0; border-radius: 10px;
  background: var(--accent-2); color: #fff; cursor: pointer; }
button.secondary { background: #2a2f3a; }
button.danger { background: #5a2226; color: #ffd6d6; }
button.link { background: none; padding: 0; color: var(--accent); font-weight: 400; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.error { background: #3a1d20; color: #ffc9c9; border: 1px solid #6b2b30; padding: 10px 12px; border-radius: 10px; }
.ok { background: #16301f; color: #c5f2d6; border: 1px solid #23573a; padding: 10px 12px; border-radius: 10px; }

.picker .seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
.picker .seg label { margin: 0; }
.picker .seg input { position: absolute; opacity: 0; pointer-events: none; }
.picker .seg span { display: block; padding: 8px 14px; color: var(--muted); cursor: pointer; }
.picker .seg input:checked + span { background: #2a3350; color: var(--text); }
.picker .seg input:focus-visible + span { outline: 2px solid var(--accent); }
.picker .fields { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.picker .fields label { flex: 1 1 150px; margin: 0; }
.picker .fields button { flex: 0 0 auto; }
.picker[data-mode=night] .only-range, .picker[data-mode=range] .only-night { display: none; }
.picker > a { display: inline-block; margin-top: 10px; }

.hero { text-align: center; padding: 28px 16px; }
.hero .label { margin: 0; color: var(--muted); font-size: 1rem; }
.hero .big { margin: 4px 0; font-size: clamp(3.5rem, 18vw, 6rem); font-weight: 800; line-height: 1.05;
  font-variant-numeric: tabular-nums; letter-spacing: -1px; }
.hero p { margin: 4px 0; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--ok);
  margin-right: 6px; vertical-align: middle; animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } }

.bars { list-style: none; margin: 0; padding: 0; }
.bars li { display: grid; grid-template-columns: 52px 1fr 48px; gap: 10px; align-items: center; padding: 5px 0; }
.bars .h { color: var(--muted); font-size: .85rem; text-align: right; }
.bars .bar { background: #0d0f13; border-radius: 6px; height: 14px; overflow: hidden; }
.bars .bar span { display: block; height: 100%; background: var(--accent); border-radius: 6px; min-width: 2px; }
.bars .c { font-variant-numeric: tabular-nums; text-align: right; }

table.nights { width: 100%; border-collapse: collapse; }
.nights th, .nights td { padding: 10px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.nights th { color: var(--muted); font-weight: 600; font-size: .85rem; }
.nights .num { text-align: right; font-variant-numeric: tabular-nums; }
.nights tr.best td:first-child::after { content: " ★"; color: var(--gold); }

.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 10px; }
.row label { flex: 1 1 200px; margin: 0; }
.row label.check { flex: 0 0 auto; display: flex; gap: 6px; align-items: center; padding-bottom: 12px; color: var(--text); }
.users { list-style: none; padding: 0; margin: 0; }
.users li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.users .who { display: flex; flex-direction: column; }
.users details summary { cursor: pointer; color: var(--accent); margin-top: 6px; font-size: .9rem; }
.status { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.status dt { color: var(--muted); }
.status dd { margin: 0; }
@media (max-width: 480px) { .status { grid-template-columns: 1fr; } .status dd { margin-bottom: 8px; } }

.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; align-items: end; }
.grid4 label { margin-bottom: 12px; }
.grid4 label.check { display: flex; gap: 6px; align-items: center; color: var(--text); }
@media (max-width: 560px) { .grid4 { grid-template-columns: 1fr 1fr; } }
.frame { position: relative; user-select: none; touch-action: none; cursor: crosshair; border-radius: 10px; overflow: hidden; margin-bottom: 6px; }
.frame img { display: block; width: 100%; height: auto; }
.frame .box { position: absolute; border: 2px solid #ffd447; background: rgba(255, 212, 71, .15); pointer-events: none; }
h2.spaced { margin-top: 20px; }
.spark { position: relative; display: flex; align-items: flex-end; gap: 1px; height: 90px; padding: 0 2px;
  background: #0d0f13; border-radius: 8px; overflow: hidden; }
.spark span { flex: 1 1 0; background: #3a4150; min-width: 1px; }
.spark span.on { background: var(--accent); }
.spark .thr { position: absolute; left: 0; right: 0; border-top: 1px dashed #ffd447; }
