:root {
  --bg: #F4F5F7; --surface: #FFFFFF; --ink: #16213A; --ink-2: #2D3748; --muted: #4B5565;
  --line: #DDE1E7; --line-soft: #EEF0F3; --accent: #1D4E89; --accent-dark: #123660;
  --accent-soft: #E8EEF7; --reviewed: #F6F7F9; --coming-bg: #FDF1E3; --coming-ink: #7A4106;
  --ok: #1E6B3A; --warn: #8A4B00; --eu-bg: #E5EDF8; --eu-ink: #1D4E89; --fi-bg: #E6F2EA; --fi-ink: #1F5C38; --pending-bg: #EEE8F7; --pending-ink: #4A2D7A;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 15px; line-height: 1.5; }
a { color: var(--accent); } a:hover { color: var(--accent-dark); }
h1 { font-family: 'IBM Plex Serif', Georgia, serif; font-size: 24px; font-weight: 600; margin: 0 0 2px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* header */
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 14px 32px;
  background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink);
  font-family: 'IBM Plex Serif', Georgia, serif; font-size: 20px; font-weight: 600; }
.list-menu { position: relative; }
.list-button { list-style: none; min-height: 44px; padding: 0 12px; display: flex; align-items: center; gap: 8px;
  border: 1px solid #C9CFD8; border-radius: 8px; cursor: pointer; }
.list-button::-webkit-details-marker { display: none; }
.muted-label { font-size: 13px; color: var(--muted); }
.menu { position: absolute; top: 52px; left: 0; z-index: 40; width: 280px; padding: 6px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(22,33,58,.15); }
.menu form { margin: 0; }
.menu-item { width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border: none; border-radius: 6px; background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.menu-item.selected { background: var(--accent-soft); font-weight: 600; }
.menu-item.disabled { color: var(--muted); cursor: default; }
.menu-sep { height: 1px; margin: 6px 4px; background: var(--line-soft); }
.topbar-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; flex-wrap: wrap; }
.btn-primary, .btn-secondary, .btn-small, .btn-small-secondary { display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 8px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--accent); color: #fff; border: 1px solid var(--accent); }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--accent); border: 1px solid #C9CFD8; }
.btn-small, .btn-small-secondary { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn-small { background: var(--accent); color: #fff; border: 1px solid var(--accent); }
.btn-small-secondary { background: var(--surface); color: var(--muted); border: 1px solid #C9CFD8; }
.link-btn { background: none; border: none; padding: 6px 0; color: var(--accent); font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; }

.tabs { display: flex; gap: 24px; padding: 0 32px; background: var(--surface); border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { display: flex; align-items: center; gap: 8px; padding: 12px 4px 9px; border-bottom: 3px solid transparent;
  color: var(--muted); font-weight: 500; text-decoration: none; white-space: nowrap; }
.tabs a[aria-current="page"] { border-bottom-color: var(--accent); color: var(--ink); font-weight: 600; }
.badge, .count { display: inline-block; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; line-height: 20px; text-align: center; }
/* Lighter counter for sections on the act page, so it differs from the change-feed count */
.count-light { background: #E5EDF8; color: #1D4E89; }

.alert { margin: 16px 32px 0; padding: 12px 16px; border-radius: 8px; background: #FDECEC; color: #8A1C1C; border: 1px solid #F3C4C4; }
.notice { padding: 10px 14px; border-radius: 8px; background: var(--fi-bg); color: var(--fi-ink); }
.page { max-width: 1440px; margin: 0 auto; padding: 24px 32px 40px; display: flex; flex-direction: column; gap: 24px; }
.footer { max-width: 1440px; margin: 0 auto; padding: 0 32px 32px; }

/* layouts */
.layout-3 { display: grid; grid-template-columns: 260px minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.main-col, .side-col, .sidebar { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (max-width: 1100px) { .layout-3 { grid-template-columns: minmax(0,1fr) 300px; } .sidebar { grid-column: 1 / -1; } }
@media (max-width: 800px) {
  .layout-3, .layout-2 { grid-template-columns: minmax(0, 1fr); }
  .topbar, .tabs { padding-left: 16px; padding-right: 16px; }
  .page { padding: 16px; } .footer { padding: 0 16px 24px; } .alert { margin: 16px 16px 0; }
}

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px; }
.panel-label { margin: 4px 0 6px; padding: 0 8px; color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.panel-title { margin: 0 0 10px; font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.sidebar .panel { padding: 8px; }
.cat { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; }
.cat.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.cat:hover { background: var(--line-soft); }
.sep { height: 1px; margin: 8px; background: var(--line-soft); }
.new-cat input { width: 100%; margin-top: 4px; min-height: 40px; padding: 0 10px; border: 1px dashed #C9CFD8; border-radius: 6px; font: inherit; color: var(--accent); background: none; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.tile-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.tile-value { font-family: 'IBM Plex Serif', Georgia, serif; font-size: 30px; font-weight: 600; line-height: 1.2; }
.tile-caption { font-size: 13px; color: var(--muted); }

.feed-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 8px; }
.feed-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 8px 0 12px; border-bottom: 1px solid var(--line-soft); }
#review-all { margin-left: auto; }
.segmented { display: inline-flex; flex-wrap: wrap; border: 1px solid #C9CFD8; border-radius: 8px; overflow: hidden; }
.segmented a { padding: 7px 12px; font-size: 14px; color: var(--ink-2); text-decoration: none; border-right: 1px solid #C9CFD8; }
.segmented a:last-child { border-right: none; }
.segmented a[aria-current="true"] { background: var(--accent); color: #fff; font-weight: 600; }
.segmented.big a { padding: 10px 18px; font-size: 15px; }

.events { list-style: none; margin: 0; padding: 0; }
.event { padding: 14px 12px; margin: 0 -12px; border-bottom: 1px solid var(--line-soft); border-radius: 8px; }
.event.is-reviewed { background: var(--reviewed); }
.event.is-reviewed .event-title { color: var(--muted); font-weight: 500; }
.event-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.event-meta .when { margin-left: auto; }
.kind { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.act-link { font-weight: 600; text-decoration: none; }
.event-title { margin: 6px 0 4px; font-size: 15px; font-weight: 600; }
.event-summary { margin: 0 0 6px; font-size: 14px; color: var(--ink-2); }
.event-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.review { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; min-height: 32px; cursor: pointer; }
.review input { width: 18px; height: 18px; accent-color: var(--accent); }
.empty { padding: 24px 0; color: var(--muted); text-align: center; }
.older { display: block; margin: 12px auto 0; text-align: center; }

.chip { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; white-space: nowrap; }  /* a badge never wraps */
.chip-eu { background: var(--eu-bg); color: var(--eu-ink); }
.chip-fi { background: var(--fi-bg); color: var(--fi-ink); }
.chip-coming { background: var(--coming-bg); color: var(--coming-ink); }
.chip-none { background: var(--line-soft); color: var(--muted); }
.ok { color: var(--ok); font-weight: 500; } .warn { color: var(--warn); font-weight: 500; }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.timeline li { display: grid; grid-template-columns: 64px 1fr; gap: 10px; }
.tl-date { display: flex; flex-direction: column; line-height: 1.2; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; }
select, input, textarea { font: inherit; color: var(--ink); }
select { min-height: 40px; padding: 0 8px; border: 1px solid #C9CFD8; border-radius: 8px; background: var(--surface); }
.table-wrap { overflow-x: auto; }
.status-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.status-table th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.status-table td { padding: 12px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.cell-act { display: flex; align-items: center; gap: 8px; }

.act-header .act-name { margin-top: 8px; }
/* The official title under the heading: a smaller subtitle, so the familiar name and number lead */
.act-title { margin: 2px 0 4px; color: var(--ink-2); font-size: 14px; line-height: 1.45; max-width: 860px; }
.act-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.act-actions form { margin: 0; }
.note { width: 100%; padding: 10px; border: 1px solid #C9CFD8; border-radius: 8px; resize: vertical; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; margin: 0; font-size: 14px; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; word-break: break-word; }

.search label { display: block; margin: 16px 0 6px; font-weight: 500; }
.search-row { display: flex; gap: 8px; }
.search-row input { flex: 1; min-height: 44px; padding: 0 12px; border: 1px solid #C9CFD8; border-radius: 8px; }
.result { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.result-main { display: flex; flex-direction: column; gap: 4px; }
.result-fields { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.result-fields input[name=short_name] { min-height: 36px; padding: 0 8px; border: 1px solid #C9CFD8; border-radius: 6px; margin-left: 6px; }
.result-fields fieldset { border: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.check { display: inline-flex; gap: 6px; align-items: center; }
.cat-block { border-bottom: 1px solid var(--line-soft); padding: 10px 0; }
.cat-block summary { cursor: pointer; display: flex; justify-content: space-between; gap: 8px; font-weight: 500; min-height: 32px; align-items: center; }
.inline { display: inline; margin: 0; }
.plain { list-style: none; padding: 0; margin: 8px 0 0; }
.cat-act { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.cat-act form { margin-left: auto; }

/* sidebar: collapsible sections and thin rail */
.sidebar-toggle-row { display: flex; justify-content: flex-end; }
.sidebar-toggle-row .link-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; min-height: 36px; }
.cat-section > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  min-height: 44px; margin: 0; padding: 6px 8px; border-radius: 6px; }
.cat-section > summary::-webkit-details-marker { display: none; }
.cat-section > summary:hover { background: var(--line-soft); }
.cat-section[open] .chev { transform: rotate(90deg); }
.chev { transition: transform .15s; flex: 0 0 auto; }
.cat-list { display: flex; flex-direction: column; gap: 2px; padding-bottom: 6px; }
.cat-selected { margin: 0 8px 8px; color: var(--ink-2); }
.cat-section[open] + .cat-selected { display: none; }
.layout-3.collapsed { grid-template-columns: 48px minmax(0, 1fr) 320px; }
.layout-3.collapsed .sidebar { display: none; }
.sidebar-rail { display: flex; flex-direction: column; gap: 8px; align-items: center; padding: 8px 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.sidebar-rail[hidden] { display: none; }
.rail-btn { width: 40px; height: 40px; display: grid; place-items: center; border: none; border-radius: 8px;
  background: none; color: var(--accent); cursor: pointer; }
.rail-btn:hover { background: var(--accent-soft); }
@media (max-width: 1100px) { .layout-3.collapsed { grid-template-columns: minmax(0,1fr) 300px; } .sidebar-rail { flex-direction: row; grid-column: 1 / -1; padding: 4px 8px; } }
@media (max-width: 800px) { .layout-3.collapsed { grid-template-columns: minmax(0,1fr); } }

.count-muted { background: var(--line-soft); color: var(--muted); }
.chip-pending { background: var(--eu-bg); color: var(--eu-ink); }  /* as in the mockup and the Vireillä panel */
.has-tip { cursor: help; }
.filter-label { font-size: 13px; color: var(--muted); align-self: center; }
.regular { font-weight: 400; }
.related li { padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.related li:last-child { border-bottom: none; }
.rel-state { margin-left: auto; }
.btn-following { color: var(--ok); }
.layout-add { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.layout-add > nav.panel { padding: 8px; }
@media (max-width: 800px) { .layout-add { grid-template-columns: minmax(0, 1fr); } }
/* Lähteet ja tiedot: section menu on the left, kept in view while scrolling */
.src-layout { grid-template-columns: 220px minmax(0, 1fr); }
.src-nav { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; }
.src-sections { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.src-sections > section { scroll-margin-top: 16px; }
/* Next to the section menu: three source cards a row (two, then one, on narrower screens) */
.src-sections .source-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1200px) { .src-sections .source-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .src-sections .source-cards { grid-template-columns: minmax(0, 1fr); } }
/* Compact enough for three a row on a 13" laptop: the name wraps before the status, a date stays on one line */
.src-sections .source-card { padding: 14px; }
.src-sections .source-card h3 { flex-wrap: wrap; row-gap: 2px; font-size: 15px; }
.src-sections .source-card dl { font-size: 13px; gap: 4px 10px; }
.src-sections .source-card dd { overflow-wrap: anywhere; }
.src-sections .source-card dl:not(.source-parts) dd { white-space: nowrap; overflow-wrap: normal; }
/* Säädökset tietokannassa: long headings wrap, so the table fits next to the section menu */
#tietokanta .data-table th { white-space: normal; vertical-align: bottom; }
html:has(.src-nav) { scroll-behavior: smooth; }
@media (max-width: 800px) { .src-nav { position: static; } }
.cat-title { margin-bottom: 0; }
.catalogue .cat-act { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.catalogue .cat-act:last-child { border-bottom: none; }
.search-results { margin-top: 8px; border-top: 1px solid var(--line-soft); padding-top: 12px; }
.feed-head .segmented { align-self: center; }
.event-foot > span:empty { display: none; }

/* ---- Muutosseuranta, as in the mockup ---- */
.layout-feed { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
.layout-feed.collapsed { grid-template-columns: 48px minmax(0, 1fr); }
.layout-feed.collapsed .sidebar { display: none; }
.feed-main { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.page-title { font-size: 30px; line-height: 1.2; margin: 0; }
.page-head p { margin: 4px 0 0; }
.feed-row { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.feed-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
/* Muutosseuranta: view choices (type pills, Piilota tarkistetut) above the card, on the page background */
.feed-col { min-width: 0; }
.feed-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.feed-filters-gap { flex: 1 1 0; }
.feed-filters .check-label { min-height: 36px; }
.feed-row > .side-col { margin-top: 48px; }  /* tops level with the card below the choices row */
.pill { height: 36px; padding: 0 12px; display: inline-flex; align-items: center; border-radius: 18px; border: 1px solid #C9CFD8;
  background: var(--surface); color: var(--ink); font-size: 14px; text-decoration: none; }
.pill:hover { border-color: var(--accent); color: var(--ink); }
.pill[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.feed-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 10px 20px; border-bottom: 1px solid var(--line); border-radius: 10px 10px 0 0; }
.hide-form { margin: 0; }
.check-label { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; cursor: pointer; }
.check-label input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.feed-count { font-weight: 600; color: var(--ink); }
.btn-outline { margin-left: auto; height: 36px; padding: 0 12px; border: 1px solid #C9CFD8; border-radius: 8px; background: var(--surface);
  color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.btn-outline:hover { border-color: var(--accent); }
.item { display: flex; gap: 6px; padding: 18px 20px 18px 10px; border-bottom: 1px solid var(--line-soft); background: var(--surface); }
.item.is-reviewed { background: var(--reviewed); }
.item-check { flex: 0 0 44px; width: 44px; height: 44px; margin-top: -10px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.item-check input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.item-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.type-tag { padding: 1px 8px; border-radius: 4px; background: var(--line-soft); color: #3D4756; font-size: 12px; font-weight: 600; }
.item-act { font-size: 14px; color: var(--muted); text-decoration: none; }
/* The act name is a link like the ones on the "Muuttaa säädöksiä" line; "5 seurattua säädöstä" stays plain text */
a.item-act { color: var(--accent); text-decoration: underline; }
a.item-act:hover { color: var(--accent-dark); }
.item-when { margin-left: auto; font-size: 13px; color: var(--muted); }
.item-title { margin: 0; font-size: 16px; font-weight: 600; }
/* A bill or proposal title in the feed opens its pop-up: blue like the bill links in Vireillä */
.item-title-link { color: var(--accent); text-decoration: none; background: none; border: none; padding: 0; font: inherit; text-align: left; cursor: pointer; }
.item-summary { margin: 0; color: var(--ink-2); }
/* The entry-into-force clause quoted from the source, apart from our own date line */
.item-quote { margin: 6px 0 0; padding: 2px 0 2px 12px; border-left: 3px solid var(--line); color: var(--muted); font-size: 14px; }
.item-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 13px; color: var(--muted); }
/* "Tarkistettu" and the link always on their own last line; the mark keeps its place
   when hidden, so ticking an item does not change its height */
.reviewed-mark { display: flex; visibility: hidden; align-items: center; gap: 4px; color: var(--fi-ink); font-weight: 600; }
.item.is-reviewed .reviewed-mark { visibility: visible; }
.foot-break { display: block; flex-basis: 100%; height: 0; }
.item-link { margin-left: auto; font-weight: 500; }
.feed-more { padding: 14px 20px; } .feed-more a { font-weight: 500; }
.feed-card .empty { padding: 28px 20px; }
.side-title { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 600; }
.pill-count { padding: 0 8px; border-radius: 10px; font-size: 13px; font-weight: 600; }
.pill-count-coming { background: var(--coming-bg); color: var(--coming-ink); }
.pill-count-pending { background: var(--eu-bg); color: var(--eu-ink); }
.side-col .panel > .muted { margin: 10px 0 0; }
.upcoming { display: flex; flex-direction: column; margin-top: 8px; }
.upcoming-row { display: flex; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.date-box { flex: 0 0 64px; height: 56px; border-radius: 8px; background: var(--coming-bg); color: var(--coming-ink); display: flex; flex-direction: column;
  align-items: center; justify-content: center; font-weight: 600; font-size: 13px; line-height: 1.3; }
.date-year { font-weight: 500; }
.upcoming-text { min-width: 0; }
.upcoming-act { font-weight: 600; color: var(--ink); text-decoration: none; }
.upcoming-act:hover { color: var(--accent); text-decoration: underline; }
.small-body { font-size: 14px; color: var(--ink-2); }
@media (max-width: 1100px) {
  .layout-feed, .layout-feed.collapsed { grid-template-columns: minmax(0, 1fr); }
  .feed-row { grid-template-columns: minmax(0, 1fr); }
  .feed-row > .side-col { margin-top: 0; }
}
@media (max-width: 800px) { .item-link, .btn-outline { margin-left: 0; } }

/* ---- profile button and menu panel ---- */
.profile-btn { position: relative; width: 44px; height: 44px; border-radius: 22px; border: 1px solid #C9CFD8; background: #EEF2F8;
  color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.profile-btn:hover { border-color: var(--accent); }
.alert-dot { position: absolute; top: 0; right: 0; width: 12px; height: 12px; border-radius: 6px; background: #C62828; border: 2px solid #fff; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(22, 33, 58, .35); opacity: 0; transition: opacity .2s; }
.drawer-backdrop.open { opacity: 1; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 100; width: min(400px, 100vw); background: var(--surface);
  box-shadow: -8px 0 32px rgba(22, 33, 58, .18); padding: 20px 24px; display: flex; flex-direction: column; gap: 20px;
  overflow-y: auto; transform: translateX(100%); transition: transform .2s ease-out; }
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border: none; border-radius: 8px; background: none; color: var(--ink); cursor: pointer; }
.icon-btn:hover { background: var(--line-soft); }
body.no-scroll { overflow: hidden; }
.status-box { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.status-box.is-ok { background: #F3F9F5; border-color: #CFE5D6; }
.status-box.is-bad { background: #FDF2F2; border-color: #F3C4C4; }
.status-line { display: flex; gap: 12px; align-items: flex-start; }
.status-light { flex: 0 0 12px; width: 12px; height: 12px; margin-top: 6px; border-radius: 6px; background: #2E7D4F; box-shadow: 0 0 0 4px rgba(46,125,79,.15); }
.is-bad .status-light { background: #C62828; box-shadow: 0 0 0 4px rgba(198,40,40,.15); }
.status-bad-line { display: block; color: #8A1C1C; }
.status-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.status-actions .btn-outline { margin-left: 0; }
.drawer-menu { display: flex; flex-direction: column; border-top: 1px solid var(--line-soft); }
.drawer-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 4px; min-height: 56px;
  border-bottom: 1px solid var(--line-soft); color: var(--ink); text-decoration: none; }
.drawer-item > span { display: flex; flex-direction: column; gap: 2px; }
.drawer-item:hover { background: var(--line-soft); }
.drawer-item svg { color: var(--accent); flex: 0 0 auto; }
.alert a { color: #8A1C1C; font-weight: 600; }

/* ---- Lähteet ja tiedot, Asetukset ---- */
.subnav { display: flex; flex-wrap: wrap; gap: 6px; }
.source-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.source-card { border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.source-card.is-bad { border-color: #F3C4C4; background: #FDF2F2; }
.source-card h3 { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 16px; }
.source-card .status-light { margin-top: 0; }
.source-card dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 6px 0 0; font-size: 14px; }
.source-card dt { color: var(--muted); } .source-card dd { margin: 0; }
/* Last on the card, below a line: what the check does */
.source-task { margin: 6px 0 0; padding-top: 8px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); line-height: 1.45; }
/* The EUR-Lex card: one line per part of the pipeline */
.source-card dl.source-parts { margin: 6px 0 0; padding-top: 8px; border-top: 1px solid var(--line); }
.error-text { color: #8A1C1C; font-size: 13px; word-break: break-word; }
.flag-list { list-style: none; margin: 0; padding: 0; }
.flag-list li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.flag-list li:last-child { border-bottom: none; }
.flag-icon { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 12px; background: var(--coming-bg); color: var(--coming-ink);
  display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 720px; }
.data-table th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.ok-text { color: var(--ok); font-weight: 600; } .fail-text { color: #8A1C1C; font-weight: 600; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 0; }
.summary-grid div { border: 1px solid var(--line-soft); border-radius: 8px; padding: 10px 12px; }
.summary-grid dt { font-size: 13px; color: var(--muted); } .summary-grid dd { margin: 0; font-size: 20px; font-weight: 600; font-family: 'IBM Plex Serif', Georgia, serif; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; margin-bottom: 8px; }
.section-head h2 { margin: 0; }
.settings-form { display: flex; flex-direction: column; gap: 20px; max-width: 640px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; }
.field .hint { margin: 4px 0 0; }
.field input, .field select { min-height: 44px; padding: 0 10px; border: 1px solid #C9CFD8; border-radius: 8px; background: var(--surface); width: 140px; }
.inline-form { display: inline; margin: 0; }
.danger-link { background: none; border: none; padding: 0; color: #8A1C1C; font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.page-intro { margin: 4px 0 0; }

.quiet-link { color: inherit; text-decoration: none; }
.quiet-link:hover { color: var(--accent); }
.btn-outline:disabled { opacity: .5; cursor: default; }

/* ---- Listat ---- */
.list-nav { padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.list-card { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.list-card:hover { background: var(--line-soft); }
.list-card.active { background: var(--accent-soft); }
.list-card-name { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stack-form { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
.stack-form .field input, .stack-form .field select { width: 100%; }
.list-title { font-size: 26px; }
.list-sub { margin-top: 24px; }
.rename summary { list-style: none; display: inline-block; }
.rename summary::-webkit-details-marker { display: none; }
.rename-row { margin-top: 8px; max-width: 520px; }
.list-danger { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.danger-link:disabled { color: var(--muted); text-decoration: none; cursor: default; }
a.menu-item { color: var(--accent); font-weight: 500; text-decoration: none; }
a.menu-item:hover { background: var(--line-soft); }
.menu-link-label { display: inline-flex; align-items: center; gap: 8px; }
.danger-link { white-space: nowrap; }

/* ---- own category editing ---- */
.cat-form { display: flex; flex-direction: column; gap: 20px; }
.cat-form .field input { width: min(100%, 420px); }
.cat-acts { border: none; padding: 0; margin: 0; }
.cat-legend { font-weight: 600; font-size: 16px; margin-bottom: 10px; }
.cat-checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 2px 16px; margin-bottom: 12px; }
.check-row { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 8px; border-radius: 6px; cursor: pointer; }
.check-row:hover { background: var(--line-soft); }
.check-row input { width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--accent); }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.form-actions .btn-outline { margin-left: 0; display: inline-flex; align-items: center; text-decoration: none; }
.cat-row { display: flex; align-items: center; gap: 2px; }
.cat-row .cat { flex: 1 1 auto; min-width: 0; }
.cat-edit { flex: 0 0 auto; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); }
.cat-edit:hover { background: var(--line-soft); color: var(--accent); }
.ext-add { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.short-input { min-height: 34px; width: 120px; padding: 0 8px; border: 1px solid #C9CFD8; border-radius: 6px; margin-left: 4px; }

/* ---- bills and proposals ---- */
.pending-list { display: flex; flex-direction: column; margin-top: 8px; }
.pending-row { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.pending-head { display: flex; align-items: center; gap: 8px; }
.pending-open { font-weight: 600; padding: 0; text-align: left; }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-top: 4px; }
.step { display: flex; flex-direction: column; gap: 4px; }
.step-bar { height: 6px; border-radius: 3px; background: var(--line); }
.step-bar.done { background: var(--accent); }
.step span { font-size: 12px; color: var(--muted); }
.steps-wide { margin: 8px 0 4px; }
.prop-dialog { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); border: none; border-radius: 12px; padding: 24px;
  box-shadow: 0 16px 48px rgba(22,33,58,.25); color: var(--ink); }
.prop-dialog::backdrop { background: rgba(22,33,58,.4); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dialog-title { font-family: 'IBM Plex Serif', Georgia, serif; font-size: 22px; margin: 6px 0 0; }
.dialog-lead { margin: 8px 0 16px; color: var(--ink-2); }
.dialog-section { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.prop-dialog .form-actions { margin-top: 16px; }
/* The two links at the bottom of the pop-up: same height, width and type */
.prop-dialog .form-actions a { flex: 1 1 0; justify-content: center; min-height: 44px; padding: 0 16px; font-size: 15px; font-weight: 600; text-align: center; }
/* "Vain ylläpitäjä" beside menu items that only the administrator sees */
.admin-tag { margin-left: 6px; vertical-align: 1px; white-space: nowrap; }
.tag-outline { padding: 0 6px; border: 1px solid #C9CFD8; border-radius: 4px; font-size: 12px; font-weight: 500; color: var(--muted); }
.pending-row .small-body { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.chip-repealed { background: #F3E8E8; color: #7A1F1F; }
.date-note { margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Is an amending act included in the consolidated text? (feed items, act history) */
.cons-mark { font-size: 12px; white-space: nowrap; }
.cons-mark.muted { font-weight: 400; }
/* Side panels on Muutosseuranta show three items until expanded */
.capped:not(.expanded) > .extra { display: none; }
.show-more { margin-top: 10px; }
/* Panel header with a link on the right (e.g. Aikajana) */
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.panel-link { font-size: 14px; font-weight: 500; }
.panel-link[aria-disabled="true"] { cursor: default; }
.nowrap { white-space: nowrap; }
/* Säädöskatsaus: on narrower screens the date lines may wrap, so the table never needs sideways scrolling */
@media (max-width: 1300px) { .status-table .nowrap { white-space: normal; } }
/* Säädöskatsaus: the category number is a count of acts, not something to review */
.count.count-neutral { background: var(--line-soft); color: var(--muted); }
/* Säädöskatsaus table inside a feed-style card */
.feed-card > .table-wrap { padding: 4px 20px 12px; }
/* Page title with the filter pills on the same line, right-aligned */
.page-head-filters { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.page-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.feed-card > .table-wrap:first-child { padding-top: 8px; }
/* Number of acts inside a filter pill (Säädöskatsaus) */
.pill-num { margin-left: 6px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--line-soft); color: var(--muted);
  font-size: 12px; font-weight: 600; line-height: 20px; text-align: center; }
.pill[aria-current="true"] .pill-num { background: rgba(255,255,255,.22); color: #fff; }
/* Sortable column headers (Säädöskatsaus) */
.sort-link { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.sort-link:hover { color: var(--accent); }
.sort-link.sorted { color: var(--ink); }
.sort-arrow { color: var(--accent); font-weight: 700; }
.check-label.is-disabled { color: var(--muted); cursor: default; }
.feed-filters { align-items: center; }
/* Sisältö choices on the Listat page */
.content-fields { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; }
.content-fields legend { font-weight: 600; margin-bottom: 4px; }
.content-edit { max-width: 360px; margin-bottom: 8px; }
.content-edit button { align-self: flex-start; margin-top: 4px; }
.content-fields input[type="checkbox"] { width: auto; height: auto; min-height: 0; padding: 0; margin: 0; flex: 0 0 auto; }
.content-fields .check-label { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.content-edit button { margin-left: 0; margin-right: auto; }
/* Listat: list header */
.list-head { align-items: flex-start; }
.list-title-row { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.list-stats { margin: 4px 0 0; padding: 0; list-style: none; line-height: 1.6; font-size: 14px; }  /* same font and colour as the page subtitles */
.list-title-row .link-btn { font-weight: 500; }
.list-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.list-actions .btn-outline { margin-left: 0; height: 44px; padding: 0 16px; font-weight: 600; }
.rename-row[hidden] { display: none; }
.later-tag { color: var(--muted); font-size: 13px; }
/* "Valittuna" on the Listat page: the list in use */
.chip-selected { background: var(--fi-bg); color: var(--ok); }
.list-sub-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.list-sub-head { margin-top: 24px; }
.list-sub-head .list-sub { margin-top: 0; margin-bottom: 0; }
/* Listat: the two list buttons are the same size */
.list-btn { min-width: 230px; height: 44px; justify-content: center; }
.list-actions .btn-outline.list-btn { display: inline-flex; align-items: center; }
/* Lisää seurantalistalle: title with "Avaa muutosseuranta" on the right */
.add-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.add-head h1 { margin: 0; }
.add-head .btn-outline { margin-left: 0; display: inline-flex; align-items: center; height: 44px; padding: 0 16px; font-weight: 600; color: var(--ink); text-decoration: none; }
/* Pop-up: a little air between the facts and the stage bar */
.prop-dialog .facts + .steps { margin-top: 18px; }
.note-list { margin-left: 8px; font-weight: 400; }  /* "Lista: …" next to the Muistiinpanot heading */
.act-meta { margin: 6px 0 0; }
.history-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; }
.history-cons { text-align: right; }
/* Act page header: name | buttons on the same row, facts and check time below on the left */
.act-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 24px; align-items: center; }
.act-header > * { grid-column: 1; }
.act-header > .act-actions { grid-column: 2; grid-row: 2; margin: 0; justify-content: flex-end; }
.act-header > .act-name { grid-row: 2; }
@media (max-width: 1180px) {  /* three buttons need room: below the facts on narrower screens */
  .act-header { grid-template-columns: minmax(0, 1fr); }
  .act-header > .act-actions { grid-column: 1; grid-row: auto; justify-content: flex-start; }
}
.act-number { color: var(--muted); font-weight: 400; }  /* the act's number after its name */
/* Act summary pop-up from the feed: close button in the corner, facts, two buttons */
.act-popup { width: min(640px, calc(100vw - 32px)); }  /* a dialog is already the frame for the close button */
.act-popup > .dialog-close { position: absolute; top: 16px; right: 16px; }
.act-popup .dialog-title { padding-right: 40px; }
/* Same rhythm as the bill pop-up: separated sections with a thin line between them */
.act-popup-desc { margin-top: 16px; }
.act-popup-desc .panel-title { margin: 0 0 6px; }
.act-popup .facts { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.act-popup .dialog-section { margin-top: 18px; padding-top: 14px; }
.act-popup .form-actions { margin-top: 20px; }
/* Säädöskatsaus Tila column: badges stacked, each as wide as its text */
.status-chips { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
/* Lisää seurantalistalle: options under the Finnish search box */
.search-options { display: flex; flex-wrap: wrap; gap: 4px 24px; margin-top: 8px; }
/* not the heading style of ".search label": normal weight, box and text on one line */
.search .search-options .check-label { display: flex; align-items: center; gap: 8px; margin: 0; min-height: 32px; font-weight: 400; font-size: 14px; }
.search-options .check-label input { width: 18px; height: 18px; margin: 0; flex: 0 0 auto; }
.act-popup-facts { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line-soft); }
/* simple pop-up: name on the left, follow button on its right (clear of the × button) */
.act-popup-titlerow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-right: 40px; }
.act-popup-titlerow .dialog-title { padding-right: 0; }
.act-popup-titlerow form { margin: 0; flex: 0 0 auto; }
.act-popup-facts p { margin: 0; }
.act-popup-facts p + p { margin-top: 4px; }
/* act page Tulossa voimaan: no act name above, so the amending act's title is the heading of each row */
.upcoming-title { font-weight: 600; color: var(--ink); }
.back-link { display: inline-flex; align-items: center; gap: 4px; }
/* Lisää seurantalistalle: the list's own entry, with an icon */
.cat.cat-onlist { align-items: center; gap: 10px; }
.cat-onlist .onlist-icon { color: var(--accent); flex: 0 0 auto; }
.cat-onlist .onlist-text { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.cat-onlist .onlist-label { font-weight: inherit; color: inherit; }

/* Aikajana: one row per act, markers on a month axis */
/* Lines up with Säädöskatsaus and Muutosseuranta when their category column is folded (48px rail + 24px gap) */
.page-wide { padding: 0 0 8px 72px; display: flex; flex-direction: column; gap: 24px; min-width: 0; }
@media (max-width: 1100px) { .page-wide { padding-left: 0; } }
.tl-card { padding: 20px 24px; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.tl-legend span { display: inline-flex; align-items: center; gap: 6px; }
/* Sideways scrolling only on narrow screens; room above and below for the today line so no vertical scroll appears */
.tl-scroll { overflow-x: auto; overflow-y: hidden; padding-bottom: 6px; }
.tl { min-width: 900px; }
.tl-grid-row { display: grid; grid-template-columns: 230px repeat(var(--tl-cols), minmax(46px, 1fr)); gap: 3px; align-items: stretch; }
.tl-row { margin-top: 4px; }
/* Header: the year at the left over a thin line; quarters as plain labels (the gaps between quarters group the months) */
.tl-year { padding: 2px 0 4px 2px; border-bottom: 1px solid #B8C0CC; font-size: 13px; font-weight: 600; color: var(--ink-2); text-align: left; }
.tl-quarter { padding: 4px 0; font-size: 13px; color: var(--muted); text-align: center; }
.tl-name { display: flex; align-items: center; gap: 6px; padding: 6px 12px 6px 0; font-weight: 600; line-height: 1.3; }
.tl-cell { min-height: 44px; border-radius: 0; background: var(--bg); }
.tl-past { opacity: .45; }
.tl-q-start { margin-left: 5px; }  /* a small gap between quarters */
.tl-filled { position: relative; display: flex; align-items: center; justify-content: center; padding: 0; border: none;
  overflow: hidden; cursor: pointer; font: inherit; }
.tl-filled:hover, .tl-filled:focus-visible, .tl-filled.active { outline: 3px solid var(--ink); outline-offset: 1px; }
.tl-bands { position: absolute; inset: 0; display: flex; }
.tl-band { flex: 1; background-color: var(--tl-bg); }
.tl-cell-label { position: relative; padding: 0 3px; font-size: 12px !important; border-radius: 4px; background: rgba(255,255,255,.92); color: var(--ink);
  font-size: 13px; font-weight: 600; white-space: nowrap; }
.tl-swatch { display: inline-block; width: 16px; height: 12px; background-color: var(--tl-bg); }
/* Partial dates: a filled corner in the type's own colour */
.tl-part { background-image: linear-gradient(225deg, var(--tl-bd) 0 9px, transparent 9px); }
.tl-swatch.tl-part { background-image: linear-gradient(225deg, var(--tl-bd) 0 5px, transparent 5px); }
.tl-neutral { --tl-bg: var(--surface); --tl-bd: var(--muted); box-shadow: inset 0 0 0 1.5px var(--muted); }
/* Equal weight for every date type, in the app's own hues ("Muutos tulossa" orange, purple, FI green):
   a medium-strength fill without a border; --tl-bd (a few steps darker) colours the partial-date corner */
.tl-in { --tl-bg: #E6AC6E; --tl-bd: #A86A2C; }
.tl-applies { --tl-bg: #B39DDB; --tl-bd: #7A5DB5; }
.tl-transposition { --tl-bg: #8CC5A1; --tl-bd: #4E8C66; }
.tl-dialog { width: min(560px, calc(100vw - 32px)); }
.tl-dialog > .dialog-close { position: absolute; top: 16px; right: 16px; }
.tl-dialog .tl-detail-head { padding-right: 40px; }
/* A little air inside the pop-up: between the type chip, the act and the clause */
.tl-dialog .tl-item { padding: 12px 0; }
.tl-dialog .tl-item > div + div { margin-top: 8px; }
.tl-dialog .tl-item .item-quote { margin-top: 10px; line-height: 1.5; }
.tl-dialog .tl-detail-head:not(:first-child) { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.tl-detail-head { margin-bottom: 8px; }
.tl-item { padding: 8px 0; border-top: 1px solid var(--line-soft); }
.tl-item:first-of-type { border-top: none; }
@media (max-width: 700px) { .tl-grid-row { grid-template-columns: 140px repeat(var(--tl-cols), minmax(52px, 1fr)); } }
.tl-later { margin: 20px 0 0; }
/* Aikajana: today, a red line in the current month (continues across the gaps between rows) */
.tl-now { position: relative; overflow: visible; }
.tl-now::before { content: ""; position: absolute; z-index: 2; top: -4px; bottom: -4px; left: var(--tl-today); width: 2px;
  margin-left: -1px; background: #C62828; pointer-events: none; }
.tl-row:first-of-type .tl-now::before { top: -8px; }
.tl-today-key { display: inline-block; width: 2px; height: 14px; background: #C62828; }
.tl-filled.tl-now .tl-bands { overflow: hidden; }
.tl-cell-label { z-index: 3; }
.brand-tld { font-weight: 400; }

/* Login page and sign-out in the profile drawer */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 100%; max-width: 400px; padding: 32px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 8px 24px rgba(22,33,58,.08); }
.login-brand { margin-bottom: 24px; }
.login-title { font-size: 22px; margin-bottom: 12px; }
.login-form { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.login-form label { font-weight: 500; margin-top: 8px; }
.login-form input { min-height: 44px; padding: 0 12px; border: 1px solid #C9CFD8; border-radius: 8px; font: inherit; }
.login-form button { margin-top: 16px; min-height: 44px; }
.login-cmd { padding: 10px 12px; background: var(--bg); border-radius: 8px; font-size: 14px; }
.drawer-logout { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap;
  margin-top: 16px; }  /* no line of its own: the menu above already ends with one */
.login-card .alert { margin: 0 0 12px; }
.via-note { margin: 2px 0 6px; }
.btn-tiny { min-height: 28px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent);
  color: #fff; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn-tiny:hover { background: var(--accent-dark); }
.btn-tiny-on { background: transparent; color: var(--muted); border-color: transparent; padding: 0 4px; }
.btn-tiny-on:hover { background: transparent; border-color: transparent; color: var(--accent); text-decoration: underline; }
.related .rel-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: start; }
.related .rel-row .cell-act { align-items: flex-start; min-width: 0; }
.related .rel-row .cell-act .chip { flex: none; margin-top: 2px; }
.related .rel-desc { grid-column: 1 / -1; }
.related .rel-state { margin: 0; }
.btn-tiny { min-height: 26px; padding: 0 9px; font-size: 12.5px; }

/* Raportit: builder on the left, the report on the right; printing shows only the report */
.rep-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
/* Not sticky: the builder is taller than a laptop screen, and a sticky panel that does not fit scrolls oddly */
.rep-builder { display: flex; flex-direction: column; gap: 6px; }
.rep-h { margin: 10px 0 2px; font-size: 13px; font-weight: 600; color: var(--muted); }
.rep-h:first-of-type { margin-top: 0; }
.rep-tpls { display: flex; flex-direction: column; gap: 4px; }
.rep-tpl { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 14px; }
.rep-tpl:hover { border-color: var(--accent); color: var(--accent); }
.rep-tpl.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.rep-input { width: 100%; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 14px; background: var(--surface); color: var(--ink); }
.rep-dates { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; font-size: 13px; color: var(--muted); }
.rep-dates[hidden] { display: none; }
.rep-h-extra { margin-top: 14px; }
.rep-check-off { color: var(--muted); }
.rep-check { font-size: 14px; }
.rep-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.rep-actions .btn-primary, .rep-actions .btn-outline { justify-content: center; width: 100%; }
.rep-out { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
/* Download buttons: white like the app's other secondary buttons; only the icon in the colour its
   format is known by (Word blue, PDF red) */
.rep-out .btn-outline { display: flex; align-items: center; justify-content: center; gap: 8px; }
.rep-out .btn-outline svg, .tl-print svg { flex-shrink: 0; }
.btn-word svg { color: #2B579A; }
.btn-excel svg { color: #217346; }
.btn-pdf svg { color: #B42323; }
.rep-out[hidden] { display: none; }
.rep-stale { margin: 0; }
.rep-empty { display: flex; align-items: center; justify-content: center; min-height: 240px; color: var(--muted); text-align: center; }
.rep-is-stale { opacity: .4; }
.rep-doc { padding: 28px 32px; }
.rep-title { font-family: 'IBM Plex Serif', Georgia, serif; font-size: 24px; font-weight: 600; margin: 0 0 4px; }
.rep-sec { margin-top: 22px; }
.rep-sec-h { font-size: 17px; margin: 0 0 4px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.rep-cat { font-size: 14px; color: var(--muted); font-weight: 600; margin: 14px 0 4px; }
.rep-act { margin: 8px 0 10px; }
.rep-act-name { font-weight: 600; }
.rep-item { margin: 4px 0 0 18px; line-height: 1.45; }
.rep-note { margin: 4px 0 4px 18px; padding: 4px 8px; border-radius: 6px; background: #FFF8DB; font-size: 13px; }
.rep-foot { margin-top: 28px; padding-top: 10px; border-top: 1px solid var(--line); }
.rep-foot p { margin: 2px 0; }
@media (max-width: 1000px) { .rep-layout { grid-template-columns: minmax(0, 1fr); } }
@media print {
  .topbar, .tabs, .rep-builder, .rep-head, .drawer, .drawer-backdrop { display: none !important; }
  body, .page { background: #fff; }
  .rep-layout { display: block; }
  .rep-doc { border: none; box-shadow: none; padding: 0; }
  .rep-doc a { color: inherit; }
}

/* Aikajana: window and source choices with the print button; printing gives the chart alone, landscape */
.tl-filters { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin-bottom: -12px; }  /* 12px to the card, as Muutosseuranta's filters */
.tl-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; }
.tl-print { display: inline-flex; align-items: center; gap: 8px; }
.print-only { display: none; }
@page tl { size: A4 landscape; margin: 12mm; }
@media print {
  .print-only { display: block; }
  .tl-filters, .tl-print, .tl-dialog, .footer { display: none !important; }
  .page-wide { padding: 0; gap: 10px; }
  .tl-card { page: tl; border: none; box-shadow: none; padding: 0; }
  .tl-scroll { overflow: visible; padding-bottom: 0; }
  .tl { min-width: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tl-filled { cursor: default; }
  .tl-name a { color: inherit; text-decoration: none; }
}
.drawer-user { margin-top: 2px; }
/* Listat: "Avaa säädöskatsaus" with a forward arrow */
.list-go { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.list-go svg { flex-shrink: 0; }

/* Public front page (landing.html): large type and open space, unlike the dense working views */
.lp { background: #FBFAF7; font-size: 16px; }
.lp-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1180px; margin: 0 auto; padding: 20px 32px; }
.lp-top .btn-primary { min-height: 40px; }
.lp-eyebrow { margin: 0 0 14px; font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.lp-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; align-items: center;
  max-width: 1180px; margin: 0 auto; padding: 56px 32px 72px; }
.lp-h1 { margin: 0 0 20px; font-size: clamp(34px, 4.6vw, 54px); line-height: 1.12; letter-spacing: -.01em; text-wrap: balance; }
.lp-lead { margin: 0 0 28px; max-width: 34em; font-size: 18px; line-height: 1.6; color: var(--ink-2); }
.lp-cta { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 24px; }
.lp-btn { min-height: 50px; padding: 0 26px; font-size: 16px; }
.lp-more { font-weight: 500; text-decoration: none; }
.lp-more::after { content: " ↓"; }
.lp-more:hover { text-decoration: underline; }
.lp-note { margin: 18px 0 0; font-size: 14px; color: var(--muted); }

/* The app drawn as a picture */
.lp-shot { position: relative; padding: 36px 18px 26px 0; }
.lp-window { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(22,33,58,.28), 0 8px 20px rgba(22,33,58,.06); font-size: 14px; }
.lp-win-tabs { display: flex; gap: 20px; padding: 0 18px; border-bottom: 1px solid var(--line); overflow: hidden; white-space: nowrap; }
.lp-win-tabs span { padding: 12px 0 9px; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 500; }
.lp-win-tabs span.on { border-bottom-color: var(--accent); color: var(--ink); font-weight: 600; }
.lp-win-tabs i { display: inline-block; min-width: 18px; margin-left: 4px; padding: 0 5px; border-radius: 9px; background: var(--accent);
  color: #fff; font-size: 11px; font-style: normal; line-height: 18px; text-align: center; }
.lp-row { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.lp-row:last-child { border-bottom: none; }
.lp-row.done { background: var(--reviewed); }
.lp-row.done .lp-row-title { color: var(--muted); }
.lp-row p { margin: 0; }
.lp-box { width: 20px; height: 20px; margin-top: 1px; border: 2px solid #9AA3B2; border-radius: 5px; display: flex; align-items: center; justify-content: center; }
.lp-box.checked { background: var(--accent); border-color: var(--accent); }
.lp-row-top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 3px; }
.lp-tag { padding: 0 7px; border-radius: 4px; font-size: 12px; font-weight: 600; line-height: 20px; }
.lp-tag.fi { background: var(--fi-bg); color: var(--fi-ink); }
.lp-tag.eu { background: var(--eu-bg); color: var(--eu-ink); }
.lp-act { font-size: 13px; color: var(--muted); }
.lp-chip { margin-left: auto; padding: 0 8px; border-radius: 10px; background: var(--coming-bg); color: var(--coming-ink); font-size: 12px; font-weight: 600; line-height: 20px; }
.lp-row-title { font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lp-row-meta { margin-top: 3px; font-size: 13px; color: var(--muted); }
.lp-float { position: absolute; display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; box-shadow: 0 8px 20px rgba(22,33,58,.12); font-size: 13px; font-weight: 500; white-space: nowrap; }
.lp-float b { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.lp-float.f1 { top: -4px; right: 0; }
.lp-float.f2 { top: 43%; right: -6px; }
.lp-float.f2 b { background: #C9741A; }
.lp-float.f3 { bottom: 6px; left: -18px; }
.lp-float.f3 b { background: var(--accent); }

.lp-sources { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px 40px; padding: 26px 32px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.lp-sources p { margin: 0; font-size: 14px; color: var(--muted); }
.lp-sources ul { display: flex; flex-wrap: wrap; gap: 8px 36px; margin: 0; padding: 0; list-style: none;
  font-family: 'IBM Plex Serif', Georgia, serif; font-size: 20px; font-weight: 600; color: var(--ink-2); }

.lp-section { max-width: 1180px; margin: 0 auto; padding: 80px 32px 0; }
.lp-h2 { margin: 0 0 36px; max-width: 20em; font-family: 'IBM Plex Serif', Georgia, serif; font-size: clamp(26px, 3vw, 36px); font-weight: 600; line-height: 1.2; text-wrap: balance; }
.lp-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.lp-card { padding: 26px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.lp-card h3, .lp-steps h3 { margin: 0 0 8px; font-size: 18px; font-weight: 600; }
.lp-card p, .lp-steps p { margin: 0; color: var(--ink-2); line-height: 1.6; }
.lp-icon { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-bottom: 18px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent); }
.lp-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; margin: 0; padding: 0; list-style: none; }
.lp-num { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-bottom: 16px; border-radius: 50%;
  background: var(--ink); color: #fff; font-family: 'IBM Plex Serif', Georgia, serif; font-size: 18px; font-weight: 600; }
.lp-closing { max-width: 1180px; margin: 88px auto 0; padding: 0 32px; }
.lp-closing { text-align: center; }
.lp-closing .lp-h2 { margin: 0 auto 24px; }
.lp-foot { max-width: 1180px; margin: 88px auto 0; padding: 24px 32px 40px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: 14px; color: var(--muted); }
.lp-foot p { margin: 0; }
html:has(.lp) { scroll-behavior: smooth; }
@media (max-width: 1000px) {
  .lp-hero { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-top: 32px; }
  .lp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .lp-top, .lp-hero, .lp-section, .lp-closing, .lp-foot { padding-left: 16px; padding-right: 16px; }
  .lp-top .brand { font-size: 17px; }
  .lp-grid, .lp-steps { grid-template-columns: minmax(0, 1fr); }
  .lp-steps { gap: 28px; }
  .lp-section { padding-top: 56px; }
  .lp-shot { padding: 0; }
  .lp-float { display: none; }
  .lp-win-tabs { gap: 14px; padding: 0 12px; font-size: 13px; }
  .lp-row { padding: 12px; }
}

/* Käyttäjät (administrator): invitation form, the link shown once, account table */
.invite-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-top: 10px; }
.invite-form .field { flex: 1 1 280px; max-width: 420px; }
.invite-form input { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid #C9CFD8; border-radius: 8px; font: inherit; }
.link-panel { border-color: var(--accent); background: var(--accent-soft); }
.link-panel p { margin: 6px 0; }
.link-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.link-row input { flex: 1 1 320px; min-height: 44px; padding: 0 12px; border: 1px solid #C9CFD8; border-radius: 8px; background: var(--surface);
  font: 14px ui-monospace, SFMono-Regular, Menlo, monospace; }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions form + form { margin-left: 16px; }
.link-btn.danger { color: #8A1C1C; }
.users-msg { margin: 0; }

/* Anna palautetta: the form, and the list of sent feedback */
.feedback-page .panel, .feedback-page .notice, .feedback-page .alert { max-width: 860px; box-sizing: border-box; }
.feedback-form textarea { width: 100%; padding: 10px 12px; border: 1px solid #C9CFD8; border-radius: 8px; background: var(--surface); resize: vertical; line-height: 1.5; }
.feedback-form .field input { width: min(100%, 420px); }
.feedback-kinds { border: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; }
.feedback-kinds legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.feedback-kinds label { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; cursor: pointer; }
.feedback-filter { display: flex; gap: 16px; flex-wrap: wrap; }
.feedback-filter a { color: var(--accent); text-decoration: none; padding: 4px 0; }
.feedback-filter a[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom: 2px solid var(--accent); }
.feedback-list { list-style: none; margin: 8px 0 0; padding: 0; }
.feedback-list li { padding: 14px 0; border-top: 1px solid var(--line-soft); }
.feedback-list li:first-child { border-top: none; padding-top: 4px; }
.feedback-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.feedback-meta a { color: var(--accent); }
.feedback-text { margin: 8px 0 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.feedback-actions { text-align: left; }

/* Footer on every signed-in page: sources, feedback link, © line */
.site-footer { text-align: center; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line-soft); padding-top: 16px; margin-top: 24px; }
.site-footer p { margin: 0 0 4px; }
