:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #162033;
  --muted: #5a6880;
  --line: #dbe2ee;
  --accent: #275df1;
  --accent-soft: #e7efff;
  --ok: #1d8f53;
  --warn: #b15a00;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
}

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

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  background: #0f1726;
  color: white;
  padding: 14px 0;
  margin-bottom: 20px;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.brand {
  color: white;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.site-nav {
  display: flex;
  gap: 14px;
  align-items: center;
}

.site-nav a {
  color: white;
  opacity: 0.92;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 0 4px 18px rgba(20, 32, 58, 0.04);
}

.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: #fbfcff;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: 1fr 1fr;
}

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

.split {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.split.tight {
  align-items: center;
}

.start-form,
.editor-form {
  display: grid;
  gap: 12px;
  min-width: 280px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

input[type="text"],
input[type="number"],
input[type="file"],
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: white;
  color: var(--text);
  font: inherit;
}

textarea {
  resize: vertical;
}

button,
.button-link {
  border: 0;
  background: var(--accent);
  color: white;
  border-radius: 12px;
  padding: 11px 16px;
  font: inherit;
  cursor: pointer;
  transition: transform 0.14s ease, opacity 0.14s ease, box-shadow 0.14s ease;
}

button:hover,
.button-link:hover {
  transform: translateY(-1px);
}

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

button.secondary {
  background: white;
  color: var(--accent);
  border: 1px solid var(--accent);
}

button.ghost {
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
}

.button-link {
  display: inline-block;
}

.actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.actions.wrap {
  flex-wrap: wrap;
}

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

.progress-box {
  min-width: 240px;
}

.progress-bar {
  width: 100%;
  height: 10px;
  background: rgba(39, 93, 241, 0.15);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar > div {
  height: 100%;
  background: var(--accent);
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.excerpt {
  white-space: pre-wrap;
  background: #f5f7fb;
  border: 1px dashed var(--line);
  padding: 12px;
  border-radius: 12px;
}

.feedback {
  white-space: pre-wrap;
  min-height: 120px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.admin-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
}

.admin-sidebar {
  border-right: 1px solid var(--line);
  padding-right: 12px;
  max-height: 78vh;
  overflow: auto;
}

.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.item-button {
  width: 100%;
  background: white;
  color: var(--text);
  border: 1px solid var(--line);
  text-align: left;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.item-button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.item-order {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.item-title {
  flex: 1;
}

.admin-top-actions {
  gap: 24px;
}

.admin-meta-form {
  margin-top: 16px;
}

.admin-stage-block {
  display: grid;
  gap: 16px;
}

.background-tools {
  display: grid;
  gap: 12px;
  align-content: start;
}

.upload-box {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: #fbfcff;
}

.stage-preview-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: #fbfcff;
}

.stage-background-preview {
  display: block;
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #07101f;
}

main.learner-main {
  width: calc(100% - 32px);
  max-width: 100%;
}

body.learner-immersive {
  overflow: auto;
  background: radial-gradient(circle at top, #0b1730 0%, #060b14 58%, #04070d 100%);
  color: #edf4ff;
}

body.learner-immersive .site-header {
  margin-bottom: 12px;
  background: linear-gradient(90deg, rgba(6, 15, 30, 0.96), rgba(9, 25, 51, 0.96));
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  position: sticky;
  top: 0;
  z-index: 20;
}

body.learner-immersive .site-nav a,
body.learner-immersive .brand {
  color: #f8fbff;
}

body.learner-immersive .container {
  width: calc(100% - 32px);
  max-width: 100%;
}

.immersive-shell {
  display: grid;
  gap: 16px;
  padding-bottom: 28px;
}

.immersive-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 18px 20px;
  border: 1px solid rgba(114, 145, 214, 0.18);
  border-radius: 24px;
  background: rgba(8, 16, 31, 0.82);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.topbar-copy {
  min-width: 0;
}

.immersive-topbar .muted,
body.learner-immersive .muted {
  color: #94a9cc;
}

.immersive-seminar-title {
  margin: 6px 0 6px;
  font-size: clamp(28px, 2.6vw, 42px);
  line-height: 1.06;
  letter-spacing: 0.01em;
}

.topbar-description {
  margin: 0;
  max-width: 900px;
}

.immersive-topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.step-badge {
  display: grid;
  gap: 4px;
  place-items: center;
  min-width: 96px;
  padding: 12px 16px;
  border-radius: 18px;
  border: 1px solid rgba(164, 192, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
}

.step-badge-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: #95aee0;
}

.step-badge strong {
  font-size: 28px;
  line-height: 1;
}

.topbar-progress {
  min-width: 260px;
}

.immersive-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 16px;
  align-items: start;
}

.stage-card,
.summary-card,
.interaction-card,
.feedback-card,
.immersive-complete .complete-card {
  background: rgba(8, 16, 31, 0.84);
  border: 1px solid rgba(114, 145, 214, 0.18);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.stage-card {
  border-radius: 28px;
  padding: 20px;
  display: grid;
  gap: 16px;
}

.stage-card-head.clean h2 {
  margin: 4px 0 0;
  font-size: clamp(24px, 2vw, 34px);
  line-height: 1.2;
}

.stage-visual {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  min-height: 360px;
  border-radius: 24px;
  border: 1px solid rgba(136, 164, 226, 0.16);
  background-color: #040913;
  background-image:
    radial-gradient(circle at center top, rgba(33, 56, 109, 0.34), rgba(0, 0, 0, 0.02) 36%),
    linear-gradient(180deg, rgba(5, 9, 18, 0.52), rgba(5, 9, 18, 0.16)),
    var(--stage-bg-image);
  background-position: center;
  background-size: cover;
}

.stage-visual-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(1, 5, 12, 0.14) 0%, rgba(1, 5, 12, 0.08) 46%, rgba(1, 5, 12, 0.36) 100%);
}

.wave-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.stage-visual-labels {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 2;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stage-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  color: #eff6ff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.muted-chip {
  color: #cfe2ff;
  background: rgba(100, 137, 255, 0.12);
}

.subtitle-panel {
  display: grid;
  gap: 10px;
  min-height: 176px;
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid rgba(129, 167, 255, 0.26);
  background: linear-gradient(180deg, rgba(16, 45, 95, 0.92), rgba(8, 25, 56, 0.95));
}

.subtitle-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #a7c4ff;
}

.subtitle-current {
  font-size: clamp(24px, 2.5vw, 38px);
  font-weight: 800;
  line-height: 1.42;
  color: #f8fbff;
}

.subtitle-next {
  min-height: 1.7em;
  font-size: clamp(15px, 1.2vw, 20px);
  line-height: 1.55;
  color: rgba(235, 244, 255, 0.72);
}

.stage-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.media-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

body.learner-immersive button.secondary {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(255, 255, 255, 0.25);
}

body.learner-immersive button.ghost {
  color: #d7e7ff;
  border-color: rgba(154, 186, 255, 0.24);
  background: rgba(255, 255, 255, 0.04);
}

.media-track-wrap {
  flex: 1;
  min-width: 240px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}

#segmentSeek {
  width: 100%;
}

#segmentAudio {
  display: none;
}

