/* ------------------------------------------------------------------
   Aqlama · Stereo Recording — editorial-minimal
   palette: cream paper · ink · cobalt blue · gold · moss
   type:    Fraunces (display) · Geist Sans (body) · JetBrains Mono
------------------------------------------------------------------ */

:root {
  --paper:        #f5efe4;
  --paper-elev:   #f0e8d8;
  --card:         #fdfaf2;
  --card-hover:   #fffcf3;
  --ink:          #1a1a1a;
  --ink-soft:     #2d2a23;
  --warm-1:       #5c5749;
  --warm-2:       #8a8170;
  --hair:         #d9d0bf;
  --hair-strong:  #b8ad96;

  --brand:        #1f4ea0;
  --brand-deep:   #163d80;
  --brand-soft:   rgba(31, 78, 160, 0.10);
  --brand-glow:   rgba(31, 78, 160, 0.25);

  --gold:         #c89414;
  --gold-deep:    #a87a10;
  --gold-soft:    rgba(200, 148, 20, 0.14);
  --gold-glow:    rgba(200, 148, 20, 0.45);

  --moss:         #4a6b3a;
  --moss-soft:    rgba(74, 107, 58, 0.10);
  --danger:       #a93226;
  --danger-soft:  rgba(169, 50, 38, 0.10);

  --font-display: "Fraunces", "Source Serif Pro", Georgia, serif;
  --font-body:    "Geist", "Geist Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:    "JetBrains Mono", "SF Mono", "Cascadia Code", Consolas, monospace;
}

/* ------------------------------------------------------------------
   Reset + base
------------------------------------------------------------------ */
* { box-sizing: border-box; }

/* Make sure the HTML `hidden` attribute always wins, even when an
   element has a `display: <something>` rule via id or class. */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
}

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 22px 20px 80px;
  position: relative;
}

a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover { color: var(--brand-deep); }

button { font-family: inherit; }

/* ------------------------------------------------------------------
   Site header (logo + room id) — appears on both pages
------------------------------------------------------------------ */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--hair);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.brand-mark:hover { text-decoration: none; }

.brand-mark img {
  height: 26px;
  width: auto;
  display: block;
}

.brand-mark .wordmark {
  font-family: var(--font-display);
  font-size: 12px;
  font-style: italic;
  color: var(--warm-1);
  font-weight: 500;
  letter-spacing: 0.005em;
  border-left: 1px solid var(--hair);
  padding-left: 10px;
  margin-left: 2px;
}

.site-header .room-id {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--warm-2);
  text-transform: uppercase;
}

/* ------------------------------------------------------------------
   Page intro (who you are)
------------------------------------------------------------------ */

.intro {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin: 0 0 14px;
  font-variation-settings: "opsz" 36;
}
.intro .you-are {
  font-style: italic;
  font-weight: 400;
  font-size: 14px;
  color: var(--warm-1);
  margin-right: 6px;
}
.intro .who {
  color: var(--ink);
}

.hint-row {
  font-size: 13px;
  color: var(--warm-1);
  margin: 0 0 18px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.hint-row #hintText { min-width: 0; }

/* ------------------------------------------------------------------
   Slot picker (room page, initial state)
------------------------------------------------------------------ */

#slots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.slot {
  position: relative;
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: 6px;
  padding: 14px 14px 12px;
  cursor: pointer;
  text-align: left;
  color: var(--ink);
  font-family: inherit;
  transition: background 180ms ease, border-color 180ms ease, transform 100ms ease, box-shadow 180ms ease;
}
.slot:hover:not(:disabled):not(.taken) {
  background: var(--card-hover);
  border-color: var(--hair-strong);
}
.slot:active:not(:disabled):not(.taken) { transform: translateY(1px); }

.slot .ch {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--warm-2);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.slot .name {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.15;
  color: var(--ink);
  letter-spacing: -0.005em;
  font-variation-settings: "opsz" 36;
}

.slot .state {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--warm-2);
  margin-top: 8px;
  font-weight: 500;
}

.slot.mine {
  background: linear-gradient(180deg, #f0f3fb 0%, var(--card) 100%);
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-soft);
}
.slot.mine .state { color: var(--brand); font-weight: 600; }

.slot.taken {
  opacity: 0.5;
  cursor: not-allowed;
}

.slot:disabled { cursor: not-allowed; }
.slot[disabled] { background: var(--card); }

/* slot 2 on landing — can't initiate, must arrive via invite link */
.slot.locked {
  cursor: not-allowed;
  background:
    repeating-linear-gradient(135deg,
      var(--card) 0 8px,
      var(--paper-elev) 8px 16px);
  border-style: dashed;
  opacity: 0.72;
}
.slot.locked:hover { background:
  repeating-linear-gradient(135deg,
    var(--card) 0 8px,
    var(--paper-elev) 8px 16px); }
