/* ─── Live Translate — NTT-branded styles ─────────────────────────────────── */

:root {
  --ntt-blue: #0072BC;
  --ntt-blue-light: #e8f4fc;
  --ntt-blue-hover: #005a96;
  --green: #16a34a;
  --green-light: #f0fdf4;
  --green-hover: #15803d;
  --red: #dc2626;
  --red-light: #fef2f2;
  --red-hover: #b91c1c;
  --amber: #d97706;
  --amber-light: #fffbeb;
  --amber-hover: #b45309;
  --amber-muted: #92400e;
  --text-primary: #1a1a1a;
  --text-secondary: #6b7280;
  --text-translation: #555;
  --bg-white: #ffffff;
  --bg-panel: #fafbfc;
  --border: #e0e4e8;
  --border-light: #eef0f2;
  --radius: 8px;
  --radius-sm: 5px;
  --radius-pill: 999px;
  --font-body: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-white);
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

/* ─── Layout ──────────────────────────────────────────────────────────────── */

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ─── Header ──────────────────────────────────────────────────────────────── */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-white);
  flex-shrink: 0;
}

.header-left {
  flex: 0 0 auto;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 10px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.header-center img {
  height: 34px;
  width: auto;
}

.header-center h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--ntt-blue);
  letter-spacing: -0.3px;
}

.title-beta {
  font-size: 13px;
  font-weight: 700;
  color: var(--amber);
  letter-spacing: 0.5px;
  text-transform: lowercase;
  vertical-align: middle;
  position: relative;
  top: -2px;
}

.header-right {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.locale-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.locale-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Session controls row (Pause / Resume / Stop) */
.session-controls-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.btn-pause-session,
.btn-resume-session,
.btn-stop-session {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.15s;
  border: 2px solid transparent;
}

.btn-pause-session {
  background: var(--amber-light);
  border-color: var(--amber);
  color: var(--amber-muted);
}
.btn-pause-session:hover {
  background: var(--amber);
  color: white;
}

.btn-resume-session {
  background: var(--green-light);
  border-color: var(--green);
  color: var(--green);
}
.btn-resume-session:hover {
  background: var(--green);
  color: white;
}

.btn-stop-session {
  background: var(--red-light);
  border-color: var(--red);
  color: var(--red);
}
.btn-stop-session:hover {
  background: var(--red);
  color: white;
}

/* Download button */
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 2px solid var(--ntt-blue);
  border-radius: var(--radius-pill);
  background: var(--bg-white);
  color: var(--ntt-blue);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  margin-left: 8px;
}
.btn-download:hover:not(.disabled) {
  background: var(--ntt-blue-light);
}
.btn-download.disabled {
  border-color: #ccc;
  color: #ccc;
  cursor: not-allowed;
  opacity: 0.5;
}
.btn-download.disabled svg {
  stroke: #ccc;
}

/* Summarize button */
.btn-summarize {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 2px solid var(--ntt-blue);
  border-radius: var(--radius-pill);
  background: var(--bg-white);
  color: var(--ntt-blue);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  margin-left: 8px;
}
.btn-summarize:hover:not(.disabled) {
  background: var(--ntt-blue-light);
}
.btn-summarize.disabled {
  border-color: #ccc;
  color: #ccc;
  cursor: not-allowed;
  opacity: 0.5;
}
.btn-summarize.disabled svg {
  stroke: #ccc;
}

/* Locale selector */
.locale-select {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
  font-family: var(--font-body);
  font-weight: 600;
  padding: 3px 6px;
  cursor: pointer;
  outline: none;
  max-width: 130px;
}
.locale-select:hover,
.locale-select:focus {
  border-color: var(--ntt-blue);
  color: var(--ntt-blue);
}

/* Toggle config link */
.btn-toggle-config {
  background: none;
  border: none;
  color: var(--ntt-blue);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-toggle-config:hover {
  text-decoration: underline;
}

/* ─── Main content ────────────────────────────────────────────────────────── */

.main {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* ─── Transcript panel (left) ─────────────────────────────────────────────── */

.transcript-panel-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--border);
  position: relative;
}

/* ─── Viewer Pane ─────────────────────────────────────────────────────────── */

.viewer-pane {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 7px 16px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-panel);
  gap: 0;
}

.viewer-pane-section {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
}

.viewer-pane-section:first-child {
  padding-left: 0;
}

.viewer-pane-section:last-child {
  padding-right: 0;
}

