/* Ninbux · estilos de la app
   Paleta: cal (blanco encalado), nit (azul noche), cel (cielo), ametller (flor de almendro), pistil (centro de la flor) */

@font-face { font-family: 'Fredoka'; src: url('/fonts/fredoka-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Fredoka'; src: url('/fonts/fredoka-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Lexend'; src: url('/fonts/lexend-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Lexend'; src: url('/fonts/lexend-600.woff2') format('woff2'); font-weight: 600 700; font-display: swap; }

:root {
  --cal: #EAF2FD;
  --surface: #FFFFFF;
  --boira: #DCE6F7;
  --boira-2: #C8D6EE;
  --nit: #15224A;
  --nit-2: #4C5878;
  --nit-3: #7A84A0;
  --cel: #3B76E1;
  --cel-deep: #2A5CC0;
  --cel-soft: #E3ECFC;
  --ametller: #E8789A;
  --ametller-deep: #D25C80;
  --ametller-soft: #FCE6ED;
  --pistil: #F5B83D;
  --peligro: #C63A4C;
  --peligro-soft: #FBE7EA;
  --ok: #2E8B5E;
  --scrim: rgba(13, 22, 51, 0.48);
  --ring: #FFFFFF;
  --tab-h: 64px;
  --top-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --display: 'Fredoka', 'Lexend', system-ui, sans-serif;
  --text: 'Lexend', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

html[data-theme="dark"] {
    --cal: #0E1733;
    --surface: #16224A;
    --boira: #22305C;
    --boira-2: #2D3D70;
    --nit: #EEF2FB;
    --nit-2: #B3BDD9;
    --nit-3: #8591B3;
    --cel: #6FA0F0;
    --cel-deep: #8DB4F5;
    --cel-soft: #1E3466;
    --ametller: #F08DAB;
    --ametller-deep: #F5A5BD;
    --ametller-soft: #3A2245;
    --peligro: #F07A88;
    --peligro-soft: #3C1D2A;
    --ok: #5FC795;
    --scrim: rgba(3, 6, 18, 0.62);
    --ring: #0E1733;
    color-scheme: dark;
  }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cal);
  color: var(--nit);
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img, video { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--cel); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; margin: 0; line-height: 1.15; }
h1 { font-size: 30px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0; }
.muted { color: var(--nit-2); }
.small { font-size: 15px; }
.tiny { font-size: 13px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 14px; border: 0;
  font-weight: 600; font-size: 16px; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, transform .1s;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-primary { background: var(--cel); color: #fff; }
.btn-primary:hover { background: var(--cel-deep); }
html[data-theme="dark"] .btn-primary { color: #0E1733; }
.btn-blossom { background: var(--ametller); color: #fff; }
.btn-blossom:hover { background: var(--ametller-deep); }
html[data-theme="dark"] .btn-blossom { color: #0E1733; }
.btn-quiet { background: var(--boira); color: var(--nit); }
.btn-quiet:hover { background: var(--boira-2); }
.btn-ghost { background: transparent; color: var(--cel); padding: 0 12px; }
.btn-danger { background: var(--peligro-soft); color: var(--peligro); }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: transparent; color: var(--nit);
}
.icon-btn:hover { background: var(--boira); }
.icon-btn svg { width: 24px; height: 24px; }
.link { color: var(--cel); background: none; border: 0; padding: 0; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Formularios ---------- */
.field { display: grid; gap: 6px; }
.field label { font-size: 15px; font-weight: 600; color: var(--nit-2); }
.input {
  width: 100%; min-height: 52px; padding: 12px 16px; border-radius: 14px;
  border: 2px solid var(--boira-2); background: var(--surface); font-size: 17px;
}
.input:focus { outline: none; border-color: var(--cel); }
.form { display: grid; gap: 16px; }
.form-error { background: var(--peligro-soft); color: var(--peligro); padding: 12px 14px; border-radius: 12px; font-size: 15px; font-weight: 600; }

/* ---------- Marca ---------- */
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--nit); }
.brand img { width: 40px; height: auto; }
.wordmark { font-family: var(--display); font-weight: 600; font-size: 26px; letter-spacing: -0.02em; line-height: 1; }

/* ---------- Bienvenida ---------- */
.welcome { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; }
.welcome-sky {
  position: relative; overflow: hidden;
  padding: calc(28px + var(--safe-t)) 24px 40px;
  background: var(--cel); color: #fff;
}
html[data-theme="dark"] .welcome-sky { background: #1B3270; }
.welcome-sky .wordmark { font-size: 64px; display: block; margin: 18px 0 14px; }
.welcome-sky .lead { font-size: 20px; max-width: 26ch; line-height: 1.35; }
.welcome-sky .mark { width: 84px; height: auto; }
.sky-cloud { position: absolute; fill: rgba(255, 255, 255, 0.10); pointer-events: none; }
.welcome-body { padding: 28px 24px calc(32px + var(--safe-b)); display: grid; gap: 28px; align-content: start; max-width: 560px; width: 100%; }
.welcome-actions { display: grid; gap: 10px; }
@media (min-width: 900px) {
  .welcome { grid-template-rows: none; grid-template-columns: 1.1fr 1fr; }
  .welcome-sky { padding: 64px 56px; display: flex; flex-direction: column; justify-content: center; }
  .welcome-sky .wordmark { font-size: 96px; }
  .welcome-body { padding: 64px 56px; align-content: center; }
}

/* ---------- Planes ---------- */
.plans { display: grid; gap: 10px; }
.plan {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 16px;
  padding: 16px 18px; border-radius: 18px; background: var(--surface); border: 2px solid var(--boira);
}
.plan.is-highlight { border-color: var(--ametller); background: var(--ametller-soft); }
.plan-name { font-family: var(--display); font-weight: 600; font-size: 20px; display: flex; align-items: center; gap: 8px; }
.plan-name img { width: 22px; }
.plan-size { font-weight: 600; color: var(--nit-2); font-size: 15px; }
.plan-price { font-family: var(--display); font-weight: 600; font-size: 20px; text-align: right; }
.plan-price small { font-family: var(--text); font-weight: 400; font-size: 13px; color: var(--nit-2); display: block; }
.plan-desc { grid-column: 1 / -1; font-size: 15px; color: var(--nit-2); }
.plan .btn { grid-column: 1 / -1; margin-top: 8px; }
.plan.is-current { border-color: var(--cel); }
.plan.is-free { border-style: dashed; }
.plan.is-free.is-current { border-style: solid; }

/* Mensual / Anual */
.period { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--boira); }
.period button {
  border: 0; background: transparent; color: var(--nit-2); font: inherit; font-weight: 600; font-size: 15px;
  min-height: 40px; padding: 6px 14px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.period button.is-on { background: var(--surface); color: var(--nit); box-shadow: 0 1px 4px rgba(21, 34, 74, .14); }
.tiers { justify-self: start; align-self: start; width: fit-content; max-width: 100%; }
.period-save { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--ametller-soft); color: var(--ametller-deep); }
.section-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.section-subtitle { font-size: 17px; }
.stack-sm { display: grid; gap: 14px; }

/* ---------- Estructura de la app ---------- */
.shell { min-height: 100dvh; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(8px + var(--safe-t)) 12px 8px 16px; min-height: calc(var(--top-h) + var(--safe-t));
  background: color-mix(in srgb, var(--cal) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.topbar .wordmark { font-size: 24px; }
.topbar .brand img { width: 34px; }
.topbar-actions { display: flex; align-items: center; gap: 4px; }
.content { padding: 4px 16px calc(var(--tab-h) + 96px + var(--safe-b)); max-width: 1240px; margin: 0 auto; min-width: 0; }
.screen-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 12px; margin: 8px 0 18px; min-height: 44px; }
.screen-head > h1 { min-width: 0; overflow-wrap: anywhere; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--boira);
}
.tab {
  display: grid; place-items: center; align-content: center; gap: 2px;
  color: var(--nit-3); text-decoration: none; font-size: 12px; font-weight: 600;
}
.tab svg { width: 26px; height: 26px; }
.tab[aria-current='page'] { color: var(--cel); }

.fab {
  position: fixed; right: 18px; bottom: calc(var(--tab-h) + 18px + var(--safe-b)); z-index: 31;
  width: 64px; height: 64px; border-radius: 22px; border: 0;
  display: grid; place-items: center;
  background: var(--ametller); color: #fff;
  box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--ametller) 70%, transparent);
}
.fab svg { width: 30px; height: 30px; }
.fab:active { transform: scale(0.96); }
html[data-theme="dark"] .fab { color: #0E1733; }

.sidebar { display: none; }
@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); }
  .topbar, .tabbar { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: 24px; position: sticky; top: 0; height: 100dvh;
    padding: 28px 18px; border-right: 1px solid var(--boira); background: var(--surface);
  }
  .side-nav { display: grid; gap: 4px; }
  .side-link {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px;
    color: var(--nit-2); text-decoration: none; font-weight: 600;
  }
  .side-link svg { width: 24px; height: 24px; }
  .side-link:hover { background: var(--boira); }
  .side-link[aria-current='page'] { background: var(--cel-soft); color: var(--cel); }
  .side-usage { margin-top: auto; }
  .content { padding: 28px 40px 80px; width: 100%; }
  .fab { display: none; }
}

/* ---------- Medidor: la nube que se llena ---------- */
.meter { display: grid; gap: 14px; justify-items: start; }
.meter-cloud { width: 72%; max-width: 320px; height: auto; }
.meter-cloud .shape { fill: var(--boira); }
.meter-cloud .fill { fill: var(--cel); transition: y .8s cubic-bezier(.2,.8,.2,1), height .8s cubic-bezier(.2,.8,.2,1); }
.meter-cloud.is-full .fill { fill: var(--ametller); }
.meter-pct { font-family: var(--display); font-weight: 600; font-size: 44px; line-height: 1; }
.meter-label { color: var(--nit-2); }
.mini-meter { display: grid; gap: 8px; }
.mini-meter .bar { height: 8px; border-radius: 8px; background: var(--boira); overflow: hidden; }
.mini-meter .bar > span { display: block; height: 100%; background: var(--cel); border-radius: 8px; }
.mini-meter.is-full .bar > span { background: var(--ametller); }
.usage-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px 6px 8px; border-radius: 999px;
  background: var(--boira); color: var(--nit); font-size: 14px; font-weight: 600; text-decoration: none;
}
.usage-pill svg { width: 22px; height: 22px; }

