/* MyWay — estilos.
   Usa la tipografía del propio móvil (la de iPhone en iPhone, la de Android en
   Android) para que se sienta como una app más, y el naranja del logo de la
   Unidad Canina Rescate Castellón para lo importante. */

:root {
  --bg: #0f0f0e;
  --card: #1c1c1b;
  --card-2: #252523;
  --fill: #2c2c2a;          /* botones secundarios, selectores */
  --fill-strong: #3a3a37;
  --seg-on: #4a4a46;
  --sep: #2f2e2b;
  --text: #f5f4f1;
  --text-2: #b8b5ad;
  --text-3: #8e8b84;

  --accent: #ef8732;        /* naranja del logo */
  --accent-deep: #c9661a;
  --accent-ink: #1d1206;    /* texto sobre naranja */
  --accent-text: #f39a52;   /* naranja cuando es texto o icono */
  --accent-soft: rgb(239 135 50 / 0.16);
  --red: #d93a2f;
  --red-text: #ff8a80;
  --red-soft: rgb(217 58 47 / 0.18);
  --green: #7cc47f;
  --amber: #e6b04a;
  --on-green: #0f1f10;

  --shadow: none;
  --mock-bg: #232322;
  --mock-raise: #333331;
  --mock-line: #343432;
  --toast-bg: #f5f4f1;
  --toast-text: #1b1b1a;
  --toast-action: #b05410;
  --needle-shadow: rgb(0 0 0 / 0.45);
  --backdrop: rgb(0 0 0 / 0.6);
  --topo: rgb(242 236 226 / 0.15);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r: 14px;
  --r-lg: 18px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);

  color-scheme: dark;
}

/* Tema claro: se lee mejor a pleno sol. Lo activa data-theme="light" en <html>
   (automático según el ajuste del móvil, o elegido en Información). */
:root[data-theme="light"] {
  --bg: #f2f1ee;
  --card: #ffffff;
  --card-2: #f7f6f3;
  --fill: #e8e6e1;
  --fill-strong: #dcd9d3;
  --seg-on: #ffffff;
  --sep: #e4e1db;
  --text: #1b1b1a;
  --text-2: #55534e;
  --text-3: #6f6c66;

  --accent-text: #b05410;
  --accent-soft: rgb(239 135 50 / 0.14);
  --red-text: #b42318;
  --red-soft: #fbe9e7;
  --green: #2f7d32;
  --amber: #8a5a00;
  --on-green: #ffffff;

  --shadow: 0 1px 2px rgb(30 25 15 / 0.06), 0 2px 10px rgb(30 25 15 / 0.04);
  --mock-bg: #ffffff;
  --mock-raise: #efedea;
  --mock-line: #e9e6e1;
  --toast-bg: #1b1b1a;
  --toast-text: #f5f4f1;
  --toast-action: #f39a52;
  --needle-shadow: rgb(60 40 20 / 0.22);
  --backdrop: rgb(20 18 15 / 0.4);
  --topo: rgb(92 70 40 / 0.13);

  color-scheme: light;
}

/* iPhone con la app instalada: la hora y la batería salen siempre en blanco, así
   que en el tema claro se pone detrás una franja oscura para que se lean */
:root[data-theme="light"] body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  height: var(--safe-t);
  background: #1b1b1a;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

[hidden] { display: none !important; }
h1, h2, h3, p, ol, ul, dl, dd { margin: 0; }
ol, ul { padding: 0; }
a { color: inherit; }
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.ic {
  width: 24px;
  height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }

/* ---------- Estructura ---------- */

#app { max-width: 520px; margin: 0 auto; }

.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(var(--safe-t) + 8px) 16px calc(var(--safe-b) + 20px);
}
.screen-top { display: flex; align-items: center; justify-content: flex-end; min-height: 44px; }

/* Curvas de nivel de fondo, como en un mapa topográfico. El dibujo se usa como
   máscara y se colorea con --topo; se difumina hacia abajo para no restar lectura. */
.screen--home, .screen--onb, .screen--install, .screen--nav { position: relative; isolation: isolate; }
.screen--home::before, .screen--onb::before, .screen--install::before, .screen--nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--topo);
  -webkit-mask: url(../img/topo.svg) center -60px / 780px auto repeat;
  mask: url(../img/topo.svg) center -60px / 780px auto repeat;
  transform: translateZ(0); /* se pinta una vez y no se repinta al girar la brújula */
  pointer-events: none;
}
.screen--home::after, .screen--onb::after, .screen--install::after, .screen--nav::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom, transparent 0%, transparent 32%, var(--bg) 78%);
  pointer-events: none;
}
/* En la brújula, el mapa rodea la esfera y se apaga antes de la distancia */
.screen--nav::after { background: linear-gradient(to bottom, transparent 0%, transparent 40%, var(--bg) 64%); }
.screen-bottom { display: grid; gap: 4px; margin-top: auto; padding-top: 24px; text-align: center; }

