/* TakiTax — main theme styles */
:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --success: #059669;
  --danger: #dc2626;
  --bg: #f1f5f9;
  --card: #fff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --chrome: #e8eef5;
  --tab: #dbe4f0;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 10px 28px rgba(15,23,42,.06);
  --font: Inter, system-ui, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
a { color: var(--primary); }
.skip-link {
  position: absolute; left: -9999px;
}
.skip-link:focus { left: 1rem; top: 1rem; z-index: 100; background: #fff; padding: .5rem 1rem; }

.site-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
}
.site-header__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-title, .site-branding a {
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -.02em;
}
.site-branding img:not(.site-brand__logo) { max-height: 40px; width: auto; }
.menu--primary {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .75rem;
}
.menu--primary a {
  color: rgba(255,255,255,.92);
  text-decoration: none;
  font-weight: 600;
  font-size: .9rem;
  padding: .35rem .55rem;
  border-radius: 8px;
}
.menu--primary a:hover,
.menu--primary .current-menu-item > a {
  background: rgba(255,255,255,.15);
  color: #fff;
}
.nav-toggle { display: none; }

.site-main { min-height: 60vh; }
.content-wrap {
  max-width: 800px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}
.page-hero h1 { margin: 0 0 .35rem; font-size: clamp(1.6rem, 3vw, 2rem); letter-spacing: -.02em; }
.page-hero__lead, .page-hero__meta { color: var(--muted); margin: 0 0 1.25rem; }
.prose .entry-content { font-size: 1.05rem; }
.post-list { display: grid; gap: 1rem; }
.post-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow);
}
.post-card__title { margin: 0 0 .35rem; font-size: 1.15rem; }
.post-card a { text-decoration: none; color: inherit; }
.post-card__meta { color: var(--muted); font-size: .85rem; margin: 0 0 .5rem; }
.post-card__excerpt { color: var(--muted); font-size: .95rem; }

.site-footer {
  border-top: 1px solid var(--border);
  background: #fff;
  margin-top: 2rem;
}
.site-footer__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 20px;
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
}
.menu--footer {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .75rem 1.25rem;
  padding: 0;
  margin: 0 0 1rem;
}
.menu--footer a { color: var(--muted); text-decoration: none; font-weight: 600; }
.site-footer__legal { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.25rem; margin: 0 0 .75rem; }
.site-footer__legal a,
.site-footer__privacy-settings { color: var(--muted); text-decoration: underline; font: inherit; font-size: .85rem; }
.site-footer__privacy-settings { background: none; border: 0; padding: 0; cursor: pointer; }
.site-footer__privacy-settings[hidden] { display: none; }
.site-footer__disclaimer { max-width: 40rem; margin: .5rem auto 0; font-size: .78rem; opacity: .85; }

/* —— Calculator shell / browser tabs —— */
.calc-shell {
  max-width: 1260px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}
.calc-shell__intro h1 {
  margin: 0 0 .35rem;
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  letter-spacing: -.02em;
}
.calc-shell__lead { margin: 0 0 1.25rem; color: var(--muted); max-width: 40rem; }

.browser-frame {
  background: var(--chrome);
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid #cfd8e6;
  overflow: visible;
}
.browser-chrome {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 10px 10px 0;
  background: linear-gradient(#edf2f7, var(--chrome));
  overflow-x: auto;
}
.browser-tab {
  appearance: none;
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .82rem;
  font-weight: 600;
  padding: 10px 14px 12px;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  max-width: 220px;
}
.browser-tab:hover { background: rgba(255,255,255,.45); color: var(--text); }
.browser-tab.is-active {
  background: #fff;
  color: var(--text);
  border-color: #cfd8e6;
  box-shadow: 0 -1px 0 #fff;
  position: relative;
  z-index: 1;
}
.browser-tab.is-soon { opacity: .75; }
.browser-tab__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #94a3b8; flex-shrink: 0;
}
.browser-tab.is-active .browser-tab__dot { background: var(--success); }
.browser-tab__badge {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: #fef3c7;
  color: #92400e;
  padding: 2px 6px;
  border-radius: 999px;
}
.browser-chrome__spacer { flex: 1; min-width: 12px; }

