/* ---------- Дизайн-токени (весела палитра + светла/тъмна тема) ---------- */
/*
  Палитра (вдъхновена от cheerful dashboard accents):
  --cheer-pink   #E11D8F  — данъци
  --cheer-blue   #2563EB  — акцент / нето
  --cheer-purple #7C3AED  — осигуровки
  --cheer-orange #EA580C  — предупреждения / pay
  --cheer-peach  #FDA4AF  — меки фонове
*/
:root {
  --page: #F8FAFC;
  --surface: #FFFFFF;
  --ink: #0F172A;
  --ink-2: #64748B;
  --ink-muted: #64748B;
  --hairline: #E2E8F0;
  --border: rgba(15, 23, 42, 0.10);
  --accent: #2563EB;
  --accent-ink: #ffffff;
  --accent-soft: #DBEAFE;
  --cheer-pink: #E11D8F;
  --cheer-purple: #7C3AED;
  --cheer-orange: #EA580C;
  --cheer-peach: #FDA4AF;
  --series-net: #2563EB;
  --series-tax: #E11D8F;
  --series-sv: #7C3AED;
  --ok: #2563EB;
  --warn: #EA580C;
  --focus: #2563EB;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(37, 99, 235, 0.08);
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #0B1220;
    --surface: #111827;
    --ink: #F8FAFC;
    --ink-2: #94A3B8;
    --ink-muted: #94A3B8;
    --hairline: #1F2937;
    --border: rgba(248, 250, 252, 0.12);
    --accent: #3B82F6;
    --accent-soft: rgba(59, 130, 246, 0.18);
    --series-net: #3B82F6;
    --series-tax: #F472B6;
    --series-sv: #A78BFA;
    --ok: #3B82F6;
    --warn: #FB923C;
    --focus: #3B82F6;
    --shadow: none;
  }
}
:root[data-theme="light"] {
  --page: #F8FAFC;
  --surface: #FFFFFF;
  --ink: #0F172A;
  --ink-2: #64748B;
  --ink-muted: #64748B;
  --hairline: #E2E8F0;
  --border: rgba(15, 23, 42, 0.10);
  --accent: #2563EB;
  --accent-soft: #DBEAFE;
  --series-net: #2563EB;
  --series-tax: #E11D8F;
  --series-sv: #7C3AED;
  --ok: #2563EB;
  --warn: #EA580C;
  --focus: #2563EB;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(37, 99, 235, 0.08);
}
:root[data-theme="dark"] {
  --page: #0B1220;
  --surface: #111827;
  --ink: #F8FAFC;
  --ink-2: #94A3B8;
  --ink-muted: #94A3B8;
  --hairline: #1F2937;
  --border: rgba(248, 250, 252, 0.12);
  --accent: #3B82F6;
  --accent-soft: rgba(59, 130, 246, 0.18);
  --series-net: #3B82F6;
  --series-tax: #F472B6;
  --series-sv: #A78BFA;
  --ok: #3B82F6;
  --warn: #FB923C;
  --focus: #3B82F6;
  --shadow: none;
}

/* ---------- Основа ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: light dark; }
body {
  margin: 0;
  background:
    radial-gradient(900px 420px at 0% -5%, color-mix(in srgb, var(--cheer-peach, #FDA4AF) 28%, transparent), transparent 70%),
    radial-gradient(800px 380px at 100% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 65%),
    var(--page);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  /* дълги немски съставни думи се пренасят според lang атрибута */
  hyphens: auto;
}
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  overflow-x: clip;
}

/* Линкове: акцент в цвят, без подчертаване */
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--ink); }

/* ---------- Header ---------- */
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.brand { display: flex; gap: 14px; align-items: flex-start; }
.brand-mark {
  flex: none;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
}
.brand-mark svg,
.brand-mark img {
  width: 28px;
  height: 28px;
  display: block;
}
/* Един източник на логото — SVG файлът; цветът следва --accent */
.brand-mark--bird {
  background-color: var(--accent-soft);
}
.brand-mark--bird::before {
  content: "";
  width: 34px;
  height: 34px;
  background-color: var(--accent);
  -webkit-mask: url("/assets/logo-swallow.svg") center / contain no-repeat;
  mask: url("/assets/logo-swallow.svg") center / contain no-repeat;
}
.brand h1,
.brand #brand-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 700;
  color: inherit;
}
.subtitle { margin: 4px 0 0; color: var(--ink-2); font-size: 13.5px; max-width: 56ch; }

