/* kirjanpidonhinta.fi
   Ilme: valkoinen pohja, tilisiirron sininen. Etusivun tulos on kuitti: katkoviivat,
   kassakoneen numerot ja korostuskynä yhteissumman alla. */

@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/public-sans-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/public-sans-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/fraunces-latin-ext-opsz-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/fraunces-latin-opsz-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url("../fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2");
}

:root {
  --paperi: #ffffff;       /* sivun tausta: laskentapaperin vaalea vihreä */
  --arkki: #ffffff;        /* nostetut pinnat, laskuri ja taulukot */
  --muste: #1a1f2b;        /* teksti: sinimusta muste */
  --harmaa: #5a6170;       /* toissijainen teksti */
  --viiva: #e1e4ea;        /* ohuet rivi- ja sarakeviivat */
  --viiva-2: #c8cdd7;      /* vahvemmat viivat */
  --vihrea: #1f47b8;       /* pääkirjan vihreä: napit, otsikkorivit */
  --vihrea-2: #edf1fc;     /* vihreä pohja */
  --puna: #b23a2e;         /* punakynä: yhteissumman kaksoisviiva, varoitukset */
  --linkki: #1f47b8;
  --fokus: #f2b705;

  --wrap: 74rem;
  --measure: 40rem;

  --fs-small: 0.84rem;
  --fs-body: 1.0625rem;
  --fs-h3: 1.2rem;
  --fs-h2: clamp(1.45rem, 2.4vw, 1.9rem);
  --fs-h1: clamp(2.05rem, 4.8vw, 3.25rem);

  --serif: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --wash: #f4f5f8;
  --mark: #fff09a;
  --saasto: #17734a;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }

body {
  margin: 0;
  background: var(--paperi);
  color: var(--muste);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.58;
}

img, svg { max-width: 100%; display: block; }

a { color: var(--linkki); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--fokus); outline-offset: 2px; border-radius: 3px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 10; background: var(--arkki); padding: 0.5rem 0.75rem; }
.skip:focus { top: 1rem; }

.wrap { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }

h1, h2, h3 {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.022em;
  margin: 0 0 0.55em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); font-weight: 750; letter-spacing: -0.03em; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 600; margin-top: 1.4em; }
h3:first-child { margin-top: 0; }

p { margin: 0 0 1em; }
.prose { max-width: var(--measure); }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin-bottom: 0.45em; }
.lead { font-size: 1.18rem; color: var(--harmaa); max-width: 36rem; }
.muted { color: var(--harmaa); }
.small { font-size: var(--fs-small); }
.num { font-variant-numeric: tabular-nums; }
.gap { margin-top: 2.25rem; }

/* Ylätunniste */
.site-header { border-bottom: 1px solid var(--viiva-2); background: var(--paperi); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem 1.5rem; padding: 0.85rem 0; flex-wrap: wrap; }
.brand {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--serif); font-weight: 650; font-size: 1.2rem;
  color: var(--muste); text-decoration: none;
}
.brand-mark { width: 1.35rem; height: 1.35rem; color: var(--vihrea); }
.site-header nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.2rem 1.25rem; margin: 0; padding: 0; }
.site-header nav a { color: var(--muste); text-decoration: none; font-size: 0.97rem; }
.site-header nav a:hover { text-decoration: underline; }
.site-header nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--puna); text-decoration-thickness: 2px; }

/* ---------- Etusivu: kysymykset ja kuitti ---------- */
.wrap.narrow { width: min(100% - 2rem, 48rem); }
.intro { padding: clamp(2rem, 6vw, 4rem) 0 2rem; }
.intro h1 { margin-bottom: 0.35em; }
.intro .lead { margin-bottom: 1.75rem; max-width: 40rem; }