.browser-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.browser-address {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: .8rem;
  color: var(--muted);
  min-width: min(100%, 280px);
  flex: 1;
}
.year-switch {
  display: inline-flex;
  gap: 4px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 999px;
}
.year-switch__btn {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 700;
  font-size: .85rem;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted);
}
.year-switch__btn.is-active {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: 0 1px 3px rgba(15,23,42,.08);
}

.browser-panel {
  display: none;
  background: #fff;
  padding: 16px;
}
.browser-panel.is-active { display: block; }

.calc-soon {
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--muted);
}
.calc-soon h2 { color: var(--text); margin-top: 0; }
.calc-soon__note { font-size: .9rem; }

@media (max-width: 720px) {
  .nav-toggle {
    display: inline-flex;
    appearance: none;
    border: 1px solid rgba(255,255,255,.35);
    background: rgba(255,255,255,.12);
    color: #fff;
    border-radius: 8px;
    padding: .4rem .7rem;
    font-weight: 600;
  }
  .site-nav .menu--primary { display: none; }
  .site-nav.is-open .menu--primary {
    display: flex;
    flex-direction: column;
    position: absolute;
    right: 16px;
    top: 56px;
    background: #fff;
    color: var(--text);
    padding: .75rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    z-index: 20;
    min-width: 200px;
  }
  .site-nav.is-open .menu--primary a { color: var(--text); }
  .site-nav { position: relative; }
}


/* Branding base — sizes overridden in Top bar section */
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
}
.site-brand__name {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -.02em;
}

/* Mobile overflow fixes — keep card frames fully visible */
html {
  max-width: 100%;
  overflow-x: clip;
}
body {
  max-width: 100%;
  overflow-x: visible;
  overflow-y: visible;
}
.calc-shell,
.browser-frame,
.browser-panel,
.jdg-calc,
.jdg-results,
.zus-calc,
.uop-calc,
.cards,
.card,
.chart-box {
  max-width: 100%;
  min-width: 0;
}
.browser-frame {
  overflow: visible;
}
.browser-panel {
  padding: 12px;
  overflow-x: auto;
}
.browser-toolbar {
  flex-wrap: wrap;
}
.browser-address {
  min-width: 0;
  flex: 1 1 100%;
  max-width: 100%;
}
.cards {
  width: 100%;
}
.card {
  width: 100%;
  box-sizing: border-box;
  overflow: visible;
}
.card.winner {
  /* keep badge visible without clipping parent */
  margin-top: 8px;
}
.row, .total, .zus-row {
  gap: 10px;
}
.row span:last-child,
.total span:last-child,
.zus-row span:last-child {
  flex-shrink: 0;
  text-align: right;
}
.chart-box {
  overflow: hidden;
}
.site-header__inner {
  /* keep within --site-max; do not stretch to full viewport */
  flex-wrap: nowrap;
}
.site-branding {
  min-width: 0;
  max-width: 100%;
}
@media (max-width: 600px) {
  .calc-shell {
    padding: 16px 10px 28px;
  }
  .browser-panel {
    padding: 10px;
  }
  .card {
    padding: 14px 10px;
  }
}

a.browser-tab {
  text-decoration: none;
  color: inherit;
}
a.browser-tab:visited { color: inherit; }
.page-hero--in-panel {
  margin-bottom: 1rem;
}
.page-hero--in-panel h1 {
  margin: 0 0 .35rem;
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
}
.browser-panel.prose,
.browser-panel .post-list {
  max-width: 100%;
}

/* Match first preferred screenshot (~1080px), keep card rows on one line */
.calc-shell {
  max-width: 1260px;
}
.jdg-calc__grid {
  grid-template-columns: minmax(260px, 1fr) minmax(0, 1.55fr);
}
.card {
  padding: 16px 12px;
}
.cards {
  gap: 12px;
}
.row,
.total {
  flex-wrap: nowrap;
  gap: 8px;
}
.row span:first-child,
.total span:first-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.row span:last-child,
.total span:last-child {
  white-space: nowrap;
  flex-shrink: 0;
}
.net-sub {
  white-space: nowrap;
}
.chart-box {
  width: 100%;
  max-width: none;
  height: 300px;
  margin-left: 0;
  margin-right: 0;
}


