/* Bolagsinblick – v2
   Idea: an annual report, read through a lens. Paper-white pages, ink-navy type,
   a serif for headlines (like a printed report), a precise sans for everything else,
   and tabular figures wherever there are numbers. One accent colour, used for actions. */

@font-face {
  font-family: "Newsreader";
  src: url("/static/fonts/newsreader.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("/static/fonts/geist.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/static/fonts/geist-mono.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --paper-2: #f4f6f9;
  --ink: #0f1e33;
  --ink-2: #44526a;
  --ink-3: #6b778c;
  --rule: #dfe4ec;
  --rule-strong: #c5cdd9;
  --accent: #2148c9;
  --accent-ink: #ffffff;
  --accent-hover: #1a3aa6;
  --accent-wash: #eef2fd;
  --pos: #0d7a4f;
  --neg: #b42318;
  --code-bg: #0f1e33;
  --code-ink: #dbe3ef;
  --code-dim: #8693a8;
  --code-key: #9cc0ff;
  --code-str: #b9e4c4;
  --code-num: #f3d08a;
  --focus: #2148c9;

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --shadow: 0 1px 2px rgba(15, 30, 51, 0.06), 0 12px 32px -12px rgba(15, 30, 51, 0.18);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d1726;
    --paper-2: #121f33;
    --ink: #e8edf5;
    --ink-2: #b3bfd1;
    --ink-3: #8794a9;
    --rule: #22324a;
    --rule-strong: #30425e;
    --accent: #7d9cff;
    --accent-ink: #0d1726;
    --accent-hover: #9db4ff;
    --accent-wash: #17264a;
    --pos: #4cc48f;
    --neg: #ff8a7e;
    --code-bg: #08111e;
    --focus: #9db4ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -16px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  font-feature-settings: "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
code, pre, kbd { font-family: var(--mono); font-size: 0.875em; }
:not(pre) > code { background: var(--paper-2); border: 1px solid var(--rule); border-radius: 5px; padding: 0.05em 0.35em; }
h1, h2, h3 { margin: 0; color: var(--ink); }
h1, h2 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.015em; font-optical-sizing: auto; }
h3 { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.005em; }
p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -999px; top: 8px; }
.skip:focus { left: 12px; background: var(--paper); padding: 8px 12px; z-index: 50; }

/* Logo */
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 1.06rem; letter-spacing: -0.01em; }
.logo svg { width: 28px; height: 28px; flex: none; }
.logo .lens { fill: none; stroke: var(--ink); stroke-width: 2.4; }
.logo .line { fill: var(--ink); }
.logo .line-accent { fill: var(--accent); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--rule); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 20px; }
nav.main { display: flex; align-items: center; gap: 6px; font-size: 0.94rem; }
nav.main a { color: var(--ink-2); text-decoration: none; padding: 8px 10px; border-radius: var(--r-sm); }
nav.main a:hover { color: var(--ink); background: var(--paper-2); }
nav.main a[aria-current="page"] { color: var(--ink); font-weight: 500; }
nav.main a.btn { margin-left: 6px; color: var(--accent-ink); }
nav.main a.btn:hover { background: var(--accent-hover); color: var(--accent-ink); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: var(--r-sm); font: 500 0.95rem/1 var(--sans); text-decoration: none; border: 1px solid transparent; cursor: pointer; white-space: nowrap; transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-quiet { background: var(--paper); color: var(--ink); border-color: var(--rule-strong); }
.btn-quiet:hover { border-color: var(--ink-3); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 0.9rem; }

/* Hero */
.hero { padding: 88px 0 96px; border-bottom: 1px solid var(--rule); background:
  linear-gradient(to bottom, var(--paper) 0, var(--paper) 60%, var(--paper-2) 100%); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: 64px; align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 5.2vw, 4.25rem); line-height: 1.02; max-width: 11ch; }
