/* Design system for the pilot web app's four screens (ADR-0031): the dark-only
   "Midnight Broadcast" look (issue #212), JetBrains Mono for headings and labels, Geist
   for body text. Reference mockups: docs/design/midnight-broadcast/. No build step. */

/* Self-hosted, no request leaves for Google Fonts (issue #207): Latin subsets of the
   official releases' variable fonts. */
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/geist-latin.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --page-bg: #0E1117;
  --bg: #0E1117;
  --surface: #1E222A;
  --surface-2: #262B35;
  --surface-3: #151920;
  --text: #FFFFFF;
  --text-muted: #94A3B8;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --accent: #00F090;
  --accent-fg: #0E1117;
  --accent-soft: rgba(0, 240, 144, 0.12);
  --accent-line: rgba(0, 240, 144, 0.30);
  --accent-glow: rgba(0, 240, 144, 0.45);
  --accent-text: #00F090;
  --tooltip-bg: #FFFFFF;
  --tooltip-fg: #0E1117;
  --danger: #FF7A7A;
  --danger-soft: rgba(255, 122, 122, 0.12);
  --danger-line: rgba(255, 122, 122, 0.45);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-md: 10px;
  --shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.9);
  --font: "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

/* The UA stylesheet's [hidden] rule doesn't reliably extend to <svg> (an
   SVGElement, not an HTMLElement) -- app.js toggles play/pause icons via this
   attribute, so without this both icons render at once instead of one. */
svg[hidden] {
  display: none;
}

html,
body {
  margin: 0;
}

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  background: var(--page-bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-text);
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.display {
  font-family: var(--font-mono);
}

