:root {
  --bg: #07111f;
  --panel: rgba(10, 20, 34, 0.72);
  --panel-strong: rgba(13, 28, 48, 0.9);
  --line: rgba(122, 190, 255, 0.18);
  --text: #e6f0ff;
  --muted: #87a1c1;
  --accent: #2fd3ff;
  --accent-strong: #8ef7ff;
  --accent-warm: #7b7dff;
  --shadow: rgba(2, 8, 20, 0.42);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 15%, rgba(47, 211, 255, 0.16), transparent 22%),
    radial-gradient(circle at 85% 10%, rgba(123, 125, 255, 0.18), transparent 20%),
    linear-gradient(145deg, #040914, var(--bg) 45%, #081a30);
}

.page {
  max-width: 1360px;
  margin: 0 auto;
  padding: 32px 20px 56px;
}

.page--demo {
  max-width: 1180px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  position: relative;
  isolation: isolate;
}

.page--demo::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 10%, rgba(57, 229, 190, 0.18), transparent 30%),
    radial-gradient(circle at 80% 18%, rgba(66, 169, 255, 0.18), transparent 30%),
    radial-gradient(circle at 50% 92%, rgba(255, 184, 107, 0.08), transparent 34%),
    linear-gradient(145deg, #03101a 0%, #061b2a 46%, #092235 100%);
}

.hero,
.toolbar,
.provider-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 20px 60px var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  padding: 28px 30px;
  background:
    linear-gradient(135deg, rgba(15, 32, 54, 0.92), rgba(9, 22, 38, 0.76)),
    radial-gradient(circle at top right, rgba(47, 211, 255, 0.18), transparent 26%);
}

.page--demo .hero {
  padding: 34px 38px;
  border-radius: 30px;
  border-color: rgba(145, 244, 222, 0.2);
  background:
    radial-gradient(circle at 12% 18%, rgba(124, 255, 220, 0.22), transparent 28%),
    radial-gradient(circle at 86% 14%, rgba(70, 170, 255, 0.22), transparent 28%),
    linear-gradient(135deg, rgba(7, 43, 54, 0.94), rgba(7, 24, 47, 0.88) 54%, rgba(23, 38, 49, 0.82));
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 700;
}

.hero h1 {
  margin: 0;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 0.96;
}

