/* ---------- Boot splash (removed by app.js; CSS failsafe after 6s) ---------- */
.boot {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-content: center; justify-items: center; gap: 20px;
  background: var(--bg);
  animation: boot-failsafe 0s linear 6s forwards;
}
.boot.done { display: none; }
@keyframes boot-failsafe { to { opacity: 0; visibility: hidden; } }

.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid var(--line-strong); border-top-color: var(--cyan);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Offline banner ---------- */
.net-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 90;
  height: 36px; display: flex; align-items: center; justify-content: center;
  padding: 0 12px; background: #3b1d2a; color: #ffd5dd;
  font-size: .8125rem; text-align: center;
}

/* ---------- Landing ---------- */
.landing { max-width: 1040px; margin: 0 auto; padding: 0 20px 48px; }

.landing-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(16px + var(--safe-t)) 0 8px;
}

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); font-weight: 700; letter-spacing: .04em; font-size: .9375rem;
}
.brand:hover { text-decoration: none; }

.hero { position: relative; display: grid; gap: 20px; padding: 48px 0 32px; }
.hero::before {
  content: ""; position: absolute; inset: -40px -20px auto; height: 280px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 80% at 20% 0, rgba(139, 92, 246, .28), transparent 70%),
    radial-gradient(50% 70% at 90% 10%, rgba(34, 211, 238, .16), transparent 70%);
}
.hero p { color: var(--muted); font-size: 1.0625rem; max-width: 34rem; }
.hero .grad, .grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

.section { display: grid; gap: 16px; padding: 32px 0 0; }
.feature-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .feature-grid { grid-template-columns: repeat(4, 1fr); } }

.landing details { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--card); }
.landing summary { cursor: pointer; font-weight: 600; min-height: 24px; }
.landing details ol { margin: 12px 0 0; padding-left: 20px; color: var(--muted); display: grid; gap: 6px; }

.landing-foot { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--faint); font-size: .8125rem; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px calc(24px + var(--safe-b)); }
.auth-card {
  width: 100%; max-width: 440px; display: grid; gap: 16px; padding: 24px 20px;
  background: linear-gradient(180deg, var(--card), var(--surface));
  border: 1px solid var(--line); border-radius: 20px;
}
.auth-card h1 { font-size: 1.5rem; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: .9375rem; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: .8125rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- App shell ---------- */
.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.shell-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  position: sticky; top: var(--banner-h); z-index: 10;
  height: calc(var(--top-h) + var(--safe-t)); padding: var(--safe-t) 16px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(5, 5, 10, .96); border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 1.125rem; letter-spacing: 0; }

.shell-main {
  flex: 1; width: 100%; max-width: 760px; margin: 0 auto;
  padding: 16px 16px calc(var(--nav-h) + var(--safe-b) + 24px);
  display: grid; gap: 16px; align-content: start;
}

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: flex; background: var(--surface); border-top: 1px solid var(--line);
}
.nav .brand { display: none; }
.nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); font-size: .75rem; text-decoration: none;
  transition: color var(--dur) var(--ease);
}
.nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"] svg { color: var(--cyan); }

@media (min-width: 900px) {
  .shell { flex-direction: row; }
  .nav {
    position: sticky; top: 0; flex: none; width: 240px; height: 100dvh;
    padding: calc(20px + var(--safe-t)) 12px 20px; flex-direction: column; gap: 4px;
    border-top: 0; border-right: 1px solid var(--line);
  }
  .nav .brand { display: inline-flex; margin: 0 8px 20px; }
  .nav a {
    flex: none; flex-direction: row; justify-content: flex-start; gap: 12px;
    padding: 0 14px; min-height: 48px; border-radius: var(--radius-sm); font-size: .9375rem;
  }
  .nav a[aria-current="page"] { background: var(--card-2); }
  .shell-main { padding-bottom: 32px; }
}

/* ---------- Settings / profile lists ---------- */
.stack { display: grid; gap: 12px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.row + .row { border-top: 1px solid var(--line); }
.row-label { color: var(--muted); font-size: .875rem; }
.row-value { text-align: right; overflow-wrap: anywhere; }
.profile-head { display: flex; align-items: center; gap: 16px; }
.avatar-edit { display: flex; align-items: center; gap: 16px; }