.viewer-pane-filters {
  flex: 1;
  flex-wrap: wrap;
  min-width: 0;
}

.viewer-pane-follow {
  flex-shrink: 0;
}

.viewer-pane-size {
  flex-shrink: 0;
}

.viewer-pane-divider {
  width: 1px;
  height: 22px;
  background: var(--border);
  flex-shrink: 0;
}

.viewer-pane-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.viewer-pane-or-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
  margin: 0 2px;
}

.size-icon {
  color: var(--text-secondary);
  font-weight: 700;
  line-height: 1;
  user-select: none;
}

.size-icon-sm {
  font-size: 11px;
}

.size-icon-lg {
  font-size: 18px;
}

.size-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  outline: none;
  cursor: pointer;
}

.size-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ntt-blue);
  cursor: pointer;
  transition: background 0.15s;
}

.size-slider::-webkit-slider-thumb:hover {
  background: var(--ntt-blue-hover);
}

.size-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ntt-blue);
  cursor: pointer;
  border: none;
}

.btn-follow-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-white);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-follow-live:hover {
  border-color: var(--ntt-blue);
  color: var(--ntt-blue);
}

.btn-follow-live.vf-active {
  background: var(--ntt-blue);
  border-color: var(--ntt-blue);
  color: white;
}

.viewer-filter-btn {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-white);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.viewer-filter-btn:hover:not(.vf-disabled) {
  border-color: var(--ntt-blue);
  color: var(--ntt-blue);
}

.viewer-filter-btn.vf-active {
  background: var(--ntt-blue);
  border-color: var(--ntt-blue);
  color: white;
}

.viewer-filter-btn.vf-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.transcript-panel {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
  --transcript-font-size: 16px;
}

.transcript-footnote {
  flex-shrink: 0;
  padding: 8px 32px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-white);
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footnote-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.footnote-right {
  display: flex;
  align-items: center;
}

.footer-version {
  color: var(--text-secondary);
  opacity: 0.6;
}

.log-level-input {
  width: 16px;
  text-align: center;
  font-size: inherit;
  font-family: inherit;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--text-secondary);
  opacity: 0.4;
  padding: 0;
  margin-left: 4px;
  line-height: 1;
  pointer-events: auto;
}
.log-level-input:focus {
  opacity: 0.8;
  outline: none;
}
.log-level-input:disabled {
  opacity: 0.6;
  cursor: default;
  pointer-events: none;
}

.log-level-display {
  font-size: 11px;
  color: var(--text-secondary);
  opacity: 0.5;
}

.footnote-sep {
  color: var(--border);
}

.speaker-block {
  margin-bottom: 24px;
}

.speaker-label {
  font-size: var(--transcript-font-size, 16px);
  font-weight: 700;
  color: var(--ntt-blue);
  margin-bottom: 10px;
  letter-spacing: 0.3px;
}

.seg-original {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 2px;
  line-height: 1.7;
}

.seg-original .seg-text {
  font-size: calc(var(--transcript-font-size, 16px) + 2px);
  font-weight: 500;
  color: var(--text-primary);
}

.seg-translation {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
  line-height: 1.7;
}

.seg-translation .seg-text {
  font-size: var(--transcript-font-size, 16px);
  font-weight: 400;
  color: var(--text-secondary);
  font-style: italic;
}

.lang-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--ntt-blue-light);
  color: var(--ntt-blue);
  font-size: calc(var(--transcript-font-size, 16px) - 5px);
  font-weight: 600;
  letter-spacing: 0.2px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ─── Config panel (right sidebar) ────────────────────────────────────────── */

.config-panel {
  width: 380px;
  flex-shrink: 0;
  padding: 24px;
  background: var(--bg-panel);
  overflow-y: auto;
}

.config-panel-close {
  display: none;
}

/* ─── Viewer mode ──────────────────────────────────────────────────────────── */

body.viewer-mode #config-panel,
body.viewer-mode #btn-toggle-config {
  display: none !important;
}

.viewer-mode-badge,
.host-mode-badge {
  display: none;
}

body.viewer-mode .viewer-mode-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: #fff3e0;
  color: #e65100;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  border: 1px solid #e65100;
  white-space: nowrap;
}

body.host-mode .host-mode-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--green-light);
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  border: 1px solid var(--green);
  white-space: nowrap;
}

/* ─── Session Details card ─────────────────────────────────────────────────── */

