
:root {
  color-scheme: dark;
  --bg: #0e1014; --surface: #161a21; --surface-2: #1d222b; --border: #2a303b;
  --fg: #e9ecf2; --muted: #8a93a6; --accent: #3d7bfd; --accent-fg: #fff;
  --danger: #f05252; --free: #16a34a; --busy: #dc2626; --ok: #34d399;
  --radius: 12px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1 { font-size: 22px; margin: 0; font-weight: 650; }
h2 { font-size: 12px; margin: 0 0 14px; color: var(--muted); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
p { margin: 0 0 14px; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.strong { font-weight: 600; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.right { text-align: right; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: var(--fg);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #3a4250; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { border-color: #6b9bff; }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(240,82,82,.45); }
.btn-danger:hover { border-color: var(--danger); }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; border-radius: 7px; }
.btn-block { display: flex; width: 100%; height: 48px; margin-top: 8px; }

input, select { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface-2); color: var(--fg); font: inherit; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.stack { display: grid; gap: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row select { flex: 1 1 280px; max-width: 460px; }
.alert { padding: 10px 12px; border-radius: 9px; background: rgba(240,82,82,.12); color: #ffb4b4; }
.pill { padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: 13px; }
.badge { display: inline-block; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); font-size: 12px; }

.page { max-width: 920px; margin: 0 auto; padding: 32px 20px 48px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.code-box { margin-top: 18px; padding: 16px; border: 1px dashed #3d4a63; border-radius: 10px; background: rgba(61,123,253,.07); display: grid; gap: 6px; }
.code { font-size: 34px; font-weight: 700; letter-spacing: .18em; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 12px 10px; border-bottom: 1px solid var(--border); }
td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
tr.revoked td { opacity: .5; }

.sheet { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.sheet .card { width: 100%; max-width: 420px; margin: 0; padding: 28px 24px; }
.sheet h1 { margin-bottom: 10px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.eyebrow.ok { color: var(--ok); }
.slot { font-size: 30px; font-weight: 700; margin: 4px 0 14px; }

/* Glow theme: the faceapp.com v3 palette, which is also the logo's glow. Warm
   (magenta to orange) marks busy and conflicts, cool (violet to blue) marks free. */
body.glow {
  --magenta: #e41d96; --violet: #8c3ce6; --indigo: #5b2ad6; --orange: #ff842e; --blue: #3d7bfd;
  --glass: rgba(18,16,28,.58); --glass-border: rgba(255,255,255,.12);
  background: #000;
}
body.glow::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(120deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.2) 50%, rgba(0,0,0,0) 100%),
    #000 url(/static/glow-logo.webp) no-repeat right 0 bottom -22vh / auto 110vh;
  filter: brightness(.55); }
body.glow .card, body.glow .status, body.glow .timeline .track, body.glow .presets .btn {
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); }
body.glow .card { background: var(--glass); border-color: var(--glass-border); }
body.glow .status { background: var(--glass); border-color: var(--glass-border); }
body.glow .status.free { background: linear-gradient(135deg, rgba(91,42,214,.82), rgba(61,123,253,.72)); border-color: rgba(160,180,255,.35); }
body.glow .status.busy { background: linear-gradient(135deg, rgba(228,29,150,.9), rgba(255,77,109,.84)); border-color: rgba(255,170,200,.35); }
body.glow .btn-primary { border: 0; border-radius: 999px; color: #fff;
  background: linear-gradient(90deg, var(--magenta), var(--violet));
  box-shadow: 0 10px 32px rgba(228,29,150,.35), inset 0 1px 0 rgba(255,255,255,.25); }
body.glow .btn-primary:hover { filter: brightness(1.08); }
body.glow .btn-primary:disabled { background: rgba(255,255,255,.08); box-shadow: none; color: rgba(255,255,255,.45); filter: none; }
body.glow .btn:not(.btn-primary) { border-radius: 999px; background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.16); }
body.glow .presets .btn.active { border-color: transparent; color: #fff;
  background: linear-gradient(rgba(30,20,45,.85), rgba(30,20,45,.85)) padding-box,
    linear-gradient(90deg, var(--magenta), var(--violet)) border-box; border: 2px solid transparent; box-shadow: none; }
body.glow .timeline .track { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); }
body.glow .timeline .meeting { background: linear-gradient(90deg, rgba(228,29,150,.75), rgba(255,77,109,.65)); }
/* On a narrow screen the logo scales with the width so it is never cut. */
@media (max-aspect-ratio: 1/1) {
  body.glow::before { background-size: auto, min(90vw, 60vh) auto; }
}
body.glow .timeline .sel { border-color: #c06bff; background: rgba(140,60,230,.28); box-shadow: 0 0 24px rgba(140,60,230,.45); }
body.glow .timeline .sel.conflict { border-color: var(--orange); background: rgba(255,132,46,.22); box-shadow: 0 0 24px rgba(255,132,46,.4); }
body.glow .range-label.conflict { color: var(--orange); }
body.glow .schedule .tag { color: #ff7ac4; }
body.glow .alert { background: rgba(228,29,150,.14); color: #ffb3dc; }
body.glow .eyebrow.ok { color: #9fb6ff; }
body.kiosk { font-size: 20px; user-select: none; }
.display { height: 100%; display: grid; grid-template-rows: auto auto auto 1fr; gap: 24px; padding: 32px 40px; }
.display header { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.display h1 { font-size: 30px; }
.clock { font-size: 30px; color: var(--muted); font-variant-numeric: tabular-nums; }
.status { display: grid; gap: 4px; padding: 36px 40px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); }
.status.free { background: var(--free); border-color: var(--free); }
.status.busy { background: var(--busy); border-color: var(--busy); }
#status-text { font-size: 64px; font-weight: 750; line-height: 1.1; }
.status-sub { font-size: 24px; opacity: .85; }
.book { display: grid; gap: 14px; }
.book h2 { margin: 0; }
.book-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.range-label { font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; }
.range-label.conflict { color: var(--danger); }
.timeline { position: relative; height: 112px; margin: 0 18px; touch-action: none; }
.timeline .track { position: absolute; left: 0; right: 0; top: 34px; height: 44px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.timeline .past { position: absolute; top: 0; bottom: 0; left: 0; background: repeating-linear-gradient(135deg, rgba(255,255,255,.04) 0 6px, transparent 6px 12px); }
.timeline .meeting { position: absolute; top: 0; bottom: 0; background: rgba(220,38,38,.55); }
.timeline .tick { position: absolute; top: 80px; width: 1px; height: 8px; background: var(--border); }
.timeline .tick.hour { height: 14px; background: var(--muted); }
.timeline .tick span { position: absolute; top: 16px; left: 0; transform: translateX(-50%); font-size: 16px; color: var(--muted); font-variant-numeric: tabular-nums; }
.timeline .sel { position: absolute; top: 30px; height: 52px; border-radius: 12px; border: 3px solid var(--accent); background: rgba(61,123,253,.28); pointer-events: none; }
.timeline .sel.conflict { border-color: var(--danger); background: rgba(240,82,82,.25); }
.timeline .handle { position: absolute; top: 14px; width: 60px; height: 84px; margin-left: -30px; display: flex; align-items: center; justify-content: center; cursor: grab; }
.timeline .handle::after { content: ""; width: 28px; height: 62px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.55);
  background: linear-gradient(90deg, transparent calc(50% - 1.5px), rgba(0,0,0,.35) calc(50% - 1.5px), rgba(0,0,0,.35) calc(50% + 1.5px), transparent calc(50% + 1.5px)) center / 100% 45% no-repeat, #fff; }
.book-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.presets { display: flex; gap: 10px; flex-wrap: wrap; }
.presets .btn { height: 60px; padding: 0 22px; font-size: 22px; border-radius: 12px; }
.presets .btn.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.btn-xl { height: 72px; padding: 0 40px; font-size: 26px; border-radius: 14px; }
.schedule ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.schedule li { font-size: 24px; color: var(--muted); font-variant-numeric: tabular-nums; display: flex; gap: 16px; align-items: baseline; }
.schedule .tag { font-size: 15px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--busy); }
.schedule li.now { color: var(--fg); font-weight: 600; }
.overlay { position: fixed; inset: 0; background: rgba(5,7,10,.88); display: flex; align-items: center; justify-content: center; }
.overlay[hidden] { display: none; }
.qr-card { background: #fff; color: #111; padding: 28px 32px; border-radius: 20px; text-align: center; max-width: 560px; }
.qr-card #qr svg { width: 340px; height: 340px; display: block; margin: 0 auto; }
.qr-card p { font-size: 22px; margin: 16px 0; }
.qr-card .btn { background: #f1f3f6; color: #111; border-color: #d5d9e0; }

@media (max-width: 640px) {
  .page { padding: 20px 14px 32px; }
  th:nth-child(3), td:nth-child(3) { display: none; }
}
