body {
  background:
    radial-gradient(100% 50% at 50% 0%, rgba(255, 122, 61, 0.14), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}

.shell {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 16px) 20px calc(var(--safe-bottom) + 40px);
}

/* ---------- Pantalla de PIN ---------- */

.lock {
  min-height: calc(100svh - var(--safe-top) - var(--safe-bottom) - 56px);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 22px;
  text-align: center;
}

.lock-back { position: absolute; top: calc(var(--safe-top) + 16px); left: 16px; }

.radar {
  position: relative;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background:
    radial-gradient(circle, transparent 0 30%, rgba(255, 220, 190, 0.08) 31% 32%, transparent 33% 62%, rgba(255, 220, 190, 0.08) 63% 64%, transparent 65%),
    radial-gradient(circle, rgba(255, 122, 61, 0.18), transparent 70%);
  overflow: hidden;
}

.radar::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 75%, rgba(255, 181, 71, 0.55) 100%);
  animation: spin 2.6s linear infinite;
}

.radar i {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 40px;
  color: var(--amber);
  filter: drop-shadow(0 0 12px rgba(255, 181, 71, 0.6));
}

.lock h1 {
  font-family: var(--font-display);
  font-size: clamp(26px, 8vw, 36px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.lock p { color: var(--text-2); }

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 14px;
  min-height: 18px;
}

.pin-dots span {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--brand-gradient);
  box-shadow: 0 0 14px rgba(255, 122, 61, 0.7);
  animation: pop 300ms var(--ease-spring);
}

.pin-dots .placeholder {
  background: transparent;
  border: 2px solid var(--border-strong);
  box-shadow: none;
  animation: none;
}

.pin-dots.is-error { animation: shake 450ms ease; }
.pin-dots.is-error span { background: var(--st-undefined); box-shadow: 0 0 14px var(--st-undefined); }

.pin-error { min-height: 22px; color: var(--danger); font-weight: 700; font-size: 14px; }

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 76px);
  gap: 14px 22px;
  justify-content: center;
}

.key {
  width: 76px;
  height: 76px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 236, 220, 0.09), rgba(255, 236, 220, 0.03));
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  transition: transform 120ms var(--ease-out), background-color 150ms;
}

.key:active { transform: scale(0.92); background: rgba(255, 122, 61, 0.25); }
.key-fn { border-color: transparent; background: transparent; font-size: 22px; color: var(--text-2); }
.key-go { background: var(--brand-gradient); color: var(--on-brand); border: 0; font-size: 26px; }

/* ---------- Panel ---------- */

.top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-title { flex: 1; min-width: 0; }
.top-title small { display: block; color: var(--amber); font-size: 11px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
.top-title h1 { font-family: var(--font-display); font-size: 22px; font-weight: 900; letter-spacing: -0.02em; line-height: 1.15; }

.hud {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 20px;
}

.hud-cell {
  padding: 14px 10px;
  border-radius: 18px;
  text-align: center;
}

.hud-cell strong {
  display: block;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hud-cell span { color: var(--muted); font-size: 12px; font-weight: 700; }

.tabs {
  position: sticky;
  top: calc(var(--safe-top) + 8px);
  z-index: 20;
  margin-top: 20px;
  background: rgba(13, 8, 6, 0.85);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.panel { margin-top: 20px; animation: rise 400ms var(--ease-out); }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h2 {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.bar {
  height: 8px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: rgba(255, 220, 190, 0.1);
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand-gradient);
  transform-origin: left;
  transform: scaleX(var(--pct, 0));
  transition: transform 800ms var(--ease-out);
}

.add-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.add-row .input { flex: 1; min-width: 0; }
.add-row .btn { flex: none; width: 50px; min-height: 50px; padding: 0; font-size: 20px; }

.list { display: grid; gap: 8px; }

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 12px;
  border-radius: 18px;
}

.row-main {
  flex: 1;
  min-width: 0;
  padding: 4px 0;
  border: 0;
  background: none;
  text-align: left;
}

.row-title { display: block; font-weight: 700; overflow-wrap: anywhere; }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; color: var(--muted); font-size: 13px; }

.check {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  margin: -4px;
  border: 0;
  background: none;
}

.check span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  color: transparent;
  font-size: 16px;
  transition: background-color 200ms, border-color 200ms;
}

.row.is-done .check span {
  border-color: var(--st-confirmed);
  background: var(--st-confirmed);
  color: var(--on-brand);
  animation: pop 400ms var(--ease-spring);
}

.row.is-done .row-title { color: var(--muted); text-decoration: line-through; }

.owner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
}

.owner .avatar { --size: 32px; }

.owner-empty {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2px dashed var(--border-strong);
  border-radius: 50%;
  color: var(--muted);
  font-size: 14px;
}

.stop-row-time {
  flex: none;
  width: 64px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.chevron { color: var(--muted); }

.admin-poll { padding: 16px; }
.admin-poll h3 { margin-top: 10px; font-size: 17px; font-weight: 800; line-height: 1.3; }

.result { margin-top: 10px; }
.result-row { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 600; }
.result-row span:last-child { flex: none; color: var(--text-2); }
.result .bar { height: 6px; margin: 6px 0 0; }

.admin-poll-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.option-inputs { display: grid; gap: 8px; }
.option-input-row { display: flex; gap: 8px; }
.option-input-row .input { flex: 1; min-width: 0; }

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.toggle-row strong { display: block; font-size: 15px; }
.toggle-row small { color: var(--muted); }

.owner-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.owner-choice {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 0;
  padding: 10px 2px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
}

.owner-choice .avatar,
.owner-choice .owner-empty { --size: 36px; width: 36px; height: 36px; }
.owner-choice[aria-pressed="true"] { border-color: var(--amber); background: rgba(255, 181, 71, 0.12); }

.members-list { display: grid; gap: 10px; }
.member-row { display: flex; align-items: center; gap: 12px; }
.member-row .field { flex: 1; min-width: 0; }

.settings-group { display: grid; gap: 14px; padding: 18px; }
.settings-group + .settings-group { margin-top: 14px; }
.settings-group h3 { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
