/* SONORA Live: site styles. Equipment-led and flat: near-black ground, graphite panels, 1px rules,
   colour only for deck identity and state. The booth has its own sheet (booth.css). */

:root {
  --bg: #080a0d;
  --bg-2: #0d1014;
  --face: #171b21;
  --face-2: #1d2229;
  --raised: #272e37;
  --raised-2: #313945;
  --line: #222831;
  --line-2: #2e3641;
  --text: #e5eaf0;
  --dim: #8a96a5;
  --faint: #5b6573;
  --a: #f2a43a;
  --b: #4c9bf5;
  --c: #a47cf3;
  --d: #45c9a0;
  --red: #e5484d;
  --red-dim: #4a1c20;
  --green: #45c9a0;
  --warn: #e8b23e;
  --radius: 6px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", "SF Mono", Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.lbl { font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--dim); font-weight: 600; }
.dim { color: var(--dim); }
.faint { color: var(--faint); }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--b); outline-offset: 2px; }
.wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 16px; }

/* ── Header ─────────────────────────────────────────────────────────── */

.top { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 30; }
.top .wrap { display: flex; align-items: center; gap: 18px; height: 52px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 800; letter-spacing: .16em; font-size: 14px; }
.brand small { font-size: 9.5px; letter-spacing: .14em; color: var(--bg); background: var(--text); padding: 2px 5px 1px; border-radius: 3px; font-weight: 800; }
.mark { width: 22px; height: 22px; flex: none; }
.nav { display: flex; gap: 2px; }
.nav a { text-decoration: none; color: var(--dim); padding: 6px 10px; border-radius: var(--radius); font-size: 13px; }
.nav a:hover { color: var(--text); background: var(--face); }
.nav a.on { color: var(--text); }
.who { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.who form { margin: 0; }
.who .menu-btn { display: none; }

@media (max-width: 760px) {
  .top .wrap { gap: 10px; }
  .nav { display: none; position: absolute; top: 52px; left: 0; right: 0; flex-direction: column; background: var(--bg-2); border-bottom: 1px solid var(--line); padding: 8px 12px 12px; }
  .nav.open { display: flex; }
  .nav a { padding: 11px 10px; font-size: 15px; }
  .who .menu-btn { display: inline-flex; }
  .who .hide-sm { display: none; }
}

/* ── Controls ───────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 32px; padding: 0 12px; border-radius: var(--radius);
  border: 1px solid var(--line-2); background: var(--face-2); color: var(--text);
  font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--raised); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--text); color: #0b0d10; border-color: var(--text); }
.btn.primary:hover { background: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--dim); }
.btn.ghost:hover { color: var(--text); background: var(--face); }
.btn.danger { border-color: #5a2328; color: #ff8a8e; background: transparent; }
.btn.danger:hover { background: var(--red-dim); }
.btn.small { height: 26px; padding: 0 9px; font-size: 12px; }
.btn.big { height: 44px; padding: 0 20px; font-size: 15px; }
.btn svg { width: 15px; height: 15px; flex: none; }
.icon-btn { width: 32px; padding: 0; }

input[type=text], input[type=password], input[type=search], input:not([type]), select, textarea {
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 7px 10px; min-height: 34px; width: 100%; color: var(--text);
}
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--b); }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field .lbl { margin: 0; }
.hint { font-size: 12px; color: var(--dim); }

.chip { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 13px; border: 1px solid var(--line-2); background: transparent; color: var(--dim); font-size: 12px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.chip:hover { color: var(--text); }
.chip.on, .chip[aria-pressed=true] { color: var(--bg); background: var(--text); border-color: var(--text); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; cursor: pointer; }
.check input { accent-color: var(--text); width: 16px; height: 16px; }

/* Status pills: what they refer to is always written in them (host or you). */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--line-2); color: var(--dim); white-space: nowrap; }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.pill.live { color: #ff6b70; border-color: #5a2328; background: #1d0e10; }
.pill.live i { animation: blink 1.6s ease-in-out infinite; }
.pill.starting { color: var(--warn); border-color: #4b3a17; }
.pill.reconnecting { color: var(--warn); border-color: #4b3a17; }
.pill.ended { color: var(--faint); }
.pill.ok { color: var(--green); border-color: #1b4136; }
.pill.warn { color: var(--warn); border-color: #4b3a17; }
.pill.bad { color: #ff8a8e; border-color: #5a2328; }
@keyframes blink { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .pill.live i { animation: none; } }

.flash { margin: 14px 0 0; padding: 10px 12px; border: 1px solid var(--line-2); background: var(--face); border-radius: var(--radius); font-size: 13px; }

/* ── Page chrome ────────────────────────────────────────────────────── */

main.page { flex: 1; padding: 22px 0 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 22px; letter-spacing: -.01em; }
.page-head p { margin: 4px 0 0; color: var(--dim); }
h2.section { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin: 28px 0 12px; display: flex; align-items: center; gap: 10px; font-weight: 700; }
h2.section::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.panel { background: var(--face); border: 1px solid var(--line); border-radius: 8px; padding: 18px; }
.panel h3 { margin: 0 0 12px; font-size: 14px; }
.foot { border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; }
.foot .wrap { display: flex; gap: 16px; align-items: center; height: 48px; flex-wrap: wrap; }
.foot a { color: var(--dim); text-decoration: none; }
.foot a:hover { color: var(--text); }

/* ── Lobby ──────────────────────────────────────────────────────────── */

.onair-strip { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--face); margin-bottom: 20px; }
.onair-strip .steps { display: flex; gap: 22px; flex-wrap: wrap; color: var(--dim); font-size: 13px; }
.onair-strip .steps b { color: var(--text); font-weight: 600; }
.onair-strip .steps span::before { content: attr(data-n); display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line-2); font-size: 10px; margin-right: 7px; color: var(--text); font-weight: 700; }
@media (max-width: 900px) { .onair-strip { grid-template-columns: 1fr; gap: 12px; } }

.filters { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.filters .search { flex: 0 1 280px; position: relative; }
.filters .search input { padding-left: 32px; }
.filters .search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--faint); }
.filters .chips { flex: 1 1 300px; min-width: 0; }
@media (max-width: 600px) { .filters .search { flex: 1 1 100%; } }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
@media (max-width: 420px) { .grid { grid-template-columns: 1fr; } }
.card { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--face); text-decoration: none; min-width: 0; position: relative; }
.card:hover { border-color: var(--line-2); background: var(--face-2); }
.card .row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.card .meta { margin-left: auto; display: flex; gap: 10px; color: var(--dim); font-size: 12px; }
.card h3 { margin: 0; font-size: 15.5px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.who-line { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
.who-line .h { color: var(--dim); }
.avatar { --c: var(--a); width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10.5px; font-weight: 800; color: #0b0d10; background: var(--c); flex: none; letter-spacing: 0; }
.avatar.big { width: 64px; height: 64px; font-size: 22px; }
.np { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--line); padding-top: 9px; font-size: 12.5px; }
.np div { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.np .dk { font-size: 10px; font-weight: 800; color: #0b0d10; border-radius: 3px; padding: 1px 4px; flex: none; }
.np .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-1 { background: var(--a); } .dk-2 { background: var(--b); } .dk-3 { background: var(--c); } .dk-4 { background: var(--d); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.tag { font-size: 11px; color: var(--dim); border: 1px solid var(--line-2); border-radius: 3px; padding: 1px 6px; }
.empty { border: 1px dashed var(--line-2); border-radius: 8px; padding: 40px 20px; text-align: center; color: var(--dim); }
.empty h3 { color: var(--text); margin: 0 0 6px; font-size: 16px; }
.empty p { margin: 0 auto; max-width: 520px; }

/* ── Forms (sign in, account) ───────────────────────────────────────── */

.auth { max-width: 380px; margin: 30px auto 0; }
.auth h1 { font-size: 20px; margin: 0 0 4px; }
.auth .switch { margin-top: 14px; text-align: center; font-size: 13px; color: var(--dim); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

/* ── Profile and lists ──────────────────────────────────────────────── */

.profile-head { display: flex; gap: 18px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.profile-head h1 { margin: 0; font-size: 24px; }
.profile-head .bio { color: var(--dim); max-width: 620px; margin: 6px 0 0; }
.profile-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--dim); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: var(--bg-2); }
.table a { text-decoration: none; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--face); }
@media (max-width: 640px) { .table .hide-sm { display: none; } }
.list { display: flex; flex-direction: column; }
.list > a, .list > div { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; min-width: 0; }

/* ── Docs and prose ─────────────────────────────────────────────────── */

.prose { max-width: 760px; }
.prose h2 { font-size: 17px; margin: 30px 0 8px; }
.prose h3 { font-size: 14px; margin: 22px 0 6px; }
.prose p, .prose li { color: #c6ced8; }
.prose code, .code { font-family: var(--mono); font-size: 12.5px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.prose pre { background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 12px; overflow-x: auto; font-size: 12.5px; }
.prose pre code { border: 0; padding: 0; background: none; }
.endpoint { display: grid; grid-template-columns: 64px 1fr; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.endpoint .m { font-family: var(--mono); font-size: 11.5px; font-weight: 700; color: var(--b); }
.endpoint .m.post { color: var(--d); } .endpoint .m.put, .endpoint .m.patch { color: var(--a); }
.endpoint .p { font-family: var(--mono); font-size: 12.5px; word-break: break-all; }
.endpoint .s { grid-column: 2; color: var(--dim); }

/* ── Toasts ─────────────────────────────────────────────────────────── */

.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 90; max-width: min(360px, calc(100vw - 32px)); }
.toast { background: var(--face-2); border: 1px solid var(--line-2); border-radius: 6px; padding: 10px 12px; font-size: 13px; box-shadow: 0 6px 24px rgba(0,0,0,.45); }
.toast a { color: var(--b); }

/* Changelog */
.release { border-bottom: 1px solid var(--line); padding: 6px 0 14px; }
.release h2 { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 18px 0 6px; }
.release ul { margin: 0; padding-left: 20px; }
.release li { margin: 3px 0; }
