/* The pricing pages, /pricing/ and /pl/cennik/: three licence cards, a strip of what every licence includes,
   a small table that compares the licences, the cost next to SpreadJS, then the terms and questions folded
   away in <details>, and a closing call to action. Loaded after /assets/site.css. */

:root {
  --ok: #0b6470;
  --ok-soft: #e3f3f5;
  --ok-line: #9fd3d9;
  --no: #a3262f;
  --no-soft: #fdecec;
  --no-line: #f0b4b8;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ok: #7fd4dc;
    --ok-soft: #11272a;
    --ok-line: #1f4a50;
    --no: #ff9ea4;
    --no-soft: #2c1517;
    --no-line: #5e2a2e;
  }
}
:root[data-theme="dark"] {
  --ok: #7fd4dc;
  --ok-soft: #11272a;
  --ok-line: #1f4a50;
  --no: #ff9ea4;
  --no-soft: #2c1517;
  --no-line: #5e2a2e;
}

.spec-hero { padding-block: clamp(2rem, 1.5rem + 3vw, 4rem) var(--s-6); border-bottom: 1px solid var(--line); }
.spec-hero h1 { font-size: var(--text-2xl); font-weight: 700; letter-spacing: -0.035em; line-height: 1.05; max-width: 24ch; }
.spec-hero .lede { margin-top: var(--s-4); font-size: var(--text-base); max-width: 44rem; }
.spec-jump { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: var(--s-5); }
.spec-jump a { display: block; padding: 0.25rem 0.65rem; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink-2); font-family: var(--font-mono); font-size: var(--text-xs); text-decoration: none; }
.spec-jump a:hover { border-color: var(--accent); color: var(--accent); }

.spec-grid { display: grid; gap: var(--s-6); padding-block: 0 var(--section); }
.spec-hero + .spec-grid { padding-top: var(--s-6); }
@media (min-width: 62rem) {
  .spec-grid { grid-template-columns: minmax(0, 1fr) 22rem; gap: var(--s-7); align-items: start; }
  .spec { grid-column: 1; grid-row: 1; }
  .pick { position: sticky; top: calc(var(--header-h) + var(--s-5)); grid-column: 2; grid-row: 1; }
  .spec-grid-wide { grid-template-columns: minmax(0, 52rem); }
}

/* ---------- Licence cards and the "which licence" panel ---------- */

.buy { border: 1px solid var(--accent-line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-lg); overflow: hidden; }
.buy-head { padding: var(--s-5); background: var(--band-bg); color: var(--band-ink); }
.buy-head h2, .buy-head h3 { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--band-ink-2); }
.buy-price { margin-top: var(--s-3); font-size: 3.25rem; font-weight: 700; letter-spacing: -0.045em; line-height: 1; font-variant-numeric: tabular-nums; }
.buy-price span { color: var(--band-accent); }
.buy-per { margin-top: var(--s-2); font-size: var(--text-sm); color: var(--band-ink-2); }
.buy-body { padding: var(--s-5); }
.buy-list { list-style: none; display: grid; gap: 0.45rem; font-size: var(--text-sm); }
.buy-list li { position: relative; padding-left: 1.4rem; }
.buy-list li::before { content: ""; position: absolute; left: 0.15rem; top: 0.35em; width: 0.3rem; height: 0.6rem; border: solid var(--ok); border-width: 0 2px 2px 0; transform: rotate(40deg); }
.btn-buy { width: 100%; margin-top: var(--s-5); white-space: normal; text-align: center; }
.buy-q { display: block; margin-top: var(--s-3); text-align: center; font-size: var(--text-sm); }
.buy-then { margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--line); font-size: var(--text-xs); line-height: 1.6; color: var(--ink-2); }
.buy-free { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-4) var(--s-5); border-top: 1px solid var(--line); background: var(--surface-2); font-size: var(--text-sm); }
.buy-free strong { display: block; }
.buy-free small { display: block; color: var(--ink-2); font-size: var(--text-xs); }
.buy-free .btn { flex: none; }