.card {
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow);
}
.card-pad { padding: 16px; }
.card-pad > p { font-size: 16px; }
.card-pad > p + p { margin-top: 2px; }

.group-title {
  margin: 26px 4px 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-2);
}
.group-title--split { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.group-meta { font-weight: 400; color: var(--text-3); font-variant-numeric: tabular-nums; }

.footnote { margin: 8px 4px 0; font-size: 14px; line-height: 1.4; color: var(--text-3); }

/* ---------- Botones ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 18px;
  overflow: hidden;
  border-radius: var(--r);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.1s ease, background-color 0.15s ease;
}
.btn:active { transform: scale(0.985); }
.btn-lg { min-height: 58px; border-radius: 16px; font-size: 18px; }
.btn-sm { min-height: 40px; padding: 0 14px; border-radius: 12px; font-size: 15px; }
.btn-sm .ic { width: 18px; height: 18px; }

.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:active { background: var(--accent-deep); }
.btn-secondary { background: var(--fill); color: var(--text); }
.btn-secondary:active { background: var(--fill-strong); }
.btn-plain { color: var(--text-2); }
.btn-destructive { color: var(--red-text); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:active { filter: brightness(0.92); }
.btn-lost { background: var(--red-soft); color: var(--red-text); }
.btn-lost:active { filter: brightness(0.95); }

.btn.is-busy { pointer-events: none; }
.btn.is-busy::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 35%;
  height: 3px;
  background: currentColor;
  opacity: 0.4;
  animation: busy 1.1s ease-in-out infinite;
}
@keyframes busy {
  from { transform: translateX(-100%); }
  to { transform: translateX(300%); }
}

.btn-link {
  padding: 10px 2px;
  font-size: 15px;
  font-weight: 500;
  color: var(--accent-text);
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text-2);
}
.icon-btn:active { background: var(--fill); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--fill);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Selector segmentado, como el del sistema */
.seg {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  background: var(--fill);
}
.seg button {
  flex: 1;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-2);
}
.seg button[aria-pressed="true"] {
  background: var(--seg-on);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.14);
}
.seg--sm { display: inline-flex; }
.seg--sm button { flex: none; min-height: 34px; font-size: 14px; }

/* ---------- Logo ---------- */

.patch {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px var(--sep);
}
.patch--md { width: 72px; height: 72px; }
.patch--lg { width: 104px; height: 104px; box-shadow: 0 0 0 1px var(--sep), 0 8px 24px rgb(0 0 0 / 0.14); }

/* ---------- Primera vez ---------- */

.intro { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 4px 0 2px; text-align: center; }
.intro-title { margin-top: 8px; font-size: 34px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.intro-text { max-width: 26ch; font-size: 17px; color: var(--text-2); }

.features { list-style: none; padding: 2px 0; }
.features li { position: relative; display: grid; grid-template-columns: 40px 1fr; gap: 14px; padding: 14px 16px; }
.features li + li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 70px;
  right: 0;
  height: 1px;
  background: var(--sep);
}
.feature-ic {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.features h3 { font-size: 17px; font-weight: 600; line-height: 1.3; }
.features p { margin-top: 2px; font-size: 15px; color: var(--text-2); }

.callout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  background: var(--accent-soft);
}
.callout .ic { margin-top: 1px; color: var(--accent-text); }
.callout h3 { font-size: 16px; font-weight: 600; line-height: 1.3; }
.callout p { margin-top: 3px; font-size: 15px; color: var(--text-2); }

/* ---------- Inicio ---------- */

.appbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-text { display: grid; min-width: 0; }
.brand-icon { width: 40px; height: 40px; flex: none; border-radius: 22%; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.06); }
.brand-name { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; }
.brand-unit { font-size: 13px; line-height: 1.25; color: var(--text-2); }

.status-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: var(--r);
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 14px;
}

