/* Mentalvia: kohti parempaa mielenterveyttä / towards better mental health
   Follows STYLEGUIDE.md strictly. Change the tokens below, not individual rules.
   Look: white pages, thin lines, light headings, colour only where it carries meaning.
   Interaction: every clickable element gets a solid green outline on hover (desktop) and on tap (mobile).
   No background colour changes on hover, no shadows, no gradients, no icons. */

@font-face { font-family: "Enorm"; src: url("../fonts/Enorm-Light.woff") format("woff"), url("../fonts/Enorm-Light.otf") format("opentype"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Enorm"; src: url("../fonts/Enorm-Regular.woff") format("woff"), url("../fonts/Enorm-Regular.otf") format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Enorm"; src: url("../fonts/Enorm-Medium.woff") format("woff"), url("../fonts/Enorm-Medium.otf") format("opentype"); font-weight: 500; font-display: swap; }

:root {
  /* ---- Colour: the only colours allowed ---- */
  --green: #438000;          /* logo green: buttons, links, selected states, footer */
  --ink: #1c2416;            /* text, headings, strong lines */
  --muted: #5c6653;          /* secondary text */
  --line: #dfe5d8;           /* thin dividers, card borders */
  --field: #b4bfa8;          /* form field borders, dashed states */
  --white: #fff;             /* page background, text on green */

  /* ---- Type ---- */
  --font: "Enorm", Arial, Helvetica, sans-serif;
  --fw-light: 300;           /* large headings, big numbers */
  --fw-regular: 400;         /* body text */
  --fw-medium: 500;          /* small headings, labels, buttons */
  --fs-small: 15px;
  --fs-body: 17px;
  --fs-lead: 19px;
  --fs-h3: 21px;
  --fs-title: 26px;
  --fs-figure: 32px;
  --fs-h2: clamp(32px, 4vw, 52px);
  --fs-h1: clamp(40px, 5.4vw, 72px);
  --fs-display: clamp(40px, 6vw, 88px);
  --lh-none: 1;
  --lh-tight: 1.1;
  --lh-snug: 1.2;
  --lh-body: 1.6;

  /* ---- Space ---- */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 112px;

  /* ---- Shape ---- */
  --r-pill: 999px;           /* buttons, tags, chips, region choices, dots */
  --r-lg: 40px;              /* slide images, video */
  --r: 24px;                 /* cards, panels, boxes, messages */
  --r-sm: 12px;              /* fields, answer options, small images */
  --r-xs: 4px;               /* text links (for the hover outline) */
  --bw: 1px;                 /* every border and divider */
  --bw-strong: 2px;          /* selected states and the hover/focus outline */
  --hover: var(--bw-strong) solid var(--green);
  --hover-offset: var(--s-1);

  /* ---- Layout ---- */
  --w-page: 1240px;
  --w-text: 840px;
  --w-form: 560px;
  --gutter: var(--s-6);
  --gutter-m: var(--s-4);
  --logo-header: 380px;
  --logo-header-m: 230px;
  --logo-header-s: 200px;
  --logo-footer: 400px;
  --logo-footer-m: 280px;
  --logo-admin: 200px;
  --target: 48px;            /* icon buttons, announcement bar height */
  --target-s: 32px;          /* slider dots, play/pause, close buttons */
  --control: 20px;           /* checkboxes and radio buttons */
  --icon: 14px;              /* icon inside a small button */
  --h-header: 136px;
  --h-header-m: 96px;
  --h-hero: 520px;
  --h-media: 420px;          /* slide image on desktop */
  --h-media-m: 260px;        /* slide image on phones */
  --h-article-image: 560px;
  --h-progress: 4px;
  --h-meter: 8px;
  --w-media: 1040px;         /* video, cookie banner */
  --w-hero-text: 820px;
  --measure: 40em;           /* reading widths, relative to the text size */
  --measure-wide: 60em;
  --measure-s: 30em;
  --measure-xs: 20em;
  --col-s: 200px;            /* minimum widths of grid columns */
  --col: 260px;
  --col-m: 280px;
  --col-l: 320px;
  --col-xl: 420px;
  --thumb-w: 160px;
  --thumb-h: 90px;
  --field-min: 90px;
  --field-min-s: 70px;

  /* ---- Components: every box, pill, notice and field uses these ---- */
  --box-pad: var(--s-6);         /* cards, panels, plans, results, admin cards */
  --box-pad-s: var(--s-5);       /* compact boxes (dashboard figures, editor side panels) and all boxes on phones */
  --tile-pad: var(--s-3);        /* media library tiles */
  --note-pad: var(--s-4) var(--s-5);   /* notices: alerts, flashes, AI introduction, waiting note */
  --chip-pad: var(--s-3) var(--s-5);   /* choices, tabs and filters */
  --tag-pad: var(--s-1) var(--s-3);    /* status tags */
  --btn-pad: var(--s-4) var(--s-6);
  --btn-pad-s: var(--s-2) var(--s-4);
  --field-pad: var(--s-3) var(--s-4);
  --cell-pad: var(--s-4) var(--s-3);
  --cell-pad-s: var(--s-2);

  /* ---- Motion ---- */
  --t-fast: .2s;
  --t-slow: .6s;
}

* { box-sizing: border-box; min-width: 0; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--white); color: var(--ink); font: var(--fw-regular) var(--fs-body)/var(--lh-body) var(--font); }
img { max-width: 100%; height: auto; }
a { color: var(--green); text-underline-offset: var(--s-1); }
h1, h2, h3 { font-weight: var(--fw-light); line-height: var(--lh-tight); margin: 0 0 var(--s-4); color: var(--ink); }
h1, h2, h3, .mission-text, .tl-name, .nav a { overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: var(--fw-medium); }
p { margin: 0 0 var(--s-4); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--s-2); top: calc(-1 * var(--s-8)); background: var(--white); color: var(--ink); padding: var(--s-2) var(--s-4); border: var(--bw) solid var(--ink); border-radius: var(--r-pill); z-index: 50; }
.skip:focus { top: var(--s-2); }
.muted { color: var(--muted); }
.wrap { max-width: var(--w-page); margin: 0 auto; padding: 0 var(--s-6); }
.narrow { max-width: var(--w-text); }
.form-wrap { max-width: var(--w-form); }
.band { padding: var(--s-10) 0; }
.band-flush { padding-top: 0; }
.band-line { padding-top: 0; }
.band-line::before { content: ""; display: block; width: calc(min(var(--w-page), 100%) - 2 * var(--gutter)); margin: 0 auto var(--s-10); border-top: var(--bw) solid var(--line); }
.mt { margin-top: var(--s-8); }
.stack-gap > * + * { margin-top: var(--s-5); }
.lead-dark { font-size: var(--fs-lead); color: var(--muted); max-width: var(--measure); }
.note { margin-top: var(--s-6); font-size: var(--fs-small); color: var(--muted); max-width: var(--measure-wide); }
@media (max-width: 600px) { .wrap { padding: 0 var(--s-4); } .band { padding: var(--s-8) 0; } .band-line { padding-top: 0; } .band-line::before { width: calc(100% - 2 * var(--gutter-m)); margin-bottom: var(--s-8); } }