.topbar-controls { display: flex; gap: 8px; align-items: center; }
.lang-switch {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}
.lang-switch button {
  appearance: none; border: 0; background: transparent;
  padding: 7px 12px;
  font: inherit; font-size: 13px; font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
}
.lang-switch button + button { border-left: 1px solid var(--hairline); }
.lang-switch button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}
.theme-toggle {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 10px;
  width: 34px; height: 34px;
  font-size: 16px;
  cursor: pointer;
}

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 20px;
}

/* ---------- Форма ---------- */
.form-card fieldset {
  border: 0; padding: 0; margin: 0 0 20px;
}
.form-card fieldset:last-child { margin-bottom: 0; }
.form-card legend {
  padding: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 10px;
}
.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px 14px;
}
@media (max-width: 420px) {
  .grid-2 { grid-template-columns: 1fr; }
}
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.label-row {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  min-width: 0;
  overflow-wrap: break-word;
}
/* Еднаква височина за етикетите в grid-2 — иначе къс етикет
   (напр. „Деца под 25 г.“) вдига select-а спрямо двуредовия съсед.
   Не важи за checkbox редовете (пенсия / безработица) — там min-height
   размества кутийката и „i“ спрямо съседния етикет. */
.field:not(.field-check) > .label-row {
  min-height: 38px; /* две линии при 13px — подравнява select-ите в grid-2 */
}
.field:not(.field-check) > .label-row .info {
  margin-top: 1px; /* оптично с първия ред текст */
}
.label-row > label, .label-row > span:first-child { min-width: 0; overflow-wrap: break-word; }
.label-row label { cursor: pointer; }

/* ---------- Тултипове ---------- */
.info { position: relative; display: inline-flex; }
.info-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--page);
  color: var(--ink-muted);
  width: 17px; height: 17px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, serif;
  line-height: 1;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  flex: none;
}
.info-btn:hover, .info-btn:focus-visible, .info.open .info-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  outline: none;
}
.tip {
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(280px, 78vw);
  background: var(--ink);
  color: var(--page);
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.45;
  text-transform: none;
  letter-spacing: normal;
  padding: 9px 12px;
  border-radius: 10px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
  z-index: 50;
  display: none;
  white-space: normal;
  text-align: left;
}
.tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--ink);
}
.info:hover .tip, .info.open .tip, .info-btn:focus-visible + .tip { display: block; }
.tip.edge-left { left: 0; transform: none; }
.tip.edge-left::after { left: 8px; transform: none; }
.tip.edge-right { left: auto; right: 0; transform: none; }
.tip.edge-right::after { left: auto; right: 8px; transform: none; }

/* ---------- Сегментиран превключвател (радио бутони) ---------- */
.segmented {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--page);
}
.segmented label {
  flex: 1;
  position: relative;
  cursor: pointer;
}
.segmented label + label { border-left: 1px solid var(--hairline); }
.segmented input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}
.segmented span {
  display: block;
  text-align: center;
  padding: 9px 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.segmented input:checked + span {
  background: var(--accent);
  color: var(--accent-ink);
}
.segmented input:focus-visible + span {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

/* ---------- Ред-превключвател (switch) за църковния данък ---------- */
.switch-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--page);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 12px 14px;
}
.switch { position: relative; display: inline-block; flex: none; margin-top: 1px; }
.switch input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
  z-index: 1;
}
.switch-track {
  display: block;
  width: 42px; height: 24px;
  border-radius: 12px;
  background: var(--hairline);
  transition: background 0.15s ease;
  position: relative;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease;
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch-text { display: flex; flex-direction: column; gap: 3px; }
.switch-text .label-row { color: var(--ink); font-size: 14px; }
.field input[type="number"], .field select {
  appearance: none;
  width: 100%;
  border: 1px solid var(--border);
  background: var(--page);
  color: var(--ink);
  border-radius: 10px;
  padding: 9px 12px;
  font: inherit;
}
.field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-muted) 50%),
    linear-gradient(135deg, var(--ink-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}
.field input:focus-visible, .field select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
.input-euro { position: relative; }
.input-euro input { padding-right: 30px; }
.input-euro > span {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-muted);
  pointer-events: none;
}
.field-check {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 9px;
  padding-top: 4px;
}
.field-check input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--accent);
  margin: 3px 0 0;
  flex: none;
}
.field-check .label-row {
  color: var(--ink);
  font-size: 13.5px;
  flex: 1;
  min-width: 0;
  flex-wrap: nowrap;
  align-items: flex-start;
  min-height: 0;
}
.field-check .label-row .info {
  margin-top: 1px;
  flex: none;
}
/* Пенсия + безработица: еднакъв горен ръб на десктоп */
.check-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px 14px;
  align-items: start;
}
@media (max-width: 420px) {
  .check-pair { grid-template-columns: 1fr; }
}
.hint { font-size: 12px; color: var(--ink-muted); margin: 0; overflow-wrap: break-word; }