.wizard {
  border: 1px solid var(--viiva); border-radius: 18px; padding: 1.75rem 1.75rem 1.5rem;
  background: var(--arkki); box-shadow: 0 1px 0 var(--viiva), 0 22px 44px -32px rgba(31, 71, 184, 0.45);
}
.wizard[data-current="result"] { padding: 0; border: 0; box-shadow: none; background: transparent; }
.progress { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1.1rem; font-size: 0.85rem; color: var(--harmaa); }
.progress[hidden] { display: none; }
.progress-track { flex: 1; height: 4px; background: var(--wash); border-radius: 2px; overflow: hidden; }
.progress-bar { display: block; height: 100%; width: 25%; background: var(--vihrea); border-radius: 2px; transition: width 0.3s ease; }
.step h2 { font-size: clamp(1.35rem, 3.4vw, 1.7rem); margin: 0 0 1.1rem; }
.options { display: grid; gap: 0.65rem; }
.options.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.options.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.option {
  appearance: none; cursor: pointer; font: inherit; font-size: 1.1rem; font-weight: 600; text-align: left;
  color: var(--muste); background: var(--arkki); border: 1.5px solid var(--viiva-2); border-radius: 12px;
  padding: 1.05rem 1.1rem; min-height: 3.6rem; font-variant-numeric: tabular-nums;
  transition: border-color 0.15s, background-color 0.15s;
}
.option:hover { border-color: var(--vihrea); background: var(--vihrea-2); color: var(--vihrea); }
.step-hint { font-size: 0.88rem; color: var(--harmaa); margin: 1rem 0 0; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--linkki); text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; }
.back { margin-top: 1rem; font-size: 0.92rem; color: var(--harmaa); }
.step.enter { animation: step-in 0.24s ease-out; }
@keyframes step-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Kuitti */
.receipt {
  position: relative; background: var(--arkki); border: 1px solid var(--viiva); border-bottom: 0;
  border-radius: 14px 14px 0 0; padding: 1.5rem 1.6rem 2.2rem;
  box-shadow: 0 22px 44px -34px rgba(26, 31, 43, 0.5);
}
.receipt::after {
  content: ""; position: absolute; left: -1px; right: -1px; bottom: -12px; height: 12px;
  background:
    linear-gradient(135deg, var(--arkki) 6px, transparent 0) 0 0 / 12px 12px repeat-x,
    linear-gradient(225deg, var(--arkki) 6px, transparent 0) 0 0 / 12px 12px repeat-x;
}
.r-choice { font-size: 0.88rem; color: var(--harmaa); margin: 0 0 1rem; padding-bottom: 0.9rem; border-bottom: 1.5px dashed var(--viiva-2); }
.r-choice .linkbtn { margin-left: 0.35rem; }
.r-title { font-size: 1rem; font-weight: 600; color: var(--harmaa); letter-spacing: 0; margin: 0 0 0.35rem; }
.r-name { font-size: 1.45rem; font-weight: 700; margin: 0 0 0.2rem; letter-spacing: -0.015em; line-height: 1.2; }
.r-name a { color: var(--muste); text-decoration: none; }
.r-name a:hover { text-decoration: underline; }
.r-pkg { font-size: 0.95rem; font-weight: 400; color: var(--harmaa); letter-spacing: 0; }
.r-price { margin: 0.4rem 0 0.3rem; }
.r-amount {
  font-family: var(--mono); font-weight: 600; font-size: clamp(2.6rem, 9vw, 3.6rem); line-height: 1.05;
  font-variant-numeric: tabular-nums; word-spacing: -0.35em; white-space: nowrap;
  background: linear-gradient(transparent 58%, var(--mark) 58%, var(--mark) 92%, transparent 92%);
  padding: 0 0.1em;
}
.r-unit { font-size: 1rem; color: var(--harmaa); margin-left: 0.25rem; }
.r-detail { font-size: 0.95rem; color: var(--harmaa); margin: 0 0 0.9rem; }
.r-actions { margin: 0 0 1.1rem; }
.r-cta {
  display: inline-block; text-decoration: none; font-weight: 600; font-size: 0.95rem;
  background: var(--vihrea); color: #fff; padding: 0.65rem 1rem; border-radius: 10px;
}
.r-cta:hover { background: #16348a; color: #fff; }
.r-actions .adlabel { display: inline; margin-left: 0.6rem; }
.r-list { list-style: none; counter-reset: none; margin: 0 0 1rem; padding: 0.9rem 0 0; border-top: 1.5px dashed var(--viiva-2); }
.r-list li { display: flex; align-items: baseline; gap: 0.5rem; margin: 0 0 0.45rem; font-size: 1.02rem; }
.r-list a { color: var(--muste); text-decoration: none; font-weight: 600; }
.r-list a:hover { text-decoration: underline; }
.r-dots { flex: 1; border-bottom: 1.5px dotted var(--viiva-2); transform: translateY(-0.25em); min-width: 1rem; }
.r-sum { font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums; word-spacing: -0.3em; white-space: nowrap; }
.r-save { margin: 0 0 1.1rem; padding: 0.8rem 0 0; border-top: 1.5px dashed var(--viiva-2); font-size: 0.98rem; }
.r-save strong { color: var(--saasto); }
.r-buttons { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0 0 0.9rem; }
.btn {
  display: inline-flex; align-items: center; font: inherit; font-weight: 600; font-size: 0.98rem; cursor: pointer;
  color: var(--vihrea); background: var(--arkki); border: 1.5px solid var(--vihrea); border-radius: 10px; padding: 0.65rem 1.05rem;
}
.btn:hover { background: var(--vihrea-2); }
.r-fine { font-size: 0.8rem; color: var(--harmaa); margin: 0; }

/* Kaikki hinnat: avautuva taulukko */
.all-prices { padding: 1.5rem 0 1rem; }
.price-table > summary { max-width: 48rem; margin: 0 auto; list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0; border-top: 1px solid var(--viiva); border-bottom: 1px solid var(--viiva); }
.price-table > summary::-webkit-details-marker { display: none; }
.price-table > summary h2 { margin: 0; font-size: clamp(1.2rem, 2.6vw, 1.45rem); }
.price-table > summary::after { content: "Näytä"; font-size: 0.92rem; font-weight: 600; color: var(--vihrea); white-space: nowrap; }
.price-table[open] > summary::after { content: "Piilota"; }
.price-table[open] > summary { margin-bottom: 1rem; }
.price-table .table-foot { max-width: 48rem; }

/* Usein kysyttyä */
.faq { padding: 2rem 0 1rem; }
.faq h2 { font-size: clamp(1.3rem, 2.8vw, 1.6rem); }
.faq details { border-top: 1px solid var(--viiva); }
.faq details:last-of-type { border-bottom: 1px solid var(--viiva); }
.faq summary { list-style: none; cursor: pointer; padding: 1rem 2.2rem 1rem 0; font-weight: 600; font-size: 1.05rem; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 0.4rem; top: 50%; width: 0.6rem; height: 0.6rem; margin-top: -0.45rem; border-right: 2px solid var(--vihrea); border-bottom: 2px solid var(--vihrea); transform: rotate(45deg); transition: transform 0.2s; }
.faq details[open] summary::after { transform: rotate(225deg); margin-top: -0.1rem; }
.faq details > div { padding: 0 0 0.8rem; color: var(--harmaa); }
.faq details ul { padding-left: 1.2em; }

/* Osiot */
.section { padding: clamp(2rem, 5vw, 3.25rem) 0; }
.section.first { padding-top: clamp(1.75rem, 4vw, 3rem); }
.section + .section { border-top: 1px solid var(--viiva-2); }
.section-head { margin-bottom: 1rem; }
.section-head h2 { margin-bottom: 0.35rem; }
.section-head p { margin: 0; max-width: 44rem; }
.table-foot { margin-top: 0.8rem; max-width: 52rem; }

/* Vertailutaulukko */
.table-scroll { overflow-x: auto; }
.compare {
  width: 100%; border-collapse: collapse;
  background: var(--arkki);
  border: 1px solid var(--viiva-2);
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
}
.compare caption { text-align: left; padding: 0 0 0.6rem; color: var(--harmaa); font-size: 0.92rem; caption-side: top; }
.compare th, .compare td { padding: 0.75rem 0.8rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--viiva); }
.compare td + td, .compare th + td { border-left: 1px solid var(--viiva); }
.compare thead th { font-size: var(--fs-small); font-weight: 650; color: var(--vihrea); background: var(--vihrea-2); border-bottom: 2px solid var(--vihrea); }
.compare thead th + th { border-left: 1px solid var(--viiva); }
.compare tbody tr:last-child > * { border-bottom: 0; }
.compare tbody th { font-weight: 400; min-width: 13rem; }
.compare .name { display: block; font-family: var(--serif); font-weight: 650; font-size: 1.06rem; line-height: 1.25; }
.compare .name a { color: inherit; text-decoration-color: var(--viiva-2); }
.compare .type, .compare .pkg, .compare .pkgnote, .compare .sub { display: block; font-size: var(--fs-small); color: var(--harmaa); }
.compare .pkg { color: var(--muste); margin-top: 0.15rem; }
.compare .why { display: block; font-size: var(--fs-small); color: var(--puna); margin-top: 0.15rem; }
.compare td.yearly .why { color: var(--harmaa); }
.compare .total { font-family: var(--mono); font-weight: 600; font-size: 1.05rem; white-space: nowrap; word-spacing: -0.3em; }
.compare .total-sm { font-family: var(--mono); font-weight: 600; white-space: nowrap; display: block; word-spacing: -0.3em; }
.compare .min { font-family: var(--sans); font-weight: 400; font-size: 0.86em; word-spacing: normal; }
.compare .flag {
  display: inline-block; margin-top: 0.3rem;
  font-size: 0.78rem; font-weight: 650; color: var(--vihrea);
  border: 1px solid var(--vihrea); border-radius: 2px; padding: 0.05rem 0.35rem;
}
.compare tr.best > * { background: var(--vihrea-2); }
.compare tr.best .total { border-bottom: 3px double var(--puna); }
.compare tr.nofit .name, .compare tr.nofit td { color: var(--harmaa); }
.cta {
  display: inline-block; text-decoration: none; font-weight: 600; font-size: 0.92rem;
  background: var(--vihrea); color: #fff; padding: 0.5rem 0.75rem; border-radius: 3px; white-space: nowrap;
}
.cta:hover { background: #244b3b; }
.cta.plain { background: transparent; color: var(--linkki); padding: 0; text-decoration: underline; white-space: normal; }
.adlabel { display: block; font-size: 0.75rem; color: var(--harmaa); margin-top: 0.3rem; }
.plain-table tbody th { min-width: 10rem; }
.form-table td { min-width: 9rem; }

/* Kaksi palstaa */
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 3.5rem; }

