/* palkka-avoimuusdirektiivi.fi
   Värit: valkoinen pohja, männynvihreä pääväri, sahrami vain määräpäiville. */

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 100 700;
  src: url("../fonts/ibm-plex-sans-latin-ext-standard-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: "IBM Plex Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 100 700;
  src: url("../fonts/ibm-plex-sans-latin-standard-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;
}

:root {
  --paper: #ffffff;
  --wash: #f2f6f4;
  --ink: #182421;
  --muted: #56635f;
  --faint: #7d8a86;
  --line: #d8e0dc;
  --pine: #0f5c4d;
  --pine-dark: #0a463b;
  --pine-soft: #e3efea;
  --saffron: #e3a51b;
  --saffron-soft: #fdf3dc;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.6;
  overflow-wrap: break-word;
}
img, svg { max-width: 100%; }
a { color: var(--pine); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--pine-dark); text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; font-weight: 600; }
h1 { font-size: clamp(2rem, 5.2vw, 3.1rem); margin: 0 0 0.45em; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.35rem, 2.8vw, 1.65rem); margin: 1.9em 0 0.6em; }
h3 { font-size: 1.1rem; margin: 1.4em 0 0.35em; }
p { margin: 0 0 0.9em; }
ul, ol { padding-left: 1.3em; }
li { margin: 0.3em 0; }
strong { font-weight: 600; }
button { font: inherit; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow, .wrap.prose { max-width: 792px; }
.prose { max-width: 760px; }
.lead { font-size: 1.2rem; color: var(--muted); line-height: 1.5; }
.small, .hint { font-size: 0.88rem; color: var(--muted); }
.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: -9999px; top: 0; }
.skip:focus { left: 16px; top: 8px; z-index: 10; background: var(--paper); padding: 8px 12px; border-radius: 6px; }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 24px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 600; text-decoration: none; font-size: 1rem; min-width: 0; }
.brand span { overflow-wrap: anywhere; }
.brand-mark { width: 24px; height: 24px; flex: none; }
.site-header nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 20px; }
.site-header nav li { margin: 0; }
.site-header nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.site-header nav a:hover { color: var(--ink); }
.site-header nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* ---------- Etusivu ---------- */
.intro { padding: 56px 0 40px; }
.intro .lead { margin-bottom: 28px; }

.wizard { border: 1px solid var(--line); border-radius: 18px; padding: 28px 28px 24px; background: var(--paper); box-shadow: 0 1px 0 var(--line), 0 18px 40px -28px rgba(15, 92, 77, 0.35); }
.wizard[data-current="result"] { padding-top: 24px; }
.progress { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; font-size: 0.85rem; color: var(--muted); }
.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: 50%; background: var(--pine); border-radius: 2px; transition: width 0.3s ease; }
.step h2 { font-size: clamp(1.4rem, 3.4vw, 1.75rem); margin: 0 0 18px; }
.options { display: grid; gap: 10px; }
.options.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 560px) { .options:not(.two) { grid-template-columns: repeat(2, minmax(0, 1fr)); } .options:not(.two) .option:last-child:nth-child(odd) { grid-column: 1 / -1; } }
.option {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  text-align: left; font-size: 1.12rem; font-weight: 500; color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 16px 18px; cursor: pointer; font-variant-numeric: tabular-nums;
  transition: border-color 0.15s, background-color 0.15s;
}
.option::after { content: ""; flex: none; width: 18px; height: 18px; border: 1.5px solid var(--line); border-radius: 50%; transition: border-color 0.15s, background-color 0.15s; }
.option:hover { border-color: var(--pine); background: var(--pine-soft); }
.option:hover::after { border-color: var(--pine); background: var(--pine); box-shadow: inset 0 0 0 3px var(--pine-soft); }
.step-hint { font-size: 0.88rem; color: var(--muted); margin: 16px 0 0; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--pine); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: inherit; }
.back { margin-top: 16px; font-size: 0.92rem; color: var(--muted); }

