/* Inventario de llaves — app nueva (asistente guiado). Mobile-first, sin CDN. */
:root {
  --petrol: #1e5a6b;
  --petrol-d: #164450;
  --petrol-2: #22697c;
  --key: #e8c547;
  --key-d: #cca82f;
  --ink: #16211f;
  --muted: #5c6a67;
  --line: #dfe4e2;
  --bg: #eef2f1;
  --card: #ffffff;
  --ok: #1f7a44;
  --ok-bg: #e6f3ea;
  --wear: #9a6a10;
  --wear-bg: #f7efd9;
  --dano: #b02a2a;
  --dano-bg: #f7e3e1;
  --radius: 18px;
  --radius-s: 12px;
  --shadow: 0 10px 30px rgba(20, 40, 45, 0.10);
  --shadow-s: 0 3px 10px rgba(20, 40, 45, 0.08);
  --tap: 52px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}
button { font-family: inherit; }

/* ---------- Pantalla de acceso (gate reutilizado) ---------- */
.locked {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 18px;
}
.locked-card {
  width: min(100%, 26rem);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 1.5rem 1.75rem;
  text-align: center;
}
.locked-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 3.4rem; height: 3.4rem; border-radius: 50%;
  color: var(--petrol); background: #e5eef0; margin-bottom: 1rem;
}
.locked-card h1 { margin: 0 0 .6rem; font-size: 1.4rem; }
.locked-card p { margin: 0 0 1.1rem; color: var(--muted); }
.locked-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; min-height: var(--tap); padding: .85rem 1.4rem;
  font-weight: 700; text-decoration: none; color: #fff; background: var(--petrol);
  border-radius: 999px; box-shadow: 0 8px 22px rgba(30,90,107,.26);
}
.locked-help { margin: 1.1rem 0 .5rem !important; font-size: .9rem; }
.locked-back { display: inline-block; font-size: .9rem; color: var(--petrol); }

/* ---------- Estructura app ---------- */
.app { display: flex; flex-direction: column; min-height: 100dvh; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(160deg, var(--petrol-2), var(--petrol) 55%, var(--petrol-d));
  color: #fff;
  padding: calc(10px + var(--safe-t)) 14px 12px;
  box-shadow: 0 4px 16px rgba(20,40,45,.18);
}
.topbar-row { display: flex; align-items: center; gap: 10px; min-height: 32px; }
.brand { display: inline-flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.brand-name { font-weight: 700; font-size: 1rem; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn.back {
  flex: none; width: 44px; height: 44px; margin-left: -8px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: rgba(255,255,255,.14); color: #fff; border-radius: 12px; cursor: pointer;
}
.save-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.35); transition: background .3s, transform .3s; }
.save-dot.saved { background: var(--key); }
.save-dot.saving { background: #fff; transform: scale(1.15); }

.progress { margin-top: 12px; }
.progress-head { display: flex; justify-content: space-between; align-items: baseline; font-size: .82rem; color: rgba(255,255,255,.88); margin-bottom: 6px; }
.progress-head #stepName { font-weight: 700; color: #fff; }
.progress-track { height: 7px; border-radius: 999px; background: rgba(255,255,255,.22); overflow: hidden; }
.progress-fill { height: 100%; width: 14%; border-radius: 999px; background: var(--key); transition: width .35s cubic-bezier(.4,0,.2,1); }

/* ---------- Escenario / pantallas ---------- */
.stage { position: relative; flex: 1; overflow-x: hidden; }
.screen {
  padding: 20px 16px 88px;   /* holgura inferior: la barra fija (sticky) nunca tapa el contenido */
  max-width: 34rem; margin: 0 auto;
  animation: slideIn .32s cubic-bezier(.4,0,.2,1);
}
.screen.back { animation: slideInBack .32s cubic-bezier(.4,0,.2,1); }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes slideInBack { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .screen, .screen.back { animation: none; }
  .progress-fill { transition: none; }
}

.screen h1 { font-size: 1.5rem; line-height: 1.2; margin: 4px 0 6px; letter-spacing: -.02em; }
.screen .lead { color: var(--muted); margin: 0 0 20px; font-size: 1.02rem; }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--petrol); background: #e5eef0; padding: .28rem .7rem; border-radius: 999px; margin-bottom: 10px; }

