:root {
  --bg: #111111;
  --bg-raised: #191919;
  --border: #2a2a2a;
  --text: #d4d4d4;
  --text-secondary: #888888;
  --text-tertiary: #666666;
  --link: #93a3f8;
  --selection: rgba(147, 163, 248, 0.3);

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", "Fira Code", Consolas, monospace;

  --max-content: 600px;
  --page-padding-x: 24px;
  --header-height: 44px;
}

html { scroll-behavior: smooth; }

*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.75 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--selection); }

a,
a:visited {
  color: var(--link);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

header.site {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

header.site .inner {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 var(--page-padding-x);
  height: 100%;
  display: flex;
  align-items: center;
}

header.site .wordmark {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

/* Wordmark is a link but presents as plain text — only revealed by clicking. */
a.wordmark,
a.wordmark:visited,
a.wordmark:hover {
  color: var(--text);
  text-decoration: none;
  cursor: default;
}

main {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: calc(var(--header-height) + 40px) var(--page-padding-x) 8px;
}

h1 {
  font-size: 20px;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 16px 0;
  line-height: 1.4;
}

p {
  margin: 0 0 12px 0;
  color: var(--text-secondary);
}

.emph { color: var(--text); }

.controls {
  margin: 24px 0;
  display: flex;
  align-items: baseline;
  gap: 24px;
}

button#play {
  background: transparent;
  color: var(--link);
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
}

button#play:hover { text-decoration: underline; }

button#play:focus-visible {
  outline: 1px solid var(--link);
  outline-offset: 4px;
}

.onair {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-tertiary);
}