/* ---------- Резултати ---------- */
.results-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}
/* картата с разбивката поема разликата, за да завършват двете колони наравно */
.results-col > .table-card:nth-of-type(2) { flex: 1; }

.hero-card { text-align: left; }
.hero-label {
  margin: 0;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-muted);
}
.hero-value {
  margin: 2px 0 0;
  font-size: 42px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
  min-height: 1.1em;
  font-variant-numeric: tabular-nums;
}
.hero-sub { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; min-height: 1.3em; }

/* пропорционална лента: 2px разстояния върху повърхността между сегментите */
.dist-bar {
  display: flex;
  gap: 3px;
  height: 14px;
  margin-top: 18px;
  border-radius: 7px;
  overflow: hidden;
}
/* без transition на flex-grow — не е композирано и дава „non-composited animations“ в Lighthouse */
.seg { min-width: 0; }
.seg-net { background: var(--series-net); border-radius: 7px 0 0 7px; }
.seg-tax { background: var(--series-tax); border-radius: 2px; }
.seg-sv { background: var(--series-sv); border-radius: 0 7px 7px 0; }

.legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  padding: 0;
  margin: 12px 0 0;
}
.legend li { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); }
.legend strong { color: var(--ink); font-weight: 600; }
.chip { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.chip-net { background: var(--series-net); }
.chip-tax { background: var(--series-tax); }
.chip-sv { background: var(--series-sv); }

.notes { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.note {
  font-size: 12.5px;
  color: var(--ink-2);
  background: var(--page);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 8px 12px;
  margin: 0;
}

/* ---------- Таблица ---------- */
.card-title {
  margin: 0 0 10px;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-muted);
}
.table-card { padding: 14px 20px; }
.results-table { width: 100%; border-collapse: collapse; }
.results-table th, .results-table td {
  text-align: right;
  padding: 7px 0 7px 12px;
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid var(--hairline);
  font-size: 14px;
}
.results-table th:first-child, .results-table td:first-child {
  text-align: left;
  padding-left: 0;
  color: var(--ink-2);
  overflow-wrap: break-word;
  word-break: break-word;
}
.results-table .label-row { font-weight: inherit; color: inherit; font-size: inherit; }
.card-title .label-row { font-size: inherit; color: inherit; text-transform: none; letter-spacing: normal; }
.card-title .label-row > span:first-child { text-transform: uppercase; letter-spacing: 0.06em; }
.results-table thead th {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.results-table tr:last-child td { border-bottom: 0; }
.row-group td {
  padding-top: 14px;
  font-size: 11.5px !important;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-muted) !important;
  border-bottom: 0 !important;
}
.row-sum td { font-weight: 600; color: var(--ink); }
.row-sum td:first-child { color: var(--ink); }
.row-strong td { font-weight: 600; color: var(--ink) !important; }
.row-net td {
  font-weight: 700;
  font-size: 15px;
  color: var(--ink) !important;
  border-top: 2px solid var(--ink);
  border-bottom: 0;
}

/* ---------- Методика / доверие ---------- */
.method-card .method-list {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  color: var(--ink-2);
  font-size: 14.5px;
  max-width: 90ch;
}
.method-card .method-list li {
  position: relative;
  margin: 0 0 6px;
  padding-left: 1.35em;
  line-height: 1.45;
}
.method-card .method-list li:last-child { margin-bottom: 0; }
.method-card .method-list li::before {
  content: "•";
  position: absolute;
  left: 0.35em;
  color: var(--ink-muted);
  font-weight: 700;
}

/* ---------- SEO / FAQ секция ---------- */
.seo-card {
  margin-top: 20px;
  max-width: 100%;
}
.seo-card h2 {
  margin: 0 0 10px;
  font-size: 19px;
  line-height: 1.3;
}
.seo-card h2 + p { margin-top: 0; }
.seo-card > h2:not(:first-child) { margin-top: 26px; }
.seo-card p {
  margin: 0 0 12px;
  color: var(--ink-2);
  font-size: 14.5px;
  max-width: 90ch;
}
.seo-card details {
  border-bottom: 1px solid var(--hairline);
}
.seo-card details:last-child { border-bottom: 0; }
.seo-card summary {
  cursor: pointer;
  padding: 12px 0 12px 1.25em;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--ink);
  list-style: none;
  position: relative;
}
.seo-card summary::-webkit-details-marker { display: none; }
.seo-card summary::marker { content: ""; }
.seo-card summary::before {
  content: "▸";
  position: absolute;
  left: 0.2em;
  top: 12px;
  color: var(--ink);
  font-size: 0.95em;
  line-height: 1.45;
  transition: transform 0.15s ease;
}
.seo-card details[open] > summary::before {
  transform: rotate(90deg);
}
.seo-card summary:hover { color: var(--accent); }
.seo-card summary:hover::before { color: var(--accent); }
.seo-card details p { padding: 0 0 14px 1.25em; margin: 0; }

