/* ─── 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;
}

/* Mute button */
.btn-mute {
  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;
}
.btn-mute:hover:not(.disabled) {
  background: var(--ntt-blue-light);
}
.btn-mute.muted {
  background: var(--ntt-blue);
  color: white;
}
.btn-mute.disabled {
  border-color: #ccc;
  color: #ccc;
  cursor: not-allowed;
  opacity: 0.5;
}
.btn-mute.disabled svg {
  stroke: #ccc;
}

/* Mute button — in config panel (amber/orange, distinct from other controls) */
.btn-mute-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  margin-bottom: 12px;
  border: 2px solid var(--amber);
  border-radius: var(--radius-pill);
  background: var(--amber-light);
  color: var(--amber);
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-mute-panel:hover:not(.disabled) {
  background: var(--amber);
  color: white;
}
.btn-mute-panel.muted {
  background: var(--amber);
  border-color: var(--amber);
  color: white;
}
.btn-mute-panel.muted:hover {
  background: var(--amber-hover);
  border-color: var(--amber-hover);
}
.btn-mute-panel.disabled {
  border-color: #ccc;
  background: var(--bg-white);
  color: #ccc;
  cursor: not-allowed;
  opacity: 0.5;
}
.btn-mute-panel.disabled svg {
  stroke: #ccc;
}

/* 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 {
  appearance: none;
  -webkit-appearance: none;
  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: 60px;
}
.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);
}

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

.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;
  gap: 6px;
}

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

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

.speaker-label {
  font-size: 15px;
  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: 18px;
  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: 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: 11px;
  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;
}

/* 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);
}

/* ─── Normalized section titles (grey, uppercase, same style) ─────────────── */

.config-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  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;
  justify-content: space-between;
  margin-bottom: 10px;
  position: relative;
}

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

.lang-row select {
  width: 200px;
  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-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;
}

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

@media (max-width: 768px) {
  .header {
    padding: 10px 14px;
    position: relative;
  }

  .header-center {
    position: static;
    transform: none;
    gap: 6px;
  }

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

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

  .btn-download {
    padding: 6px 10px;
    font-size: 12px;
    gap: 4px;
    margin-left: 4px;
  }

  .btn-download svg {
    width: 14px;
    height: 14px;
  }

  .btn-summarize {
    padding: 6px 10px;
    font-size: 12px;
    gap: 4px;
    margin-left: 4px;
  }

  .btn-summarize svg {
    width: 14px;
    height: 14px;
  }

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

  .locale-select {
    font-size: 11px;
    padding: 2px 4px;
    margin-right: 6px;
  }

  .main {
    flex-direction: column;
  }

  .transcript-panel-wrapper {
    border-right: none;
    border-bottom: 1px solid var(--border);
    min-height: 45vh;
  }

  .transcript-panel {
    padding: 16px;
  }

  .transcript-footnote {
    padding: 6px 16px;
  }

  .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 {
    width: 100%;
    padding: 16px;
  }

  aside.config-panel.hidden {
    width: 100%;
    height: 0;
    padding: 0;
  }

  .lang-row {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    margin-bottom: 12px;
  }

  .lang-row select {
    width: 100%;
  }

  .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;
  }
}

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

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

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