/* ---------- Fotos ---------- */
.month { margin: 26px 0 10px; font-family: var(--display); font-weight: 500; font-size: 19px; }
.groups > section:first-child .month { margin-top: 0; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(6, 1fr); gap: 4px; } }
.tile {
  position: relative; aspect-ratio: 1; border: 0; padding: 0; overflow: hidden;
  background: var(--boira); border-radius: 4px;
}
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile .tile-icon { position: absolute; inset: 0; display: grid; place-items: center; color: var(--nit-3); }
.tile .tile-icon svg { width: 32px; height: 32px; }
.tile .badge {
  position: absolute; right: 6px; bottom: 6px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(13, 22, 51, .55); color: #fff;
}
.tile .badge svg { width: 14px; height: 14px; }
.tile .check {
  position: absolute; left: 6px; top: 6px; width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid #fff; background: rgba(13, 22, 51, .25); display: grid; place-items: center; color: #fff;
}
.tile .check svg { width: 16px; height: 16px; opacity: 0; }
.tile.is-selected .check { background: var(--cel); border-color: var(--cel); }
.tile.is-selected .check svg { opacity: 1; }
.tile.is-selected img { transform: scale(0.9); border-radius: 6px; }
.tile img { transition: transform .15s; }

/* ---------- Archivos ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; font-weight: 600; color: var(--nit-2); margin-bottom: 14px; }
.crumbs button { background: none; border: 0; padding: 6px 4px; color: var(--cel); font-weight: 600; }
.crumbs .sep { color: var(--nit-3); }
.crumbs .here { color: var(--nit); padding: 6px 4px; }
.rows { display: grid; }
.row {
  display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 14px;
  padding: 10px 4px; border-bottom: 1px solid var(--boira); min-height: 68px;
}
.row:last-child { border-bottom: 0; }
.row-main { all: unset; display: grid; grid-template-columns: 48px 1fr; gap: 14px; align-items: center; grid-column: 1 / 3; cursor: pointer; min-width: 0; }
.row-main:focus-visible { outline: 3px solid var(--cel); border-radius: 10px; }
.row-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--boira); color: var(--nit-2); overflow: hidden; }
.row-icon svg { width: 26px; height: 26px; }
.row-icon img { width: 100%; height: 100%; object-fit: cover; }
.row-icon.is-folder { background: var(--cel-soft); color: var(--cel); }
.row-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { font-size: 14px; color: var(--nit-2); }
.row.is-selected { background: var(--cel-soft); border-radius: 12px; }

/* ---------- Vacíos y carga ---------- */
.empty { display: grid; justify-items: start; gap: 12px; padding: 32px 4px; max-width: 420px; }
.empty svg.empty-art { width: 120px; height: auto; }
.empty h2 { font-size: 22px; }
.skeleton { background: linear-gradient(90deg, var(--boira) 0%, var(--boira-2) 50%, var(--boira) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--boira-2); border-top-color: var(--cel); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Secciones de cuenta ---------- */
.stack { display: grid; gap: 28px; max-width: 640px; }
.section { display: grid; gap: 14px; }
.section-title { font-size: 20px; }
.list { display: grid; grid-template-columns: minmax(0, 1fr); background: var(--surface); border-radius: 18px; border: 1px solid var(--boira); overflow: hidden; }
.list-item {
  all: unset; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--boira); cursor: pointer;
}
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: var(--boira); }
.list-item:focus-visible { outline: 3px solid var(--cel); outline-offset: -3px; }
.list-item.is-static { cursor: default; }
.list-item.is-static:hover { background: none; }
.app-version-row strong { font-variant-numeric: tabular-nums; }
.list-item.is-danger { color: var(--peligro); font-weight: 600; }
.list-item svg { width: 20px; height: 20px; color: var(--nit-3); }
.note { padding: 14px 16px; border-radius: 14px; background: var(--cel-soft); font-size: 15px; }
.note.is-blossom { background: var(--ametller-soft); }

/* ---------- Administración ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat { padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--boira); }
.stat strong { display: block; font-family: var(--display); font-weight: 600; font-size: 24px; }
.user-card { display: grid; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--boira); }
.user-card:last-child { border-bottom: 0; }
.user-top { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--boira); color: var(--nit-2); }
.tag.is-plan { background: var(--cel-soft); color: var(--cel); }
.tag.is-gift { background: var(--ametller-soft); color: var(--ametller-deep); }
.tag.is-off { background: var(--peligro-soft); color: var(--peligro); }
.tag.is-ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Visor ---------- */
.viewer {
  position: fixed; inset: 0; z-index: 60; background: #05070F; color: #fff; display: grid; grid-template-rows: auto 1fr auto;
  /* una sola columna del ancho de la pantalla: un nombre de archivo largo no puede ensancharla (antes empujaba la foto a la derecha) */
  grid-template-columns: minmax(0, 1fr);
}
.viewer-top, .viewer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px; }
.viewer-top { padding-top: calc(8px + var(--safe-t)); }
.viewer-bottom { padding-bottom: calc(10px + var(--safe-b)); justify-content: space-around; }
.viewer .icon-btn { color: #fff; }
.viewer .icon-btn:hover { background: rgba(255, 255, 255, .12); }
.viewer-title { flex: 1; min-width: 0; text-align: center; }
.viewer-top-pad { width: 44px; flex: none; }
.viewer-title strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.viewer-title span { font-size: 13px; color: rgba(255, 255, 255, .7); }
.viewer-stage {
  position: relative; display: grid; place-items: center; min-height: 0; overflow: hidden; touch-action: pan-y;
  /* fila y columna con tamaño fijo: así la foto se ajusta a la pantalla en vez de salir a tamaño real */
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
}
.viewer-stage > img, .viewer-stage > video { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; }
.viewer-stage.is-zoomable { touch-action: none; user-select: none; -webkit-user-select: none; cursor: zoom-in; }
.viewer-stage.is-zoomed { cursor: grab; }
.viewer-img { transform-origin: 50% 50%; will-change: transform; -webkit-user-drag: none; }
.viewer-action { min-width: 0; }
@media (max-width: 380px) { .viewer-action { padding: 6px 6px; font-size: 11px; } }
.viewer-file img { max-width: 100%; max-height: 50vh; object-fit: contain; }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.viewer-nav.prev { left: 8px; } .viewer-nav.next { right: 8px; }
.viewer-action { display: grid; justify-items: center; gap: 2px; background: none; border: 0; color: #fff; font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 12px; text-decoration: none; }
.viewer-action svg { width: 26px; height: 26px; }
.viewer-action:hover { background: rgba(255, 255, 255, .1); }
.viewer-file { display: grid; justify-items: center; gap: 16px; text-align: center; padding: 24px; }
.viewer-file svg { width: 72px; height: 72px; opacity: .8; }

/* ---------- Diálogos y hojas ---------- */
.scrim { position: fixed; inset: 0; z-index: 70; background: var(--scrim); display: grid; align-items: end; justify-items: center; animation: fade .15s ease-out; }
@media (min-width: 640px) { .scrim { align-items: center; } }
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: 100%; max-width: 480px; max-height: 88dvh; overflow: auto;
  background: var(--surface); border-radius: 24px 24px 0 0;
  padding: 22px 20px calc(20px + var(--safe-b)); display: grid; gap: 16px;
  animation: rise .2s cubic-bezier(.2,.8,.2,1);
}
@media (min-width: 640px) { .sheet { border-radius: 24px; padding-bottom: 22px; } }
@keyframes rise { from { transform: translateY(24px); opacity: .6; } }
.sheet-actions { display: grid; gap: 8px; }
.sheet-actions.is-row { grid-template-columns: 1fr 1fr; }
.menu { display: grid; }
.menu button {
  all: unset; display: flex; align-items: center; gap: 14px; padding: 14px 8px; border-radius: 12px; cursor: pointer; font-weight: 600;
}
.menu button:hover { background: var(--boira); }
.menu button:focus-visible { outline: 3px solid var(--cel); }
.menu button svg { width: 24px; height: 24px; color: var(--nit-2); }
.menu button.is-danger, .menu button.is-danger svg { color: var(--peligro); }
.picker-row { all: unset; display: flex; align-items: center; gap: 12px; padding: 12px 8px; border-radius: 12px; cursor: pointer; font-weight: 600; }
.picker-row:hover { background: var(--boira); }
.picker-row svg { width: 24px; height: 24px; color: var(--cel); }

/* ---------- Bandeja de subidas ---------- */
.tray {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--tab-h) + 12px + var(--safe-b)); z-index: 40;
  max-width: 460px; margin-left: auto;
  background: var(--surface); border: 1px solid var(--boira); border-radius: 20px;
  box-shadow: 0 18px 40px -18px rgba(13, 22, 51, .45);
  overflow: hidden;
}
@media (min-width: 900px) { .tray { bottom: 24px; right: 24px; left: auto; width: 420px; } }
.tray-head { display: flex; align-items: center; gap: 12px; padding: 12px 10px 12px 16px; }
.tray-head .grow { flex: 1; min-width: 0; }
.tray-head strong { display: block; }
.tray-progress { height: 4px; background: var(--boira); }
.tray-progress > span { display: block; height: 100%; background: var(--ametller); transition: width .3s; }
.tray-list { max-height: 40dvh; overflow: auto; border-top: 1px solid var(--boira); }
.tray-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 16px; border-bottom: 1px solid var(--boira); font-size: 15px; }
.tray-item:last-child { border-bottom: 0; }
.tray-item .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.tray-item .state { font-size: 13px; color: var(--nit-2); }
.tray-item .state.is-error { color: var(--peligro); font-weight: 600; }
.tray-item .state.is-done { color: var(--ok); font-weight: 600; }
.tray-item .bar { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: var(--boira); overflow: hidden; }
.tray-item .bar > span { display: block; height: 100%; background: var(--cel); }

