/* =========================================================
   SplitÑAÑAM — estilos
   Paleta: crema + brasa (clara, cálida). Una sola app, un solo
   archivo, sin dependencias externas (nada de fuentes ni iconos
   remotos).
   ========================================================= */

:root {
  --bg: #fbf3e6;
  --bg-soft: #f6ead4;
  --card: #ffffff;
  --card-2: #f4e8d3;
  --line: #e6d4b3;
  --text: #2b1d10;
  --text-dim: #5c4830;
  --text-faint: #7d6a52;
  --flame: #ff8c1a;
  --flame-2: #d9670a;
  --ember: #d94a2b;
  --leaf: #1f9d5c;
  --sky: #1f77c9;
  --gold: #b8790a;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(60,40,10,.14);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(1200px 800px at 50% -10%, #fce3b8 0%, var(--bg) 55%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.app { min-height: 100vh; padding-top: var(--safe-top); padding-bottom: var(--safe-bottom); display: flex; flex-direction: column; }
.app-footer { text-align: center; font-size: 11px; color: var(--text-faint); padding: 10px 0 calc(18px + var(--safe-bottom)); }
.app-footer a { color: var(--text-faint); text-decoration: underline; }

/* --------- mascota de la ayuda con IA (vídeo de Pollito, en bucle) --------- */
.ai-mascot { width: 40px; height: 70px; flex-shrink: 0; border-radius: 10px; overflow: hidden; background: #fbead0; }
.ai-mascot video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pollito-avatar { background: #fbead0; overflow: hidden; }
.pollito-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* --------- enlace de apoyo / PayPal --------- */
/* El logotipo de PayPal es de uso libre para enlazar a un pago/donación
   (paypal.me); lo pintamos con sus colores de marca en vez de usar una
   imagen externa, para que no dependa de ningún servidor de terceros. */
.support-paypal-link { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 6px auto 4px; text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; width: fit-content; box-shadow: var(--shadow); }
.support-paypal-link span:first-child { font-size: 13px; font-weight: 700; color: var(--text-dim); }
.paypal-wordmark { font-size: 17px; font-weight: 800; font-style: italic; letter-spacing: -0.5px; }
.paypal-wordmark .pp-pay { color: #003087; }
.paypal-wordmark .pp-pal { color: #009cde; }
.app-footer .support-paypal-link { margin: 6px auto; padding: 6px 12px; }
.app-footer .support-paypal-link span:first-child { font-size: 11px; }
.app-footer .paypal-wordmark { font-size: 13px; }

/* --------- utilidades --------- */
.screen { padding: 20px 18px 24px; max-width: 560px; margin: 0 auto; width: 100%; flex: 1; animation: screenIn .28s ease both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.h1 { font-size: 26px; font-weight: 800; margin: 4px 0 6px; line-height: 1.2; }
.h2 { font-size: 19px; font-weight: 700; margin: 0 0 10px; }
.sub { color: var(--text-dim); font-size: 14.5px; margin: 0 0 18px; line-height: 1.45; }
.section-title { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); font-weight: 700; margin: 22px 0 10px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.spacer { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 6px; background: var(--card-2); border: 1px solid #d8c096; border-radius: 999px; padding: 5px 12px; font-size: 12.5px; color: var(--text-dim); font-weight: 600; }
.muted { color: var(--text-faint); }
.muted a { color: var(--flame-2); font-weight: 700; text-decoration: underline; }
.small { font-size: 12.5px; }
.hidden { display: none !important; }

/* --------- barra superior --------- */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: calc(12px + var(--safe-top)) 16px 12px; background: linear-gradient(var(--bg) 60%, transparent); backdrop-filter: blur(6px); }
.topbar .back { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 18px; display: flex; align-items: center; justify-content: center; }
.topbar .title { font-weight: 700; font-size: 16px; flex: 1; }

/* --------- botones --------- */
.btn { appearance: none; border: none; cursor: pointer; border-radius: var(--radius-sm); padding: 14px 18px; font-size: 15.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .12s ease, filter .12s ease; }
.btn:active { transform: scale(.97); }
.btn-block { width: 100%; }
.btn-flame { background: linear-gradient(135deg, var(--flame), var(--ember)); color: #1a1006; box-shadow: 0 8px 22px rgba(255,140,26,.28); }
.btn-flame:active { filter: brightness(.95); }
.btn-outline { background: transparent; border: 1.5px solid var(--line); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-dim); padding: 10px 12px; }
.btn-sm { padding: 9px 14px; font-size: 13.5px; }
.btn-danger { background: rgba(217,74,43,.12); color: #b8341a; border: 1px solid rgba(217,74,43,.35); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 50%; background: var(--card-2); border: 1px solid var(--line); color: var(--text); font-size: 16px; }

/* --------- inputs --------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; color: var(--text-dim); font-weight: 600; }
.input, select.input, textarea.input {
  background: var(--card); border: 1.5px solid var(--line); color: var(--text);
  border-radius: var(--radius-sm); padding: 13px 14px; font-size: 15.5px; width: 100%; font-family: inherit;
}
.input:focus, select.input:focus, textarea.input:focus { outline: none; border-color: var(--flame); }
.input-code { text-transform: uppercase; letter-spacing: .3em; text-align: center; font-weight: 800; font-size: 22px; }

/* =========================================================
   INTRO / PARRILLA ANIMADA
   ========================================================= */
.intro { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; text-align: center; position: relative; overflow: hidden; }
.intro-brand { font-weight: 800; font-size: 15px; letter-spacing: .08em; color: var(--flame-2); text-transform: uppercase; margin-bottom: 6px; opacity: .9; }

/* --------- selector de idioma --------- */
.lang-switch { display: flex; gap: 8px; justify-content: center; margin-bottom: 6px; }
.lang-switch button { font-size: 20px; background: none; border: none; padding: 4px; border-radius: 8px; opacity: .45; cursor: pointer; line-height: 1; }
.lang-switch button.on { opacity: 1; background: var(--card-2); }

.grill-wrap { width: 240px; height: 210px; position: relative; margin: 10px auto 8px; }
.grill-smoke { position: absolute; left: 50%; bottom: 128px; width: 10px; height: 10px; border-radius: 50%; background: rgba(120,105,85,.45); filter: blur(3px); animation: smokeUp 2.6s ease-in infinite; }
.grill-smoke.s2 { left: 38%; animation-delay: .8s; }
.grill-smoke.s3 { left: 62%; animation-delay: 1.6s; }
@keyframes smokeUp {
  0% { transform: translate(-50%,0) scale(.6); opacity: 0; }
  15% { opacity: .7; }
  100% { transform: translate(-50%,-120px) scale(1.6); opacity: 0; }
}

.grill-grate { position: absolute; left: 50%; bottom: 78px; transform: translateX(-50%); width: 190px; height: 92px; }
.grill-grate .bar { position: absolute; top: 0; bottom: 0; width: 8px; background: #2a2a2a; border-radius: 4px; box-shadow: inset 0 0 0 1px #000; }
.grill-grate .bar:nth-child(1){ left: 6px; } .grill-grate .bar:nth-child(2){ left: 42px; }
.grill-grate .bar:nth-child(3){ left: 78px; } .grill-grate .bar:nth-child(4){ left: 114px; }
.grill-grate .bar:nth-child(5){ left: 150px; } .grill-grate .bar:nth-child(6){ left: 178px; }

.meat { position: absolute; bottom: 96px; width: 46px; height: 30px; border-radius: 40% 40% 46% 46% / 60% 60% 40% 40%; background: linear-gradient(180deg,#c66a3e,#8a3f22); box-shadow: inset 0 -6px 8px rgba(0,0,0,.35), 0 4px 10px rgba(0,0,0,.3); animation: sizzle 1.4s ease-in-out infinite; }
.meat::after { content:""; position:absolute; inset: 5px 8px; border-radius: 50%; background: repeating-linear-gradient(45deg, rgba(255,200,120,.25) 0 4px, transparent 4px 9px); }
.meat.m1 { left: 26px; animation-delay: 0s; }
.meat.m2 { left: 84px; animation-delay: .3s; width: 40px; }
.meat.m3 { left: 138px; animation-delay: .6s; }
@keyframes sizzle { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-3px) rotate(1deg); } }

.grill-spark { position: absolute; bottom: 92px; width: 4px; height: 4px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 6px var(--flame); animation: spark 1.8s ease-in infinite; }
.grill-spark.k1 { left: 40px; animation-delay: .2s; } .grill-spark.k2 { left: 110px; animation-delay: .9s; } .grill-spark.k3 { left: 160px; animation-delay: 1.4s; }
@keyframes spark { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-46px) translateX(6px); opacity: 0; } }

.grill-fire { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 210px; height: 84px; }
.flame-tongue { position: absolute; bottom: 0; width: 26px; height: 60px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: linear-gradient(0deg, var(--ember), var(--flame) 55%, var(--gold) 100%); filter: blur(.2px); animation: flameMove 1.1s ease-in-out infinite; transform-origin: bottom center; }
.flame-tongue.f1 { left: 8px; animation-delay: 0s; height: 50px; }
.flame-tongue.f2 { left: 40px; animation-delay: .15s; height: 68px; width: 30px; }
.flame-tongue.f3 { left: 76px; animation-delay: .3s; height: 58px; }
.flame-tongue.f4 { left: 112px; animation-delay: .45s; height: 70px; width: 30px; }
.flame-tongue.f5 { left: 148px; animation-delay: .1s; height: 54px; }
.flame-tongue.f6 { left: 180px; animation-delay: .25s; height: 46px; }
@keyframes flameMove { 0%,100% { transform: scaleY(1) scaleX(1) rotate(-2deg); } 50% { transform: scaleY(1.18) scaleX(.9) rotate(2deg); } }
.grill-base { position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); width: 230px; height: 26px; background: linear-gradient(180deg,#3a3a3a,#1c1c1c); border-radius: 40% 40% 60% 60% / 50% 50% 100% 100%; box-shadow: 0 12px 20px rgba(0,0,0,.5); }

.chef-face { font-size: 64px; line-height: 1; animation: bounce 1.8s ease-in-out infinite; filter: drop-shadow(0 6px 10px rgba(0,0,0,.4)); }
@keyframes bounce { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-6px) rotate(2deg); } }

.speech-bubble { background: var(--card); border: 1.5px solid var(--line); border-radius: 20px; padding: 14px 18px; margin: 14px auto 4px; max-width: 320px; font-weight: 700; font-size: 17px; position: relative; box-shadow: var(--shadow); }
.speech-bubble::after { content:""; position: absolute; left: 50%; top: -8px; transform: translateX(-50%) rotate(45deg); width: 14px; height: 14px; background: var(--card); border-left: 1.5px solid var(--line); border-top: 1.5px solid var(--line); }

.intro-dots { display: flex; gap: 6px; justify-content: center; margin-top: 22px; }
.intro-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--line); animation: dot 1.2s ease-in-out infinite; }
.intro-dots span:nth-child(2) { animation-delay: .2s; } .intro-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes dot { 0%,80%,100% { opacity: .3; transform: scale(.8);} 40% { opacity: 1; transform: scale(1.15);} }

.intro-skip { position: absolute; top: calc(16px + var(--safe-top)); right: 16px; }

/* --------- selector de tipo de evento --------- */
.event-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.event-card {
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 18px 12px; text-align: center; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
  animation: popIn .4s ease both;
}
.event-card:nth-child(1){animation-delay:.02s} .event-card:nth-child(2){animation-delay:.08s}
.event-card:nth-child(3){animation-delay:.14s} .event-card:nth-child(4){animation-delay:.2s}
.event-card:nth-child(5){animation-delay:.26s} .event-card:nth-child(6){animation-delay:.32s}
.event-card:nth-child(7){animation-delay:.38s}
@keyframes popIn { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: scale(1); } }
.event-card:active { transform: scale(.95); }
.event-card.selected { border-color: var(--flame); background: linear-gradient(160deg, rgba(255,140,26,.16), var(--card)); }
.event-card .emoji { font-size: 34px; }
.event-card .label { font-weight: 700; font-size: 14px; }

/* --------- lista de la compra --------- */
.list-section { margin-bottom: 6px; }
.list-section-head { display: flex; align-items: center; gap: 8px; padding: 10px 2px 6px; }
.list-section-head .section-icon { display: flex; color: var(--flame-2); }
.list-section-head .section-icon svg { width: 19px; height: 19px; }
.list-section-head .name { font-weight: 700; font-size: 14.5px; flex: 1; }
.list-section-head .count { font-size: 12px; color: var(--text-faint); }

.item-card { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 8px; }
.item-card.bought { opacity: .55; }
.item-check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; background: transparent; color: transparent; }
.item-check.on { background: var(--leaf); border-color: var(--leaf); color: #0c1f16; }
.item-thumb { width: 36px; height: 36px; border-radius: 10px; background: var(--card-2); border: 1px solid var(--line); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 17px; overflow: hidden; color: var(--flame-2); }
.item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.item-thumb svg { width: 19px; height: 19px; }
.item-body { flex: 1; min-width: 0; }
.item-name { font-weight: 700; font-size: 14.5px; }
.item-name.bought { text-decoration: line-through; }
.item-meta { font-size: 12.5px; color: var(--text-faint); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; }
.item-qty { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.qty-btn { width: 28px; height: 28px; border-radius: 8px; border: 1px solid #d8c096; background: var(--card-2); color: var(--text); font-size: 15px; font-weight: 700; }
.qty-val { min-width: 22px; text-align: center; font-weight: 700; font-size: 14.5px; }
.item-price { font-size: 13px; color: var(--gold); font-weight: 700; }
.avatar-mini { width: 22px; height: 22px; border-radius: 50%; background: var(--card-2); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; border: 1px solid var(--line); overflow: hidden; }
.avatar-mini img { width: 100%; height: 100%; object-fit: cover; }

.add-item-bar { display: flex; gap: 8px; margin-top: 14px; }
.add-item-bar .input { flex: 1; min-width: 0; }
.add-item-bar .btn-icon, .add-item-bar .btn { flex-shrink: 0; }

.fab { position: fixed; right: 18px; bottom: calc(18px + var(--safe-bottom)); width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, var(--flame), var(--ember)); color: #1a1006; font-size: 26px; box-shadow: 0 10px 26px rgba(255,140,26,.4); border: none; z-index: 6; }

/* --------- participantes / avatares --------- */
.avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--card-2); border: 1.5px solid var(--line); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; overflow: hidden; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 84px; height: 84px; font-size: 26px; }
.member-row { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 12px; margin-bottom: 8px; }
.member-row .name { font-weight: 700; font-size: 14.5px; }
.member-row .tag { font-size: 12px; color: var(--text-faint); }
.avatar-edit { position: relative; display: inline-block; }
.avatar-edit .pencil { position: absolute; bottom: -2px; right: -2px; width: 26px; height: 26px; border-radius: 50%; background: var(--flame); color: #1a1006; display: flex; align-items: center; justify-content: center; font-size: 12px; border: 2px solid var(--bg); }

/* --------- invitar / compartir --------- */
.code-box { background: var(--card); border: 1.5px dashed var(--flame); border-radius: var(--radius); padding: 20px; text-align: center; margin: 14px 0 18px; }
.code-box .code { font-size: 32px; font-weight: 800; letter-spacing: .28em; color: var(--flame-2); }
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* --------- tarjetas de gasto / liquidación --------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.expense-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.expense-row:last-child { border-bottom: none; }
.expense-amount { font-weight: 800; font-size: 15.5px; }
.total-banner { background: linear-gradient(135deg, rgba(255,140,26,.18), rgba(230,76,60,.1)); border: 1px solid rgba(255,140,26,.35); border-radius: var(--radius); padding: 18px; text-align: center; margin-bottom: 16px; }
.total-banner .amount { font-size: 34px; font-weight: 800; color: var(--flame-2); }
.split-choice { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); font-size: 13.5px; font-weight: 700; color: var(--text-dim); }
.chip.on { border-color: var(--flame); color: var(--flame-2); background: rgba(255,140,26,.12); }
.settle-line { display: flex; align-items: center; flex-wrap: wrap; row-gap: 8px; gap: 10px; background: var(--card); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 8px; border: 1px solid var(--line); }
.settle-arrow { color: var(--flame); font-weight: 800; }

/* --------- historial --------- */
.history-row { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 10px; }
.history-row .emoji { font-size: 26px; }
.history-row .info { flex: 1; }
.history-row .name { font-weight: 700; font-size: 15px; }
.history-row .date { font-size: 12.5px; color: var(--text-faint); }
.badge-closed { font-size: 11px; padding: 3px 9px; border-radius: 999px; background: rgba(63,178,127,.15); color: var(--leaf); font-weight: 700; }

/* --------- bottom nav --------- */
.tabbar { position: sticky; bottom: 0; display: flex; background: var(--bg-soft); border-top: 1px solid var(--line); padding: 8px 6px calc(8px + var(--safe-bottom)); z-index: 5; }
.tab { flex: 1; background: none; border: none; color: var(--text-faint); display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; padding: 6px 2px; border-radius: 10px; }
.tab .ic { font-size: 19px; position: relative; display: inline-block; }
.tab.active { color: var(--flame-2); }
.tab-badge { position: absolute; top: -6px; right: -10px; background: var(--ember); color: #fff; font-size: 9.5px; font-weight: 800; border-radius: 999px; min-width: 15px; height: 15px; display: flex; align-items: center; justify-content: center; padding: 0 3px; line-height: 1; }

/* --------- chat de grupo --------- */
.chat-participants { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 10px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.chat-participant { display: flex; flex-direction: column; align-items: center; gap: 3px; flex-shrink: 0; }
.chat-participant-name { font-size: 10.5px; color: var(--text-faint); max-width: 46px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-wrap { display: flex; flex-direction: column; height: calc(100vh - 250px); min-height: 320px; }
.chat-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 10px; }
.chat-msg { max-width: 78%; align-self: flex-start; display: flex; flex-direction: column; }
.chat-msg.mine { align-self: flex-end; align-items: flex-end; }
.chat-sender { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--flame-2); margin-bottom: 3px; padding-left: 4px; }
.chat-bubble { background: var(--card); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 9px 13px; font-size: 14px; line-height: 1.4; word-break: break-word; }
.chat-msg.mine .chat-bubble { background: var(--flame); color: #fff; border-color: var(--flame); border-radius: 14px 14px 4px 14px; }
.chat-msg.bot .chat-sender { color: #a5601f; }
.chat-msg.bot .chat-bubble { background: #fdf1de; border-color: #ecd3a3; }
.chat-time { font-size: 10px; color: var(--text-faint); margin-top: 2px; padding: 0 4px; }
.chat-input-row { display: flex; gap: 8px; align-items: center; padding-top: 10px; border-top: 1px solid var(--line); }
.chat-input-row .input { flex: 1; }
.btn-flame-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--flame); color: #fff; border: none; font-size: 18px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; padding: 0; }

/* --------- escáner de código de barras --------- */
.scan-frame { position: relative; width: 100%; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; margin-bottom: 12px; }
.scan-frame video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-guide { position: absolute; inset: 20% 8%; border: 3px solid var(--flame); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0,0,0,.4); pointer-events: none; }

/* --------- modal --------- */
.overlay { position: fixed; inset: 0; background: rgba(10,7,4,.6); backdrop-filter: blur(2px); z-index: 20; display: flex; align-items: flex-end; justify-content: center; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.sheet { background: var(--bg-soft); border-radius: 22px 22px 0 0; padding: 20px 18px calc(20px + var(--safe-bottom)); width: 100%; max-width: 560px; max-height: 86vh; overflow-y: auto; animation: sheetUp .25s cubic-bezier(.2,.9,.3,1); border-top: 1px solid var(--line); }
@keyframes sheetUp { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.sheet-topbar { position: relative; display: flex; align-items: center; justify-content: center; height: 38px; margin-bottom: 6px; }
.sheet-topbar .back { position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 16px; display: flex; align-items: center; justify-content: center; }
.sheet-handle { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 0; }

/* --------- toast --------- */
.toast { position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); background: #2b1d10; border: 1px solid #3a2a18; color: #f5ede1; padding: 12px 18px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 50; box-shadow: var(--shadow); max-width: 90vw; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* --------- switch --------- */
.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; }
.switch .track { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: background .15s; }
.switch .thumb { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--text); transition: transform .15s; }
.switch input:checked + .track { background: var(--flame); }
.switch input:checked ~ .thumb { transform: translateX(20px); background: #1a1006; }

@media (min-width: 640px) {
  .screen { padding-top: 28px; }
}