/* ---------- Hover, tap and focus: one solid outline for everything clickable ---------- */
a:hover, button:hover, summary:hover, label:hover, select:hover, input[type=file]:hover,
a:active, button:active, summary:active, label:active,
a:focus-visible, button:focus-visible, summary:focus-visible, select:focus-visible,
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible, input[type=file]:focus-visible {
  outline: var(--hover); outline-offset: var(--hover-offset);
}
.opts input:focus-visible, .chips input:focus-visible, .pkgs input:focus-visible { outline: none; }
.opts input:focus-visible + span, .opts label:has(input:focus-visible), .chips input:focus-visible + label, .pkgs input:focus-visible + label { outline: var(--hover); outline-offset: var(--hover-offset); }
.foot a:hover, .foot a:active, .foot a:focus-visible { outline-color: var(--white); }

/* ---------- Header ---------- */
.top { position: relative; z-index: 20; background: var(--white); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: var(--s-5); min-height: var(--h-header); }
.brand { line-height: 0; flex: none; border-radius: var(--r-sm); }
.brand img { width: var(--logo-header); }
.top-tools { display: flex; align-items: center; gap: var(--s-4); }
.burger { width: var(--target); height: var(--target); border: 0; border-radius: var(--r-sm); background: none; cursor: pointer; display: grid; place-content: center; gap: var(--s-2); padding: 0; }
.burger span { display: block; width: var(--target-s); height: var(--bw-strong); background: var(--ink); transition: transform var(--t-fast), opacity var(--t-fast); }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(calc(var(--s-2) + var(--bw-strong))) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(calc(-1 * (var(--s-2) + var(--bw-strong)))) rotate(-45deg); }
.nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--white); border-top: var(--bw) solid var(--line); border-bottom: var(--bw) solid var(--line); }
.nav.open { display: block; }
.nav-in { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--col-m)), 1fr)); gap: 0 var(--s-7); padding-top: var(--s-6); padding-bottom: var(--s-7); }
.nav a { display: block; padding: var(--s-4) 0; border-bottom: var(--bw) solid var(--line); color: var(--ink); text-decoration: none; font-size: var(--fs-figure); font-weight: var(--fw-light); line-height: var(--lh-snug); }
.nav a[aria-current] { color: var(--green); }

