/* Generated from design/tokens.css and design/mockup.html; edit here. */
/* iReg design tokens. Light theme only.
   Minimal: light background, one green accent, hairline dividers, no gradients, almost no shadows.
   Contrast ratios are against #FFFFFF unless noted. */


:root {
  /* Surfaces */
  --color-bg: #FAFBFA;            /* page background, a hint of warm-green grey */
  --color-surface: #FFFFFF;       /* cards, inputs, tables */
  --color-surface-muted: #F3F5F4; /* table header, hover row, chart track, filter panel */
  --color-border: #E3E7E5;        /* hairline dividers (decorative, no contrast requirement) */
  --color-border-strong: #C9D0CC; /* input outline at rest */
  --color-input-border: #8A948F;  /* input outline when it must be a UI boundary: 3.1:1 (WCAG 1.4.11) */

  /* Text */
  --color-text: #111A15;          /* 17.6:1, headings and body */
  --color-text-secondary: #4A5550;/* 7.6:1, labels, meta */
  --color-text-muted: #66706B;    /* 5.1:1 (4.9:1 on --color-bg), hints, captions. Never lighter for text */
  --color-text-inverse: #FFFFFF;

  /* Primary green (buttons). White text: 5.0:1 / 7.0:1 / 9.3:1 */
  --color-primary: #15803D;
  --color-primary-hover: #166534;
  --color-primary-active: #14532D;
  --color-primary-soft: #EAF5EE;  /* selected suggestion, active pagination, chips */
  --color-primary-soft-hover: #DCEFE3;
  --color-focus: #15803D;         /* focus ring colour */
  --focus-ring: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--color-focus);

  /* Links */
  --color-link: #0B6B3A;          /* 6.6:1 */
  --color-link-hover: #084D2A;    /* 9.8:1 */
  --color-link-visited: #3F5F4C;

  /* Status badges: text on its own background, all >= 6:1 */
  --color-success-bg: #E6F4EA;  --color-success-text: #14532D; --color-success-dot: #16A34A;
  --color-warning-bg: #FDF3DC;  --color-warning-text: #7A4A04; --color-warning-dot: #D97706;
  --color-danger-bg:  #FDE8E8;  --color-danger-text:  #9B1C1C; --color-danger-dot:  #DC2626;
  --color-neutral-bg: #EEF0EF;  --color-neutral-text: #3D4641; --color-neutral-dot: #8A948F;

  /* Charts */
  --color-chart-bar: #3FA265;        /* regular quarter */
  --color-chart-bar-current: #15803D;/* last quarter, highlighted */
  --color-chart-bar-hover: #166534;
  --color-chart-grid: #E3E7E5;
  --color-chart-axis: #66706B;
  --color-chart-negative: #DC2626;
  --color-telegram: #229ED9;         /* the Telegram badge in the footer credit */
  --color-chart-median: #1F2937;     /* industry median line */
  --color-chart-s2: #2563EB;         /* compared companies 2-4 */
  --color-chart-s3: #D97706;
  --color-chart-s4: #7C3AED;
  --color-delta-up: #15803D;
  --color-delta-down: #B91C1C;       /* 6.5:1 */

  /* Typography */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --text-xs: 0.75rem;    /* 12px  captions, axis labels */
  --text-sm: 0.875rem;   /* 14px  meta, table secondary */
  --text-base: 1rem;     /* 16px  body, inputs (16px avoids zoom on iOS) */
  --text-lg: 1.125rem;   /* 18px  lead, search input */
  --text-xl: 1.375rem;   /* 22px  section titles */
  --text-2xl: 1.75rem;   /* 28px  company name (mobile), KPI values */
  --text-3xl: 2.25rem;   /* 36px  company name (desktop) */
  --text-4xl: 3rem;      /* 48px  home hero (desktop) */

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --leading-tight: 1.15;
  --leading-snug: 1.35;
  --leading-normal: 1.55;
  --tracking-tight: -0.02em; /* large headings */
  --tracking-caps: 0.06em;   /* small uppercase labels */

  /* Spacing, 4px base */
  --space-1: 0.25rem;  /* 4  */
  --space-2: 0.5rem;   /* 8  */
  --space-3: 0.75rem;  /* 12 */
  --space-4: 1rem;     /* 16 */
  --space-5: 1.5rem;   /* 24 */
  --space-6: 2rem;     /* 32 */
  --space-7: 3rem;     /* 48 */
  --space-8: 4rem;     /* 64 */
  --space-9: 6rem;     /* 96 */

  /* Layout */
  --container-max: 1120px;
  --container-narrow: 720px;
  --container-pad: var(--space-4);     /* 16px on mobile, 32px from 768px */
  --header-height: 64px;
  /* Company card: number columns in tables of figures */
  --col-period: 7.5rem;
  --col-money: 7.5rem;
  --col-count: 6rem;
  /* Scroll hint at the edges of a scrolling table */
  --shadow-scroll: rgba(17, 26, 21, 0.14);

  /* Sizes */
  --control-h-sm: 36px;
  --control-h: 44px;       /* minimum touch target */
  --control-h-lg: 56px;    /* home search */

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  /* Shadows: only for floating layers (suggestions dropdown). Nothing else casts a shadow. */
  --shadow-none: none;
  --shadow-float: 0 8px 24px rgba(17, 26, 21, 0.08), 0 1px 2px rgba(17, 26, 21, 0.06);

  /* Motion */
  --duration-fast: 120ms;
  --duration: 180ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);

  /* Home page only (owner asked for a livelier front page): soft glows, glass stat cards, a lift shadow
     for the topic cards. Every other page stays flat as in design/spec.md. */
  --home-glow-1: rgba(34, 197, 94, 0.20);   /* green glow, top left */
  --home-glow-2: rgba(16, 185, 129, 0.15);  /* emerald glow, top right */
  --home-glow-3: rgba(132, 204, 22, 0.10);  /* lime glow, low centre */
  --home-glass: rgba(255, 255, 255, 0.80);  /* stat cards over the animated background */
  --home-net-opacity: 0.55;                 /* "network" lines and nodes; lower = calmer */
  --home-drift: 26s;                        /* one drift of the background; higher = slower */
  --shadow-lift: 0 16px 32px -16px rgba(21, 128, 61, 0.35), 0 2px 6px rgba(17, 26, 21, 0.05);
}

@media (min-width: 768px) {
  :root { --container-pad: var(--space-6); }
}

@media (prefers-reduced-motion: reduce) {
  :root { --duration-fast: 0ms; --duration: 0ms; }
}
/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--color-bg); color: var(--color-text);
  font-family: var(--font-sans); font-size: var(--text-base); line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: var(--leading-tight); letter-spacing: var(--tracking-tight); }
p { margin: 0; }
a { color: var(--color-link); text-decoration: none; }
a:hover { color: var(--color-link-hover); text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.container { max-width: var(--container-max); margin: 0 auto; padding: 0 var(--container-pad); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.label-caps { font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-caps);
  text-transform: uppercase; color: var(--color-text-muted); }


/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--control-h); padding: 0 var(--space-5); border: 1px solid transparent; border-radius: var(--radius-md);
  font: inherit; font-weight: var(--weight-semibold); font-size: var(--text-base); cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--color-primary); color: var(--color-text-inverse); }
.btn-primary:hover { background: var(--color-primary-hover); color: var(--color-text-inverse); }
.btn-primary:active { background: var(--color-primary-active); }
.btn-secondary { background: var(--color-surface); color: var(--color-text); border-color: var(--color-border-strong); }
.btn-secondary:hover { background: var(--color-surface-muted); color: var(--color-text); }
.btn-ghost { background: transparent; color: var(--color-link); padding: 0 var(--space-3); }
.btn-ghost:hover { background: var(--color-primary-soft); color: var(--color-link-hover); }
.btn-sm { min-height: var(--control-h-sm); padding: 0 var(--space-4); font-size: var(--text-sm); }
.btn[disabled] { background: var(--color-surface-muted); color: var(--color-text-muted); border-color: transparent; cursor: not-allowed; }