/* Tarjetas de elección grandes */
.choices { display: grid; gap: 12px; margin: 6px 0 4px; }
.choice {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 16px; min-height: 68px; cursor: pointer; box-shadow: var(--shadow-s);
  transition: border-color .15s, transform .08s, box-shadow .15s;
}
.choice:active { transform: scale(.99); }
.choice[aria-pressed="true"], .choice.sel { border-color: var(--petrol); box-shadow: 0 0 0 3px rgba(30,90,107,.12), var(--shadow-s); }
.choice .c-ic { flex: none; width: 46px; height: 46px; border-radius: 13px; background: #e5eef0; color: var(--petrol); display: flex; align-items: center; justify-content: center; }
.choice .c-body { flex: 1; min-width: 0; }
.choice .c-title { display: block; font-weight: 700; font-size: 1.06rem; }
.choice .c-sub { display: block; color: var(--muted); font-size: .9rem; margin-top: 3px; line-height: 1.35; }
.choice .c-chev { flex: none; color: var(--muted); }

/* Segmentado (Entrada / Salida) */
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: #e3e9e7; border-radius: 14px; padding: 5px; margin: 4px 0 20px; }
.segmented button {
  min-height: 46px; border: 0; border-radius: 10px; background: transparent; color: var(--muted);
  font-weight: 700; font-size: 1rem; cursor: pointer; transition: background .15s, color .15s, box-shadow .15s;
}
.segmented button[aria-pressed="true"] { background: #fff; color: var(--petrol); box-shadow: var(--shadow-s); }

/* Rejilla de opciones (tipo de piso) */
.optgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.optgrid.two { grid-template-columns: 1fr 1fr; }
.opt {
  min-width: 0; min-height: 74px; padding: 8px 4px; border: 1.5px solid var(--line); border-radius: var(--radius-s); background: var(--card);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-weight: 700; cursor: pointer; box-shadow: var(--shadow-s); transition: border-color .15s, transform .08s;
}
.opt:active { transform: scale(.98); }
.opt[aria-pressed="true"] { border-color: var(--petrol); box-shadow: 0 0 0 3px rgba(30,90,107,.12); }
.opt .o-num { font-size: 1.5rem; line-height: 1; color: var(--petrol); }
.opt .o-lb { font-size: .78rem; color: var(--muted); font-weight: 600; text-align: center; line-height: 1.1; overflow-wrap: anywhere; }

/* Campos */
.field { margin: 0 0 14px; }
.field > label { display: block; font-weight: 650; font-size: .92rem; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; min-height: var(--tap); padding: 12px 14px; font-size: 16px; font-family: inherit;
  border: 1.5px solid var(--line); border-radius: var(--radius-s); background: #fff; color: var(--ink);
}
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 3px solid rgba(30,90,107,.28); border-color: var(--petrol); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

/* Detalles plegables */
.disc { border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--card); margin: 6px 0 16px; overflow: hidden; }
.disc > summary { list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 650; display: flex; justify-content: space-between; align-items: center; }
.disc > summary::-webkit-details-marker { display: none; }
.disc > summary::after { content: ""; width: .55rem; height: .55rem; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .18s; }
.disc[open] > summary::after { transform: rotate(-135deg); }
.disc .disc-body { padding: 0 16px 14px; }

/* Bloque de contador */
.meter {
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 14px; box-shadow: var(--shadow-s);
}
.meter-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.meter-head .m-name { font-weight: 700; font-size: 1.08rem; display: inline-flex; align-items: center; gap: 9px; }
.meter-head .m-ic { width: 34px; height: 34px; border-radius: 10px; background: #e5eef0; color: var(--petrol); display: inline-flex; align-items: center; justify-content: center; }
.photo-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-bottom: 12px; }
.photo-add {
  aspect-ratio: 1/1; border: 1.5px dashed var(--petrol); border-radius: var(--radius-s); background: #f2f7f7; color: var(--petrol);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: .78rem; font-weight: 650; cursor: pointer;
}
.photo-add input { display: none; }
.thumb { position: relative; aspect-ratio: 1/1; border-radius: var(--radius-s); overflow: hidden; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Botón «×»: área pulsable 44×44 (transparente) con un punto visible de 26 px dentro */
.thumb .rm { position: absolute; top: 0; right: 0; width: 44px; height: 44px; border: 0; background: transparent; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.thumb .rm-x { width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 16px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.meter.off .photo-row, .meter.off .field, .meter.off .m-hint { display: none; }
.m-hint { font-size: .84rem; color: var(--muted); margin: -4px 0 10px; }
.switch-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.switch-line span { font-size: .92rem; color: var(--muted); }
.chk { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-weight: 650; font-size: .92rem; }
.chk input { width: 22px; height: 22px; accent-color: var(--petrol); }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 12px 20px; border: 0; border-radius: 999px;
  font-weight: 700; font-size: 1.02rem; cursor: pointer; text-decoration: none;
  transition: transform .08s, background .15s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--petrol); color: #fff; box-shadow: 0 10px 24px rgba(30,90,107,.26); }
.btn.primary:disabled { opacity: .5; box-shadow: none; }
.btn.key { background: var(--key); color: #2a230a; box-shadow: 0 10px 24px rgba(0,0,0,.14); }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn.block { width: 100%; }
.btn.secondary { background: #e5eef0; color: var(--petrol); }

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

/* Navegación inferior fija */
.bottomnav {
  position: sticky; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: auto 1fr; gap: 10px;
  padding: 12px 16px calc(12px + var(--safe-b));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.bottomnav .btn.ghost { padding-inline: 18px; }
.bottomnav[data-first="yes"] { grid-template-columns: 1fr; }
.bottomnav[data-first="yes"] #navBack { display: none; }

/* Toast */
.toast {
  position: fixed; left: 14px; right: 14px; top: calc(12px + var(--safe-t));
  margin: 0 auto; max-width: 30rem;
  background: var(--ink); color: #fff; padding: 13px 16px; border-radius: 12px;
  text-align: center; font-weight: 650; overflow-wrap: anywhere;
  opacity: 0; transform: translateY(-8px); pointer-events: none; transition: .2s ease; z-index: 60;
}
.toast.show { opacity: 1; transform: none; }

.hint { color: var(--muted); font-size: .9rem; }
.center { text-align: center; }

/* ---------- Paso 5: Habitaciones ---------- */
.screen.nofx { animation: none; }
.sec-title { font-size: 1.12rem; margin: 26px 0 12px; letter-spacing: -.01em; }

.roomlist { display: grid; gap: 12px; margin: 4px 0 18px; }
.roomcard {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 15px 16px; cursor: pointer; box-shadow: var(--shadow-s); transition: transform .12s, border-color .15s;
}
.roomcard:active { transform: scale(.99); }
.roomcard.done { border-color: var(--ok); background: var(--ok-bg); }
.roomcard .rc-body { flex: 1; min-width: 0; }
.roomcard .rc-name { display: block; font-weight: 700; font-size: 1.08rem; }
.roomcard .rc-sub { display: block; color: var(--muted); font-size: .86rem; margin: 2px 0 8px; }
.roomcard .rc-bar { display: block; height: 6px; border-radius: 999px; background: #e3e9e7; overflow: hidden; }
.roomcard .rc-fill { display: block; height: 100%; background: var(--petrol); border-radius: 999px; transition: width .3s; }
.roomcard.done .rc-fill { background: var(--ok); }
.roomcard .rc-check { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--ok); color: #fff; display: flex; align-items: center; justify-content: center; animation: pop .3s cubic-bezier(.34,1.56,.64,1); }
.roomcard .c-chev { flex: none; color: var(--muted); }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }

.addroom { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 10px; }
.addroom input, .room-name-input {
  width: 100%; border: 1.5px solid var(--line); border-radius: var(--radius-s);
  padding: 13px 14px; font: inherit; background: var(--card); color: var(--ink);
}
.addroom input:focus, .room-name-input:focus, .el-extra textarea:focus, .padwrap input:focus {
  outline: 3px solid rgba(30,90,107,.28); border-color: var(--petrol);
}

/* Detalle de habitación */
.detail-head { display: flex; align-items: center; gap: 10px; margin: 2px 0 4px; }
.room-name-input { flex: 1; font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; border-color: transparent; background: transparent; padding: 6px 6px; }
.room-name-input:hover { background: var(--card); }
.icon-danger {
  flex: none; width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--card); color: var(--dano); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.icon-danger:active { transform: scale(.95); }

.ellist { display: grid; gap: 12px; margin: 6px 0 4px; }
.elrow { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px 15px; }
.el-name { font-weight: 650; font-size: 1.02rem; margin-bottom: 10px; }
.estados3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.est {
  border: 1.5px solid var(--line); background: #f4f7f6; color: var(--muted);
  border-radius: 12px; padding: 12px 6px; font-weight: 700; font-size: .95rem; cursor: pointer; transition: .12s;
}
.est:active { transform: scale(.97); }
.est-ok[aria-pressed="true"] { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.est-desgaste[aria-pressed="true"] { background: var(--wear-bg); border-color: var(--wear); color: var(--wear); }
.est-dano[aria-pressed="true"] { background: var(--dano-bg); border-color: var(--dano); color: var(--dano); }
.el-extra { margin-top: 12px; }
.el-extra textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: var(--radius-s);
  padding: 12px 14px; font: inherit; min-height: 74px; resize: vertical; background: var(--card); color: var(--ink); margin-bottom: 12px;
}

/* ---------- Paso 6: Llaves ---------- */
.keylist { display: grid; gap: 10px; margin: 4px 0; }
.keyrow {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow-s);
}
.keyrow .k-name { font-weight: 650; font-size: 1.02rem; }
.k-step { display: inline-flex; align-items: center; gap: 4px; }
.stepper {
  width: var(--tap); height: var(--tap); border-radius: 13px; border: 1.5px solid var(--line);
  background: #f4f7f6; color: var(--petrol); font-size: 1.5rem; font-weight: 700; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.stepper:active { transform: scale(.94); }
.k-val { min-width: 2ch; text-align: center; font-weight: 800; font-size: 1.2rem; }

/* ---------- Paso 7: Revisar y firmar ---------- */
.avisos { background: var(--wear-bg); border: 1px solid #ecdfb6; border-radius: var(--radius); padding: 14px 16px; margin: 4px 0 8px; }
.avisos.ok { background: var(--ok-bg); border-color: #cae6d3; }
.avisos .av-title { font-weight: 700; margin: 0 0 6px; }
.avisos ul { margin: 0; padding-left: 20px; }
.avisos li { margin: 3px 0; color: var(--ink); }
.avisos.ok p { margin: 0; font-weight: 650; color: var(--ok); }

.padwrap { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px 15px; margin-bottom: 14px; box-shadow: var(--shadow-s); }
.pad-label { display: block; font-weight: 700; margin-bottom: 10px; }
.padwrap input { width: 100%; border: 1.5px solid var(--line); border-radius: var(--radius-s); padding: 12px 14px; font: inherit; background: #fff; color: var(--ink); }
.pad {
  display: block; width: 100%; height: 150px; margin: 4px 0 8px;
  border: 1.5px dashed var(--petrol); border-radius: var(--radius-s); background: #fbfdfd; touch-action: none; cursor: crosshair;
}
.pad-clear { padding: 8px 12px; font-size: .88rem; }

.smeter { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px 14px; }
.smeter.warn { background: var(--wear-bg); border-color: #ecdfb6; }
.sm-bar { height: 8px; border-radius: 999px; background: #e3e9e7; overflow: hidden; margin-bottom: 8px; }
.sm-bar span { display: block; height: 100%; background: var(--petrol); border-radius: 999px; transition: width .3s; }
.smeter.warn .sm-bar span { background: var(--wear); }
.sm-text { margin: 0; font-size: .84rem; color: var(--muted); }

/* ---------- Arreglos QA (ronda 1) ---------- */
/* Nombres largos sin espacios: que nada se salga por la derecha en móvil */
.roomcard, .choice, .keyrow, .elrow { min-width: 0; }
.roomcard .rc-name, .roomcard .rc-sub,
.choice .c-title, .choice .c-sub,
.el-name, .keyrow .k-name { overflow-wrap: anywhere; word-break: break-word; min-width: 0; }
.keyrow .k-name { flex: 1; }
.keyrow .k-step { flex: none; }          /* los botones +/− nunca se encogen */
.estados3 { min-width: 0; }
.estados3 .est { min-width: 0; }          /* «Daño» siempre visible y pulsable */

/* Elemento: cabecera con nombre editable + borrar */
.el-head { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.el-name-input {
  flex: 1; min-width: 0; font: inherit; font-weight: 650; font-size: 1.02rem; line-height: 1.3;
  border: 1.5px solid transparent; border-radius: 8px; background: transparent; color: var(--ink);
  padding: 8px 8px; overflow-wrap: anywhere;
  resize: none; overflow: hidden; display: block; min-height: 0;   /* textarea que crece y hace salto de línea */
}
.el-name-input:hover { background: #f4f7f6; }
.el-name-input:focus { outline: 3px solid rgba(30,90,107,.28); border-color: var(--petrol); background: #fff; }
.icon-danger.sm { flex: none; width: 44px; height: 44px; border-radius: 10px; }   /* área táctil ≥44 (icono pequeño dentro) */

/* Objetivos táctiles más cómodos */
.chk { min-height: 44px; min-width: 88px; padding: 6px 10px; border-radius: 10px; }

/* En escritorio, la barra inferior no ocupa todo el ancho: se ciñe al contenido */
@media (min-width: 620px) {
  .bottomnav { max-width: 34rem; margin-inline: auto; }
}

/* ---------- QA ronda 3: selector Entrada/Salida visible en pasos 1 y 2 ---------- */
.modesel { margin: 0 0 18px; }
.modesel .segmented { margin: 0; }

/* ---------- r9: cabecera más grande y más premium (misma marca que la web) ---------- */
.topbar { padding-top: calc(12px + var(--safe-t)); padding-bottom: 14px; }
.topbar-row { min-height: 40px; gap: 10px; }
.brand { gap: 10px; }
.brand-mark { display: inline-flex; flex: none; }
.brand-mark img { width: 36px; height: 36px; display: block; }
.brand-name {
  font-family: Georgia, "Iowan Old Style", "Noto Serif", "Times New Roman", serif;
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.08;
  letter-spacing: 0.005em;
  white-space: normal;       /* red de seguridad: si no cabe, pasa a dos líneas; nunca «…» */
  overflow: visible;
  text-overflow: clip;
  text-wrap: balance;
}
@media (max-width: 359.98px) {
  .brand-mark img { width: 32px; height: 32px; }
  .brand-name { font-size: 1.06rem; }
}

/* ---------- r11: selector de idioma ES/EN ---------- */
.lang-switch {
  display: inline-flex; flex: none; align-items: center; gap: 1px; padding: 2px;
  border: 1px solid rgba(255,255,255,.34); border-radius: 999px; background: rgba(255,255,255,.08);
}
.lang-switch button {
  font: 700 .68rem/1 var(--sans); letter-spacing: .08em; color: rgba(255,255,255,.82);
  background: transparent; border: 0; border-radius: 999px; min-width: 1.9rem; height: 1.7rem; padding: 0 .4rem; cursor: pointer;
}
.lang-switch button[aria-pressed="true"] { background: #fff; color: var(--petrol); }
.lang-switch button:focus-visible { outline: 2px solid var(--key); outline-offset: 1px; }
.lang-switch--card { float: right; margin: -6px -6px 0 8px; border-color: var(--line); background: #f3f6f5; }
.lang-switch--card button { color: var(--muted); }
.lang-switch--card button[aria-pressed="true"] { background: var(--petrol); color: #fff; }
@media (max-width: 359.98px) { .lang-switch button { min-width: 1.75rem; padding: 0 .32rem; } }

/* ---------- r12 freemium: aviso «gratis», muro de pago y vista previa ---------- */
.free-note { margin: 10px 0 4px; padding: 10px 12px; border-radius: var(--radius-s); background: #e5eef0; color: var(--petrol-d); font-size: .92rem; font-weight: 600; line-height: 1.4; }
body.pw-open, body.pv-open { overflow: hidden; }
.pw-overlay { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center; padding: 12px 12px calc(12px + var(--safe-b)); background: rgba(14, 30, 34, .55); overflow-y: auto; }
@media (min-width: 560px) { .pw-overlay { align-items: center; } }
.pw-card { position: relative; width: 100%; max-width: 440px; margin: auto 0 0; background: var(--card); border-radius: 22px; padding: 24px 20px 16px; box-shadow: 0 24px 60px rgba(0,0,0,.28); display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 560px) { .pw-card { margin: auto; } }
.pw-x { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 28px; line-height: 1; cursor: pointer; }
.pw-ic { width: 52px; height: 52px; border-radius: 16px; background: #e5eef0; color: var(--petrol); display: inline-flex; align-items: center; justify-content: center; }
.pw-card h2 { margin: 2px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.55rem; line-height: 1.15; letter-spacing: -.01em; }
.pw-lead { margin: 0; color: var(--muted); font-size: .96rem; line-height: 1.45; }
.pw-price { margin: 2px 0 0; display: flex; align-items: baseline; gap: 8px; }
.pw-amount { font-size: 2.1rem; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.pw-once { color: var(--muted); font-size: .92rem; }
.pw-list { list-style: none; margin: 0 0 4px; padding: 0; display: grid; gap: 7px; }
.pw-list li { display: flex; gap: 8px; align-items: flex-start; font-size: .93rem; line-height: 1.35; }
.pw-list li svg { flex: none; color: var(--ok); margin-top: 1px; }
.pw-card .btn { min-height: 50px; }
.pw-card a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.pw-note { margin: 2px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.4; text-align: center; }
.pv-overlay { position: fixed; inset: 0; z-index: 85; display: flex; flex-direction: column; background: #e9e5dc; }
.pv-bar { display: flex; align-items: center; gap: 8px; padding: calc(8px + var(--safe-t)) 10px 8px; background: var(--petrol); color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.pv-title { flex: 1; min-width: 0; font-size: .95rem; line-height: 1.2; }
.pv-bar .btn { min-height: 42px; padding: 0 12px; font-size: .88rem; width: auto; white-space: nowrap; }
.pv-bar a.btn { display: inline-flex; align-items: center; text-decoration: none; }
.pv-frame { flex: 1; width: 100%; border: 0; background: #e9e5dc; }
.pv-print-note { display: none; }
@media (max-width: 400px) { .pv-title { font-size: .85rem; } .pv-bar .btn { padding: 0 9px; font-size: .8rem; } }
/* Imprimir la app con la vista previa o el muro abiertos no da un acta limpia: solo un aviso */
@media print {
  body.pv-open > *:not(.pv-overlay), body.pw-open > *:not(.pw-overlay) { display: none !important; }
  .pv-overlay .pv-bar, .pv-overlay .pv-frame { display: none !important; }
  .pv-overlay { position: static; background: #fff; }
  .pv-print-note { display: block; margin: 40px; padding: 24px; border: 3px solid #9a2a2a; color: #6e1f1f; font: 700 20px/1.4 var(--sans); text-align: center; }
  .pw-overlay { position: static; background: #fff; }
}