/* ---------- Avisos ---------- */
.toasts { position: fixed; left: 0; right: 0; top: calc(12px + var(--safe-t)); z-index: 90; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  pointer-events: auto; max-width: 440px; padding: 12px 16px; border-radius: 14px;
  background: var(--nit); color: var(--cal); font-weight: 600; font-size: 15px;
  box-shadow: 0 12px 30px -12px rgba(13, 22, 51, .5); animation: drop .2s ease-out;
}
.toast.is-error { background: var(--peligro); color: #fff; }
@keyframes drop { from { transform: translateY(-12px); opacity: 0; } }

.install-card { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 14px 12px 14px 16px; border-radius: 18px; background: var(--cel-soft); margin-bottom: 18px; }
.install-card img { width: 40px; border-radius: 10px; }
.install-card p { font-size: 15px; }

.selbar {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--tab-h) + 12px + var(--safe-b)); z-index: 41;
  display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; border-radius: 18px;
  background: var(--nit); color: var(--cal); max-width: 520px; margin: 0 auto;
}
.selbar .grow { flex: 1; font-weight: 600; }
.selbar .icon-btn { color: var(--cal); }
.selbar .icon-btn:hover { background: rgba(255, 255, 255, .12); }
@media (min-width: 900px) { .selbar { bottom: 24px; left: 284px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Subidas en versión pequeña: deja libre el botón + */
.tray-pill {
  position: fixed; left: 12px; right: 100px; bottom: calc(var(--tab-h) + 20px + var(--safe-b)); z-index: 40;
  max-width: 360px; display: flex; align-items: center; gap: 2px;
  padding: 6px 4px 6px 6px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--boira);
  box-shadow: 0 14px 34px -16px rgba(13, 22, 51, .5);
  animation: rise .2s cubic-bezier(.2,.8,.2,1);
}
@media (min-width: 900px) { .tray-pill { left: auto; right: 24px; bottom: 24px; width: 340px; } }
.pill-main { all: unset; flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 6px; border-radius: 14px; cursor: pointer; }
.pill-main:focus-visible { outline: 3px solid var(--cel); }
.pill-text { min-width: 0; display: grid; }
.pill-text strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill-sub { font-size: 13px; color: var(--nit-2); }
.ring {
  flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--ametller) calc(var(--p) * 1%), var(--boira) 0);
  transition: background .3s;
}
.ring::after { content: ''; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); }
.pill-icon { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--cel-soft); color: var(--ok); }
.pill-icon.is-error { background: var(--peligro-soft); color: var(--peligro); }
.pill-icon svg { width: 18px; height: 18px; }
.tray-foot { padding: 10px 16px; border-top: 1px solid var(--boira); text-align: center; }
.link.is-danger { color: var(--peligro); }