/* Region and language choice, inside the menu panel */
.nav-region { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-4); padding-top: var(--s-6); }
.rs-title { width: 100%; font-size: var(--fs-small); color: var(--muted); margin: 0; }
.nav .nav-region a { display: grid; padding: var(--chip-pad); border: var(--bw) solid var(--line); border-bottom: var(--bw) solid var(--line); border-radius: var(--r-pill); font-size: var(--fs-body); font-weight: var(--fw-regular); color: var(--ink); text-decoration: none; }
.nav .nav-region a span { font-weight: var(--fw-medium); }
.nav .nav-region a small { font-size: var(--fs-small); color: var(--muted); }
.nav .nav-region a[aria-current] { border-color: var(--green); }
.nav .nav-region a[aria-current] span { color: var(--green); }
.nav .nav-region a[aria-current] span::after { content: "\00a0\2713"; }

@media (max-width: 600px) {
  .top-in { min-height: var(--h-header-m); gap: var(--s-3); }
  .brand img { width: var(--logo-header-m); }
  .top-tools { gap: var(--s-2); }
  .nav a { font-size: var(--fs-title); }
}
@media (max-width: 420px) { .brand img { width: var(--logo-header-s); } }

/* ---------- Buttons and links ---------- */
.btn { display: inline-block; padding: var(--btn-pad); border: var(--bw) solid var(--green); border-radius: var(--r-pill); background: var(--green); color: var(--white); font: var(--fw-medium) var(--fs-body)/var(--lh-snug) var(--font); text-decoration: none; text-align: center; cursor: pointer; }
.btn-outline { background: var(--white); color: var(--green); }
.btn-small { padding: var(--btn-pad-s); font-size: var(--fs-small); }
.btn-block { display: block; width: 100%; }
.link { background: none; border: 0; padding: 0; font: var(--fw-regular) var(--fs-body) var(--font); color: var(--green); text-decoration: underline; cursor: pointer; border-radius: var(--r-xs); }
.more { font-weight: var(--fw-medium); text-decoration: none; border-radius: var(--r-xs); }
.more::after { content: "\00a0\203A"; }
.actions { display: flex; flex-wrap: wrap; gap: var(--s-4) var(--s-5); align-items: center; margin-top: var(--s-6); }
.actions form { margin: 0; }

/* ---------- Hero slideshow: white, large heading, image on the right ---------- */
.hero { padding: var(--s-6) 0 var(--s-8); }
.hero-card { position: relative; }
.slides { display: grid; }
.slide { grid-area: 1 / 1; display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: var(--s-8); min-height: var(--h-hero); visibility: hidden; opacity: 0; transition: opacity var(--t-slow), visibility 0s var(--t-slow); }
.slide.is-active { visibility: visible; opacity: 1; transition: opacity var(--t-slow); z-index: 1; }
.slide.has-image { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.slide-copy { padding: var(--s-6) 0 var(--s-9); max-width: var(--w-hero-text); }
.slide-media { align-self: stretch; }
.slide-media img { width: 100%; height: 100%; min-height: var(--h-media); object-fit: cover; border-radius: var(--r-lg); display: block; }
.slide h1, .slide-title { font-size: var(--fs-display); line-height: var(--lh-tight); margin-bottom: var(--s-6); }
.slide-text { font-size: var(--fs-h3); color: var(--muted); max-width: var(--measure-s); }
.slider-ui { position: absolute; left: 0; bottom: var(--s-5); z-index: 3; display: flex; align-items: center; gap: var(--s-4); }
.dots { display: flex; gap: var(--s-1); }
.dot { width: var(--target-s); height: var(--target-s); border: 0; border-radius: var(--r-pill); background: none; cursor: pointer; position: relative; padding: 0; }
.dot::after { content: ""; position: absolute; left: calc((var(--target-s) - var(--s-3)) / 2); top: calc((var(--target-s) - var(--s-3)) / 2); width: var(--s-3); height: var(--s-3); border-radius: var(--r-pill); border: var(--bw) solid var(--ink); background: var(--white); }
.dot[aria-current]::after { background: var(--green); border-color: var(--green); }
.ctl-icon { width: var(--target-s); height: var(--target-s); border: var(--bw) solid var(--ink); border-radius: var(--r-pill); background: var(--white); cursor: pointer; display: grid; place-items: center; padding: 0; }
.ctl-icon svg { width: var(--icon); height: var(--icon); fill: var(--ink); }
.ctl-icon .i-play { display: none; }
.hero.paused .ctl-icon .i-play { display: block; }
.hero.paused .ctl-icon .i-pause { display: none; }
@media (max-width: 900px) {
  .slide, .slide.has-image { grid-template-columns: 1fr; gap: var(--s-5); min-height: 0; align-items: start; }
  .slide-media { order: -1; }
  .slide-media img { min-height: 0; height: var(--h-media-m); border-radius: var(--r); }
  .slide-copy { padding: 0 0 var(--s-9); }
}
@media (prefers-reduced-motion: reduce) { .slide, .slide.is-active, .burger span { transition: none; } }

/* ---------- Mission statement ---------- */
.mission { padding: var(--s-8) 0 var(--s-10); }
.mission-text { font-size: var(--fs-h2); font-weight: var(--fw-light); line-height: var(--lh-tight); color: var(--green); max-width: var(--measure-xs); margin: 0; }
@media (max-width: 600px) { .mission { padding: var(--s-6) 0 var(--s-8); } .mission-text { font-size: var(--fs-title); } }

/* ---------- Section intro ---------- */
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-4) var(--s-8); align-items: end; margin-bottom: var(--s-7); }
.section-head h2, .section-head p { margin: 0; }
@media (max-width: 900px) { .section-head { grid-template-columns: 1fr; } }
.center { text-align: center; }
.center .lead-dark { margin: 0 auto; }