.hero .lead { margin-top: 24px; font-size: 1.15rem; line-height: 1.6; color: var(--ink-2); max-width: 46ch; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero .assure { margin-top: 18px; font-size: 0.9rem; color: var(--ink-3); }

/* The report panel */
.report { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; min-width: 0; }
.report-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--rule); }
.company { display: flex; flex-direction: column; min-width: 0; }
.company strong { font-weight: 600; font-size: 0.98rem; }
.company span { font-size: 0.82rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--pos); }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.segmented { display: inline-flex; padding: 3px; background: var(--paper-2); border: 1px solid var(--rule); border-radius: 8px; }
.segmented button { min-height: 32px; padding: 0 12px; border: 0; background: none; border-radius: 6px; font: 500 0.84rem var(--sans); color: var(--ink-2); cursor: pointer; }
.segmented button[aria-selected="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(15, 30, 51, 0.12); }

.ledger { width: 100%; border-collapse: collapse; font-size: 0.9rem; font-variant-numeric: tabular-nums; display: table; margin: 0; }
.ledger th, .ledger td { padding: 11px 20px; border-bottom: 1px solid var(--rule); text-align: right; white-space: nowrap; }
.ledger thead th { font-weight: 500; color: var(--ink-3); font-size: 0.8rem; padding-top: 14px; padding-bottom: 10px; }
.ledger tbody th { text-align: left; font-weight: 400; color: var(--ink); }
.ledger tbody th code { display: block; background: none; border: 0; padding: 0; margin-top: 1px; font-size: 0.74rem; color: var(--ink-3); }
.ledger tbody tr:last-child th, .ledger tbody tr:last-child td { border-bottom: 0; }
.ledger td.cur { font-weight: 600; }
.ledger .up { color: var(--pos); }
.ledger tr.derived th, .ledger tr.derived td { background: var(--paper-2); }
.report-foot { display: flex; justify-content: space-between; gap: 12px; padding: 11px 20px; border-top: 1px solid var(--rule); font-size: 0.8rem; color: var(--ink-3); }

.code-panel pre, pre.code { margin: 0; padding: 18px 20px; background: var(--code-bg); color: var(--code-ink); font-size: 0.8rem; line-height: 1.65; overflow-x: auto; }
.k { color: var(--code-key); } .s { color: var(--code-str); } .n { color: var(--code-num); } .c { color: var(--code-dim); }

@media (prefers-reduced-motion: no-preference) {
  .ledger tbody tr { animation: rowIn 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .ledger tbody tr:nth-child(2) { animation-delay: 0.06s; }
  .ledger tbody tr:nth-child(3) { animation-delay: 0.12s; }
  .ledger tbody tr:nth-child(4) { animation-delay: 0.18s; }
  .ledger tbody tr:nth-child(5) { animation-delay: 0.24s; }
  .ledger tbody tr:nth-child(6) { animation-delay: 0.30s; }
  [role="tabpanel"] { animation: fadeIn 0.18s ease both; }
}
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Sections */
.section { padding: 104px 0; }
.section + .section { border-top: 1px solid var(--rule); }
.section.tint { background: var(--paper-2); }
.section-head { max-width: 640px; margin-bottom: 56px; }
.section-head h2 { font-size: clamp(2rem, 3.4vw, 2.75rem); line-height: 1.08; }
.section-head p { margin-top: 16px; font-size: 1.08rem; color: var(--ink-2); }

/* How it works – a real sequence, so it is numbered */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--ink); counter-reset: step; }
.steps li { padding: 28px 32px 0 0; counter-increment: step; }
.steps li + li { padding-left: 32px; border-left: 1px solid var(--rule); }
.steps li::before { content: counter(step); display: block; font: 500 2.4rem/1 var(--serif); color: var(--accent); margin-bottom: 18px; }
.steps h3 { margin-bottom: 8px; }
.steps p { color: var(--ink-2); }

/* Use cases: text on the left, the endpoint that does it on the right */
.uses { border-top: 1px solid var(--rule); }
.use { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; padding: 32px 0; border-bottom: 1px solid var(--rule); align-items: start; }
.use h3 { font-family: var(--serif); font-weight: 500; font-size: 1.5rem; letter-spacing: -0.01em; margin-bottom: 8px; }
.use p { color: var(--ink-2); max-width: 44ch; }
.use .endpoint { font-family: var(--mono); font-size: 0.84rem; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-md); padding: 14px 16px; overflow-x: auto; white-space: nowrap; color: var(--ink); }
.section.tint .use .endpoint { background: var(--paper); }
.endpoint .verb { color: var(--accent); font-weight: 600; margin-right: 8px; }
.endpoint .hint { display: block; margin-top: 6px; font-family: var(--sans); white-space: normal; color: var(--ink-3); font-size: 0.85rem; }