.checklist { list-style: none; padding: 0; margin: 0; max-width: var(--measure); }
.checklist li { padding: 0.65rem 0 0.65rem 1.7rem; border-bottom: 1px solid var(--viiva); position: relative; }
.checklist li::before {
  content: ""; position: absolute; left: 0.1rem; top: 1.05rem;
  width: 0.8rem; height: 0.45rem;
  border-left: 2px solid var(--vihrea); border-bottom: 2px solid var(--vihrea);
  transform: rotate(-45deg);
}

/* Toimijasivu */
.facts { display: grid; grid-template-columns: minmax(9rem, max-content) minmax(0, 1fr); gap: 0; margin: 0.5rem 0 1.5rem; max-width: 52rem; border-top: 1px solid var(--viiva); }
.facts dt, .facts dd { padding: 0.55rem 0; border-bottom: 1px solid var(--viiva); }
.facts dt { color: var(--harmaa); padding-right: 1.25rem; }
.facts dd { margin: 0; }
.sources { font-size: 0.95rem; padding-left: 1.2em; }
.sources li { margin-bottom: 0.5rem; word-break: break-word; }
.sources .url { font-size: var(--fs-small); color: var(--harmaa); }
.breadcrumb { font-size: var(--fs-small); margin-bottom: 0.9rem; color: var(--harmaa); }
.breadcrumb a { color: var(--harmaa); }
.notice { background: var(--arkki); border-left: 3px solid var(--puna); padding: 0.75rem 1rem; max-width: 52rem; margin: 0 0 1.5rem; }

