:root {
  --cell: 56px;
  --meta: 300px;
  --bg: #16181d;
  --panel: #1e2027;
  --panel-2: #24262f;
  --line: #303341;
  --text: #edeff5;
  --muted: #9aa0b0;
  --accent: #4f8cff;
  --night: #1b1d25;
  --early: #2b3350;
  --day: #3a5fa8;
  --peak: #4f7fd6;
  --evening: #2f3552;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
}

.muted {
  color: var(--muted);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  font-size: 16px;
  margin: 0 0 2px;
  font-weight: 600;
}

.brand p {
  margin: 0;
  font-size: 12px;
}

.readout {
  margin-left: auto;
  text-align: right;
}

.cursor-time {
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.readout .muted {
  font-size: 12px;
}

.controls {
  display: flex;
  gap: 8px;
}

button {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
}

button:hover {
  background: #2d3040;
}

main {
  flex: 1;
  min-height: 0;
  padding: 16px 0 0;
}

.board {
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 220px);
}

.board-inner {
  position: relative;
  width: max-content;
  min-width: 100%;
  padding-bottom: 8px;
}

.rows {
  position: relative;
}

.row {
  display: flex;
  align-items: stretch;
  height: 72px;
  border-bottom: 1px solid var(--line);
}

.row.is-home .meta {
  box-shadow: inset 3px 0 0 var(--accent);
}

.meta {
  position: sticky;
  left: 0;
  z-index: 3;
  flex: 0 0 var(--meta);
  width: var(--meta);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: var(--panel);
  border-right: 1px solid var(--line);
}

.meta .names {
  min-width: 0;
  flex: 1;
}

.label {
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: text;
}

.label-input {
  font: inherit;
  font-weight: 600;
  width: 100%;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 2px 6px;
}

.zone-id {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clock {
  text-align: right;
}

.clock .time {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.clock .sub {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.remove {
  padding: 2px 8px;
  line-height: 1.2;
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  font-size: 16px;
}

.remove:hover {
  color: #ff8080;
  background: transparent;
}

.strip {
  position: relative;
  flex: 0 0 auto;
}

.cell {
  position: absolute;
  top: 8px;
  bottom: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-right: 1px solid rgba(0, 0, 0, 0.35);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--text);
  user-select: none;
}

.cell.night {
  background: var(--night);
  color: #737a8c;
}

.cell.early {
  background: var(--early);
}

.cell.day {
  background: var(--day);
}

.cell.peak {
  background: var(--peak);
}

.cell.evening {
  background: var(--evening);
}

.cell .daymark {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.72);
  margin-top: 2px;
}

.cell.newday {
  border-left: 2px solid var(--text);
}

.overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--meta);
  z-index: 2;
  pointer-events: none;
}

.cursor,
.nowline {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
}

.cursor {
  background: var(--text);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
}

.nowline {
  background: #ffb04a;
  opacity: 0.85;
}

.hint {
  font-size: 12px;
  padding: 10px 20px 0;
}

.addbar {
  padding: 14px 20px 20px;
}

.search {
  position: relative;
  max-width: 480px;
}

#zone-input {
  width: 100%;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
}

#zone-input:focus {
  outline: none;
  border-color: var(--accent);
}

.results {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  max-height: 260px;
  overflow-y: auto;
  z-index: 10;
}

.results li {
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.results li:hover,
.results li[aria-selected="true"] {
  background: var(--panel-2);
}

.results .offset {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