.slot.locked .state { color: var(--warm-1); font-weight: 600; }

/* ---------- Metadata form (inside slot card) ---------- */

.meta-form {
  margin-top: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px dashed var(--brand);
  border-radius: 5px;
}
.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.meta-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--warm-2);
  font-weight: 600;
}
.meta-form label.full {
  margin-top: 8px;
}
.meta-form input,
.meta-form select {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--hair);
  border-radius: 3px;
  padding: 8px 10px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.meta-form input:focus,
.meta-form select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-soft);
}
.meta-form input:invalid:not(:placeholder-shown) {
  border-color: var(--danger);
}
.meta-form select:disabled {
  background: repeating-linear-gradient(135deg,
    var(--paper-elev) 0 6px,
    var(--card) 6px 12px);
  border-style: dashed;
  color: var(--warm-2);
  cursor: not-allowed;
}
.meta-form .meta-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--warm-1);
  margin-top: 7px;
  letter-spacing: 0.02em;
}
.meta-form .meta-save {
  margin-top: 10px;
  background: var(--brand);
  color: var(--card);
  border: 0;
  padding: 8px 16px;
  border-radius: 3px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 160ms;
}
.meta-form .meta-save:hover:not(:disabled) { background: var(--brand-deep); }
.meta-form .meta-save:disabled { opacity: 0.5; cursor: not-allowed; }
.meta-form .meta-err {
  margin-top: 7px;
  font-size: 11px;
  color: var(--danger);
  font-weight: 500;
}

/* Saved metadata summary — replaces the form once submitted */
.meta-summary {
  margin-top: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--hair);
  border-radius: 4px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.meta-summary .meta-line {
  font-family: var(--font-mono);
  color: var(--ink-soft);
  letter-spacing: 0.01em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.meta-summary .meta-edit {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 11px;
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
  flex: none;
}

/* ---------- Start-recording hint ---------- */

.start-hint {
  margin: -8px 0 14px;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--warm-2);
  text-align: center;
}

/* ------------------------------------------------------------------
   Peer line (after both claimed — compact)
------------------------------------------------------------------ */

#peerLine {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 13px;
}

#peerLine .seg {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
}
#peerLine .seg.me { color: var(--ink); font-weight: 600; }
#peerLine .seg.them { color: var(--warm-1); }

#peerLine .dot {
  width: 7px; height: 7px; border-radius: 50%;
  flex: none;
}
#peerLine .seg.me .dot { background: var(--brand); }
#peerLine .seg.them .dot { background: var(--moss); }
#peerLine .seg.them[data-state="waiting"] .dot,
#peerLine .seg.them[data-state="connecting"] .dot {
  background: var(--warm-2);
  animation: blink 1.2s ease-in-out infinite;
}
#peerLine .seg.them[data-state="recording"] .dot {
  background: var(--gold);
  animation: pulse-gold 1.4s ease-out infinite;
}

#peerLine .seg .name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#peerLine .seg .state-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--warm-2);
  text-transform: lowercase;
}

#peerLine .divider {
  width: 1px;
  align-self: stretch;
  background: var(--hair);
  margin: -10px 0;
}

/* ------------------------------------------------------------------
   Invite card
------------------------------------------------------------------ */

#inviteCard {
  background: var(--card);
  border: 1px solid var(--hair);
  border-left: 3px solid var(--brand);
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

#inviteCard .lab {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--warm-2);
  margin-bottom: 8px;
  font-weight: 600;
}

.invite-row {
  display: flex;
  gap: 6px;
}

.invite-row input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  border: 1px solid var(--hair);
  background: #fff;
  padding: 9px 11px;
  border-radius: 4px;
  color: var(--ink-soft);
}
.invite-row input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.copy-feedback {
  margin-top: 8px;
  font-size: 11px;
  color: var(--moss);
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* ------------------------------------------------------------------
   Status component (state-driven)
------------------------------------------------------------------ */

#statusRow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.4;
}

#statusRow .status-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex: none;
  background: var(--warm-2);
}
#statusRow .status-text { flex: 1; min-width: 0; }
#statusRow .status-timer {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--warm-1);
  font-feature-settings: "tnum";
  letter-spacing: 0.02em;
  flex: none;
}

/* State variants */
#statusRow[data-state="idle"] .status-dot { background: var(--warm-2); }

#statusRow[data-state="waiting"] .status-dot {
  background: var(--warm-2);
  animation: blink 1.6s ease-in-out infinite;
}

#statusRow[data-state="connecting"] .status-dot {
  background: var(--brand);
  animation: blink 1.0s ease-in-out infinite;
}

#statusRow[data-state="connected"] .status-dot {
  background: var(--moss);
}