.tiers-wrap { padding-block: var(--s-6); }
.tiers { display: grid; gap: var(--s-5); }
@media (min-width: 62rem) { .tiers { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; } }
.tier { display: flex; flex-direction: column; border-color: var(--line); box-shadow: none; scroll-margin-top: calc(var(--header-h) + 1rem); }
.tier .buy-head { background: var(--surface-2); color: var(--ink); border-bottom: 1px solid var(--line); }
.tier .buy-head h3, .tier .buy-per { color: var(--ink-2); }
.tier .buy-head h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem 0.5rem; min-height: 1.5rem; white-space: nowrap; }
.tier .buy-price { font-size: 2.75rem; white-space: nowrap; }
.tier .buy-price span { color: var(--accent); }
.tier .buy-price small { font-size: var(--text-sm); font-weight: 500; letter-spacing: 0; color: var(--ink-2); }
.tier .buy-body { flex: 1; display: flex; flex-direction: column; }
.tier .buy-list { margin-bottom: auto; }
.tier-for { margin-bottom: var(--s-4); font-size: var(--text-sm); line-height: 1.55; }
.tier-main { border-color: var(--accent-line); box-shadow: var(--shadow-lg); }
.tier-main .buy-head { background: var(--band-bg); color: var(--band-ink); border-bottom: 0; }
.tier-main .buy-head h3, .tier-main .buy-per { color: var(--band-ink-2); }
.tier-main .buy-price span { color: var(--band-accent); }
.tier-tag { padding: 0 0.45rem; border: 1px solid currentColor; border-radius: 999px; letter-spacing: 0; text-transform: none; color: var(--band-accent); }
.try-first { margin-top: var(--s-5); padding: var(--s-4) var(--s-5); border: 1px solid var(--ok-line); border-radius: var(--r-lg); background: var(--ok-soft); color: var(--ink); font-size: var(--text-sm); }
.try-first strong { color: var(--ok); }
.tiers-all { margin-top: var(--s-5); padding: var(--s-5); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.tiers-all h3 { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.tiers-all .buy-list { margin-top: var(--s-3); }
@media (min-width: 40rem) { .tiers-all .buy-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s-5); } }
@media (min-width: 62rem) { .tiers-all .buy-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tiers-note { margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--line); font-size: var(--text-xs); line-height: 1.6; color: var(--ink-2); }

.pick { scroll-margin-top: calc(var(--header-h) + 1rem); }
.pick .buy-head h2 { color: var(--band-ink); }
.pick-list { list-style: none; counter-reset: pick; margin: 0; padding: 0; font-size: var(--text-sm); line-height: 1.55; }
.pick-list li { counter-increment: pick; position: relative; padding: var(--s-4) var(--s-5) var(--s-4) calc(var(--s-5) + 1.9rem); border-bottom: 1px solid var(--line); }
.pick-list li:last-child { border-bottom: 0; }
.pick-list li::before { content: counter(pick); position: absolute; left: var(--s-5); top: var(--s-4); width: 1.35rem; height: 1.35rem; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface-2); color: var(--ink-2); font-family: var(--font-mono); font-size: 0.75rem; line-height: 1.3rem; text-align: center; }
.pick-a { margin-top: 0.3rem; font-weight: 600; }

/* ---------- Spec blocks ---------- */

.spec { min-width: 0; display: grid; gap: var(--s-6); }
.block { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; scroll-margin-top: calc(var(--header-h) + 1rem); }
.block-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem var(--s-4); padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.block-head h2 { font-size: 1.1875rem; letter-spacing: -0.015em; }
.block-head span { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-2); }
.block-body { padding: var(--s-5); }
.block-body > p { color: var(--ink-2); font-size: var(--text-sm); line-height: 1.65; }
.block-body > p + p { margin-top: var(--s-3); }

