/* Splash */
.splash {
  position: fixed; inset: 0;
  background: var(--bg-base);
  display: grid; place-items: center;
  z-index: 100;
  transition: opacity var(--t-slow) var(--easing);
}
.splash[hidden] { display: none; }
.splash.fade-out { opacity: 0; pointer-events: none; }
.splash-word {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(2.5rem, 9vw, 4.5rem);
  letter-spacing: -0.01em;
  color: var(--fg-primary);
  font-weight: 500;
  opacity: 0;
  animation: splashIn var(--t-slow) var(--easing) forwards;
}
@keyframes splashIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Bottom nav */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(10,10,15,0.78);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  z-index: 50;
}
.bottom-nav[hidden] { display: none; }
.nav-btn {
  flex: 1;
  position: relative;
  display: grid; place-items: center;
  color: var(--fg-tertiary);
  transition: color var(--t-fast), transform var(--t-fast);
  height: var(--nav-h);
}
.nav-btn:hover { color: var(--fg-secondary); }
.nav-btn:active { transform: scale(0.9); }
.nav-btn.is-active { color: var(--fg-primary); }
.nav-btn.is-active::before {
  content: ""; position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 24px; height: 2px;
  background: var(--fg-primary);
  border-radius: 0 0 2px 2px;
}
.nav-ico svg { width: 22px; height: 22px; display: block; }
.nav-offline-dot {
  position: absolute; top: 8px; right: 14px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-red);
  box-shadow: 0 0 0 2px var(--bg-base), 0 0 8px var(--accent-red);
}

/* Toast */
.toast {
  position: fixed; left: 50%; transform: translate(-50%, 24px);
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 24px);
  background: var(--bg-elevated);
  color: var(--fg-primary);
  border: 1px solid var(--border-subtle);
  padding: var(--sp-3) var(--sp-5);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-modal);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base) var(--easing), transform var(--t-base) var(--easing);
  z-index: 200;
  max-width: 88vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Sheet */
.sheet {
  position: fixed; inset: 0;
  z-index: 150;
  display: flex; align-items: flex-end;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--t-base) var(--easing);
}
.sheet.open { opacity: 1; }
.sheet[hidden] { display: none; }
.sheet-inner {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  background: var(--bg-elevated);
  border-radius: 24px 24px 0 0;
  padding: var(--sp-4) var(--sp-5) calc(var(--sp-7) + var(--safe-bottom));
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(24px);
  transition: transform var(--t-base) var(--easing);
  border-top: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-modal);
}
.sheet.open .sheet-inner { transform: none; }
.sheet-handle {
  width: 36px; height: 4px;
  background: var(--border-strong);
  border-radius: 999px;
  margin: 0 auto var(--sp-5);
}
.sheet-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.75rem;
  letter-spacing: -0.02em;
  margin: 0 0 var(--sp-3);
}

/* Chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 6px 12px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
  flex-shrink: 0;
}
.chip:hover { color: var(--fg-primary); border-color: var(--border-strong); }
.chip.is-active {
  background: var(--bg-card);
  color: var(--fg-primary);
  border-color: var(--cat-color, var(--fg-primary));
}
.chip-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cat-color, var(--fg-tertiary));
  flex-shrink: 0;
}

/* Input */
.input {
  width: 100%;
  background: var(--bg-input);
  color: var(--fg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: var(--sp-4) var(--sp-5);
  font-size: 1.05rem;
  font-family: var(--font-sans);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.input::placeholder { color: var(--fg-tertiary); }
.input:focus { outline: none; border-color: var(--border-strong); background: var(--bg-elevated); }

/* Button */
.btn {
  display: inline-flex;
  align-items: center; justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  background: var(--bg-input);
  color: var(--fg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.btn:hover { background: var(--bg-elevated); border-color: var(--border-strong); }
.btn:active { transform: scale(0.98); }
.btn.is-danger { color: var(--accent-red); }
.btn.is-danger:hover { color: var(--accent-red); border-color: var(--accent-red); }
.btn.is-block { width: 100%; }

/* Result row */
.row {
  display: flex; flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-5) var(--sp-3);
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background var(--t-fast);
  margin: 0 calc(var(--sp-3) * -1);
  padding-left: var(--sp-3);
  padding-right: var(--sp-3);
  border-radius: 8px;
}
.row:hover { background: var(--bg-card); }
.row-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.35rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--fg-primary);
}
.row-title-sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--fg-secondary);
  font-size: 0.95rem;
}
.row-body {
  color: var(--fg-secondary);
  font-size: 0.875rem;
  line-height: 1.55;
  max-width: 65ch;
}
.row-meta {
  display: flex; gap: var(--sp-3);
  align-items: center;
  margin-top: var(--sp-1);
}
.row-tier {
  color: var(--accent-yellow);
  font-size: 0.8rem;
  line-height: 1;
  text-shadow: 0 0 8px rgba(255,199,44,0.4);
}

/* Empty state */
.empty {
  display: flex; flex-direction: column;
  gap: var(--sp-3);
  align-items: center; justify-content: center;
  text-align: center;
  padding: var(--sp-8) var(--sp-5);
  color: var(--fg-secondary);
  flex: 1;
}
.empty-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.5rem;
  color: var(--fg-primary);
  letter-spacing: -0.01em;
}
.empty p { max-width: 36ch; line-height: 1.6; }