.session-details-card {
  margin-top: 10px;
  margin-bottom: 8px;
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 12px 12px 10px;
}

.session-details-hint {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.session-details-body {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.session-details-left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sdl-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sdl-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sdl-value {
  font-size: 12px;
  color: var(--text-primary);
  font-family: var(--font-mono, monospace);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sdl-value--key {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--ntt-blue);
}

.sdl-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.btn-sdl-action {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid var(--ntt-blue);
  border-radius: var(--radius-pill);
  background: var(--bg-white);
  color: var(--ntt-blue);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: center;
  white-space: nowrap;
}

.btn-sdl-action:hover {
  background: var(--ntt-blue-light);
}

.btn-sdl-action.copied {
  border-color: var(--green);
  color: var(--green);
}

/* QR thumbnail button */
.session-qr-thumb {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  background: none;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 6px 6px 4px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.session-qr-thumb:hover {
  border-color: var(--ntt-blue);
  box-shadow: 0 0 0 2px rgba(0, 114, 188, 0.12);
}

.sqt-canvas-wrap {
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sqt-canvas-wrap img,
.sqt-canvas-wrap canvas {
  display: block;
  max-width: 96px;
  max-height: 96px;
}

.sqt-hint {
  font-size: 9px;
  color: var(--text-secondary);
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
}

/* ─── (legacy) btn-copy-url / btn-copy-viewer-key stubs — kept for compat ── */
.btn-copy-url,
.btn-copy-viewer-key {
  display: none;
}

/* ─── Viewer session banner ────────────────────────────────────────────────── */

.viewer-session-banner {
  display: none;
  margin: 12px 16px;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

.viewer-session-banner--waiting {
  background: var(--bg-panel);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}

.viewer-session-banner--ended {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.viewer-session-banner--session_not_found {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Override .hidden for config-panel to use width collapse instead */
aside.config-panel.hidden {
  display: block !important;
  width: 0;
  padding: 0;
  overflow: hidden;
  opacity: 0;
  transition: width 0.2s, padding 0.2s, opacity 0.2s;
}

.config-section {
  margin-bottom: 24px;
}

/* ─── Hierarchical config headings ─────────────────────────────────────────── */

.config-group-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ntt-blue);
  margin: 0 0 16px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--ntt-blue-light);
}

.config-group-title--collapsible::after {
  content: " ▾";
  font-size: 15px;
  opacity: 0.6;
}

.config-group-title--collapsible.collapsed::after {
  content: " ▸";
  font-size: 15px;
  opacity: 0.6;
}

#pre-session-body,
#post-call-body {
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease;
  max-height: 600px;
  opacity: 1;
}

#pre-session-body.collapsed,
#post-call-body.collapsed {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

/* ─── Normalized section titles (grey, no uppercase) ─────────────────────── */

.config-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
  margin-bottom: 12px;
}

/* ─── Host Key ────────────────────────────────────────────────────────────── */

.host-key-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-clearable {
  position: relative;
  flex: 1;
}

.input-clearable input {
  width: 100%;
  padding: 7px 30px 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-body);
}
.input-clearable input:focus {
  outline: none;
  border-color: var(--ntt-blue);
  box-shadow: 0 0 0 2px rgba(0, 114, 188, 0.15);
}
.input-clearable input:disabled {
  background: #f3f4f6;
  color: #999;
}

.input-clear-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #999;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 50%;
}
.input-clear-btn:hover {
  color: #333;
  background: #eee;
}

.btn-apply {
  padding: 7px 16px;
  border: 1px solid var(--ntt-blue);
  border-radius: var(--radius-sm);
  background: var(--ntt-blue);
  color: white;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-apply:hover:not(:disabled) {
  background: var(--ntt-blue-hover);
}
.btn-apply:disabled {
  cursor: default;
}
.btn-apply.btn-apply-success {
  background: var(--green);
  border-color: var(--green);
  color: white;
  font-size: 16px;
  font-weight: 700;
}

.host-key-error {
  margin-top: 6px;
  font-size: 13px;
  color: var(--red);
  font-weight: 500;
}

/* ─── Language selectors ──────────────────────────────────────────────────── */

.lang-row {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  gap: 0;
}

.lang-row label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.lang-row .btn-lang-clear {
  margin-left: auto;
  margin-right: 6px;
  flex-shrink: 0;
}

.lang-row select {
  width: 200px;
  flex-shrink: 0;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-white);
  cursor: pointer;
}
.lang-row select:focus {
  outline: none;
  border-color: var(--ntt-blue);
  box-shadow: 0 0 0 2px rgba(0, 114, 188, 0.15);
}