.step.enter { animation: step-in 0.24s ease-out; }
@keyframes step-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .step.enter { animation: none; } .progress-bar { transition: none; } }

/* Tulos: määräpäivät pystyjanana */
.res-choice { font-size: 0.92rem; color: var(--muted); margin: 0 0 6px; }
.res-choice .linkbtn { margin-left: 6px; }
.res-title { font-size: clamp(1.7rem, 4.4vw, 2.3rem); margin: 0 0 8px; }
.res-next { margin: 0 0 8px; color: var(--muted); }
.res-next strong { color: var(--ink); }
.deadlines { list-style: none; margin: 26px 0 8px; padding: 0 0 0 26px; position: relative; }
.deadlines::before { content: ""; position: absolute; left: 6px; top: 10px; bottom: 18px; width: 2px; background: var(--line); }
.deadline { position: relative; margin: 0 0 22px; }
.deadline::before { content: ""; position: absolute; left: -26px; top: 9px; width: 14px; height: 14px; border-radius: 50%; background: var(--saffron); box-shadow: 0 0 0 4px var(--paper); }
.deadline-date { margin: 0 0 6px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.d-big { order: -1; font-size: 1.6rem; font-weight: 600; color: var(--pine); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1.2; }
.d-small { font-size: 0.85rem; color: var(--muted); }
.tasks { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.task { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); margin: 0; }
.tick { width: 20px; height: 20px; border: 1.5px solid var(--pine); border-radius: 5px; margin-top: 2px; }
.task h3 { margin: 0; font-size: 1.06rem; font-weight: 500; }
.task h3 a { color: var(--ink); text-decoration: none; }
.task h3 a:hover { color: var(--pine); text-decoration: underline; }
.task .task-when { margin: 4px 0 0; font-size: 0.92rem; color: var(--muted); }
.task-tag { display: inline-block; font-size: 0.78rem; font-weight: 500; padding: 1px 8px; border-radius: 999px; background: var(--saffron-soft); color: #7a5300; }
.task-more { font-size: 0.9rem; font-weight: 500; }
.res-note { background: var(--saffron-soft); border-radius: 12px; padding: 14px 18px; margin: 8px 0 16px; }
.res-note h3 { margin: 0 0 4px; font-size: 1rem; }
.res-note p { margin: 0; font-size: 0.95rem; }
.later { background: var(--wash); border-radius: 12px; padding: 16px 20px; margin: 18px 0; }
.later h3 { margin: 0 0 6px; font-size: 1rem; }
.later ul { margin: 0; padding-left: 1.1em; }
.later li { font-size: 0.95rem; color: var(--muted); }
.later li strong { color: var(--ink); }
.res-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 14px; }
.res-fine { font-size: 0.82rem; color: var(--faint); margin: 0; }
.res-fine a { color: var(--faint); }

.btn, .button {
  display: inline-flex; align-items: center; justify-content: center; font: inherit; font-size: 0.98rem; font-weight: 600; line-height: 1.25;
  color: var(--pine); background: var(--paper); border: 1.5px solid var(--pine); border-radius: 10px;
  padding: 11px 18px; text-decoration: none; cursor: pointer;
}
.btn:hover, .button:hover { background: var(--pine-soft); color: var(--pine-dark); text-decoration: none; }
.btn-primary, .button { background: var(--pine); color: #fff; }
.btn-primary:hover, .button:hover { background: var(--pine-dark); color: #fff; }
.button.secondary { background: var(--paper); color: var(--pine); }
.button.secondary:hover { background: var(--pine-soft); color: var(--pine-dark); }
.button.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.button.ghost:hover { color: var(--ink); background: transparent; }

/* UKK */
.faq { padding: 24px 0 8px; }
.faq h2 { margin-top: 0; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 16px 40px 16px 0; font-weight: 600; font-size: 1.05rem; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; margin-top: -7px; border-right: 2px solid var(--pine); border-bottom: 2px solid var(--pine); transform: rotate(45deg); transition: transform 0.2s; }
.faq details[open] summary::after { transform: rotate(225deg); margin-top: -2px; }
.faq details > div { padding: 0 0 12px; }
.faq details p { color: var(--muted); }
.src-line { font-size: 0.8rem; }
.guides { padding: 32px 0 24px; }
.guides h2 { margin-top: 0; }
.plain-links { list-style: none; padding: 0; margin: 0; }
.plain-links li { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 0.95rem; }
.plain-links a { display: block; font-weight: 600; font-size: 1.02rem; text-decoration: none; }
.plain-links a:hover { text-decoration: underline; }

/* ---------- Oppaat ---------- */
.section { padding: 8px 0 32px; }
.section.first { padding-top: 36px; }
.cols { display: grid; gap: 8px 48px; }
@media (min-width: 900px) { .cols { grid-template-columns: 1fr 1fr; align-items: start; } }
.crumbs { font-size: 0.85rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }

.tag { display: inline-block; font-size: 0.74rem; font-weight: 500; line-height: 1.3; padding: 2px 8px; border-radius: 999px; background: var(--pine-soft); color: var(--pine-dark); white-space: nowrap; margin-right: 2px; }
.tag-voimassa, .tag-ok { background: #e2f0e2; color: #2a5d2f; }
.tag-direktiivi { background: #ecefee; color: #3f4a47; }
.tag-vero { background: #e4ecf4; color: #284a6b; }
.tag-huomio { background: var(--saffron-soft); color: #7a5300; }
.tag-over { background: var(--saffron); color: #2b1d00; }
.tag-scope, .tag-date { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.src { font-size: 0.8rem; color: var(--faint); }
.src a { color: var(--faint); text-decoration: none; border-bottom: 1px solid var(--line); }
.src a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.more { font-size: 0.88rem; font-weight: 500; }

.toc { background: var(--wash); border-radius: 12px; padding: 14px 20px; margin: 1.2em 0; font-size: 0.95rem; }
.toc p { margin: 0 0 4px; }
.toc ol { margin: 0; }
.ob { border-top: 1px solid var(--line); padding: 16px 0 6px; scroll-margin-top: 16px; }
.ob h2, .ob h3 { margin-top: 0; }
.ob-meta { font-size: 0.85rem; color: var(--muted); }
.ob-variants { font-size: 0.95rem; }
.callout { background: var(--wash); border-left: 3px solid var(--line); border-radius: 0 10px 10px 0; padding: 12px 16px; margin: 14px 0; font-size: 0.95rem; }
.callout p:last-child { margin-bottom: 0; }
.callout.warn { background: var(--saffron-soft); border-left-color: var(--saffron); }
.callout ul { margin: 4px 0 0; }
.cta { background: var(--pine-soft); border-radius: 14px; padding: 18px 22px; margin: 1.8em 0; }
.cta p:last-child { margin-bottom: 0; }

.table-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1em 0; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
table { border-collapse: collapse; width: 100%; font-size: 0.93rem; }
caption { text-align: left; font-weight: 600; padding: 10px 12px 4px; font-size: 0.9rem; color: var(--muted); }
th, td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--line); }
thead th { font-size: 0.82rem; color: var(--muted); font-weight: 600; background: var(--wash); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }

.timeline { list-style: none; padding: 0 0 0 20px; border-left: 2px solid var(--line); margin: 1em 0 1em 6px; }
.timeline li { position: relative; margin: 0 0 14px; }
.timeline li::before { content: ""; position: absolute; left: -27px; top: 0.45em; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid var(--pine); }
.timeline li.is-today::before { background: var(--saffron); border-color: var(--saffron); }
.timeline p { margin: 0; }
.tl-date { font-weight: 600; color: var(--pine); font-variant-numeric: tabular-nums; }

.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); margin: 0; }
.checklist .box { width: 20px; height: 20px; border: 1.5px solid var(--pine); border-radius: 5px; margin-top: 3px; }
.checklist p { margin: 0 0 4px; }

.providers { list-style: none; padding: 0; margin: 0; }
.provider { border-top: 1px solid var(--line); padding: 14px 0 8px; margin: 0; }
.provider h3 { margin: 0 0 4px; }
.provider p { margin: 0 0 6px; }
.sources li { font-size: 0.93rem; }

.guide-list { list-style: none; padding: 0; margin: 0; }
.guide-list li { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.guide-list a { font-weight: 600; }
.guide-list span { display: block; font-size: 0.9rem; color: var(--muted); }
.related { margin-top: 2.4em; }
.related h2 { font-size: 1.2rem; }

/* ---------- Palkkaerolaskuri ---------- */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.panel-title { font-size: 1.15rem; margin: 0 0 12px; }
.field { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.field legend, .field-label { font-weight: 600; font-size: 0.95rem; margin-bottom: 8px; display: block; padding: 0; }
textarea, input[type="file"] { font: inherit; width: 100%; max-width: 100%; }
.calc-grid { display: grid; gap: 24px; margin: 8px 0 24px; }
@media (min-width: 900px) {
  .calc-cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 0 28px; align-items: stretch; }
  .calc-left { display: flex; flex-direction: column; }
  .calc-left textarea { flex: 1; min-height: 320px; }
}
.calc-form textarea { font-family: var(--mono); font-size: 0.85rem; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfb; resize: vertical; min-height: 180px; }
.file-row { margin: 12px 0 16px; }
.file-row input { font-size: 0.9rem; }
.radios { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.95rem; }
.radios label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.calc-result { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.calc-result h2 { margin-top: 0; }
.calc-summary { font-size: 1.02rem; }
.calc-table { font-size: 0.88rem; }
.calc-table td, .calc-table tbody th { white-space: nowrap; }
.calc-table thead th { white-space: normal; vertical-align: bottom; }
.calc-table td:nth-child(6), .calc-table td:last-child { white-space: normal; min-width: 7.5rem; }
.calc-table .tag { white-space: normal; }
.calc-table tr.total th, .calc-table tr.total td { font-weight: 600; background: var(--wash); border-top: 2px solid var(--line); }
.calc-table .cell-scale { min-width: 120px; vertical-align: middle; }
.scale { position: relative; display: block; height: 12px; background: var(--wash); border-radius: 6px; min-width: 100px; }
.scale-band { position: absolute; left: 37.5%; width: 25%; top: 0; bottom: 0; background: #dcebdc; }
.scale-mid { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: var(--faint); }
.scale-dot { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--pine); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--pine); }
.scale.is-over .scale-dot { background: var(--saffron); box-shadow: 0 0 0 1px #b07c00; }

/* Footer */
.site-footer { background: var(--wash); border-top: 1px solid var(--line); color: var(--muted); margin-top: 48px; padding: 36px 0 28px; font-size: 0.88rem; }
.site-footer a { color: var(--ink); }
.footer-grid { display: grid; gap: 24px; }
@media (min-width: 860px) { .footer-grid { grid-template-columns: 1.3fr 1fr; } }
.footer-links { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 24px; }
.footer-links li { break-inside: avoid; margin: 0 0 6px; }

@media (max-width: 520px) {
  body { font-size: 17px; }
  .intro { padding-top: 32px; }
  .wizard { padding: 20px 16px; border-radius: 14px; }
  .deadlines { padding-left: 22px; }
  .deadline::before { left: -22px; }
  .deadlines::before { left: 4px; }
}

@media print {
  .site-header, .site-footer, .no-print, .cta, .related, .crumbs, .skip,
  body.home .faq, body.home .guides, body.home .lead, .progress, .res-actions, .res-choice .linkbtn { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .wizard { border: 0; box-shadow: none; padding: 0; }
  .task, .checklist li { break-inside: avoid; }
}
