/* Base: reset, typography, focus, direction-safe data. Logical properties only
   (tests/console/test_static_gates.py rejects physical left/right). */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.35; color: var(--text); }
h1 { font-size: 20px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0 0 var(--s3); }
ul, ol { margin: 0; padding-inline-start: var(--s5); }
small, .muted { color: var(--text-3); }
.small { font-size: 12px; }
strong { font-weight: 600; }

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

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled, [aria-disabled="true"] { cursor: not-allowed; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

hr { border: 0; border-block-start: 1px solid var(--border); margin-block: var(--s4); }

/* Technical data is always left-to-right and isolated from the Persian text
   around it: IPs, CIDRs, ports, hashes, ids, timestamps. */
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; text-align: start; }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-inline-size: 100%; }
.wrap-anywhere { overflow-wrap: anywhere; }

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

.skip-link {
  position: absolute; inset-block-start: -48px; inset-inline-start: var(--s3);
  background: var(--accent); color: var(--on-accent); padding: var(--s2) var(--s4);
  border-radius: var(--r-control); z-index: 100;
}
.skip-link:focus { inset-block-start: var(--s3); text-decoration: none; }

.icon { inline-size: 18px; block-size: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
[dir="rtl"] .icon.mirror { transform: scaleX(-1); }

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

@media (prefers-contrast: more) {
  :root { --border: var(--border-strong); }
}

@media (forced-colors: active) {
  .chip, .btn, .card, .field input, .field select, .field textarea { border: 1px solid CanvasText; }
  :focus-visible { outline-color: Highlight; }
}
