/* Palette: #2b193d background, #016fb9 blue, #22aed1 cyan, #6d8ea0 slate, #afa98d sand. Surfaces are tints of the background. */
:root {
  --bg: #2b193d;
  --blue: #016fb9;
  --cyan: #22aed1;
  --slate: #6d8ea0;
  --sand: #afa98d;
  --text: #e4e0cf;
  --surface: color-mix(in srgb, var(--bg), white 7%);
  --surface-2: color-mix(in srgb, var(--bg), white 13%);
  --line: color-mix(in srgb, var(--bg), var(--slate) 35%);
  --danger: #e0788a;
  --green: #8fdba9; /* pastel green: fully checked in */
  --yellow: #f2d675; /* walk-in room is used up */
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--sand);
  background: var(--bg);
}
main { padding: 8px 16px 56px; max-width: 720px; margin: 0 auto; }
h1 { font-size: 24px; line-height: 1.2; margin: 16px 0 10px; color: var(--text); letter-spacing: -0.01em; }
h2 { font-size: 18px; margin: 0 0 6px; color: var(--text); }
h1 small, h2 small { font-size: 13px; font-weight: 400; color: var(--slate); margin-left: 6px; }
small { color: var(--slate); }
p { margin: 8px 0; }
a { color: var(--cyan); }
strong { color: var(--text); }

/* top bar and tabs */
.topbar { display: flex; align-items: center; justify-content: space-between; max-width: 720px; margin: 0 auto; padding: 12px 16px 4px; }
.topbar form { margin: 0; }
.brand { font-weight: 800; font-size: 18px; letter-spacing: 0.02em; color: var(--cyan); }
.tabs { display: flex; flex-wrap: wrap; gap: 5px; max-width: 720px; margin: 0 auto; padding: 6px 16px 10px; }
.tab { flex: none; padding: 5px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; text-decoration: none; color: var(--slate); background: var(--surface); border: 1px solid var(--line); }
.tab:hover { color: var(--text); }
.tab.active { color: var(--bg); background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 14px color-mix(in srgb, var(--cyan), transparent 60%); }

/* buttons: small everywhere */
.btn, button, input[type=submit] {
  display: inline-block; padding: 5px 12px; font: inherit; font-size: 13px; font-weight: 700; line-height: 1.4; text-decoration: none; cursor: pointer;
  border-radius: 999px; border: 1px solid var(--cyan); background: var(--cyan); color: var(--bg);
}
.btn:hover, button:hover, input[type=submit]:hover { filter: brightness(1.1); }
.btn:active, button:active { transform: translateY(1px); }
.btn.ghost, button.ghost { background: transparent; color: var(--cyan); border-color: color-mix(in srgb, var(--cyan), transparent 55%); }
.btn.quiet, button.quiet { background: var(--surface-2); color: var(--sand); border-color: var(--line); }
.btn.ghost.on, button.ghost.on { background: var(--blue); color: #fff; border-color: var(--blue); }
button form, form { margin: 0; }
.row > form, .row > .btn { margin: 0; }
td.end, .row.end { justify-content: flex-end; }

/* surfaces */
/* The accent is the card's own top border, so it follows the rounded corners exactly. */
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--blue); border-radius: var(--radius); padding: 12px 14px 14px; margin: 12px 0; }
.card.next { border-color: var(--cyan); box-shadow: 0 0 22px color-mix(in srgb, var(--cyan), transparent 82%); }

/* forms */
label { display: block; margin: 12px 0; font-size: 14px; color: var(--sand); }
input[type=text], input[type=password], input[type=number], input[type=search], input[type=tel], input[type=datetime-local], textarea, select {
  display: block; width: 100%; margin-top: 4px; padding: 9px 11px; font: inherit; font-size: 16px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color-scheme: dark;
}
input::placeholder, textarea::placeholder { color: var(--slate); }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--cyan); outline-offset: 1px; border-color: var(--cyan); }
input[type=checkbox] { accent-color: var(--cyan); margin-right: 6px; }
input[type=search] { margin-bottom: 8px; }
.hint { font-size: 13px; color: var(--slate); margin: 0 0 12px; }

/* flash and warnings */
.flash { padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--cyan), var(--bg) 82%); border: 1px solid color-mix(in srgb, var(--cyan), transparent 60%); color: var(--text); }
.flash.alert, .warn { background: color-mix(in srgb, var(--danger), var(--bg) 85%); border: 1px solid color-mix(in srgb, var(--danger), transparent 55%); color: #f3c4cc; padding: 8px 12px; border-radius: 10px; }

/* tables */
table { width: 100%; border-collapse: collapse; margin-top: 6px; }
td, th { text-align: left; padding: 10px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.end { text-align: right; }

.row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.big { font-size: 28px; font-weight: 800; color: var(--cyan); }

/* conversation */
.thread { margin: 8px 0 12px; }
.bubble { width: fit-content; max-width: 85%; padding: 6px 11px; border-radius: 14px; margin: 4px 0; line-height: 1.3; }
.bubble .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble .meta { font-size: 11px; margin-top: 2px; opacity: 0.7; }
.bubble .meta a { color: inherit; text-decoration: underline; }
.bubble.in { background: var(--surface-2); color: var(--text); border-bottom-left-radius: 4px; }
.bubble.out { background: var(--blue); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }

.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--slate); color: var(--bg); vertical-align: middle; }
.badge.flag { background: var(--danger); }
.handler { margin: 10px 0; }
.bubble.failed { outline: 1px solid var(--danger); }

