/* Ile na rękę — guide pages (/poradnik/, /uk/dovidnyk/, /en/guide/). Loaded after style.css. */

/* Top band */
.guide-band .wrap { padding-bottom: 44px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 0; margin: 4px 0 22px; padding: 0; font-size: 14px; font-weight: 700; }
.crumbs li { display: flex; align-items: center; }
.crumbs li + li::before { content: "›"; margin: 0 9px; opacity: 0.6; }
.crumbs a { text-decoration: none; border-bottom: 1.5px solid currentColor; }
.crumbs a:hover { border-bottom-width: 3px; }
.guide-band h1 { font-size: clamp(30px, 4.6vw, 54px); max-width: 18em; margin-bottom: 18px; }
.guide-band .lead { max-width: 40em; margin: 0 0 20px; }
.meta-line { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; font-size: 14px; font-weight: 700; }
.meta-line li { padding: 6px 12px; border-radius: 999px; background: var(--chip); }
.meta-line li.ok { background: var(--mint); color: var(--ink); }

/* Search with suggestions (guide-search.js) */
.guide-top .gsearch { flex: 1 1 auto; max-width: 420px; margin-left: auto; }
.gsearch { position: relative; }
.gsearch-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.gsearch-field { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 12px 0 14px; border-radius: 999px; background: var(--surface); color: var(--fg); }
.gsearch-field:focus-within { outline: 3px solid var(--cobalt); outline-offset: 2px; }
.gsearch-icon { flex: none; }
.gsearch input { flex: 1 1 auto; min-width: 0; height: 100%; border: 0; outline: 0; padding: 0; background: transparent; color: var(--fg); font: inherit; font-size: 16px; -webkit-appearance: none; appearance: none; }
.gsearch input::placeholder { color: var(--muted); }
.gsearch-key { flex: none; min-width: 22px; padding: 1px 6px; border: 1.5px solid var(--line); border-radius: 6px; font: 700 12px/1.4 inherit; text-align: center; color: var(--muted); }
.gsearch-field:focus-within .gsearch-key { display: none; }
.gsearch-list { position: absolute; z-index: 30; top: calc(100% + 10px); left: 0; right: 0; min-width: min(360px, calc(100vw - 32px)); max-height: min(70vh, 520px); overflow-y: auto; margin: 0; padding: 6px; list-style: none; background: var(--surface); color: var(--fg); border: var(--edge); border-radius: 20px; box-shadow: var(--shadow); }
.gsearch-list[hidden] { display: none; }
.gsearch-list li[role="option"] a { display: block; padding: 9px 12px; border-radius: 12px; text-decoration: none; color: inherit; }
.gsearch-list li[aria-selected="true"] a { background: var(--sun); color: var(--ink); }
.gsearch-list b { display: block; font-weight: 700; font-size: 16px; line-height: 1.3; }
.gsearch-list span { display: block; margin-top: 2px; font-size: 14px; line-height: 1.35; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gsearch-list mark { background: none; color: inherit; text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--mint); text-underline-offset: 2px; }
.gsearch-group { margin: 6px 6px 0; padding: 10px 6px 4px; border-top: 1.5px dashed var(--line); font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.gsearch-empty a { display: block; padding: 12px; font-weight: 700; }
.gsearch-hub { max-width: 640px; margin: 4px 0 26px; }
.gsearch-hub .gsearch-field { height: 62px; padding: 0 16px 0 20px; gap: 12px; box-shadow: var(--shadow-sm); }
.gsearch-hub .gsearch-icon { width: 24px; height: 24px; }
.gsearch-hub input { font-size: 18px; }
@media (hover: none) { .gsearch-key { display: none; } }

/* Layout */
.guide-main { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 56px; align-items: start; padding: 48px 0 72px; }
.guide-body { max-width: 760px; min-width: 0; }
.guide-body h2 { font-size: clamp(23px, 2.4vw, 29px); margin: 48px 0 14px; scroll-margin-top: 16px; }
.guide-body h2:first-child { margin-top: 0; }
.guide-body h3 { font-size: 19px; margin: 28px 0 8px; }
.guide-body p, .guide-body ul, .guide-body ol { margin: 0 0 16px; }
.guide-body li { margin-bottom: 6px; }
.guide-body a { text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
.guide-body a:hover { background: var(--sun); color: var(--ink); }
.guide-body strong { font-weight: 700; }

/* Callouts */
.box { border-radius: 24px; padding: 20px 24px; margin: 22px 0; background: var(--soft); }
.box > :last-child { margin-bottom: 0; }
.box > :first-child { margin-top: 0; }
.box.key { background: var(--sun); color: var(--ink); }
.box.tip { background: var(--mint); color: var(--ink); }
.box.warn { background: var(--pink); color: var(--ink); }
.box.key a, .box.tip a, .box.warn a { color: var(--ink); }
.box-title { font-family: var(--display); font-weight: 800; font-size: 16px; margin: 0 0 8px; }

/* Tables */
.table { overflow-x: auto; margin: 20px 0 24px; border: var(--edge); border-radius: 20px; background: var(--surface); }
.table table { border-collapse: collapse; width: 100%; font-size: 16px; font-variant-numeric: tabular-nums; }
.table th, .table td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.table thead th { background: var(--soft); color: var(--fg); font-size: 14px; }
.table tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; white-space: nowrap; }

/* Worked examples: a small receipt */
.calc { margin: 20px 0 24px; padding: 20px 24px; background: var(--surface); border: var(--edge); border-radius: 24px; font-variant-numeric: tabular-nums; }
.calc .calc-title { font-family: var(--display); font-weight: 800; font-size: 16px; margin: 0 0 10px; }
.calc dl { margin: 0; }
.calc dl > div { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; font-size: 16px; }
.calc dt, .calc dd { margin: 0; }
.calc dd { white-space: nowrap; }
.calc .sum { font-weight: 700; border-top: 2px dashed var(--line); margin-top: 6px; padding-top: 8px; }
.calc .net { font-weight: 700; margin-top: 10px; padding: 12px 16px; background: var(--sun); color: var(--ink); border-radius: 16px; }
.calc .calc-note { font-size: 14px; margin: 10px 0 0; }

/* FAQ, sources, disclaimer */
.guide-body .qas { margin-top: 8px; }
.guide-body .qa { scroll-margin-top: 16px; }
.guide-body .qa p, .guide-body .qa ul { margin: 0; padding: 0 22px 16px; }
.guide-body .qa ul { padding-left: 44px; }
.sources { font-size: 15px; padding-left: 20px; }
.sources li { margin-bottom: 8px; overflow-wrap: anywhere; }
.disclaimer { margin-top: 36px; padding: 16px 20px; border: 1.5px dashed var(--line); border-radius: 18px; font-size: 15px; color: var(--muted); }

/* Side column */
.guide-side { position: sticky; top: 20px; display: grid; gap: 20px; }
.toc { border-radius: 24px; padding: 20px 22px; background: var(--soft); }
.toc p { font-family: var(--display); font-weight: 800; font-size: 15px; margin: 0 0 10px; }
.toc ol { margin: 0; padding-left: 20px; font-size: 15px; line-height: 1.4; }
.toc li { margin-bottom: 7px; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.side-cta { border-radius: 24px; padding: 22px; background: var(--cobalt); color: var(--white); }
.side-cta p { margin: 0 0 14px; font-size: 16px; }
.side-cta .side-cta-title { font-family: var(--display); font-weight: 800; font-size: 18px; line-height: 1.15; }
.side-cta .join { background: var(--sun); color: var(--ink); min-height: 46px; padding: 0 22px; font-size: 16px; }
.side-cta .side-cta-link { display: inline-block; margin-top: 14px; color: var(--white); font-weight: 700; font-size: 15px; }

/* Cards: related pages and the hub */
.related { padding: 0 0 80px; }
.related h2, .hub-cluster h2 { font-size: clamp(26px, 3.2vw, 38px); margin-bottom: 22px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 0; margin: 0; list-style: none; }
.card { display: block; height: 100%; padding: 22px 24px 24px; border-radius: 28px; background: var(--soft); text-decoration: none; transition: transform 0.15s ease; }
.card:hover { transform: translateY(-3px); }
.card b { display: block; font-family: var(--display); font-weight: 800; font-size: 18px; line-height: 1.15; margin-bottom: 8px; }
.card span { display: block; font-size: 15px; line-height: 1.45; }
.card .card-site { margin-top: 12px; font-size: 13px; font-weight: 700; letter-spacing: 0.02em; opacity: 0.7; }
.cards li:nth-child(4n+1) .card { background: var(--sun); color: var(--ink); }
.cards li:nth-child(4n+2) .card { background: var(--mint); color: var(--ink); }
.cards li:nth-child(4n+3) .card { background: var(--soft); }
.cards li:nth-child(4n+4) .card { background: var(--pink); color: var(--ink); }

.hub-main { padding-top: 56px; padding-bottom: 40px; }
.hub-cluster { margin-bottom: 64px; scroll-margin-top: 16px; }
.hub-cluster > p { max-width: 44em; margin: -8px 0 24px; }
.hub-nav { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.hub-nav a { display: inline-block; font-weight: 700; font-size: 15px; text-decoration: none; padding: 9px 16px; border-radius: 999px; background: var(--soft); }
.hub-nav a:hover { background: var(--mark-bg); color: var(--mark-fg); }

/* Closing band on guide pages */
.guide-cta h2 { font-size: clamp(28px, 4vw, 46px); }
.guide-cta-actions { position: relative; display: flex; flex-wrap: wrap; gap: 12px; }
.guide-cta .join.alt { background: transparent; color: var(--cta-btn-bg); box-shadow: inset 0 0 0 2px var(--cta-btn-bg); }
footer.site a { text-decoration: none; }
footer.site a:hover { text-decoration: underline; }

@media (max-width: 980px) {
  .guide-main { grid-template-columns: 1fr; gap: 32px; }
  .guide-side { position: static; order: -1; }
  .side-cta { display: none; }
  .cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .guide-top { flex-wrap: wrap; row-gap: 14px; }
  .guide-top .gsearch { order: 4; flex: 1 1 0; max-width: none; margin-left: 0; }
}
@media (max-width: 640px) {
  .guide-band .wrap { padding-bottom: 32px; }
  .gsearch-hub .gsearch-field { height: 56px; padding: 0 14px 0 16px; }
  .gsearch-hub input { font-size: 17px; }
  .guide-main { padding: 32px 0 56px; }
  .cards { grid-template-columns: 1fr; }
  .box, .calc { padding: 16px; }
  .table table { font-size: 15px; }
}

/* Tool pages: the tool sits full width between the heading and the article (guide/build.py, TOOL_END). */
.tool-band { padding: 8px 0 48px; }

/* PIT-37 calculator (guide/content/<lang>/pit-37-calculator.html, js/pit37.js). The form is on the left,
   the result stays in view on the right; on a phone a bar at the bottom shows the amount. */
.pit37-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); gap: 24px; align-items: start; }
.pit37-form { display: grid; gap: 16px; min-width: 0; }
.pit37-step { display: grid; gap: 14px; padding: 24px; border-radius: 32px; background: var(--calc-bg); }
.pit37-step-title { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 22px; }
.pit37-num { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--sun); font-size: 17px; flex: none; }
:root[data-theme="dark"] .pit37-num, :root:not([data-theme]):has(#theme-switch:checked) .pit37-num { background: var(--sun); color: var(--ink); }
.pit37-hint { margin: 0; font-size: 15px; line-height: 1.45; color: var(--muted); }
.pit37-payers { display: grid; gap: 14px; }
.pit37-payer { position: relative; display: grid; gap: 14px; min-width: 0; margin: 0; padding: 18px; border: 0; border-radius: 24px; background: var(--surface); }
.pit37-payer legend { float: left; padding: 0; font-family: var(--display); font-weight: 800; font-size: 17px; }
.pit37-payer legend + * { clear: both; }
.pit37-remove { position: absolute; top: 14px; right: 14px; padding: 6px 12px; border: 0; border-radius: 999px; background: var(--soft); color: var(--fg); font: 700 14px inherit; cursor: pointer; }
.pit37-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.pit37-field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.pit37-field[hidden], .pit37-check[hidden], .pit37-fifty[hidden], .pit37-block[hidden], .pit37-question[hidden] { display: none; }
.pit37-field label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-weight: 700; font-size: 14px; line-height: 1.3; }
.pit37-field small { flex: none; padding: 2px 8px; border-radius: 999px; background: var(--soft); color: var(--muted); font-weight: 700; font-size: 12px; white-space: nowrap; }
.pit37-field small:empty { display: none; }
.pit37 input[type="text"], .pit37 select { width: 100%; min-height: 48px; padding: 10px 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--bg); color: var(--fg); font: 700 18px inherit; font-variant-numeric: tabular-nums; }
.pit37 select { font-size: 16px; }
.pit37 input[type="text"]:focus-visible, .pit37 select:focus-visible { outline: none; border-color: var(--cobalt); }
.pit37-kind small.pit37-kind-hint { justify-self: start; padding: 0; background: none; font-weight: 400; font-size: 13px; white-space: normal; }
.pit37-check { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.4; cursor: pointer; }
.pit37-check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--ink); }
:root[data-theme="dark"] .pit37-check input, :root:not([data-theme]):has(#theme-switch:checked) .pit37-check input { accent-color: var(--sun); }
.pit37-fifty { display: grid; gap: 10px; padding: 14px; border-radius: 18px; background: var(--soft); }
.pit37-rare summary, .pit37-more summary { cursor: pointer; font-weight: 700; font-size: 15px; }
.pit37-rare[open] summary, .pit37-more[open] summary { margin-bottom: 12px; }
.pit37-more { padding: 16px 18px; border-radius: 24px; background: var(--surface); }
.pit37-more .pit37-check { margin-top: 12px; }
.pit37-add { justify-self: start; min-height: 48px; padding: 10px 20px; border: 2px dashed var(--ink); border-radius: 999px; background: transparent; color: var(--fg); font: 700 15px inherit; cursor: pointer; }
:root[data-theme="dark"] .pit37-add, :root:not([data-theme]):has(#theme-switch:checked) .pit37-add { border-color: var(--sun); }
.pit37-question { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin: 0; padding: 14px 18px; border: 0; border-radius: 24px; background: var(--surface); }
.pit37-question legend { float: left; max-width: 60ch; padding: 0; font-weight: 700; font-size: 16px; line-height: 1.35; }
.pit37-yesno { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: var(--soft); }
.pit37-yesno label { position: relative; min-width: 64px; padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: 15px; text-align: center; cursor: pointer; }
.pit37-yesno input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.pit37-yesno label:has(input:checked) { background: var(--mark-bg); color: var(--mark-fg); }
.pit37-yesno label:has(input:focus-visible) { outline: 3px solid var(--cobalt); outline-offset: 2px; }
.pit37-block { display: grid; gap: 12px; padding: 0 4px; }
.pit37-stepper { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.pit37-stepper button { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--surface); color: var(--fg); font: 800 20px inherit; cursor: pointer; }
.pit37-stepper b { min-width: 2ch; text-align: center; font-size: 20px; }
.pit37-children { display: grid; gap: 8px; }
.pit37-child { padding: 12px 16px; border-radius: 18px; background: var(--surface); }
.pit37-child summary { display: flex; gap: 10px; align-items: baseline; cursor: pointer; list-style: none; }
.pit37-child summary::-webkit-details-marker { display: none; }
.pit37-child[open] summary { margin-bottom: 12px; }
.pit37-change { margin-left: auto; color: var(--cobalt); font-weight: 700; font-size: 14px; }
.pit37-child .pit37-check { margin-top: 10px; }

.pit37-result { position: sticky; top: 16px; display: grid; gap: 10px; padding: 24px; border-radius: 32px; background: var(--white); color: var(--ink); box-shadow: var(--shadow); font-variant-numeric: tabular-nums; }
.pit37-result.stale .pit37-amount, .pit37-result.stale dl { opacity: 0.4; }
.pit37-example { margin: 0; padding: 10px 14px; border-radius: 16px; background: #fff4cc; font-size: 14px; color: var(--ink); }
.pit37-example[hidden] { display: none; }
.pit37-example button { padding: 0; border: 0; background: none; color: #1f47d6; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.pit37-title { justify-self: start; margin: 0; padding: 4px 12px; border-radius: 999px; background: #d8f8e8; font-weight: 700; font-size: 15px; }
.pit37-result[data-tone="pay"] .pit37-title { background: #ffe1d9; }
.pit37-result[data-tone="even"] .pit37-title { background: #eeeae0; }
.pit37-amount { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(34px, 4vw, 48px); line-height: 1.05; }
.pit37-method { margin: 0; font-size: 14px; color: #6b6777; }
.pit37-result dl { margin: 4px 0 0; }
.pit37-result .row { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-top: 1px solid #ece8de; font-size: 15px; }
.pit37-result .row[hidden] { display: none; }
.pit37-result dt, .pit37-result dd { margin: 0; }
.pit37-result dd { white-space: nowrap; font-weight: 700; }
.pit37-notes { margin: 0; padding: 10px 14px; border-radius: 16px; background: #fff4cc; font-size: 14px; }
.pit37-notes[hidden], .pit37-variants[hidden] { display: none; }
.pit37-variants p { margin: 8px 0 0; font-weight: 700; font-size: 14px; }
.pit37-variants .row.chosen dt { font-weight: 700; }
.pit37-epit summary { cursor: pointer; font-weight: 700; font-size: 15px; }
.pit37-epit table { width: 100%; margin-top: 10px; border-collapse: collapse; font-size: 14px; }
.pit37-epit th, .pit37-epit td { padding: 6px 4px; border-top: 1px solid #ece8de; text-align: left; vertical-align: top; }
.pit37-epit th { white-space: nowrap; color: #6b6777; }
.pit37-epit td:last-child { text-align: right; white-space: nowrap; font-weight: 700; }
.pit37-status { margin: 0; font-weight: 700; font-size: 14px; color: #c0260e; }
.pit37-status:empty { display: none; }
.pit37-small { margin: 0; font-size: 13px; line-height: 1.45; color: #6b6777; }
.pit37-bar { display: none; }

@media (max-width: 900px) {
  .pit37-grid { grid-template-columns: minmax(0, 1fr); }
  .pit37-result { position: static; }
  .pit37-bar {
    position: sticky; bottom: 12px; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px;
    width: 100%; margin-top: 16px; padding: 14px 22px; border: 0; border-radius: 999px; background: var(--ink); color: var(--white);
    box-shadow: var(--shadow); font: 700 15px inherit; cursor: pointer;
  }
  .pit37-bar b { font-family: var(--display); font-size: 20px; }
  :root[data-theme="dark"] .pit37-bar, :root:not([data-theme]):has(#theme-switch:checked) .pit37-bar { background: var(--sun); color: var(--ink); }
}
@media (max-width: 600px) {
  .pit37-step { padding: 16px; border-radius: 26px; }
  .pit37-payer { padding: 14px; }
  .pit37-question { padding: 12px 14px; }
  .pit37-epit th { white-space: normal; }
}
footer.site .consent-open { text-decoration: none; }
footer.site .consent-open:hover { text-decoration: underline; }