/* ---------- Header ---------- */
.site-header { background: var(--color-surface); border-bottom: 1px solid var(--color-border); }
.site-header .container { display: flex; align-items: center; gap: var(--space-5); min-height: var(--header-height); flex-wrap: wrap; }
.site-header.is-home { background: transparent; border-bottom: 0; }
.logo { display: inline-flex; flex: none; }
.logo img { display: block; height: 32px; width: auto; }
.header-search { flex: 1 1 320px; max-width: 480px; }
.header-nav { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }
.header-nav a.navlink { color: var(--color-text-secondary); font-size: var(--text-sm); font-weight: var(--weight-medium);
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); }
.header-nav a.navlink:hover { color: var(--color-text); background: var(--color-surface-muted); text-decoration: none; }

.lang { display: inline-flex; padding: 2px; background: var(--color-surface-muted); border-radius: var(--radius-pill); }
.lang a { min-width: 40px; min-height: 32px; display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--color-text-secondary); border-radius: var(--radius-pill); }
.lang a:hover { color: var(--color-text); text-decoration: none; }
.lang a[aria-current="true"] { background: var(--color-surface); color: var(--color-text); }

/* ---------- Search field ---------- */
.search { position: relative; }
.search-field { display: flex; align-items: center; background: var(--color-surface);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-md);
  transition: border-color var(--duration-fast) var(--ease); }
.search-field:hover { border-color: var(--color-input-border); }
.search-field:focus-within { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-soft-hover); }
.search-field .search-icon { flex: none; margin-left: var(--space-3); color: var(--color-text-muted); }
.search-field input { flex: 1; min-width: 0; height: var(--control-h); border: 0; background: transparent; outline: none;
  font: inherit; font-size: var(--text-base); color: var(--color-text); padding: 0 var(--space-3); }
.search-field input::placeholder { color: var(--color-text-muted); }
.search-lg .search-field { border-radius: var(--radius-lg); padding: var(--space-1); }
.search-lg .search-field .search-icon { margin-left: var(--space-4); }
/* Input and button share one 48px row: the field is 48 + 2 x 4px padding + 2 x 1px border = 58px. */
.search-lg input { height: 48px; font-size: var(--text-lg); }

/* Submit inside the large field. Nested radius: outer 14 - padding 4 - border 1 = 9px. */
.search-lg .search-submit {
  position: relative; flex: none; height: 48px; min-height: 48px;
  padding: 0 var(--space-4) 0 var(--space-5); /* 24 left, 16 right: the arrow carries its own air */
  gap: 10px; border: 0; border-radius: calc(var(--radius-lg) - var(--space-1) - 1px);
  font-size: var(--text-base); font-weight: var(--weight-semibold); letter-spacing: -0.01em; line-height: 1;
  color: var(--color-text-inverse); background: var(--color-primary);
  transition: background-color var(--duration) var(--ease), transform var(--duration-fast) var(--ease),
              box-shadow var(--duration-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.search-lg .search-submit-icon {
  display: block; flex: none; color: currentColor;
  transition: transform var(--duration) var(--ease);
}
.search-lg .search-submit:hover { background: var(--color-primary-hover); color: var(--color-text-inverse); }
@media (hover: hover) {
  .search-lg .search-submit:hover .search-submit-icon { transform: translateX(3px); }
}
.search-lg .search-submit:active { background: var(--color-primary-active); transform: scale(0.97); }
.search-lg .search-submit:focus-visible { outline: none; box-shadow: var(--focus-ring); }
/* Once the query has text, the arrow nudges once as a hint that Enter / the button is ready.
   The animation is applied only while the selector matches, so it replays after the field is cleared. */
.search-lg .search-field input:not(:placeholder-shown) ~ .search-submit .search-submit-icon {
  animation: search-nudge calc(var(--duration) * 2) var(--ease) 1; /* 360ms: ~160ms out, ~200ms back */
}
@keyframes search-nudge {
  0%, 100% { transform: translateX(0); }
  45%      { transform: translateX(4px); }
}
/* A light sweep across the button: on hover, and once when the query gets its first character.
   A deliberate exception to "no gradients": it only exists while moving. */
.search-lg .search-submit { overflow: hidden; isolation: isolate; }
.search-lg .search-submit::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 45%; z-index: -1;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.32) 50%, rgba(255, 255, 255, 0) 100%);
  transform: translateX(-120%) skewX(-18deg); pointer-events: none;
}
/* Inside the isolated button the sweep (z-index -1) paints over its background, under text and arrow. */
@media (hover: hover) {
  .search-lg .search-submit:hover::after { animation: search-shine 650ms var(--ease) 1; }
}
.search-lg .search-field input:not(:placeholder-shown) ~ .search-submit::after { animation: search-shine 650ms var(--ease) 1; }
@keyframes search-shine {
  from { transform: translateX(-120%) skewX(-18deg); }
  to   { transform: translateX(260%) skewX(-18deg); }
}
@media (prefers-reduced-motion: reduce) {
  .search-lg .search-submit::after { display: none; }
  .search-lg .search-submit,
  .search-lg .search-submit-icon { transition: background-color var(--duration) linear; }
  .search-lg .search-submit:active,
  .search-lg .search-submit:hover .search-submit-icon { transform: none; }
  .search-lg .search-field input:not(:placeholder-shown) ~ .search-submit .search-submit-icon { animation: none; }
}

.suggest { position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + var(--space-2)); margin: 0; padding: var(--space-2);
  list-style: none; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float); text-align: left; }
.suggest-group { padding: var(--space-2) var(--space-3) var(--space-1); }
.suggest-item a { display: flex; align-items: center; gap: var(--space-3); min-height: 48px; padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md); color: var(--color-text); }
.suggest-item a:hover, .suggest-item[aria-selected="true"] a { background: var(--color-primary-soft); text-decoration: none; }
.suggest-item mark { background: none; color: inherit; font-weight: var(--weight-bold); }
.suggest-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-meta { flex: none; font-size: var(--text-sm); color: var(--color-text-muted); }
.suggest-foot { border-top: 1px solid var(--color-border); margin-top: var(--space-2); padding: var(--space-2) var(--space-3) 0; font-size: var(--text-sm); }
.suggest-foot a { display: inline-flex; align-items: center; min-height: 36px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--radius-pill);
  font-size: var(--text-xs); font-weight: var(--weight-semibold); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--color-success-bg); color: var(--color-success-text); }
.badge-success::before { background: var(--color-success-dot); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning-text); }
.badge-warning::before { background: var(--color-warning-dot); }
.badge-danger  { background: var(--color-danger-bg);  color: var(--color-danger-text); }
.badge-danger::before { background: var(--color-danger-dot); }
.badge-neutral { background: var(--color-neutral-bg); color: var(--color-neutral-text); }
.badge-neutral::before { background: var(--color-neutral-dot); }

/* ---------- Home ---------- */
.hero { padding-top: var(--space-8); padding-bottom: var(--space-9); text-align: center; }
.hero h1 { font-size: var(--text-2xl); font-weight: var(--weight-bold); }
.hero .lead { margin: var(--space-3) auto 0; max-width: 560px; color: var(--color-text-secondary); font-size: var(--text-lg); }
.hero .search { max-width: var(--container-narrow); margin: var(--space-6) auto 0; }
.hero-links { display: flex; justify-content: center; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-5); }
.hero-hint { margin-top: var(--space-3); font-size: var(--text-sm); color: var(--color-text-muted); }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-5) var(--space-4);
  max-width: 820px; margin: var(--space-8) auto 0; text-align: left; }
.stat-value { font-size: var(--text-2xl); font-weight: var(--weight-bold); letter-spacing: var(--tracking-tight); line-height: 1.1; }
.stat-label { margin-top: var(--space-1); font-size: var(--text-sm); color: var(--color-text-secondary); }