/* show time cards and pages */
.st-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.st-head h1, .st-head h2 { margin: 0; }
h1 .badge, h2 .badge { margin-left: 6px; font-size: 12px; }
.section { margin: 22px 0 0; color: var(--slate); font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; }
.card.clickable:hover { border-color: var(--cyan); }
.card-link { color: var(--text); text-decoration: none; }
.card-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card.past { opacity: 0.65; }
.badge.status-closed { background: var(--sand); }
.badge.status-cancelled { background: var(--danger); }

/* the "..." menu (sits above the card's stretched link) */
.menu { position: relative; z-index: 3; flex: none; }
.dots { padding: 2px 11px; font-size: 18px; line-height: 1.2; letter-spacing: 1px; }
.menu.open { z-index: 10; }
.menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; min-width: 210px; padding: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); }
.menu-list[hidden] { display: none; }
.menu-list form { margin: 0; }
.menu .menu-item { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 14px; font-weight: 600; text-align: left; text-decoration: none; cursor: pointer; }
.menu .menu-item:hover { background: var(--surface); filter: none; }
.menu .menu-item.danger { color: var(--danger); }

/* guest rows on the show page */
.searchrow { display: flex; gap: 8px; align-items: center; margin: 12px 0 4px; }
.searchrow input[type=search] { flex: 1; margin: 0; }
.guest { padding: 12px 2px; border-bottom: 1px solid var(--line); }
.guest[hidden] { display: none; }
.guest-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.guest-info { display: flex; flex-direction: column; min-width: 0; }
.count { flex: none; font-size: 32px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.count.empty { color: var(--slate); }
.count.partial { color: var(--sand); }
.count.full { color: var(--green); }
.guest-bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
.guest-links, .guest-actions { margin: 0; flex-wrap: nowrap; }
button:disabled, .btn:disabled { opacity: 0.35; cursor: default; filter: none; }

/* capacity bar on the show page: four flat parts that add up to the room */
.capbar { display: flex; height: 16px; border-radius: 999px; overflow: hidden; background: var(--surface-2); margin: 10px 0 8px; }
.seg { display: block; height: 100%; }
.seg.checked_in, .swatch.checked_in { background: var(--cyan); }
/* "more expected" is hatched: these people are coming but not here yet */
.seg.held, .swatch.held { background: repeating-linear-gradient(135deg, var(--blue) 0 4px, color-mix(in srgb, var(--blue), var(--bg) 70%) 4px 8px); }
.seg.walkins, .swatch.walkins { background: var(--sand); }
.seg.open { background: transparent; }
.legend { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 14px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; background: var(--surface-2); border: 1px solid var(--slate); }
.swatch.checked_in, .swatch.held, .swatch.walkins { border-color: transparent; }

/* compact clickable cards (messages list) */
.card.compact { padding: 8px 12px; margin: 8px 0; }
.card.compact { border-top: 1px solid var(--line); }
.card.compact .st-head { align-items: center; }
.msg-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; }
.msg-title .card-link { font-weight: 700; }
.msg-time { flex: none; white-space: nowrap; }
.msg-snippet { display: block; margin-top: 2px; overflow-wrap: anywhere; }
.topbar .menu { margin-left: auto; }
.dots.gear { font-size: 24px; line-height: 1; padding: 3px 9px; letter-spacing: 0; }
.brand-phone { margin-left: 8px; font-size: 13px; color: var(--slate); opacity: 0.8; white-space: nowrap; }
.topbar { gap: 0; }
.brand { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.capbar.thin { height: 8px; margin: 8px 0 6px; }
.summary { margin: 4px 0 0; color: var(--text); }
.brand-phone.shareable { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.form-actions { margin-top: 16px; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: var(--bg); }
.btn.stop { background: var(--yellow); border-color: var(--yellow); color: var(--bg); }

/* blasts */
fieldset { border: 0; padding: 0; margin: 12px 0; }
legend { padding: 0; font-size: 14px; color: var(--sand); }
.choice { display: flex; align-items: flex-start; gap: 4px; margin: 8px 0; color: var(--text); }
.choice input { margin-top: 4px; }
.choice small { display: block; }
.choice-card { display: block; cursor: pointer; }
.choice-card:has(input:checked) { border-color: var(--cyan); }
.choice-card small { color: var(--slate); }
.choice-card small.warn { color: #f3c4cc; background: none; border: 0; padding: 0; }
input[type=radio] { accent-color: var(--cyan); margin-right: 6px; }
.blast-summary { font-weight: 700; }
.guest .row { margin: 0; flex-wrap: nowrap; }

/* Privacy policy and SMS terms */
.legal h2 { margin-top: 24px; }
.legal ul { margin: 8px 0; padding-left: 22px; }
.legal li { margin: 4px 0; }
