/* Finance IDE – Basis: Reset, Typografie, Zahlen. Nur Tokens verwenden. */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh-base);
  font-feature-settings: "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  margin: 0 0 var(--sp-3);
  line-height: var(--lh-tight);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.01em;
}
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-base); }

/* Display-Schrift für alles ab --fs-lg (D-106) */
h1, h2, h3,
.font-display {
  font-family: var(--font-display);
}

p { margin: 0 0 var(--sp-3); }

a {
  color: var(--c-accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

code, kbd, pre {
  font-family: var(--font-mono);
  font-size: 0.92em;
}
kbd {
  padding: 1px 6px;
  border: var(--line-w) solid var(--c-line-strong);
  border-bottom-width: 2px;
  border-radius: var(--r-xs);
  background: var(--c-surface);
  color: var(--c-text-2);
}

hr {
  border: 0;
  border-top: var(--line-w) solid var(--c-line);
  margin: var(--sp-6) 0;
}

:focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: 2px;
}

::selection {
  background: var(--c-accent-soft);
}

/* ---- Scrollbars (D-101): schmal, themenfarbig ---------------------------
   Standard-Eigenschaften (Firefox, Chromium ≥ 121); Safari nutzt die ::-webkit-Variante. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--c-scroll-thumb) transparent;
}
*:hover {
  scrollbar-color: var(--c-scroll-thumb-hover) transparent;
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: var(--r-pill);
  background: var(--c-scroll-thumb);
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background-color: var(--c-scroll-thumb-hover);
}

/* Zahlen immer tabellarisch – Beträge stehen sauber untereinander. */
.num,
table,
input[type="number"] {
  font-variant-numeric: tabular-nums;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
  }
}