/* Code section */
.code-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 56px; align-items: center; }
.code-grid ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.code-grid li { padding-left: 28px; position: relative; color: var(--ink-2); }
.code-grid li svg { position: absolute; left: 0; top: 4px; width: 16px; height: 16px; color: var(--accent); }
.code-card { border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--rule); box-shadow: var(--shadow); min-width: 0; background: var(--code-bg); }
.code-card .tabs { display: flex; gap: 2px; padding: 8px 10px 0; background: var(--code-bg); border-bottom: 1px solid #22324a; }
.code-card .tabs button { min-height: 36px; padding: 0 14px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--code-dim); font: 500 0.84rem var(--sans); cursor: pointer; }
.code-card .tabs button[aria-selected="true"] { color: #fff; border-bottom-color: var(--code-key); }
.code-card .label { padding: 12px 20px 0; font-size: 0.78rem; color: var(--code-dim); border-top: 1px solid #22324a; }

/* Pricing: one comparison, not three loose cards */
.pricing { border: 1px solid var(--rule-strong); border-radius: var(--r-lg); overflow: hidden; background: var(--paper); display: grid; grid-template-columns: 1.15fr repeat(3, 1fr); }
.pricing > div { padding: 18px 24px; border-bottom: 1px solid var(--rule); display: flex; align-items: center; font-size: 0.94rem; }
.pricing .rowlabel { color: var(--ink-2); }
.pricing .col { justify-content: center; text-align: center; }
.pricing .featured { background: var(--accent-wash); }
.pricing .plan-head { flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 28px; padding-bottom: 24px; gap: 6px; }
.pricing .plan-head h3 { font-size: 1rem; }
.pricing .plan-head .price { font: 500 2.4rem/1.1 var(--serif); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.pricing .plan-head .per { font-size: 0.85rem; color: var(--ink-3); }
.pricing .plan-head .tag { font-size: 0.75rem; font-weight: 600; color: var(--accent); min-height: 1.2em; }
.pricing .cta { border-bottom: 0; padding-top: 24px; padding-bottom: 28px; }
.pricing .cta .btn { width: 100%; }
.pricing .yes svg { width: 18px; height: 18px; color: var(--pos); }
.pricing .no { color: var(--ink-3); }
.pricing .soon { font-size: 0.82rem; color: var(--ink-3); }
.pricing .corner { border-bottom: 1px solid var(--rule); }
.fine { margin-top: 18px; font-size: 0.88rem; color: var(--ink-3); }

/* FAQ */
.faq-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 56px; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq details:first-child { border-top: 1px solid var(--rule); }
.faq summary { list-style: none; cursor: pointer; padding: 20px 36px 20px 0; font-weight: 500; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3); transform: translateY(-70%) rotate(45deg); transition: transform 0.2s ease; }
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { padding: 0 0 22px; color: var(--ink-2); max-width: 62ch; }

/* News opt-in */
.news { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.news h2 { font-size: 1.8rem; }
.news p { margin-top: 10px; color: var(--ink-2); }
.news form { display: flex; flex-wrap: wrap; gap: 10px; }
.news label.field { flex: 1 1 100%; font-size: 0.85rem; color: var(--ink-2); font-weight: 500; }
.news input[type="email"], .news select { min-height: 44px; padding: 0 12px; border: 1px solid var(--rule-strong); border-radius: var(--r-sm); background: var(--paper); color: var(--ink); font: inherit; }
.news input[type="email"] { flex: 1 1 220px; }
.news select { flex: 0 1 200px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-msg { margin-top: 10px; font-size: 0.92rem; min-height: 1.5em; }
.form-msg.ok { color: var(--pos); } .form-msg.err { color: var(--neg); }
.news .fine { margin-top: 6px; }

/* Docs and text pages */
.page { padding: 64px 0 104px; }
.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 64px; }
.docs aside nav { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 2px; font-size: 0.92rem; border-left: 1px solid var(--rule); }
.docs aside a { color: var(--ink-2); text-decoration: none; padding: 5px 14px; margin-left: -1px; border-left: 1px solid transparent; }
.docs aside a:hover { color: var(--ink); border-left-color: var(--ink-3); }
.docs article { max-width: 780px; min-width: 0; }
.docs article h1, .prose h1 { font-size: clamp(2.2rem, 4vw, 3rem); line-height: 1.08; margin-bottom: 20px; }
.docs article h2, .prose h2 { font-size: 1.6rem; margin: 56px 0 14px; }
.docs article h3 { font-family: var(--mono); font-size: 0.95rem; font-weight: 500; margin: 26px 0 10px; display: inline-block; padding: 6px 10px; border-radius: var(--r-sm); background: var(--paper-2); border: 1px solid var(--rule); }
.docs article p, .prose p { color: var(--ink-2); margin: 0 0 14px; max-width: 70ch; }
.docs pre.block, .prose pre.block { background: var(--code-bg); color: var(--code-ink); padding: 16px 18px; border-radius: var(--r-md); overflow-x: auto; font-size: 0.8rem; line-height: 1.65; margin: 0 0 18px; }
.docs table, .prose table { border-collapse: collapse; width: 100%; font-size: 0.92rem; margin: 6px 0 22px; display: block; overflow-x: auto; }
.docs th, .docs td, .prose th, .prose td { text-align: left; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.docs th, .prose th { color: var(--ink-3); font-weight: 500; font-size: 0.85rem; }
.prose { max-width: 720px; }
.notice { background: var(--accent-wash); border-radius: var(--r-md); padding: 14px 18px; font-size: 0.93rem; color: var(--ink) !important; margin-bottom: 24px !important; }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); padding: 56px 0 48px; font-size: 0.9rem; color: var(--ink-3); background: var(--paper); }
.site-footer .wrap { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); gap: 40px; }
.site-footer p { margin-top: 14px; max-width: 36ch; }
.site-footer h3 { font-size: 0.85rem; color: var(--ink); margin-bottom: 12px; }
.site-footer nav { display: flex; flex-direction: column; gap: 8px; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }
.site-footer .legal { grid-column: 1 / -1; padding-top: 24px; border-top: 1px solid var(--rule); font-size: 0.84rem; }


/* Contact page */
.contact { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 72px; align-items: start; }
.contact .eyebrow { font: 500 0.78rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin: 8px 0 18px; }
.contact h1 { font-size: clamp(2.4rem, 4.4vw, 3.4rem); line-height: 1.05; }
.contact .lede { margin-top: 18px; font-size: 1.1rem; color: var(--ink-2); max-width: 40ch; }
.contact-hints { list-style: none; margin: 40px 0 0; padding: 0; border-top: 1px solid var(--rule); }
.contact-hints li { display: grid; gap: 4px; padding: 16px 0; border-bottom: 1px solid var(--rule); font-size: 0.94rem; }
.contact-hints strong { color: var(--ink); font-weight: 500; }
.contact-hints span { color: var(--ink-2); }
.contact-form { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 32px; display: grid; gap: 20px; }
.contact-form .field { display: grid; gap: 8px; min-width: 0; }
.contact-form .field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.contact-form label { font-size: 0.88rem; font-weight: 500; color: var(--ink); }
.contact-form .opt { color: var(--ink-3); font-weight: 400; }
.contact-form input, .contact-form select, .contact-form textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--rule-strong); border-radius: var(--r-sm); background: var(--paper); color: var(--ink); font: inherit; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.contact-form textarea { resize: vertical; min-height: 160px; line-height: 1.55; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.contact-form [aria-invalid="true"] { border-color: var(--neg); }
.contact-submit { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.contact-submit .fine { margin: 0; flex: 1 1 220px; }
.contact-form .form-msg { margin: 0; }
.contact-form .form-msg:empty { display: none; }
.contact-form.sent .field, .contact-form.sent .field-row, .contact-form.sent .contact-submit { display: none; }
.contact-form.sent .form-msg { font-size: 1rem; padding: 8px 0; }
@media (max-width: 980px) { .contact { grid-template-columns: minmax(0, 1fr); gap: 40px; } }
@media (max-width: 560px) { .contact-form { padding: 22px 18px; } .contact-form .field-row { grid-template-columns: minmax(0, 1fr); } }

/* Responsive */
@media (max-width: 980px) {
  .hero .wrap, .code-grid, .faq-grid, .news { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .hero { padding: 56px 0 64px; }
  .hero h1 { max-width: 14ch; }
  .use { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .docs { grid-template-columns: minmax(0, 1fr); }
  .docs aside { display: none; }
  .section { padding: 72px 0; }
}
@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; }
  .steps li, .steps li + li { padding: 24px 0; border-left: 0; }
  .steps li + li { border-top: 1px solid var(--rule); }
  /* Pricing turns into three stacked plans; row labels move inside each cell */
  .pricing { grid-template-columns: 1fr; border-radius: var(--r-lg); }
  .pricing .rowlabel, .pricing .corner { display: none; }
  .pricing .col { justify-content: space-between; text-align: left; }
  .pricing .col[data-label]::before { content: attr(data-label); color: var(--ink-2); margin-right: 12px; }
  .pricing .plan-head { align-items: flex-start; border-top: 1px solid var(--rule-strong); }
  .pricing .plan-head:first-of-type { border-top: 0; }
  .pricing .m1 { order: 1; } .pricing .m2 { order: 2; } .pricing .m3 { order: 3; }
  .site-footer .wrap { grid-template-columns: 1fr 1fr; }
  .site-footer .wrap > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  nav.main a.hide-sm { display: none; }
  .report-head { flex-wrap: wrap; }
  .ledger th, .ledger td { padding: 10px 12px; }
  .ledger .old { display: none; }
}
.section-head.flush { margin-bottom: 0; }
@media (max-width: 560px) { .hide-xs { display: none; } nav.main a.btn { margin-left: 2px; } }
@media (max-width: 430px) { nav.main a.hide-xxs { display: none; } }

/* ---- Public company pages, hubs and the Bolagsverket API page (server-rendered, see seo.py) ---- */
.page:has(.co-api) { padding-bottom: 0; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px 8px; font-size: 0.86rem; color: var(--ink-3); margin-bottom: 28px; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch; }

.co-head { max-width: 820px; padding-bottom: 36px; }
.co-head h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); line-height: 1.04; overflow-wrap: anywhere; }
.co-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 16px; color: var(--ink-2); font-size: 0.95rem; }
.co-meta > span + span:not(.pill) { padding-left: 18px; border-left: 1px solid var(--rule-strong); }
.co-lede { margin-top: 20px; font-size: 1.1rem; line-height: 1.65; color: var(--ink-2); max-width: 66ch; }