.gps {
  --q: var(--text-3);
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.gps-label { font-weight: 600; color: var(--text); }
.gps[data-q="good"] { --q: var(--green); }
.gps[data-q="fair"] { --q: var(--amber); }
.gps[data-q="poor"], .gps[data-q="error"] { --q: var(--red-text); }
.gps[data-q="error"] { color: var(--red-text); }

.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 13px; }
.bars i { width: 3.5px; border-radius: 1px; background: var(--fill-strong); }
.bars i:nth-child(1) { height: 5px; }
.bars i:nth-child(2) { height: 8px; }
.bars i:nth-child(3) { height: 10.5px; }
.bars i:nth-child(4) { height: 13px; }
.gps[data-bars="1"] .bars i:nth-child(-n + 1),
.gps[data-bars="2"] .bars i:nth-child(-n + 2),
.gps[data-bars="3"] .bars i:nth-child(-n + 3),
.gps[data-bars="4"] .bars i:nth-child(-n + 4) { background: var(--q); }
.gps[data-q="searching"] .bars i { animation: scan 1.6s ease-in-out infinite; }
.gps[data-q="searching"] .bars i:nth-child(2) { animation-delay: 0.15s; }
.gps[data-q="searching"] .bars i:nth-child(3) { animation-delay: 0.3s; }
.gps[data-q="searching"] .bars i:nth-child(4) { animation-delay: 0.45s; }
@keyframes scan {
  0%, 100% { background: var(--fill-strong); }
  40% { background: var(--text-3); }
}

.offline { display: flex; align-items: center; gap: 5px; margin-left: auto; color: var(--text-3); }
.offline .ic { width: 16px; height: 16px; stroke-width: 2.4; }
.offline[data-ready="true"] { color: var(--green); }
.offline[data-ready="false"] .ic { display: none; }

.notice {
  display: grid;
  gap: 2px;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: var(--r);
  background: var(--red-soft);
  font-size: 15px;
  color: var(--text-2);
}
.notice strong { font-weight: 600; color: var(--red-text); }

.banner {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px 12px;
  margin-top: 10px;
  padding: 12px 14px;
}
.banner-ic { color: var(--accent-text); }
.banner-text { font-size: 15px; font-weight: 500; }
.banner-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 4px; }

.home-main { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 20px 0; }

.hero { position: relative; padding: 20px; }
.hero-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.hero--empty { display: grid; justify-items: center; gap: 8px; padding: 28px 22px; text-align: center; }
.hero-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.hero-icon .ic { width: 28px; height: 28px; }
.hero-title { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.hero-text { font-size: 16px; color: var(--text-2); }
.hero-label { font-size: 15px; font-weight: 600; color: var(--text-2); }
.hero-dir { margin-top: 4px; font-size: 19px; font-weight: 600; color: var(--accent-text); }
.hero-meta { margin-top: 2px; font-size: 14px; color: var(--text-3); }
#home-point .readout-dist { margin-top: 2px; }

.readout-dist { display: flex; align-items: baseline; gap: 6px; }
.big-num {
  font-size: clamp(56px, 18vw, 76px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.big-unit { font-size: 24px; font-weight: 600; color: var(--text-2); }

.actions { display: grid; gap: 10px; }

/* ---------- Barra de las pantallas interiores ---------- */

.navbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: 52px;
}
.navbar > :first-child { justify-self: start; margin-left: -8px; }
.navbar > :last-child { justify-self: end; }
.navbar-title { font-size: 17px; font-weight: 600; text-align: center; white-space: nowrap; }

.chip--gps[data-q="good"] { color: var(--green); }
.chip--gps[data-q="fair"] { color: var(--amber); }
.chip--gps[data-q="poor"], .chip--gps[data-q="error"] { color: var(--red-text); }

/* ---------- Volver al punto ---------- */

.dial-wrap { flex: 1; display: grid; place-items: center; min-height: 0; padding-top: 8px; }
.dial { width: min(100%, 46dvh, 380px); height: auto; aspect-ratio: 1; overflow: visible; }
.dial-face { fill: var(--card); stroke: var(--sep); stroke-width: 1.5; }
.tick { stroke: var(--text-3); stroke-width: 1.2; stroke-linecap: round; }
.tick--major { stroke: var(--text-2); stroke-width: 2; }
.tick--card { stroke: var(--text); stroke-width: 2.6; }
.tick--north { stroke: var(--accent); stroke-width: 3.5; }
.dial-letter { font: 600 20px var(--font); fill: var(--text-2); text-anchor: middle; }
.dial-letter--n { fill: var(--accent-text); }
.lubber { fill: var(--text); }
.needle-l { fill: var(--accent); }
.needle-r { fill: var(--accent-deep); }
#needle { filter: drop-shadow(0 6px 10px var(--needle-shadow)); }
.target-dot { fill: var(--accent); stroke: var(--card); stroke-width: 4; }

.near-ring { fill: none; stroke: var(--accent); stroke-width: 3; }
.near-dot { fill: var(--accent); }
.pulse {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  transform-origin: 0 0;
  animation: pulse 2.2s ease-out infinite;
}
.pulse--2 { animation-delay: 1.1s; }
@keyframes pulse {
  from { transform: scale(1); opacity: 0.8; }
  to { transform: scale(3.1); opacity: 0; }
}

.nav-readout { margin-top: 8px; text-align: center; }
.nav-readout .readout-dist { justify-content: center; }
.readout-sub { margin-top: 6px; font-size: 18px; font-weight: 600; color: var(--accent-text); }
.nav-readout.is-near .big-num { font-size: clamp(32px, 9vw, 40px); letter-spacing: -0.01em; color: var(--accent-text); }
.nav-readout.is-near .readout-sub { font-size: 17px; font-weight: 400; color: var(--text-2); }

.hint {
  min-height: 2.9em;
  max-width: 34ch;
  margin: 10px auto 0;
  font-size: 15px;
  text-align: center;
  color: var(--text-3);
}
.hint.is-warn { color: var(--amber); }

.nav-foot { display: grid; gap: 8px; margin-top: 6px; }
.nav-src { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }

@media (max-height: 720px) {
  .dial { width: min(100%, 40dvh, 380px); }
  .screen--nav .big-num { font-size: 56px; }
  .readout-sub { margin-top: 4px; font-size: 17px; }
  .hint { min-height: 2.8em; margin-top: 6px; font-size: 14px; }
}

.portrait-guard { display: none; }
@media (orientation: landscape) and (max-height: 540px) {
  .screen--nav .portrait-guard {
    position: fixed;
    inset: 0;
    z-index: 5;
    display: grid;
    place-items: center;
    padding: 24px;
    background: var(--bg);
    font-size: 22px;
    font-weight: 600;
    text-align: center;
  }
}

/* ---------- Me he perdido ---------- */

.screen--lost .btn-danger { margin-top: 12px; }

.coords { padding: 2px 16px; }
.kv > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 0; }
.kv > div + div { border-top: 1px solid var(--sep); }
.kv dt { font-size: 15px; color: var(--text-2); }
.kv dd { font-size: 20px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.kv > .kv-stack { flex-direction: column; align-items: stretch; gap: 4px; }
.kv-stack dd { font-size: 18px; line-height: 1.35; text-align: left; white-space: pre-line; }
.coords.is-empty dd { color: var(--text-3); }

.action-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; margin-top: 12px; }
.action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 68px;
  border-radius: var(--r);
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-text);
  text-decoration: none;
}
.action .ic { width: 22px; height: 22px; }
.action:active { background: var(--card-2); }