/* ---------- Results ---------- */
.page { padding-top: var(--space-6); padding-bottom: var(--space-8); }
.results-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.results-head h1 { font-size: var(--text-xl); font-weight: var(--weight-semibold); }
.results-head .meta { color: var(--color-text-muted); font-size: var(--text-sm); }
.results { list-style: none; margin: var(--space-5) 0 0; padding: 0; border-top: 1px solid var(--color-border); }
.result { padding: var(--space-5) 0; border-bottom: 1px solid var(--color-border); display: grid; gap: var(--space-2) var(--space-6); }
.result-title { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.result-title a { font-size: var(--text-lg); font-weight: var(--weight-semibold); color: var(--color-text); }
.result-title a:hover { color: var(--color-link); }
.result-meta { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); font-size: var(--text-sm); color: var(--color-text-secondary); }
.result-figures { display: flex; gap: var(--space-6); }
.figure dt { font-size: var(--text-xs); color: var(--color-text-muted); }
.figure dd { margin: 0; font-weight: var(--weight-semibold); }
.figure dd.empty { color: var(--color-text-muted); font-weight: var(--weight-regular); }

.pagination { display: flex; justify-content: center; align-items: center; gap: var(--space-1); margin-top: var(--space-6); flex-wrap: wrap; }
.pagination a, .pagination span { min-width: var(--control-h); height: var(--control-h); display: inline-flex; align-items: center; justify-content: center;
  padding: 0 var(--space-3); border-radius: var(--radius-md); color: var(--color-text-secondary); font-weight: var(--weight-medium); font-variant-numeric: tabular-nums; }
.pagination a:hover { background: var(--color-surface-muted); color: var(--color-text); text-decoration: none; }
.pagination a[aria-current="page"] { background: var(--color-primary-soft); color: var(--color-primary-hover); font-weight: var(--weight-semibold); }
.pagination span[aria-hidden] { color: var(--color-text-muted); }

/* ---------- Company card ---------- */
.breadcrumbs { font-size: var(--text-sm); color: var(--color-text-muted); }
.breadcrumbs a { color: var(--color-text-secondary); }
.company-head { margin-top: var(--space-4); display: flex; gap: var(--space-4); align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.company-head h1 { font-size: var(--text-2xl); font-weight: var(--weight-bold); overflow-wrap: anywhere; }
.company-sub { margin-top: var(--space-3); display: flex; align-items: center; gap: var(--space-2) var(--space-4); flex-wrap: wrap;
  color: var(--color-text-secondary); font-size: var(--text-sm); }
.company-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }

.section { margin-top: var(--space-8); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-4); flex-wrap: wrap; }
.section-head h2 { font-size: var(--text-xl); font-weight: var(--weight-semibold); }
.section-head .meta { font-size: var(--text-sm); color: var(--color-text-muted); }

.kv { margin: 0; display: grid; grid-template-columns: 1fr; }
.kv > div { display: grid; grid-template-columns: 1fr; gap: 2px; padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border); }
.kv dt { font-size: var(--text-sm); color: var(--color-text-secondary); }
.kv dd { margin: 0; }
.copy { margin-left: var(--space-1); vertical-align: middle; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--color-text-muted); border-radius: var(--radius-sm); cursor: pointer; }
.copy:hover { background: var(--color-surface-muted); color: var(--color-text); }

.charts { display: grid; gap: var(--space-6); grid-template-columns: 1fr; }
.chart h3 { font-size: var(--text-base); font-weight: var(--weight-semibold); letter-spacing: 0; }
.chart .meta { font-size: var(--text-sm); color: var(--color-text-muted); }
.chart svg { display: block; width: 100%; height: auto; margin-top: var(--space-3); }
.chart .bar { fill: var(--color-chart-bar); }
.chart .bar.current { fill: var(--color-chart-bar-current); }
.chart .bar:hover { fill: var(--color-chart-bar-hover); }
.chart .grid { stroke: var(--color-chart-grid); stroke-width: 1; }
.chart .axis { fill: var(--color-chart-axis); font-size: 11px; font-family: var(--font-sans); }
.chart .val { fill: var(--color-text); font-size: 11px; font-weight: 600; font-family: var(--font-sans); }

.table-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; border-top: 1px solid var(--color-border); } /* relative: the sr-only caption stays inside the scroll box */
table.data { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
table.data th, table.data td { padding: var(--space-3) var(--space-4) var(--space-3) 0; text-align: left; border-bottom: 1px solid var(--color-border); white-space: nowrap; }
table.data th { font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--color-text-muted); letter-spacing: var(--tracking-caps); text-transform: uppercase; }
table.data td.r, table.data th.r { text-align: right; font-variant-numeric: tabular-nums; }
table.data tbody tr:hover { background: var(--color-surface-muted); }
table.data tbody tr:first-child td { font-weight: var(--weight-semibold); }

.people { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--color-border); }
.people li { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); min-height: 56px; padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border); }
.people .role { font-size: var(--text-sm); color: var(--color-text-secondary); }
.share { display: flex; align-items: center; gap: var(--space-3); flex: none; }
.share-bar { width: 72px; height: 6px; border-radius: var(--radius-pill); background: var(--color-surface-muted); overflow: hidden; }
.share-bar i { display: block; height: 100%; background: var(--color-chart-bar-current); }

.two-col { display: grid; grid-template-columns: 1fr; gap: var(--space-8); }
.chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 var(--space-3); border-radius: var(--radius-pill);
  background: var(--color-surface-muted); font-size: var(--text-sm); font-variant-numeric: tabular-nums; color: var(--color-text-secondary); margin-right: var(--space-2); }
.activities { list-style: none; margin: 0; padding: 0; }
.activities li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border); }
.activities li:first-child { border-top: 1px solid var(--color-border); }

.source { margin-top: var(--space-8); padding: var(--space-4) 0; font-size: var(--text-sm); color: var(--color-text-muted); border-top: 1px solid var(--color-border); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--color-border); padding: var(--space-6) 0; font-size: var(--text-sm); color: var(--color-text-muted); }
.site-footer .container { display: grid; gap: var(--space-4); }
.site-footer a { color: var(--color-text-secondary); }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }

/* ---------- Responsive ---------- */
@media (max-width: 599px) {
  .header-search { order: 3; flex-basis: 100%; max-width: none; padding-bottom: var(--space-3); }
  .header-nav .navlink { display: none; }
  /* Square 48x48, arrow only. The text stays for screen readers (visually hidden, not display:none). */
  .search-lg .search-submit { width: 48px; padding: 0; gap: 0; }
  .search-lg .search-submit .btn-text { position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; }
  .search-lg input { font-size: var(--text-base); }
  .suggest-meta { display: none; }
  .result-figures { gap: var(--space-5); }
}
@media (min-width: 600px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .kv > div { grid-template-columns: 220px 1fr; gap: var(--space-4); }
}
@media (min-width: 768px) {
  .hero { padding-top: var(--space-9); padding-bottom: var(--space-9); }
  .hero h1 { font-size: var(--text-4xl); }
  .company-head h1 { font-size: var(--text-3xl); }
  .result { grid-template-columns: 1fr auto; align-items: center; }
  .result-figures { grid-row: 1 / span 2; grid-column: 2; }
  .figure { text-align: right; min-width: 110px; }
  .charts { grid-template-columns: 1fr 1fr; gap: var(--space-7); }
  .two-col { grid-template-columns: 1fr 1fr; gap: var(--space-7); }
  .site-footer .container { grid-template-columns: 1fr auto; align-items: start; }
}

/* ---------- Additions beyond the mockup (same tokens) ---------- */
[hidden] { display: none !important; }
.skip { position: absolute; left: -9999px; top: 0; z-index: 20; background: var(--color-surface); padding: var(--space-2) var(--space-4); }
.skip:focus { left: var(--space-4); top: var(--space-2); }
.muted { color: var(--color-text-muted); }
.small { font-size: var(--text-sm); }
.narrow { max-width: calc(var(--container-narrow) + 2 * var(--container-pad)); }
.center { text-align: center; }
.center .search { margin: var(--space-6) auto; max-width: var(--container-narrow); }
.page-title { font-size: var(--text-2xl); font-weight: var(--weight-bold); }
.empty-state { color: var(--color-text-secondary); padding: var(--space-5) 0; }
.note { margin-top: var(--space-3); color: var(--color-text-secondary); font-size: var(--text-sm); max-width: 640px; }

