:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #eef1f4;
  --ink: #18222c;
  --ink-2: #3f4c58;
  --muted: #5f6c78;
  --line: #dde3e9;
  --brand: #17608f;
  --brand-deep: #12395b;
  --brand-ink: #ffffff;
  --brand-soft: #e1eef6;
  --ok: #1d7443;
  --ok-soft: #e3f3e9;
  --warn: #8f5b00;
  --warn-soft: #fbf0d9;
  --bad: #b42318;
  --bad-soft: #fde8e6;
  --shadow: 0 1px 2px rgba(20, 30, 40, .06), 0 4px 16px rgba(20, 30, 40, .06);
  --radius: 12px;
  --font: system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10161c; --surface: #182029; --surface-2: #202a34; --ink: #e6ecf1; --ink-2: #c2ccd5; --muted: #8f9ca8;
    --line: #2c3743; --brand: #62addb; --brand-deep: #0d2b45; --brand-ink: #08131c; --brand-soft: #15303f;
    --ok: #5cc48a; --ok-soft: #173023; --warn: #e0b04f; --warn-soft: #33290f; --bad: #f08a80; --bad-soft: #3a1d1a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.55; overflow-x: hidden; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
h2 { font-size: 20px; margin: 0 0 4px; line-height: 1.3; }
h3 { font-size: 16px; margin: 0 0 4px; line-height: 1.35; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.masthead { background: var(--brand-deep); color: #fff; padding: 20px 0 64px; }
.masthead h1 { font-size: 24px; margin: 0; }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.subtitle { margin: 2px 0 0; opacity: .86; }
.producer { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.producer img { height: 38px; width: auto; background: #fff; border-radius: 6px; padding: 3px; }

.search-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-top: -44px; }
.search-card p { margin: 10px 0 0; }
.profil-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.profil-grid label, .field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink-2); min-width: 0; }
select, input[type="text"], input[type="search"], input[type="email"], input[type="password"], input[type="date"], textarea {
  width: 100%; min-height: 40px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font-weight: 400; font-size: 15px;
}
textarea { resize: vertical; min-height: 84px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 16px 0 12px; }
.tab { border: 0; background: transparent; padding: 8px 12px; border-radius: 8px; cursor: pointer; color: var(--ink-2); font-weight: 600; min-height: 40px; }
.tab:hover { background: var(--surface-2); }
.tab[aria-selected="true"] { background: var(--brand); color: var(--brand-ink); }
.count { font-weight: 400; opacity: .8; font-size: 13px; }

.tab-panel { display: none; padding-bottom: 32px; }
.tab-panel.active { display: block; }
.intro { margin: 0 0 14px; color: var(--ink-2); max-width: 75ch; }
.section { margin: 26px 0 10px; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-width: 0; overflow-wrap: anywhere; }
.card p { margin: 6px 0; }
.card ul { margin: 6px 0; padding-left: 20px; }
.card-accent { border-left: 4px solid var(--brand); }
.row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.meta { color: var(--muted); font-size: 13px; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--brand-soft); color: var(--brand); }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.filters input[type="search"] { flex: 1 1 240px; width: auto; }
.filters select { flex: 0 1 200px; width: auto; }
.toggle { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; min-height: 40px; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 16px; color: var(--ink-2); }
.notice { background: var(--warn-soft); color: var(--ink); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 12px; }

.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 12px; cursor: pointer; font-weight: 600; min-height: 40px; }
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand); filter: brightness(1.08); }
.btn-small { padding: 4px 8px; min-height: 32px; font-size: 13px; }

.steps { counter-reset: s; display: grid; gap: 10px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.step strong { display: block; }

.cv-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.form-stack { display: grid; gap: 10px; }
.cv-output { white-space: pre-wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; font-size: 14px; min-height: 200px; overflow-wrap: anywhere; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 12px; font-weight: 400; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.compare div { padding: 8px 10px; border-radius: 8px; background: var(--surface-2); }
.compare div + div { background: var(--ok-soft); }

.admin-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.admin-row > div:first-child { flex: 1 1 280px; min-width: 0; overflow-wrap: anywhere; }
.error { color: var(--bad); }

footer { border-top: 1px solid var(--line); padding: 16px 0 28px; color: var(--muted); font-size: 13px; }
.prose { max-width: 70ch; padding-top: 24px; padding-bottom: 24px; }

@media (max-width: 800px) {
  .profil-grid, .grid, .cv-layout { grid-template-columns: minmax(0, 1fr); }
  .masthead-inner { flex-direction: column; align-items: flex-start; }
  .compare { grid-template-columns: minmax(0, 1fr); }
}

@media print {
  .masthead, .search-card, .tabs, footer, .no-print, .form-stack { display: none !important; }
  .cv-layout { display: block; }
  .cv-output { border: 0; padding: 0; }
  body { background: #fff; color: #000; }
}