.compact-details {
  border-top: 1px solid rgba(137, 163, 219, 0.18);
  padding-top: 8px;
}

.compact-details summary {
  cursor: pointer;
  color: #dce8ff;
}

.compact-excerpt {
  max-height: 160px;
  overflow: auto;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(136, 164, 226, 0.2);
  color: #d6e3fa;
}

.summary-column {
  display: grid;
  gap: 16px;
  align-content: start;
}

.summary-card {
  border-radius: 24px;
  padding: 18px;
}

.summary-card p {
  margin: 0;
  color: #f7fbff;
  line-height: 1.7;
}

.mini-label {
  margin-bottom: 8px;
  color: #9db6e8;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.helper-card p {
  color: #d7e7ff;
}

.engagement-stack {
  display: grid;
  gap: 16px;
}

.interaction-card,
.feedback-card {
  border-radius: 24px;
  padding: 18px;
  display: grid;
  gap: 12px;
}

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

.interaction-head h3,
.feedback-head h3 {
  margin: 0;
}

.compact-actions {
  gap: 10px;
}

body.learner-immersive textarea,
body.learner-immersive input[type="text"],
body.learner-immersive input[type="number"] {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(146, 172, 225, 0.22);
  color: #f5f9ff;
}

body.learner-immersive textarea::placeholder,
body.learner-immersive input::placeholder {
  color: rgba(237, 245, 255, 0.52);
}