/* ─── Language section hint & required asterisk ──────────────────────────── */

.config-section-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  margin-top: -6px;
}

.required {
  color: var(--ntt-blue);
  font-weight: 700;
}

/* ─── Lang row clear / add buttons ───────────────────────────────────────── */

.btn-lang-clear {
  background: none;
  border: none;
  color: #aaa;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 50%;
  margin-left: 4px;
  flex-shrink: 0;
}
.btn-lang-clear:hover {
  color: var(--red);
  background: var(--red-light);
}

.lang3-add-row {
  margin-top: -2px;
  margin-bottom: 10px;
}

.btn-lang-add {
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--ntt-blue);
  font-size: 13px;
  font-family: var(--font-body);
  font-weight: 600;
  padding: 5px 12px;
  cursor: pointer;
  width: 100%;
  transition: all 0.15s;
}
.btn-lang-add:hover {
  background: var(--ntt-blue-light);
  border-color: var(--ntt-blue);
}

/* ─── Mic selector (full width, no MIC label) ─────────────────────────────── */

.mic-select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-white);
  margin-bottom: 10px;
}
.mic-select:focus {
  outline: none;
  border-color: var(--ntt-blue);
}

/* Audio level bar */
.level-container {
  height: 18px;
  background: var(--ntt-blue-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 4px;
}

.level-bar {
  height: 100%;
  width: 0%;
  background: var(--ntt-blue);
  opacity: 0.5;
  transition: width 0.05s linear;
  border-radius: var(--radius-sm);
}

/* ─── Response Speed slider ────────────────────────────────────────────────── */

.slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.slider-label-left,
.slider-label-right {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

.slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ntt-blue);
  cursor: pointer;
  transition: background 0.15s;
}
.slider::-webkit-slider-thumb:hover {
  background: var(--ntt-blue-hover);
}
.slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ntt-blue);
  cursor: pointer;
  border: none;
}
.slider:disabled {
  opacity: 0.4;
}
.slider:disabled::-webkit-slider-thumb {
  cursor: default;
}

.slider-value-display {
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ─── Control buttons ─────────────────────────────────────────────────────── */

.btn-clear {
  display: block;
  width: 100%;
  padding: 10px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-white);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-clear:hover {
  border-color: var(--ntt-blue);
  color: var(--ntt-blue);
}

.btn-clear-small {
  display: block;
  width: 100%;
  padding: 5px 10px;
  margin-top: 8px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.btn-clear-small:hover {
  border-color: var(--ntt-blue);
  color: var(--ntt-blue);
}

.config-section--start {
  padding-bottom: 4px;
}

.btn-record {
  display: block;
  width: 100%;
  padding: 12px;
  border: 2px solid;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-body);
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.15s;
}

/* Start Session = green */
.btn-record.btn-start {
  border-color: var(--green);
  background: var(--bg-white);
  color: var(--green);
}
.btn-record.btn-start:hover {
  background: var(--green-light);
}

/* End Session = red */
.btn-record.btn-stop {
  border-color: var(--red);
  background: var(--red);
  color: white;
}
.btn-record.btn-stop:hover {
  background: var(--red-hover);
  border-color: var(--red-hover);
}

/* ─── Empty state ─────────────────────────────────────────────────────────── */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-secondary);
  font-size: 15px;
  gap: 8px;
}

.empty-state svg {
  opacity: 0.3;
  margin-bottom: 8px;
}

.empty-state-intro {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  white-space: nowrap;
  margin-bottom: 10px;
}

.empty-state-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.empty-state-bullets li {
  font-size: 13px;
  color: var(--text-secondary);
  padding-left: 16px;
  position: relative;
  white-space: nowrap;
}

.empty-state-bullets li::before {
  content: "›";
  position: absolute;
  left: 0;
  color: var(--ntt-blue);
  font-weight: 700;
}

@media (max-width: 600px) {
  .empty-state-intro {
    white-space: normal;
    text-align: center;
  }
  .empty-state-bullets li {
    white-space: normal;
  }
}

/* ─── Controls row (hidden on desktop) ───────────────────────────────────── */

.mobile-controls-row {
  display: none;
}

/* ─── Action row (Transcript + Summarize) — always visible ───────────────── */

