:root {
  --bg: #0e1116;
  --panel: #161b22;
  --line: #262d36;
  --hour: #303845;
  --text: #e6e8eb;
  --muted: #8b949e;
  --now: #ff3b3b;
  --px-per-min: 1.5px;

  --sb: #4f8cff;
  --vgc: #a970ff;
  --ccms: #22b5a4;
  --ceo: #f0a030;
  --darts: #ff5c8a;
  --pers: #4cc764;
  --free: #59606b;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  max-width: 980px;
  margin: 0 auto;
  padding: 16px;
}

.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.title { display: flex; align-items: center; gap: 8px; }
h1 { font-size: 20px; font-weight: 600; margin: 0 4px; min-width: 12ch; }
.nav {
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  font-size: 18px; line-height: 1; padding: 6px 11px; cursor: pointer;
}
.nav.small { font-size: 12px; padding: 7px 10px; }
.nav:hover { border-color: var(--muted); }

.now-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px;
  display: flex; gap: 10px; align-items: center; min-height: 40px;
}
.now-card .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.now-card .what { font-weight: 600; }
.now-card .left { color: var(--muted); font-variant-numeric: tabular-nums; }

.notice { background: #2a1f12; border: 1px solid #5c4320; color: #f3d6a8; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.notice code { background: #00000040; padding: 1px 4px; border-radius: 4px; }

.board {
  display: grid;
  grid-template-columns: 52px 1fr minmax(160px, 34%);
  grid-template-rows: auto auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px 14px 0;
}
.col-head { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding: 0 0 8px 8px; }
.plan-head { grid-column: 2; }
.meet-head { grid-column: 3; }
.allday { text-transform: none; letter-spacing: 0; }
.allday span { display: inline-block; background: var(--line); color: var(--text); border-radius: 6px; padding: 1px 6px; margin-left: 4px; }

.timeline {
  grid-column: 1 / 4;
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr minmax(160px, 34%);
  height: calc(var(--minutes, 540) * var(--px-per-min));
}
.hours { position: relative; }
.hours .h {
  position: absolute; left: 0; right: 0; transform: translateY(-50%);
  color: var(--muted); font-size: 11px; text-align: right; padding-right: 8px; font-variant-numeric: tabular-nums;
}
.lane { position: relative; border-left: 1px solid var(--line); }
.lane .grid { position: absolute; left: 0; right: 0; border-top: 1px solid var(--hour); opacity: .55; }
.lane .grid.half { border-top-style: dashed; opacity: .25; }

.block {
  --inset: 6px;
  position: absolute; left: var(--inset); right: var(--inset);
  border-radius: 7px; padding: 3px 8px; overflow: hidden;
  background: color-mix(in srgb, var(--c) 26%, var(--panel));
  border-left: 4px solid var(--c);
  display: flex; align-items: baseline; gap: 8px;
  transition: box-shadow .2s, transform .2s;
}
.block .t { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.block .n { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.block .cat { margin-left: auto; font-size: 10px; text-transform: uppercase; color: var(--c); flex: none; }
.block.short { padding-top: 0; padding-bottom: 0; font-size: 12px; align-items: center; }
/* overlapping items share the lane side by side (columns set by layoutColumns in app.js) */
.block.split {
  right: auto;
  left: calc(var(--inset) + (100% - 2 * var(--inset)) * var(--col) / var(--cols));
  width: calc((100% - 2 * var(--inset)) / var(--cols) - 3px);
  flex-direction: column; align-items: stretch; gap: 0;
  padding-left: 6px; padding-right: 4px;
}
.block.split .n { order: -1; white-space: normal; overflow-wrap: anywhere; line-height: 1.2; font-size: 12px; }
.block.split .t { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.block.split.short { flex-direction: row; align-items: center; gap: 4px; }
.block.split.short .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.block.split.short .t { display: none; }
.block.split .cat { display: none; }
.block.past { opacity: .45; }
.block.current {
  background: color-mix(in srgb, var(--c) 45%, var(--panel));
  box-shadow: 0 0 0 2px var(--c), 0 0 18px color-mix(in srgb, var(--c) 55%, transparent);
  z-index: 2;
}
.meetings .block { --c: #c9d1d9; background: #222a33; border-left-color: #c9d1d9; }
.meetings .block.current { box-shadow: 0 0 0 2px #c9d1d9; }

.nowline {
  position: absolute; left: 44px; right: 0; height: 0;
  border-top: 2px solid var(--now); z-index: 5; pointer-events: none;
}
.nowline::before {
  content: ""; position: absolute; left: -5px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--now);
}
.nowline span {
  position: absolute; right: 0; top: -18px; font-size: 11px; color: var(--now); font-weight: 600; font-variant-numeric: tabular-nums;
}

.empty { position: absolute; inset: 40% 12px auto; text-align: center; color: var(--muted); }

footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 12px; color: var(--muted); font-size: 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.legend .item { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.legend .mins { color: var(--text); font-variant-numeric: tabular-nums; }

@media (max-width: 600px) {
  body { padding: 12px; }
  :root { --px-per-min: 1.25px; }
  .board, .timeline { grid-template-columns: 40px 1fr 38%; }
  .nowline { left: 34px; }
  .block .cat { display: none; }
  .block { --inset: 3px; padding: 2px 6px; }
}
