/* TrueCentral Share — página del destinatario y portada.
   Mismo lenguaje visual que el panel web de TrueCentral y la consola: barra
   grafito con el logo, contenido claro, tarjetas blancas y el azul de la marca.
   El video va en un marco negro. Íconos: Material Design Icons (consola/vendor). */
:root {
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: Consolas, "Cascadia Mono", "SF Mono", monospace;
  --bg: #f3f5f8;
  --panel: #ffffff;
  --panel-2: #f6f8fb;
  --border: #e2e7ee;
  --text: #1b2633;
  --text-body: #4a5868;
  --muted: #7b8798;
  --accent: #1f6feb;
  --accent-hover: #1a5fd0;
  --accent-soft: #6cb3fa;
  --accent-rgb: 31, 111, 235;
  --danger-rgb: 229, 72, 77;
  --ok-rgb: 31, 157, 85;
  --warn-rgb: 245, 159, 0;
  --danger-text: #c4282d;
  --ok-text: #157a42;
  --warn-text: #a86500;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .10);
  --top-bg: #0f141a;
  --top-text: #c9d3df;
  --top-muted: #7d8a9a;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text-body); font: 14.5px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2 { color: var(--text); font-weight: 600; }
h1 { font-size: 20px; margin: 0 0 6px; line-height: 1.3; }
h2 { font-size: 15.5px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
h2 .mdi { color: var(--accent); font-size: 18px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.lead { font-size: 15px; color: var(--text-body); margin: 4px 0 0; }
.mdi { line-height: 1; }

/* ---------- Barra superior y franja de marca ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; padding: 0 20px;
  background: var(--top-bg); color: var(--top-text); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { width: 34px; height: 34px; border-radius: 8px; flex: none; }
.brand-name { color: #fff; font-size: 17px; font-weight: 600; letter-spacing: .1px; white-space: nowrap; }
.brand-name b { color: var(--accent-soft); font-weight: 600; }
.top-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--top-text);
  border: 1px solid rgba(255, 255, 255, .12); border-radius: 999px; padding: 4px 11px; white-space: nowrap; }
.top-tag .mdi { color: var(--accent-soft); font-size: 15px; }
/* La franja grafito sigue bajo la barra y la primera tarjeta se monta sobre ella. */
.band { height: 110px; background: var(--top-bg); border-top: 1px solid rgba(255, 255, 255, .06); }
main { position: relative; max-width: 960px; margin: -86px auto 0; padding: 0 16px 28px; }

/* ---------- Tarjetas ---------- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px 24px;
  margin: 0 0 16px; box-shadow: var(--shadow); }
.card.narrow, .card.hero, .card.summary { box-shadow: var(--shadow-lg); }
.card.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
.card-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: rgba(var(--accent-rgb), .10); color: var(--accent); font-size: 24px; margin-bottom: 14px; }
.card-icon.bad { background: rgba(var(--danger-rgb), .10); color: var(--danger-text); }

/* ---------- Pasos (sobre la franja grafito) ---------- */
.steps { list-style: none; display: flex; justify-content: center; align-items: center; gap: 6px; margin: 0 auto 14px;
  padding: 0; max-width: 560px; }
.steps li { display: flex; align-items: center; gap: 8px; color: var(--top-muted); font-size: 13px; }
.steps li + li::before { content: ""; width: 34px; height: 1px; background: rgba(255, 255, 255, .18); margin-right: 2px; }
.step-n { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; border: 1px solid rgba(255, 255, 255, .25); color: var(--top-text); }
.steps li.on { color: #fff; }
.steps li.on .step-n { background: var(--accent); border-color: var(--accent); color: #fff; }
.steps li.done { color: var(--top-text); }
.steps li.done .step-n { background: rgba(var(--ok-rgb), .9); border-color: transparent; color: #fff; }

/* ---------- Botones y campos ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600;
  font-size: 14px; padding: 9px 18px; border-radius: var(--radius); border: 1px solid var(--accent); background: var(--accent);
  color: #fff; cursor: pointer; transition: background .12s, border-color .12s; }
.btn:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: var(--panel); color: var(--text); border-color: var(--border); }
.btn.ghost:hover:not(:disabled) { background: var(--panel-2); border-color: #cfd6df; }
.btn:focus-visible, .play:focus-visible, input:focus-visible { outline: 2px solid rgba(var(--accent-rgb), .45); outline-offset: 2px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 0; }
label { display: block; font-weight: 600; color: var(--text); font-size: 13px; margin: 0 0 6px; }
.code-form { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.code-row { display: flex; gap: 8px; flex-wrap: wrap; }
.code-input { font: 600 22px/1 var(--mono); letter-spacing: .35em; text-align: center; width: 10.5em; padding: 10px 8px 10px 14px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel-2); color: var(--text); }
.code-input::placeholder { color: #c5ccd6; }
.code-input:focus { border-color: var(--accent); background: var(--panel); }
label.check { display: flex; gap: 9px; align-items: center; font-weight: 500; font-size: 14px; margin: 16px 0 0; cursor: pointer; }
label.check input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }

/* ---------- Mensajes ---------- */
.alert, .ok { border-radius: var(--radius); padding: 10px 12px; margin: 14px 0 0; font-size: 13.5px; }
.alert { background: rgba(var(--danger-rgb), .08); color: var(--danger-text); border: 1px solid rgba(var(--danger-rgb), .25); }
.ok { background: rgba(var(--ok-rgb), .08); color: var(--ok-text); border: 1px solid rgba(var(--ok-rgb), .25); }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); padding: 12px 0; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(var(--accent-rgb), .2);
  border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Datos y aviso ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-body); background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; max-width: 100%; }
.chip .mdi { color: var(--muted); font-size: 14px; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.code { font-family: var(--mono); color: var(--text); font-weight: 600; background: rgba(var(--accent-rgb), .08);
  border-color: rgba(var(--accent-rgb), .25); }
.chip.code .mdi { color: var(--accent); }
.message { margin: 16px 0 0; padding: 10px 14px; border-left: 3px solid var(--accent-soft); background: var(--panel-2);
  border-radius: 0 var(--radius) var(--radius) 0; white-space: pre-wrap; color: var(--text); font-style: italic; }
.notice { margin: 16px 0 0; border: 1px solid rgba(var(--warn-rgb), .35); background: rgba(var(--warn-rgb), .07);
  border-radius: var(--radius); padding: 12px 14px; }
.notice-head { display: flex; align-items: center; gap: 7px; font-weight: 600; color: var(--warn-text); font-size: 13px; margin-bottom: 6px; }
.notice-head .mdi { font-size: 17px; }
#n-notice { white-space: pre-wrap; font-size: 13.5px; color: var(--text-body); }

/* ---------- Contenido ---------- */
.summary-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.summary-text { flex: 1 1 auto; min-width: 0; max-width: 100%; }
.summary-text h1 { overflow-wrap: anywhere; }
.plays { flex: none; display: flex; align-items: center; gap: 10px; background: rgba(var(--accent-rgb), .07);
  border: 1px solid rgba(var(--accent-rgb), .2); border-radius: var(--radius-lg); padding: 8px 14px; }
.plays-n { font-size: 26px; font-weight: 700; color: var(--accent); line-height: 1; }
.plays-l { font-size: 11.5px; line-height: 1.25; color: var(--text-body); }
.note { display: flex; gap: 8px; align-items: flex-start; margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--muted); }
.note > .mdi { font-size: 16px; color: var(--accent); margin-top: 1px; }
.video-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.video-head .mdi { font-size: 20px; color: var(--accent); }
.video-head h2 { margin: 0; }
.video-meta { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin: 0 0 12px; }
/* ---------- Reproductor ---------- */
/* Marco negro + barra grafito (la de la marca); los dos van juntos a pantalla completa. */
.player { border-radius: 8px; overflow: hidden; background: #000; }
.stage { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.viewport { position: absolute; inset: 0; overflow: hidden; cursor: pointer; touch-action: pan-y; }
.stage.zoomed .viewport { cursor: grab; touch-action: none; }
.stage.zoomed .viewport:active { cursor: grabbing; }
.viewport video { width: 100%; height: 100%; display: block; object-fit: contain; transform-origin: 0 0; background: #000; }
.play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column;
  align-items: center; gap: 10px; background: none; border: 0; color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.play .mdi { width: 68px; height: 68px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 40px; background: var(--accent); box-shadow: 0 6px 20px rgba(0, 0, 0, .45); transition: transform .12s, background .12s; }
.play:hover:not(:disabled) .mdi { transform: scale(1.06); background: var(--accent-hover); }
.play:disabled { opacity: .6; cursor: progress; }
.zoom-badge { position: absolute; left: 10px; top: 10px; background: rgba(15, 20, 26, .78); color: #fff; font-size: 12px;
  padding: 3px 10px; border-radius: 999px; pointer-events: none; }
.pbar { background: var(--top-bg); color: var(--top-text); padding: 6px 12px 8px; }
/* Línea de tiempo: la barra, lo reproducido, la perilla y los eventos del expediente en ámbar. */
.track { position: relative; height: 20px; cursor: pointer; touch-action: none; }
.track::before { content: ""; position: absolute; left: 0; right: 0; top: 8px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .18); }
.track-fill { position: absolute; left: 0; top: 8px; height: 4px; width: 0; border-radius: 2px; background: var(--accent-soft); }
.track-knob { position: absolute; left: 0; top: 4px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .5); pointer-events: none; }
.track-tip { position: absolute; bottom: 22px; transform: translateX(-50%); background: #fff; color: var(--text); font: 11.5px var(--mono);
  padding: 2px 6px; border-radius: 4px; pointer-events: none; white-space: nowrap; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.mark { position: absolute; top: 1px; width: 12px; height: 18px; margin-left: -6px; padding: 0; border: 0; background: none; cursor: pointer; }
.mark::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 16px; border-radius: 2px; background: #f5a524;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); }
.mark:hover::after, .mark:focus-visible::after { background: #ffd166; }
.pctl { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin-top: 2px; }
.pctl-group { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.pbtn { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 6px;
  background: none; color: #e6ebf1; cursor: pointer; font-size: 21px; }
.pbtn:hover:not(:disabled) { background: rgba(255, 255, 255, .09); }
.pbtn:disabled { opacity: .35; cursor: default; }
.pbtn:focus-visible, .pspeed:focus-visible, .pzoom:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 1px; }
.ptime { display: flex; flex-direction: column; line-height: 1.15; margin-left: 8px; font-variant-numeric: tabular-nums; }
.ptime b { font: 600 14px var(--mono); color: #fff; }
.ptime-rel { font-size: 11.5px; color: var(--top-muted); }
.pspeed { background: rgba(255, 255, 255, .06); color: #e6ebf1; border: 1px solid rgba(255, 255, 255, .16); border-radius: 6px;
  font: 600 13px var(--font); height: 32px; padding: 0 6px; cursor: pointer; margin-right: 4px; }
.pspeed option { color: var(--text); background: #fff; }
.pzoom-group { display: inline-flex; align-items: center; border: 1px solid rgba(255, 255, 255, .16); border-radius: 6px; margin-right: 4px; }
.pzoom-group .pbtn { width: 32px; height: 30px; font-size: 19px; }
.pzoom { min-width: 54px; background: none; border: 0; color: #e6ebf1; font: 600 12.5px var(--font); cursor: pointer; padding: 0 2px; }
.pnote { margin: 8px 0 0; }
.pnote:empty { display: none; }
.pkeys { display: flex; gap: 6px; align-items: center; font-size: 11.5px; color: var(--muted); margin: 8px 0 0; }
.pkeys .mdi { font-size: 15px; }
@media (hover: none) { .pkeys { display: none; } }
.btn.tiny { padding: 3px 9px; font-size: 12px; gap: 4px; }
.player:fullscreen { display: flex; flex-direction: column; border-radius: 0; width: 100%; height: 100%; }
.player:fullscreen .stage { aspect-ratio: auto; flex: 1 1 auto; }
/* Descarga de la copia (si quien compartió la permitió). */
.pdl { margin: 12px 0 0; }
.pdl-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pdl-ask { border: 1px solid rgba(var(--accent-rgb), .3); background: rgba(var(--accent-rgb), .05); border-radius: var(--radius);
  padding: 12px 14px; }
.pdl-ask p { margin: 0; font-size: 13.5px; color: var(--text-body); }
.pdl-ask .actions { margin-top: 10px; }
.hash { margin: 14px 0 0; padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius); }
.hash-l { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.hash-l .mdi { color: var(--ok-text); font-size: 15px; }
.hash-v { font: 12px/1.45 var(--mono); color: var(--text-body); word-break: break-all; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; background: var(--panel-2); }
tr:last-child td { border-bottom: 0; }

/* ---------- Portada ---------- */
.hero { display: flex; gap: 18px; align-items: center; padding: 26px 28px; }
.hero img { width: 64px; height: 64px; border-radius: 14px; flex: none; }
.hero h1 { font-size: 22px; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 16px; }
.home-grid .card { margin: 0; }
.home-grid h2 { margin-bottom: 8px; }
.list { margin: 6px 0 10px; padding-left: 20px; }
.list li { margin: 6px 0; }

/* ---------- Pie ---------- */
.foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 6px 16px 30px; }
.foot p { margin: 4px 0; }
.foot .mdi { color: var(--accent); }
.foot-brand { font-size: 11.5px; color: #a3adba; }

/* ---------- Celular ---------- */
@media (max-width: 640px) {
  .top { padding: 0 14px; }
  .top-tag { display: none; }
  .band { height: 96px; }
  main { margin-top: -76px; padding: 0 12px 24px; }
  .card { padding: 18px 16px; }
  .steps li > span:last-child { display: none; }
  .steps li.on > span:last-child { display: inline; }
  .summary-head { flex-direction: column; }
  .summary-text { width: 100%; }
  .hero { flex-direction: column; align-items: flex-start; padding: 20px 18px; }
  .code-input { width: 100%; }
  .code-row .btn { width: 100%; }
  .pkeys { display: none; }
  /* Eventos apilados: fecha arriba, tipo y detalle debajo, «Ver» al costado. */
  #c-events-card table, #c-events-card tbody { display: block; }
  #c-events-card thead { display: none; }
  #c-events tr { display: grid; grid-template-columns: 1fr auto; column-gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
  #c-events tr:last-child { border-bottom: 0; }
  #c-events td { grid-column: 1; border: 0; padding: 0; }
  #c-events td:nth-child(1) { font-weight: 600; color: var(--text); }
  #c-events td:nth-child(2), #c-events td:nth-child(4) { font-size: 12px; color: var(--muted); }
  #c-events td:nth-child(5) { grid-column: 2; grid-row: 1 / span 4; align-self: center; }
}