/* Десктоп: повече въздух между левия ръб на картата и маркерите */
@media (min-width: 861px) {
  .seo-card {
    padding-left: 28px;
    padding-right: 28px;
  }
  .method-card .method-list li {
    padding-left: 1.85em;
  }
  .method-card .method-list li::before {
    left: 0.7em;
  }
  .seo-card summary {
    padding-left: 1.75em;
  }
  .seo-card summary::before {
    left: 0.6em;
  }
  .seo-card details p,
  .seo-card details p.faq-more {
    padding-left: 1.75em;
  }
}

.seo-card details p.faq-more {
  padding-top: 0;
  padding-bottom: 14px;
  font-size: 13.5px;
}
.faq-more a {
  color: var(--accent);
  font-weight: 600;
}

/* ---------- Популярни брутни суми ---------- */
.amounts-card { margin-top: 20px; }
.amounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.amount-chip {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  padding: 12px 14px;
  background: var(--page);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.amount-chip:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
  color: var(--accent);
}

/* Бърз избор под полето за бруто (hero CTA) */
.offer-cta {
  margin: 10px 0 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.offer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.offer-chip {
  border: 1px solid var(--hairline);
  background: var(--page);
  color: var(--ink);
  border-radius: 8px;
  padding: 7px 10px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.offer-chip:hover,
.offer-chip:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}
.offer-chip:active {
  background: var(--accent-soft);
}
.amount-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 2px;
  margin: 8px 0 0;
}
.amount-links a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.amount-links a:hover { text-decoration: underline; }

/* ---------- Статии / ръководства на главната страница ---------- */
.guides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.guide-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px;
  background: var(--page);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.guide-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.guide-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
}
.guide-card:hover .guide-title { color: var(--accent); }
.guide-desc {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-2);
}
.guide-more {
  margin-top: auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}
.guide-more::after {
  content: " →";
  display: inline-block;
  transition: transform 0.15s ease;
}
.guide-card:hover .guide-more::after { transform: translateX(3px); }
.guide-card-tool { border-style: dashed; }
.guide-card-tool:hover { border-style: solid; }

/* ---------- Сравнение на данъчни класове ---------- */
.vgl-head h2 { margin: 0 0 8px; font-size: 22px; line-height: 1.3; }
.vgl-intro { margin: 0 0 18px; color: var(--ink-2); font-size: 14.5px; max-width: 90ch; }
.vgl-form fieldset { margin-bottom: 0; }
.vgl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.combo-card { display: flex; flex-direction: column; }
.combo-card h3 {
  margin: 0 0 12px;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-muted);
}
.combo-rows { display: flex; flex-direction: column; }
.combo-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 14px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.combo-row strong { color: var(--ink); font-weight: 600; }
.combo-total-label {
  margin: 14px 0 0;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-muted);
}
.combo-total {
  margin: 2px 0 0;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.combo-delta {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}
.combo-delta.delta-plus { color: var(--series-tax); font-weight: 600; }
.settlement {
  margin: 12px 0 0;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.settle-refund { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); }
.settle-pay { background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.settle-even { background: var(--page); color: var(--ink-2); border: 1px solid var(--hairline); }
.combo-tags {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--ink-muted);
}
.vgl-assumptions { margin-top: 14px; max-width: 90ch; }

.footer { margin-top: 28px; max-width: 90ch; }

/* Линкове към правните страници */
.footer-links {
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--ink-muted);
}
.footer-links a {
  color: var(--ink-muted);
  text-decoration: none;
}
.footer-links a:hover { color: var(--accent); }
.footer-links .sep { margin: 0 6px; user-select: none; }