.terms { margin: 0; font-size: var(--text-sm); line-height: 1.55; }
.terms > div { display: grid; gap: 0.15rem var(--s-4); padding: 0.7rem var(--s-5); border-bottom: 1px solid var(--line); }
.terms > div:last-child { border-bottom: 0; }
@media (min-width: 40rem) { .terms > div { grid-template-columns: 11rem minmax(0, 1fr) auto; align-items: baseline; } }
.terms dt { font-weight: 600; }
.terms dd { margin: 0; color: var(--ink-2); }
.terms dd.t { color: var(--ink); }
.pill { display: inline-block; padding: 0.1rem 0.5rem; border: 1px solid var(--ok-line); border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-family: var(--font-mono); font-size: 0.75rem; white-space: nowrap; }
.pill-no { border-color: var(--no-line); background: var(--no-soft); color: var(--no); }
.pill-opt { border-color: var(--line-strong); background: var(--surface-2); color: var(--ink-2); }
.terms .row-no { background: var(--no-soft); }

.tree { margin: 0; padding: var(--s-5); background: #14161b; color: #e3e4ea; font-size: 0.8125rem; line-height: 1.8; overflow-x: auto; }
.tree .c { color: #9499a8; }
.tree .f { color: #aeb2ff; }

.cost-wrap { overflow-x: auto; }
.cost { width: 100%; min-width: 34rem; border-collapse: collapse; font-size: var(--text-sm); line-height: 1.5; }
.cost th, .cost td { padding: 0.65rem var(--s-5); text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.cost thead th { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.cost tbody th { width: 26%; font-weight: 600; }
.cost td.us { background: var(--accent-soft); }
.cost tr.total > * { border-bottom: 0; font-size: var(--text-base); }
.cost tr.total strong { font-size: 1.375rem; letter-spacing: -0.03em; }
.cost small { display: block; margin-top: 0.15rem; color: var(--ink-2); font-size: var(--text-xs); }
.block .fine { margin: 0; padding: var(--s-4) var(--s-5); border-top: 1px solid var(--line); }

.block .faq { border-top: 0; }
.block .faq summary { padding: 0.8rem var(--s-5); font-size: var(--text-base); }
.block .faq details > p { padding: 0 var(--s-5) var(--s-4); max-width: none; font-size: var(--text-sm); }
.block .faq details:last-child { border-bottom: 0; }

.news-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-4); }
.news-row p { flex: 1 1 18rem; color: var(--ink-2); font-size: var(--text-sm); line-height: 1.65; }
.news-latest { font-family: var(--font-mono); }

/* A promotion code from an offer link (/pricing/?code=...): the shop Worker adds these to the page. */
.promo-note { margin-bottom: var(--s-5); padding: var(--s-4) var(--s-5); border: 1px solid var(--accent-line); border-radius: var(--r-lg); background: var(--accent-soft); font-size: var(--text-sm); line-height: 1.55; }
.promo-note strong { color: var(--accent); }
.promo-note.is-warning { border-color: var(--line-strong); background: var(--surface-2); }
.promo-note.is-warning strong { color: var(--ink); }
.tier .buy-was { margin-top: var(--s-3); font-size: var(--text-sm); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tier .buy-was s { text-decoration-thickness: 1.5px; }
.tier .buy-was b { margin-left: 0.4rem; padding: 0.1rem 0.45rem; border-radius: 999px; background: var(--accent-fill); color: var(--on-accent); font-size: var(--text-xs); font-weight: 600; }
.tier .buy-was + .buy-price { margin-top: var(--s-1, 0.25rem); }
.tier-main .buy-was { color: var(--band-ink-2); }

/* ---------- The page below the licence cards ---------- */

.tiers-wrap { padding-bottom: 0; }
.tiers-wrap > .tiers-note { border-top: 0; padding-top: 0; text-align: center; }
.price-sect { padding-block: clamp(2.5rem, 1.5rem + 3vw, 4.5rem) 0; scroll-margin-top: var(--header-h); }
.price-sect > h2, .price-sect .section-head h2 { font-size: var(--text-xl); letter-spacing: -0.03em; line-height: 1.15; }
.price-sub { margin-top: var(--s-2); color: var(--ink-2); font-size: var(--text-sm); }
.price-sect > .block { margin-top: var(--s-5); }

/* "Every licence includes": short facts in a grid, each a bold lead and a few words. */
.includes { list-style: none; display: grid; gap: 1px; margin-top: var(--s-5); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--line); overflow: hidden; font-size: var(--text-sm); line-height: 1.5; color: var(--ink-2); }
@media (min-width: 36rem) { .includes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 62rem) { .includes { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.includes li { position: relative; padding: var(--s-4) var(--s-4) var(--s-4) 2.6rem; background: var(--surface); }
.includes li::before { content: ""; position: absolute; left: 1.15rem; top: 1.25rem; width: 0.35rem; height: 0.7rem; border: solid var(--ok); border-width: 0 2px 2px 0; transform: rotate(40deg); }
.includes strong { display: block; color: var(--ink); font-size: var(--text-base); font-weight: 650; }

/* The comparison: on a phone each licence's cell names itself, so the table reads without sideways scrolling. */
.cmp-wrap { margin-top: var(--s-5); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.cmp { width: 100%; border-collapse: collapse; font-size: var(--text-sm); line-height: 1.5; }
.cmp th, .cmp td { padding: 0.7rem var(--s-5); text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.cmp tbody tr:last-child > * { border-bottom: 0; }
.cmp thead th, .cmp thead td { background: var(--surface-2); font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.cmp tbody th { width: 22%; font-weight: 600; }
.cmp td:nth-child(3), .cmp thead th:nth-child(3) { background: var(--accent-soft); }
@media (max-width: 47.99rem) {
  .cmp thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .cmp, .cmp tbody, .cmp tr, .cmp th, .cmp td { display: block; width: auto; }
  .cmp tbody th { width: auto; padding-bottom: 0.3rem; border-bottom: 0; background: var(--surface-2); }
  .cmp tbody td { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: var(--s-3); padding-block: 0.45rem; border-bottom: 0; }
  .cmp tbody td::before { content: attr(data-l); color: var(--ink-2); font-family: var(--font-mono); font-size: var(--text-xs); line-height: 1.9; }
  .cmp tbody tr { border-bottom: 1px solid var(--line); }
  .cmp tbody tr:last-child { border-bottom: 0; }
  .cmp td:nth-child(3) { background: none; }
}

.try-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3) var(--s-5); margin-top: var(--s-5); padding: var(--s-4) var(--s-5); border: 1px solid var(--ok-line); border-radius: var(--r-lg); background: var(--ok-soft); font-size: var(--text-sm); line-height: 1.55; }
.try-strip p { flex: 1 1 24rem; }
.try-strip strong { color: var(--ok); }
.try-strip .btn { flex: none; }

/* Terms and questions: every answer is closed until asked for. */
.price-sect.faq-grid { padding-bottom: var(--section); }
.price-sect .faq summary { padding-block: 0.85rem; font-size: var(--text-base); }
.price-sect .faq details > p { font-size: var(--text-sm); }
.price-sect .faq details[open] { padding-bottom: var(--s-2); }
.price-sect .faq details { scroll-margin-top: calc(var(--header-h) + 1rem); }
.faq .pick-list li { padding-left: 2.2rem; padding-right: 0; }
.faq .pick-list li::before { left: 0; }
.faq .terms { margin-bottom: var(--s-4); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.faq .terms > div { padding-inline: var(--s-4); }
@media (min-width: 40rem) { .faq .terms > div { grid-template-columns: 9rem minmax(0, 1fr) auto; } }
.faq .tree { border-radius: var(--r-md); }
.faq .block-body { padding: var(--s-4) 0; }

.price-cta { padding-block: clamp(3rem, 2rem + 4vw, 5rem); border-top: 1px solid var(--line); background: var(--surface-2); text-align: center; }
.price-cta h2 { font-size: var(--text-2xl); letter-spacing: -0.035em; line-height: 1.1; }
.price-cta p { margin-top: var(--s-3); color: var(--ink-2); }
.price-cta .cta-row { justify-content: center; margin-top: var(--s-5); }
.price-cta .price-news { margin-top: var(--s-5); font-size: var(--text-xs); }
