:root {
  --bg: #f7f7f5; --surface: #ffffff; --text: #1d1d1b; --muted: #6b6b66; --border: #e3e2dd;
  --accent: #1f6f5c; --accent-text: #ffffff; --danger: #b3261e;
  --gray: #ececea; --blue: #dbe8fb; --amber: #fbefd0; --green: #d9f0e3;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161615; --surface: #20201e; --text: #ecebe6; --muted: #a09f99; --border: #34332f;
    --accent: #4cb394; --accent-text: #0e1a16; --danger: #f2948d;
    --gray: #2e2e2b; --blue: #1f3350; --amber: #4a3b16; --green: #1c3d2d;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); }
main { max-width: 960px; margin: 0 auto; padding: 24px 16px 64px; }
h1 { font-size: 1.7rem; line-height: 1.25; margin: 0.4em 0; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.top nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.top nav a { text-decoration: none; color: var(--text); }
.logo { font-weight: 700; font-size: 1.2rem; text-decoration: none; color: var(--accent) !important; }
.btn { display: inline-block; background: var(--accent); color: var(--accent-text) !important; border: 0; border-radius: 8px; padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn.small { padding: 6px 12px; font-size: 0.9rem; }
.btn.ghost { background: transparent; color: var(--accent) !important; border: 1px solid var(--accent); }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.danger { color: var(--danger) !important; }
form.inline { display: inline; }
.muted { color: var(--muted); }
.error { color: var(--danger); font-weight: 600; }
.flash { background: var(--green); padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
.hint { background: var(--amber); padding: 10px 14px; border-radius: 8px; }
.empty { padding: 32px; text-align: center; background: var(--surface); border: 1px dashed var(--border); border-radius: 12px; }
.narrow { max-width: 480px; margin: 0 auto; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack > .btn { align-self: flex-start; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 0.92rem; }
input, select, textarea { font: inherit; font-weight: 400; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); width: 100%; min-width: 0; }
fieldset { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--surface); }
legend { font-weight: 700; padding: 0 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.item-row { display: grid; grid-template-columns: 1fr 70px 80px 110px 72px 28px; gap: 6px; margin-bottom: 8px; align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.hero { padding: 32px 0 16px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center; }
.hero-mock { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px; box-shadow: 0 12px 32px rgba(0,0,0,.08); font-size: .9rem; transform: rotate(1deg); }
.hero-mock .accepted { margin-top: 12px; font-size: .85rem; padding: 8px 10px; }
.mock-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.mock-head div { display: flex; flex-direction: column; }
.mock-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--border); }
.mock-total { text-align: right; margin-top: 10px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 24px 0; }
.steps b { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--accent-text); }
.steps h3 { margin: 8px 0 4px; }
.pricing .card .btn { margin-top: 8px; }
.faq { margin: 40px 0 8px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; margin-bottom: 8px; }
.faq summary { cursor: pointer; font-weight: 600; }
.hero h1 { font-size: 2.2rem; }
.lead { font-size: 1.15rem; max-width: 680px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 32px 0; }
.features div, .card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.features h3 { margin-top: 0; }
.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.card.pro { border: 2px solid var(--accent); }
.price-tag { font-size: 2rem; font-weight: 700; margin: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.num { text-align: right; white-space: nowrap; }
table.list { background: var(--surface); border-radius: 12px; overflow: hidden; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.82rem; font-weight: 600; white-space: nowrap; }
.badge.gray { background: var(--gray); } .badge.blue { background: var(--blue); } .badge.amber { background: var(--amber); } .badge.green { background: var(--green); }
.toolbar, .share { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.share { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; align-items: flex-end; }
.share label { flex: 1 1 260px; }
.doc { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 28px; }
.doc-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.doc-head h1 { margin: 0; }
.doc-logo { display: block; max-width: 220px; max-height: 80px; object-fit: contain; margin-bottom: 12px; }
.logo-box { margin: 16px 0 24px; }
.deposit { margin-top: 6px; padding: 8px 12px; background: var(--green); border-radius: 8px; display: inline-block; }
.logo-box h2 { margin-top: 0; font-size: 1.15rem; }
.right { text-align: right; }
.parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 24px 0; }
.items { margin: 8px 0 16px; }
.items-wrap { overflow-x: auto; }
.sum { text-align: right; display: flex; flex-direction: column; gap: 2px; }
.sum .big { font-size: 1.25rem; margin-top: 6px; }
.notes { margin-top: 18px; white-space: normal; }
.accepted { margin-top: 24px; padding: 12px 14px; background: var(--green); border-radius: 8px; font-weight: 600; }
.accept { margin-top: 24px; display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; padding: 16px; border: 2px solid var(--accent); border-radius: 12px; }
.accept label { flex: 1 1 220px; }
.expired { margin-top: 24px; padding: 12px 14px; border: 1px solid var(--danger); color: var(--danger); border-radius: 8px; }
.doc, .doc td, .doc h1, table.list td { overflow-wrap: anywhere; }
.footer-brand { margin-top: 28px; font-size: 0.85rem; color: var(--muted); text-align: center; }
main.bare { padding-top: 24px; }
@media (max-width: 640px) {
  .grid2, .parties { grid-template-columns: 1fr; }
  .item-row { grid-template-columns: 1fr 1fr 1fr; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
  .item-row .grow { grid-column: 1 / -1; }
  .doc { padding: 16px; }
  .doc-head .right { text-align: left; }
  .doc .items { font-size: 0.85rem; }
  .doc .items th:nth-child(4), .doc .items td:nth-child(4), .doc .items th:nth-child(5), .doc .items td:nth-child(5) { display: none; }
  .hero h1 { font-size: 1.7rem; }
  .hero { grid-template-columns: 1fr; }
  .hero-mock { transform: none; }
  /* Lista wycen na telefonie jako karty zamiast szerokiej tabeli */
  table.list thead { display: none; }
  table.list, table.list tbody, table.list tr, table.list td { display: block; width: auto; }
  table.list tr { padding: 10px 12px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
  table.list td { border: 0; padding: 0; }
  table.list td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  table.list td.num { text-align: right; }
}
@page { size: A4; margin: 14mm 12mm; }
@media print {
  body { background: #fff; color: #000; }
  .no-print, .top { display: none !important; }
  main { padding: 0; max-width: none; }
  .doc { border: 0; padding: 0; }
  a { color: #000; text-decoration: none; }
}

.site-footer { max-width: 960px; margin: 0 auto; padding: 24px 16px 40px; border-top: 1px solid var(--border); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
label.check { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 400; }
label.check input { width: auto; margin-top: 4px; }
.templates-teaser { margin: 0 0 32px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 24px; }
.tpl-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; text-decoration: none; color: var(--text); }
.tpl-card:hover { border-color: var(--accent); }
.tpl-card h3 { margin: 0 0 6px; color: var(--accent); }
.tpl-card p { margin: 0; font-size: 0.92rem; }
.cta-box { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--surface); border: 2px solid var(--accent); border-radius: 12px; padding: 16px; margin: 24px 0; }
.tips li { margin-bottom: 6px; }
.small { font-size: 0.85rem; }
.calc { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; align-items: end; }
.calc-out { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 2px; text-align: right; }
.calc-out .big { font-size: 1.3rem; }
.legal { max-width: 760px; }
.legal h2 { font-size: 1.15rem; margin-top: 1.6em; }
.placeholder { background: var(--amber); padding: 0 4px; border-radius: 4px; }