.hero-copy {
  margin: 14px 0 0;
  max-width: 780px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.page--demo .hero-copy {
  max-width: 620px;
}

.toolbar {
  margin-top: 18px;
  padding: 20px;
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.page--demo .toolbar {
  margin-top: 0;
  padding: 18px;
  border-radius: 28px;
  border-color: rgba(145, 244, 222, 0.16);
  background:
    radial-gradient(circle at 76% 50%, rgba(84, 199, 255, 0.13), transparent 36%),
    linear-gradient(135deg, rgba(7, 36, 46, 0.86), rgba(8, 23, 43, 0.76) 58%, rgba(26, 36, 47, 0.68));
}

.toolbar-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.meta-card {
  min-width: 180px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(142, 247, 255, 0.08);
}

.page--demo .meta-card {
  min-width: 170px;
  border-color: rgba(142, 247, 255, 0.12);
}

.audio-sensor-card {
  min-width: 260px;
}

.meta-label,
.block-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.meta-value {
  font-size: 15px;
}

.audio-sensor {
  --level: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 32px;
}

.audio-sensor-orb {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(230, 240, 255, 0.95) 0 22%, rgba(142, 247, 255, 0.9) 23% 46%, rgba(47, 211, 255, 0.42) 47% 100%);
  transform: scale(calc(0.84 + var(--level) * 0.32));
  box-shadow:
    0 0 0 calc(3px + var(--level) * 8px) rgba(47, 211, 255, calc(0.08 + var(--level) * 0.16)),
    0 0 calc(16px + var(--level) * 24px) rgba(142, 247, 255, calc(0.24 + var(--level) * 0.36));
  transition: transform 80ms ease, box-shadow 80ms ease;
}

.audio-sensor-bars {
  height: 30px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.audio-sensor-bar {
  width: 5px;
  height: 22px;
  border-radius: 999px;
  transform-origin: center;
  background: linear-gradient(180deg, var(--accent-strong), var(--accent));
  opacity: calc(0.38 + var(--level) * 0.62);
  transition: transform 80ms ease, opacity 80ms ease;
}

.audio-sensor-text {
  min-width: 56px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filter-card {
  min-width: 200px;
}

.file-card {
  min-width: 300px;
}

.default-selector-card {
  min-width: 320px;
  max-width: 420px;
}

.default-model-picker {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}

.default-model-chip {
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: none;
}

.default-model-chip--selected {
  color: #04111b;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: transparent;
}

.default-model-chip-label {
  flex: 1;
  min-width: 0;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
}

.default-model-chip-order {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(142, 247, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.default-model-chip--selected .default-model-chip-order {
  border-color: rgba(4, 17, 27, 0.1);
  background: rgba(4, 17, 27, 0.12);
  color: #04111b;
}

.default-model-picker-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.default-model-apply {
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.default-model-apply--ready {
  color: #04111b;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: transparent;
  box-shadow: 0 12px 30px rgba(47, 211, 255, 0.22);
}

.default-model-apply-icon {
  font-size: 22px;
  line-height: 1;
  font-weight: 800;
}

.file-dropzone {
  margin-top: 6px;
  padding: 16px 14px;
  border-radius: 16px;
  border: 1px dashed rgba(142, 247, 255, 0.28);
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}

.file-dropzone--active {
  border-color: var(--accent);
  background: rgba(47, 211, 255, 0.08);
  transform: translateY(-1px);
}

.file-dropzone-title {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.file-dropzone-subtitle {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.file-input-hidden {
  display: none;
}

.file-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.file-picker-button {
  white-space: nowrap;
}

.file-picker-status {
  color: var(--muted);
  font-size: 13px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stacked-control {
  display: block;
  margin-top: 12px;
}

.playback-control-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.playback-toggle {
  padding-inline: 16px;
  white-space: nowrap;
}

.playback-icon-button {
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}

.control-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.playback-mode-button {
  min-width: 152px;
  justify-content: center;
}

.playback-mode-content {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.playback-mode-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.playback-mode-button--muted {
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
}

.playback-mode-button--playalong {
  color: #04111b;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.helper-text {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.notice-bar {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(142, 247, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.language-select {
  width: 100%;
  border: 1px solid rgba(142, 247, 255, 0.18);
  border-radius: 14px;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(5, 14, 25, 0.88);
  font: inherit;
}

.language-select:focus {
  outline: 2px solid rgba(47, 211, 255, 0.22);
  outline-offset: 2px;
}

.mono {
  font-family: "SFMono-Regular", "JetBrains Mono", monospace;
}

.toolbar-actions {
  display: flex;
  gap: 12px;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease;
  box-shadow: 0 12px 30px rgba(47, 211, 255, 0.22);
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.primary-action {
  color: #04111b;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.primary-action--attention {
  box-shadow: 0 0 0 3px rgba(142, 247, 255, 0.24), 0 16px 36px rgba(47, 211, 255, 0.34);
  animation: startPulse 1.2s ease-in-out infinite;
}

.secondary-action {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  border: 1px solid rgba(142, 247, 255, 0.12);
}

.toolbar-notice {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(142, 247, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent-strong);
  font-size: 13px;
  line-height: 1.5;
}

.provider-list,
.provider-grid {
  margin-top: 20px;
  display: grid;
  gap: 18px;
}

.provider-list {
  grid-template-columns: 1fr;
}

.provider-list--focus {
  max-width: 1040px;
  margin-left: auto;
  margin-right: auto;
}

.provider-list--demo {
  width: 100%;
  max-width: none;
  margin-top: 0;
  gap: 14px;
}

.demo-waveform-card {
  width: calc(100% - 64px);
  height: 104px;
  margin: 0 auto 2px;
  padding: 12px 16px;
  border-radius: 24px;
  border: 1px solid rgba(145, 244, 222, 0.2);
  background:
    radial-gradient(circle at 18% 50%, rgba(73, 235, 196, 0.18), transparent 30%),
    radial-gradient(circle at 86% 50%, rgba(92, 179, 255, 0.16), transparent 28%),
    linear-gradient(90deg, rgba(5, 31, 39, 0.92), rgba(8, 30, 55, 0.84) 52%, rgba(26, 43, 54, 0.78));
  box-shadow: inset 0 0 36px rgba(90, 224, 206, 0.08), 0 14px 36px rgba(2, 8, 20, 0.24);
}

.demo-waveform-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.provider-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.provider-grid--four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.provider-card {
  padding: 20px;
  min-height: 360px;
}

.provider-card--focus {
  min-height: 460px;
  padding: 24px;
}

.provider-card--demo {
  min-height: auto;
  padding: 32px;
  border-radius: 30px;
  border-color: rgba(145, 244, 222, 0.18);
  background:
    radial-gradient(circle at 16% 0%, rgba(110, 244, 206, 0.16), transparent 32%),
    radial-gradient(circle at 86% 18%, rgba(83, 178, 255, 0.18), transparent 34%),
    linear-gradient(145deg, rgba(7, 31, 43, 0.96), rgba(6, 18, 36, 0.9) 56%, rgba(21, 34, 45, 0.86));
  box-shadow: 0 24px 70px rgba(2, 8, 20, 0.44), inset 0 1px 0 rgba(230, 255, 249, 0.04);
}

.provider-card--demo .provider-head h2 {
  font-size: clamp(24px, 3.1vw, 36px);
}

.provider-card--demo .provider-detail {
  margin-top: 10px;
  font-size: 13px;
}

.provider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.provider-head h2 {
  margin: 0;
  font-size: 22px;
}

.provider-detail {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.provider-block {
  margin-top: 18px;
}

.text-box {
  height: 236px;
  max-height: 236px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(142, 247, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.7;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(142, 247, 255, 0.45) rgba(255, 255, 255, 0.04);
}

.text-box::-webkit-scrollbar {
  width: 10px;
}

.text-box::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}

.text-box::-webkit-scrollbar-thumb {
  background: rgba(142, 247, 255, 0.4);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.text-box::-webkit-scrollbar-thumb:hover {
  background: rgba(142, 247, 255, 0.6);
  background-clip: padding-box;
}

.transcript-box {
  color: var(--text);
}

.text-box--focus {
  height: 340px;
  max-height: 340px;
  font-size: 16px;
  line-height: 1.8;
}

.text-box--demo {
  height: 175px;
  max-height: 175px;
  padding: 24px 28px;
  border-radius: 24px;
  font-size: 16px;
  line-height: 1.8;
  background:
    radial-gradient(circle at 0% 0%, rgba(112, 245, 211, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(238, 255, 250, 0.07), rgba(78, 159, 176, 0.045));
  border-color: rgba(145, 244, 222, 0.16);
}

.provider-card-empty {
  min-height: 240px;
}

.empty-state {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  border: 1px dashed rgba(142, 247, 255, 0.16);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
  line-height: 1.6;
}

@media (max-width: 1080px) {
  .provider-grid--three,
  .provider-grid--four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .page {
    padding-left: 14px;
    padding-right: 14px;
  }

  .provider-grid--three,
  .provider-grid--four {
    grid-template-columns: 1fr;
  }

  .provider-card {
    min-height: 332px;
  }

  .provider-card--focus {
    min-height: 392px;
  }

  .provider-card--demo {
    min-height: auto;
    padding: 22px;
  }

  .demo-waveform-card {
    width: calc(100% - 44px);
    height: 82px;
    padding: 10px 12px;
    border-radius: 20px;
  }

  .text-box {
    height: 212px;
    max-height: 212px;
  }

  .text-box--focus {
    height: 284px;
    max-height: 284px;
  }

  .text-box--demo {
    height: 150px;
    max-height: 150px;
    padding: 18px;
    font-size: 16px;
    line-height: 1.8;
  }
}

@keyframes startPulse {
  0%, 100% {
    box-shadow: 0 0 0 3px rgba(142, 247, 255, 0.18), 0 14px 34px rgba(47, 211, 255, 0.26);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(142, 247, 255, 0.32), 0 18px 42px rgba(47, 211, 255, 0.38);
  }
}
