/* translate.mongi.dev — closed captions EN | ES. Alto contraste, sin dependencias. */
:root {
  --bg: #0b0d10; --panel: #14181d; --line: #2a3139; --fg: #ffffff; --muted: #b8c0c8;
  --accent: #4fc3f7; --accent-fg: #00131c; --ok: #7ee787; --warn: #ffd166; --err: #ff8a80;
  --fs: 28px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); }
[hidden] { display: none !important; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; background: var(--accent); color: var(--accent-fg); padding: 6px 10px; z-index: 10; }
:focus-visible { outline: 3px solid var(--warn); outline-offset: 2px; }

/* Botones y formularios */
.btn {
  font: inherit; font-size: 15px; padding: 7px 12px; border-radius: 8px; cursor: pointer;
  background: #222a33; color: var(--fg); border: 1px solid #44505c; min-height: 38px;
}
.btn:hover { background: #2c3641; }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 600; }
.btn.primary[aria-pressed="true"] { background: var(--err); border-color: var(--err); color: #1a0000; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
select, input { font: inherit; font-size: 15px; background: #0f1317; color: var(--fg); border: 1px solid #44505c; border-radius: 8px; padding: 7px 10px; }
.sel { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.group { display: inline-flex; gap: 4px; }

/* Acceso */
.login { min-height: 100%; display: grid; place-items: center; padding: 20px; }
.card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px; display: grid; gap: 12px; }
.card h1 { margin: 0; font-size: 26px; }
.card p { margin: 0; color: var(--muted); }
.card label { font-weight: 600; }
h1 span, .brand span { color: var(--accent); }
.msg { margin: 0; min-height: 1.2em; font-size: 14px; color: var(--warn); }
.msg.error { color: var(--err); }

/* Barra superior */
.app { height: 100%; display: flex; flex-direction: column; }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #0f1317; }
.brand { margin: 0; font-size: 18px; white-space: nowrap; }
.controls { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.status { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; width: 100%; }
.pill { font-size: 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
#mic-state.on { color: var(--ok); border-color: var(--ok); }
.banner { margin: 0; padding: 10px 14px; background: #3a2a00; color: #fff3cd; border-bottom: 1px solid var(--warn); font-size: 15px; }

/* Paneles */
.panes { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.pane { min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.pane:last-child { border-right: 0; }
.pane h2 { margin: 0; padding: 8px 16px; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); border-bottom: 1px solid var(--line); background: var(--panel); }
.scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 18px 28px; scroll-behavior: smooth; }
.seg { margin: 0 0 .5em; font-size: var(--fs); line-height: 1.35; color: var(--fg); overflow-wrap: anywhere; }
.seg .t { display: block; font-size: 12px; line-height: 1.4; color: var(--muted); font-family: ui-monospace, monospace; }
.seg.pending .tx { color: var(--muted); }
.seg.preview .tx { color: #cfd6dd; font-style: italic; }
.seg.local .tx::after { content: " ⓛ"; font-size: .55em; color: var(--warn); vertical-align: super; }
.seg.failed .tx { color: var(--err); font-style: italic; }
.interim { margin: 0; font-size: var(--fs); line-height: 1.35; color: #9aa4ae; font-style: italic; min-height: 1.35em; overflow-wrap: anywhere; }

/* Disposición: auto = columnas en horizontal, filas en vertical/móvil */
body[data-layout="rows"] .panes { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
body[data-layout="rows"] .pane { border-right: 0; border-bottom: 1px solid var(--line); }
@media (orientation: portrait), (max-width: 760px) {
  body[data-layout="auto"] .panes { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  body[data-layout="auto"] .pane { border-right: 0; border-bottom: 1px solid var(--line); }
  :root { --fs: 22px; }
  .btn { font-size: 14px; padding: 6px 9px; }
}

/* Modo closed caption a pantalla completa */
body.cc { background: #000; }
body.cc .bar, body.cc .banner, body.cc .seg .t { display: none; }
body.cc .app { background: #000; }
body.cc .pane { border-color: #222; }
body.cc .pane h2 { background: #000; color: #8fd8ff; border-color: #222; font-size: 13px; }
body.cc .scroll { padding: 16px 4vw 40px; scroll-behavior: auto; scrollbar-width: none; }
body.cc .seg, body.cc .interim { font-size: calc(var(--fs) * 1.45); font-weight: 600; line-height: 1.3; }
body.cc .seg { color: #fff; }
body.cc .cc-exit { position: fixed; right: 12px; bottom: 12px; opacity: .35; }
body.cc .cc-exit:hover, body.cc .cc-exit:focus { opacity: 1; }

/* Diálogo Compartir */
.share { width: min(760px, 94vw); background: var(--panel); color: var(--fg); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.share::backdrop { background: rgba(0, 0, 0, .7); }
.share h2 { margin: 0 0 8px; font-size: 20px; }
.share h2 span { color: var(--accent); font-family: ui-monospace, monospace; letter-spacing: .08em; }
.share .muted { color: var(--muted); font-size: 14px; margin: 6px 0; }
.share-body { display: flex; flex-wrap: wrap; gap: 18px; margin: 12px 0; align-items: flex-start; }
.share-body img { background: #fff; border-radius: 8px; width: 220px; height: 220px; }
.share-links { flex: 1; min-width: 260px; display: grid; gap: 6px; }
.share-links label { font-weight: 600; font-size: 14px; }
.share .row { display: flex; gap: 6px; }
.share .row input { flex: 1; min-width: 0; font-size: 13px; }
.share .row.end { justify-content: flex-end; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }

@media (prefers-reduced-motion: reduce) { .scroll { scroll-behavior: auto; } }

.gl-text { width: 100%; box-sizing: border-box; min-height: 300px; background: #0b0f14; color: var(--fg); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px; font: 14px/1.5 ui-monospace, monospace; resize: vertical; }