.immersive-feedback {
  min-height: 180px;
  max-height: 360px;
  overflow: auto;
  background: rgba(255, 255, 255, 0.04);
  color: #f7fbff;
  border: 1px solid rgba(137, 163, 219, 0.18);
}

.immersive-complete {
  display: grid;
  place-items: center;
  min-height: calc(100dvh - 120px);
  border-radius: 24px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.immersive-complete .complete-card {
  width: min(720px, 100%);
  padding: 28px;
  border-radius: 24px;
  text-align: center;
}

.immersive-complete h1 {
  margin-top: 8px;
  margin-bottom: 14px;
}

.progress-box.wide {
  width: 100%;
}

@media (max-width: 1240px) {
  .immersive-hero-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 980px) {
  .grid.two,
  .grid.three,
  .admin-layout,
  .summary-column {
    grid-template-columns: 1fr;
  }

  .split,
  .immersive-topbar,
  .immersive-topbar-actions,
  .interaction-head,
  .feedback-head,
  .stage-controls,
  .site-header .container {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-sidebar {
    border-right: 0;
    padding-right: 0;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
    max-height: none;
  }

  .media-track-wrap {
    grid-template-columns: 1fr;
  }

  .stage-card,
  .summary-card,
  .interaction-card,
  .feedback-card {
    border-radius: 22px;
  }

  .immersive-seminar-title {
    font-size: 28px;
  }

  .subtitle-current {
    font-size: 24px;
  }
}

@media (max-width: 640px) {
  .container,
  body.learner-immersive .container,
  main.learner-main {
    width: calc(100% - 20px);
  }

  .panel,
  .stage-card,
  .interaction-card,
  .feedback-card,
  .summary-card {
    padding: 16px;
  }

  .stage-visual {
    min-height: 260px;
  }

  .subtitle-panel {
    min-height: 150px;
  }
}


.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.small {
  font-size: 12px;
}

.small-btn {
  padding: 8px 12px;
  border-radius: 10px;
}

.compact-actions {
  margin-top: 8px;
}

.compare-hero h1 {
  margin: 8px 0 10px;
}

.compare-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.summary-chip {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcff;
  padding: 14px 16px;
  display: grid;
  gap: 6px;
}

.summary-chip.danger {
  border-color: rgba(200, 52, 52, 0.26);
  background: rgba(255, 237, 237, 0.92);
}

.summary-chip.warn {
  border-color: rgba(177, 90, 0, 0.28);
  background: rgba(255, 245, 231, 0.98);
}

.summary-chip-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.compare-alert {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(177, 90, 0, 0.28);
  background: rgba(255, 245, 231, 0.98);
}

.compare-alert code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.compare-note {
  margin-top: 10px;
}

.compare-panel {
  padding-top: 10px;
}

.compare-table-wrap {
  overflow: auto;
}

.compare-table {
  width: 100%;
  min-width: 1320px;
  border-collapse: separate;
  border-spacing: 0;
}

.compare-table th,
.compare-table td {
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  padding: 14px 12px;
}

.compare-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fbff;
  text-align: left;
  font-size: 13px;
}

.compare-row-major td {
  background: rgba(255, 239, 239, 0.86);
}

.compare-row-review td {
  background: rgba(255, 248, 236, 0.92);
}

.compare-step-cell {
  width: 120px;
}

.compare-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #0f1726;
  color: white;
  font-weight: 800;
  font-size: 18px;
  margin-bottom: 8px;
}

