html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.22), transparent 34rem),
    linear-gradient(135deg, #020617 0%, #0f172a 50%, #111827 100%);
  color: #e2e8f0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 36px 16px 56px;
}

.panel {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.78);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(16px);
}

.hero {
  padding: 30px;
}

.hero-grid,
.grid,
.captions {
  display: grid;
  gap: 18px;
}

.hero-grid {
  grid-template-columns: 1fr minmax(220px, 320px);
  align-items: start;
}

.grid {
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.2fr);
  margin-top: 18px;
}

.captions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #38bdf8;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 14px;
  font-size: clamp(2.2rem, 5vw, 4.9rem);
  line-height: 0.94;
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 16px;
  color: #cbd5e1;
  font-size: 0.86rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.muted,
.hint {
  color: #94a3b8;
  line-height: 1.55;
}

.muted {
  max-width: 720px;
  margin-bottom: 0;
  font-size: 1.05rem;
}

.hint {
  margin: 12px 0 0;
  font-size: 0.92rem;
}

.status-card {
  display: grid;
  gap: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(15, 23, 42, 0.74);
  color: #cbd5e1;
  font-size: 0.86rem;
  font-weight: 800;
}

.badge.ok {
  border-color: rgba(34, 197, 94, 0.42);
  color: #bbf7d0;
}

.badge.warn {
  border-color: rgba(251, 191, 36, 0.42);
  color: #fde68a;
}

.controls-panel,
.preview-panel,
.caption-card {
  padding: 24px;
}

label {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  color: #cbd5e1;
  font-size: 0.9rem;
  font-weight: 800;
}

input,
select {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(2, 6, 23, 0.72);
  color: #f8fafc;
  font: inherit;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 12px;
}

.toggle-label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  grid-column: 1 / -1;
}

input[type="checkbox"] {
  width: auto;
  padding: 0;
  border-radius: 4px;
  cursor: pointer;
}

input[readonly] {
  color: #bae6fd;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
}

input:focus {
  border-color: #38bdf8;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  background: #38bdf8;
  color: #082f49;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.secondary button {
  background: rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
}

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

pre {
  min-height: 72px;
  margin: 18px 0 0;
  white-space: pre-wrap;
  color: #cbd5e1;
}

video {
  display: block;
  width: 100%;
  min-height: 280px;
  border-radius: 18px;
  background: #020617;
  object-fit: contain;
}

#partial,
#translation {
  min-height: 5.8rem;
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.6rem);
  font-weight: 780;
  line-height: 1.18;
}

#partial {
  color: #bae6fd;
}

#translation {
  color: #f8fafc;
}

@media (max-width: 860px) {
  .hero-grid,
  .grid,
  .captions {
    grid-template-columns: 1fr;
  }
}