.onair .dot { display: inline-block; }
.onair .dot-on  { color: #22c55e; }
.onair .dot-off { color: var(--text-tertiary); }

.status {
  border: 1px solid var(--border);
  background: var(--bg-raised);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin: 24px 0;
}

.status .row {
  display: flex;
  align-items: baseline;
  gap: 0;
}

.status .label {
  color: var(--text-tertiary);
  flex-shrink: 0;
  min-width: 8ch;
}

.status .val {
  color: var(--text-secondary);
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.status .val.primary { color: var(--text); }

.meta {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 24px;
}

footer.site {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 8px var(--page-padding-x) 32px;
  font-size: 13px;
  color: var(--text-tertiary);
}

.loading-dots {
  display: inline-block;
  vertical-align: middle;
  line-height: 0;
}

.loading-dots span {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin: 0 2px;
  background: var(--link);
  border-radius: 50%;
  animation: loading-bounce 1.2s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes loading-bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40%           { transform: translateY(-6px); }
}

/* Trays — collapsible sections (about / attribution / kofi).
   Visual language matches voxtts.space FAQ: flush rows with a bottom
   divider between them, no card framing. */
.trays {
  margin: 24px 0 8px;
  display: flex;
  flex-direction: column;
}

.tray {
  border-bottom: 1px solid var(--border);
}

.tray:last-child { border-bottom: 0; }

.tray > summary {
  font-size: 14px;
  color: var(--text);
  padding: 12px 0;
  cursor: pointer;
  list-style: none;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Hide the default disclosure triangle on browsers that still render one. */
.tray > summary::-webkit-details-marker { display: none; }
.tray > summary::marker { content: ""; }

/* Right-side [+] / [-] indicator in monospace. */
.tray > summary::after {
  content: "[+]";
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.tray[open] > summary::after { content: "[-]"; }

.tray > summary:focus-visible {
  outline: 1px solid var(--link);
  outline-offset: 2px;
}

.tray-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.75;
  padding: 0 0 16px;
}

.tray-body p { margin: 0; }
.tray-body p + p { margin-top: 12px; }

.tray-loading,
.tray-empty {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-tertiary);
}

/* Attribution table — compact, monospace, scrollable horizontally if needed. */
.attribution-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  margin-top: 8px;
}

.attribution-table th,
.attribution-table td {
  text-align: left;
  vertical-align: top;
  padding: 6px 12px 6px 0;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.attribution-table th {
  color: var(--text-tertiary);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-bottom: 8px;
}

.attribution-table td.col-title { color: var(--text); }
.attribution-table td.col-license a,
.attribution-table td.col-source a { color: var(--link); }

.attribution-table tr.is-now td               { color: var(--text); }
.attribution-table tr.is-now td.col-title     { color: var(--link); }
.attribution-table .now-marker {
  color: var(--link);
  margin-right: 6px;
}

#attribution-table-wrap {
  max-height: 60vh;
  overflow-y: auto;
  margin-top: 4px;
}

/* Schedule tray — tab strip + day list. Reuses the existing monospace +
   flush-row aesthetic from .status and the attribution table. */
.schedule-tabs {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  font-family: var(--font-mono);
  font-size: 12px;
  margin: 0 0 12px;
  border: 1px solid var(--border);
}

.schedule-tabs button {
  background: transparent;
  border: 0;
  border-right: 1px solid var(--border);
  color: var(--text-tertiary);
  padding: 8px 0;
  font: inherit;
  cursor: pointer;
  text-transform: lowercase;
}

.schedule-tabs button:last-child { border-right: 0; }

.schedule-tabs button[aria-selected="true"] {
  background: var(--bg-raised);
  color: var(--text);
}

.schedule-tabs button:hover { color: var(--text); }

.schedule-tabs button:focus-visible {
  outline: 1px solid var(--link);
  outline-offset: -1px;
}

.schedule-day {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.9;
  color: var(--text-secondary);
}

.schedule-day .day-header {
  color: var(--text-tertiary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.schedule-day .row {
  display: grid;
  grid-template-columns: 2ch 8ch 1fr;
  gap: 0 12px;
  align-items: baseline;
}

.schedule-day .row.is-now            { color: var(--text); }
.schedule-day .row.is-now .marker    { color: var(--link); }
.schedule-day .row.is-now .name      { color: var(--link); }
.schedule-day .time                  { white-space: nowrap; }
.schedule-day .name                  { overflow-wrap: anywhere; }

/* Message-the-host form — lives inside a .tray, so no outer frame; the tray
   already provides the row separator + open/close affordance. */
.msg-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
/* `display: flex` above overrides the user-agent [hidden] rule, so be
   explicit: when the form is hidden, none of its children render. */
.msg-form[hidden] { display: none; }

.msg-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 13px;
}
.msg-label {
  color: var(--text-tertiary);
  font-size: 11px;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

.msg-form input,
.msg-form textarea {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
.msg-form textarea {
  min-height: 4rem;
  resize: vertical;
}
.msg-form input:focus,
.msg-form textarea:focus {
  border-color: var(--link);
}

.msg-foot {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12px;
}

.msg-counter {
  color: var(--text-tertiary);
  margin-right: auto;
}
.msg-counter.warn { color: var(--link); }
.msg-counter.over { color: #c97a7a; }

.msg-error {
  color: #c97a7a;
}

/* Post-send confirmation + countdown. Replaces the form for the duration of
   the rate-limit window; reverts to the form when the countdown hits 0. */
.msg-sent {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
}
.msg-sent-line {
  margin: 0;
}
.msg-sent-line + .msg-sent-line {
  margin-top: 6px;
}
.msg-sent-timer {
  color: var(--text-tertiary);
  font-size: 12px;
}
#msg-sent-countdown {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.msg-form button {
  background: transparent;
  color: var(--link);
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
}
.msg-form button:hover { text-decoration: underline; }
.msg-form button:disabled {
  color: var(--text-tertiary);
  cursor: not-allowed;
  text-decoration: none;
}

@media (max-width: 600px) {
  /* Suppress iOS zoom-on-focus by promoting inputs to 16px. */
  .msg-form input,
  .msg-form textarea {
    font-size: 16px;
  }

  /* Attribution table linearizes into per-track cards. Each row becomes a
     two-line block: title (full-brightness) above, then year · license ·
     source on a small secondary line. No horizontal scroll inside the tray. */
  .attribution-table thead { display: none; }
  .attribution-table,
  .attribution-table tbody,
  .attribution-table tr { display: block; width: 100%; }
  .attribution-table tr {
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
  }
  .attribution-table td {
    border-bottom: 0;
    padding: 0;
  }
  .attribution-table td.col-title {
    display: block;
    font-size: 13px;
    color: var(--text);
  }
  .attribution-table td:not(.col-title) {
    display: inline;
    font-size: 11px;
    color: var(--text-tertiary);
  }
  /* Middot separators only between non-empty cells. The artist row goes on
     its own line right under the title; year/license/source share a footer
     line separated by middots. */
  .attribution-table td:nth-child(2) {  /* artist */
    display: block;
    margin-top: 2px;
  }
  .attribution-table td.col-license::before,
  .attribution-table td.col-source::before { content: " · "; }
  .attribution-table td.col-year:empty,
  .attribution-table td.col-license:empty,
  .attribution-table td.col-source:empty { display: none; }

  #attribution-table-wrap { max-height: 70vh; }

  /* Schedule: shrink tab font a touch so the 7 chips never feel cramped at
     320 px. Day rows are already fluid (1fr name column). */
  .schedule-tabs { font-size: 11px; }
  .schedule-day .row { grid-template-columns: 2ch 8ch 1fr; }
}
