/* Modo puente: estilo claro y limpio (referencias: revolut.com, bia.app). Redefine los tokens de
   styles.css solo en esta pagina; el resto de la app sigue en oscuro. Barra superior, portada
   breve y dos columnas en escritorio (ajustes | panel en vivo); una columna en el celular. */
.bridge-page {
  color-scheme: light;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f3f4f7;
  --surface-3: #e9ebf0;
  --surface-4: #dcdfe6;
  --line: #e6e8ee;
  --line-strong: #d3d7e0;
  --ink: #0f1222;
  --muted: #5f6677;
  --primary: #1f5eff;
  --primary-hover: #174ee0;
  --primary-soft: rgba(31, 94, 255, 0.1);
  --success: #16a34a;
  --success-ink: #15803d;
  --success-soft: rgba(22, 163, 74, 0.12);
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-soft: rgba(220, 38, 38, 0.1);
  --warning: #b45309;
  --warning-soft: rgba(245, 158, 11, 0.14);
  --focus: 0 0 0 4px rgba(31, 94, 255, 0.22);
  --radius-lg: 24px;
  --radius: 16px;
  --shadow-card: 0 1px 2px rgba(15, 18, 34, 0.04), 0 12px 32px rgba(15, 18, 34, 0.06);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.bridge-page .secondary {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}

.bridge-page .secondary:hover:not(:disabled) {
  background: var(--surface-2);
}

.bridge-page .primary {
  box-shadow: 0 10px 24px rgba(31, 94, 255, 0.28);
}

.bridge-page .danger {
  box-shadow: 0 10px 24px rgba(220, 38, 38, 0.22);
}

.bridge-page .btn-lg {
  border-radius: 999px;
  min-height: 56px;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.bridge-page .btn-sm {
  border-radius: 999px;
}

/* ---------- Barra superior ---------- */
.bridge-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.bridge-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.bridge-logo {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #fff;
}

.bridge-brand-tag {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.bridge-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.bridge-link {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  transition:
    background-color 150ms ease,
    border-color 150ms ease;
}

.bridge-link:hover {
  background: var(--surface-2);
  border-color: var(--surface-4);
}

/* ---------- Contenido ---------- */
.bridge {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 28px 80px;
  display: grid;
  gap: 32px;
}

.bridge-hero {
  display: grid;
  gap: 14px;
  max-width: 760px;
}

.bridge-hero h1 {
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.bridge-hero .muted {
  font-size: 1.15rem;
  line-height: 1.5;
}

.bridge-chips {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bridge-chips li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 18, 34, 0.04);
}

.bridge-chips li::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.bridge-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(380px, 0.9fr);
  gap: 24px;
  align-items: start;
}

.bridge-column {
  display: grid;
  gap: 24px;
}

@media (max-width: 980px) {
  .bridge-layout {
    grid-template-columns: 1fr;
  }
  .bridge-topbar {
    padding: 10px 16px;
  }
  .bridge {
    padding: 32px 16px 56px;
    gap: 24px;
  }
}

/* ---------- Tarjetas ---------- */
.bridge-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: grid;
  gap: 20px;
  box-shadow: var(--shadow-card);
}

.bridge-card-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.bridge-card-head > div {
  flex: 1;
  display: grid;
  gap: 3px;
}

.bridge-card-head .muted {
  font-size: 0.92rem;
}

.bridge-card h2 {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.bridge-step {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 800;
}

.bridge-badge {
  align-self: center;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.bridge-run-card {
  position: sticky;
  top: 84px;
}

@media (max-width: 980px) {
  .bridge-run-card {
    position: static;
  }
}

/* ---------- Campos ---------- */
.bridge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.bridge-subgrid {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.bridge-field {
  display: grid;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}

.bridge-field-wide {
  grid-column: 1 / -1;
}

.bridge-field select,
.bridge-field input,
.bridge-header-actions select {
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 500;
  min-width: 0;
  width: 100%;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background-color 150ms ease;
}

.bridge-field select:hover,
.bridge-field input:hover {
  border-color: #b8bdc9;
}

.bridge-field input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.bridge-header-actions select {
  width: auto;
  min-height: 40px;
  border-radius: 999px;
  padding: 0 14px;
  font-weight: 600;
}

.bridge-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ink);
  font-weight: 500;
  cursor: pointer;
}

.bridge-check input {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

/* ---------- Avisos ---------- */
.bridge-hint {
  margin: 0;
  padding: 12px 16px 12px 44px;
  position: relative;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid transparent;
}

.bridge-hint::before {
  content: 'i';
  position: absolute;
  left: 14px;
  top: 12px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.74rem;
  font-weight: 800;
  background: var(--surface-4);
  color: var(--ink);
}

.bridge-hint:empty {
  display: none;
}

.bridge-hint.ok {
  color: var(--success-ink);
  background: var(--success-soft);
}

.bridge-hint.ok::before {
  content: '✓';
  background: var(--success);
  color: #fff;
}

.bridge-hint.warn {
  color: var(--warning);
  background: var(--warning-soft);
}

.bridge-hint.warn::before {
  content: '!';
  background: #f59e0b;
  color: #1b1300;
}

.bridge-hint a {
  color: inherit;
}

.bridge-alert {
  margin: 0;
  padding: 12px 16px;
  border-radius: 14px;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid rgba(220, 38, 38, 0.3);
  font-weight: 500;
}

.bridge-steps {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 12px;
  color: var(--muted);
  line-height: 1.55;
}

.bridge-steps li::marker {
  color: var(--primary);
  font-weight: 800;
}

.bridge-steps strong {
  color: var(--ink);
  font-weight: 700;
}

/* Solo los pasos de la salida elegida (puente.js pone data-output). */
.bridge-steps[data-output='bot'] li:not([data-for~='bot']),
.bridge-steps[data-output='extension'] li:not([data-for~='extension']),
.bridge-steps[data-output='cable'] li:not([data-for~='cable']) {
  display: none;
}

/* ---------- Panel en vivo ---------- */
.bridge-live {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.bridge-ring {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  transition:
    border-color 200ms ease,
    box-shadow 200ms ease;
}

.bridge-ring:has(.bridge-dot.on) {
  border-color: var(--success);
  box-shadow: 0 0 0 8px var(--success-soft);
}

.bridge-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface-4);
  transition: background-color 150ms ease;
}

.bridge-dot.on {
  background: var(--success);
}

.bridge-live-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 10px;
}

.bridge-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.08rem;
  letter-spacing: -0.01em;
}