.compare-title {
  font-weight: 700;
  line-height: 1.45;
}

.compare-ts-cell {
  width: 220px;
}

.compare-audio-cell {
  width: 220px;
}

.compare-audio-cell audio {
  width: 100%;
}

.compare-text-block {
  white-space: pre-wrap;
  line-height: 1.75;
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 12px;
  padding: 12px;
  min-height: 120px;
}

.compare-text-block.alt {
  background: #f7fbff;
}

.compare-details {
  margin-top: 10px;
}

.compare-details summary {
  cursor: pointer;
  color: var(--muted);
}

.compare-anchor {
  margin-top: 6px;
  white-space: pre-wrap;
  line-height: 1.6;
}

.compare-score-cell {
  width: 120px;
}

.score-number {
  font-size: 24px;
}

.score-label {
  margin-top: 8px;
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.score-ok {
  background: rgba(29, 143, 83, 0.12);
  color: var(--ok);
}

.score-review {
  background: rgba(177, 90, 0, 0.12);
  color: var(--warn);
}

.score-major {
  background: rgba(200, 52, 52, 0.12);
  color: #b42318;
}

@media (max-width: 1080px) {
  .compare-summary-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Actual clip comparison view overrides */
.compare-summary-grid-wide {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.compare-table-actual {
  min-width: 1960px;
}

.compare-table-actual .compare-ts-cell {
  width: 240px;
}

.compare-table-actual .compare-audio-cell {
  width: 250px;
}

.compare-table-actual .compare-text-block {
  min-height: 132px;
}

.compare-table-actual .compare-text-block.actual {
  background: #fffdf2;
}

.compare-method-line {
  margin-top: 8px;
}

.compare-method-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  border: 1px solid var(--line);
  background: #f6f8fc;
  color: var(--muted);
}

.compare-method-badge.ok {
  background: rgba(29, 143, 83, 0.12);
  color: var(--ok);
  border-color: rgba(29, 143, 83, 0.25);
}

.compare-method-badge.warn {
  background: rgba(177, 90, 0, 0.12);
  color: var(--warn);
  border-color: rgba(177, 90, 0, 0.28);
}

@media (max-width: 1080px) {
  .compare-summary-grid-wide {
    grid-template-columns: 1fr 1fr;
  }
}

.compare-status-card {
  margin-top: 1rem;
  padding: 1rem 1.2rem;
  border: 1px solid rgba(81, 134, 255, 0.22);
  border-radius: 18px;
  background: rgba(4, 15, 42, 0.68);
}

.compare-status-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.9rem;
}

.compare-status-title {
  font-size: 1.25rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.compare-status-title.state-running {
  color: #8cb4ff;
}

.compare-status-title.state-completed {
  color: #8dffcf;
}

.compare-status-title.state-failed {
  color: #ff9ea7;
}

.compare-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 0.8rem;
}

.compare-progress-bar-wrap {
  margin-bottom: 0.7rem;
}

.compare-progress-bar {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.compare-progress-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #5b7cff 0%, #5ed1ff 100%);
}

.compare-status-message {
  margin: 0.2rem 0 0;
}

.compare-pre {
  margin: 0.5rem 0 0;
  padding: 0.85rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
}

.compare-alert.danger {
  border-color: rgba(255, 110, 131, 0.4);
  background: rgba(255, 110, 131, 0.08);
}

.compare-empty {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
}

.button-link.disabled {
  opacity: 0.55;
  pointer-events: none;
}

@media (max-width: 1100px) {
  .compare-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .compare-status-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .compare-status-grid {
    grid-template-columns: 1fr;
  }
}


/* === OpenAI timestamp audit === */
.compare-method-badge.idle {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.88);
}
.compare-table .mono.small {
  white-space: pre-wrap;
  word-break: break-word;
}
.compare-table audio {
  min-width: 240px;
}
.compare-status-title.state-idle {
  color: rgba(255,255,255,0.92);
}