.logo { align-items: center; gap: 10px; color: var(--color-text); }
.logo:hover { text-decoration: none; color: var(--color-text); }

.suggest-item a { text-decoration: none; }
.suggest-item.active a { background: var(--color-primary-soft); }
.suggest-item .badge { flex: none; }

.stats { margin-left: auto; margin-right: auto; }
.stats > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; }
.stats dd { margin: 0; }
.stats-left { margin: var(--space-6) 0 0; max-width: none; }

.about-strip { padding-bottom: var(--space-8); }
.about-strip h2 { font-size: var(--text-xl); font-weight: var(--weight-semibold); }
.features { list-style: none; margin: var(--space-5) 0 0; padding: 0; display: grid; gap: var(--space-4); }
.features li { padding: var(--space-4) 0 0; border-top: 2px solid var(--color-primary); color: var(--color-text-secondary); }

.persons-strip { margin-top: var(--space-5); }
.chips { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip-link { color: var(--color-text); gap: var(--space-2); margin: 0; }
.chip-link:hover { background: var(--color-primary-soft); text-decoration: none; color: var(--color-text); }
.chip-n { color: var(--color-text-muted); font-size: var(--text-xs); }

.intro { margin-top: var(--space-4); max-width: 760px; color: var(--color-text-secondary); }
.kpi-note { margin-top: var(--space-3); font-size: var(--text-xs); color: var(--color-text-muted); }
.contacts { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); overflow-wrap: anywhere; }
.chart { margin: 0; }
.chart .hit { fill: transparent; }
.chart .hit:hover + .bar, .chart .bar:hover { fill: var(--color-chart-bar-hover); }
.charts + .table-wrap { margin-top: var(--space-6); }
.push { margin-left: auto; }
.section-head.sub { margin-top: var(--space-6); }
.section-head.sub h3 { font-size: var(--text-base); font-weight: var(--weight-semibold); }
.former { margin-top: var(--space-4); }
.former summary { gap: 0.3em; cursor: pointer; color: var(--color-link); font-size: var(--text-sm); font-weight: var(--weight-medium); min-height: var(--control-h); display: flex; align-items: center; }
.former[open] summary { margin-bottom: var(--space-2); }
.people li > .badge { flex: none; }

/* Advanced search */
.filter-layout { display: grid; gap: var(--space-6); margin-top: var(--space-5); }
.filters { display: grid; gap: var(--space-4); align-content: start; background: var(--color-surface-muted); border-radius: var(--radius-lg); padding: var(--space-5); }
.field { display: grid; gap: var(--space-1); margin: 0; padding: 0; border: 0; min-width: 0; }
.field label, .field legend { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--color-text-secondary); padding: 0; margin-bottom: var(--space-1); }
.field input, .field select { width: 100%; height: var(--control-h); padding: 0 var(--space-3); font: inherit; font-size: var(--text-base); color: var(--color-text);
  background: var(--color-surface); border: 1px solid var(--color-border-strong); border-radius: var(--radius-md); }
.field input:hover, .field select:hover { border-color: var(--color-input-border); }
.field input:focus, .field select:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-soft-hover); }
.range-row { display: flex; align-items: center; gap: var(--space-2); color: var(--color-text-muted); }
.range-row input { flex: 1; min-width: 0; }
.filter-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.filter-actions .btn-primary { flex: 1; }
.filter-results .results { margin-top: 0; }

/* Statistics */
.ranks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--color-border); }
.ranks li { display: grid; grid-template-columns: minmax(0, 1fr) 30% auto 3.5em; align-items: center; gap: var(--space-3); min-height: 44px; border-bottom: 1px solid var(--color-border); font-size: var(--text-sm); }
.rank-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-bar { height: 6px; border-radius: var(--radius-pill); background: var(--color-surface-muted); overflow: hidden; }
.rank-bar i { display: block; height: 100%; background: var(--color-chart-bar); border-radius: var(--radius-pill); }
.rank-n { text-align: right; font-weight: var(--weight-semibold); }
.rank-pct { text-align: right; color: var(--color-text-muted); }
.three-col { display: grid; gap: var(--space-7); }
table.data.top td { white-space: normal; }
table.data.top tbody tr:first-child td { font-weight: inherit; }

/* Text pages */
.prose h1 { font-size: var(--text-2xl); font-weight: var(--weight-bold); margin-bottom: var(--space-5); }
.prose h2 { font-size: var(--text-xl); font-weight: var(--weight-semibold); margin: var(--space-7) 0 var(--space-3); }
.prose p, .prose ul, .prose ol { margin: 0 0 var(--space-4); color: var(--color-text-secondary); }
.prose li { margin-bottom: var(--space-2); }
.prose strong { color: var(--color-text); }

.footer-text p { margin: 0 0 var(--space-2); max-width: 720px; }

@media (min-width: 600px) {
  .features { grid-template-columns: 1fr 1fr; gap: var(--space-5) var(--space-6); }
}
@media (min-width: 900px) {
  .features { grid-template-columns: repeat(4, 1fr); }
  .filter-layout { grid-template-columns: 280px minmax(0, 1fr); gap: var(--space-7); }
  .filters { position: sticky; top: var(--space-4); }
  .three-col { grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
}
@media (max-width: 599px) {
  .ranks li { grid-template-columns: minmax(0, 1fr) 20% auto; }
  .rank-pct { display: none; }
}
/* The field draws the focus ring around the whole box, not the bare input. */
.search-field input:focus-visible { box-shadow: none; }

/* Wide screens: the page grows with the window instead of leaving empty margins. */
@media (min-width: 1280px) {
  :root { --container-max: 1320px; --container-pad: var(--space-7); }
}
@media (min-width: 1680px) {
  :root { --container-max: 1520px; }
}

/* Company card: one column below 1280px; from there the details and the map stand in a column
   on the right. At 1280 the main column is at least 776px, enough for four KPI tiles and the
   yearly table; at 1100 it would be 612. Blocks inside follow their column (container queries),
   not the window, since the column's width jumps when the side column appears. */
.company-layout { display: grid; grid-template-columns: minmax(0, 1fr); }
.company-top, .company-main { min-width: 0; container-type: inline-size; }
.company-top  { container-name: top; }
.company-main { container-name: main; }
@media (min-width: 1280px) {
  .company-layout { grid-template-columns: minmax(0, 1fr) 360px; column-gap: var(--space-7); align-items: start; }
  .company-top  { grid-column: 1; grid-row: 1; }
  .company-side { grid-column: 2; grid-row: 1 / span 2; }
  .company-main { grid-column: 1; grid-row: 2; }
  .company-side > .section:first-child { margin-top: 0; }
  .company-side .kv > div { grid-template-columns: 1fr; gap: 2px; }
}
@media (min-width: 1680px) {
  .company-layout { grid-template-columns: minmax(0, 1fr) 400px; column-gap: var(--space-8); }
}
/* One column, 900–1279: tax debt and details on the left, the map beside them, not a full-width grey box. */
@media (min-width: 900px) and (max-width: 1279px) {
  .company-side { margin-top: var(--space-8); display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 34%);
    column-gap: var(--space-7); align-items: start; }
  .company-side > .section { grid-column: 1; }
  .company-side > .map-section { grid-column: 2; grid-row: 1 / span 3; margin-top: 0; }
  .company-side > .section:first-child { margin-top: 0; }
  .company-side .map-box { aspect-ratio: 1 / 1; }
}

.map-box { position: relative; aspect-ratio: 16 / 10; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; background: var(--color-surface-muted); }
.map-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.map-box.loaded .map-fallback { display: none; }
.map-larger { position: absolute; right: var(--space-2); bottom: var(--space-2); padding: 2px var(--space-2);
  border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface); font-size: var(--text-xs); }
