/* Ciclo: maqueta visual movil. Negro con violeta como acento principal y rosa para el sangrado. */

:root {
  --bg: #0B0A10;
  --surface: #14121C;
  --surface2: #1D1A28;
  --ink: #F1ECF8;
  --ink2: #A59DB8;
  --line: #2A2538;
  --accent: #A58BFA;
  --on-accent: #140C28;
  --accent-soft: #2A2148;
  --rose: #F27BAA;
  --rose-soft: #3A1F33;
  --grad: linear-gradient(135deg, #A58BFA 0%, #F27BAA 100%);
  --glow: rgba(157, 124, 245, .16);
  --warn: #E3A857;
  --warn-soft: #33260F;
  --ok: #7CC4A0;
  --ok-soft: #1B2F26;
  --l1: #6B3A5C; --l1t: #F6E9F1;
  --l2: #A5497A; --l2t: #FFF1F7;
  --l3: #E0679A; --l3t: #260A18;
  --l4: #FF8FBA; --l4t: #260A18;
  --backdrop: rgba(0, 0, 0, .65);
  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #F7F4FC;
  --surface: #FFFFFF;
  --surface2: #EFEAF8;
  --ink: #1B1428;
  --ink2: #62587A;
  --line: #E2DAF0;
  --accent: #6D45D6;
  --on-accent: #FFFFFF;
  --accent-soft: #E9E1FB;
  --rose: #CC4F85;
  --rose-soft: #FBE3EE;
  --grad: linear-gradient(135deg, #6D45D6 0%, #CC4F85 100%);
  --glow: rgba(109, 69, 214, .08);
  --warn: #8F5710;
  --warn-soft: #F9ECD6;
  --ok: #3F7D5F;
  --ok-soft: #DDEFE6;
  --l1: #F6C6DA; --l1t: #4A2434;
  --l2: #EC8FB4; --l2t: #3A1626;
  --l3: #CC4F85; --l3t: #FFFFFF;
  --l4: #9C2F5B; --l4t: #FFFFFF;
  --backdrop: rgba(30, 15, 40, .45);
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  background-color: var(--bg);
  background-image: radial-gradient(120% 55% at 50% -8%, var(--glow), transparent 62%);
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
svg { display: block; }

/* ---------- Estructura ---------- */
.app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  padding-block: 8px 130px;
}
.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 0 18px; }
.eyebrow { font-size: 12px; letter-spacing: .09em; text-transform: uppercase; color: var(--ink2); font-weight: 500; }
h1 { font-family: var(--serif); font-weight: 400; font-size: 38px; line-height: 1.05; margin-top: 4px; text-wrap: balance; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.icon-btn svg { width: 22px; height: 22px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 20px; }
.q { font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--ink2); margin: 22px 0 10px; }
.q:first-child { margin-top: 0; }
.hint { font-size: 13px; color: var(--ink2); }
[hidden] { display: none !important; }
.chip-btn { height: 40px; padding: 0 16px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 14px; flex: none; }
.list .row input[type="date"] { flex: 1; min-width: 0; }
.chip-back {
  align-self: flex-start; display: inline-flex; gap: 6px; align-items: center; height: 36px; padding: 0 14px;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 14px; margin-bottom: 14px;
}

/* ---------- Avisos de implante ---------- */
.banner {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 14px 16px; border-radius: 20px; margin-bottom: 14px;
  background: var(--warn-soft); color: var(--warn);
}
.banner .b-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); flex: none; }
.banner .b-ic svg { width: 22px; height: 22px; }
.banner span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.banner b { font-weight: 600; font-size: 15px; }
.banner small { font-size: 13px; opacity: .9; }
.banner > svg { width: 18px; height: 18px; flex: none; }
.allgood {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 14px 16px; border-radius: 20px; margin-bottom: 14px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
}
.allgood:active { border-color: var(--ok); }
.allgood .ag-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); flex: none; }
.allgood .ag-ic svg { width: 22px; height: 22px; }
.allgood span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.allgood b { font-weight: 600; font-size: 15px; }
.allgood small { font-size: 13px; color: var(--ink2); }