/* —— Top bar (WP.pl-inspired: icons above labels) —— */
:root {
  --site-max: 1260px;
  --header-bg: #1e3a8a;
  --header-bg-2: #1e40af;
  --logo-size: 112px;
  --header-h: 52px;
}
.site-header {
  background: var(--header-bg);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
  overflow: visible;
  position: relative;
  z-index: 50;
  /* short bar — logo hangs below into white */
  min-height: var(--header-h);
}
.site-header__inner {
  width: 100%;
  max-width: var(--site-max);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  height: var(--header-h);
  min-height: var(--header-h);
  overflow: visible;
  flex-wrap: nowrap;
  box-sizing: border-box;
}
.site-branding {
  position: relative;
  z-index: 5;
  overflow: visible;
  flex-shrink: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
}
.site-brand {
  display: flex;
  align-items: center;
  /* reserve horizontal room for absolutely positioned logo */
  padding-left: calc(var(--logo-size) + 14px);
  height: var(--header-h);
  text-decoration: none;
  color: #fff;
  flex-shrink: 0;
  position: relative;
  overflow: visible;
}
.site-brand__logo {
  position: absolute;
  left: 0;
  top: 4px;
  width: var(--logo-size) !important;
  height: var(--logo-size) !important;
  max-height: none !important;
  border-radius: 20px;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .28);
  z-index: 6;
  margin: 0;
}
.site-brand__text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.15;
  margin: 0;
  padding: 0;
}
.site-brand__name {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -.02em;
}
.site-brand__tag {
  font-size: .65rem;
  font-weight: 600;
  opacity: .75;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.site-main {
  overflow: visible;
  position: relative;
  z-index: 1;
}
/* Title sits beside hanging logo (not below it) */
.site-main > .calc-shell {
  padding-top: 6px;
}
@media (min-width: 901px) {
  .calc-shell__intro {
    padding-left: calc(var(--logo-size) + 12px);
    min-height: calc(var(--logo-size) - var(--header-h) + 8px);
    display: flex;
    align-items: center;
    margin: 0 0 14px;
  }
  .calc-shell__intro h1 {
    margin: 0;
    overflow: visible;
    line-height: 1.2;
  }
  .site-main > .calc-shell > .page-hero {
    padding-left: calc(var(--logo-size) + 12px);
    min-height: calc(var(--logo-size) - var(--header-h) + 8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-top: 0;
  }
}
.top-nav {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  position: relative;
}
.top-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 2px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
}
.top-nav__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 64px;
  padding: 4px 8px;
  color: rgba(255,255,255,.92);
  text-decoration: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: .72rem;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.top-nav__icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: #fff;
}
.top-nav__icon svg {
  width: 24px;
  height: 24px;
  display: block;
}
.top-nav__label {
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-nav__link:hover {
  background: rgba(255,255,255,.12);
  color: #fff;
}
.top-nav__item.is-active .top-nav__link,
.top-nav__link[aria-current="page"] {
  background: rgba(255,255,255,.18);
  color: #fff;
  box-shadow: inset 0 -2px 0 #93c5fd;
}
.nav-toggle {
  display: none;
  appearance: none;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.1);
  color: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 700;
  font-size: .8rem;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.nav-toggle__bars {
  width: 16px;
  height: 12px;
  border-top: 2px solid #fff;
  border-bottom: 2px solid #fff;
  box-shadow: 0 -5px 0 #fff;
  background: transparent;
  display: inline-block;
}
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .top-nav__list {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 40;
    background: #fff;
    color: var(--text);
    padding: 10px;
    border-radius: 14px;
    box-shadow: var(--shadow);
    flex-wrap: wrap;
    justify-content: flex-start;
    max-width: min(92vw, 420px);
    overflow: visible;
  }
  .top-nav.is-open .top-nav__list { display: flex; }
  .top-nav__link {
    color: var(--text);
    min-width: 88px;
  }
  .top-nav__icon { color: var(--primary); }
  .top-nav__item.is-active .top-nav__link,
  .top-nav__link[aria-current="page"] {
    background: #eff6ff;
    box-shadow: none;
    color: var(--primary-dark);
  }
  .site-brand__tag { display: none; }
  :root {
    --logo-size: 72px;
    --header-h: 48px;
  }
  .site-brand { padding-left: calc(var(--logo-size) + 10px); }
  .site-brand__logo { border-radius: 14px; top: 4px; }
  .site-main > .calc-shell {
    padding-top: calc(var(--logo-size) - var(--header-h) + 12px);
  }
  .calc-shell__intro,
  .site-main > .calc-shell > .page-hero {
    padding-left: 0;
    min-height: 0;
    margin-top: 0;
    display: block;
  }
}