@media (max-width: 899px) {
  /* 16:10 of the column, at most 320px high; full width (aspect-ratio with max-height would narrow it). */
  .map-box { aspect-ratio: auto; height: min(320px, calc((100vw - 2 * var(--container-pad)) * 0.625)); }
}
@media (min-width: 1280px) {
  .map-box { aspect-ratio: 1 / 1; }
}

table.data td.wrap { white-space: normal; min-width: 240px; }
table.data td .muted { font-size: var(--text-xs); font-weight: var(--weight-regular); }
table.reports .report-files a { display: inline-block; margin-right: var(--space-3); }
table.reports .report-files a.pdf { font-weight: var(--weight-semibold); }
.show-all { margin-top: var(--space-4); }

/* The admin's description of a company, under the intro. */
.about-company { margin-top: var(--space-4); max-width: 760px; }
.about-company p { margin: 0 0 var(--space-3); }

/* Admin (/admin): plain forms on the site's tokens. */
.admin-head { border-bottom: 1px solid var(--color-border); background: var(--color-surface); }
.admin-head .container { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-height); }
.admin-head a { color: var(--color-text); text-decoration: none; }
.admin h1 { font-size: var(--text-2xl); margin-bottom: var(--space-5); }
.admin h2 { font-size: var(--text-lg); margin: var(--space-7) 0 var(--space-3); }
.admin-login { display: grid; gap: var(--space-4); max-width: 360px; }
.admin-login label, .admin-field label { display: grid; gap: var(--space-1); font-size: var(--text-sm); color: var(--color-text-secondary); }
.admin input:not([type=checkbox]):not([type=hidden]), .admin textarea { width: 100%; min-height: var(--control-h-sm); padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); font: inherit; color: var(--color-text); background: var(--color-surface); }
.admin textarea { resize: vertical; }
.admin-search { display: flex; gap: var(--space-3); max-width: 640px; }
.admin-form { display: grid; gap: var(--space-6); max-width: 900px; }
.admin-form fieldset { border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-5); display: grid; gap: var(--space-4); }
.admin-form legend { padding: 0 var(--space-2); font-weight: var(--weight-semibold); }
.admin-field { display: grid; gap: var(--space-1); }
.admin-field.changed label { color: var(--color-primary); font-weight: var(--weight-semibold); }
.admin-check { display: flex; gap: var(--space-2); align-items: flex-start; font-size: var(--text-sm); }
.admin-error { color: var(--color-delta-down); }
.admin-ok { padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); background: var(--color-primary-soft); }
.admin-links a { margin-right: var(--space-2); }

/* Links to the register's PDFs: a document icon before the text. */
.doc-link { display: inline-flex; align-items: center; gap: var(--space-1); white-space: nowrap; }
.doc-link .icon-pdf { flex: none; }
/* One document per line, so the reports table keeps to the column. */
table.reports td.report-files { white-space: normal; }
table.reports .report-files .doc-link { display: flex; margin: 2px 0; }
.section-head .doc-link { font-size: var(--text-sm); }

/* Contact form (/contact). */
.contact-form { display: grid; gap: var(--space-5); margin-top: var(--space-6); }
.contact-two { display: grid; gap: var(--space-5); }
@media (min-width: 600px) { .contact-two { grid-template-columns: 1fr 1fr; } }
.field textarea { width: 100%; padding: var(--space-3); font: inherit; font-size: var(--text-base); color: var(--color-text); resize: vertical;
  background: var(--color-surface); border: 1px solid var(--color-border-strong); border-radius: var(--radius-md); }
.field textarea:hover { border-color: var(--color-input-border); }
.field textarea:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-soft-hover); }
.field [aria-invalid="true"] { border-color: var(--color-delta-down); }
.field-error { margin: var(--space-1) 0 0; font-size: var(--text-sm); color: var(--color-delta-down); }
.field-hint { margin: var(--space-1) 0 0; font-size: var(--text-sm); color: var(--color-text-muted); }
.contact-form .btn { justify-self: start; }
.contact-done { margin-top: var(--space-6); padding: var(--space-5); border-radius: var(--radius-lg); background: var(--color-primary-soft); }
.contact-done p { margin: 0 0 var(--space-2); }
/* The trap field for bots: out of sight and out of the tab order. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.footer-mail { display: inline-flex; align-items: center; gap: var(--space-2); }
.footer-mail svg { flex: none; }
.admin-messages { display: grid; gap: var(--space-3); }
.admin-message { border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-4); background: var(--color-surface); }
.admin-message.done { opacity: 0.6; }
.admin-message header { font-size: var(--text-sm); color: var(--color-text-secondary); }
.admin-message p { margin: var(--space-3) 0; white-space: normal; }

/* ==========================================================================
   Home page
   The one page allowed to be expressive (owner's request): soft glows, a slowly drifting
   "network of companies", glass stat cards, topic cards that lift on hover.
   Only transform and opacity are animated; everything stops under prefers-reduced-motion.
   Tuning: --home-drift (speed), --home-net-opacity and --home-glow-* (intensity) in :root.
   ========================================================================== */

/* Header sits above the hero background, which runs up behind it. */
.site-header.is-home { position: relative; z-index: 2; }
/* z-index 1 keeps the suggestions dropdown above the sections that follow. */
.home-hero { position: relative; z-index: 1; }
.home-hero-bg { position: absolute; z-index: -1; left: 0; right: 0; top: calc(-1 * var(--header-height)); bottom: 0;
  overflow: hidden; pointer-events: none; }
/* Fade into the page colour at the bottom, so the hero has no visible edge. */
.home-hero-bg::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 55%, var(--color-bg) 100%); }

.home-glow { position: absolute; display: block; width: 720px; height: 720px; border-radius: 50%;
  will-change: transform; animation: home-glow var(--home-drift) ease-in-out infinite alternate; }
.home-glow-1 { top: -260px; left: -220px; background: radial-gradient(closest-side, var(--home-glow-1), transparent); }
.home-glow-2 { top: -200px; right: -240px; background: radial-gradient(closest-side, var(--home-glow-2), transparent);
  animation-duration: calc(var(--home-drift) * 1.3); animation-direction: alternate-reverse; }
.home-glow-3 { bottom: -300px; left: 30%; width: 820px; height: 600px;
  background: radial-gradient(closest-side, var(--home-glow-3), transparent); animation-duration: calc(var(--home-drift) * 1.6); }
@keyframes home-glow {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(60px, 40px, 0) scale(1.12); }
}

/* The network: dot grid plus two node clusters. The centre (title, search) is masked out. */
.home-net { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--color-primary); opacity: var(--home-net-opacity);
  -webkit-mask-image: radial-gradient(ellipse 44% 58% at 50% 46%, transparent 40%, #000 100%);
          mask-image: radial-gradient(ellipse 44% 58% at 50% 46%, transparent 40%, #000 100%); }
.home-net pattern circle { fill: var(--color-border-strong); }
.net-line { fill: none; stroke: currentColor; stroke-width: 1.25; stroke-opacity: 0.35; vector-effect: non-scaling-stroke; }
.net-node { fill: var(--color-surface); stroke: currentColor; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.net-node.is-hub { fill: currentColor; }
.net-group { animation: net-drift var(--home-drift) ease-in-out infinite alternate; }
.net-b { animation-duration: calc(var(--home-drift) * 1.2); animation-direction: alternate-reverse; }
@keyframes net-drift {
  from { transform: translate(0, 0); }
  to   { transform: translate(24px, -18px); }
}
.net-pulse { fill: currentColor; opacity: 0; transform-box: fill-box; transform-origin: center;
  animation: net-pulse 4.8s ease-out infinite; }
.net-pulse-late { animation-delay: 2.4s; }
@keyframes net-pulse {
  0%       { opacity: 0.35; transform: scale(1); }
  70%, 100% { opacity: 0; transform: scale(4); }
}

/* Hero content */
.home-hero .hero { padding-bottom: var(--space-8); }
.hero-eyebrow { display: inline-flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-4);
  padding: 6px var(--space-3); border: 1px solid var(--color-primary-soft-hover); border-radius: var(--radius-pill);
  background: var(--home-glass); font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--color-primary-active); }
.hero-eyebrow-dot { position: relative; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--color-success-dot); }
.hero-eyebrow-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit;
  animation: eyebrow-ping 2.4s ease-out infinite; }
