:root {
  --bg: #f3f6fc;
  --surface: #ffffff;
  --surface-2: #e9eef8;
  --ink: #0e1a33;
  --ink-2: #43506b;
  --ink-3: #5f6b84;
  --line: #dce3f0;
  --ridder: #1b76ff;        /* azul de la marca (logo) */
  --accent: #1564e6;        /* azul Ridder un tono más oscuro: texto blanco legible en botones */
  --accent-ink: #ffffff;
  --brand: #0a1a3a;         /* marino: menú, barra del celular e ingreso */
  --brand-raised: #13285a;
  --brand-line: #1f3566;
  --brand-ink-2: #a9b8d6;
  --brand-ink-3: #8193b8;
  --red: #b8291d;
  --red-bg: #fde9e6;
  --amber: #8a5300;
  --amber-bg: #fff2d6;
  --green: #17703d;
  --green-bg: #e1f5e8;
  --blue: #2563c9;
  --blue-bg: #e3ecfb;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(18,22,26,.06), 0 2px 8px rgba(18,22,26,.05);
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  color-scheme: light;
}
/* Oscuro: sigue al sistema salvo que el usuario haya elegido claro; o forzado con data-theme="dark" */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #071022; --surface: #0f1a30; --surface-2: #16243f; --ink: #eaf0fb; --ink-2: #adb9d0; --ink-3: #7c89a4;
    --line: #22314f; --brand: #060d1c; --brand-raised: #112142; --brand-line: #182a4d;
    --red: #ff6b5c; --red-bg: #3a1714; --amber: #ffb547; --amber-bg: #352510;
    --green: #4ad584; --green-bg: #112d1d; --blue: #7aa7ff; --blue-bg: #15233d;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #071022; --surface: #0f1a30; --surface-2: #16243f; --ink: #eaf0fb; --ink-2: #adb9d0; --ink-3: #7c89a4;
  --line: #22314f; --brand: #060d1c; --brand-raised: #112142; --brand-line: #182a4d;
  --red: #ff6b5c; --red-bg: #3a1714; --amber: #ffb547; --amber-bg: #352510;
  --green: #4ad584; --green-bg: #112d1d; --blue: #7aa7ff; --blue-bg: #15233d;
  --shadow: none; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.4;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }

