/* MapFactory base: reset + element defaults. Requires mf-tokens.css. */

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

html, body {
  height: 100%;
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "tnum" 1;   /* tabular figures everywhere: numbers line up */
  overflow: hidden;                   /* full-height app pages */
}
body.is-scroll { overflow: auto; }   /* long pages: <body class="is-scroll"> */

h1, h2, h3, h4 { font-weight: var(--fw-semibold); line-height: var(--lh-snug); color: var(--text); }
h1 { font-size: var(--fs-2xl); letter-spacing: 0.01em; }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }

p { text-wrap: pretty; }
small { font-size: var(--fs-xs); }
strong, b { font-weight: var(--fw-semibold); }

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

code, kbd, samp, pre, .mono { font-family: var(--font-mono); font-size: 0.95em; }
pre { white-space: pre-wrap; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); cursor: pointer; }
input[type="number"] { font-family: var(--font-mono); }
::placeholder { color: var(--text-dim); opacity: 1; }

table { border-collapse: collapse; }
[hidden] { display: none !important; }
img, svg { display: block; max-width: 100%; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-hover-bg); }

/* Thin scrollbars everywhere */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--r-pill); }

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