#statusRow[data-state="recording"] .status-dot {
  background: var(--gold);
  animation: pulse-gold 1.4s ease-out infinite;
}
#statusRow[data-state="recording"] {
  background: linear-gradient(180deg, rgba(200,148,20,0.06), var(--card));
  border-color: rgba(200,148,20,0.35);
}

#statusRow[data-state="finalizing"] .status-dot {
  background: var(--brand);
  animation: blink 0.8s ease-in-out infinite;
}

#statusRow[data-state="done"] .status-dot { background: var(--moss); }

#statusRow[data-state="ended"] .status-dot { background: var(--warm-2); }

#statusRow[data-state="error"] .status-dot { background: var(--danger); }
#statusRow[data-state="error"] {
  background: var(--danger-soft);
  border-color: rgba(169, 50, 38, 0.3);
  color: var(--danger);
}

@keyframes blink {
  50% { opacity: 0.28; }
}
@keyframes pulse-gold {
  0%   { box-shadow: 0 0 0 0 rgba(200, 148, 20, 0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(200, 148, 20, 0); }
  100% { box-shadow: 0 0 0 0 rgba(200, 148, 20, 0); }
}

/* Sub-line below status (e.g., connection hint, peers) */
.status-hint {
  margin: -6px 0 12px;
  padding: 9px 12px;
  border-radius: 6px;
  background: var(--gold-soft);
  border-left: 3px solid var(--gold);
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.45;
}

/* ------------------------------------------------------------------
   Primary action button (only one rendered at a time)
------------------------------------------------------------------ */

button.action {
  width: 100%;
  background: var(--brand);
  color: var(--card);
  border: 0;
  padding: 13px 18px;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 160ms ease, transform 90ms ease, box-shadow 160ms ease;
  margin-bottom: 12px;
}
button.action:hover:not(:disabled) {
  background: var(--brand-deep);
}
button.action:active:not(:disabled) { transform: translateY(1px); }
button.action:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-soft);
}
button.action:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

button.action.stop {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
button.action.stop:hover {
  background: var(--ink);
  color: var(--card);
}

button.action.compact,
a.action.compact {
  display: inline-block;
  width: auto;
  padding: 9px 16px;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0;
  text-decoration: none;
}

button.action.ghost,
a.action.ghost {
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--brand);
}
button.action.ghost:hover:not(:disabled),
a.action.ghost:hover { background: var(--brand-soft); color: var(--brand-deep); }

/* ------------------------------------------------------------------
   Final / download card
------------------------------------------------------------------ */

#resultBox {
  background: var(--moss-soft);
  border: 1px solid rgba(74, 107, 58, 0.35);
  border-radius: 6px;
  padding: 13px 14px;
  margin-bottom: 14px;
}
#resultBox .lab {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--moss);
  margin-bottom: 6px;
  font-weight: 700;
}
#resultBox a {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  color: var(--brand);
  font-weight: 500;
}
#resultBox .share {
  margin-top: 6px;
  font-size: 11px;
  color: var(--warm-1);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
#resultBox button {
  margin-top: 14px;
}

/* ------------------------------------------------------------------
   Log (folded)
------------------------------------------------------------------ */

.log-fold {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--hair);
}
.log-fold summary {
  cursor: pointer;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--warm-2);
  font-weight: 600;
  list-style: none;
  user-select: none;
}
.log-fold summary::-webkit-details-marker { display: none; }
.log-fold summary::before {
  content: "▸  ";
  display: inline-block;
  transition: transform 120ms ease;
}
.log-fold[open] summary::before {
  content: "▾  ";
}
.log-fold pre {
  margin: 10px 0 0;
  background: #1a1815;
  color: #c8bda3;
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 10px 12px;
  max-height: 200px;
  overflow: auto;
  border-radius: 4px;
  line-height: 1.5;
}

/* ------------------------------------------------------------------
   Footer
------------------------------------------------------------------ */

.site-footer {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--hair);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--warm-2);
  text-align: center;
  font-weight: 500;
}
.site-footer .dot { margin: 0 6px; color: var(--hair-strong); }
.site-footer .ink {
  font-family: var(--font-display);
  font-style: italic;
  text-transform: none;
  letter-spacing: 0.005em;
  font-size: 11px;
  color: var(--warm-1);
}

/* ------------------------------------------------------------------
   Admin page — seat names editor
------------------------------------------------------------------ */

#seatNamesPanel {
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: 8px;
  padding: 16px 16px 14px;
  margin-bottom: 18px;
}

#seatNamesPanel h2 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
#seatNamesPanel .hint {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--warm-1);
  line-height: 1.5;
}

.seat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.seat-grid label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--warm-2);
  font-weight: 600;
}

