/* Base elements, typography and utilities. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.6;
  color: var(--tk-body, var(--text-primary));
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.25; margin: 0; font-weight: 600; }
/* Heading colours: the theme tokens (/theme.css, Visual Builder → Theme) when set, else the design below. h5 and h6
   inherit their colour unless a token is set (an unset var() makes the colour inherit). */
h1 { font-size: 1.5rem; color: var(--tk-h1, var(--text-primary)); }
h2 { font-size: 1.0625rem; color: var(--tk-h2, var(--text-primary)); }
h3 { font-size: 1rem; color: var(--tk-h3, var(--text-primary)); }
h4 { color: var(--tk-h4, var(--text-primary)); }
h5 { color: var(--tk-h5); }
h6 { color: var(--tk-h6); }
p { margin: 0 0 0.75rem; }
img, svg { max-width: 100%; }
img { height: auto; }
a { color: var(--tk-link, var(--state-info-text)); text-underline-offset: 2px; }
a:hover { text-decoration: underline; }
:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
hr { border: 0; border-top: 1px solid var(--border-default); }
table { border-collapse: collapse; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.icon { width: 1.125rem; height: 1.125rem; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.icon-sm { width: 1rem; height: 1rem; }
.icon-xs { width: 0.75rem; height: 0.75rem; }

.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; }
.skip-link { position: absolute; left: 0.5rem; top: -4rem; z-index: 100; padding: 0.5rem 0.75rem; background: var(--bg-surface); color: var(--text-primary); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); }
.skip-link:focus { top: 0.5rem; }
.muted { color: var(--text-muted); }
.small { font-size: var(--text-label); }
.stack { display: grid; gap: 1rem; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }

@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 print {
  .admin-sidebar, .admin-topbar, .toast-region, .skip-link { display: none !important; }
  .admin-main { margin: 0 !important; }
}