/* ---------- layout (celular: app con menú abajo) ---------- */
.shell { max-width: 760px; margin: 0 auto; min-height: 100dvh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.topbar { position: sticky; top: 0; z-index: 10; background: var(--brand); color: #fff; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; }
.topbar-row { display: flex; align-items: center; gap: 10px; }
.topbar h1 { font-size: 17px; margin: 0; font-weight: 700; flex: 1; letter-spacing: -.01em; }
.topbar .sub { font-size: 12px; color: var(--brand-ink-2); margin-top: 2px; }
.logo { height: 26px; width: auto; display: block; flex: none; }
.icon-btn { background: rgba(255,255,255,.08); border: 0; color: #fff; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:active { background: rgba(255,255,255,.18); }
.back { font-size: 20px; }
main { padding: 14px 16px; }

.nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
.nav-inner { max-width: 760px; margin: 0 auto; display: flex; }
.nav a, .nav-mas { flex: 1; min-width: 0; text-align: center; text-decoration: none; color: var(--ink-3); font-size: 11px; font-weight: 600;
  padding: 6px 0; border-radius: 10px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.nav-mas { background: none; border: 0; cursor: pointer; font-family: inherit; }
.nav a svg, .nav-mas svg { width: 22px; height: 22px; }
.nav a.on, .nav-mas.on { color: var(--ink); }
.nav a.on svg, .nav-mas.on svg { color: var(--ridder); }
.side-brand, .side-user { display: none; }
@media (max-width: 1023px) { .nav a.nav-extra { display: none; } }
@media (min-width: 1024px) { .nav-mas { display: none; } }

/* menú flotante (engranaje y "Más") */
.ajustes-menu { position: fixed; z-index: 60; min-width: 200px; background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.ajustes-menu[hidden] { display: none; }
.ajustes-menu a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500; }
.ajustes-menu a svg { width: 18px; height: 18px; color: var(--ink-3); }
.ajustes-menu a:hover, .ajustes-menu a:focus-visible { background: var(--surface-2); outline: none; }
.ajustes-menu a.on { color: var(--accent); }
.ajustes-menu a.on svg { color: var(--accent); }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
@media (min-width: 560px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpis.k5 { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 560px) { .kpis.k5 { grid-template-columns: repeat(5, 1fr); } }
.kpi { background: var(--surface); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); border: 0; text-align: left; color: inherit; cursor: default; }
button.kpi { cursor: pointer; }
button.kpi.on { outline: 2px solid var(--accent); }
.kpi .l { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; }
.kpi .v { font-size: 20px; font-weight: 600; margin-top: 4px; font-family: var(--mono); }
.kpi.alert .v { color: var(--red); }
.kpi.good .v { color: var(--green); }
.kpi.warn .v { color: var(--amber); }

/* ---------- controles ---------- */
.search { position: relative; margin-bottom: 10px; }
.search input { width: 100%; padding: 12px 14px 12px 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); outline: none; }
.search input:focus { border-color: var(--ink-2); }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; color: var(--ink-3); }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 12px; padding: 0 16px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; border: 1px solid var(--line); background: var(--surface); padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.tab .c { font-family: var(--mono); font-size: 12px; color: var(--ink-3); margin-left: 4px; }
.tab.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tab.on .c { color: var(--bg); opacity: .7; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .spacer { flex: 1; }
.toolbar input, .toolbar select { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 10px; min-width: 0; }
.toolbar input[type=month] { width: 160px; }

/* ---------- tarjetas y listas ---------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; display: block; text-decoration: none; border: 1px solid transparent; }
.card-top { display: flex; align-items: center; gap: 10px; }
.card-name { font-weight: 600; font-size: 15px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; display: flex; gap: 6px; flex-wrap: wrap; }
.card-bottom { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.badge { flex: none; font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 8px; font-family: var(--mono); }
.chip { font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.chip.red { background: var(--red-bg); color: var(--red); }
.chip.amber { background: var(--amber-bg); color: var(--amber); }
.chip.green { background: var(--green-bg); color: var(--green); }
.chip.blue { background: var(--blue-bg); color: var(--blue); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; display: inline-block; }
.dot.green { background: var(--green); } .dot.red { background: var(--red); } .dot.amber { background: var(--amber); } .dot.blue { background: var(--blue); }

.btn { border: 0; border-radius: 12px; padding: 12px 14px; font-weight: 600; cursor: pointer; text-align: center; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 14.5px; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-dark { background: var(--ink); color: var(--bg); }
.btn-ghost { background: var(--surface-2); color: var(--ink); }
.btn-danger { background: var(--red-bg); color: var(--red); }
.btn-ok { background: var(--green-bg); color: var(--green); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 10px; font-size: 13px; border-radius: 9px; }

.section { background: var(--surface); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); margin-bottom: 12px; }
.section h3 { margin: 0 0 12px; font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.section h3 .spacer { flex: 1; }
.field { margin-bottom: 10px; }
.field label { display: block; font-size: 12px; color: var(--ink-3); font-weight: 600; margin-bottom: 5px; }
.field input, .field select, .field textarea { width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); outline: none; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink-2); }
.field textarea { min-height: 70px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { font-size: 12px; color: var(--ink-3); margin-top: -4px; margin-bottom: 10px; }
.checks { display: flex; gap: 6px; flex-wrap: wrap; }
.checks label { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; font-size: 13px; font-weight: 600; cursor: pointer; background: var(--surface); }
.checks input { margin: 0; }
.checks label:has(input:checked) { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.switch-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 12px; font-size: 14px; }
.switch-row input { width: 20px; height: 20px; }

.row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row .info { flex: 1; min-width: 0; }
.row .n { font-weight: 600; }
.row .s { font-size: 12.5px; color: var(--ink-3); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.row.clickable { cursor: pointer; }
.row.clickable:hover { background: var(--surface-2); margin: 0 -14px; padding-left: 14px; padding-right: 14px; }
.avatar { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--ink-2); flex: none; }
.timeline { display: flex; flex-direction: column; }
.ev { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; align-items: center; }
.ev:first-child { border-top: 0; padding-top: 0; }
.ev .h { font-family: var(--mono); font-weight: 600; min-width: 48px; }
.ev .t { font-weight: 600; min-width: 60px; }
.ev .o { color: var(--ink-3); font-size: 12.5px; }
.ev .nota { color: var(--ink-2); font-size: 12.5px; flex-basis: 100%; }

/* ---------- marcar ---------- */
.reloj { text-align: center; padding: 18px 0 6px; }
.reloj .hora { font-family: var(--mono); font-size: 52px; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.reloj .fecha { color: var(--ink-3); margin-top: 6px; font-size: 14px; text-transform: capitalize; }
.marcar-btn { width: 100%; max-width: 420px; margin: 18px auto 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  aspect-ratio: 1.6; border: 0; border-radius: 28px; font-size: 24px; font-weight: 700; cursor: pointer; color: #fff; box-shadow: 0 10px 30px rgba(21,100,230,.3); transition: transform .1s; }
.marcar-btn:active { transform: scale(.98); }
.marcar-btn:disabled { opacity: .6; cursor: default; }
.marcar-btn.entrada { background: linear-gradient(160deg, #1b76ff, #1050c8); }
.marcar-btn.salida { background: linear-gradient(160deg, #17703d, #0f4d2a); box-shadow: 0 10px 30px rgba(23,112,61,.3); }
.marcar-btn small { font-size: 13px; font-weight: 500; opacity: .85; }
.marcar-btn svg { width: 44px; height: 44px; margin-bottom: 4px; }
.estado-ubic { text-align: center; font-size: 13px; color: var(--ink-3); min-height: 20px; margin-bottom: 14px; }

/* ---------- calendario ---------- */
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-head h2 { flex: 1; text-align: center; margin: 0; font-size: 16px; text-transform: capitalize; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dn { text-align: center; font-size: 11px; color: var(--ink-3); font-weight: 600; padding: 4px 0; text-transform: uppercase; }
.cal .d { aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 13px; font-weight: 600; cursor: pointer; padding: 0; color: var(--ink); position: relative; }
.cal .d.vacio { border: 0; background: transparent; cursor: default; }
.cal .d.on { outline: 2px solid var(--accent); }
.cal .d.hoy { border-color: var(--accent); border-width: 2px; }
.cal .d .e { font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.cal .d.presente { background: var(--green-bg); color: var(--green); }
.cal .d.tarde { background: var(--amber-bg); color: var(--amber); }
.cal .d.ausente { background: var(--red-bg); color: var(--red); }
.cal .d.justificado { background: var(--blue-bg); color: var(--blue); }
.cal .d.franco { color: var(--ink-3); background: var(--surface-2); }
.cal .d .mark { position: absolute; top: 4px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.leyenda { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); margin: 10px 0 0; }
.leyenda span { display: inline-flex; align-items: center; gap: 4px; }
.leyenda i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.dia-detalle { margin-top: 12px; }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: var(--brand); }
.login-box { width: 100%; max-width: 360px; }
.login-brand { color: #fff; margin-bottom: 30px; }
.login-logo { display: block; width: 210px; max-width: 70%; height: auto; margin: 0 0 18px -6px; }
.login-brand h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.login-brand p { margin: 4px 0 0; color: var(--brand-ink-2); font-size: 13.5px; }
.login .field label { color: var(--brand-ink-2); }
.login .field input { background: var(--brand-raised); border-color: var(--brand-line); color: #fff; padding: 13px 14px; }
.login .field input:focus { border-color: var(--ridder); box-shadow: 0 0 0 3px rgba(27,118,255,.25); }
.err { background: var(--red-bg); color: var(--red); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 10px; }

/* ---------- misc ---------- */
.empty { text-align: center; color: var(--ink-3); padding: 40px 20px; font-size: 14px; }
.loading { text-align: center; color: var(--ink-3); padding: 40px; }
.spin { width: 22px; height: 22px; border: 2.5px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .7s linear infinite; margin: 0 auto 10px; }
@keyframes spin { to { transform: rotate(360deg); } }
.banner { background: var(--amber-bg); color: var(--amber); font-size: 12.5px; padding: 8px 12px; border-radius: 10px; margin-bottom: 12px; font-weight: 500; }
.banner.info { background: var(--blue-bg); color: var(--blue); }
.updated { font-size: 11.5px; color: var(--ink-3); text-align: center; margin: 14px 0 4px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.live { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
#toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: .2s; z-index: 70; max-width: calc(100% - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--surface); width: 100%; max-width: 520px; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 90dvh; overflow-y: auto; }
@media (min-width: 560px) { .modal-bg { align-items: center; } .modal { border-radius: 18px; } }
.modal h3 { margin: 0 0 14px; font-size: 17px; }
.modal-actions { display: flex; gap: 8px; margin-top: 6px; }
.modal-actions .btn { flex: 1; }

/* ---------- tablas ---------- */
.tabla-wrap { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
.tabla { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tabla th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; padding: 11px 10px; background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
.tabla td { padding: 9px 10px; border-top: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.tabla td.wrap { white-space: normal; }
.tabla td.r, .tabla th.r { text-align: right; }
.tabla tfoot td { font-weight: 700; background: var(--surface-2); }

/* ---------- escritorio: panel con barra lateral ---------- */
@media (min-width: 1024px) {
  body { font-size: 14.5px; }
  .shell { max-width: none; padding-bottom: 0; display: grid; grid-template-columns: 232px minmax(0, 1fr); grid-template-rows: auto 1fr; align-items: start; }
  .nav { position: sticky; top: 0; bottom: auto; left: auto; right: auto; height: 100dvh; grid-column: 1; grid-row: 1 / span 2; background: var(--brand); border: 0; padding: 22px 14px 18px; display: flex; flex-direction: column; gap: 22px; }
  .side-brand { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 0 0; text-align: center; }
  .side-logo { width: 150px; height: auto; display: block; }
  .side-brand span { font-size: 13px; font-weight: 600; color: var(--brand-ink-2); letter-spacing: .01em; }
  .nav-inner { max-width: none; flex-direction: column; gap: 2px; flex: 1; }
  .nav a { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 11px 12px; font-size: 14px; color: var(--brand-ink-2); border-radius: 10px; }
  .nav a svg { width: 19px; height: 19px; }
  .nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
  .nav a.on { background: var(--accent); color: var(--accent-ink); }
  .nav a.on svg { color: var(--accent-ink); }
  .side-user { display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--brand-line); color: #fff; }
  .side-user .avatar { background: var(--brand-raised); color: var(--brand-ink-2); }
  .side-user-txt { min-width: 0; flex: 1; }
  .side-user b { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-user span { display: block; font-size: 11.5px; color: var(--brand-ink-3); }
  .gear-top { display: none; }
  .gear-side { display: inline-flex; flex: none; width: 34px; height: 34px; background: transparent; color: var(--brand-ink-2); border: 0; }
  .gear-side:hover { background: rgba(255,255,255,.08); color: #fff; }
  .gear-side.on { color: #fff; background: rgba(255,255,255,.1); }
  .topbar { position: static; grid-column: 2; background: transparent; color: var(--ink); padding: 30px 28px 6px; max-width: 1360px; width: 100%; justify-self: center; }
  .topbar .logo { display: none; }
  .topbar h1 { font-size: 26px; letter-spacing: -.02em; }
  .topbar .sub { font-size: 13.5px; color: var(--ink-3); margin-top: 3px; }
  .topbar .icon-btn { background: var(--surface); color: var(--ink); border: 1px solid var(--line); width: 40px; height: 40px; }
  main { grid-column: 2; padding: 14px 28px 48px; max-width: 1360px; width: 100%; justify-self: center; }
  #toast { bottom: 28px; }
  .kpis { gap: 14px; margin-bottom: 18px; }
  .kpi { padding: 16px 18px; }
  .kpi .v { font-size: 26px; }
  .tabs { flex-wrap: wrap; overflow: visible; margin: 0 0 14px; padding: 0; }
  .narrow { max-width: 560px; }
  .two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
  .modal { max-width: 600px; }
  .marcar-wrap { max-width: 560px; margin: 0 auto; }
  .cal .d { aspect-ratio: auto; height: 72px; font-size: 14px; }
}
@media (max-width: 1023px) { .gear-side { display: none; } }

/* ---------- selfie ---------- */
.selfie-box { position: relative; width: 100%; max-width: 420px; margin: 6px auto 0; aspect-ratio: 1; border-radius: 28px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; }
.selfie-box video, .selfie-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.selfie-box video { transform: scaleX(-1); } /* espejo, como la cámara del celular */
.selfie-msg { position: absolute; inset: auto 16px 16px; text-align: center; font-size: 13px; color: var(--ink-2); background: var(--surface); padding: 8px 10px; border-radius: 12px; }
.selfie-mini { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; flex: none; cursor: zoom-in; background: var(--surface-2); }
.selfie-grande { width: 100%; max-height: 70dvh; object-fit: contain; border-radius: 14px; background: var(--surface-2); }
.marcar-btn { margin-top: 12px; aspect-ratio: auto; padding: 16px; }
.ev > svg { width: 18px; height: 18px; flex: none; color: var(--ink-3); }
.selfie-box { max-height: 36dvh; }