.pill { display: inline-flex; align-items: center; gap: 7px; padding: 3px 11px 3px 9px; border-radius: 999px; font-size: 0.82rem; font-weight: 500; border: 1px solid currentColor; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-active { color: var(--pos); }
.pill-bankruptcy, .pill-liquidation, .pill-reconstruction { color: var(--neg); }
.pill-deregistered { color: var(--ink-3); }

.co-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 56px; align-items: start; padding-top: 36px; border-top: 1px solid var(--ink); }
.co-section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 24px; margin-bottom: 18px; }
.co-section-head h2, .co-desc h2, .co-facts h2, .co-more h2 { font-size: 1.55rem; }
.co-section-head p { font-size: 0.86rem; color: var(--ink-3); }

.co-chart { margin: 0 0 8px; }
.co-chart svg { width: 100%; height: auto; max-height: 260px; display: block; }
.co-chart .axis { stroke: var(--rule-strong); stroke-width: 1; }
.co-chart .bar-rev { fill: var(--ink); }
.co-chart .bar-res { fill: var(--accent); }
.co-chart .bar-res.neg { fill: var(--neg); }
.co-chart .yr { fill: var(--ink-3); font: 500 12px var(--sans); font-variant-numeric: tabular-nums; }
.co-chart figcaption { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--ink-3); margin-top: 6px; }
.co-chart .key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.co-chart .key-rev { background: var(--ink); }
.co-chart .key-res { background: var(--accent); margin-left: 12px; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.co-ledger { border-top: 1px solid var(--rule); }
.co-ledger th, .co-ledger td { padding: 11px 0 11px 20px; }
.co-ledger th:first-child { padding-left: 0; }
.co-ledger thead th:first-child { text-align: left; }
.co-ledger .pe { display: block; font-size: 0.72rem; color: var(--ink-3); font-weight: 400; }
.co-ledger td.neg, .hub-table td.neg { color: var(--neg); }
.co-ledger tr.derived th { padding-left: 12px; }
.co-ledger tr.derived td:last-child { padding-right: 12px; }
.co-note { margin-top: 14px; font-size: 0.85rem; color: var(--ink-3); max-width: 72ch; }
.co-empty { padding: 22px 24px; background: var(--paper-2); border-radius: var(--r-md); color: var(--ink-2); max-width: 66ch; }

.co-desc { margin-top: 56px; }
.co-desc p { margin-top: 14px; color: var(--ink-2); max-width: 70ch; font-family: var(--serif); font-size: 1.12rem; line-height: 1.7; }

.co-facts { position: sticky; top: 88px; }
.co-facts dl { margin: 16px 0 0; border-top: 1px solid var(--rule); }
.co-facts dl > div { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.co-facts dt { font-size: 0.8rem; color: var(--ink-3); }
.co-facts dd { margin: 0; font-size: 0.95rem; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.co-source { margin-top: 14px; font-size: 0.82rem; color: var(--ink-3); }
.co-source + .co-source { margin-top: 4px; }

.co-api { margin-top: 88px; background: var(--code-bg); color: var(--code-ink); padding: 72px 0; }
.co-api-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 56px; align-items: center; }
.co-api h2 { color: #fff; font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.1; overflow-wrap: anywhere; }
.co-api p { margin-top: 14px; color: var(--code-ink); max-width: 46ch; }
.co-api a:not(.btn) { color: var(--code-key); }
.co-api .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.co-api .assure { font-size: 0.88rem; color: var(--code-dim); }
.co-api .code-card { border-color: #22324a; box-shadow: none; background: #08111e; }
.co-api pre.code { background: transparent; max-height: 420px; }
.btn-ghost { background: transparent; color: #fff; border-color: #3a4d6b; }
.btn-ghost:hover { border-color: #8693a8; }
@media (prefers-color-scheme: dark) { .co-api { background: #08111e; border-top: 1px solid var(--rule); } .co-api .code-card { background: #050b14; } }

.co-more { padding-top: 72px; padding-bottom: 96px; }
.peer-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 56px; border-top: 1px solid var(--rule); }
.peer-list li { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--rule); }
.peer-list a { color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.peer-list a:hover { color: var(--accent); text-decoration: underline; }
.peer-list .num { color: var(--ink-3); font-size: 0.9rem; flex: none; }
.co-links { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 22px; font-size: 0.95rem; }

/* Hubs */
.hub-table { border-top: 1px solid var(--ink); }
.hub-table th, .hub-table td { padding: 12px 0 12px 20px; }
.hub-table thead th { text-align: right; }
.hub-table thead th:nth-child(2), .hub-table thead th:nth-child(3), .hub-table td.txt { text-align: left; }
.hub-table .rank { color: var(--ink-3); width: 2.5em; padding-left: 0; text-align: left; }
.hub-table tbody th { white-space: normal; min-width: 220px; }
.hub-table tbody th a { color: var(--ink); text-decoration: none; font-weight: 500; }
.hub-table tbody th a:hover { color: var(--accent); text-decoration: underline; }
.hub-table .sub { display: block; font-size: 0.78rem; color: var(--ink-3); }
.hub-table td.txt { white-space: normal; color: var(--ink-2); max-width: 28ch; font-size: 0.86rem; }
.hub-index { columns: 2; column-gap: 64px; border-top: 1px solid var(--ink); padding-top: 12px; }
.hub-index section { break-inside: avoid; padding: 20px 0 12px; }
.hub-index h2 { font-family: var(--sans); font-size: 1rem; font-weight: 600; letter-spacing: 0; display: flex; gap: 12px; align-items: baseline; margin-bottom: 8px; }
.sec-letter { font: 500 1.4rem/1 var(--serif); color: var(--accent); min-width: 1.1em; }
.hub-index ul { list-style: none; margin: 0; padding: 0; }
.hub-index li { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; border-bottom: 1px solid var(--rule); font-size: 0.92rem; }
.hub-index li a { color: var(--ink-2); text-decoration: none; }
.hub-index li a:hover { color: var(--accent); text-decoration: underline; }
.hub-index li .num { color: var(--ink-3); font-size: 0.85rem; flex: none; }

/* Bolagsverket API page */
.bv-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; padding-bottom: 72px; }
.bv-hero h1 { font-size: clamp(2.3rem, 4.6vw, 3.6rem); line-height: 1.04; }
.bv-hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.bv-hero .assure { margin-top: 16px; font-size: 0.9rem; color: var(--ink-3); }
.bv-section { padding: 72px 0; border-top: 1px solid var(--rule); }
.bv-section > h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); line-height: 1.1; }
.bv-intro { margin: 14px 0 28px; color: var(--ink-2); max-width: 66ch; font-size: 1.05rem; }
.compare { width: 100%; border-collapse: collapse; font-size: 0.95rem; border-top: 1px solid var(--ink); }
.compare th, .compare td { text-align: left; padding: 14px 24px 14px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.compare thead th { font-size: 0.85rem; color: var(--ink-3); font-weight: 500; }
.compare thead th:last-child { color: var(--accent); }
.compare tbody th { font-weight: 500; width: 30%; }
.compare td { color: var(--ink-2); }
.compare td:last-child { color: var(--ink); }
.coverage { width: 100%; border-collapse: collapse; font-size: 0.92rem; margin-bottom: 40px; }
.coverage caption { text-align: left; padding-bottom: 12px; caption-side: top; }
.coverage caption span { margin-left: 12px; }
.coverage caption strong { font: 500 1.25rem var(--serif); }
.coverage caption span { font-size: 0.85rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.coverage th, .coverage td { text-align: left; padding: 10px 20px 10px 0; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.coverage thead th { font-size: 0.8rem; color: var(--ink-3); font-weight: 500; border-top: 1px solid var(--ink); }
.coverage tbody th { font-weight: 400; white-space: normal; }
.coverage code { font-size: 0.78rem; }
.coverage td.num, .coverage thead th:nth-child(3) { text-align: right; }
.cov-cell { display: flex; align-items: center; gap: 12px; min-width: 200px; }
.cov-cell .num { min-width: 4.5em; text-align: right; }
.meter { width: 140px; height: 6px; flex: none; }
.meter-bg { fill: var(--paper-2); stroke: var(--rule); stroke-width: 0.5; }
.meter-fg { fill: var(--accent); }

@media (max-width: 980px) {
  .co-grid, .co-api-grid, .bv-hero { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .co-facts { position: static; }
  .hub-index { columns: 1; }
}
@media (max-width: 560px) {
  .peer-list { grid-template-columns: minmax(0, 1fr); }
  .co-ledger th, .co-ledger td { padding-left: 14px; }
  .co-ledger .old { display: none; }
  .co-ledger th, .co-ledger td { white-space: normal; }
  .co-api { padding: 56px 0; margin-top: 64px; }
  .meter { width: 70px; }
  .cov-cell { min-width: 0; }
  .hub-table td.txt { display: none; }
  .hub-table thead th:nth-child(3) { display: none; }
}
.co-chart .val { fill: var(--ink-2); font: 500 11.5px var(--sans); font-variant-numeric: tabular-nums; }
.co-chart .val-res { fill: var(--accent); }
.co-chart .val.neg { fill: var(--neg); }
@media (max-width: 560px) { .co-chart .val { font-size: 15px; } .co-chart .yr { font-size: 16px; } }
.co-ledger tbody tr, .hub-table tbody tr { animation: none; }
.coverage { table-layout: fixed; min-width: 640px; }
.coverage thead th:nth-child(1) { width: 34%; } .coverage thead th:nth-child(2) { width: 28%; }
.coverage thead th:nth-child(3) { width: 12%; } .coverage thead th:nth-child(4) { width: 26%; }
.coverage td:nth-child(2) { overflow: hidden; text-overflow: ellipsis; }
.coverage td.num { padding-right: 24px; }
@media (max-width: 560px) {
  .coverage { min-width: 0; }
  .coverage th:nth-child(2), .coverage td:nth-child(2) { display: none; }
  .coverage thead th:nth-child(1) { width: 46%; } .coverage thead th:nth-child(3) { width: 22%; } .coverage thead th:nth-child(4) { width: 32%; }
  .coverage td.num { padding-right: 10px; }
  .cov-cell .meter { display: none; }
  .compare { font-size: 0.86rem; }
  .compare th, .compare td { padding-right: 12px; }
  .compare tbody th { width: 28%; }
}