/* Small publisher imprint (name + address) at end of page */
.publisher-imprint {
  margin: 14px 0 0;
  color: var(--ink-muted);
  font-size: 11.5px;
  line-height: 1.45;
  letter-spacing: 0.01em;
}
.legal-page .publisher-imprint {
  color: var(--ink-muted);
  font-size: 11.5px;
  line-height: 1.45;
  margin-top: 18px;
}
.publisher-imprint a {
  color: var(--ink-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.publisher-imprint a:hover { color: var(--accent); }

/* ---------- Правни страници ---------- */
.legal-page { max-width: 760px; margin: 0 auto; }
.legal-page h1 { margin: 0 0 6px; font-size: 22px; line-height: 1.3; }
.legal-page h2 { margin: 0 0 6px; font-size: 22px; line-height: 1.3; }
.legal-page h3 { margin: 22px 0 8px; font-size: 16px; line-height: 1.35; }
/* When the article title is H1, section headings (H2) use the body-section size */
.legal-page:has(> [data-lang-section] > h1) h2,
.legal-page:has(h1.page-title) h2 {
  margin: 22px 0 8px;
  font-size: 16px;
  line-height: 1.35;
}
.legal-page p, .legal-page li { color: var(--ink-2); font-size: 14.5px; }
.legal-page p { margin: 0 0 12px; }
.legal-page ul { margin: 0 0 12px; padding-left: 22px; }
.legal-page li { margin: 4px 0; }
.legal-page .updated { color: var(--ink-muted); font-size: 12.5px; margin-bottom: 18px; }

.page-meta {
  margin: 8px 0 16px;
  color: var(--ink-muted);
  font-size: 12.5px;
  line-height: 1.5;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  align-items: baseline;
}
.page-meta a { color: var(--accent); }
.page-meta .meta-sep { margin: 0 8px; opacity: 0.55; }
.page-meta time { font-variant-numeric: tabular-nums; }

/* Google Preferred Sources button (publisher.js) */
.preferred-source {
  margin: -4px 0 18px;
  min-height: 40px;
}
.preferred-source-link {
  display: inline-block;
  font-size: 13.5px;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.eeat-box {
  margin: 22px 0 8px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}
.eeat-box p { margin: 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.55; }
.eeat-box a { color: var(--accent); }
.card.eeat-box { margin: 16px 0 0; }


.official-sources {
  margin: 16px 0 8px;
  padding-left: 1.2em;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.55;
}
.official-sources li { margin: 0.35em 0; }
.official-sources a { color: var(--accent); }
p.official-sources {
  padding-left: 0;
  list-style: none;
}

.author-box {
  margin: 20px 0 8px;
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}
.author-box p { margin: 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.55; }
.legal-page details {
  margin: 8px 0;
  padding: 8px 0;
  border-bottom: 1px solid var(--hairline);
}
.legal-page details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
  font-size: 14px;
}
.legal-page details p { margin: 8px 0 4px; }

.article-figure {
  margin: 14px 0 18px;
  max-width: 640px;
}
.article-figure--tall { max-width: 720px; }
.article-figure a { display: block; }
.article-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.article-figure figcaption {
  margin-top: 8px;
  color: var(--ink-muted);
  font-size: 12.5px;
  line-height: 1.45;
}
.article-figure figcaption a { display: inline; }
.article-figure--diagram {
  max-width: none;
  width: 100%;
}
.article-figure--diagram .diagram-frame {
  display: block;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: visible;
  background: #0F172A;
  box-shadow: var(--shadow);
}
.article-figure--diagram .diagram-frame img,
.article-figure--diagram .diagram-frame object,
.article-figure--diagram .diagram-frame svg {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 0;
  border-radius: 14px;
}
@media (max-width: 640px) {
  /* Break out of card padding so the tall diagram uses full phone width */
  .article-figure--diagram {
    margin-left: -14px;
    margin-right: -14px;
    width: calc(100% + 28px);
  }
  .article-figure--diagram .diagram-frame {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  .article-figure--diagram .diagram-frame img {
    border-radius: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .article-figure--diagram .diagram-frame {
    box-shadow: none;
  }
}
.legal-page a { color: var(--accent); }
.legal-page table { border-collapse: collapse; width: 100%; margin: 0 0 12px; }
.legal-page th, .legal-page td {
  text-align: left;
  padding: 7px 10px;
  border-bottom: 1px solid var(--hairline);
  font-size: 13.5px;
  color: var(--ink-2);
}
.legal-page th { color: var(--ink); font-weight: 600; }

.contact { margin-bottom: 14px; }
.contact strong { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-muted); }
.contact a { color: var(--accent); }

/* Красив CTA бутон-линк за контакт */
.contact-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--surface);
  color: var(--accent) !important;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  transition: all 0.15s;
  margin-top: 6px;
}
.contact-cta:hover {
  background: var(--accent);
  color: var(--accent-ink) !important;
  border-color: var(--accent);
}

/* CTA блок в статии (Kindergeld и др.) — задържа bounce трафик към калкулатора */
.article-cta {
  margin: 1.25rem 0 0.5rem;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--accent-soft);
}
.article-cta-lead {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.45;
}
.article-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}
.article-cta .contact-cta {
  margin-top: 0;
}