.mobile-action-row {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-white);
  flex-shrink: 0;
}

.mobile-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid var(--border-light);
  background: var(--bg-white);
  color: var(--text-secondary);
  font-family: var(--font-body);
  transition: background 0.15s, color 0.15s;
}

.mobile-action-btn:not(.disabled):hover {
  background: var(--bg-panel);
  color: var(--text-primary);
}

.mobile-action-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}



/* ─── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  aside.config-panel.config-panel--session-active {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
  }

  /* ── App shell ── */
  .app {
    height: 100dvh;
  }

  /* ── Header: 2-row grid layout on mobile ── */
  .header {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    padding: 10px 14px 8px;
    gap: 6px 8px;
  }

  /* Row 1: logo + title — spans full width, centred */
  .header-center {
    grid-column: 1 / -1;
    grid-row: 1;
    position: static;
    transform: none;
    justify-content: center;
    gap: 8px;
    width: 100%;
  }

  .header-center img {
    height: 26px;
  }

  .header-center h1 {
    font-size: 17px;
  }

  /* Row 2 left: mode badge — shrinks to content width */
  .header-left {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-shrink: 0;
  }

  .header-left .btn-download,
  .header-left .btn-summarize {
    display: none !important;
  }

  /* Row 2 right: locale + host config toggle — fills remaining space */
  .header-right {
    grid-column: 2;
    grid-row: 2;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    width: 100%;
  }

  .locale-row {
    gap: 4px;
  }

  .locale-label {
    font-size: 11px;
  }

  .locale-select {
    font-size: 11px;
    padding: 3px 5px;
    max-width: 110px;
  }

  .btn-toggle-config {
    font-size: 13px;
    white-space: nowrap;
  }

  .landing-header {
    padding: 14px 14px 12px;
  }

  .landing-key-card {
    min-width: 0;
    width: 100%;
    max-width: 400px;
    padding: 20px 16px;
  }

  /* ── Main: vertical stack ── */
  .main {
    flex-direction: column;
    overflow: hidden;
  }

  /* ── Transcript panel wrapper fills available height ── */
  .transcript-panel-wrapper {
    flex: 1;
    border-right: none;
    border-bottom: none;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  /* ── Viewer pane: two separate rows on mobile ── */
  .viewer-pane {
    flex-wrap: wrap;
    padding: 4px 10px;
    gap: 0;
    row-gap: 0;
  }

  /* Row 3: filter buttons — full width */
  .viewer-pane-filters {
    order: 1;
    width: 100%;
    padding: 3px 0;
    border-bottom: 1px solid var(--border-light);
  }

  .viewer-filter-btn {
    padding: 3px 9px;
    font-size: 11px;
  }

  .viewer-pane-or-label {
    font-size: 10px;
  }

  /* Row 4: follow live + sizer */
  .viewer-pane-follow {
    order: 2;
    padding: 4px 0;
    flex: 1;
  }

  .btn-follow-live {
    padding: 3px 9px;
    font-size: 11px;
  }

  .viewer-pane-size {
    order: 3;
    padding: 4px 0;
  }

  .size-slider {
    width: 60px;
  }

  .size-icon-sm {
    font-size: 10px;
  }

  .size-icon-lg {
    font-size: 15px;
  }

  /* Hide desktop dividers and desktop-only pane sections on mobile */
  .vp-divider-desktop,
  .vp-desktop-only {
    display: none !important;
  }

  /* ── Mobile controls row (Follow Live + sizer) — below transcript ── */
  .mobile-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 14px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-white);
    flex-shrink: 0;
  }

  /* ── Transcript panel ── */
  .transcript-panel {
    flex: 1;
    padding: 14px 16px;
    min-height: 0;
  }

  /* ── Mobile action row ── */
  .mobile-action-row {
    padding: 8px 14px;
  }

  .mobile-action-btn {
    flex: 1;
    justify-content: center;
    padding: 8px 10px;
    font-size: 13px;
  }

  .mobile-action-btn svg {
    width: 15px;
    height: 15px;
  }

  /* ── Footer ── */
  .transcript-footnote {
    padding: 6px 14px;
  }

  .footer-beta,
  .footnote-beta-sep {
    display: none;
  }

  /* ── Transcript content ── */
  .speaker-label {
    font-size: 13px;
  }

  .seg-original .seg-text {
    font-size: 15px;
  }

  .seg-translation .seg-text {
    font-size: 13px;
  }

  .lang-badge {
    font-size: 10px;
    padding: 1px 6px;
  }

  /* ── Config panel close button ── */
  .config-panel-close {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 12px;
    right: 14px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    padding: 0;
  }

  .config-panel-close:hover {
    background: var(--border-light);
    color: var(--text-primary);
  }

  /* ── Config panel: full-width slide-in on mobile ── */
  .config-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    max-width: 100vw;
    z-index: 500;
    padding: 56px 16px 20px;
    box-shadow: -4px 0 24px rgba(0,0,0,0.15);
    overflow-y: auto;
    transition: transform 0.25s ease, opacity 0.2s ease;
    transform: translateX(0);
    opacity: 1;
  }

  aside.config-panel.hidden {
    display: block !important;
    width: 100vw;
    padding: 56px 16px 20px;
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
  }

  .lang-row {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    margin-bottom: 10px;
  }

  .lang-row label {
    font-size: 13px;
    min-width: 0;
    white-space: nowrap;
  }

  .lang-row select {
    width: auto;
    flex: 1;
    min-width: 0;
    font-size: 13px;
  }

  .empty-state {
    font-size: 13px;
  }

  .empty-state svg {
    width: 36px;
    height: 36px;
  }

  .btn-record {
    font-size: 14px;
    padding: 10px;
  }

  .btn-clear {
    font-size: 13px;
    padding: 8px;
  }

  .config-section-title {
    font-size: 12px;
  }

  /* Modal on mobile */
  .modal--wide {
    width: 96vw;
    max-height: 88vh;
  }
}

