/* =====================================================================
   Base — reset, typography, RTL, boot splash
   ===================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

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

body {
  font-family: var(--font);
  font-size: var(--fs-md);
  color: var(--ink);
  /* Cool paper with two faint radial accents — depth without a busy pattern. */
  background:
    radial-gradient(1200px 700px at 100% -10%, rgba(18, 196, 138, 0.06), transparent 55%),
    radial-gradient(1000px 600px at -10% 110%, rgba(11, 110, 79, 0.05), transparent 55%),
    var(--cream);
  background-attachment: fixed;
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  line-height: 1.25;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* Big numbers / display values read tight, heavy, latin-tabular. */
.display, .num--display {
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  font-variant-numeric: tabular-nums;
  line-height: 0.95;
}

a {
  color: var(--green);
  text-decoration: none;
}
a:hover { color: var(--green-600); }

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button { cursor: pointer; }

img { max-width: 100%; display: block; }

/* Icons: sane default so an un-sized inline <svg> never falls back to the
   300×150 replaced-element default (caused horizontal overflow). Specific
   rules in components.css (.btn svg, .kpi__icon svg, …) override this. */
svg:not([width]) { width: 1.15em; height: 1.15em; flex-shrink: 0; }

ul { list-style: none; padding: 0; }

/* Numbers & latin fragments keep LTR direction inline */
.ltr,
.num {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}

/* Focus visibility — electric mint ring, always visible (WCAG 2.2 2.4.11/2.4.13) */
:focus-visible {
  outline: 3px solid var(--mint);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Scrollbar polish */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: #c3d2cb;
  border-radius: 999px;
  border: 2px solid var(--cream);
}
::-webkit-scrollbar-thumb:hover { background: #a9bcb3; }

/* ------- Boot splash ------- */
.boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 22px;
  background:
    radial-gradient(900px 520px at 80% -10%, rgba(18, 196, 138, 0.16), transparent 60%),
    radial-gradient(700px 500px at 10% 110%, rgba(11, 110, 79, 0.20), transparent 60%),
    linear-gradient(160deg, var(--ink-900), var(--ink-850) 60%, var(--ink-800));
  color: var(--cream);
  z-index: 9999;
}
.boot__mark {
  width: 78px;
  height: 78px;
  border-radius: 22px;
  display: grid;
  place-content: center;
  color: var(--ink-900);
  background: linear-gradient(145deg, var(--mint-bright), var(--mint));
  box-shadow: 0 14px 36px var(--mint-glow), inset 0 1px 0 rgba(255,255,255,0.4);
}
.boot__mark svg { stroke: var(--ink-900) !important; }
.boot__spin {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--mint-bright);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.boot__txt {
  font-size: var(--fs-sm);
  opacity: 0.8;
  letter-spacing: 0.3px;
  font-weight: 500;
}
@keyframes spin { to { transform: rotate(360deg); } }

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

[hidden] { display: none !important; }

/* Utilities */
.muted { color: var(--ink-faint); }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.hide-sm { }
@media (max-width: 720px) { .hide-sm { display: none !important; } }
