:root {
  color-scheme: dark;
  font-family: Inter, Pretendard, "Noto Sans KR", system-ui, sans-serif;
  background: #07111f;
  color: #eff7ff;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top, #102744 0, #07111f 42rem); }
button, select, input { font: inherit; }
button, select, input, .panel { border: 1px solid #294767; }
button, select, input { border-radius: 0.65rem; }
button { cursor: pointer; font-weight: 700; }
button:disabled { cursor: not-allowed; opacity: 0.45; }

.shell { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; padding: 2rem 0 4rem; }
.page-header, .viewer-header, .section-heading, .action-row, .viewer-status { display: flex; align-items: center; gap: 1rem; }
.page-header, .viewer-header { justify-content: space-between; border-bottom: 1px solid #294767; padding-bottom: 1.5rem; margin-bottom: 1.5rem; }
.eyebrow { color: #68c8ff; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.12em; margin: 0 0 0.45rem; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(1.8rem, 4vw, 2.65rem); margin-bottom: 0.5rem; }
h2 { font-size: 1.05rem; margin-bottom: 0; }
.description, .hint { color: #9db6cf; line-height: 1.6; margin-bottom: 0; }
.secondary-link { color: #dff4ff; text-decoration: none; border: 1px solid #3f6e96; padding: 0.75rem 1rem; border-radius: 0.65rem; white-space: nowrap; }
.panel { background: rgba(14, 31, 52, 0.92); border-radius: 1rem; padding: 1.25rem; margin-top: 1rem; box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.15); }
.participant-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1.5rem; }
.participant-entry-url { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.8rem; }
.participant-entry-url input { flex: 1 1 16rem; min-width: 0; padding: 0.7rem; color: #eff7ff; background: #09192b; }
.participant-entry-url button { flex: 0 0 auto; }
.participant-qr { width: min(240px, 100%); height: auto; aspect-ratio: 1; background: #fff; border: 8px solid #fff; border-radius: 0.65rem; }
.section-heading { justify-content: space-between; margin-bottom: 1rem; }
.badge, .status-dot { border-radius: 999px; background: #173552; color: #bde8ff; padding: 0.35rem 0.7rem; font-size: 0.82rem; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.field { display: grid; gap: 0.45rem; color: #b4c9dd; font-size: 0.85rem; }
.field-wide { grid-column: 1 / -1; }
select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  color: #eff7ff;
  background-color: #09192b;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23bde8ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 1.75rem center;
  background-repeat: no-repeat;
  background-size: 0.75rem 0.5rem;
  padding: 0.78rem 4rem 0.78rem 0.9rem;
}
select:disabled { color: #8298ad; background-color: #0b1c2f; }
.primary, .secondary, .danger { padding: 0.72rem 1rem; color: #06111e; }
.primary { background: #64c8ff; border-color: #64c8ff; }
.secondary { background: #d8ecff; border-color: #d8ecff; align-self: end; }
.permission-button { width: 100%; min-height: 3rem; }
.multilingual-targets { min-width: 0; margin: 0; border: 1px solid #294767; border-radius: 0.8rem; padding: 0.85rem 1rem; color: #b4c9dd; }
.multilingual-targets legend { padding: 0 0.3rem; font-size: 0.85rem; font-weight: 700; }
.multilingual-target-options { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.5rem; }
.multilingual-target-options label { display: inline-flex; align-items: center; gap: 0.5rem; border: 1px solid #3f6e96; border-radius: 0.65rem; padding: 0.6rem 0.9rem; color: #eff7ff; cursor: pointer; }
.multilingual-target-options input { accent-color: #64c8ff; width: 1rem; height: 1rem; margin: 0; }
.multilingual-targets small, .multilingual-health { color: #9db6cf; line-height: 1.5; }
.multilingual-health { margin: 1rem 0 0; }
.danger { background: #ff7c8c; border-color: #ff7c8c; }
.action-row { margin-top: 1.2rem; flex-wrap: wrap; }
.status { color: #b8cee2; margin: 0; }
.status[data-error="true"] { color: #ffb1ba; }
.meter-track { height: 0.75rem; overflow: hidden; border-radius: 999px; background: #06101d; }
.meter-fill { width: 0; height: 100%; background: linear-gradient(90deg, #3ed6a4 0 72%, #ffd166 86%, #ff6678 100%); transition: width 90ms linear; }
.input-status-layout { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); align-items: start; gap: 1rem; }
.status-group { min-width: 0; border: 1px solid #294767; border-radius: 0.8rem; background: rgba(5, 18, 33, 0.72); padding: 1rem; }
.status-group-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.status-kicker { color: #68c8ff; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; margin-bottom: 0.25rem; }
.status-group h3 { font-size: 1rem; margin: 0; }
.status-group-note { color: #8faac3; font-size: 0.76rem; white-space: nowrap; }
.level-readouts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; margin-top: 0.85rem; }
.level-readout { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; border-radius: 0.6rem; background: #0b1d31; padding: 0.7rem 0.8rem; }
.level-readout span { color: #7dbfea; font-size: 0.78rem; font-weight: 700; }
.level-readout strong { color: #eff7ff; font-size: 1.25rem; }
.diagnostic-list { margin: 0; }
.diagnostic-list > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 1rem; padding: 0.62rem 0; border-bottom: 1px solid rgba(41, 71, 103, 0.72); }
.diagnostic-list > div:first-child { padding-top: 0; }
.diagnostic-list > div:last-child { border-bottom: 0; padding-bottom: 0; }
.diagnostic-list dt { color: #91abc4; font-size: 0.8rem; }
.diagnostic-list dd { color: #eff7ff; font-size: 0.9rem; font-weight: 700; margin: 0; text-align: right; overflow-wrap: anywhere; }
.status-group-description { color: #829db7; font-size: 0.78rem; line-height: 1.5; margin: 0.9rem 0 0; }
.partial-box { background: #061222; border-radius: 0.8rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; }
.caption-copy { display: grid; gap: 0.35rem; }
.partial-box .caption-copy { align-content: start; min-width: 0; min-height: 7rem; padding: 1rem 1.1rem; }
.partial-box .caption-translation-copy { border-left: 1px solid rgba(61, 112, 153, 0.55); }
.caption-stack .caption-copy + .caption-translation-copy { border-top: 1px solid rgba(61, 112, 153, 0.45); padding-top: 0.85rem; }
.caption-label { color: #7dbfea; font-size: 0.78rem; font-weight: 750; letter-spacing: 0.04em; }
.caption-copy p { line-height: 1.5; margin: 0; }
.source-caption { color: #abc2d8; font-size: 1rem; }
.translated-caption { color: #f4faff; font-size: 1.35rem; font-weight: 700; }
.partial-box .source-caption, .partial-box .translated-caption { color: #eff7ff; font-size: 1.08rem; font-weight: 600; line-height: 1.55; }
.final-list, .viewer-final-list { display: grid; gap: 0.55rem; padding: 0; margin: 1rem 0 0; list-style: none; }
.final-list li, .viewer-final-list li { border-left: 3px solid #3e86ba; background: rgba(8, 22, 38, 0.72); padding: 0.8rem 1rem; line-height: 1.5; }
.final-list .caption-pair, .viewer-final-list .caption-pair { display: grid; gap: 0.75rem; }
.final-list .caption-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.final-list .source-caption, .final-list .translated-caption { color: #eff7ff; font-size: 1rem; font-weight: 600; line-height: 1.5; }
.viewer-final-list .translated-caption { font-size: 1.12rem; }

.viewer-body { display: grid; place-items: center; }
.viewer-shell { width: min(1160px, calc(100% - 2rem)); min-height: 100vh; padding: 2rem 0 4rem; display: flex; flex-direction: column; }
.viewer-links { display: flex; align-items: center; gap: 0.65rem; }
.media-panel { background: rgba(14, 31, 52, 0.92); border: 1px solid #294767; border-radius: 1rem; padding: 1.25rem; margin-bottom: 1rem; }
.media-heading, .media-controls { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.media-heading { margin-bottom: 1rem; }
.media-heading .eyebrow { margin-bottom: 0.25rem; }
.media-retry { align-self: center; }
.program-stage { position: relative; display: grid; place-items: center; overflow: hidden; aspect-ratio: 16 / 9; border-radius: 0.8rem; background: #020812; }
.program-stage video { width: 100%; height: 100%; object-fit: contain; background: #020812; }
.media-message { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 2rem; color: #b8cee2; text-align: center; background: rgba(2, 8, 18, 0.78); }
.media-message[hidden] { display: none; }
.media-controls { margin-top: 1rem; }
.caption-delay-control { flex: 1; display: grid; grid-template-columns: auto minmax(10rem, 1fr) 3.2rem; align-items: center; gap: 0.75rem; color: #b4c9dd; font-size: 0.85rem; }
.caption-delay-control input { width: 100%; accent-color: #64c8ff; }
.caption-delay-control output { color: #eff7ff; font-variant-numeric: tabular-nums; text-align: right; }
.media-hint { color: #829db7; font-size: 0.78rem; line-height: 1.5; margin: 0.85rem 0 0; }
.live-caption { min-height: 11rem; display: grid; place-items: center; text-align: center; background: rgba(5, 18, 33, 0.85); border: 1px solid #294767; border-radius: 1rem; padding: 2rem; }
.caption-stack { width: 100%; display: grid; gap: 1.35rem; }
.live-caption .source-caption { max-height: 3em; overflow-y: hidden; font-size: clamp(1rem, 2.5vw, 1.8rem); }
.live-caption .translated-caption { max-height: 4.05em; overflow-y: hidden; font-size: clamp(1.8rem, 5vw, 4.2rem); line-height: 1.35; font-weight: 750; text-wrap: balance; }
.viewer-final-list { margin-top: 1.5rem; }
.viewer-final-list li { opacity: 0.86; }
.viewer-final-list .source-caption { font-size: clamp(0.9rem, 1.8vw, 1.15rem); }
.viewer-final-list .translated-caption { font-size: clamp(1.05rem, 2.4vw, 1.65rem); }
.viewer-notice { color: #ffcf77; text-align: center; margin-top: 1rem; }
.status-dot[data-state="connected"] { background: #144c3e; color: #8ef0c7; }
.status-dot[data-state="disconnected"], .status-dot[data-state="failed"] { background: #5a2931; color: #ffb1ba; }
.status-dot[data-state="retrying"] { background: #5b451b; color: #ffda8a; }
.status-dot[data-state="unavailable"] { background: #303c49; color: #bdc9d4; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.overlay-body { place-items: start center; background: #020812; }
.overlay-shell { width: min(1600px, 100%); min-height: 100vh; padding: 1rem; }
.overlay-header { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.overlay-header h1 { font-size: clamp(1.35rem, 2.5vw, 2rem); margin-bottom: 0; }
.overlay-header .eyebrow { margin-bottom: 0.25rem; }
.overlay-media-panel { width: 100%; }
.overlay-program-stage { min-height: min(78vh, 900px); aspect-ratio: 16 / 9; border: 1px solid #294767; border-radius: 1rem; }
.overlay-program-stage::after {
  content: "";
  position: absolute;
  inset: 48% 0 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(1, 6, 14, 0.3) 35%, rgba(1, 6, 14, 0.88));
}
.video-caption-overlay {
  position: absolute;
  z-index: 2;
  left: clamp(1rem, 4vw, 4rem);
  right: clamp(1rem, 4vw, 4rem);
  bottom: clamp(1.25rem, 4vh, 3rem);
  display: grid;
  align-content: end;
  gap: clamp(0.4rem, 1vh, 0.7rem);
  min-width: 0;
  max-height: 62%;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95), 0 0 2px #000;
}
.video-caption-overlay .caption-copy { min-width: 0; justify-items: center; }
.video-caption-overlay .caption-label { color: #a9dfff; text-shadow: 0 1px 4px #000; }
.video-caption-overlay .source-caption {
  max-width: 90%;
  color: #e1edf7;
  font-size: clamp(0.95rem, 1.65vw, 1.65rem);
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.video-caption-overlay .translated-caption {
  max-width: 100%;
  color: #fff;
  font-size: clamp(1.3rem, 2.6vw, 2.75rem);
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.overlay-notice { position: absolute; z-index: 3; top: 1rem; left: 50%; transform: translateX(-50%); max-width: calc(100% - 2rem); margin: 0; padding: 0.55rem 0.85rem; border-radius: 999px; background: rgba(44, 31, 7, 0.82); }
.overlay-notice:empty { display: none; }
.overlay-controls { margin: 1rem 0 0; }
.overlay-final-buffer { display: none; }

.caption-chat-body { overflow: hidden; }
.caption-select-body { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.caption-select-shell { width: min(34rem, 100%); border: 1px solid #294767; border-radius: 1rem; padding: clamp(1.25rem, 5vw, 2.5rem); background: #10243a; box-shadow: 0 1.25rem 4rem #06101dcc; }
.caption-select-shell h1 { margin: 0.35rem 0 0.6rem; }
.caption-select-shell .description { color: #b4c9dd; line-height: 1.6; }
.caption-select-form { display: grid; gap: 1rem; margin-top: 1.75rem; }
.caption-select-form select { width: 100%; }
.caption-select-form button { min-height: 3rem; }
.caption-select-form button:disabled { cursor: not-allowed; opacity: 0.55; }
.caption-select-status { min-height: 1.5em; margin: 1rem 0 0; color: #9db6cf; line-height: 1.5; }
.room-select-body { min-height: 100vh; padding: clamp(1.25rem, 5vw, 4rem) 1.25rem; }
.room-select-shell { width: min(56rem, 100%); margin: 0 auto; }
.room-select-header { margin-bottom: 2rem; }
.room-select-header .eyebrow { margin-bottom: 2.5rem; }
.room-select-kicker { color: #9db6cf; font-size: 0.85rem; margin-bottom: 0.75rem; }
.room-select-header h1 { font-size: clamp(1.75rem, 4.5vw, 2.8rem); letter-spacing: -0.045em; margin-bottom: 0.9rem; }
.room-select-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; padding: 0; margin: 0; list-style: none; }
.room-select-grid > li { min-width: 0; }
.room-select-card { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 1.25rem; height: 100%; padding: 1.6rem; border: 1px solid #294767; border-radius: 1rem; background: linear-gradient(135deg, #10243a, #0b1b2e); color: #eff7ff; text-decoration: none; transition: border-color 150ms ease, background-color 150ms ease; }
.room-select-card:hover { border-color: #68c8ff; background: #132d48; }
.room-select-card:focus-visible, .room-select-operator summary:focus-visible, .room-select-operator a:focus-visible { outline: 3px solid #68c8ff; outline-offset: 4px; }
.room-select-number { display: grid; place-items: center; width: 3rem; height: 3rem; border: 1px solid #345571; border-radius: 0.8rem; background: #173552; color: #a4dbff; font-size: 0.9rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.room-select-copy { min-width: 0; padding-top: 0.1rem; }
.room-select-copy h2 { font-size: 1.2rem; margin-bottom: 0.4rem; }
.room-select-id { color: #9db6cf; font-size: 0.9rem; line-height: 1.5; overflow-wrap: anywhere; margin-bottom: 0; }
.room-select-action { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 1rem; margin-top: 0.75rem; padding-top: 1rem; border-top: 1px solid #294767; color: #a4dbff; font-size: 0.9rem; font-weight: 700; }
.room-select-action > span { font-size: 1.1rem; }
.room-select-note { color: #9db6cf; font-size: 0.85rem; line-height: 1.65; margin: 1.25rem 0 2rem; }
.room-select-operator { border-top: 1px solid #294767; padding-top: 1.25rem; }
.room-select-operator summary { width: fit-content; color: #b4c9dd; cursor: pointer; font-size: 0.85rem; padding: 0.25rem 0; }
.room-select-operator > p { color: #9db6cf; font-size: 0.85rem; line-height: 1.6; margin: 1rem 0; }
.room-select-operator-links { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.room-select-operator-links a { min-width: 0; max-width: 100%; border: 1px solid #294767; border-radius: 0.6rem; padding: 0.7rem 0.85rem; color: #b4c9dd; font-size: 0.85rem; line-height: 1.5; overflow-wrap: anywhere; text-decoration: none; }
.room-select-operator-links a:hover { color: #eff7ff; border-color: #68c8ff; }
@media (max-width: 560px) {
  .room-select-header .eyebrow { margin-bottom: 1.75rem; }
  .room-select-grid { grid-template-columns: minmax(0, 1fr); }
  .room-select-card { padding: 1.25rem; gap: 1rem; }
  .room-select-operator-links { flex-direction: column; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) { .room-select-card { transition: none; } }
.caption-chat-shell { width: min(960px, 100%); height: 100vh; margin: 0 auto; padding: 1.5rem clamp(1rem, 4vw, 2.5rem); display: grid; grid-template-rows: auto minmax(0, 1fr); }
.caption-chat-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; border-bottom: 1px solid #294767; padding-bottom: 1.25rem; }
.caption-chat-header h1 { margin-bottom: 0.35rem; }
.caption-chat-actions { display: grid; justify-items: end; gap: 0.75rem; }
.caption-language-picker { width: min(16rem, 100%); text-align: left; }
.caption-view-mode { display: inline-grid; grid-template-columns: repeat(2, auto); gap: 0.2rem; border: 1px solid #294767; border-radius: 999px; background: #09192b; padding: 0.2rem; }
.caption-view-mode button { min-width: 4.5rem; border: 0; border-radius: 999px; background: transparent; color: #91abc4; padding: 0.45rem 0.75rem; font-size: 0.78rem; }
.caption-view-mode button[aria-pressed="true"] { background: #235579; color: #eff9ff; box-shadow: 0 0.2rem 0.65rem rgba(0, 0, 0, 0.25); }
.caption-chat-panel { position: relative; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 0.75rem; padding-top: 1rem; }
.caption-chat-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable both-edges; scrollbar-width: thin; scrollbar-color: rgba(100, 200, 255, 0.55) rgba(8, 24, 42, 0.32); padding: 0.25rem 0.35rem 1.25rem; }
.caption-chat-scroll::-webkit-scrollbar { width: 0.65rem; }
.caption-chat-scroll::-webkit-scrollbar-track { border-radius: 999px; background: rgba(8, 24, 42, 0.32); }
.caption-chat-scroll::-webkit-scrollbar-thumb { min-height: 3rem; border: 2px solid #0b1f34; border-radius: 999px; background: linear-gradient(180deg, rgba(100, 200, 255, 0.78), rgba(47, 109, 155, 0.78)); background-clip: padding-box; }
.caption-chat-scroll::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #79d4ff, #3d86b8); background-clip: padding-box; }
.caption-chat-empty { color: #8faac3; text-align: center; line-height: 1.6; margin: 18vh 1rem 0; }
.caption-chat-empty[hidden] { display: none; }
.caption-chat-feed { display: grid; gap: 0.85rem; padding: 0; margin: 0; list-style: none; }
.caption-chat-message { width: 100%; display: grid; gap: 0.75rem; border: 1px solid #294767; border-left: 3px solid #4ca9df; border-radius: 0.85rem; background: rgba(10, 26, 44, 0.94); padding: 0.9rem 1rem; box-shadow: 0 0.7rem 2rem rgba(0, 0, 0, 0.12); animation: caption-stream-in 180ms ease-out; }
.caption-chat-message .source-caption { color: #b5cadc; font-size: 0.95rem; line-height: 1.55; overflow-wrap: anywhere; }
.caption-chat-message .translated-caption { color: #f7fbff; font-size: clamp(1.08rem, 2.4vw, 1.35rem); line-height: 1.5; overflow-wrap: anywhere; }
.caption-chat-message .caption-translation-copy { border-top: 1px solid rgba(61, 112, 153, 0.4); padding-top: 0.7rem; }
.caption-chat-draft-feed { margin-top: 0.85rem; }
.caption-chat-draft-feed[hidden] { display: none; }
.caption-chat-message--draft { border-color: #3f739c; border-left-color: #64c8ff; background: #0c2238; box-shadow: 0 0.7rem 2rem rgba(7, 17, 31, 0.32); }
.caption-chat-message--draft .caption-translation-copy { border-top-style: dashed; border-top-color: rgba(104, 200, 255, 0.35); }
.caption-chat-message--draft .source-caption { color: #b9cde0; }
.caption-chat-message--draft .translated-caption { color: #fff; }
.caption-draft-state { width: max-content; border-radius: 999px; background: #254b69; color: #bde8ff; padding: 0.25rem 0.55rem; font-size: 0.72rem; font-weight: 800; }
.caption-draft-state[hidden] { display: none; }
.caption-latest { position: absolute; right: 1.25rem; bottom: 3rem; border-color: #64c8ff; border-radius: 999px; background: #64c8ff; color: #06111e; padding: 0.65rem 1rem; box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.35); }
.caption-latest[hidden] { display: none; }
.caption-chat-panel .viewer-notice { min-height: 1.4rem; margin: 0; }
.caption-streams { min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr); gap: 1rem; }
.caption-stream { position: relative; min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); border: 1px solid #294767; border-radius: 0.85rem; background: rgba(9, 25, 43, 0.6); overflow: hidden; }
.caption-stream-heading { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.65rem 1rem; border-bottom: 1px solid #294767; }
.caption-stream-heading h2 { margin: 0; color: #a4dbff; font-size: 0.9rem; }
.caption-stream-hint { color: #91abc4; font-size: 0.75rem; }
.caption-stream .caption-chat-scroll { padding: 0.65rem 0.5rem; }
.caption-stream .caption-chat-empty { margin: 1.5rem 1rem; }
.caption-stream .caption-latest { bottom: 0.75rem; right: 1rem; padding: 0.45rem 0.75rem; font-size: 0.8rem; }
.caption-stream .caption-chat-message { padding: 0.65rem 0.85rem; gap: 0.35rem; }
.caption-stream .caption-label { display: none; }
.caption-stream .source-caption, .caption-stream .translated-caption { margin: 0; font-size: clamp(1rem, 1.5vw, 1.2rem); font-weight: 600; line-height: 1.5; }
.caption-chat-body--translation .caption-chat-shell { height: 100dvh; }
.caption-chat-body--translation .caption-chat-header { display: grid; grid-template-columns: minmax(0, 1fr) minmax(20rem, 0.9fr); gap: 1rem; padding-bottom: 0.85rem; }
.caption-chat-body--translation .caption-chat-actions { grid-template-columns: 1fr 1fr; align-items: end; gap: 0.6rem; }
.caption-chat-body--translation .caption-chat-actions .secondary-link { font-size: 0.8rem; padding: 0.65rem 0.5rem; }
.caption-chat-body--translation .caption-chat-header .description { max-width: 34rem; }
.caption-screen-body { overflow: hidden; background: #05070b; color: #fff; }
.caption-screen-shell { width: 100%; height: 100vh; height: 100dvh; padding: clamp(1.25rem, 4vw, 4rem) clamp(1.5rem, 6vw, 7rem); }
.caption-screen-panel { width: 100%; height: 100%; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr); }
.caption-screen-scroll { min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; }
.caption-screen-scroll .caption-chat-feed { flex: none; gap: clamp(0.5rem, 1.2vh, 1rem); }
.caption-screen-scroll .caption-chat-empty { display: none; }
.caption-screen-scroll .caption-chat-message { border: 0; border-radius: 0; background: transparent; box-shadow: none; padding: 0; animation: none; }
.caption-screen-scroll .caption-chat-message .translated-caption { margin: 0; color: #fff; font-size: clamp(1.65rem, 3.7vw, 4.5rem); font-weight: 700; line-height: 1.34; text-align: center; overflow-wrap: anywhere; text-wrap: balance; }
.caption-screen-scroll .caption-chat-message--draft .translated-caption { color: #d9edff; }
.caption-screen-scroll .caption-label, .caption-screen-scroll .caption-draft-state { display: none; }
.caption-screen-scroll .caption-chat-draft-feed { margin-top: clamp(0.5rem, 1.2vh, 1rem); }
.screen-preview-form { display: flex; flex-wrap: wrap; align-items: end; gap: 0.75rem; }
.screen-preview-form .field { min-width: min(18rem, 100%); }
.screen-preview-form button { min-height: 2.7rem; }
.caption-screen-bilingual-shell { height: 100vh; height: 100dvh; display: grid; grid-template-rows: repeat(2, minmax(0, 1fr)); gap: clamp(0.75rem, 2vh, 1.5rem); padding: clamp(1rem, 3vh, 2.5rem) clamp(1.25rem, 5vw, 6rem); }
.caption-screen-language { min-width: 0; min-height: 0; overflow: hidden; }
.caption-screen-bilingual .caption-screen-scroll { height: 100%; padding: 0; }
.caption-screen-bilingual .caption-chat-feed { list-style: none; }
.caption-screen-bilingual .caption-chat-message .translated-caption { font-size: clamp(1.45rem, 3vw, 3.5rem); line-height: 1.22; }
.caption-screen-bilingual .caption-chat-message--draft .translated-caption { color: inherit; opacity: 0.84; }
.caption-screen-theme--light { background: #f5f7f9; color: #152238; }
.caption-screen-theme--light .translated-caption { color: #152238 !important; }
.caption-screen-theme--chroma-green { background: #00ff00; color: #fff; }
.caption-screen-theme--chroma-blue { background: #0000ff; color: #fff; }
.caption-screen-theme--chroma-green .translated-caption, .caption-screen-theme--chroma-blue .translated-caption { color: #fff !important; text-shadow: 0 2px 3px #111, 2px 0 3px #111, -2px 0 3px #111, 0 -2px 3px #111; }
@keyframes caption-stream-in { from { opacity: 0; transform: translateY(0.45rem); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .caption-chat-message { animation: none; } }

.multilingual-selection-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-block: 0.75rem; }
.multilingual-selection-actions button { min-height: 2.5rem; padding: 0.5rem 0.8rem; }
#language-selection-summary { color: #acd6f5; margin-block: 0.5rem; }
#language-selection-summary[data-error="true"] { color: #ffc978; }
.access-body { display: grid; place-items: center; padding: 1rem; }
.access-shell { width: min(34rem, 100%); }
.access-panel { padding: clamp(1.5rem, 5vw, 2.5rem); }
.access-form { display: grid; gap: 1rem; margin-top: 1.5rem; }
.access-form input { width: 100%; color: #eff7ff; background: #09192b; padding: 0.85rem 0.9rem; }
.access-form .primary { min-height: 3rem; }
.access-error { color: #ffb1ba; background: #3d1c27; border-radius: 0.65rem; padding: 0.8rem 0.9rem; margin: 1rem 0 0; }

@media (max-width: 720px) {
  .participant-entry { grid-template-columns: 1fr; }
  .page-header, .viewer-header { align-items: flex-start; flex-direction: column; }
  .viewer-links { width: 100%; flex-direction: column; align-items: stretch; }
  .viewer-links .secondary-link { text-align: center; }
  .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .secondary { width: 100%; }
  .input-status-layout { grid-template-columns: 1fr; }
  .partial-box, .final-list .caption-pair { grid-template-columns: 1fr; }
  .partial-box .caption-copy { min-height: 5.5rem; }
  .partial-box .caption-translation-copy { border-top: 1px solid rgba(61, 112, 153, 0.55); border-left: 0; }
  .viewer-status { width: 100%; justify-content: space-between; }
  .media-heading, .media-controls { align-items: stretch; flex-direction: column; }
  .media-retry, .media-controls button { width: 100%; }
  .caption-delay-control { grid-template-columns: auto minmax(0, 1fr) 3.2rem; }
  .overlay-shell { padding: 0.75rem; }
  .overlay-header { grid-template-columns: 1fr; align-items: stretch; }
  .overlay-header .secondary-link { text-align: center; }
  .overlay-program-stage { min-height: 0; }
  .video-caption-overlay { left: 0.75rem; right: 0.75rem; bottom: 0.75rem; max-height: 68%; gap: 0.35rem; }
  .video-caption-overlay .caption-label { font-size: 0.66rem; }
  .video-caption-overlay .source-caption { font-size: clamp(0.8rem, 2.8vw, 1rem); }
  .video-caption-overlay .translated-caption { font-size: clamp(1.05rem, 4vw, 1.6rem); }
  .overlay-controls { align-items: stretch; }
  .caption-chat-shell { width: 100%; padding: 0.75rem 1rem; }
  .caption-chat-header { display: grid; gap: 1rem; }
  .caption-chat-actions { justify-items: stretch; }
  .caption-view-mode { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .caption-chat-actions .secondary-link { text-align: center; }
  .caption-chat-message { width: 100%; }
  .caption-chat-scroll { padding-inline: 0.15rem; }
  .caption-chat-scroll::-webkit-scrollbar { width: 0.5rem; }
  .caption-latest { right: 1rem; bottom: 3rem; }
  .caption-chat-body--translation .caption-chat-header { grid-template-columns: 1fr; gap: 0.65rem; padding-bottom: 0.65rem; }
  .caption-chat-body--translation .caption-chat-header h1 { font-size: 1.55rem; }
  .caption-chat-body--translation .caption-chat-header .description { font-size: 0.85rem; margin-bottom: 0; }
  .caption-chat-body--translation .caption-chat-actions { grid-template-columns: 1fr 1fr; align-items: end; gap: 0.5rem; }
  .caption-chat-body--translation .caption-chat-actions .viewer-status { flex-wrap: wrap; gap: 0.25rem; justify-content: flex-end; }
  .caption-chat-body--translation .caption-chat-actions .secondary-link { font-size: 0.78rem; padding: 0.55rem 0.4rem; }
  .caption-chat-body--translation .caption-view-mode button { min-width: 0; }
  .caption-streams { gap: 0.65rem; }
}