/* ---------- Formulario Hoy ---------- */
/* Cada pregunta en su bloque; a la derecha del titulo, lo elegido */
#form { display: grid; gap: 10px; }
.blk { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 14px; display: grid; gap: 12px; }
.blk-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 20px; }
.blk-h .q { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; letter-spacing: 0; }
.blk-h .q svg { width: 16px; height: 16px; color: var(--ink2); opacity: .7; }
.blk-h em { font-style: normal; font-size: 13px; font-weight: 600; color: var(--rose); text-align: right; }
.blk-h em.v { color: var(--accent); }
.blk-h small { font-size: 12px; color: var(--ink2); opacity: .8; }

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: -4px 0 12px; }
.week button { display: grid; justify-items: center; gap: 6px; padding: 8px 0 9px; border-radius: 14px; border: 1px solid transparent; font-size: 11px; color: var(--ink2); min-width: 0; }
.week button b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.week button i { width: 6px; height: 6px; border-radius: 50%; }
.week button i.ok { background: var(--accent); }
.week button i.bl { background: var(--rose); }
.week button.sel { background: var(--surface); border-color: var(--line); color: var(--ink); }
.week button.sel i:not(.ok):not(.bl) { box-shadow: 0 0 0 1.5px var(--accent) inset; }
.week button[disabled] { opacity: .35; cursor: default; }

.flow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.flow button {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 74px; padding: 0 1px 10px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--bg); color: var(--ink2);
  font-size: clamp(9px, 2.7vw, 11px); letter-spacing: -.02em; min-width: 0;
}
.flow button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow button.on { border-color: var(--rose); background: var(--rose-soft); color: var(--ink); font-weight: 600; box-shadow: 0 0 18px color-mix(in srgb, var(--rose) 18%, transparent); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--surface2); border-radius: 16px; }
.seg button { height: 40px; border-radius: 12px; font-size: 14px; color: var(--ink2); min-width: 0; }
.seg button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button {
  height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 14px; color: var(--ink2);
}
.chips button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); font-weight: 600; }
.blk .chips { gap: 7px; }
.blk .chips button { height: 36px; padding: 0 14px; font-size: 13.5px; background: var(--bg); display: inline-flex; align-items: center; gap: 7px; }
.blk .chips button i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.blk .chips:not(.rose) button { padding-left: 12px; }
.seg.pain { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; }
.seg.pain button { height: auto; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 9px 0 8px; border-radius: 10px; font-size: 12.5px; }
.seg.pain button.on { background: var(--accent-soft); box-shadow: none; }
.seg.pain .lvl { display: flex; flex-direction: row; align-items: center; gap: 3px; height: 6px; }
.seg.pain .lvl i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink2); opacity: .5; }
.seg.pain .lvl.none i { width: 12px; height: 2px; border-radius: 1px; }
.seg.pain button.on .lvl i { background: var(--accent); opacity: 1; }
.blk textarea { background: var(--surface2); }
textarea, input[type="date"], input[type="time"], input[type="email"], input[type="text"], select {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface2); border: 1px solid transparent;
  border-radius: 14px; padding: 12px 14px; resize: none;
}
input[type="time"] { width: auto; }
.savebar {
  position: sticky; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); padding-top: 18px; margin-top: 8px;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}
.btn {
  width: 100%; height: 54px; border-radius: 18px; background: var(--grad); color: var(--on-accent);
  font-weight: 600; font-size: 16px; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn[disabled] { background: var(--surface2); color: var(--ink2); cursor: default; }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--warn); border: 1px solid var(--line); }
.btn svg { width: 20px; height: 20px; }
.saved-note { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; color: var(--ok); margin-bottom: 8px; font-weight: 500; }
.saved-note svg { width: 16px; height: 16px; }