@keyframes eyebrow-ping {
  0%        { transform: scale(1); opacity: 0.6; }
  80%, 100% { transform: scale(2.6); opacity: 0; }
}
/* The search stays the strongest element: white, lifted off the background. */
.home-hero .search-lg .search-field { box-shadow: var(--shadow-lift); }
.home-hero .search-lg .search-field:focus-within { box-shadow: 0 0 0 3px var(--color-primary-soft-hover), var(--shadow-lift); }

/* Stats as glass cards */
.home-hero .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); max-width: 960px; margin-top: var(--space-7); }
.home-hero .stats > div { padding: var(--space-4); background: var(--home-glass); border: 1px solid var(--color-border); border-radius: var(--radius-lg); }
.home-hero .stat-value { font-size: var(--text-xl); color: var(--color-primary-active); }

/* Sections */
.home-section { padding-bottom: var(--space-8); }
.home-section-head { max-width: 680px; margin-bottom: var(--space-6); }
.home-section-head h2 { font-size: var(--text-xl); font-weight: var(--weight-bold); }
.home-section-head p { margin-top: var(--space-2); color: var(--color-text-secondary); }
.go-arrow { flex: none; transition: transform var(--duration) var(--ease); }

/* Topic cards. The link is stretched over the whole card. */
.topics { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
.topic { position: relative; isolation: isolate; display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-5); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  transition: transform var(--duration) var(--ease); }
/* The hover shadow lives on a pseudo-element: only its opacity is animated. */
.topic::before { content: ""; position: absolute; z-index: -1; inset: 0; border-radius: inherit; box-shadow: var(--shadow-lift);
  opacity: 0; transition: opacity var(--duration) var(--ease); pointer-events: none; }
.topic-icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; margin-bottom: var(--space-2);
  border: 1px solid var(--color-primary-soft-hover); border-radius: var(--radius-md); color: var(--color-primary-hover);
  background: linear-gradient(145deg, var(--color-surface) 0%, var(--color-primary-soft) 100%);
  box-shadow: inset 0 -3px 0 var(--color-primary-soft-hover);
  transition: transform calc(var(--duration) * 1.5) var(--ease); }
.topic-icon svg { display: block; }
.topic-icon .ic-fill { fill: var(--color-primary-soft-hover); }
.topic-icon .ic-solid { fill: var(--color-surface); }
.topic-title { font-size: var(--text-lg); font-weight: var(--weight-semibold); letter-spacing: -0.01em; }
.topic-text { flex: 1; color: var(--color-text-secondary); }
.topic-link { align-self: flex-start; display: inline-flex; align-items: center; gap: var(--space-1); margin-top: var(--space-2);
  font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-link); }
.topic-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-lg); }
.topic-link:hover { text-decoration: none; }
/* Focus ring around the whole card, not just the words. */
.topic-link:focus-visible { box-shadow: none; }
.topic-link:focus-visible::after { box-shadow: var(--focus-ring); }

/* Industries and counties */
.browse-grid { display: grid; gap: var(--space-4); }
.browse-panel { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-5);
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  background: radial-gradient(circle at 100% 0, var(--color-primary-soft) 0, transparent 45%), var(--color-surface); }
.browse-title { font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-caps);
  text-transform: uppercase; color: var(--color-text-muted); }
.browse-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.browse-chip { display: inline-flex; align-items: center; min-height: 36px; padding: var(--space-1) var(--space-3);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-pill); background: var(--color-surface);
  color: var(--color-text); font-size: var(--text-sm); line-height: 1.3;
  transition: transform var(--duration-fast) var(--ease); }
.browse-chip:hover { background: var(--color-primary-soft); border-color: var(--color-primary); color: var(--color-primary-active); text-decoration: none; }
.browse-chip:focus-visible { border-radius: var(--radius-pill); }
.browse-more { align-self: flex-start; margin-top: auto; display: inline-flex; align-items: center; gap: var(--space-1);
  min-height: var(--control-h-sm); font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.browse-more:hover { text-decoration: none; }

/* Closing call to action */
.home-cta { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start;
  gap: var(--space-5); padding: var(--space-6) var(--space-5); border-radius: var(--radius-lg); color: var(--color-text-inverse);
  background: linear-gradient(120deg, var(--color-primary-active) 0%, var(--color-primary) 100%); }
.home-cta h2 { font-size: var(--text-xl); font-weight: var(--weight-bold); }
.home-cta p { margin-top: var(--space-2); max-width: 560px; }
.home-cta-deco { position: absolute; z-index: -1; top: 0; right: 0; width: min(420px, 75%); height: 100%;
  fill: none; stroke: var(--color-text-inverse); stroke-opacity: 0.14; stroke-width: 1.5; }
.home-cta-deco circle { transform-box: fill-box; transform-origin: center; animation: cta-ring 7s ease-in-out infinite alternate; }
.home-cta-deco circle:nth-child(2) { animation-delay: -2.3s; }
.home-cta-deco circle:nth-child(3) { animation-delay: -4.6s; }
@keyframes cta-ring {
  from { transform: scale(0.94); opacity: 0.6; }
  to   { transform: scale(1.04); opacity: 1; }
}
.home-cta-btn { flex: none; background: var(--color-surface); color: var(--color-primary-active); }
.home-cta-btn:hover { background: var(--color-primary-soft); color: var(--color-primary-active); }
.home-cta-btn:focus-visible { box-shadow: 0 0 0 2px var(--color-primary-active), 0 0 0 4px var(--color-text-inverse); }

/* Phones: keep it calm. No pulses, smaller glows. */
@media (max-width: 599px) {
  .net-pulse, .home-glow-3 { display: none; }
  .home-glow { width: 440px; height: 440px; }
  .hero-eyebrow { font-size: var(--text-xs); }
}
@media (min-width: 600px) {
  .topics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 768px) {
  .home-section-head h2 { font-size: var(--text-2xl); }
  .home-cta { flex-direction: row; align-items: center; justify-content: space-between; padding: var(--space-7); }
  .home-cta h2 { font-size: var(--text-2xl); }
}
@media (min-width: 900px) {
  .home-hero .stats { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-4); }
  .home-hero .stats > div { padding: var(--space-5); }
  .home-hero .stat-value { font-size: var(--text-2xl); }
  .browse-grid { grid-template-columns: 1fr 1fr; gap: var(--space-5); }
}
@media (min-width: 1000px) {
  .topics { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-5); }
}

/* Hover depth only with a real pointer and enough room; touch screens get flat cards. */
@media (hover: hover) and (min-width: 768px) {
  .topic:hover { transform: translateY(-4px); border-color: var(--color-primary-soft-hover); }
  .topic:hover::before { opacity: 1; }
  .topic:hover .topic-icon { transform: perspective(240px) rotateX(10deg) rotateY(-14deg) translateZ(6px); }
  .topic:hover .go-arrow,
  .browse-more:hover .go-arrow,
  .home-cta-btn:hover .go-arrow { transform: translateX(3px); }
  .browse-chip:hover { transform: translateY(-1px); }
}

