:root {
  --font-display: "Avenir Next Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  --font-body: "Avenir Next", "Segoe UI", sans-serif;
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --shadow-card: 0 24px 90px rgba(0, 0, 0, 0.28);
  --surface-blur: blur(16px);
  --surface-alpha: 0.72;
  --border-alpha: 0.12;
  --space-1: 0.45rem;
  --space-2: 0.8rem;
  --space-3: 1rem;
  --space-4: 1.35rem;
  --space-5: 1.9rem;
  --space-6: 2.6rem;
}

:root,
:root[data-theme="graphite"] {
  --bg: #050505;
  --bg-soft: #101011;
  --panel: rgba(16, 16, 17, var(--surface-alpha));
  --panel-solid: #111214;
  --line: rgba(255, 255, 255, var(--border-alpha));
  --text: #f1f1f1;
  --muted: #8a8a8f;
  --accent: #f0d46d;
  --accent-strong: #ffffff;
  --accent-warm: #f0d46d;
  --shadow-color: rgba(0, 0, 0, 0.65);
  --orb-one: rgba(180, 180, 180, 0.18);
  --orb-two: rgba(111, 111, 111, 0.12);
  --orb-three: rgba(255, 217, 122, 0.1);
}

:root[data-theme="aurora"] {
  --bg: #06080f;
  --bg-soft: #101521;
  --panel: rgba(15, 20, 32, var(--surface-alpha));
  --panel-solid: #121827;
  --line: rgba(123, 240, 255, var(--border-alpha));
  --text: #eef8ff;
  --muted: #98aec5;
  --accent: #58e7d4;
  --accent-strong: #7ca8ff;
  --accent-warm: #ffe28f;
  --orb-one: rgba(88, 231, 212, 0.18);
  --orb-two: rgba(124, 168, 255, 0.12);
  --orb-three: rgba(255, 226, 143, 0.1);
}

:root[data-theme="ember"] {
  --bg: #120d0c;
  --bg-soft: #211614;
  --panel: rgba(33, 22, 20, var(--surface-alpha));
  --panel-solid: #281918;
  --line: rgba(255, 186, 146, var(--border-alpha));
  --text: #fff3ea;
  --muted: #d0b29e;
  --accent: #ff9f6c;
  --accent-strong: #ffdd85;
  --accent-warm: #ffb978;
  --orb-one: rgba(255, 159, 108, 0.16);
  --orb-two: rgba(255, 221, 133, 0.12);
  --orb-three: rgba(255, 120, 98, 0.08);
}

:root[data-theme="tide"] {
  --bg: #061216;
  --bg-soft: #0e2028;
  --panel: rgba(14, 32, 40, var(--surface-alpha));
  --panel-solid: #112730;
  --line: rgba(153, 230, 255, var(--border-alpha));
  --text: #edf9fd;
  --muted: #9ec2cf;
  --accent: #78ebff;
  --accent-strong: #a8ffd2;
  --accent-warm: #f5ef9d;
  --orb-one: rgba(120, 235, 255, 0.15);
  --orb-two: rgba(168, 255, 210, 0.1);
  --orb-three: rgba(245, 239, 157, 0.08);
}

:root[data-surface="solid"] {
  --surface-alpha: 0.95;
}

:root[data-surface="minimal"] {
  --surface-alpha: 0.38;
  --surface-blur: blur(8px);
}

:root[data-density="compact"] {
  --space-3: 0.85rem;
  --space-4: 1.1rem;
  --space-5: 1.45rem;
  --space-6: 2rem;
}

:root[data-density="airy"] {
  --space-3: 1.2rem;
  --space-4: 1.6rem;
  --space-5: 2.15rem;
  --space-6: 2.9rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  background:
    radial-gradient(circle at top center, rgba(255, 255, 255, 0.06), transparent 26%),
    radial-gradient(circle at bottom right, rgba(255, 220, 120, 0.06), transparent 24%),
    var(--bg);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: var(--custom-background-image);
  background-size: cover;
  background-position: center;
  opacity: 0.14;
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

input,
textarea,
select {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 18px;
  padding: 0.95rem 1rem;
}

input::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, 0.28);
}

textarea {
  resize: vertical;
}

img {
  max-width: 100%;
}

.scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(100px);
  opacity: 0.32;
}

.orb-one {
  width: 24rem;
  height: 24rem;
  top: -5rem;
  left: -4rem;
  background: var(--orb-one);
}

.orb-two {
  width: 20rem;
  height: 20rem;
  top: 16%;
  right: 10%;
  background: var(--orb-two);
}

.orb-three {
  width: 18rem;
  height: 18rem;
  right: 8%;
  bottom: 8%;
  background: var(--orb-three);
}

.grid-mask {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black 36%, transparent 90%);
}

.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  backdrop-filter: var(--surface-blur);
  border-radius: var(--radius-lg);
}

.button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 0.75rem 1rem;
  border-radius: 999px;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.22);
}

.button-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #050505;
  border-color: transparent;
  font-weight: 700;
}

.button-small {
  padding: 0.55rem 0.85rem;
  font-size: 0.92rem;
}

.eyebrow {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-warm);
}

.subtle,
small,
.list-row span,
.tile span + small {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 10rem;
  padding: var(--space-5);
  border-radius: var(--radius-md);
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
}

.empty-state.compact {
  min-height: auto;
  padding: 1rem;
}

.brand-mark {
  width: 3.1rem;
  height: 3.1rem;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #050505;
  font-weight: 800;
}

.loading-shell {
  width: min(28rem, calc(100vw - 2rem));
  margin: 15vh auto 0;
  padding: 2rem;
  text-align: center;
}

.toast-root {
  position: fixed;
  right: 1rem;
  bottom: 8rem;
  z-index: 30;
  display: grid;
  gap: 0.75rem;
}

.toast {
  min-width: 14rem;
  max-width: 24rem;
  border-radius: 18px;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  background: rgba(18, 18, 19, 0.92);
  backdrop-filter: blur(18px);
  transform: translateY(8px);
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-error {
  border-color: rgba(255, 123, 123, 0.4);
}

@media (max-width: 720px) {
  .toast-root {
    right: 0.75rem;
    left: 0.75rem;
    bottom: 7rem;
  }

  .toast {
    min-width: 0;
    max-width: none;
  }
}