.chips.rose button.on { background: var(--rose-soft); border-color: var(--rose); }
.q .opt { font-weight: 400; }
#form .hues { display: flex; align-items: center; gap: 10px; }
#form .hues small { font-size: 12px; color: var(--ink2); margin-right: 2px; }
#form .hues button { display: block; padding: 0; border: 0; background: none; border-radius: 50%; }
#form .hues button.on { background: none; }
#form .hues i { border: 2px solid var(--surface); }
#form .hues button.on i { box-shadow: 0 0 0 2px var(--rose); }
.hues { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.hues button {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0 10px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink2); font-size: 11.5px; min-width: 0;
}
.hues button.on { border-color: var(--rose); background: var(--rose-soft); color: var(--ink); font-weight: 600; }
.hues i { width: 26px; height: 26px; border-radius: 50%; display: block; box-shadow: 0 0 0 1.5px var(--line); }
.hdot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.day.hued::after { content: ''; position: absolute; bottom: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--hue); box-shadow: 0 0 0 1.5px var(--surface); }

/* ---------- Calendario ---------- */
.monthbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.monthbar h2 { font-family: var(--serif); font-weight: 400; font-size: 28px; }
.monthbar .icon-btn[disabled] { opacity: .35; cursor: default; }
.weekdays, .grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.weekdays span { text-align: center; font-size: 12px; color: var(--ink2); padding-bottom: 8px; font-weight: 500; }
.grid { row-gap: 6px; }
.day {
  position: relative; width: 100%; max-width: 44px; aspect-ratio: 1; margin: 0 auto; border-radius: 50%;
  display: grid; place-items: center; font-size: 15px; font-variant-numeric: tabular-nums;
}
.day.logged::after { content: ''; position: absolute; bottom: 6px; width: 4px; height: 4px; border-radius: 50%; background: var(--ink2); opacity: .5; }
.day.l1 { background: var(--l1); color: var(--l1t); }
.day.l2 { background: var(--l2); color: var(--l2t); }
.day.l3 { background: var(--l3); color: var(--l3t); }
.day.l4 { background: var(--l4); color: var(--l4t); }
.day.today { box-shadow: inset 0 0 0 2px var(--accent); font-weight: 700; }
.day.sel { outline: 2px solid var(--ink); outline-offset: 2px; }
.day[disabled] { color: var(--ink2); opacity: .4; cursor: default; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 18px; font-size: 12px; color: var(--ink2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.legend .dot { width: 5px; height: 5px; background: var(--ink2); opacity: .5; margin: 0 3.5px; }

/* ---------- Implante ---------- */
.preview-toggle { border: 1px dashed var(--line); border-radius: 18px; padding: 12px; margin-bottom: 14px; }
.preview-toggle p { font-size: 12px; color: var(--ink2); margin-bottom: 8px; }
.ring-card { text-align: center; padding: 26px 20px 22px; }
.ring { position: relative; width: 210px; height: 210px; margin: 0 auto 14px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .num { font-family: var(--serif); font-size: 64px; line-height: 1; font-variant-numeric: tabular-nums; }
.ring .lbl { font-size: 13px; color: var(--ink2); margin-top: 4px; }
.status { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.status.warn { background: var(--warn-soft); color: var(--warn); }
.status.ok { background: var(--ok-soft); color: var(--ok); }
.ring-card .when { margin-top: 12px; color: var(--ink2); font-size: 14px; }
.note-box { margin-top: 16px; padding: 14px 16px; border-radius: 16px; background: var(--warn-soft); color: var(--warn); font-size: 14px; text-align: left; }
.list { display: flex; flex-direction: column; }
.list .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.list .row:last-child { border-bottom: 0; padding-bottom: 0; }
.list .row:first-child { padding-top: 0; }
.row .t { display: flex; flex-direction: column; min-width: 0; }
.row .t b { font-weight: 600; font-size: 15px; }
.row .t small { color: var(--ink2); font-size: 13px; }
.row .v { color: var(--ink2); font-size: 14px; text-align: right; }
.h2 { font-family: var(--serif); font-weight: 400; font-size: 26px; margin: 8px 0 -2px; }
.ticks { display: flex; flex-wrap: wrap; gap: 8px; }
.ticks span { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--surface2); font-size: 13px; color: var(--ink2); }
.ticks svg { width: 14px; height: 14px; color: var(--ok); }

/* ---------- Resumen ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 14px 12px; min-width: 0; }
.stat b { display: block; font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }
.stat small { display: block; margin-top: 6px; font-size: 12px; color: var(--ink2); line-height: 1.3; }
.heat { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; margin-top: 14px; }
.heat i { aspect-ratio: 1; border-radius: 5px; background: var(--surface2); display: block; }
.heat i.none { background: transparent; border: 1px dashed var(--line); }
.heat i.empty { background: transparent; }
.heat i.l1 { background: var(--l1); } .heat i.l2 { background: var(--l2); }
.heat i.l3 { background: var(--l3); } .heat i.l4 { background: var(--l4); }
.heat-cap { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink2); margin-top: 10px; }
.bar { display: grid; grid-template-columns: 110px 1fr 28px; align-items: center; gap: 10px; font-size: 14px; padding: 6px 0; }
.bar .track { height: 8px; border-radius: 4px; background: var(--surface2); overflow: hidden; }
.bar .track i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.bar em { font-style: normal; color: var(--ink2); text-align: right; font-variant-numeric: tabular-nums; }
.meter { height: 8px; border-radius: 4px; background: var(--surface2); overflow: hidden; margin: 10px 0 6px; }
.meter i { display: block; height: 100%; background: var(--ok); border-radius: 4px; }

/* ---------- Barra inferior ---------- */
.tabbar {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%, 430px); z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 8px max(10px, env(safe-area-inset-left, 0px)) calc(8px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; font-size: 11.5px; color: var(--ink2); border-radius: 14px; }
.tabbar svg { width: 25px; height: 25px; }
.tabbar button.on { color: var(--accent); font-weight: 600; }

/* ---------- Capas: ajustes y hoja ---------- */
.layer {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%); width: min(100%, 430px); height: 100%;
  background: var(--bg); z-index: 40; overflow-y: auto;
  padding: 8px max(20px, env(safe-area-inset-left, 0px)) 48px;
}
.layer[hidden] { display: none; }
.layer .back { display: flex; align-items: center; gap: 8px; height: 44px; font-weight: 600; margin-top: 8px; }
.layer .back svg { width: 20px; height: 20px; }
.sect { margin-top: 24px; }
.sect > h3 { font-size: 12px; letter-spacing: .09em; text-transform: uppercase; color: var(--ink2); font-weight: 600; margin: 0 0 10px 4px; }
.sw { width: 52px; height: 32px; border-radius: 999px; background: var(--surface2); border: 1px solid var(--line); position: relative; flex: none; transition: background .2s; }
.sw i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--ink2); transition: transform .2s, background .2s; }
.sw[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.sw[aria-checked="true"] i { transform: translateX(20px); background: var(--on-accent); }
.lock { border-radius: 26px; padding: 16px; background: linear-gradient(165deg, #3a2a4a, #1d2742); display: flex; flex-direction: column; gap: 8px; }
.lock .clock { text-align: center; color: #fff; font-size: 13px; opacity: .8; padding: 2px 0 6px; }
.notif { display: flex; gap: 10px; padding: 12px; border-radius: 18px; background: rgba(255, 255, 255, .16); color: #fff; }
.notif .ico { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, #7C5CE0, #E0679A); display: grid; place-items: center; flex: none; }
.notif .ico svg { width: 20px; height: 20px; }
.notif div { min-width: 0; }
.notif b { font-size: 14px; font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.notif b em { font-style: normal; font-weight: 400; opacity: .7; font-size: 12px; }
.notif p { font-size: 14px; opacity: .92; line-height: 1.35; }

.backdrop { position: fixed; inset: 0; background: var(--backdrop); z-index: 50; opacity: 0; pointer-events: none; transition: opacity .2s; }
.backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translate(-50%, 100%); width: min(100%, 430px); z-index: 60;
  background: var(--surface); border-radius: 28px 28px 0 0; transition: transform .25s;
  padding: 10px max(20px, env(safe-area-inset-left, 0px)) calc(22px + env(safe-area-inset-bottom, 0px));
  max-height: 92%; overflow-y: auto;
}
.sheet.open { transform: translate(-50%, 0); }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
.sheet h2 { font-family: var(--serif); font-weight: 400; font-size: 30px; margin-bottom: 4px; }
.sheet .field { margin-top: 18px; }
.sheet .field > label { display: block; font-size: 13px; font-weight: 600; color: var(--ink2); margin-bottom: 8px; }
.sheet .result { margin-top: 18px; padding: 14px 16px; border-radius: 16px; background: var(--accent-soft); font-size: 15px; }
.sheet .btn { margin-top: 20px; }

.toast {
  position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 12px);
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-size: 14px; z-index: 80;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 40px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 520px) {
  body { background: var(--surface2); }
  .app { background: var(--bg); box-shadow: 0 0 0 1px var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
@media (max-width: 360px) {
  h1 { font-size: 34px; }
  .bar { grid-template-columns: 92px 1fr 24px; }
}

/* ---------- Acceso (propuesta A: Orbita) ---------- */
.app.is-login { padding-bottom: max(24px, env(safe-area-inset-bottom, 0px)); }
.lg { min-height: calc(100svh - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; }
.lg-orbit { position: relative; height: 330px; display: grid; place-items: center; margin: 4px -20px 0; flex: none; }
.lg-orbit.sm { height: 270px; }
.lg-orbit::before { content: ""; position: absolute; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle, rgba(165,139,250,.20) 0%, rgba(242,123,170,.07) 45%, transparent 70%); }
.lg-rings { position: absolute; inset: 0; margin: auto; width: 340px; max-width: 100%; height: 100%; }
.lg-spin, .lg-spin2 { transform-origin: 170px 165px; }
.lg-spin { animation: lg-rot 24s linear infinite; }
.lg-spin2 { animation: lg-rot 40s linear infinite reverse; }
@keyframes lg-rot { to { transform: rotate(360deg); } }
.lg-badge { position: relative; width: 84px; height: 84px; border-radius: 28px; background: color-mix(in srgb, var(--surface) 85%, transparent); border: 1px solid var(--line); display: grid; place-items: center; }
.lg-copy { text-align: center; display: grid; gap: 8px; margin-top: -8px; }
.lg-copy .eyebrow { letter-spacing: .22em; }
.lg-copy h1 { font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: 1.02; text-wrap: balance; }
.lg-copy h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lg-copy p:last-child { margin: 0 auto; color: var(--ink2); font-size: 15px; max-width: 30ch; }
.lg-copy b { color: var(--ink); font-weight: 600; word-break: break-all; }
.lg-form { margin-top: auto; padding-top: 28px; display: grid; gap: 14px; }
.lg-input { height: 56px; border-radius: 18px; background: var(--surface2); border: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 16px; color: var(--ink2); transition: border-color .15s, box-shadow .15s; }
.lg-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.lg-input input[type="email"] { flex: 1; min-width: 0; background: none; border: 0; padding: 0; height: 100%; font-size: 16px; outline: none; }
.lg-otp { position: relative; display: block; }
.lg-boxes { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.lg-boxes span { height: 58px; border-radius: 16px; background: var(--surface2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 24px; font-weight: 500; font-variant-numeric: tabular-nums; }
.lg-otp:focus-within .lg-boxes span.on { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.lg-otp:focus-within .lg-boxes span.on::after { content: ""; width: 2px; height: 24px; background: var(--accent); animation: lg-blink 1s steps(1) infinite; }
@keyframes lg-blink { 50% { opacity: 0; } }
.lg-otp input[type="text"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 16px; caret-color: transparent; }
.lg .btn { height: 56px; box-shadow: 0 10px 30px color-mix(in srgb, var(--rose) 22%, transparent); }
.lg .btn[disabled] { box-shadow: none; }
.lg-err { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--warn-soft); color: var(--warn); font-size: 14px; }
.lg-privacy { margin: 0; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--ink2); font-size: 12.5px; opacity: .8; }
.lg-links { display: flex; justify-content: space-between; gap: 8px; }
.lg-link { padding: 10px 4px; color: var(--ink2); font-size: 14px; font-weight: 500; }
.lg-link b { color: var(--accent); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .lg-spin, .lg-spin2, .lg-otp .lg-boxes span.on::after { animation: none; } }