/* Align site containers with WP.pl-like content width */
.calc-shell,
.site-footer__inner {
  width: 100%;
  max-width: var(--site-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 16px;
  padding-right: 16px;
  box-sizing: border-box;
}
.content-wrap {
  width: 100%;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 16px;
  padding-right: 16px;
  box-sizing: border-box;
}

/* —— Jak liczymy tables —— */
.jak-wrap {
  max-width: 960px;
}
.jak-lead {
  color: var(--muted);
  margin: 0 0 1.25rem;
  font-size: 1.02rem;
}
.jak-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 0 0 1.5rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}
.jak-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: .95rem;
  line-height: 1.45;
}
.jak-table th,
.jak-table td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.jak-table thead th {
  background: #eff6ff;
  color: #1e3a8a;
  font-weight: 700;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  border-bottom: 1px solid #bfdbfe;
  position: sticky;
  top: 0;
}
.jak-table th:not(:last-child),
.jak-table td:not(:last-child) {
  border-right: 1px solid var(--border);
}
.jak-table tbody tr:nth-child(even) td {
  background: #f8fafc;
}
.jak-table tbody tr:last-child td {
  border-bottom: none;
}
.jak-table th:first-child,
.jak-table td:first-child {
  width: 22%;
  font-weight: 700;
  color: #0f172a;
  background: #f1f5f9;
}
.jak-table tbody tr:nth-child(even) td:first-child {
  background: #e2e8f0;
}
.jak-table th:nth-child(2),
.jak-table td:nth-child(2),
.jak-table th:nth-child(3),
.jak-table td:nth-child(3) {
  width: 39%;
}
.jak-list {
  margin: 0 0 1.25rem;
  padding-left: 1.2rem;
  line-height: 1.55;
  color: #334155;
}
.jak-list li { margin: 0 0 .4rem; }
.jak-foot {
  margin: 1.5rem 0 0;
  font-size: .88rem;
  color: var(--muted);
}
@media (max-width: 700px) {
  .jak-table {
    table-layout: auto;
    min-width: 560px;
  }
  .jak-table th,
  .jak-table td {
    padding: 10px 12px;
    font-size: .9rem;
  }
}
/* Generic prose tables (fallback) */
.prose table,
.entry-content table,
.calc-shell.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.25rem;
  font-size: .95rem;
}
.prose table th,
.prose table td,
.entry-content table th,
.entry-content table td,
.calc-shell.prose table th,
.calc-shell.prose table td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.prose table th,
.entry-content table th,
.calc-shell.prose table th {
  background: #eff6ff;
  font-weight: 700;
}

/* —— Language switcher (flag dropdown, outside scrolling nav) —— */
.top-nav {
  align-items: center;
  gap: 8px;
}
.lang-switcher {
  position: relative;
  flex-shrink: 0;
  z-index: 90;
}
.lang-switcher__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  margin: 0;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1;
  white-space: nowrap;
}
.lang-switcher__btn:hover,
.lang-switcher.is-open .lang-switcher__btn {
  background: rgba(255,255,255,.16);
  border-color: rgba(255,255,255,.35);
}
.lang-switcher__flag {
  display: inline-flex;
  line-height: 0;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(15,23,42,.12);
}
.lang-switcher__flag .lang-flag {
  display: block;
  width: 22px;
  height: 15px;
}
.lang-switcher__code {
  font-weight: 800;
}
.lang-switcher__caret {
  width: 0;
  height: 0;
  margin-left: 1px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: .85;
}
.lang-switcher.is-open .lang-switcher__caret {
  transform: rotate(180deg);
}
.lang-switcher__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 100;
  min-width: 168px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  color: #0f172a;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(15, 23, 42, 0.06);
  overflow: visible;
  max-height: none;
}
.lang-switcher__menu[hidden] {
  display: none !important;
}
.lang-switcher__menu li {
  margin: 0;
  padding: 0;
  list-style: none;
}
.lang-switcher__option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.lang-switcher__option:hover,
.lang-switcher__option:focus-visible {
  background: #eff6ff;
  color: #1d4ed8;
  outline: none;
}
.lang-switcher__option.is-active {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
}
.lang-switcher__name {
  white-space: nowrap;
}