/* ---------- Test list (home) ---------- */
.test-list { list-style: none; margin: 0; padding: 0; border-top: var(--bw) solid var(--ink); }
.test-list li { border-bottom: var(--bw) solid var(--line); }
.test-list a { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: var(--s-2) var(--s-6); align-items: baseline; padding: var(--s-6) var(--s-2); border-radius: var(--r-sm); color: var(--ink); text-decoration: none; }
.tl-name { font-size: var(--fs-figure); font-weight: var(--fw-light); line-height: var(--lh-tight); }
.tl-tool { color: var(--green); font-weight: var(--fw-medium); }
.tl-meta { color: var(--muted); font-size: var(--fs-small); }
.tl-price { font-size: var(--fs-h3); white-space: nowrap; }
.tl-price::after { content: "\00a0\203A"; color: var(--green); }
@media (max-width: 900px) { .test-list a { grid-template-columns: 1fr auto; padding: var(--s-5) var(--s-2); } .tl-name { grid-column: 1 / -1; font-size: var(--fs-title); } .tl-meta { grid-column: 1 / -1; } }

/* ---------- Cards (tests page) ---------- */
.head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--s-2) var(--s-5); margin-bottom: var(--s-6); }
.head h2 { margin: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--col)), 1fr)); gap: var(--s-5); }
.card { display: flex; flex-direction: column; background: var(--white); border: var(--bw) solid var(--line); border-radius: var(--r); padding: var(--box-pad); color: var(--ink); text-decoration: none; }
.card h3 { font-size: var(--fs-title); font-weight: var(--fw-light); color: var(--ink); }
.card h3 a { color: inherit; text-decoration: none; border-radius: var(--r-xs); }
.card > p { color: var(--muted); flex: 1; }
.facts { margin: 0 0 var(--s-5); }
.facts > div { display: flex; justify-content: space-between; gap: var(--s-4); padding: var(--s-2) 0; border-bottom: var(--bw) solid var(--line); font-size: var(--fs-small); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: var(--fw-medium); text-align: right; }
.facts s { color: var(--muted); font-weight: var(--fw-regular); }

/* ---------- Video ---------- */
.video-wrap { max-width: var(--w-media); margin-top: var(--s-7); }
.video { position: relative; aspect-ratio: 16 / 9; background: var(--white); border: var(--bw) solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-play { position: absolute; inset: 0; width: 100%; border: 0; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-3); font: inherit; border-radius: var(--r-lg); }
.video-play:hover, .video-play:active, .video-play:focus-visible { outline-offset: calc(-1 * var(--s-3)); }
.video-play small { color: var(--muted); font-size: var(--fs-small); }
.video-empty { display: grid; place-items: center; padding: var(--s-5); text-align: center; color: var(--muted); }

/* ---------- Chat explainer ---------- */
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-7); }
.steps li { counter-increment: s; border-top: var(--bw) solid var(--ink); padding-top: var(--s-5); }
.steps li::before { content: counter(s); display: block; font-size: var(--fs-figure); font-weight: var(--fw-light); line-height: var(--lh-none); color: var(--green); margin-bottom: var(--s-5); }
.steps h3 { margin-bottom: var(--s-2); }
.steps p { color: var(--muted); margin: 0; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr; gap: var(--s-6); } }