@media (max-width: 400px) {
  .header-center h1 {
    font-size: 15px;
  }

  .header-center img {
    height: 22px;
  }

  .btn-toggle-config {
    font-size: 12px;
  }
}

/* ─── Advanced Settings link ──────────────────────────────────────────────── */

.advanced-settings-row {
  margin-top: 6px;
  margin-bottom: 20px;
  display: flex;
  justify-content: flex-end;
}

.btn-advanced-settings {
  background: none;
  border: none;
  color: var(--ntt-blue);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}

.btn-advanced-settings:hover {
  color: var(--ntt-blue-hover);
}

/* ─── Modal ───────────────────────────────────────────────────────────────── */

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  width: 340px;
  max-width: 94vw;
  overflow: hidden;
}

.modal--wide {
  width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal--wide .modal-body {
  overflow-y: auto;
  flex: 1;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--border-light);
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ntt-blue);
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  background: var(--border-light);
  color: var(--text-primary);
}

.modal-body {
  padding: 18px;
}

/* ─── Modal context section ───────────────────────────────────────────────── */

.preferred-langs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px 10px;
}

.pref-lang-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pref-lang-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.pref-lang-select {
  width: 100%;
  font-size: 13px;
}

.modal-context-section {
  margin-bottom: 0;
}

.modal-context-section + .modal-context-section {
  margin-top: 20px;
}

.context-subsection {
  margin-bottom: 20px;
}

.context-subsection:last-child {
  margin-bottom: 0;
}

.context-sub-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.2px;
  margin-bottom: 4px;
}

.context-sub-title--heading {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
  margin-bottom: 12px;
}

.context-sub-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  margin-top: -6px;
}

.context-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.context-term-input {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-body);
  color: var(--text-primary);
}
.context-term-input:focus {
  outline: none;
  border-color: var(--ntt-blue);
  box-shadow: 0 0 0 2px rgba(0, 114, 188, 0.15);
}

.context-kv-row {
  align-items: stretch;
}

.context-key-input {
  width: 130px;
  flex-shrink: 0;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-body);
  color: var(--text-primary);
}
.context-key-input:focus {
  outline: none;
  border-color: var(--ntt-blue);
  box-shadow: 0 0 0 2px rgba(0, 114, 188, 0.15);
}

.context-value-input {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-body);
  color: var(--text-primary);
}
.context-value-input:focus {
  outline: none;
  border-color: var(--ntt-blue);
  box-shadow: 0 0 0 2px rgba(0, 114, 188, 0.15);
}

.btn-context-add {
  padding: 7px 14px;
  border: 1px solid var(--ntt-blue);
  border-radius: var(--radius-sm);
  background: var(--ntt-blue);
  color: white;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
  flex-shrink: 0;
}
.btn-context-add:hover {
  background: var(--ntt-blue-hover);
}

.context-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 0;
}