/* —— Mobile / tablet header (1.6.7) ——
   One row that never wraps: [logo + name] ……… [lang] [Menu].
   Both controls are 40px high and vertically centred in a 56px bar; the logo still
   hangs below the bar onto the white content. The language switcher stays in the bar
   when the menu is open (it used to become a full-width row and push "Menu" off-screen). */
@media (max-width: 900px) {
  :root {
    --header-h: 56px;
    --logo-size: 72px;
  }
  .site-header__inner {
    gap: 10px;
    padding: 0 12px 0 16px;
  }
  .site-branding {
    flex: 0 1 auto;
    min-width: 0;
  }
  .site-brand,
  .site-brand__text {
    min-width: 0;
  }
  .site-brand__text { overflow: hidden; }
  .site-brand__name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .top-nav {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    height: var(--header-h);
  }
  .lang-switcher {
    order: 0;
    margin: 0;
  }
  .lang-switcher__btn { height: 40px; }
  .nav-toggle {
    order: 1;
    flex-shrink: 0;
    height: 40px;
    min-width: 40px;
    padding: 0 12px;
    justify-content: center;
    line-height: 1;
    white-space: nowrap;
    border-radius: 10px;
    font-size: .8rem;
  }
  .top-nav__list { top: calc(100% + 4px); }
  /* full labels in the mobile dropdown (88px cap is for the desktop bar only) */
  .top-nav__list .top-nav__label { max-width: none; }
}
/* Hamburger: three 2px bars inside a 16×12 box (the old box-shadow drew the top bar 5px outside the box). */
.nav-toggle__bars {
  width: 16px;
  height: 12px;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  box-shadow: none;
  background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat;
  flex-shrink: 0;
}
/* Narrow phones: icon-only Menu button (label kept for screen readers). */
@media (max-width: 400px) {
  .nav-toggle { width: 40px; padding: 0; }
  .nav-toggle__label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
  .lang-switcher__btn { padding: 0 9px; gap: 5px; }
}
@media (max-width: 340px) {
  :root { --logo-size: 64px; }
  .site-header__inner { gap: 8px; padding: 0 10px 0 12px; }
  .site-brand { padding-left: calc(var(--logo-size) + 8px); }
  .site-brand__name { font-size: 1rem; }
  .top-nav { gap: 6px; }
}

/* —— 1.6.8: single news post hero beside the hanging logo (was overlapped on desktop) —— */
@media (min-width: 901px) {
  .site-main > .calc-shell > article > .page-hero:first-child {
    padding-left: calc(var(--logo-size) + 12px);
    min-height: calc(var(--logo-size) - var(--header-h) + 8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-top: 0;
  }
  .site-main > .calc-shell > article > .page-hero:first-child .page-hero__meta { margin-bottom: .35rem; }
}

/* —— 1.6.8: news illustrations —— */
.post-card--thumb {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 1.1rem 1.25rem;
  align-items: start;
}
.post-card__media { display: block; border-radius: 12px; overflow: hidden; line-height: 0; background: #1e3a8a; }
.post-card__img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; transition: transform .2s ease; }
.post-card__media:hover .post-card__img { transform: scale(1.03); }
.post-card__body { min-width: 0; }
.post-card__body .post-card__excerpt p { margin: 0; }
@media (max-width: 600px) {
  .post-card--thumb { grid-template-columns: 132px minmax(0, 1fr); gap: .75rem .85rem; padding: .85rem; }
  .post-card--thumb .post-card__title { font-size: 1rem; line-height: 1.3; }
  .post-card--thumb .post-card__excerpt { display: none; }
  .post-card--thumb .post-card__meta { margin-bottom: 0; }
}
@media (max-width: 340px) {
  .post-card--thumb { grid-template-columns: 104px minmax(0, 1fr); }
}
.news-hero-img { margin: .25rem 0 1.5rem; max-width: 880px; }
.news-hero-img img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; border-radius: 16px; box-shadow: var(--shadow); background: #1e3a8a; }
.prose .entry-content a[target="_blank"] { text-decoration: underline; text-underline-offset: 2px; }

/* —— 1.6.9: square news images (smaller list thumbs, modest single-post image) —— */
.post-card--thumb { grid-template-columns: 112px minmax(0, 1fr); gap: .9rem 1.15rem; }
.post-card__media { border-radius: 12px; width: 112px; }
.post-card__img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; }
.news-hero-img { float: right; width: 300px; max-width: 42%; margin: .35rem 0 1.25rem 1.75rem; }
.news-hero-img img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 16px; }
.news-hero-img + .entry-content::after { content: ""; display: block; clear: both; }
@media (max-width: 600px) {
  .post-card--thumb { grid-template-columns: 80px minmax(0, 1fr); gap: .7rem .85rem; }
  .post-card__media { width: 80px; border-radius: 10px; }
  .post-card--thumb .post-card__excerpt { display: none; }
  .news-hero-img { float: none; width: 180px; max-width: 60%; margin: .1rem 0 1.1rem; }
  .news-hero-img img { border-radius: 14px; }
}
@media (max-width: 340px) {
  .post-card--thumb { grid-template-columns: 72px minmax(0, 1fr); }
  .post-card__media { width: 72px; }
}