/* Cards rise in as they scroll into view (scroll-driven animations; other browsers just show them).
   Uses the separate `translate` property so the hover `transform` still works. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .topic, .browse-panel { animation: home-rise linear both; animation-timeline: view(); animation-range: entry 0% entry 35%; }
  }
}
@keyframes home-rise {
  from { opacity: 0; translate: 0 24px; }
  to   { opacity: 1; translate: none; }
}

@media (prefers-reduced-motion: reduce) {
  .home-glow, .net-group, .hero-eyebrow-dot::after, .home-cta-deco circle { animation: none; }
  .net-pulse { display: none; }
  .topic, .topic::before, .topic-icon, .browse-chip, .go-arrow { transition: none; }
  .topic:hover, .topic:hover .topic-icon, .browse-chip:hover,
  .topic:hover .go-arrow, .browse-more:hover .go-arrow, .home-cta-btn:hover .go-arrow { transform: none; }
}

/* Tax debt (api/taxdebt), ratios, related companies, history. */
.debt-status { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--space-2); margin: 0 0 var(--space-2); }
.debt-status .dot { flex: none; width: 10px; height: 10px; border-radius: 50%; transform: translateY(1px); }
.debt-status.ok .dot { background: var(--color-primary); }
.debt-status.bad .dot { background: var(--color-delta-down); }
.debt-status.bad b { color: var(--color-delta-down); }
.debt-total { font-weight: var(--weight-bold); font-size: var(--text-lg); color: var(--color-delta-down); }
.debt-box.has-debt { border-left: 3px solid var(--color-delta-down); padding-left: var(--space-4); }
.debt-table { margin: var(--space-2) 0; }
.debt-table td.wrap { white-space: normal; }
.debt-decl { margin: 0 0 var(--space-3); padding-left: var(--space-5); font-size: var(--text-sm); }

/* Ratio and per-employee tiles: auto-fit, so two tiles share the row instead of taking 2 tracks of 4;
   the foot (value + hint) sits at the bottom, so values in a row line up under 1- and 2-line labels. */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: var(--space-3); margin-top: var(--space-4); }
.metric { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4); background: var(--color-surface); }
.metric-label { font-size: var(--text-sm); line-height: var(--leading-snug); text-wrap: balance; color: var(--color-text-secondary); }
.metric-foot { margin-top: auto; padding-top: var(--space-1); }
.metric-value { font-size: var(--text-lg); font-weight: var(--weight-bold); font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric-value.neg { color: var(--color-delta-down); }
.metric-hint { margin-top: 2px; font-size: var(--text-xs); color: var(--color-text-muted); }

.representation { margin: 0 0 var(--space-2); font-size: var(--text-sm); color: var(--color-text-secondary); max-width: 640px; }
.related { list-style: none; margin: 0; padding: 0; display: grid; gap: 0 var(--space-6); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.related li { padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border); }
.related .role { font-size: var(--text-sm); color: var(--color-text-secondary); }
table.data tr.ended td { color: var(--color-text-muted); }
table.history td.wrap { min-width: 220px; }

/* ---------- Company card: KPI ----------
   The grid follows the width of .company-top (container "top"), the figure's size follows its
   tile: a 13-character sum ("526 146 445 €", about 6.95em) takes at most 94% of the tile.
   Figures never wrap; sums from 1 bn are short (I18n::moneyShort), so 13 characters is the longest.
   The tile itself can't be a size container: containment would switch off its subgrid. So the
   tile's content width is worked out from .company-top (cqi) and the grid's own numbers below. */
.kpis { --kpi-cols: 1; --kpi-gap: var(--space-3); --kpi-pad-y: var(--space-4); --kpi-pad-x: var(--space-4); --kpis-max: 100cqi;
  display: grid; grid-template-columns: repeat(var(--kpi-cols), minmax(0, 1fr)); grid-auto-rows: auto; gap: var(--kpi-gap); margin-top: var(--space-6); }
/* Subgrid: label, value and delta share rows across the tiles, so values in a row stand level. */
.kpi { min-width: 0; display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; align-content: start;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--kpi-pad-y) var(--kpi-pad-x); }
.kpi-label { font-size: var(--text-sm); line-height: var(--leading-snug); color: var(--color-text-secondary); text-wrap: balance;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kpi-value {
  margin-top: var(--space-2); align-self: end;
  font-size: var(--text-xl); /* fallback without container units */
  /* 18…28px: 13.5% of the tile's content width (tile = (row - gaps) / columns - padding - border) */
  font-size: clamp(1.125rem, calc(((min(100cqi, var(--kpis-max)) - (var(--kpi-cols) - 1) * var(--kpi-gap)) / var(--kpi-cols)
    - 2 * var(--kpi-pad-x) - 2px) * 0.135), var(--text-2xl));
  font-weight: var(--weight-bold); letter-spacing: var(--tracking-tight); line-height: 1.1;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.kpi-delta { margin-top: var(--space-1); font-size: var(--text-xs); line-height: var(--leading-snug); font-weight: var(--weight-medium); color: var(--color-text-muted); }
.kpi-delta .up { color: var(--color-delta-up); font-weight: var(--weight-semibold); }
.kpi-delta .down { color: var(--color-delta-down); font-weight: var(--weight-semibold); }
.kpi-delta .up, .kpi-delta .down, .kpi-vs { white-space: nowrap; }
@container top (min-width: 320px) {
  .kpis { --kpi-cols: 2; --kpi-pad-x: var(--space-3); }
}
@container top (min-width: 480px) {
  .kpis { --kpi-gap: var(--space-4); --kpi-pad-y: var(--space-5); --kpi-pad-x: var(--space-5); }
}
@container top (min-width: 760px) {
  .kpis { --kpi-cols: 4; --kpi-gap: var(--space-3); --kpi-pad-y: var(--space-4); --kpi-pad-x: var(--space-4); }
}
/* Annual figures only: always two tiles. */
.kpis.kpis-2 { --kpi-cols: 2; --kpis-max: 640px; max-width: 640px; }

/* ---------- Company card: tables ----------
   Column headers wrap (up to 2 lines) and sit at the bottom: the numbers set a column's width, not
   a caps header. Numbers stay whole: cells keep nowrap. */
table.data th:last-child, table.data td:last-child { padding-right: 0; }
table.data thead th { white-space: normal; vertical-align: bottom; overflow-wrap: normal; hyphens: manual; }
/* Tables of figures (quarters, years): fixed layout, money columns of equal width. */
table.data.figures { table-layout: fixed; width: 100%;
  min-width: calc(var(--col-period) + var(--num-cols) * var(--col-money) + var(--col-count)); }
table.data.figures .c-period { width: var(--col-period); }
table.data.figures .c-count  { width: var(--col-count); }
/* .c-money gets the rest, split evenly */
table.data.figures td.r, table.data.figures th.r { padding-left: var(--space-3); padding-right: 0; }
table.data.figures td:first-child, table.data.figures th:first-child { padding-right: var(--space-3); }
/* Reports: the period may wrap after the dash, the kind at " · ". */
table.reports td.kind { white-space: normal; min-width: 8rem; }
.nowrap { white-space: nowrap; }
/* Phones: the table scrolls inside its box; the first column stays, a shadow shows there is more. */
.company-layout .table-wrap {
  background:
    linear-gradient(to right, var(--color-bg) 30%, transparent) left center / 24px 100% no-repeat local,
    linear-gradient(to left,  var(--color-bg) 30%, transparent) right center / 24px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, var(--shadow-scroll), transparent) left center / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, var(--shadow-scroll), transparent) right center / 12px 100% no-repeat scroll;
}
.table-wrap:focus-visible { box-shadow: var(--focus-ring); }
.table-wrap table.data.figures th:first-child, .table-wrap table.data.figures td:first-child,
.table-wrap table.reports th:first-child, .table-wrap table.reports td:first-child { position: sticky; left: 0; z-index: 1; background: var(--color-bg); }
.table-wrap table.data.figures tbody tr:hover td:first-child,
.table-wrap table.reports tbody tr:hover td:first-child { background: var(--color-surface-muted); }