/* ---------- FAQ ---------- */
.faq-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--s-6) var(--s-8); }
@media (max-width: 900px) { .faq-grid { grid-template-columns: 1fr; } }
.faq { border-bottom: var(--bw) solid var(--line); }
.faq:first-of-type { border-top: var(--bw) solid var(--ink); }
.faq summary { cursor: pointer; list-style: none; padding: var(--s-5) var(--s-7) var(--s-5) var(--s-2); font-size: var(--fs-lead); position: relative; border-radius: var(--r-sm); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: var(--s-2); top: var(--s-4); font-size: var(--fs-figure); font-weight: var(--fw-light); color: var(--green); }
.faq[open] summary::after { content: "\2212"; }
.faq p { color: var(--muted); padding: 0 var(--s-2) var(--s-4); max-width: var(--measure); }

/* ---------- Inner page header ---------- */
.page-head { padding: var(--s-7) 0; }
.page-head h1 { margin-bottom: var(--s-4); }
.back { display: inline-block; margin-bottom: var(--s-4); font-size: var(--fs-small); text-decoration: none; border-radius: var(--r-xs); }
.back::before { content: "\2039\00a0"; }

/* ---------- Tests ---------- */
.quiz .progress { height: var(--h-progress); background: var(--line); border-radius: var(--r-pill); overflow: hidden; margin-bottom: var(--s-6); }
.quiz .progress i { display: block; width: var(--pct, 0%); height: 100%; background: var(--green); border-radius: var(--r-pill); transition: width var(--t-fast); }
.prompt { font-size: var(--fs-lead); color: var(--muted); }
.q { border: 0; border-top: var(--bw) solid var(--line); border-radius: 0; padding: var(--s-6) 0; margin: 0; }
.q legend { float: left; width: 100%; padding: 0; margin: 0 0 var(--s-4); font-size: var(--fs-h3); }
.q legend + * { clear: both; }
.qn { display: block; font-size: var(--fs-small); color: var(--muted); margin-bottom: var(--s-1); }
.opts { display: grid; gap: var(--s-2); }
.opts label { display: flex; gap: var(--s-3); align-items: center; padding: var(--field-pad); border-radius: var(--r-sm); background: var(--white); cursor: pointer; border: var(--bw) solid var(--line); }
.opts label:has(input:checked) { border-color: var(--green); color: var(--green); }
.opts input { width: var(--control); height: var(--control); accent-color: var(--green); flex: none; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chips input, .pkgs input { position: absolute; opacity: 0; pointer-events: none; }
.chips label { display: inline-block; padding: var(--chip-pad); border: var(--bw) solid var(--field); border-radius: var(--r-pill); background: var(--white); cursor: pointer; }
.chips input:checked + label { border-color: var(--green); color: var(--green); font-weight: var(--fw-medium); }
.alert { border: var(--bw) solid var(--ink); font-weight: var(--fw-medium); padding: var(--note-pad); border-radius: var(--r-sm); }
.buy .price { font-size: var(--fs-h3); }
.result { border: var(--bw) solid var(--line); border-radius: var(--r); padding: var(--box-pad); }
.result-band { font-size: var(--fs-figure); color: var(--green); margin-bottom: var(--s-4); }
.meter { height: var(--h-meter); background: var(--line); border-radius: var(--r-pill); overflow: hidden; }
.meter i { display: block; width: var(--pct, 0%); height: 100%; background: var(--green); border-radius: var(--r-pill); }
.result-score { margin-top: var(--s-2); color: var(--muted); font-size: var(--fs-small); }
.result-text { font-size: var(--fs-lead); }
.next { margin-top: var(--s-7); }
.crisis { border: var(--bw) solid var(--ink); border-radius: var(--r); padding: var(--box-pad); margin-bottom: var(--s-5); }
.crisis h2 { font-size: var(--fs-title); }
.crisis-lines a { font-size: var(--fs-lead); }
@media (max-width: 600px) { .result, .crisis, .card, .plan, .slide-editor, .empty { padding: var(--box-pad-s); } }

/* ---------- Tables and pricing ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: var(--cell-pad); border-bottom: var(--bw) solid var(--line); vertical-align: top; }
thead th { font-size: var(--fs-small); font-weight: var(--fw-medium); color: var(--muted); border-bottom-color: var(--ink); }
.num { text-align: right; white-space: nowrap; }
.price-table tbody th { font-weight: var(--fw-medium); }
.price-table small { display: block; font-size: var(--fs-small); font-weight: var(--fw-regular); color: var(--muted); }
.member { color: var(--green); font-weight: var(--fw-medium); }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--col)), 1fr)); gap: var(--s-5); margin-top: var(--s-6); }
.plan { display: flex; flex-direction: column; background: var(--white); border: var(--bw) solid var(--line); border-radius: var(--r); padding: var(--box-pad); }
.plan h3 { font-size: var(--fs-title); font-weight: var(--fw-light); }
.plan p:not(.plan-price) { color: var(--muted); flex: 1; }
.plan-current { border-color: var(--green); }
.plan-price { font-size: var(--fs-figure); color: var(--green); margin-bottom: var(--s-2); }
.plan-price small { font-size: var(--fs-small); color: var(--muted); }
.badge { color: var(--green); font-weight: var(--fw-medium); }

/* ---------- Forms ---------- */
.form label:not(.check) { display: block; font-weight: var(--fw-medium); margin: var(--s-5) 0 var(--s-2); }
.form input:not([type=checkbox]):not([type=radio]):not([type=file]), .form textarea, select, .compose textarea, .admin-table input:not([type=checkbox]) {
  width: 100%; font: var(--fw-regular) var(--fs-body)/var(--lh-snug) var(--font); color: var(--ink); background: var(--white); border: var(--bw) solid var(--field); border-radius: var(--r-sm); padding: var(--field-pad); }
.form textarea, .compose textarea { resize: vertical; }
.form input:focus, .form textarea:focus, select:focus, .compose textarea:focus, .admin-table input:focus { outline: var(--hover); outline-offset: calc(-1 * var(--bw-strong)); }
.hint { font-size: var(--fs-small); color: var(--muted); margin: var(--s-2) 0 0; }
.check { display: flex; gap: var(--s-3); align-items: flex-start; margin: var(--s-5) 0; cursor: pointer; border-radius: var(--r-xs); }
.check input { width: var(--control); height: var(--control); accent-color: var(--green); flex: none; margin-top: var(--s-1); }
.form .btn { margin-top: var(--s-4); }
fieldset { border: 0; padding: 0; margin: 0 0 var(--s-6); }
fieldset > legend { font-weight: var(--fw-medium); font-size: var(--fs-lead); margin-bottom: var(--s-3); padding: 0; }
.form .chips label { display: inline-block; margin: 0; font-weight: var(--fw-regular); }
.form .chips input:checked + label { font-weight: var(--fw-medium); }
.pkgs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--col-s)), 1fr)); gap: var(--s-4); }
.form label.pkg { display: flex; flex-direction: column; margin: 0; font-weight: var(--fw-regular); padding: var(--box-pad-s); border: var(--bw) solid var(--field); border-radius: var(--r); background: var(--white); cursor: pointer; }
.pkgs input:checked + label.pkg { border-color: var(--green); box-shadow: none; outline: var(--hover); outline-offset: calc(-1 * var(--bw-strong)); }
.pkg b { font-weight: var(--fw-medium); font-size: var(--fs-lead); }
.pkg span { color: var(--muted); font-size: var(--fs-small); }
.pkg .pkg-price { color: var(--green); font-size: var(--fs-h3); font-weight: var(--fw-medium); margin-top: var(--s-2); }
.pkg s { color: var(--muted); font-size: var(--fs-small); font-weight: var(--fw-regular); }
.pkg small { color: var(--muted); font-size: var(--fs-small); }
.panel { background: var(--white); border: var(--bw) solid var(--line); border-radius: var(--r); padding: var(--box-pad); }
.panel h2 { font-size: var(--fs-title); }
.panel > :last-child { margin-bottom: 0; }
.danger summary { cursor: pointer; font-weight: var(--fw-medium); border-radius: var(--r-xs); }
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-1) var(--s-4); padding: var(--s-3) 0; border-bottom: var(--bw) solid var(--line); }
@media (max-width: 600px) { .panel { padding: var(--box-pad-s); } }

