/* Oblivet 3.3 — clean card borders, restrained motion and original palette. */
:root {
  --edge-glow: rgba(170, 190, 255, .14);
  --edge-highlight: rgba(255, 255, 255, .12);
}

/* Keep the familiar standard theme; AMOLED changes only the deepest surfaces. */
body.amoled-mode {
  --bg: #000;
  --bg-raised: #030303;
  --bg-hover: #080808;
  --panel: #030303;
  --line: rgba(255,255,255,.10);
  --line-soft: rgba(255,255,255,.06);
  --line-strong: rgba(255,255,255,.19);
}
body.amoled-mode .ambient { opacity: .68; background: #000; }
body.amoled-mode .ambient-grid { opacity: .16; }
body.amoled-mode .card,
body.amoled-mode .stat-card,
body.amoled-mode .panel,
body.amoled-mode .portfolio-hero,
body.amoled-mode .wallet-card,
body.amoled-mode .budget-card,
body.amoled-mode .planning-card {
  background-color: #030303;
  border-color: rgba(255,255,255,.12);
}

/* Slow geometric ambience in the background. */
.ambient::before,
.ambient::after {
  content: "";
  position: absolute;
  width: min(42vw, 480px);
  aspect-ratio: 1;
  border: 1px solid rgba(190,205,255,.075);
  border-radius: 34% 66% 57% 43% / 42% 39% 61% 58%;
  left: 58%; top: 18%;
  transform: rotate(0deg);
  animation: oblivet-geometry 42s linear infinite;
  box-shadow: inset 0 0 70px rgba(120,140,210,.018), 0 0 80px rgba(120,140,210,.018);
  pointer-events: none;
}
.ambient::after {
  width: min(28vw, 320px);
  left: 10%; top: 54%;
  border-radius: 50%;
  border-style: dashed;
  opacity: .42;
  animation-duration: 58s;
  animation-direction: reverse;
}
@keyframes oblivet-geometry {
  0% { transform: rotate(0deg) translate3d(0,0,0) scale(.97); }
  50% { transform: rotate(180deg) translate3d(1.5%, -1.5%, 0) scale(1.025); }
  100% { transform: rotate(360deg) translate3d(0,0,0) scale(.97); }
}

/* IMPORTANT: do not override card ::after pseudo-elements from the original UI.
   The previous gradient mask conflicted with existing highlights and caused broken edges. */
:is(.stat-card, .panel, .portfolio-hero, .wallet-card, .wallet-mini, .budget-card, .planning-card, .modal) {
  border-style: solid;
  border-width: 1px;
  transition: border-color .24s ease, box-shadow .24s ease, transform .24s ease;
}
:is(.stat-card, .panel, .portfolio-hero, .wallet-card, .wallet-mini, .budget-card, .planning-card) {
  border-color: var(--line);
}
:is(.stat-card, .panel, .portfolio-hero, .wallet-card, .wallet-mini, .budget-card, .planning-card):hover {
  border-color: rgba(190,205,255,.25);
  box-shadow: 0 0 0 1px rgba(170,190,255,.025), 0 10px 28px rgba(0,0,0,.14);
}
:is(.stat-card, .panel, .portfolio-hero, .wallet-card, .wallet-mini, .budget-card, .planning-card):focus-within {
  border-color: rgba(190,205,255,.30);
  box-shadow: 0 0 0 3px rgba(170,190,255,.045);
}
:is(button, a, input, select, textarea):focus-visible {
  outline: 2px solid rgba(190,205,255,.62);
  outline-offset: 3px;
}

/* Comfortable touch targets: five equal cells, four destinations + More. */
@media (max-width: 960px) {
  .mobile-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    left: 12px; right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    padding: 6px;
    border-radius: 18px;
    background: rgba(10,10,10,.91);
    border-color: rgba(220,225,245,.14);
    box-shadow: 0 12px 38px rgba(0,0,0,.38), inset 0 1px rgba(255,255,255,.035);
  }
  .mobile-nav-link { min-width: 0; height: 50px; gap: 4px; font-size: 10px; }
  .mobile-nav-link svg { width: 19px; height: 19px; }
  .mobile-nav-link span { white-space: nowrap; }
  .mobile-nav-link.is-active { background: rgba(255,255,255,.075); }
  body.amoled-mode .mobile-nav { background: rgba(0,0,0,.96); border-color: rgba(255,255,255,.17); }
}
@media (max-width: 380px) {
  .mobile-nav { left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); }
  .mobile-nav-link { font-size: 9px; height: 48px; }
  .mobile-nav-link svg { width: 18px; height: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .ambient::before, .ambient::after, .orb { animation: none !important; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