.bridge-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 22px;
}

.bridge-bars span {
  width: 5px;
  height: 20%;
  border-radius: 3px;
  background: var(--surface-4);
  transition: background-color 200ms ease;
}

.bridge-live:has(.bridge-dot.on) .bridge-bars span {
  background: var(--success);
  animation: bridge-bar 700ms ease-in-out infinite alternate;
}

.bridge-live:has(.bridge-dot.on) .bridge-bars span:nth-child(2n) {
  animation-delay: -200ms;
}

.bridge-live:has(.bridge-dot.on) .bridge-bars span:nth-child(3n) {
  animation-delay: -450ms;
}

@keyframes bridge-bar {
  from {
    height: 20%;
  }
  to {
    height: 100%;
  }
}

.bridge-caption-title {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.bridge-phrases {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  min-height: 180px;
  max-height: 440px;
  overflow-y: auto;
}

.bridge-phrases:empty {
  display: grid;
  place-items: center;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.92rem;
}

.bridge-phrases:empty::before {
  content: 'Aqui apareceran tus frases y su traduccion.';
}

html[lang='en'] .bridge-phrases:empty::before {
  content: 'Your sentences and their translation will show here.';
}

.bridge-phrases li {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface-2);
  display: grid;
  gap: 6px;
  animation: bridge-in 180ms ease;
}

@keyframes bridge-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.bridge-phrases .original {
  color: var(--muted);
  font-size: 0.9rem;
}

.bridge-phrases .translated {
  font-weight: 600;
  padding-left: 12px;
  border-left: 3px solid var(--primary);
}

/* Frases de los demas, oidas por el bot en la reunion. */
.bridge-phrases li.theirs {
  background: var(--success-soft);
}

.bridge-phrases li.theirs .translated {
  border-left-color: var(--success);
}

.bridge-phrases .translated:empty::before {
  content: '…';
  color: var(--muted);
  font-weight: 400;
}

.bridge-foot {
  font-size: 0.84rem;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.bridge-diag {
  display: grid;
  gap: 2px;
  font-size: 0.78rem;
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  padding-left: 16px;
}

.bridge-diag::before {
  content: none;
}

@media (max-width: 600px) {
  .bridge-brand-tag {
    display: none;
  }
  .bridge-link {
    padding: 8px 12px;
    font-size: 0.85rem;
  }
}