.seat-grid input {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--hair);
  border-radius: 4px;
  padding: 9px 11px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.seat-grid input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.row-flex {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

#seatNamesStatus { font-size: 11px; letter-spacing: 0.02em; }
#seatNamesStatus.ok  { color: var(--moss); }
#seatNamesStatus.err { color: var(--danger); }

/* ------------------------------------------------------------------
   Admin: section heads + active rooms
------------------------------------------------------------------ */

.admin-section { margin-bottom: 20px; }
.admin-section .section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.admin-section .section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.admin-section .section-head .row-flex { gap: 8px; }

.small-status {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--warm-2);
  font-weight: 600;
  margin-bottom: 10px;
}

#activeRooms {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.active-card {
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: 6px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
.active-card .active-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.active-card .active-id {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.active-card .active-age {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--warm-2);
  letter-spacing: 0.02em;
  flex: 1;
}
.active-card .active-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 2px;
  letter-spacing: 0.12em;
}
.active-card .active-tag.idle {
  background: var(--brand-soft);
  color: var(--brand);
}
.active-card .active-tag.rec {
  background: var(--gold-soft);
  color: var(--gold-deep);
  animation: pulse-gold 1.4s ease-out infinite;
}
.active-card .active-slot {
  font-size: 12px;
  color: var(--ink-soft);
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.active-card .active-slot .ch {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--warm-2);
  letter-spacing: 0.16em;
  flex: none;
  min-width: 56px;
}
.active-card .active-slot .who {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--ink);
  letter-spacing: -0.005em;
}

/* ------------------------------------------------------------------
   Admin: recordings list
------------------------------------------------------------------ */

#listToolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
}

#listStatus {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--warm-2);
  font-weight: 600;
}

#list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rec-card {
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: 6px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  transition: border-color 140ms ease, background 140ms ease;
}
.rec-card:hover {
  border-color: var(--hair-strong);
  background: var(--card-hover);
}

.rec-card .rec-num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  color: var(--brand);
  min-width: 24px;
  text-align: center;
  font-weight: 500;
}

.rec-card .rec-body { min-width: 0; }

.rec-card .seat-line {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rec-card .seat-line .sep {
  color: var(--warm-2);
  font-style: italic;
  font-weight: 400;
  margin: 0 4px;
}

.rec-card .meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--warm-2);
  letter-spacing: 0.02em;
  margin-top: 3px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.rec-card .meta-detail {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--warm-1);
}
.rec-card .meta-detail .label {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  color: var(--brand);
}
.rec-card .meta-detail .value {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.rec-card .actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
  font-size: 12px;
}
.rec-card .actions a {
  color: var(--brand);
  font-family: var(--font-display);
  font-style: italic;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ------------------------------------------------------------------
   Help: hint-row link + "how it works" modal
------------------------------------------------------------------ */

.help-link {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}
.help-link:hover { color: var(--brand-deep); }
.help-link .q {
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  text-decoration: none;
}

#helpBackdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.45);
  opacity: 0;
  transition: opacity 280ms ease;
  z-index: 40;
}
#helpBackdrop.show { opacity: 1; }

#helpModal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, calc(-50% + 12px));
  width: min(440px, calc(100vw - 32px));
  background: var(--card);
  border: 1px solid var(--hair-strong);
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
  padding: 20px 22px 22px;
  z-index: 41;
  opacity: 0;
  transition: opacity 280ms ease, transform 280ms ease;
}
#helpModal.show {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.help-close {
  position: absolute;
  right: 12px; top: 10px;
  background: transparent;
  border: 0;
  color: var(--warm-2);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.help-close:hover { color: var(--ink); }

.help-eyebrow {
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand);
  font-weight: 700;
  margin-bottom: 3px;
}
.help-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
}
.help-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: help;
}
.help-steps li {
  counter-increment: help;
  position: relative;
  padding-left: 32px;
  margin-bottom: 11px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.help-steps li::before {
  content: counter(help);
  position: absolute;
  left: 0; top: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--card);
  font-weight: 700;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.help-steps li b { color: var(--ink); font-weight: 600; }
.help-foot {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--hair);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--warm-2);
  letter-spacing: 0.02em;
}

@media (prefers-reduced-motion: reduce) {
  #helpBackdrop, #helpModal { transition: none; }
}

/* ------------------------------------------------------------------
   Mobile tweaks
------------------------------------------------------------------ */

@media (max-width: 480px) {
  main { padding: 18px 16px 80px; }
  .brand-mark .wordmark { display: none; }
  .rec-card {
    grid-template-columns: auto 1fr;
    gap: 10px 12px;
  }
  .rec-card .actions {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    gap: 14px;
  }
}

/* ------------------------------------------------------------------
   Logged-in header chip (room + admin) — signed-in name + log out
------------------------------------------------------------------ */
.header-right { display: flex; align-items: center; gap: 12px; }
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--warm-1);
}
.user-chip a {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 11px;
  color: var(--brand);
}
@media (max-width: 480px) {
  .user-chip #userChipName { display: none; }
}