.context-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 10px;
  background: var(--ntt-blue-light);
  border: 1px solid rgba(0, 114, 188, 0.2);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  color: var(--ntt-blue);
  max-width: 100%;
}

.context-tag-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-tag-remove {
  background: none;
  border: none;
  color: var(--ntt-blue);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  opacity: 0.6;
  flex-shrink: 0;
}
.context-tag-remove:hover {
  opacity: 1;
}

/* ─── Landing overlay ────────────────────────────────────────────────────────── */
.landing-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
  flex-direction: column;
}
body.landing-mode .landing-overlay {
  display: flex;
}
body.landing-mode .app {
  display: none;
}
body.landing-mode #btn-toggle-config-landing {
  visibility: hidden;
}
body.landing-mode .host-mode-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--green-light);
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  border: 1px solid var(--green);
  white-space: nowrap;
}

.landing-header {
  padding: 0 24px;
  min-height: 56px;
}
.landing-header-center img {
  height: 28px;
  width: 28px;
}
.landing-header-center h1 {
  font-size: 18px;
  font-weight: 600;
  color: var(--ntt-blue);
  margin: 0;
}

.landing-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.landing-key-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  min-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.landing-key-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.landing-card-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.landing-key-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.landing-key-input-wrap {
  flex: 1;
}

.landing-footer {
  text-align: left;
  padding: 14px 32px;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ─── Viewer key gate ────────────────────────────────────────────────────────── */

.viewer-key-gate {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: var(--bg-white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.viewer-key-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (max-width: 480px) {
  .viewer-key-card {
    padding: 20px 16px;
  }
}

/* ─── Viewer key block — now rendered as .sdl-field inside .session-details-card ── */

/* ─── QR Code button (URL row) ───────────────────────────────────────────────── */

.btn-qr-url {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: none;
  border: none;
  border-radius: 4px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  transition: background 0.1s, color 0.1s;
}

.btn-qr-url:hover {
  background: var(--border-light);
  color: var(--ntt-blue);
}

/* ─── QR Code modal (desktop) ────────────────────────────────────────────────── */

.modal--qr {
  width: 320px;
  max-width: 94vw;
}

.modal-body--qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px 18px 10px;
}

.qr-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

.qr-canvas-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
}

.qr-canvas-wrap img,
.qr-canvas-wrap canvas {
  display: block;
}

.qr-url-display {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--font-mono, monospace);
  text-align: center;
  word-break: break-all;
  max-width: 260px;
}

.modal-footer--qr {
  display: flex;
  justify-content: center;
  padding: 10px 18px 16px;
  border-top: 1px solid var(--border-light);
}

.btn-qr-close-bottom {
  padding: 8px 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-white);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-qr-close-bottom:hover {
  border-color: var(--ntt-blue);
  color: var(--ntt-blue);
}

/* ─── QR Code overlay (mobile slide-in) ──────────────────────────────────────── */

.qr-mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(0, 0, 0, 0.45);
  align-items: flex-end;
  justify-content: center;
}

.qr-mobile-overlay.open {
  display: flex;
}

.qr-mobile-sheet {
  background: var(--bg-white);
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 100vw;
  padding: 20px 24px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: relative;
  animation: qr-slide-up 0.25s ease;
}

@keyframes qr-slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.qr-mobile-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.qr-mobile-close:hover {
  background: var(--border-light);
  color: var(--text-primary);
}

.qr-mobile-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ntt-blue);
  margin-top: 4px;
}

.qr-mobile-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

/* ─── Host empty-state subheading ───────────────────────────────────────────── */

.empty-state-subhead {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 8px;
  margin-bottom: 2px;
}

.empty-state-bullets--after {
  margin-top: 8px;
}

.host-empty-state {
  align-items: center;
  justify-content: flex-start;
  padding: 32px;
  overflow-y: auto;
}

.host-empty-state .empty-state-intro,
.host-empty-state .empty-state-subhead,
.host-empty-state .empty-state-bullets {
  align-self: center;
  width: 100%;
  max-width: 480px;
  text-align: left;
}

.empty-state-bullets--plain li::before {
  content: none;
}

.empty-state-bullets--plain {
  padding-left: 0;
  margin-top: 10px;
  border-top: 1px solid var(--border-light);
  padding-top: 10px;
}

.empty-state-bullets--plain li {
  padding-left: 0;
}

@media (max-width: 600px) {
  .host-empty-state {
    padding: 16px;
  }
}