/* ---------- Flash ---------- */
.flash { padding: var(--s-4) 0; border-top: var(--bw) solid var(--line); border-bottom: var(--bw) solid var(--line); font-weight: var(--fw-medium); color: var(--green); }

/* ---------- Chat ---------- */
.chat-meta { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); color: var(--muted); font-size: var(--fs-small); align-items: center; margin: 0; }
.status { display: inline-block; padding: var(--tag-pad); border-radius: var(--r-pill); font-size: var(--fs-small); border: var(--bw) solid var(--field); white-space: nowrap; }
.status-open { border-color: var(--green); color: var(--green); }
.thread { list-style: none; padding: 0; margin: 0 0 var(--s-5); display: grid; gap: var(--s-4); }
.msg { max-width: 80%; }
.msg .body { padding: var(--note-pad); border-radius: var(--r); overflow-wrap: anywhere; white-space: pre-wrap; border: var(--bw) solid var(--line); background: var(--white); }
.msg.mine { justify-self: end; }
.msg.mine .body { border-color: var(--green); }
.msg .who, .msg time { display: block; font-size: var(--fs-small); color: var(--muted); margin: var(--s-1) 0; }
.msg.mine .who, .msg.mine time { text-align: right; }
@media (max-width: 600px) { .msg { max-width: 95%; } }
.waiting { color: var(--muted); font-size: var(--fs-small); padding: var(--note-pad); border: var(--bw) dashed var(--field); border-radius: var(--r-sm); text-align: center; }
.compose { margin-top: var(--s-5); }
.compose-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s-3); margin-top: var(--s-3); }
.close-form { margin-top: var(--s-6); }
.case-list { list-style: none; padding: 0; margin: 0; border-top: var(--bw) solid var(--ink); }
.case-list li { border-bottom: var(--bw) solid var(--line); }
.case-list a { display: grid; grid-template-columns: 1fr auto; gap: var(--s-1) var(--s-3); padding: var(--s-5) var(--s-2); border-radius: var(--r-sm); color: var(--ink); text-decoration: none; }
.case-title { font-size: var(--fs-lead); color: var(--green); }
.case-list .muted { grid-column: 1 / -1; font-size: var(--fs-small); }
.empty { color: var(--muted); padding: var(--box-pad); border: var(--bw) dashed var(--field); border-radius: var(--r); }