/* ---------- Portada ---------- */
.lp { min-height: 100dvh; background: var(--cal); }
.lp-hero {
  position: relative; overflow: hidden; color: #fff;
  background: var(--cel);
  padding: calc(14px + var(--safe-t)) 20px 0;
}
html[data-theme="dark"] .lp-hero { background: #1B3270; }
.lp-nav { display: flex; align-items: center; justify-content: space-between; max-width: 1120px; margin: 0 auto; }
.lp-brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.lp-brand img { width: 44px; height: auto; }
.lp-brand .wordmark { font-size: 28px; }
.lp-btn-ghost { background: rgba(255, 255, 255, .16); color: #fff; }
.lp-btn-ghost:hover { background: rgba(255, 255, 255, .26); }
.lp-btn-main { background: #fff; color: var(--cel-deep); min-height: 56px; padding: 0 28px; font-size: 17px; border-radius: 16px; }
.lp-btn-main:hover { background: var(--ametller-soft); }
html[data-theme="dark"] .lp-btn-main { color: #1B3270; }
.lp-btn-main:focus-visible, .lp-btn-ghost:focus-visible { outline: 3px solid var(--pistil); outline-offset: 3px; }

.lp-hero-grid { max-width: 1120px; margin: 0 auto; display: grid; gap: 8px; padding-top: 36px; }
.lp-hero h1 {
  font-family: var(--display); font-weight: 600; letter-spacing: -0.025em;
  font-size: clamp(40px, 11vw, 76px); line-height: 1.02; max-width: 13ch; text-wrap: balance;
}
.lp-lead { font-size: 18px; line-height: 1.5; margin-top: 18px; max-width: 34ch; color: rgba(255, 255, 255, .9); }
.lp-ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.lp-ctas .lp-btn-ghost { min-height: 56px; border-radius: 16px; }
@media (max-width: 759px) { .lp-ctas .lp-btn-main { flex: 1 1 100%; } .lp-ctas .lp-btn-ghost { display: none; } }
.lp-note { margin-top: 14px; font-size: 14px; color: rgba(255, 255, 255, .8); }

.lp-art { width: 100%; max-width: 560px; justify-self: center; margin-bottom: -6px; overflow: visible; }
.lp-cloud { filter: drop-shadow(0 18px 0 rgba(13, 22, 51, .10)); }
html[data-theme="dark"] .lp-cloud { fill: #EEF2FB; }
.lp-photo-in { filter: drop-shadow(0 6px 10px rgba(21, 34, 74, .18)); }
.lp-blossom { transform-origin: 463px 355px; }
@media (prefers-reduced-motion: no-preference) {
  .lp-photo-in { animation: lp-rise .9s cubic-bezier(.2, .8, .25, 1.15) both; animation-delay: calc(.35s + var(--i) * .16s); }
  .lp-blossom { animation: lp-bloom .7s cubic-bezier(.3, 1.4, .5, 1) 1.3s both; }
  .lp-cloud { animation: lp-fade .6s ease-out both; }
}
@keyframes lp-rise { from { transform: translateY(260px) scale(.7); opacity: 0; } 60% { opacity: 1; } to { transform: none; opacity: 1; } }
@keyframes lp-bloom { from { transform: scale(0) rotate(-40deg); } to { transform: none; } }
@keyframes lp-fade { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.lp main { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.lp-section { padding: 64px 0 8px; }
.lp-h2 { font-family: var(--display); font-weight: 600; font-size: clamp(30px, 7vw, 44px); line-height: 1.08; letter-spacing: -0.02em; max-width: 20ch; text-wrap: balance; margin-bottom: 28px; }

.lp-benefits { display: grid; gap: 32px; }
.lp-benefit { display: grid; grid-template-columns: 48px 1fr; gap: 4px 16px; align-items: start; }
.lp-benefit h3 { font-family: var(--display); font-weight: 600; font-size: 22px; line-height: 1.2; align-self: center; }
.lp-benefit p { grid-column: 2; color: var(--nit-2); line-height: 1.55; max-width: 44ch; }
.lp-icon {
  width: 48px; height: 48px; padding: 11px; border-radius: 50%;
  background: var(--cel-soft); stroke: var(--cel); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.lp-benefit:nth-child(2) .lp-icon { background: var(--ametller-soft); stroke: var(--ametller); }

.lp-steps { list-style: none; padding: 0; margin: 0; counter-reset: lp; display: grid; gap: 28px; }
.lp-steps li { counter-increment: lp; position: relative; padding-left: 72px; min-height: 56px; }
.lp-steps li::before {
  content: counter(lp); position: absolute; left: 0; top: -6px;
  font-family: var(--display); font-weight: 600; font-size: 56px; line-height: 1; color: var(--ametller);
}
.lp-steps h3 { font-family: var(--display); font-weight: 600; font-size: 22px; margin-bottom: 4px; }
.lp-steps p { color: var(--nit-2); line-height: 1.55; max-width: 40ch; }

.lp-plans-head { display: grid; gap: 4px; }
.lp-plans-head .lp-h2 { margin-bottom: 16px; }
.lp-plans-head .period { justify-self: start; margin-bottom: 20px; }
.lp-plans { margin-bottom: 16px; }

.lp-faq { display: grid; gap: 12px; align-items: start; }
@media (min-width: 760px) { .lp-faq { grid-template-columns: 1fr 1fr; gap: 14px 20px; } }
.lp-faq details { background: var(--surface); border: 2px solid var(--boira); border-radius: 18px; }
.lp-faq details[open] { border-color: var(--cel-soft); }
.lp-faq summary {
  cursor: pointer; list-style: none; padding: 18px 52px 18px 20px; position: relative;
  font-weight: 600; font-size: 17px; line-height: 1.35; border-radius: 16px;
}
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary::after {
  content: '+'; position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  font-family: var(--display); font-size: 26px; color: var(--cel); transition: transform .2s;
}
.lp-faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.lp-faq summary:focus-visible { outline: 3px solid var(--cel); outline-offset: 2px; }
.lp-faq details p { padding: 0 20px 18px; color: var(--nit-2); line-height: 1.55; }

.lp-footer { max-width: 1200px; margin: 0 auto; padding: 28px 20px calc(36px + var(--safe-b)); }

@media (min-width: 760px) {
  .lp-benefits { grid-template-columns: 1fr 1fr; gap: 44px 56px; }
  .lp-steps { grid-template-columns: repeat(3, 1fr); gap: 32px; }
  .lp-steps li { padding-left: 0; padding-top: 72px; }
  .lp-plans { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
  .lp-plans .plan { grid-template-columns: 1fr; align-content: start; }
  .lp-plans .plan-price { text-align: left; margin-top: 10px; }
  .lp-plans-head { grid-template-columns: 1fr auto; align-items: end; }
  .lp-plans-head .period { justify-self: end; }
}
@media (min-width: 960px) {
  .lp-hero { padding: 20px 40px 0; }
  .lp-hero-grid { grid-template-columns: 1fr 1fr; align-items: end; gap: 40px; padding-top: 56px; }
  .lp-hero-copy { padding-bottom: 96px; }
  .lp main { max-width: 1200px; padding: 0 40px; }
  .lp-lead { font-size: 20px; }
  .lp-section { padding-top: 96px; }
  .lp-final { padding: 72px 40px; }
  .lp-footer { padding: 32px 40px 48px; }
}
.lp-plans .plan { transition: background-color .7s ease, border-color .7s ease; }
.lp-plans .plan.is-lit { background: #FEF2F6; border-color: #F4B3C6; }
html[data-theme="dark"] .lp-plans .plan.is-lit { background: #2C2148; border-color: #A0607E; }

/* ---------- Buscar ---------- */
.sr-bar {
  display: flex; align-items: center; gap: 10px; padding: 0 6px 0 16px; margin-bottom: 16px;
  min-height: 54px; border-radius: 16px; background: var(--surface); border: 2px solid var(--boira-2);
}
.sr-bar:focus-within { border-color: var(--cel); }
.sr-bar > svg { width: 22px; height: 22px; color: var(--nit-3); flex: none; }
.sr-input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 17px; color: var(--nit); padding: 12px 0; }
.sr-input:focus { outline: none; }
.sr-input::-webkit-search-cancel-button { display: none; }
.sr-sections { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; margin-top: 8px; }
.sr-sections > * { min-width: 0; }
.sr-sections .month { margin: 0 0 10px; }
.sr-explain { margin: -4px 0 10px; }
.sr-more { margin-top: 14px; }
.sr-people { display: flex; gap: 14px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.sr-person { all: unset; cursor: pointer; display: grid; justify-items: center; gap: 6px; width: 76px; flex: none; text-align: center; font-size: 14px; font-weight: 600; }
.sr-person img, .sr-noface { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: var(--boira); }
.sr-noface { display: grid; place-items: center; color: var(--nit-3); }
.sr-noface svg { width: 30px; height: 30px; }
.sr-person span { max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-person:focus-visible img { outline: 3px solid var(--cel); outline-offset: 2px; }
.sr-places { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 600px) { .sr-places { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .sr-places { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.sr-place { all: unset; cursor: pointer; position: relative; aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden; background: var(--boira); }
.sr-place img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sr-place-blank { display: grid; place-items: center; height: 100%; color: var(--nit-3); }
.sr-place-blank svg { width: 32px; height: 32px; }
.sr-place-text {
  position: absolute; inset: auto 0 0 0; padding: 26px 12px 10px; display: grid; color: #fff;
  background: linear-gradient(transparent, rgba(13, 22, 51, .72));
}
.sr-place-text strong { font-family: var(--display); font-weight: 600; font-size: 17px; line-height: 1.15; }
.sr-place:focus-visible { outline: 3px solid var(--cel); outline-offset: 2px; }
.sr-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sr-chip {
  all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border-radius: 999px; background: var(--cel-soft); color: var(--nit); font-weight: 600; font-size: 15px;
}
.sr-chip svg { width: 18px; height: 18px; color: var(--cel); }
.sr-chip:focus-visible { outline: 3px solid var(--cel); outline-offset: 2px; }
.sr-head { display: flex; align-items: center; gap: 12px; margin: 8px 0 18px; }
.sr-head-face { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; }
.sr-title { font-size: 28px; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-title .link { font-size: 24px; }
.sr-big-icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--cel-soft); color: var(--cel); }
.sr-big-icon svg { width: 34px; height: 34px; }

/* ---------- Interruptores ---------- */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--boira); cursor: pointer; }
.switch-row:last-child { border-bottom: 0; }
.switch-text { display: grid; gap: 3px; min-width: 0; flex: 1 1 auto; overflow-wrap: anywhere; }
.switch {
  appearance: none; flex: none; width: 52px; height: 32px; border-radius: 999px; background: var(--boira-2);
  position: relative; cursor: pointer; transition: background-color .2s;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(13, 22, 51, .25); transition: transform .2s;
}
.switch:checked { background: var(--cel); }
.switch:checked::after { transform: translateX(20px); }
.switch:disabled { opacity: .5; cursor: default; }
.switch:focus-visible { outline: 3px solid var(--cel); outline-offset: 2px; }
.consent { display: grid; gap: 10px; padding-left: 20px; margin: 14px 0 6px; font-size: 15px; line-height: 1.45; }
.sr-row { margin-bottom: 10px; }
.sr-row .month { margin: 0; }

/* ---------- Vista y orden ---------- */
.head-actions { display: flex; align-items: center; gap: 4px; }
.grid.is-small { grid-template-columns: repeat(5, 1fr); gap: 2px; }
.grid.is-large { grid-template-columns: repeat(2, 1fr); gap: 4px; }
@media (min-width: 600px) { .grid.is-small { grid-template-columns: repeat(7, 1fr); } .grid.is-large { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .grid.is-small { grid-template-columns: repeat(10, 1fr); } .grid.is-large { grid-template-columns: repeat(4, 1fr); gap: 6px; } }
.vopts { border: 0; padding: 0; margin: 18px 0 0; }
.vopts legend { font-weight: 600; font-size: 15px; color: var(--nit-2); margin-bottom: 8px; }
.vopts-row { display: flex; flex-wrap: wrap; gap: 8px; }
.vopt {
  all: unset; cursor: pointer; min-height: 40px; padding: 0 14px; border-radius: 999px; display: inline-flex; align-items: center;
  background: var(--boira); color: var(--nit); font-weight: 600; font-size: 15px;
}
.vopt.is-on { background: var(--cel); color: #fff; }
html[data-theme="dark"] .vopt.is-on { color: #0E1733; }
.vopt:focus-visible { outline: 3px solid var(--cel); outline-offset: 2px; }
.vopts + .btn { margin-top: 24px; }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 600px) { .fgrid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); } }
.fcard { position: relative; background: var(--surface); border: 1px solid var(--boira); border-radius: 16px; overflow: hidden; }
.fcard.is-selected { outline: 3px solid var(--cel); outline-offset: -3px; }
.fcard-main { all: unset; cursor: pointer; display: grid; width: 100%; }
.fcard-main:focus-visible { outline: 3px solid var(--cel); outline-offset: -3px; }
.fcard-art { aspect-ratio: 4 / 3; display: grid; place-items: center; background: var(--boira); color: var(--nit-2); overflow: hidden; }
.fcard-art.is-folder { background: var(--cel-soft); color: var(--cel); position: relative; }
.fcard-art svg { width: 40px; height: 40px; }
.fcard-art.is-folder > svg { width: 56px; height: 56px; }
.fcard-art img { width: 100%; height: 100%; object-fit: cover; }
.fcard-name { padding: 10px 40px 0 12px; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fcard-meta { padding: 2px 44px 12px 12px; font-size: 13px; color: var(--nit-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fcard-menu { position: absolute; right: 0; bottom: 4px; }
.smart-status { display: grid; gap: 2px; }
.labels { display: grid; gap: 6px; padding-left: 22px; margin: 12px 0 20px; }
.labels li { display: grid; grid-template-columns: 1fr auto 76px; gap: 10px; align-items: baseline; }
.labels li span:first-child { min-width: 0; }
.labels .is-sure { color: var(--ok); }
.labels .is-maybe { color: var(--pistil); }
.labels .is-no { color: var(--nit-3); font-weight: 400; }

/* ---------- Avisos con botón (Deshacer) ---------- */
.toast.has-action { display: flex; align-items: center; gap: 14px; padding-right: 8px; }
.toast-action { border: 0; background: rgba(255, 255, 255, .16); color: inherit; font: inherit; font-weight: 700; padding: 8px 12px; border-radius: 10px; cursor: pointer; }
.toast-action:hover { background: rgba(255, 255, 255, .26); }
html[data-theme="dark"] .toast-action { background: rgba(14, 23, 51, .12); }

/* ---------- Papelera ---------- */
.side-link.is-minor { font-size: 15px; color: var(--nit-2); }
.trash-summary { display: grid; gap: 6px; padding: 16px 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--boira); margin-bottom: 16px; }
.trash-summary .btn { margin-top: 6px; }
.is-danger-text { color: var(--peligro); }
.trash-grid { gap: 6px; }
.trash-tile { position: relative; display: grid; }
.trash-tile .tile { opacity: .82; }
.trash-tile .tile.is-selected { opacity: 1; }
.trash-left {
  position: absolute; left: 6px; bottom: 6px; pointer-events: none;
  padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(14, 23, 51, .72); color: #fff;
}
.trash-left.is-soon { background: var(--peligro); }
.trash-name {
  position: absolute; left: 6px; right: 6px; top: 6px; pointer-events: none;
  font-size: 12px; font-weight: 600; color: var(--nit-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.trash-preview { width: 100%; max-height: 46dvh; object-fit: contain; border-radius: 14px; background: var(--boira); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 15px; margin: 0; }
.facts dt { color: var(--nit-3); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Panel de administración ---------- */
.admin-tabs {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: -8px -16px 0; padding: 0 16px 4px;
  position: sticky; top: calc(var(--top-h) + var(--safe-t)); z-index: 5; background: var(--cal);
}
@media (min-width: 900px) { .admin-tabs { top: 0; margin: -8px 0 0; padding: 8px 0 6px; flex-wrap: wrap; overflow: visible; } }
.refresh-btn { min-height: 44px; }
.refresh-btn.is-busy svg { animation: spin .8s linear infinite; }
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tab {
  display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 44px; padding: 0 14px; border-radius: 999px;
  text-decoration: none; color: var(--nit-2); font-weight: 600; font-size: 15px; background: var(--boira);
}
.admin-tab svg { width: 18px; height: 18px; }
.admin-tab[aria-current='page'] { background: var(--nit); color: var(--cal); }
.admin-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--peligro); color: #fff; font-size: 12px; display: inline-grid; place-items: center; }

.all-good { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: 18px; background: color-mix(in srgb, var(--ok) 12%, var(--surface)); }
.all-good > svg { width: 28px; height: 28px; color: var(--ok); flex: none; }
.all-good > div, .status-text, .alert-body { display: grid; gap: 2px; min-width: 0; }
.alerts { display: grid; gap: 10px; }
.alert-card { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 14px 10px 14px 16px; border-radius: 18px; border: 1px solid var(--boira); background: var(--surface); }
.alert-card > svg { width: 24px; height: 24px; margin-top: 1px; }
.alert-card.is-error { background: var(--peligro-soft); border-color: transparent; }
.alert-card.is-error > svg { color: var(--peligro); }
.alert-card.is-warn { background: color-mix(in srgb, var(--pistil) 18%, var(--surface)); border-color: transparent; }
.alert-card.is-warn > svg { color: color-mix(in srgb, var(--pistil) 70%, var(--nit)); }

.status-row, .event-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--boira); }
.status-row:last-child, .event-row:last-child { border-bottom: 0; }
.event-row { grid-template-columns: auto 1fr; align-items: start; }
.event-row .status-dot { margin-top: 7px; }
.event-msg { overflow-wrap: anywhere; font-size: 15px; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--nit-3); flex: none; display: inline-block; }
.status-dot.is-ok { background: var(--ok); }
.status-dot.is-warn { background: var(--pistil); }
.status-dot.is-error { background: var(--peligro); }
.status-dot.is-off { background: var(--boira-2); }
.tag.is-quiet { background: transparent; border: 1px solid var(--boira-2); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--boira-2); background: var(--surface); color: var(--nit); font: inherit; font-weight: 600; font-size: 14px; min-height: 40px; padding: 0 14px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip.is-on { background: var(--nit); color: var(--cal); border-color: var(--nit); }
.chip-n { font-size: 12px; opacity: .7; }
.user-card.is-button { all: unset; display: grid; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--boira); cursor: pointer; }
.user-card.is-button:last-child { border-bottom: 0; }
.user-card.is-button:hover { background: var(--boira); }
.user-card.is-button:focus-visible { outline: 3px solid var(--cel); outline-offset: -3px; }
.user-card.is-button .user-top > svg { width: 20px; height: 20px; color: var(--nit-3); flex: none; margin-top: 4px; }

.user-detail { display: grid; gap: 18px; }
.detail-block { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--boira); }
.detail-block h3 { font-size: 16px; }
.action-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.action-grid .btn { justify-content: flex-start; font-size: 15px; min-height: 48px; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.plain-list li { overflow-wrap: anywhere; }
.run-list li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; }
.plain-list .status-dot { width: 8px; height: 8px; margin-top: 7px; }
.sheet:has(.user-detail) { max-width: 640px; }

.jobs { display: grid; gap: 10px; }
.job-card { display: grid; gap: 10px; padding: 16px 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--boira); }
.job-head { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; }
.job-head .status-dot { margin-top: 7px; }
@media (max-width: 520px) {
  .job-head { grid-template-columns: auto 1fr; }
  .job-head .btn { grid-column: 1 / -1; }
}
.job-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--nit-2); }
.job-meta span { display: inline-flex; align-items: center; gap: 6px; }
.job-meta svg { width: 16px; height: 16px; }
.job-msg { padding: 10px 12px; border-radius: 12px; background: var(--boira); overflow-wrap: anywhere; }
.job-msg.is-error { background: var(--peligro-soft); color: var(--peligro); font-weight: 600; }
.job-links { display: flex; gap: 18px; }

.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.filters .input { min-height: 48px; padding: 8px 12px; font-size: 16px; }
.inline-form { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.inline-form .field { flex: 1 1 200px; }
.admin code { font-size: 13px; background: var(--boira); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.sheet code { font-size: 13px; background: var(--boira); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.meter-label a { color: var(--cel); font-weight: 600; text-underline-offset: 3px; }

/* ---------- Doble verificación ---------- */
.code-input { font-size: 26px; letter-spacing: .25em; text-align: center; font-variant-numeric: tabular-nums; }
.tfa-alt { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.tfa-head, .tfa-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--boira); }
.tfa-row > svg { width: 22px; height: 22px; color: var(--nit-2); }
.qr { width: 200px; max-width: 70vw; margin: 0 auto; padding: 10px; background: #fff; border-radius: 14px; }
.qr svg { display: block; width: 100%; height: auto; }
.steps-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.backup-codes { margin: 0; padding: 14px 18px 14px 40px; border-radius: 14px; background: var(--boira); columns: 2; column-gap: 24px; }
.backup-codes li { margin: 4px 0; }
.backup-codes code { font-size: 16px; letter-spacing: .04em; }
.check-row { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.check-row input { width: 22px; height: 22px; }

/* ---------- Visitas ---------- */
:root { --chart: #3B76E1; --chart-hover: #2A5CC0; }
html[data-theme="dark"] { --chart: #5B8FE8; --chart-hover: #8DB4F5; }
.chart-card { display: grid; align-content: start; gap: 10px; padding: 16px 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--boira); min-width: 0; }
.chart-card h3 { font-size: 16px; }
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart-grid { stroke: var(--boira); stroke-width: 1; }
.chart-axis { fill: var(--nit-3); font-size: 11px; font-family: var(--text); }
.chart-bar { fill: var(--chart); }
.chart-bar.is-hover { fill: var(--chart-hover); }
.chart-tip { position: absolute; top: 0; transform: translateX(-50%); display: grid; gap: 2px; padding: 8px 12px; border-radius: 12px; background: var(--nit); color: var(--cal); font-size: 13px; pointer-events: none; white-space: nowrap; box-shadow: 0 8px 20px -10px rgba(13, 22, 51, .5); }
.visits-cols { display: grid; gap: 10px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 760px) { .visits-cols { grid-template-columns: 1.4fr 1fr; } }
.country-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.country-list li { display: grid; grid-template-columns: minmax(0, 11em) 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.country-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.country-bar { height: 8px; border-radius: 4px; background: var(--boira); overflow: hidden; }
.country-bar > span { display: block; height: 100%; border-radius: 4px; background: var(--chart); }
.country-n { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--nit); }
.code-input::placeholder { color: var(--boira-2); letter-spacing: .25em; }

/* ---------- Continuar con Google / Apple ---------- */
.oauth-buttons { display: grid; gap: 10px; }
.oauth-btn { gap: 10px; min-height: 52px; font-weight: 600; }
.oauth-btn.is-google { background: #fff; color: #1f1f1f; border: 1px solid #747775; }
.oauth-btn.is-google:hover { background: #f2f2f2; }
.oauth-btn.is-apple { background: #000; color: #fff; }
.oauth-btn.is-apple:hover { background: #222; }
html[data-theme="dark"] .oauth-btn.is-apple { background: #fff; color: #000; } html[data-theme="dark"] .oauth-btn.is-apple:hover { background: #eee; }
.oauth-mark { width: 20px; height: 20px; }
.oauth-or { display: flex; align-items: center; gap: 12px; color: var(--nit-3); font-size: 14px; margin: 4px 0; }
.oauth-or::before, .oauth-or::after { content: ''; flex: 1; height: 1px; background: var(--boira-2); }

/* ---------- Comunicaciones (panel) ---------- */
.comm-grid { display: grid; gap: 20px; }
@media (min-width: 1180px) { .comm-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; } .comm-side { position: sticky; top: 12px; } }
.comm-form, .comm-side { display: grid; gap: 18px; min-width: 0; align-content: start; }
.comm-form textarea.input, .tpl-editor textarea.input { min-height: 0; resize: vertical; line-height: 1.5; font-size: 16px; }
.comm-when { display: grid; gap: 12px; }
.amount-row { display: grid; grid-template-columns: minmax(0, 120px) minmax(0, 200px); gap: 8px; }
.comm-summary { display: grid; gap: 2px; padding: 14px 16px; border-radius: 14px; background: var(--cel-soft); }
.comm-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.comm-actions .btn { flex: 1 1 200px; }
.mail-preview { border: 1px solid var(--boira-2); border-radius: 16px; overflow: hidden; background: #f4f6fb; }
.mail-head { display: grid; gap: 2px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--boira); overflow-wrap: anywhere; }
.mail-preview iframe { display: block; width: 100%; height: 480px; border: 0; background: #f4f6fb; }
.picked-user { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 8px 8px 14px; border-radius: 14px; background: var(--cel-soft); overflow-wrap: anywhere; }
.picked-user > svg { width: 20px; height: 20px; color: var(--cel); }
.pick-list .list-item { min-height: 52px; }
.comm-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; margin-top: 6px; }
.tpl-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; align-items: start; padding: 14px 16px; border-bottom: 1px solid var(--boira); }
.tpl-row:last-child { border-bottom: 0; }
.tpl-row .tags { margin-top: 4px; }
.tpl-actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.tpl-actions:empty { display: none; }
@media (min-width: 700px) { .tpl-row { grid-template-columns: auto minmax(0, 1fr) auto; } .tpl-actions { grid-column: 3; margin-top: 0; } }
.comm-open { all: unset; display: grid; gap: 2px; cursor: pointer; min-width: 0; }
.comm-open:focus-visible { outline: 3px solid var(--cel); outline-offset: 4px; border-radius: 6px; }
.comm-open svg { width: 15px; height: 15px; vertical-align: -2px; }
.var-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.var-chips .chip { min-height: 34px; font-size: 13px; font-family: ui-monospace, Menlo, monospace; font-weight: 500; }
.te-row { display: grid; gap: 12px; }
@media (min-width: 560px) { .te-row { grid-template-columns: 1fr 1fr; } }
.tpl-editor h3 { font-size: 17px; margin-top: 6px; }
.sheet:has(.tpl-editor), .sheet:has(.mail-preview) { max-width: 640px; }
.link-btn { all: unset; color: var(--cel); font-weight: 600; cursor: pointer; justify-self: start; }
.link-btn:focus-visible { outline: 2px solid var(--cel); outline-offset: 2px; border-radius: 4px; }

/* ---------- Aviso arriba en la app ---------- */
.app-notice { --n: #3B76E1; --n-soft: #E8F0FD; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 12px 12px 12px 14px; border-radius: 14px; background: var(--n-soft); color: var(--nit); border-left: 4px solid var(--n); font-size: 15px; line-height: 1.45; }
.app-notice > svg { width: 20px; height: 20px; color: var(--n); margin-top: 1px; }
.app-notice strong { color: var(--n); margin-right: 4px; }
.app-notice .icon-btn { width: 32px; height: 32px; margin: -4px -2px 0 0; }
.app-notice .icon-btn svg { width: 18px; height: 18px; }
.app-notice.is-sample { grid-template-columns: auto 1fr; }
.app-notice.is-warn { --n: #B87100; --n-soft: #FDF1DC; }
.app-notice.is-ok { --n: #2E8B5E; --n-soft: #E3F4EA; }
.app-notice.is-alert { --n: #C63A4C; --n-soft: #FBE7EA; }
html[data-theme="dark"] .app-notice { --n: #8DB4F5; --n-soft: #1E3466; }
  html[data-theme="dark"] .app-notice.is-warn { --n: #F5C46B; --n-soft: #3A2C10; }
  html[data-theme="dark"] .app-notice.is-ok { --n: #7DD3A6; --n-soft: #143A2A; }
  html[data-theme="dark"] .app-notice.is-alert { --n: #F29AA6; --n-soft: #3D1A22; }
.notices { display: grid; gap: 8px; margin-bottom: 16px; }
textarea { font: inherit; color: inherit; }

/* ---------- Mantenimiento: pantalla para los clientes ---------- */
.mnt {
  --mnt-warn: #B87100; min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto;
  background: var(--cel); color: #fff;
  padding: calc(14px + var(--safe-t)) 20px calc(14px + var(--safe-b));
}
html[data-theme="dark"] .mnt { background: #1B3270; }
.mnt-nav { display: flex; align-items: center; gap: 10px; max-width: 1120px; width: 100%; margin: 0 auto; }
.mnt-nav img { width: 40px; height: auto; }
.mnt-nav .wordmark { font-size: 28px; }
.mnt-body { align-self: center; justify-self: center; width: 100%; max-width: 520px; padding: 28px 0 20px; display: grid; gap: 14px; }
.mnt-art { width: min(260px, 66%); height: auto; overflow: visible; margin-bottom: 4px; }
.mnt-cloud { fill: #fff; filter: drop-shadow(0 14px 0 rgba(13, 22, 51, .10)); animation: mnt-float 5s ease-in-out infinite alternate; }
.mnt-gear { fill: var(--ametller); }
.mnt-gear-hole { fill: #fff; }
.mnt-gear-spin { transform-box: fill-box; transform-origin: center; animation: spin 7s linear infinite; }
.mnt-zz text { fill: #fff; font-family: var(--display); font-weight: 600; font-size: 34px; animation: mnt-zz 3s ease-in-out infinite; }
.mnt-zz text + text { font-size: 26px; animation-delay: .8s; }
html[data-theme="dark"] .mnt-cloud, html[data-theme="dark"] .mnt-gear-hole { fill: #EEF2FB; }
@keyframes mnt-float { to { transform: translateY(-7px); } }
@keyframes mnt-zz { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .mnt-cloud, .mnt-gear-spin, .mnt-zz text { animation: none; } }
.mnt h1 { font-family: var(--display); font-weight: 600; font-size: clamp(34px, 9vw, 52px); line-height: 1.04; letter-spacing: -0.02em; text-wrap: balance; }
.mnt-lead { font-size: 18px; line-height: 1.5; color: rgba(255, 255, 255, .92); }
.mnt-msg { background: rgba(255, 255, 255, .14); border-radius: 14px; padding: 12px 14px; font-size: 16px; line-height: 1.5; }
.mnt-when { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; font-size: 16px; line-height: 1.45; }
.mnt-when svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.mnt-points { list-style: none; padding: 0; margin: 2px 0 0; display: grid; gap: 8px; font-size: 15px; line-height: 1.45; color: rgba(255, 255, 255, .9); }
.mnt-points li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; }
.mnt-points svg { width: 20px; height: 20px; color: var(--pistil); }
.mnt-check { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; margin-top: 6px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .22); color: rgba(255, 255, 255, .85); }
.mnt-check .btn { min-height: 44px; border-radius: 12px; }
.mnt-contact { color: rgba(255, 255, 255, .8); }
.mnt-contact a { color: #fff; }
.mnt-admin { justify-self: center; background: none; border: 0; color: rgba(255, 255, 255, .7); font: inherit; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 10px; }
.mnt-admin:hover { color: #fff; }
.mnt-admin:focus-visible { outline: 3px solid var(--pistil); outline-offset: 2px; border-radius: 8px; }
.mnt.is-preview { min-height: 0; border-radius: 18px; padding: 14px 16px 18px; grid-template-rows: auto auto; }
.mnt.is-preview .mnt-body { padding: 14px 0 0; gap: 10px; }
.mnt.is-preview h1 { font-size: 30px; }
.mnt.is-preview .mnt-art { width: 150px; }
.mnt.is-preview .mnt-lead { font-size: 16px; }
.mnt-preview-wrap { display: grid; gap: 12px; }
.mnt-preview { border-radius: 18px; }

/* ---------- Fase 8: aviso de app antigua, Tus dispositivos y enlace de contraseña ---------- */
.app-update-band {
  display: grid; gap: 10px; padding: 12px 14px; margin-bottom: 16px; border-radius: 14px;
  border-left: 4px solid var(--cel); background: var(--cel-soft); color: var(--nit); font-size: 15px; line-height: 1.45;
}
.app-update-band p { margin: 0; }
.app-update-band strong { color: var(--cel); }
.app-update-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.app-update-actions .btn { min-height: 40px; }
@media (min-width: 760px) { .app-update-band { grid-template-columns: 1fr auto; align-items: center; } }
.devices .device-row .status-text strong { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.devices .device-row .btn { white-space: nowrap; }
.devices > .btn { justify-self: start; max-width: 100%; white-space: normal; text-align: center; line-height: 1.25; padding-top: 10px; padding-bottom: 10px; }
@media (max-width: 520px) { .devices > .btn { justify-self: stretch; width: 100%; } }
@media (max-width: 420px) { .devices .device-row { grid-template-columns: auto 1fr; } .devices .device-row .btn { grid-column: 2; justify-self: start; } }
.reset-account { margin: -4px 0 4px; padding: 10px 12px; border-radius: 12px; background: var(--cel-soft); }

/* ---------- Mantenimiento: para el administrador ---------- */
.mnt-band {
  --w: #B87100; --w-soft: #FDF1DC;
  display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center;
  padding: 12px 14px; margin-bottom: 16px; border-radius: 14px; border-left: 4px solid var(--w);
  background: var(--w-soft); color: var(--nit); font-size: 15px; line-height: 1.45;
}
.mnt-band > svg { width: 22px; height: 22px; color: var(--w); }
.mnt-band strong { color: var(--w); }
.mnt-band-actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; }
.mnt-band-actions .btn { min-height: 40px; }
@media (min-width: 760px) { .mnt-band { grid-template-columns: auto 1fr auto; } .mnt-band-actions { grid-column: auto; } }
.mnt-card { display: grid; gap: 16px; padding: 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--boira); }
.mnt-card.is-on { --w: #B87100; border: 2px solid #E9B44C; background: #FFFAF0; }
.mnt-card-head { display: flex; gap: 12px; align-items: center; }
.mnt-card-head .status-text { display: grid; gap: 2px; }
.mnt-card-icon { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--cel-soft); color: var(--cel); }
.mnt-card-icon svg { width: 22px; height: 22px; }
.mnt-card.is-on .mnt-card-icon { background: #FDF1DC; color: #B87100; }
.mnt-on-label { color: #B87100; }
.mnt-card .field textarea { resize: vertical; min-height: 64px; padding-top: 10px; }
.mnt-card-actions { display: grid; gap: 8px; }
@media (min-width: 600px) { .mnt-card-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; } }
.mnt-card a { color: var(--cel); }
html[data-theme="dark"] .mnt-band { --w: #F5C46B; --w-soft: #3A2C10; }
  html[data-theme="dark"] .mnt-card.is-on { border-color: #8A6420; background: #231C10; }
  html[data-theme="dark"] .mnt-card.is-on .mnt-card-icon { background: #3A2C10; color: #F5C46B; }
  html[data-theme="dark"] .mnt-on-label { color: #F5C46B; }

/* ---------- Logo según el tema y botón de tema ---------- */
.logo-dark { display: none; }
html[data-theme="dark"] .logo-dark { display: inline; }
html[data-theme="dark"] .logo-light { display: none; }
.lp-nav-actions { display: flex; align-items: center; gap: 8px; }
.theme-btn { width: 44px; height: 44px; padding: 0; border-radius: 50%; }
.theme-btn svg { width: 22px; height: 22px; }
.vopt svg { width: 18px; height: 18px; margin-right: 6px; }
.side-theme { margin-top: auto; }
.side-theme + .side-usage { margin-top: 0; }
.oauth-mark { width: 20px; height: 20px; flex: none; }
/* Visitas: móvil y ordenador por país */
.country-list li { align-items: start; }
.country-name { display: grid; gap: 1px; }
.country-dev { font-size: 12px; }
.country-bar.is-split { display: flex; margin-top: 6px; background: var(--boira); }
.country-bar.is-split > span { border-radius: 0; }
.country-bar.is-split > .dev-pc { background: var(--ametller); }
.dev-movil { background: var(--chart); height: 100%; }
.dev-pc { background: var(--ametller); height: 100%; }
.dev-split { display: grid; gap: 8px; }
.dev-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--boira); }
.dev-split.is-big .dev-bar { height: 14px; border-radius: 7px; }
.dev-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.dev-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.dev-dot.is-movil { background: var(--chart); }
.dev-dot.is-pc { background: var(--ametller); margin-left: 8px; }
.dev-legend .dev-dot.is-pc { margin-left: 0; }
.dev-key { margin-top: 10px; }
.dev-select { min-height: 44px; margin: 4px 0 10px; }
.admin-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; min-width: 0; overflow-wrap: anywhere; }
.admin-body > * { min-width: 0; }
/* Cuenta: en pantallas grandes usa todo el ancho, en dos columnas */
.account-page { max-width: 1180px; }
@media (min-width: 1100px) {
  .account-page { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; column-gap: 32px; }
  .account-page > .screen-head, .account-page > .meter, .account-page > .account-wide { grid-column: 1 / -1; }
}

/* ---------- Idiomas y formas de pago ---------- */
.flag { width: 21px; height: 14px; border-radius: 3px; flex: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); display: block; }
.lang-btn { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; letter-spacing: .02em; }
.menu button .flag { width: 24px; height: 16px; }
.lang-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.lang-links button, .lang-links a {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 12px;
  border: 1px solid var(--boira-2); border-radius: 999px; background: transparent; color: var(--nit-2);
  font: inherit; font-size: 14px; cursor: pointer; text-decoration: none; transition: background-color .15s, border-color .15s;
}
.lang-links button:hover, .lang-links a:hover { background: var(--boira); }
.lang-links button:focus-visible, .lang-links a:focus-visible { outline: 3px solid var(--cel); outline-offset: 2px; }
.lang-links button.is-on, .lang-links a.is-on { border-color: var(--cel); color: var(--nit); font-weight: 700; background: var(--surface); }
html[data-theme="dark"] .lang-links button.is-on, html[data-theme="dark"] .lang-links a.is-on { color: #fff; }
.pay-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 16px; }
.pay-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pay-row { gap: 6px; }
.pay-badge { display: block; line-height: 0; }
.pay-badge > svg { display: block; width: auto; height: 32px; }
html[data-theme="dark"] .pay-badge > svg > rect:first-child { stroke: transparent; }
.pay-note { display: inline-flex; align-items: center; gap: 6px; }
.stripe-mark { display: inline-block; line-height: 0; }
.stripe-mark svg { display: block; height: 19px; width: auto; }
html[data-theme="dark"] .stripe-mark svg path { fill: #A7A3FF; }
.lp-footer { display: grid; gap: 22px; border-top: 1px solid var(--boira-2); margin-top: 72px; padding-top: 32px; }
.lp-footer .legal-links { gap: 12px 28px !important; margin-top: 0 !important; font-size: 14px; }
.lp-footer .lang-links { margin-top: 0; gap: 8px; }
@media (min-width: 760px) {
  .lp-footer { grid-template-columns: 1fr auto; align-items: center; column-gap: 48px; }
}
/* ---------- Google Play ---------- */
.play-btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 12px; border-radius: 10px;
  background: #000; color: #fff; text-decoration: none; line-height: 1.1; font-weight: 600; font-size: 17px;
  border: 1px solid #A6A6A6; width: max-content; margin-top: 10px;
}
.play-btn small { display: block; font-size: 11px; font-weight: 500; letter-spacing: .02em; opacity: .9; }
.play-btn:hover { background: #1a1a1a; }
.play-btn:focus-visible { outline: 3px solid var(--cel); outline-offset: 2px; }
.play-icon, .play-icon svg { display: block; width: 26px; height: 26px; }
.install-card .play-btn { margin-top: 0; }
.lp-app-note { font-size: 18px; line-height: 1.5; color: var(--nit-2); max-width: 640px; margin-top: 12px; }
/* ---------- Copia automática (app de Android) ---------- */
.backup-status { display: grid; gap: 6px; justify-items: start; padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--boira-2); margin-bottom: 12px; }
.backup-status p { margin: 0; }
.backup-status > p:first-child { font-weight: 600; }
.backup-status.is-running { border-color: var(--cel); }
.backup-status.is-running > p:first-child::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%; background: var(--cel); animation: bk-pulse 1.2s ease-in-out infinite; vertical-align: 1px; }
.backup-status.is-error { border-color: var(--peligro); }
.lock-select { width: auto; min-height: 44px; max-width: 48%; min-width: 0; flex: 0 1 auto; }
.backup-section .note, .lock-section .note { display: grid; gap: 10px; justify-items: start; margin-bottom: 12px; }
.note.is-warn { background: #FFF4E5; color: #6B4100; }
html[data-theme="dark"] .note.is-warn { background: #3A2A12; color: #FFD9A0; }
@keyframes bk-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .backup-status.is-running > p:first-child::before { animation: none; } }

/* Texto de la portada para buscadores (lo pone el servidor, ver seo.js): se ve solo sin JavaScript; con la app arrancada se oculta. */
.seo { max-width: 760px; margin: 0 auto; padding: 24px 16px 48px; font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--nit); }
.seo a { color: var(--cel); }
.seo h1 { font-size: 28px; line-height: 1.2; }
.seo h2 { font-size: 21px; margin-top: 28px; }
.seo h3 { font-size: 17px; margin: 14px 0 2px; }
.seo li > p, .seo li > h3 { margin-top: 0; }
html.js #seo { display: none; }

/* ---------- Casilla «Soy una persona» (registro) y campo trampa ---------- */
.human { border: 2px solid var(--boira-2); border-radius: 14px; background: var(--surface); }
.human-box { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 8px 16px; cursor: pointer; position: relative; }
.human-box input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.human-mark { width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--boira-2); display: grid; place-items: center; flex-shrink: 0; color: #fff; background: var(--surface); }
.human-mark .spinner { width: 16px; height: 16px; border-width: 2.5px; }
.human-box input:focus-visible + .human-mark { outline: 3px solid var(--cel); outline-offset: 2px; }
.human.is-done { border-color: var(--ok); }
.human.is-done .human-mark { background: var(--ok); border-color: var(--ok); }
.human.is-working .human-mark { border-color: var(--cel); }
.human.is-error { border-color: var(--peligro); }
.human.is-error .human-text { color: var(--peligro); }
.human-text { font-size: 16px; font-weight: 600; color: var(--nit); }
.hp-field { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.sec-areas li { grid-template-columns: minmax(0, 12em) 1fr auto; align-items: start; }
.sec-areas .country-name { white-space: normal; overflow: visible; }
.origin-list li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; }
.origin-list .status-dot { margin-top: 6px; }
.origin-list .link { margin-left: 8px; }
.sec-areas .country-name .link { text-align: left; padding: 0; }
/* Portada en móviles estrechos: la marca y los botones no se pisan (solo la bandera en el botón de idioma). */
@media (max-width: 480px) {
  .lp-nav { gap: 8px; }
  .lp-nav-actions { gap: 4px; }
  .lp-nav-actions .btn { padding-inline: 12px; min-width: 0; }
  .lp-nav .lang-btn span { display: none; }
  .lp-brand { gap: 8px; flex-shrink: 0; }
  .lp-brand img { width: 38px; }
  .lp-brand .wordmark { font-size: 24px; }
}
@media (max-width: 359px) {
  .lp-brand img { width: 32px; }
  .lp-brand .wordmark { font-size: 21px; }
  .lp-nav-actions .btn { padding-inline: 9px; font-size: 14px; }
}

/* ---------- Visitas: personas o robots / Seguridad ---------- */
.traffic-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--boira); gap: 2px; }
.traffic-list li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; }
.tb { display: block; height: 100%; }
.tb-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; display: inline-block; }
.tb-persona { background: var(--ok); }
.tb-sin-confirmar { background: var(--pistil); }
.tb-buscador { background: var(--cel); }
.tb-ia { background: #8B6BD8; }
.tb-social { background: var(--ametller); }
.tb-monitor { background: var(--nit-3); }
.tb-herramienta { background: #7A5C3A; }
.tb-escaner { background: var(--peligro); }
.tb-automatizado { background: #D9822B; }
.country-name .link[aria-pressed="true"] { font-weight: 700; text-decoration: underline; }

/* ---------- Carpetas con miniaturas ---------- */
.is-folder > svg { fill: currentColor; fill-opacity: .22; }
.row-icon.is-folder { position: relative; }
.mosaic { position: absolute; inset: 0; display: grid; gap: 2px; background: var(--cel-soft); grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.mosaic.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mosaic.n3, .mosaic.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); }
.mosaic.n3 img:first-child { grid-row: span 2; }
.mosaic img { display: block; width: 100%; height: 100%; object-fit: cover; min-width: 0; min-height: 0; }
.folder-badge { position: absolute; left: 8px; bottom: 8px; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--surface); color: var(--cel); box-shadow: 0 1px 4px rgba(13, 22, 51, .3); }
.folder-badge svg { width: 16px; height: 16px; fill: currentColor; fill-opacity: .25; }
.app-version { margin-top: 8px; }

/* ---------- Arrastrar a carpetas ---------- */
.fcard.is-drop, .row.is-drop { outline: 3px dashed var(--cel); outline-offset: -3px; background: var(--cel-soft); }
.crumbs .is-drop { outline: 2px dashed var(--cel); border-radius: 8px; background: var(--cel-soft); }
.fcard[draggable="true"] img, .row[draggable="true"] img { -webkit-user-drag: none; }

.agents { display: inline-block; margin-top: 3px; line-height: 1.6; }
.agent { overflow-wrap: anywhere; }

/* ---------- Grupos desplegables de Cuenta ---------- */
.fold { background: var(--surface); border: 1px solid var(--boira); border-radius: 18px; overflow: hidden; }
.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 12px 18px; font-family: var(--display); font-weight: 600; font-size: 18px; color: var(--nit); }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary svg { width: 22px; height: 22px; flex: none; color: var(--nit-3); transition: transform .2s; }
.fold[open] > summary svg { transform: rotate(180deg); }
.fold > summary:focus-visible { outline: 3px solid var(--cel); outline-offset: -3px; }
.fold-body { display: grid; gap: 22px; padding: 0 18px 18px; min-width: 0; }
.fold-body > .section { margin: 0; padding: 0; }
.fold:not(.is-multi) .section-title { display: none; }
.fold.is-multi .section-title { font-size: 16px; }

/* Nada se sale por la derecha en el móvil (el panel de administración con datos largos, listas, direcciones IP…) */
.content { overflow-x: clip; }
:where(.stack, .section) { grid-template-columns: minmax(0, 1fr); }
.field > :is(input, select, textarea) { max-width: 100%; min-width: 0; }
.chart-card, .stat { overflow-wrap: anywhere; }
.custom-plan { border-style: dashed; }
.plans .fold { grid-column: 1 / -1; }

/* Sugerencias del panel de administración (avisos que manda la gente desde la app) */
.fb-item { display: grid; gap: 10px; padding: 16px; border-bottom: 1px solid var(--boira); }
.fb-item:last-child { border-bottom: 0; }
.fb-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.fb-msg { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.fb-kind { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--cel-soft); }
.fb-kind.is-fallo { background: color-mix(in srgb, #D98A0B 20%, transparent); }
.fb-kind.is-mejora { background: color-mix(in srgb, #2E9E63 20%, transparent); }
.fb-note { min-height: 0; resize: vertical; line-height: 1.5; font-size: 16px; }
.fb-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Banderas de países como imagen (Windows no dibuja las banderas emoji) */
.flag-img { width: 21px; height: auto; max-height: 16px; object-fit: contain; vertical-align: -2px; border-radius: 2px; margin-right: 2px; }

/* Seguridad: buscar una IP y ver todo lo que ha hecho */
.ip-search { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ip-search .input { flex: 1 1 260px; min-width: 0; }
.ip-detail { display: grid; gap: 14px; }
.ip-detail h3 { margin: 0; overflow-wrap: anywhere; }
.ip-path { overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }

/* Arrastrar archivos del ordenador a Archivos */
.is-drop-area { outline: 2px dashed var(--cel, #3B76E1); outline-offset: 6px; border-radius: 16px; }

/* Carpeta física del cliente (U1, U340…) en el panel de administración: grande y de otro color para localizarla al vuelo */
.folder-line { margin: 4px 0 0; font-size: 15px; font-weight: 600; }
.folder-id { font-weight: 800; font-size: 20px; letter-spacing: 0.04em; color: #B45309; }
.folder-id.is-small { font-size: 14px; }
html[data-theme="dark"] .folder-id { color: #FBBF24; }

/* «Orígenes más activos»: misma altura que «Dónde lo han intentado» y con scroll (rueda del ratón) para ver todos */
.scroll-body { overflow-y: auto; min-height: 0; max-height: 420px; padding-right: 6px; overscroll-behavior: contain; scrollbar-width: thin; }
@media (min-width: 760px) {
  .visits-cols > .chart-card.is-scroll { position: relative; overflow: hidden; contain: size; min-height: 320px; align-content: stretch; grid-template-rows: auto minmax(0, 1fr); }
  .visits-cols:has(> .chart-card.is-scroll) { align-items: stretch; }
  .chart-card.is-scroll .scroll-body { max-height: none; }
}

/* Avisos rojos que se pueden marcar como leídos pulsándolos */
.tag.is-clickable { cursor: pointer; }
.tag.is-clickable:hover, .tag.is-clickable:focus-visible { filter: brightness(1.15); outline: 2px solid currentColor; outline-offset: 1px; }

/* Facturación */
.bill-row { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 12px 4px; border-bottom: 1px solid var(--boira); text-align: left; width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; color: inherit; font: inherit; }
.bill-row:last-child { border-bottom: 0; }
.bill-cust { cursor: pointer; }
.bill-cust:hover { background: color-mix(in srgb, var(--cel, #3B76E1) 8%, transparent); }
.bill-amount { text-align: right; font-weight: 700; white-space: nowrap; }


/* ---------- Detalles de un archivo ---------- */
.details { display: grid; gap: 0; margin: 4px 0 12px; }
.details-row { display: grid; grid-template-columns: minmax(96px, 34%) 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--boira); }
.details-row:last-child { border-bottom: 0; }
.details dt { color: var(--nit-2); font-size: 14px; }
.details dd { margin: 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }

/* ---------- Visor de PDF ---------- */
/* place-items: normal: el visor de fotos centra con «place-items: center», y los Chrome nuevos también lo aplican a un
   bloque. Con eso, al ampliar un PDF lo que sobresalía por la izquierda quedaba fuera de alcance. */
.pdf-stage { display: block; place-items: normal; justify-items: normal; overflow: auto; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; background: #2A2F3A; min-height: 0; overscroll-behavior: contain; }
/* Bloque (no rejilla centrada): al ampliar, la página crece hacia la derecha y se puede llegar a todo con el dedo.
   Con una rejilla centrada, lo que sobresalía por la izquierda quedaba fuera de alcance. */
.pdf-pages { display: block; padding: 12px 8px 24px; transform-origin: 0 0; width: max-content; min-width: 100%; box-sizing: border-box; }
.pdf-pages > .pdf-page { margin: 0 auto 12px; }
.pdf-page { position: relative; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
.pdf-page canvas { display: block; width: 100%; height: 100%; }
.pdf-msg { display: grid; place-items: center; gap: 16px; padding: 32px 24px; text-align: center; color: #fff; }
.pdf-msg svg { width: 64px; height: 64px; opacity: .8; }
.pdf-count { font-size: 13px; color: rgba(255, 255, 255, .75); min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; }
.pdf-zoom { display: flex; align-items: center; gap: 4px; }

/* ---------- Fase 9: huella del código ---------- */
.code-set { display: grid; gap: 6px; }
.code-list { max-height: 200px; overflow: auto; padding: 8px 10px; border-radius: 10px; background: var(--cal); }
.code-list code { background: none; padding: 0; }
