:root {
  color-scheme: dark;
  --bg: #2a313c;
  --surface: #3c4656;
  --field: #242b36;
  --ink: #f4f6f8;
  --muted: #c5ced8;
  --line: #4d5868;
  --accent: #1ec8e0;
  --go-ink: #062026;
  --stop: #e25b5b;
  --warn: #e2b657;
  font-family: "Segoe UI", "Arial Hebrew", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, p { margin: 0; }

.emblem {
  height: 36px;
  width: auto;
  display: block;
}
.emblem-lg {
  height: 78px;
  margin: 0 0 10px auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.brand h1, .lockup h1 {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.1;
}
.brand h1 span, .by {
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
  letter-spacing: 0;
}
.brand h1 span { margin-inline-start: 8px; }
.lockup { text-align: right; }
.lockup h1 { margin-top: 2px; }
.by { margin-top: 2px; }

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}
.login .card {
  width: min(360px, 100%);
  padding: 28px 24px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.login p { color: var(--muted); margin: 14px 0 0; }
label {
  display: block;
  margin: 14px 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
input[type="text"], input[type="password"], input[type="datetime-local"], textarea, select {
  width: 100%;
  border: 1px solid #596475;
  background: var(--field);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}
textarea {
  min-height: 180px;
  resize: vertical;
  line-height: 1.5;
  font-size: 18px;
}
input[type="file"] { font-size: 13px; color: var(--muted); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stack { display: grid; gap: 0; }
.stack > * + * { margin-top: 10px; }
.stack label { margin-top: 16px; }

.btn {
  border: 1px solid #596475;
  border-radius: 8px;
  padding: 9px 14px;
  background: #4a5568;
  color: var(--ink);
}
.btn.go {
  background: var(--accent);
  color: var(--go-ink);
  border-color: var(--accent);
  padding: 11px 18px;
  font-weight: 700;
}
.btn.stop { background: transparent; color: #ffb4b4; border-color: #a85a5a; }
.btn.ghost { background: transparent; color: var(--ink); border-color: #596475; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 12px 28px;
  background: #343d4c;
  border-bottom: 3px solid var(--accent);
}
.top-side { display: flex; gap: 12px; align-items: center; }
.top .muted { color: #e4eaf1; }
.top .btn.ghost { color: var(--ink); border-color: #7b8798; }

.banner {
  margin: 0;
  width: 100%;
  padding: 10px 28px;
  background: #4a4332;
  color: #ffe7a8;
  border-bottom: 1px solid #6d6248;
}
.wrap {
  width: min(1080px, calc(100% - 56px));
  margin: 0 auto;
  padding: 18px 0 56px;
  display: grid;
  gap: 14px;
}
.sheet {
  padding: 18px 18px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.sheet h2 {
  margin-bottom: 14px;
  font-size: 15px;
  font-weight: 680;
}

.live, .day {
  display: grid;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.live {
  grid-template-columns: 1.4fr repeat(6, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px 8px;
  overflow: hidden;
}
.day {
  grid-template-columns: repeat(5, 1fr);
  margin-top: 8px;
  border-top: 1px solid var(--line);
}
.live .stat, .day .stat, .live .panel {
  padding: 14px 16px 16px 0;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.live .stat + .stat, .day .stat + .stat { border-inline-start: 1px solid var(--line); padding-inline-start: 16px; }
.live .stat:only-child { grid-column: 1 / -1; }
.stat b {
  display: block;
  margin-top: 3px;
  font-size: 26px;
  font-weight: 640;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.day .stat b { font-size: 22px; }
.stat span { color: var(--muted); font-size: 12px; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.45; }

.lists { display: flex; flex-wrap: wrap; gap: 8px; }
.list-toggle {
  border: 1px solid #596475;
  background: var(--field);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--ink);
}
.list-toggle.on { border-color: var(--accent); color: var(--accent); }
a.btn { text-decoration: none; display: inline-block; }
.name-row { display: flex; align-items: center; gap: 14px; }
.name-row input[type="text"] { width: 260px; max-width: 100%; }
.stack .name-row label.check, label.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
label.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.wave-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  font: inherit;
  text-align: right;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.wave-sheet {
  width: min(860px, 94vw);
  max-height: 88vh;
  overflow: auto;
  padding: 20px 24px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.wave-sheet::backdrop, .done-sheet::backdrop { background: rgba(10, 14, 20, 0.6); }
.done-sheet {
  width: min(420px, 90vw);
  padding: 22px 24px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--accent);
  border-radius: 12px;
  text-align: center;
}
.done-sheet h2 { margin: 0 0 8px; color: var(--accent); }
.done-sheet p { margin: 0 0 18px; line-height: 1.5; }
.wave-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.wave-head h2 { margin: 0; }
.wave-sheet h3 { margin: 18px 0 6px; font-size: 14px; color: var(--muted); }
.wave-sheet p { margin: 6px 0; line-height: 1.5; }
.wave-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.wave-text { padding: 10px 12px; background: var(--field); border-radius: 8px; margin-top: 8px; }
.wave-text p { white-space: pre-wrap; margin: 4px 0 0; }
.link-cell { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.wave-cities { max-height: 120px; overflow: auto; font-size: 13px; color: var(--muted); }
.list-toggle .muted { font-size: 12px; }
.city-pick { position: relative; }
.city-face {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  background: var(--field);
  border: 1px solid #596475;
  border-radius: 8px;
  color: var(--ink);
  text-align: right;
}
.city-face span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.city-face::after { content: "▾"; color: var(--muted); }
.city-menu {
  position: absolute;
  z-index: 4;
  inset-inline: 0;
  top: calc(100% + 4px);
  padding: 8px;
  background: #323b4a;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.city-menu-actions { display: flex; gap: 8px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.min-count {
  width: 80px;
  padding: 4px 8px;
  border: 1px solid #596475;
  background: var(--field);
  border-radius: 6px;
  color: var(--ink);
}
.city-list { max-height: 240px; margin-top: 8px; overflow: auto; }
.city-list button {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: inherit;
  text-align: right;
}
.city-list button.on { background: #243240; color: var(--accent); }
.city-list .muted { font-size: 12px; }
.variants { display: grid; gap: 8px; }
.variant { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; }
.actions { margin-top: 8px; }
.table-wrap { overflow-x: auto; }
.history { width: 100%; border-collapse: collapse; font-size: 14px; }
.history th {
  text-align: right;
  padding: 0 10px 8px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  border-bottom: 1px solid var(--line);
}
.history td {
  text-align: right;
  padding: 9px 10px 9px 0;
  border-bottom: 1px solid #4c5668;
}
.history tbody tr:last-child td { border-bottom: 0; }
.btn.tiny { padding: 3px 8px; font-size: 12px; }
.error { color: var(--stop); font-size: 14px; min-height: 1.2em; }

@media (max-width: 900px) {
  .live, .day { grid-template-columns: 1fr 1fr; }
  .live .stat + .stat, .day .stat + .stat { border-inline-start: 0; border-top: 1px solid var(--line); padding-inline-start: 0; }
  .top { padding: 12px 16px; align-items: flex-start; }
  .brand h1 { font-size: 16px; }
  .brand h1 span { display: block; margin: 4px 0 0; }
  .wrap { width: calc(100% - 32px); }
  .banner { padding-inline: 16px; }
}