/* ---------- Staff and admin ---------- */
.chips-links { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chips-links a { padding: var(--chip-pad); border: var(--bw) solid var(--field); border-radius: var(--r-pill); text-decoration: none; color: var(--ink); }
.chips-links a[aria-current] { border-color: var(--green); color: var(--green); font-weight: var(--fw-medium); }
.data td, .data th { font-size: var(--fs-small); }
tr.late td { font-weight: var(--fw-medium); }
tr.late td:last-child { color: var(--green); }
.admin-table td { padding: var(--cell-pad-s); }
.admin-table input:not([type=checkbox]) { min-width: var(--field-min); }
.admin-table .in-num { min-width: var(--field-min-s); text-align: right; }
.admin-table input[type=checkbox] { width: var(--control); height: var(--control); accent-color: var(--green); }
.new-row td { border-bottom-style: dashed; }
.inline { display: flex; gap: var(--s-2); align-items: center; }
select { width: auto; }
.stats { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-6); color: var(--muted); }
.stats b { font-size: var(--fs-figure); color: var(--green); font-weight: var(--fw-light); margin-right: var(--s-1); }
.lang-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s-6); }
@media (max-width: 900px) { .lang-cols { grid-template-columns: 1fr; } }
.slide-editors { display: grid; gap: var(--s-4); }
.slide-editor { border: var(--bw) solid var(--line); border-radius: var(--r); padding: var(--box-pad); margin: 0; }
.slide-editor > legend { float: left; width: 100%; font-size: var(--fs-lead); margin-bottom: 0; }
.slide-editor.is-new { border-style: dashed; border-color: var(--field); }
.slide-editor select { width: 100%; }
.img-field { display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: flex-end; clear: both; }
.img-field img { width: var(--thumb-w); height: var(--thumb-h); object-fit: cover; border-radius: var(--r-sm); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 0 var(--s-5); clear: both; }
.grid-2b { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s-4); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 var(--s-4); }
@media (max-width: 900px) { .grid-2, .grid-4 { grid-template-columns: 1fr 1fr; } .grid-2 > :first-child { grid-column: 1 / -1; } }
@media (max-width: 600px) { .grid-2, .grid-2b, .grid-4 { grid-template-columns: 1fr; } }
.checks { display: flex; flex-wrap: wrap; gap: 0 var(--s-5); }
@media (max-width: 600px) {
  .stack thead { display: none; }
  .stack tr { display: grid; padding: var(--s-2) 0; border-bottom: var(--bw) solid var(--line); }
  .stack td { border: 0; padding: var(--s-1) 0; text-align: left; }
  .stack td.num { text-align: left; }
}

/* ---------- Legal ---------- */