/* Свързани ръководства в края на статиите */
.article-related {
  margin: 1.35rem 0 0.25rem;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.article-related p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink-2);
}
.article-related strong {
  color: var(--ink);
  font-weight: 600;
}
.article-related .sep {
  color: var(--ink-muted);
}

/* Kindergeld: квиз + мини-калкулатор (задържане на bounce трафик) */
.kg-engage {
  margin: 1.1rem 0 1.4rem;
}
.kg-engage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 820px) {
  .kg-engage-grid { grid-template-columns: 1fr; }
}
.kg-panel {
  margin: 0;
  padding: 14px 16px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent-soft) 55%, transparent);
}
.kg-panel h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  line-height: 1.3;
}
.kg-lead {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: var(--ink-2);
  line-height: 1.45;
}
.kg-q {
  margin: 0 0 10px;
  padding: 0;
  border: 0;
}
.kg-q legend {
  padding: 0;
  margin: 0 0 6px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
}
.kg-choice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 10px 6px 0;
  font-size: 0.9rem;
  cursor: pointer;
}
.kg-result {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.92rem;
  line-height: 1.45;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  color: var(--ink);
}
.kg-result[data-tone="warn"] {
  background: color-mix(in srgb, #f59e0b 14%, transparent);
}
.kg-result[data-tone="info"] {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.kg-fields {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}
.kg-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}
.kg-field select,
.kg-field input {
  appearance: none;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  background: var(--card, #fff);
}
.kg-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.kg-out {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 8px;
}
.kg-out-value {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.15;
}
.kg-out-label {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--ink-2);
}
.kg-hint {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: var(--ink-2);
  line-height: 1.4;
}
.kg-calc-actions { margin: 0 0 8px; }
.kg-calc-actions .contact-cta { margin-top: 0; }
.kg-disclaimer {
  margin: 0;
  font-size: 0.75rem;
  color: var(--ink-muted);
  line-height: 1.35;
}

/* ---------- Contact form ---------- */
.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  margin-top: 12px;
  max-width: 640px;
}
.contact-form .form-field { display: flex; flex-direction: column; gap: 4px; }
.contact-form .form-field-wide { grid-column: 1 / -1; }
.contact-form label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}
.contact-form input,
.contact-form textarea {
  appearance: none;
  width: 100%;
  border: 1px solid var(--border);
  background: var(--page);
  color: var(--ink);
  border-radius: 10px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.45;
}
.contact-form textarea {
  resize: vertical;
  min-height: 90px;
}
.contact-form input:focus-visible,
.contact-form textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
.contact-form button {
  appearance: none;
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 20px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  justify-self: start;
  transition: background 0.15s;
}
.contact-form button:hover { background: var(--ink); }
.contact-form button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Honeypot — скрит от хора, ботовете го попълват */
.contact-form .hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  grid-column: 1 / -1;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  margin: 4px 0 0;
}
.form-status[data-state="success"] {
  background: rgba(27, 175, 122, 0.12);
  color: #0d6d4b;
  border: 1px solid rgba(27, 175, 122, 0.3);
}
.form-status[data-state="error"] {
  background: rgba(220, 53, 69, 0.08);
  color: #b02a37;
  border: 1px solid rgba(220, 53, 69, 0.25);
}
@media (max-width: 500px) {
  .contact-form { grid-template-columns: 1fr; }
}
