/* Reset + element defaults + tiny utilities. Everything here is token-driven (tokens.css must be
   loaded first). Component classes live in components.css; the shell in shell.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: dark; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--f-base);
  line-height: 1.45;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }

h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 600; }
h2 { font-size: var(--f-lg); }
h3 { font-size: var(--f-md); }
p { margin: 0; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; }
code, .mono { font-family: var(--mono); }
code { font-size: 0.92em; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* Form controls - same navy-on-navy look as today, one shared focus ring. */
input, select, textarea {
  font: inherit;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--r-md);
  font-size: var(--f-base);
  width: 100%;
  min-height: var(--tap);
}
textarea { min-height: 96px; resize: vertical; line-height: 1.4; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .85; }
input:hover, select:hover, textarea:hover { border-color: #334a7a; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-2); }
input:focus-visible, select:focus-visible, textarea:focus-visible { box-shadow: var(--focus); }
input:disabled, select:disabled, textarea:disabled { opacity: .55; cursor: not-allowed; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--accent); }
input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }
/* Dark dropdown list where the browser honours it (Chromium/Firefox). */
select option { background: var(--panel-2); color: var(--text); }
select {
  appearance: none; -webkit-appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2393a3c9' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
  cursor: pointer;
}
select[multiple] { background-image: none; padding-right: 12px; }

/* Keyboard focus is always visible; mouse focus never draws a ring on buttons/links. */
:focus-visible { outline: none; box-shadow: var(--focus); }
button:focus:not(:focus-visible), a:focus:not(:focus-visible) { outline: none; box-shadow: none; }

/* Utilities */
.muted, .sub { color: var(--muted); }
.sub { font-size: 13px; }
.small-text { font-size: var(--f-sm); }
.xs { font-size: var(--f-xs); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tnum { font-variant-numeric: tabular-nums; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.between { justify-content: space-between; }
.gap-1 { gap: var(--s-1); }
.gap-2 { gap: var(--s-2); }
.gap-3 { gap: var(--s-3); }
.gap-4 { gap: var(--s-4); }
.grow { flex: 1 1 auto; min-width: 0; }
.mt-2 { margin-top: var(--s-2); }
.mt-3 { margin-top: var(--s-3); }
.mt-4 { margin-top: var(--s-4); }
.mt-6 { margin-top: var(--s-6); }
.mb-2 { margin-bottom: var(--s-2); }
.mb-3 { margin-bottom: var(--s-3); }
.mb-4 { margin-bottom: var(--s-4); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.c-ok { color: var(--c-ok); }
.c-danger { color: var(--c-danger); }
.c-warn { color: var(--c-warn); }
.c-info { color: var(--c-info); }
.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;
}
/* Shown only on one side of the 760 px breakpoint. */
@media (max-width: 759px) { .desktop-only { display: none !important; } }
@media (min-width: 760px) { .mobile-only { display: none !important; } }

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