/* Alatunniste */
.site-footer { border-top: 2px solid var(--vihrea); padding: 2rem 0 2.5rem; font-size: 0.92rem; color: var(--harmaa); background: var(--arkki); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: 1.5rem 3rem; }
.footer-grid p { max-width: 46rem; }
.footer-grid strong { color: var(--muste); }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 0.4rem; }
.site-footer a { color: var(--muste); }

/* Kapeat näytöt */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; grid-template-areas: "copy" "sheet" "aside"; grid-template-rows: auto; }
  .hero { padding-top: 1.25rem; }
  .lead { font-size: 1.05rem; }
  .cols { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .compare, .compare tbody, .compare tr, .compare td, .compare th { display: block; }
  .compare thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .compare caption { display: block; padding: 0.75rem 0.9rem 0.4rem; }
  .compare tr { border-bottom: 1px solid var(--viiva-2); padding: 0.55rem 0 0.7rem; }
  .compare tbody tr:last-child { border-bottom: 0; }
  .compare td, .compare th { border: 0 !important; padding: 0.2rem 0.9rem; min-width: 0 !important; }
  .compare tbody th { padding-bottom: 0.4rem; }
  .compare td[data-label] { position: relative; padding-left: 8.6rem; }
  .compare td[data-label]::before { content: attr(data-label); position: absolute; left: 0.9rem; width: 7.4rem; color: var(--harmaa); font-size: var(--fs-small); padding-top: 0.12rem; }
  .compare td:empty { display: none; }
  .compare td.ctacell { padding-top: 0.45rem; }
  .compare tr.best > * { background: transparent; }
  .compare tr.best { background: var(--vihrea-2); }
  .line { display: block; padding: 0.55rem 1rem 0.7rem; }
  .line legend { border-right: 0; padding: 0; height: auto; width: 100%; margin-bottom: 0.4rem; display: block; }
  .line .keys { clear: both; }
  .site-header nav ul { gap: 0.2rem 0.9rem; }
  .site-header nav a { font-size: 0.92rem; }
  .leaders dd { font-size: 0.9rem; flex: 0 0 auto; }
  .leaders dd::before { display: none; }
  .leaders div { justify-content: space-between; border-bottom: 1px dotted var(--viiva-2); }
  .facts { grid-template-columns: 1fr; }
  .facts dt { border-bottom: 0; padding-bottom: 0; font-size: var(--fs-small); }
  .facts dd { padding-top: 0.15rem; }
}

@media (max-width: 520px) {
  .wizard { padding: 1.25rem 1rem; border-radius: 14px; }
  .options.three { grid-template-columns: 1fr; }
  .option { font-size: 1.05rem; padding: 0.95rem 1rem; }
  .receipt { padding: 1.25rem 1.1rem 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .step.enter { animation: none; }
  .progress-bar { transition: none; }
}