.point-dist { margin-bottom: 4px; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }

.tips { list-style: none; counter-reset: tip; padding: 2px 16px; }
.tips li { counter-increment: tip; position: relative; padding: 12px 0 12px 38px; font-size: 16px; }
.tips li + li { border-top: 1px solid var(--sep); }
.tips li::before {
  content: counter(tip);
  position: absolute;
  left: 0;
  top: 12px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--fill);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
}

/* ---------- Información ---------- */

.unit-card { display: flex; align-items: center; gap: 14px; margin-top: 8px; padding: 14px 16px; }
.unit-card p { font-size: 15px; color: var(--text-2); }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.row-actions:not(:has(> :not([hidden]))) { display: none; }
.info-foot { padding: 28px 0 4px; font-size: 13px; text-align: center; color: var(--text-3); }

/* ---------- Instalar ---------- */

.inst-hero { display: flex; align-items: center; gap: 14px; padding: 6px 0 22px; }
.app-icon {
  width: 72px;
  height: 72px;
  flex: none;
  border-radius: 22%;
  box-shadow: 0 4px 14px rgb(0 0 0 / 0.18), 0 0 0 1px rgb(0 0 0 / 0.04);
}
.inst-name { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.inst-unit { font-size: 14px; color: var(--text-2); }

.inst { display: grid; gap: 14px; }
.inst-title { font-size: 26px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.15; }
.inst-lead { font-size: 17px; color: var(--text-2); }

.inst-manual { border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow); }
.inst-manual summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.inst-manual summary::-webkit-details-marker { display: none; }
.inst-manual summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  margin-right: 4px;
  border-right: 2px solid var(--text-3);
  border-bottom: 2px solid var(--text-3);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}
.inst-manual[open] summary::after { transform: rotate(-135deg); }
.inst-manual .steps { padding: 4px 16px 18px; }