h1,
h2 {
  margin: 0 0 1rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* Top bar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.brand-mark {
  width: 24px;
  height: 21px;
  color: var(--accent);
  flex: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  font-family: var(--font-mono);
  line-height: 1;
}

.brand-text b {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-text span {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.42em;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Page container + generic elements */

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.page-title {
  font-size: 21px;
}

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

.label {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

/* The second declaration hides the prefix from screen readers; older browsers drop it
   and keep the first. */
.label::before {
  content: "// ";
  content: "// " / "";
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.footer-copy {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 2rem 0 0;
}

/* Waveform: episode thumbnails, host tiles, miniplayer */

.wave {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 16px;
  flex: none;
}

.wave i {
  display: block;
  width: 3px;
  height: 100%;
  border-radius: 2px;
  background: var(--text-muted);
  opacity: 0.45;
  transform: scaleY(var(--h));
  /* Same 200ms as the tile and avatar, so a speaker swap fades rather than snapping. */
  transition: background 0.2s ease, opacity 0.2s ease;
}

.wave.is-on i,
.episode-row.is-current .wave i {
  background: var(--accent);
  opacity: 1;
}

.wave.is-playing i,
.episode-row.is-playing .wave i {
  animation: eq 0.9s ease-in-out infinite alternate;
}

.wave i:nth-child(2) {
  animation-delay: -0.6s;
}

.wave i:nth-child(3) {
  animation-delay: -0.4s;
}

.wave i:nth-child(4) {
  animation-delay: -0.1s;
}

.wave i:nth-child(5) {
  animation-delay: -0.5s;
}

@keyframes eq {
  from {
    transform: scaleY(calc(var(--h) * 0.35));
  }
  to {
    transform: scaleY(1);
  }
}

/* Breadcrumb (player / settings sub-header) */

.breadcrumb {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 1.25rem;
}

.breadcrumb-back {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.breadcrumb-back:hover {
  color: var(--text);
}

.breadcrumb-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 0 rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.icon-btn:hover,
a:hover > .icon-btn {
  border-color: rgba(255, 255, 255, 0.3);
}

.icon-btn:active,
a:active > .icon-btn {
  transform: translateY(1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* Auth screens (login / login_sent / login_invalid) */

body.auth {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

body.auth .container {
  width: 100%;
  max-width: 420px;
  padding: 0;
}

.auth-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem 2rem;
}

.auth-card .brand {
  margin-bottom: 88px;
}

.auth-card h1 {
  font-size: 28px;
  margin-bottom: 10px;
}

.auth-card.centered h1 {
  font-size: 24px;
  margin-top: 1.5rem;
}

.auth-subtitle {
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0 0 2rem;
}

.auth-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid rgba(0, 240, 144, 0.35);
  color: var(--accent);
  box-shadow: 0 0 30px -6px var(--accent-glow);
  margin: 0 auto;
}

.auth-icon svg {
  width: 30px;
  height: 30px;
}

.auth-icon-warn {
  background: rgba(255, 122, 122, 0.12);
  border-color: rgba(255, 122, 122, 0.35);
  color: var(--danger);
  box-shadow: none;
}

.auth-card.centered {
  text-align: center;
}

.auth-email-box {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  margin: 0 0 14px;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.auth-ttl {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.auth-ttl svg {
  width: 14px;
  height: 14px;
}

.auth-resend {
  display: inline-block;
  margin: 14px 0 10px;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.auth-resend::before {
  content: "[ ";
  content: "[ " / "";
}

.auth-resend::after {
  content: " ]";
  content: " ]" / "";
}

.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-card label {
  margin: 0;
}

.auth-card input {
  height: 50px;
  padding: 0 14px;
  font-family: var(--font-mono);
  font-size: 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  width: 100%;
}

.auth-card input::placeholder {
  color: #6B7688;
}

.auth-card input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.button,
button.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-fg);
  box-shadow: 0 0 0 1px rgba(0, 240, 144, 0.4), 0 8px 28px -10px var(--accent-glow);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0 1.1rem;
  cursor: pointer;
  width: 100%;
}

.button:hover,
button.primary:hover {
  box-shadow: 0 0 0 1px var(--accent), 0 10px 36px -8px var(--accent-glow);
}

.button:active,
button.primary:active {
  transform: translateY(1px);
}

.button:focus-visible,
button.primary:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.auth-card button {
  margin-top: 6px;
}

.auth-footnote {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin: 1.5rem 0 0;
}

/* On a phone the auth screen is the page itself, not a card on it. */
@media (max-width: 480px) {
  body.auth-login {
    justify-content: flex-start;
  }

  .auth-card {
    background: none;
    border: 0;
    box-shadow: none;
    padding: 0.5rem 0;
  }
}

/* Episode list */

.empty-state {
  color: var(--text-muted);
  padding: 2rem 0;
}

.show-card {
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  margin: 0;
}

.show-card + .show-card {
  border-top: 1px solid var(--border);
  margin-top: 14px;
  padding-top: 22px;
}

.show-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.show-card-header h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.show-description {
  margin: 3px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-muted);
}

.episode-list {
  list-style: none;
  margin: 4px -10px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.episode-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  color: var(--text);
}

.episode-row:hover,
.episode-row.is-current {
  background: var(--surface);
}

.episode-row.is-current {
  border-color: var(--accent-line);
}

.episode-thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.episode-row.is-current .episode-thumb {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.episode-row-text {
  flex: 1;
  min-width: 0;
}

.episode-date {
  display: flex;
  gap: 8px;
  margin: 0 0 2px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.episode-playing {
  display: none;
  color: var(--accent);
}

.episode-playing::before {
  content: "\25CF  ";
  content: "\25CF  " / "";
}

.episode-row.is-playing .episode-playing {
  display: inline;
}

.episode-title {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Player */

.player-title {
  font-size: 21px;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
}

.hosts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 1.25rem;
}

.host {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s ease;
}

.host.is-active {
  border-color: var(--accent-line);
}

/* Only dim the other host while one is actually speaking: an episode with no line times
   (rendered before #213) keeps both tiles at full strength. */
.hosts:has(.is-active) .host:not(.is-active) .host-avatar {
  opacity: 0.5;
}

.host.is-active .host-avatar {
  border-color: var(--accent);
  box-shadow: 0 0 14px var(--accent-glow);
}

.host-avatar,
.voice-avatar {
  transition: opacity 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  background: var(--surface-2);
  border: 3px solid var(--border-strong);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
}

.host-info {
  min-width: 0;
}

.host-name {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  min-width: 0;
  /* The bars are decoration: clip them rather than let them spill out of the tile. */
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.host-role,
.voice-role {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  box-shadow: none;
  margin-bottom: 1.75rem;
}

.big-ruler {
  height: 5px;
  background: repeating-linear-gradient(90deg, var(--border-strong) 0 1px, transparent 1px 5%);
}

.big-progress {
  height: 6px;
  border-radius: 3px;
  background: var(--surface-2);
  position: relative;
  cursor: pointer;
}

/* A 6px bar is a hard target on a phone; this widens the clickable area only. */
.big-progress::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -9px;
  bottom: -9px;
}

.big-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(0, 240, 144, 0.5);
}

.big-progress-thumb {
  position: absolute;
  left: 0%;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 0 4px rgba(0, 240, 144, 0.25);
}

.big-time {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.big-time-current {
  color: var(--text);
}

.big-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.big-skip {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 0 rgba(0, 0, 0, 0.4);
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.big-skip:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.big-skip:active {
  transform: translateY(1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.big-skip svg {
  width: 20px;
  height: 20px;
}

.big-play {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: var(--accent-fg);
  box-shadow: 0 0 0 6px var(--accent-soft), 0 8px 24px -6px var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.big-play:focus-visible,
.miniplayer-toggle:focus-visible {
  outline-color: var(--text);
  outline-offset: 8px;
}

.big-play svg {
  width: 24px;
  height: 24px;
}

/* Miniplayer -- persists across soft navigation (app.js), stays out of
   #main-content so it's never touched when a page swap happens. */

.miniplayer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 16px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.miniplayer[hidden] {
  display: none;
}

body.has-miniplayer .container {
  padding-bottom: 88px;
}

.miniplayer-progress {
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 3px;
  background: var(--surface-2);
}

.miniplayer-progress > div {
  height: 100%;
  width: 0%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

.miniplayer-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: var(--accent-fg);
  box-shadow: 0 0 0 4px var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  padding: 0;
}

.miniplayer-toggle svg {
  width: 16px;
  height: 16px;
}

.miniplayer-info {
  flex: 1;
  min-width: 0;
}

.miniplayer-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.miniplayer-show {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.miniplayer-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.story-list {
  list-style: none;
  margin: 0 0 1.75rem;
  padding: 0;
}

.story-list li + li a {
  border-top: 1px solid var(--border);
}

.story-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  color: var(--text);
}

.story-title {
  font-size: 14px;
}

.story-source {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  max-width: 45%;
  padding: 4px 9px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-family: var(--font-mono);
  /* 11px, not the 10.5px of the other meta text: on hover this turns green on --accent-soft,
     which #212 forbids below 11px. */
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.story-source-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.story-source::before {
  content: "[";
  content: "[" / "";
}

.story-source::after {
  content: "]";
  content: "]" / "";
}

.story-list a:hover .story-source {
  color: var(--accent);
  border-color: rgba(0, 240, 144, 0.5);
  background: var(--accent-soft);
}

.story-source svg {
  width: 11px;
  height: 11px;
  flex: none;
}

.transcript {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 14px;
}

.transcript summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  list-style: none;
}

.transcript summary::-webkit-details-marker {
  display: none;
}

.transcript summary .chevron {
  width: 14px;
  height: 14px;
  transition: transform 0.15s ease;
}

.transcript[open] summary .chevron {
  transform: rotate(180deg);
}

.transcript-body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  margin: 1rem 0 0;
  max-height: 22rem;
  overflow-y: auto;
}

.transcript-line {
  margin: 0;
}

.transcript-new-topic {
  margin-top: 1em;
}

.transcript-speaker {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

/* Show settings */

.settings-title {
  font-size: 23px;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.settings-description {
  font-size: 13px;
  margin: 0 0 1.75rem;
}

.settings-card + .settings-card {
  margin-top: 1.625rem;
}

.inert {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  /* Not overflow:hidden -- a single-row .inert (Frequency, each voice card) has no
     room above its own row to render the hover tooltip in, so it'd always clip
     itself; a multi-row one (Topics) only clipped its first row's tooltip, which
     read as "tooltip works" without ever really being tested on a lone row. */
}

.inert-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  font-size: 14px;
  position: relative;
}

.inert-row + .inert-row {
  border-top: 1px solid var(--border);
}

.inert-row.frequency {
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  border-radius: var(--radius-md);
  box-shadow: 0 0 0 2px var(--accent);
}

.inert-row svg {
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.inert-row[tabindex],
.voice-card[tabindex] {
  cursor: default;
}

.inert-row .tooltip,
.voice-card .tooltip {
  position: absolute;
  left: 12px;
  bottom: calc(100% + 8px);
  background: var(--tooltip-bg);
  color: var(--tooltip-fg);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: none;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.inert-row .tooltip::after,
.voice-card .tooltip::after {
  content: "";
  position: absolute;
  left: 16px;
  top: 100%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  background: var(--tooltip-bg);
  transform: rotate(45deg);
}

.inert-row:hover .tooltip,
.inert-row:focus-within .tooltip,
.voice-card:hover .tooltip,
.voice-card:focus-within .tooltip {
  opacity: 1;
  transform: translateY(0);
}

.voices-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.voice-card {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 10px;
  text-align: center;
}

.voice-lock {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 15px;
  height: 15px;
  color: var(--text-muted);
}

.voice-name {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
}

.voice-role {
  white-space: normal;
  line-height: 1.5;
}

/* Show-request screens (issue #224): the code gate and the nine-question form. */
.code-input {
  font-family: var(--font-mono);
  letter-spacing: 0.18em;
  height: 50px;
  padding: 0 14px;
  font-size: 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  width: 100%;
}

.code-input::placeholder {
  color: #6B7688;
  letter-spacing: normal;
}

.code-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.input.bad,
.area.bad,
.code-input.bad {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}

.field-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  font-size: 13.5px;
  color: var(--danger);
}

.warn-icon {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

.form-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto 8px;
}

.form-head .display {
  margin: 0;
}

.form-head .auth-subtitle {
  text-align: left;
  margin: 0;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.pill {
  padding: 5px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.request-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 720px;
  margin: 0 auto;
}

/* Off-screen rather than display:none: some bots skip hidden fields, and a real visitor
   never reaches it -- tabindex -1 keeps it out of the keyboard order. */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.sec-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 0 6px;
}

.sec-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.sec-top h2 {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

.sec-top span {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.bar {
  display: flex;
  gap: 4px;
}

.bar i {
  display: block;
  height: 3px;
  flex: 1;
  border-radius: 2px;
  background: var(--surface-2);
}

.bar i.on {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

.q {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.q.flagged {
  border-color: var(--danger-line);
}

.q-top {
  display: flex;
  gap: 12px;
  align-items: baseline;
}

.q-num {
  flex: none;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.q.flagged .q-num {
  color: var(--danger);
}

.q-label {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}

.q-help {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}

.example {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent-line);
  border-radius: var(--radius-sm);
}

.example b {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.example p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-muted);
}

.example p span {
  color: var(--text);
}

.q .input,
.area {
  width: 100%;
  padding: 14px;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.q .input::placeholder,
.area::placeholder {
  color: #6B7688;
}

.q .input:focus,
.area:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.area {
  resize: vertical;
}

.choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.opt-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.opt-box:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent);
}

.opt-box:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.opt-box input {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
}

.skip-note {
  margin: 0;
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--text-muted);
  background: var(--surface-3);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
}

.skip-note b {
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 500;
}

.summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  background: var(--danger-soft);
  border: 1px solid var(--danger-line);
  border-radius: var(--radius-md);
}

.summary h2 {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--danger);
}

.summary ul {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
}

.summary a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.summary p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-muted);
}

.submit-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 10px;
}

.submit-wrap .auth-footnote {
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
