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

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

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-14);
  color: var(--color-text);
  position: relative;
  overflow-x: hidden;
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.005em;
}

/* --- Aurora stage ---------------------------------------------------------
 * A single fixed, pointer-events:none layer paints the four-way aurora wash
 * behind every route. Previous revisions ran a continuous hue-rotate and
 * layered a blended noise texture on top — both forced the whole viewport
 * to repaint every frame and made scrolling feel heavy. Now the look is
 * preserved by baking a faint grain directly into the background-image
 * stack, so there's one paint layer and zero ongoing animation cost.
 * ------------------------------------------------------------------------ */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    var(--aurora-1),
    var(--aurora-2),
    var(--aurora-3),
    var(--aurora-4),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0 0.03 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
    linear-gradient(180deg, #070915 0%, #05070f 100%);
}

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

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: inherit;
}

/* Global form control color intent (helps native popup menus on some OSes). */
:root {
  color-scheme: dark;
}

/* Unified dropdown styling across modules/routes. */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  color: var(--color-text);
  background-color: rgba(25, 18, 44, 0.94);
  border: 1px solid rgba(168, 136, 255, 0.34);
  border-radius: var(--radius-10);
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(224, 208, 255, 0.95) 50%),
    linear-gradient(135deg, rgba(224, 208, 255, 0.95) 50%, transparent 50%),
    radial-gradient(circle at center, rgba(168, 136, 255, 0.18), rgba(168, 136, 255, 0));
  background-position:
    calc(100% - 17px) calc(50% - 1px),
    calc(100% - 11px) calc(50% - 1px),
    calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px, 22px 22px;
  background-repeat: no-repeat;
  padding-right: 2.3rem;
}

/* Native popup options (best effort; browser/OS controls final rendering). */
select option {
  background-color: #20163b;
  color: var(--color-text);
}

select option:checked,
select option:hover {
  background-color: #3a2a63;
  color: #ffffff;
}

button {
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}

::selection {
  background: rgba(34, 227, 255, 0.28);
  color: #fff;
}

/* Global scrollbar — thin, premium, on brand. */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb:hover {
  background: rgba(34, 227, 255, 0.2);
}

#app {
  min-height: 100vh;
}

/* Display + numeric voice helpers. */
.display-font {
  font-family: var(--font-family-display);
  letter-spacing: -0.02em;
}
.num-font {
  font-family: var(--font-family-mono);
  font-feature-settings: "tnum" 1, "ss01" 1;
  letter-spacing: -0.02em;
}

/* Focus ring — designed, not default. Used globally. */
:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(6, 7, 15, 1),
    0 0 0 4px rgba(34, 227, 255, 0.55);
  border-radius: 10px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