/* Charts with tabs, the industry median and several companies (View::chart). */
.chart-tabs { margin-bottom: var(--space-5); }
.tab-list { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }
.tab-list [role=tab] { font: inherit; font-size: var(--text-sm); padding: var(--space-1) var(--space-3); min-height: 34px; cursor: pointer;
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-pill); background: var(--color-surface); color: var(--color-text-secondary); }
.tab-list [role=tab]:hover { background: var(--color-surface-muted); }
.tab-list [role=tab][aria-selected=true] { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-text-inverse); }
.chart-panel figcaption { font-size: var(--text-sm); color: var(--color-text-secondary); }
.chart-panel figcaption b { color: var(--color-text); font-size: var(--text-base); }
.chart-summary { display: block; margin-top: var(--space-1); color: var(--color-text); }
/* The summary wraps only between its parts; a phone may break the longest part too. */
.chart-summary-part { white-space: nowrap; }
@container main (max-width: 379px) { .chart-summary-part { white-space: normal; } }
.tab-list [role=tab] { max-width: 100%; white-space: normal; text-align: left; }
/* Axis labels: SVG units scale with the chart, so the size is picked by the panel's width
   to stay 11–15px on screen. Below 480 the narrow 360-wide SVG (last 8 periods) is shown. */
.chart-tabs { container-type: inline-size; container-name: chart; }
.chart .chart-narrow { display: none; }
.chart-tabs .chart .axis { font-size: 9.5px; }
/* One column at 1100–1279 makes the panel up to 1056 wide: a bit smaller still to stay under 15px. */
@container chart (min-width: 1000px) { .chart-tabs .chart .axis { font-size: 9px; } }
@container chart (max-width: 799px) { .chart-tabs .chart .axis { font-size: 11px; } }
@container chart (max-width: 639px) { .chart-tabs .chart .axis { font-size: 15px; } }
@container chart (max-width: 479px) {
  .chart svg.chart-wide { display: none; }
  .chart .chart-narrow { display: block; }
  .chart-tabs .chart .axis { font-size: 11px; }
}
@container chart (max-width: 399px) { .chart-tabs .chart .axis { font-size: 13px; } }
.chart .bar.s1 { fill: var(--color-chart-bar); }
.chart .bar.s1.current { fill: var(--color-chart-bar-current); }
.chart .bar.s2 { fill: var(--color-chart-s2); }
.chart .bar.s3 { fill: var(--color-chart-s3); }
.chart .bar.s4 { fill: var(--color-chart-s4); }
.chart .bar.neg { fill: var(--color-chart-negative); }
.chart .grid.zero { stroke: var(--color-chart-axis); }
.chart .line.median { fill: none; stroke: var(--color-chart-median); stroke-width: 2; stroke-dasharray: 5 4; }
.chart .dot.median { fill: var(--color-surface); stroke: var(--color-chart-median); stroke-width: 2; }
.chart .hit:hover { fill: var(--color-surface-muted); fill-opacity: 0.6; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); margin: var(--space-2) 0 0; padding: 0; font-size: var(--text-xs); color: var(--color-text-secondary); }
.legend li { display: inline-flex; align-items: center; gap: var(--space-2); }
.key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--color-chart-bar); }
.key.s2 { background: var(--color-chart-s2); } .key.s3 { background: var(--color-chart-s3); } .key.s4 { background: var(--color-chart-s4); }
.key.line { height: 0; border-radius: 0; background: none; border-top: 2px dashed var(--color-chart-median); width: 18px; }

/* Position in the industry: a gauge per figure, the median marked at the middle. */
/* One column, or two from 560px of the block's own width; never three (an orphan) or four (short gauges). */
.position { container-type: inline-size; container-name: position;
  margin-top: var(--space-6); padding: var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); }
/* A container can't query itself: the block's padding follows .company-top, which is as wide as the block. */
@container top (min-width: 560px) { .position { padding: var(--space-4) var(--space-5); } }
.position-title { font-size: var(--text-lg); font-weight: var(--weight-semibold); display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2) var(--space-3); }
.position-title .meta { font-size: var(--text-sm); font-weight: var(--weight-regular); color: var(--color-text-muted); }
.position-list { list-style: none; margin: var(--space-3) 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-5); }
@container position (min-width: 560px) {
  .position-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5) var(--space-6); }
}
@container position (max-width: 559px) {
  .position-title .meta { flex-basis: 100%; }
}
/* Label on the left, value on the right; the value wraps whole. */
.position-label { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 var(--space-2);
  font-size: var(--text-sm); color: var(--color-text-secondary); }
.position-label .num { white-space: nowrap; color: var(--color-text); font-weight: var(--weight-semibold); }
/* The gauge is never shorter than 140px: in a narrow item the percentage goes under it. */
.gauge { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); margin-top: var(--space-2); }
.gauge-bar { position: relative; flex: 1 1 140px; min-width: 140px; height: 8px; border-radius: var(--radius-pill); background: var(--color-surface-muted); }
.gauge-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: var(--radius-pill); background: var(--color-chart-bar-current); }
.gauge-bar b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--color-chart-median); }
.gauge-pct { font-size: var(--text-xs); font-weight: var(--weight-semibold); white-space: nowrap; }
.position-note { margin-top: 2px; font-size: var(--text-xs); color: var(--color-text-muted); }

/* Compare: a button on the card, the tray, the table of companies side by side. */
.compare-btn { display: inline-flex; align-items: center; gap: var(--space-2); }
.compare-btn.on { border-color: var(--color-primary); color: var(--color-primary); }
.compare-tray { position: fixed; left: 50%; bottom: var(--space-4); transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-pill);
  background: var(--color-surface); box-shadow: var(--shadow-float); font-size: var(--text-sm); }
.compare-add { display: flex; gap: var(--space-3); max-width: 560px; margin: var(--space-5) 0; }
.compare-add input { flex: 1; min-height: var(--control-h); padding: 0 var(--space-3); font: inherit; border: 1px solid var(--color-border-strong); border-radius: var(--radius-md); background: var(--color-surface); }
.compare-table th[scope=row] { font-size: var(--text-sm); font-weight: var(--weight-regular); color: var(--color-text-secondary); text-transform: none; letter-spacing: 0; white-space: normal; min-width: 160px; }
.compare-table thead th { text-transform: none; letter-spacing: 0; font-size: var(--text-sm); color: var(--color-text); white-space: normal; min-width: 180px; vertical-align: top; }
.compare-table td { white-space: normal; }
.compare-table tbody tr:first-child td { font-weight: var(--weight-regular); }
.compare-table .key { margin-right: var(--space-1); vertical-align: middle; }
.compare-charts { margin-top: var(--space-7); }
@media (min-width: 900px) { .compare-charts { grid-template-columns: 1fr 1fr; } }
/* Equal columns: long activity names wrap instead of pushing a company off the page. */
.compare-table { table-layout: fixed; }
.compare-table th[scope=row] { width: 190px; }
.compare-table thead th, .compare-table td { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 700px) { .compare-table { table-layout: auto; min-width: 560px; } }
table.data.compare-table td, table.data.compare-table th { white-space: normal; }

/* Developer credit in the footer: the badge and @kodulehed in link colour, the text quiet. */
.dev-line { margin-top: var(--space-3); }
.dev-credit {
  display: inline-flex; align-items: center; gap: var(--space-2);
  /* Padding enlarges the hit and focus area; the negative margin keeps the text aligned. */
  padding: var(--space-1) var(--space-2);
  margin: calc(-1 * var(--space-1)) calc(-1 * var(--space-2));
  border-radius: var(--radius-sm);
  font-size: var(--text-sm); line-height: 1.3;
  color: var(--color-text-secondary); text-decoration: none;
  transition: color .15s ease;
}
.site-footer .dev-credit { color: var(--color-text-secondary); }
.dev-credit__icon { width: 20px; height: 20px; flex: none; color: var(--color-telegram); transition: transform .15s ease; }
.dev-credit__handle { font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--color-link); }
.dev-credit:hover { text-decoration: none; }
.site-footer .dev-credit:hover { color: var(--color-link-hover); }
.dev-credit:hover .dev-credit__text { text-decoration: underline; text-underline-offset: 3px; }
.dev-credit:hover .dev-credit__icon { transform: translateY(-1px); }
.dev-credit:focus-visible { outline: none; box-shadow: var(--focus-ring); }
@media (prefers-reduced-motion: reduce) { .dev-credit, .dev-credit__icon { transition: none; } .dev-credit:hover .dev-credit__icon { transform: none; } }
