:root {
  --bg: #f5f7fa; --surface: #ffffff; --surface2: #eef2f6; --ink: #0e1a2b; --muted: #4a5568; --line: #dce2ea; --line-strong: #b8c3d1;
  --accent: #157347; --accent-ink: #ffffff; --accent-soft: #e3f2ea; --ok: #0f5a37; --ok-soft: #ddf0e5; --warn: #8a4b08; --warn-soft: #fdf0d5; --bad: #b42318; --bad-soft: #fde7e5;
  --head: #0f3d2b; --head-ink: #ffffff; --head-muted: #b7d3c5; --head-line: #2a6a50; --head-2: #17513a;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1520; --surface: #151e2b; --surface2: #1c2736; --ink: #e6ecf3; --muted: #9aa8ba; --line: #2a3748; --line-strong: #3d4e64;
    --accent: #4cc38a; --accent-ink: #06140d; --accent-soft: #16352a; --ok: #6fd3a0; --ok-soft: #173326; --warn: #f2b866; --warn-soft: #3a2c14; --bad: #f59a92; --bad-soft: #3b1d1c;
    --head: #0b2a1e; --head-line: #24553f; --head-2: #134330; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1520; --surface: #151e2b; --surface2: #1c2736; --ink: #e6ecf3; --muted: #9aa8ba; --line: #2a3748; --line-strong: #3d4e64;
  --accent: #4cc38a; --accent-ink: #06140d; --accent-soft: #16352a; --ok: #6fd3a0; --ok-soft: #173326; --warn: #f2b866; --warn-soft: #3a2c14; --bad: #f59a92; --bad-soft: #3b1d1c;
  --head: #0b2a1e; --head-line: #24553f; --head-2: #134330; color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 'Inter', system-ui, 'Segoe UI', Arial, sans-serif; }
main { max-width: 860px; margin: 0 auto; padding: 28px 16px 80px; display: flex; flex-direction: column; gap: 28px; }
h1 { margin: 0; font: 800 24px/1.25 'Manrope', 'Inter', sans-serif; }
h2 { margin: 0; font: 800 19px/1.3 'Manrope', 'Inter', sans-serif; }
h3 { margin: 0; font-size: 15px; font-weight: 600; }
p { margin: 0; }
.mute { color: var(--muted); }
.small { font-size: 13px; }
.step { display: inline-block; font: 700 11px/1 'Inter', sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 5px 10px; border-radius: 999px; margin-bottom: 8px; }
.sec { display: flex; flex-direction: column; gap: 12px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px 16px; }
label.fld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
label.fld > span { font-size: 12.5px; font-weight: 500; color: var(--muted); }
input[type=text], input[type=search], input[type=number], input[type=email], input[type=month], textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 11px; width: 100%; min-width: 0; }
input.bad { border-color: var(--bad); background: var(--bad-soft); }
textarea { resize: vertical; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn { font: inherit; font-weight: 600; font-size: 14px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; }
.btn:hover:not(:disabled) { background: var(--surface2); }
.btn.pri:hover:not(:disabled) { background: var(--accent-hover, var(--accent)); border-color: var(--accent-hover, var(--accent)); filter: brightness(.95); }
.btn.pri { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.sm { padding: 6px 12px; font-size: 13px; font-weight: 500; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.choice { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice input { margin-top: 4px; accent-color: var(--accent); }
.choice strong { display: block; }
.drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 20px 14px; text-align: center; border: 1.5px dashed var(--line-strong); border-radius: 8px; background: var(--surface2); cursor: pointer; }
.drop:hover, .drop.over, .drop:focus-within { border-color: var(--accent); background: var(--accent-soft); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.drop small { color: var(--muted); font-size: 12.5px; }
details > summary { cursor: pointer; font-size: 13.5px; color: var(--accent); }
details > summary + * { margin-top: 8px; }
.status { font-size: 13.5px; color: var(--muted); }
.status.warn { color: var(--warn); } .status.ok { color: var(--ok); } .status.bad { color: var(--bad); }
.search { position: relative; }
.results { position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + 4px); max-height: 320px; overflow-y: auto; margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.results[hidden] { display: none; }
.results li { padding: 6px 8px; border-radius: 6px; cursor: pointer; display: flex; gap: 10px; align-items: baseline; }
.results li:hover, .results li.act { background: var(--accent-soft); }
.results li.free { color: var(--accent); font-weight: 500; }
.code { font: 12.5px 'JetBrains Mono', monospace; color: var(--muted); white-space: nowrap; }
.pos { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); }
.pos-h { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.pos-h input { flex: 1 1 240px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--surface2); border: 1px solid var(--line); font-size: 13px; max-width: 100%; }
.chip span { overflow-wrap: anywhere; }
.chip button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 4px; border-radius: 50%; }
.chip button:hover { color: var(--bad); }
.empty { padding: 14px; border: 1px dashed var(--line-strong); border-radius: 10px; text-align: center; }
.bar { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 12px 16px; }
.bar .in { max-width: 860px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
[hidden] { display: none !important; }
.list { display: flex; flex-direction: column; gap: 10px; }
.item { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.item .t { display: flex; flex-direction: column; min-width: 0; }
.item .t strong { overflow-wrap: anywhere; }
.pill { display: inline-flex; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface2); color: var(--muted); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft, #fdf3dc); color: var(--warn, #8a5a00); }
a.btn { text-decoration: none; display: inline-block; }
.apphead { background: var(--head); color: var(--head-ink); }
.apphead .in { max-width: 1120px; margin: 0 auto; padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between; }
.apphead .logo { display: flex; align-items: center; gap: 10px; color: var(--head-ink); text-decoration: none; font: 800 17px/1.2 'Manrope', 'Inter', sans-serif; }
.apphead nav { display: flex; flex-wrap: wrap; gap: 6px; }
.apphead nav a { color: var(--head-ink); text-decoration: none; font-size: 14px; padding: 8px 12px; border-radius: 8px; border: 1px solid transparent; }
/* Бутоните в горната лента са в зеленото от логото (#22A463) */
.apphead nav a { background: #22A463; border-color: #22A463; color: #fff; font-weight: 600; }
.apphead nav a:hover { background: #2bb672; border-color: #2bb672; }
.apphead nav a[aria-current="page"] { background: #2bb672; border-color: #fff; box-shadow: inset 0 0 0 1px #fff; }