/* ---------- Footer ---------- */
.foot { background: var(--green); color: var(--white); padding: var(--s-8) 0 var(--s-6); }
.foot-top { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--s-6); }
.foot-brand img { width: var(--logo-footer); }
.foot h2 { font-size: var(--fs-small); font-weight: var(--fw-medium); color: var(--white); margin-bottom: var(--s-3); }
.foot nav { display: grid; gap: var(--s-1); align-content: start; justify-items: start; }
.foot nav a { color: var(--white); text-decoration: none; padding: var(--s-1) 0; border-radius: var(--r-xs); }
.foot-note { margin-top: var(--s-7); padding-top: var(--s-5); border-top: var(--bw) solid var(--white); font-size: var(--fs-small); }
.foot-note p { margin: 0; }
@media (max-width: 900px) { .foot-top { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } .foot-brand img { width: var(--logo-footer-m); } }

/* Public article list and article page */
.article-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--col-l)), 1fr)); gap: var(--s-7) var(--s-6); }
.article-list a { display: grid; gap: var(--s-2); color: var(--ink); text-decoration: none; border-radius: var(--r); }
.article-list img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--r); margin-bottom: var(--s-2); }
.al-date { font-size: var(--fs-small); color: var(--muted); }
.al-title { font-size: var(--fs-title); font-weight: var(--fw-light); line-height: var(--lh-snug); }
.al-excerpt { color: var(--muted); }
.article-image { margin-bottom: var(--s-7); }
.article-image img { width: 100%; max-height: var(--h-article-image); object-fit: cover; border-radius: var(--r-lg); display: block; }
.prose h2, .prose h3, .prose h4 { margin-top: var(--s-7); }
.prose h2 { font-size: var(--fs-figure); }
.prose h3 { font-size: var(--fs-title); font-weight: var(--fw-light); }
.prose ul, .prose ol { padding-left: var(--s-5); margin: 0 0 var(--s-4); }
.prose li { margin-bottom: var(--s-2); }
.prose blockquote { margin: var(--s-6) 0; padding-left: var(--s-5); border-left: var(--bw-strong) solid var(--green); font-size: var(--fs-h3); font-weight: var(--fw-light); }
.prose img { border-radius: var(--r); margin: var(--s-4) 0; }

/* ---------- Plugins ---------- */
.cookie-banner { position: fixed; left: var(--s-4); right: var(--s-4); bottom: var(--s-4); z-index: 60; }
.cookie-banner[hidden] { display: none; }
.cookie-in { max-width: var(--w-media); margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-4) var(--s-6); background: var(--white); border: var(--bw) solid var(--ink); border-radius: var(--r); padding: var(--box-pad); }
.cookie-in > div:first-child { flex: 1 1 var(--col-xl); }
.cookie-in h2 { font-size: var(--fs-h3); font-weight: var(--fw-medium); margin-bottom: var(--s-1); }
.cookie-in p { margin: 0; color: var(--muted); }
.cookie-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }
@media (max-width: 600px) { .cookie-in { padding: var(--box-pad-s); } .cookie-actions { width: 100%; } .cookie-actions .btn { flex: 1 1 auto; } }
.announce { border-bottom: var(--bw) solid var(--line); }
.announce-in { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: var(--target); }
.announce p { margin: 0; font-size: var(--fs-small); padding: var(--s-3) 0; }
.announce a { font-weight: var(--fw-medium); }
.announce-close { flex: none; width: var(--target-s); height: var(--target-s); border: 0; background: none; border-radius: var(--r-pill); font: var(--fw-light) var(--fs-title)/var(--lh-none) var(--font); color: var(--ink); cursor: pointer; }
.plugin-staff-note { margin: 0; padding: var(--s-2) var(--s-4); text-align: center; font-size: var(--fs-small); border-bottom: var(--bw) solid var(--green); color: var(--green); }

/* ---------- AI assistant in chat ---------- */
.ai-intro { font-size: var(--fs-small); color: var(--muted); border: var(--bw) dashed var(--field); border-radius: var(--r-sm); padding: var(--note-pad); margin-bottom: var(--s-5); }
.msg.ai .body { border-style: dashed; border-color: var(--field); }
.msg.ai .who { color: var(--green); }
.typing { color: var(--muted); font-size: var(--fs-small); margin: 0 0 var(--s-4); }
.typing::after { content: "…"; }
.ai-error { color: var(--ink); font-size: var(--fs-small); border: var(--bw) solid var(--ink); border-radius: var(--r-sm); padding: var(--note-pad); }
.status-urgent { border-color: var(--ink); color: var(--ink); font-weight: var(--fw-medium); }
.check-hint { margin: calc(-1 * var(--s-4)) 0 var(--s-5) var(--s-6); }