/* —— 1.7.0: calculator tab bar scroll affordance —— */
.browser-frame[data-calc-shell] { position: relative; }
.browser-chrome { scrollbar-width: none; scroll-behavior: smooth; }
.browser-chrome::-webkit-scrollbar { display: none; }
.browser-chrome.is-scroll-right { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent); }
.browser-chrome.is-scroll-left { -webkit-mask-image: linear-gradient(to right, transparent, #000 28px); mask-image: linear-gradient(to right, transparent, #000 28px); }
.browser-chrome.is-scroll-left.is-scroll-right { -webkit-mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 56px), transparent); }
.browser-chrome__more {
  position: absolute; top: 0; right: 0; z-index: 3; width: 40px;
  display: grid; place-items: center; padding: 6px 0 0;
  appearance: none; border: 0; background: none; color: #1e40af; cursor: pointer;
}
.browser-chrome__more svg { width: 26px; height: 26px; padding: 5px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(15,23,42,.18); }
.browser-chrome__more[hidden] { display: none; }
.browser-chrome__more:focus-visible svg { outline: 2px solid #2563eb; outline-offset: 2px; }

/* —— 1.7.6: guides (tables + callout in post content) —— */
.post-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 1.25rem; }
.post-table-wrap table { margin: 0; }
@media (max-width: 700px) {
  .post-table-wrap table { min-width: 560px; font-size: .9rem; }
}
.entry-content blockquote { margin: 0 0 1.25rem; padding: .85rem 1.1rem; border-left: 4px solid #2563eb; background: #eff6ff; border-radius: 0 12px 12px 0; }
.entry-content blockquote p { margin: 0; }

/* —— 1.7.7: Rank Math breadcrumbs —— */
.rank-math-breadcrumb { margin: 0 0 .35rem; font-size: .85rem; color: var(--muted); }
.rank-math-breadcrumb p { margin: 0; }
.rank-math-breadcrumb a { color: inherit; text-decoration: none; }
.rank-math-breadcrumb a:hover { text-decoration: underline; }
.rank-math-breadcrumb .separator { margin: 0 .3em; }
/* 1.7.9: breadcrumbs sit beside the hanging logo on desktop; the post hero keeps its logo offset when a breadcrumb precedes it */
@media (min-width: 901px) {
  .site-main > .calc-shell .rank-math-breadcrumb { padding-left: calc(var(--logo-size) + 12px); }
  .site-main > .calc-shell > article > .rank-math-breadcrumb + .page-hero {
    padding-left: calc(var(--logo-size) + 12px);
    min-height: calc(var(--logo-size) - var(--header-h) + 8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-top: 0;
  }
  .site-main > .calc-shell > article > .rank-math-breadcrumb + .page-hero .page-hero__meta { margin-bottom: .35rem; }
}

/* —— Home SEO text under the calculator (1.7.12, PL `/` + JDG tab) —— */
.calc-shell > .home-seo {
  max-width: 800px;
  margin: 2rem auto 0;
  line-height: 1.6;
  color: #334155;
}
.calc-shell > .home-seo[hidden] { display: none; }
.home-seo h2 {
  margin: 1.75rem 0 .6rem;
  font-size: clamp(1.2rem, 2.2vw, 1.4rem);
  line-height: 1.3;
  letter-spacing: -.01em;
  color: var(--text);
}
.home-seo h2:first-child { margin-top: 0; }
.home-seo h3 {
  margin: 1.25rem 0 .4rem;
  font-size: 1.05rem;
  line-height: 1.35;
  color: var(--text);
}
.home-seo p,
.home-seo ul { margin: 0 0 1rem; }
.home-seo ul { padding-left: 1.2rem; }
.home-seo li { margin: 0 0 .4rem; }
.home-seo__answer { font-size: 1.05rem; color: var(--text); }
/* 4-column table: equal columns (the Jak liczymy widths assume 3 columns), keep .jak-table borders over .prose table */
.home-seo .jak-table th,
.home-seo .jak-table td {
  width: 25%;
  border: 0;
  border-bottom: 1px solid var(--border);
}
.home-seo .jak-table th:not(:last-child),
.home-seo .jak-table td:not(:last-child) { border-right: 1px solid var(--border); }
.home-seo .jak-table tbody tr:last-child th,
.home-seo .jak-table tbody tr:last-child td { border-bottom: none; }
.home-seo .jak-table thead th { border-bottom: 1px solid #bfdbfe; }
.home-seo .jak-table tbody th { background: #fff; text-align: left; }
.home-seo .jak-table tbody tr:nth-child(even) th { background: #e2e8f0; }
.home-seo .jak-table caption {
  caption-side: top;
  padding: 12px 16px;
  text-align: left;
  font-size: .88rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
@media (max-width: 700px) {
  /* fit 4 columns on phones (no horizontal scroll, caption stays readable) */
  .home-seo .jak-table { min-width: 0; table-layout: fixed; }
  .home-seo .jak-table th,
  .home-seo .jak-table td { padding: 8px 6px; font-size: .8rem; overflow-wrap: normal; word-wrap: normal; }
  .home-seo .jak-table thead th { font-size: .66rem; letter-spacing: .01em; }
  .home-seo .jak-table caption { padding: 10px 12px; font-size: .82rem; }
}

/* —— 1.7.14: Redakcja TakiTax (byline, author box, O stronie sections, contact) —— */
.byline a.byline__author { color: inherit; font-weight: 600; text-decoration: none; }
.byline a.byline__author:hover { text-decoration: underline; }
.page-hero__meta--updated { font-size: .9rem; margin-top: -.6rem; }
.post-howwework {
  margin: 2rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: .92rem;
}
.author-box {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin: 1rem 0 0;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.author-box__logo { flex: 0 0 64px; width: 64px; height: 64px; border-radius: 14px; }
.author-box__body { min-width: 0; }
.author-box__body p { margin: 0 0 .45rem; }
.author-box__name { font-weight: 700; font-size: 1.05rem; }
.author-box__name a { color: var(--text); text-decoration: none; }
.author-box__name a:hover { text-decoration: underline; }
.author-box__bio { color: #334155; font-size: .92rem; line-height: 1.55; }
.author-box__links { font-size: .88rem; color: var(--muted); margin-bottom: 0 !important; }
@media (max-width: 520px) {
  .author-box { flex-direction: column; gap: 10px; padding: 14px; }
  .author-box__logo { width: 52px; height: 52px; flex-basis: 52px; }
}
.about-eeat { scroll-margin-top: 80px; }
.about-eeat__updated { color: var(--muted); font-size: .9rem; }
.tt-contact { white-space: nowrap; }

/* 1.7.18: social icons (markup + URLs: inc/social.php). 44×44 tap targets, theme colours. */
.social-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.social-links__item { margin: 0; padding: 0; }
.social-links__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}
.social-links__svg { width: 20px; height: 20px; display: block; }
.social-links__link:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: #eff6ff;
}
.social-links__link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  color: var(--primary);
  border-color: var(--primary);
  background: #eff6ff;
}
.social-links--footer { justify-content: center; margin: 0 0 1rem; }
/* Mobile dropdown only: the desktop bar is already full. */
.top-nav__social { display: none; }
@media (max-width: 900px) {
  .top-nav__social {
    display: block;
    flex: 1 0 100%;
    margin-top: 6px;
    padding: 10px 0 2px;
    border-top: 1px solid var(--border);
  }
  /* the dropdown is one narrow column: keep two 44px icons side by side (a third wraps neatly) */
  .social-links--menu { justify-content: center; gap: 8px; }
  .social-links--menu .social-links__link { color: var(--primary); }
  .social-links--menu .social-links__link:hover,
  .social-links--menu .social-links__link:focus-visible { color: var(--primary-dark); }
}
@media (prefers-reduced-motion: reduce) {
  .social-links__link { transition: none; }
}

/* —— 1.8.15: tabs as links, footer calculator list, latest news, post calculator box —— */
a.browser-tab, a.browser-tab:visited { color: var(--muted); }
a.browser-tab:hover, a.browser-tab.is-active, a.browser-tab.is-active:visited { color: var(--text); }
.footer-calcs { margin: 0 0 1rem; }
.footer-calcs__title { margin: 0 0 .4rem; font-weight: 700; color: var(--text); }
.footer-calcs__list { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.25rem; padding: 0; margin: 0; }
.footer-calcs__list a { color: var(--muted); text-decoration: none; font-weight: 600; }
.footer-calcs__list a:hover, .menu--footer a:hover { text-decoration: underline; }
.calc-shell > .latest-news { max-width: 800px; margin: 2rem auto 0; line-height: 1.5; color: #334155; }
.latest-news h2 { margin: 0 0 .6rem; font-size: clamp(1.2rem, 2.2vw, 1.4rem); line-height: 1.3; color: var(--text); }
.latest-news__list { margin: 0 0 .75rem; padding-left: 1.2rem; }
.latest-news__list li { margin: 0 0 .45rem; }
.latest-news__list time { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.latest-news__all { margin: 0; font-weight: 600; }
.post-calcs { margin: 1.75rem 0 1rem; padding: 14px 18px; border: 1px solid var(--border); border-radius: 12px; background: #f8fafc; }
.post-calcs__title { margin: 0 0 .5rem !important; font-size: 1.05rem !important; }
.post-calcs__list { margin: 0 !important; padding-left: 1.2rem; }
.post-calcs__list li { margin: 0 0 .3rem; }

/* 1.8.21: guide panel (kody-pkd) + calculator hub cards */
.guide-panel, .hub-panel { padding: 8px 4px 4px; }
.guide-panel h2, .hub-panel h2 { margin: 0 0 8px; font-size: 1.15rem; }
.hub-grid { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.hub-card { border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px 14px; background: #fff; display: flex; flex-direction: column; gap: 4px; }
.hub-card a { color: #1d4ed8; text-decoration: none; }
.hub-card a:hover { text-decoration: underline; }
.hub-card span { font-size: .82rem; color: #475569; line-height: 1.45; }

/* 1.8.23: EN expat guides */
.expat-guide-main { max-width: 860px; margin: 0 auto; padding: 1.5rem 1rem 2rem; }
.expat-guide__meta { color: var(--muted, #5b6470); font-size: .9rem; }
.expat-guide h2 { margin-top: 1.6rem; }
.expat-steps { padding-left: 1.2rem; }
.expat-steps > li { margin-bottom: 1rem; }
.expat-steps > li h2 { font-size: 1.15rem; margin: .8rem 0 .3rem; }
.expat-table { width: 100%; border-collapse: collapse; font-size: .95rem; display: block; overflow-x: auto; }
.expat-table th, .expat-table td { border: 1px solid #e3e6ea; padding: .5rem .6rem; text-align: left; vertical-align: top; }
.expat-guide__sources { margin-top: 2rem; font-size: .92rem; }
.expat-guide__sources li { margin-bottom: .35rem; overflow-wrap: anywhere; }
.expat-guide__note { color: var(--muted, #5b6470); font-size: .85rem; }
.expat-hub { margin: 2rem 0 1rem; padding: 1rem 1.2rem; border: 1px solid #e3e6ea; border-radius: 10px; background: #f8fafb; }
.expat-hub h2 { font-size: 1.1rem; margin: 0 0 .5rem; }
.expat-hub ul { margin: 0; padding-left: 1.1rem; }