.steps { list-style: none; counter-reset: st; display: grid; gap: 24px; }
.steps li { counter-increment: st; position: relative; padding-left: 40px; }
.steps li::before {
  content: counter(st);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 15px;
  font-weight: 700;
}
.steps h3 { padding-top: 2px; font-size: 17px; font-weight: 600; line-height: 1.3; }
.steps p { margin-top: 2px; font-size: 15px; color: var(--text-2); }

/* Dibujos que imitan lo que se ve en el móvil */
.mock {
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--sep);
  border-radius: 14px;
  background: var(--mock-bg);
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.25;
}
.mock .ic { width: 22px; height: 22px; color: var(--text-3); }
.mock-bar { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.mock-url {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--mock-raise);
  font-size: 14px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mock-tabs {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--text-3);
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
}
.mock-hl {
  display: grid;
  place-items: center;
  padding: 5px;
  border-radius: 10px;
  box-shadow: 0 0 0 2px var(--accent);
  animation: hl 1.8s ease-in-out infinite;
}
.mock .mock-hl .ic { color: var(--accent-text); }
@keyframes hl {
  50% { box-shadow: 0 0 0 2px var(--accent), 0 0 0 7px rgb(239 135 50 / 0.22); }
}
.mock-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; }
.mock-row + .mock-row { border-top: 1px solid var(--mock-line); }
.mock-list--ios .mock-row { justify-content: space-between; }
.mock-row--hl {
  border-radius: 0 0 13px 13px;
  background: var(--accent-soft);
  color: var(--text);
  box-shadow: inset 0 0 0 2px var(--accent);
}
.mock .mock-row--hl .ic { color: var(--accent-text); }
.mock-dialog { display: grid; gap: 14px; padding: 14px; }
.mock-dialog-t { font-size: 16px; font-weight: 600; color: var(--text); }
.mock-app { display: flex; align-items: center; gap: 12px; }
.mock-app img { width: 40px; height: 40px; border-radius: 10px; }
.mock-app span { display: grid; }
.mock-app strong { font-weight: 600; color: var(--text); }
.mock-app small { font-size: 13px; color: var(--text-3); }
.mock-actions { display: flex; align-items: center; justify-content: flex-end; gap: 18px; color: var(--text-3); }
.mock-actions--top { justify-content: space-between; }
.mock-pill { padding: 7px 14px; border-radius: 999px; font-weight: 600; color: var(--accent-text); }

.mock-home {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: start;
  gap: 14px 10px;
  padding: 16px 14px 14px;
}
.tile {
  justify-self: center;
  width: 100%;
  max-width: 52px;
  aspect-ratio: 1;
  border-radius: 22%;
  background: var(--mock-raise);
}
.tile--app { display: grid; justify-items: center; gap: 5px; max-width: none; aspect-ratio: auto; background: none; }
.tile--app img { width: 52px; height: 52px; border-radius: 22%; box-shadow: 0 0 0 2px var(--mock-bg), 0 0 0 4px var(--accent); }
.tile--app small { font-size: 12px; color: var(--text); }

.qr-frame {
  justify-self: center;
  padding: 14px;
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow), 0 0 0 1px var(--sep);
}
.qr { width: 220px; height: 220px; }
.qr svg { display: block; width: 100%; height: 100%; }
.qr-url { font-size: 15px; text-align: center; color: var(--text-2); word-break: break-all; }

.done-badge {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: var(--on-green);
}
.done-badge .ic { width: 32px; height: 32px; stroke-width: 2.6; }
#inst-again { justify-self: center; }

/* ---------- Diálogo ---------- */

.dialog {
  width: min(100% - 32px, 400px);
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 20px 50px rgb(0 0 0 / 0.3);
}
.dialog::backdrop { background: var(--backdrop); }
.dialog form { display: grid; gap: 10px; padding: 22px 20px 18px; }
.dialog-title { font-size: 20px; font-weight: 700; line-height: 1.25; }
.dialog-body { display: grid; gap: 8px; font-size: 16px; color: var(--text-2); }
.dialog-body ol { display: grid; gap: 6px; padding-left: 1.3em; }
.dialog-body li::marker { font-weight: 700; color: var(--accent-text); }
.dialog-actions { display: flex; flex-direction: column-reverse; gap: 8px; margin-top: 10px; }

/* ---------- Aviso flotante ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-b) + 18px);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 10px 10px 10px 16px;
  border-radius: 14px;
  background: var(--toast-bg);
  color: var(--toast-text);
  font-size: 16px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.25);
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.is-in { opacity: 1; transform: translate(-50%, 0); }
.toast-action { padding: 8px 10px; font-size: 16px; font-weight: 600; color: var(--toast-action); }

.noscript { padding: 24px; text-align: center; }

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