/* No backdrop blur anywhere: the glass is 92-95% opaque already, and blurring a live WebGL map is costly on low-end phones.
   SenFlote Maps Explorer — built on SenFlote Go's frontend V7 « Repère × Instrument Panel » (senflote-5.0/frontendV7).
   Taken from V7: paper and ink surfaces, Plus Jakarta Sans + JetBrains Mono, mono uppercase eyebrows, 38 px controls with
   7 px corners, 16 px cards, glass panels floating over a full-bleed map, round category pins with a white ring.
   Changed on purpose: the brand is the Maps green (not V7's blue), so the explorer matches maps.senflote.com. */

:root,
:root[data-theme='light'] {
  /* surfaces: paper */
  --bg: #fcfbf8;
  --surface: #ffffff;
  --surface-2: #f5f3ee;
  --surface-3: #efece4;
  --surface-4: #e7e3d8;
  --glass: rgba(255, 255, 255, 0.85);
  /* Opaque on purpose: without the backdrop blur a translucent panel lets the map ghost through its text. */
  --glass-2: #ffffff;
  --line: #e6e2da;
  --line-2: #d6d1c4;
  /* ink */
  --fg: #232b36;
  --fg-2: #4a5568;
  --muted: #5f6672;
  --dim: #8b93a0;
  /* brand: the Maps green */
  --brand: #0a7d55;
  --brand-2: #076a48;
  --brand-ink: #065c3f;
  --on-brand: #ffffff;
  --brand-dim: color-mix(in srgb, var(--brand) 10%, transparent);
  --warn: #8a5a00;
  --err: #a3281f;
  --shadow: rgba(17, 20, 24, 0.14);
  --map-bg: #f2f5f9;
  color-scheme: light;
}

:root[data-theme='dark'] {
  --bg: #0a1018;
  --surface: #141b26;
  --surface-2: #1a2230;
  --surface-3: #222b39;
  --surface-4: #2a3444;
  --glass: rgba(13, 20, 30, 0.82);
  --glass-2: #141b26;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.16);
  --fg: #eef0f3;
  --fg-2: #b4c0cc;
  --muted: #9aa3ae;
  --dim: #6d7885;
  --brand: #3ecf94;
  --brand-2: #5fe0ac;
  --brand-ink: #9df0cc;
  --on-brand: #062019;
  --brand-dim: color-mix(in srgb, var(--brand) 16%, transparent);
  --warn: #e0b04a;
  --err: #ff8a7e;
  --shadow: rgba(0, 0, 0, 0.55);
  --map-bg: #0b1723;
  color-scheme: dark;
}

/* No explicit theme (the admin console): follow the OS. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0a1018;
    --surface: #141b26;
    --surface-2: #1a2230;
    --surface-3: #222b39;
    --surface-4: #2a3444;
    --glass: rgba(13, 20, 30, 0.82);
    --glass-2: #141b26;
    --line: rgba(255, 255, 255, 0.08);
    --line-2: rgba(255, 255, 255, 0.16);
    --fg: #eef0f3;
    --fg-2: #b4c0cc;
    --muted: #9aa3ae;
    --dim: #6d7885;
    --brand: #3ecf94;
    --brand-2: #5fe0ac;
    --brand-ink: #9df0cc;
    --on-brand: #062019;
    --brand-dim: color-mix(in srgb, var(--brand) 16%, transparent);
    --warn: #e0b04a;
    --err: #ff8a7e;
    --shadow: rgba(0, 0, 0, 0.55);
    --map-bg: #0b1723;
    color-scheme: dark;
  }
}

:root {
  /* names the components already use */
  --ink: var(--fg);
  --accent: var(--brand);
  --accent-ink: var(--on-brand);
  --radius: 7px;
  --radius-lg: 16px;
  --font-ui: 'Plus Jakarta Sans Variable', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --header-h: 60px;
  --panel-w: 380px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.5 var(--font-ui);
  /* Plus Jakarta Sans sets its word space very tight: V7 widens it so small text does not run together. */
  word-spacing: 0.1em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

p {
  margin: 0;
}

button,
input,
select {
  font: inherit;
  color: inherit;
  word-spacing: inherit;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  word-spacing: normal;
}

.muted {
  color: var(--muted);
}

/* Mono uppercase label: the V7 way to name a section without a heavy heading. */
.eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand-ink);
  word-spacing: normal;
}
.eyebrow--muted {
  color: var(--muted);
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  border: 1px solid var(--line-2);
  background: var(--surface-3);
  color: var(--fg-2);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  white-space: nowrap;
  word-spacing: normal;
}
.tag--ok {
  color: var(--brand-ink);
  border-color: color-mix(in srgb, var(--brand) 40%, transparent);
  background: var(--brand-dim);
}

.icon {
  flex: none;
  vertical-align: middle;
}

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

/* ── Controls (V7 .btn / .input) ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--fg);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: 0.14s var(--ease);
}
.btn:hover {
  border-color: var(--brand);
  color: var(--brand-ink);
}
.btn[aria-expanded='true'] {
  border-color: var(--brand);
  background: var(--brand-dim);
  color: var(--brand-ink);
}
.btn:disabled {
  opacity: 0.6;
  cursor: progress;
}
.btn--primary {
  background: var(--brand);
  border-color: transparent;
  color: var(--on-brand);
}
.btn--primary:hover {
  background: var(--brand-2);
  color: var(--on-brand);
}

input[type='search'],
input[type='text'],
select {
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--fg);
  outline: 0;
}
input:focus,
select:focus {
  border-color: var(--brand);
}

.link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--brand-ink);
  cursor: pointer;
  text-decoration: underline;
}

/* Arabic joins its letters: no letter-spacing, no uppercase, and the UI face rather than the mono one for small labels. */
:lang(ar) .eyebrow,
:lang(ar) .tag,
:lang(ar) .brand__sub,
:lang(ar) .area__label,
:lang(ar) .stat__label,
:lang(ar) th,
:lang(ar) .legend summary {
  letter-spacing: 0;
  text-transform: none;
  font-family: var(--font-ui);
}
