/* The Back Nine (Centerville) — a demo for a building that is mostly used
   after dark, so it is designed dark first rather than dimmed afterwards. */
:root {
  --bg: #0d1713;
  --surface: #13211c;
  --surface-2: #192c25;
  --line: #244036;
  --ink: #eaf3ef;
  --muted: #8fa89e;
  --green: #4ade80;
  --green-deep: #15803d;
  --owl: #6366f1;
  --owl-soft: #1e1b4b;
  --red: #f87171;
  --amber: #fbbf24;
  --r: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

/* ------------------------------------------------------------ chrome */
.top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 16px;
  border-bottom: 1px solid var(--line); background: var(--surface);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; }
.mark {
  width: 38px; height: 38px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--green-deep); color: #fff;
  font-weight: 800; font-size: 18px;
}
.wordmark { display: flex; flex-direction: column; line-height: 1.25; }
.wordmark b { font-size: 16px; letter-spacing: .2px; }
.wordmark small { color: var(--muted); font-size: 12px; }
.clock { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }

.tabs {
  display: flex; gap: 6px; padding: 10px 16px; overflow-x: auto;
  border-bottom: 1px solid var(--line); background: var(--surface);
  position: sticky; top: 67px; z-index: 19;
}
.tabs button {
  flex: none; padding: 8px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  font: inherit; font-size: 14px;
}
.tabs button.on { background: var(--green-deep); border-color: var(--green-deep); color: #fff; }

main { max-width: 1100px; margin: 0 auto; padding: 16px; }
main:focus { outline: none; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 16px; margin: 0 0 14px;
}
h1 { font-size: 21px; margin: 0 0 6px; }
h2 { font-size: 16px; margin: 0 0 8px; }
.lede { color: var(--muted); margin: 0 0 14px; max-width: 62ch; }
.muted { color: var(--muted); font-size: 13px; }
.warn { color: var(--amber); font-size: 13px; }

button { font: inherit; }
.primary, .ghost, .danger {
  border-radius: 10px; padding: 10px 16px; cursor: pointer; border: 1px solid var(--line);
}
.primary { background: var(--green-deep); border-color: var(--green-deep); color: #fff; font-weight: 600; }
.ghost { background: transparent; color: var(--ink); }
.danger { background: transparent; color: var(--red); border-color: var(--red); }
.wide { display: block; width: 100%; text-align: left; margin-bottom: 6px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.flash {
  display: none; margin-bottom: 12px; padding: 10px 14px; border-radius: 10px;
  background: var(--owl-soft); border: 1px solid var(--owl); color: var(--ink);
}
.flash.on { display: block; }

/* ------------------------------------------------------------ booking */
.dates { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.date {
  flex: none; display: flex; flex-direction: column; align-items: center;
  padding: 8px 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--ink);
}
.date small { color: var(--muted); font-size: 11px; }
.date.on { background: var(--surface-2); border-color: var(--green); }

.spans { display: flex; gap: 6px; margin-top: 12px; }
.chip {
  padding: 6px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
}
.chip.on { background: var(--green-deep); border-color: var(--green-deep); color: #fff; }

.legend { display: flex; gap: 14px; margin-bottom: 10px; flex-wrap: wrap; }
.key { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.sw { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.sw.open { background: var(--green-deep); }
.sw.taken { background: var(--surface-2); border: 1px solid var(--line); }
.sw.owl { background: var(--owl); }

.gridwrap { overflow-x: auto; }
.row { display: flex; align-items: stretch; gap: 2px; margin-bottom: 2px; }
.bayname {
  flex: none; width: 132px; position: sticky; left: 0; z-index: 2;
  background: var(--surface); padding: 4px 8px 4px 0;
  display: flex; flex-direction: column; justify-content: center;
}
.bayname b { font-size: 13px; }
.bayname small { color: var(--muted); font-size: 11px; }
.row.head .hcell {
  flex: none; width: 26px; font-size: 10px; color: var(--muted);
  white-space: nowrap; overflow: visible;
}
.row.head .hcell.owl { color: var(--owl); }
.cell {
  flex: none; width: 26px; height: 30px; border-radius: 4px; cursor: pointer;
  border: 1px solid transparent; padding: 0;
}
.cell.open { background: var(--green-deep); }
.cell.open:hover { background: var(--green); }
.cell.open.owl { background: var(--owl); }
.cell.short { background: var(--surface-2); border-color: var(--line); cursor: not-allowed; }
.cell.taken { background: var(--surface-2); border-color: var(--line); cursor: not-allowed; opacity: .55; }

.hold { border-color: var(--green); }

/* --------------------------------------------------------- door code */
.booking .bhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pill {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 12px; font-size: 13px;
}
.code { display: flex; gap: 8px; margin: 14px 0; }
.digit {
  width: 46px; height: 58px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------- keypad */
.door .lede { max-width: 66ch; }
.keypad-display { display: flex; gap: 8px; margin: 16px 0; }
.keypad-display .slot {
  width: 40px; height: 50px; border-radius: 8px;
  display: grid; place-items: center; font-size: 24px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--green);
}
.keypad-display .slot.filled { border-color: var(--green); }
.keypad {
  display: grid; grid-template-columns: repeat(3, 72px); gap: 8px;
}
.key {
  height: 60px; border-radius: 10px; cursor: pointer; font-size: 20px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink);
}
.key:hover { border-color: var(--green); }
.key.go { background: var(--green-deep); border-color: var(--green-deep); color: #fff; }
.key.clr { color: var(--muted); }

.verdict.granted { border-color: var(--green); }
.verdict.refused { border-color: var(--red); }
.verdict .say { font-size: 17px; margin: 6px 0 10px; }
.verdict.refused .say { color: var(--red); }
.verdict.granted .say { color: var(--green); }

/* ----------------------------------------------------------- operator */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; display: flex; flex-direction: column;
}
.stat b { font-size: 22px; font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); font-size: 12px; }
.stat.bad { border-color: var(--red); }
.stat.bad b { color: var(--red); }

.inside, .logline {
  display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap;
  padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.inside:last-child, .logline:last-child { border-bottom: 0; }
.inside b { min-width: 110px; }
.inside.bad { color: var(--amber); }
.logline b { min-width: 64px; font-variant-numeric: tabular-nums; color: var(--muted); }
.logline.refused span { color: var(--red); }
.logline.granted span { color: var(--green); }

.pinform { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.pinform label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.pinform input {
  padding: 9px 12px; border-radius: 10px; font: inherit;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink);
}

/* -------------------------------------------------------------- foot */
.foot {
  max-width: 1100px; margin: 0 auto; padding: 8px 16px 40px;
  color: var(--muted); font-size: 12.5px;
}
.foot strong { color: var(--ink); }

@media (max-width: 640px) {
  .tabs { top: 63px; }
  .bayname { width: 96px; }
  .digit { width: 40px; height: 52px; font-size: 22px; }
}
