/* Общие токены и компоненты сайта; палитра — как у карты (map/template.html), контраст проверен аудитом. */
:root {
  --bg: #f7f6f3; --surface: #ffffff; --text: #1d1c1a; --muted: #5d5a54;
  --line: #dcd8d0; --band: #efece5;
  --accent: #2f5bd3; --accent-soft: #e7edfb; --accent-text: #ffffff;
  --late: #b3261e; --late-soft: #fbe9e7;
  --soon: #7a4800; --soon-soft: #fbf0dc;
  --ok: #2e6b3f; --ok-soft: #e4f1e7;
  --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 6px 20px rgb(0 0 0 / .07);
  --radius: 12px; --r-s: 8px;
  --fs-s: 13px; --fs-m: 15px; --fs-l: 17px; --fs-xl: 22px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121315; --surface: #1b1c1f; --text: #ecebe8; --muted: #c1beb8;
    --line: #34363b; --band: #18191c;
    --accent: #a1bdff; --accent-soft: #222b42; --accent-text: #121315;
    --late: #ffa69e; --late-soft: #3a2220;
    --soon: #f0b860; --soon-soft: #3a2e1a;
    --ok: #8fd19e; --ok-soft: #1d3324;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 6px 20px rgb(0 0 0 / .35);
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); color: var(--text); font: var(--fs-m)/1.45 var(--font); }
body { margin: 0; }
::selection { background: var(--accent-soft); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-underline-offset: 3px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

header.top { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.bar { max-width: 1240px; margin: 0 auto; padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
h1 { font-size: var(--fs-l); margin: 0; font-weight: 650; letter-spacing: -0.01em; }

.nw-nav { display: flex; gap: 4px; background: var(--band); padding: 3px; border-radius: 10px; }
.nw-nav a { padding: 8px 14px; border-radius: 8px; min-height: 40px; display: inline-flex; align-items: center; color: var(--text); text-decoration: none; }
.nw-nav a[aria-current="page"] { background: var(--surface); box-shadow: var(--shadow); font-weight: 600; }
.nw-nav a:hover { text-decoration: underline; }

.btn { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-s); padding: 7px 12px; cursor: pointer; min-height: 36px; white-space: nowrap; text-decoration: none; color: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--late); }
.btn kbd { font: 600 11px/1 var(--font); opacity: .7; }
kbd { font: 600 12px/1 var(--font); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 2px 5px; background: var(--surface); color: var(--text); }
input[type=search], input[type=text], input[type=date], input[type=number], select, textarea {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-s); padding: 7px 10px; min-height: 36px; width: 100%; }
textarea { min-height: 80px; resize: vertical; }
label.f { display: flex; flex-direction: column; gap: 3px; font-size: var(--fs-s); color: var(--muted); }
label.f > input, label.f > select, label.f > textarea { color: var(--text); font-size: var(--fs-m); }

main { max-width: 1240px; margin: 0 auto; padding: 16px 16px 80px; }
.lead { color: var(--muted); margin: 0 0 14px; max-width: 75ch; }
.chips { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-bottom: 4px; }
.chip { font-size: var(--fs-s); padding: 2px 8px; border-radius: 999px; background: var(--band); }
.chip.kind { background: var(--accent-soft); font-weight: 600; }
.status { font-size: var(--fs-s); font-weight: 600; padding: 2px 8px; border-radius: 999px; display: inline-block; margin-bottom: 6px; }
.status.approve, .status.edit, .status.ok { background: var(--ok-soft); color: var(--ok); }
.status.skip { background: var(--late-soft); color: var(--late); }
.status.later, .status.warn { background: var(--soon-soft); color: var(--soon); }
.empty-state { text-align: center; padding: 48px 16px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); font-size: var(--fs-s); max-width: calc(100% - 32px); z-index: 20; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
@media (max-width: 900px) {
  header.top { position: static; }
  .btn, .nw-nav a, input[type=search], input[type=text], input[type=date], input[type=number], select { min-height: 44px; }
  input[type=checkbox] { width: 22px; height: 22px; }
  .btn kbd { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
