/* ── LOCK ──────────────────────────────────────────────────── */
#lock-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 32px;
}
.lock-logo {
  width: 72px; height: 72px; border-radius: 20px;
  background: var(--accent-l);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 24px;
}
.lock-logo svg { width: 34px; height: 34px; stroke: var(--accent); fill: none; stroke-width: 1.8; }
.lock-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 6px; }
.lock-sub   { font-size: .85rem; color: var(--text3); margin-bottom: 28px; }
.lock-field { width: 100%; max-width: 280px; margin-bottom: 10px; }
.lock-field input {
  width: 100%; padding: 14px; text-align: center;
  font-size: 1.1rem; letter-spacing: .2em;
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: var(--r-sm); color: var(--text);
  font-family: inherit; outline: none; transition: border-color .2s;
}
.lock-field input:focus { border-color: var(--accent); }
.lock-btn {
  width: 100%; max-width: 280px; padding: 13px;
  background: var(--accent); color: #fff; border: none;
  border-radius: var(--r-sm); font-size: .9rem; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: opacity .2s;
}
.lock-btn:active { opacity: .8; }
.lock-error {
  color: var(--danger); font-size: .8rem; margin-top: 12px;
  opacity: 0; transition: opacity .3s; height: 20px;
}
.lock-error.show { opacity: 1; }

/* ── APP SHELL ─────────────────────────────────────────────── */
#app { display: none; flex-direction: column; min-height: 100dvh; }
#app.visible { display: flex; }

/* ── TOP BAR ───────────────────────────────────────────────── */
.top-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--nav-h);
  background: rgba(245,245,247,.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
}
[data-theme="dark"] .top-bar { background: rgba(0,0,0,.88); }

.top-bar-left { display: flex; align-items: center; gap: 8px; }

.back-btn {
  display: none; align-items: center; gap: 3px;
  color: var(--accent); font-size: .9rem; font-weight: 500;
  background: none; border: none; cursor: pointer; font-family: inherit;
  padding: 6px 0;
}
.back-btn svg { width: 18px; height: 18px; stroke: var(--accent); fill: none; stroke-width: 2.5; }
.back-btn.visible { display: flex; }

.page-title { font-size: 1rem; font-weight: 700; }

.trim-pill {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 20px;
  background: var(--accent-l); color: var(--accent);
  font-size: .78rem; font-weight: 600; cursor: pointer;
  border: none; font-family: inherit; transition: opacity .2s;
}
.trim-pill svg { width: 13px; height: 13px; stroke: var(--accent); fill: none; stroke-width: 2; }
.trim-pill:active { opacity: .7; }

/* ── MAIN ──────────────────────────────────────────────────── */
.main {
  margin-top: var(--nav-h);
  margin-bottom: var(--bot-h);
  flex: 1;
}

.page {
  display: none;
  padding: 16px;
  min-height: calc(100dvh - var(--nav-h) - var(--bot-h));
  /* centrado en desktop */
  max-width: var(--max-w);
  margin-left: auto; margin-right: auto;
  width: 100%;
}
.page.active { display: block; }

/* ── BOTTOM NAV ────────────────────────────────────────────── */
.bot-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  height: var(--bot-h);
  background: rgba(245,245,247,.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-around;
  padding: 10px 0 env(safe-area-inset-bottom);
}
[data-theme="dark"] .bot-nav { background: rgba(0,0,0,.92); }

.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 0 10px; cursor: pointer;
  background: none; border: none; color: var(--text3);
  font-family: inherit; transition: color .2s; flex: 1;
}
.nav-item svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.nav-item span { font-size: .58rem; font-weight: 500; }
.nav-item.active { color: var(--accent); }

/* ── FAB ───────────────────────────────────────────────────── */
.fab {
  position: fixed; bottom: calc(var(--bot-h) + 14px); right: 20px;
  width: 50px; height: 50px; border-radius: 50%;
  background: var(--accent); color: #fff; border: none;
  cursor: pointer; z-index: 100;
  box-shadow: 0 4px 18px rgba(79,70,229,.38);
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s, box-shadow .15s;
}
.fab svg { width: 22px; height: 22px; stroke: #fff; fill: none; stroke-width: 2.5; }
.fab:active { transform: scale(.92); box-shadow: 0 2px 8px rgba(79,70,229,.25); }

/* Desktop: centrar FAB */
@media (min-width: 768px) {
  .top-bar, .bot-nav { max-width: 100%; }
  .fab { right: calc(50% - var(--max-w)/2 + 20px); }
}