/* lipsync-poc-start */
.site-nav a[href="/admin/lipsync"] {
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  padding: 6px 12px;
}
.lipsync-hero h1 { margin: 4px 0 8px; }
.mini-label {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 800;
}
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.prewrap { white-space: pre-wrap; }
.actions.wrap { flex-wrap: wrap; }
.button-link.compact { padding: 7px 10px; font-size: 13px; }
.warning-panel { border-color: #ffd38a; background: #fff8e8; }
.warning-panel.danger { border-color: #ffb3b3; background: #fff1f1; }
.warning-panel pre { white-space: pre-wrap; }
.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
  background: #eef3ff;
  color: #274273;
}
.status-pill.ok, .status-succeeded, .status-review_ok { background: #e6f8ed; color: #11613a; }
.status-pill.danger, .status-failed, .status-review_ng { background: #ffefef; color: #9e1b1b; }
.status-submitted, .status-processing { background: #fff7d6; color: #895900; }
.status-ready_to_submit { background: #e7efff; color: #1c4fd1; }
.table-wrap { overflow-x: auto; }
.lipsync-table { width: 100%; border-collapse: collapse; }
.lipsync-table th, .lipsync-table td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.lipsync-table th { font-size: 12px; color: var(--muted); }
.lipsync-stat-grid { margin-bottom: 18px; }
.lipsync-form h2 { margin-top: 20px; }
.consent-box { border: 1px solid var(--line); border-radius: 14px; background: #fbfcff; padding: 16px; line-height: 1.8; }
.check-row { display: flex; grid-template-columns: none; flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 600; }
.check-row input { margin-top: 5px; }
.is-hidden { display: none !important; }
.lipsync-preview-grid video { width: 100%; max-height: 330px; background: #111827; border-radius: 12px; }
.lipsync-preview-grid audio { width: 100%; }
.media-card h3 { margin-top: 0; }
.lipsync-dl { display: grid; grid-template-columns: 130px 1fr; gap: 10px 14px; }
.lipsync-dl dt { color: var(--muted); font-weight: 800; }
.lipsync-dl dd { margin: 0; min-width: 0; word-break: break-word; }
.grid.four { grid-template-columns: repeat(4, 1fr); }
.log-list { display: grid; gap: 10px; }
.log-row { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fbfcff; }
.log-row pre { white-space: pre-wrap; margin: 6px 0 0; color: var(--muted); }
button.danger { background: #bd1e1e; }
@media (max-width: 980px) {
  .grid.three, .grid.four, .grid.two { grid-template-columns: 1fr; }
  .split { flex-direction: column; }
}
/* lipsync-poc-end */

/* lipsync-fal-key-ui-start */
.fal-key-panel {
  border-color: rgba(37, 99, 235, .22);
  background: linear-gradient(180deg, rgba(37, 99, 235, .05), rgba(255, 255, 255, .96));
}
.fal-key-form {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}
.fal-key-form input[type="password"] {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .02em;
}
.notice {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, .35);
  background: #f8fafc;
  font-weight: 700;
}
.notice.ok {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}
.notice.warn {
  background: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}
.notice.danger {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}
/* lipsync-fal-key-ui-end */
/* lipsync-duration-ui-start */
.lipsync-duration-grid { align-items: stretch; margin-top: 16px; }
.soft-estimate strong { display: block; font-size: 24px; margin-top: 6px; }
.lipsync-form select[name="requested_max_seconds"] { font-size: 18px; font-weight: 800; }
/* lipsync-duration-ui-end */
