/* digipex Reporting. Tokens come from the marketing site (tokens.css), so both read as one brand.
   Layout: shared base (screen and PDF), then the screen design, then the print layout for "PDF herunterladen". */
:root {
  --line: #e4dbcb;          /* card borders and rules on paper */
  --inset: #fffdf9;         /* fields and cards that sit on a paper card */
  --wash: #f3ede2;          /* row hover */
  --good: #2f6022; --good-bg: #e3edd8;     /* 6.2:1 */
  --bad: #9a3f22; --bad-bg: #f6e0d6;       /* 5.3:1 */
  --warn: #6b5304; --warn-bg: #f3e6c4;     /* 5.9:1 */
  --info: #075e80; --info-bg: #dcecf2;     /* 5.9:1 */
  --shadow-card: 0 1px 2px rgba(28, 24, 21, 0.04), 0 10px 28px -22px rgba(28, 24, 21, 0.28);
  --page: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; background: var(--bone); color: var(--ink-3); font: 400 var(--fs-body)/1.6 var(--font-sans); display: flex; flex-direction: column; min-height: 100vh; -webkit-font-smoothing: antialiased; }
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--rose-deep); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
h1, h2, h3, h4 { color: var(--ink); margin: 0; line-height: 1.15; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.01em; }
h1 { font-size: var(--fs-h2); }
h2 { font-size: var(--fs-h3); }
h3 { font-size: var(--fs-h4); }
h4 { font: 600 var(--fs-tiny)/1.3 var(--font-sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--umber); }
p { margin: 0 0 1rem; }
code { font-size: 0.85em; word-break: break-word; background: var(--bone-2); padding: 0.05rem 0.3rem; border-radius: var(--radius); }
:focus-visible { outline: 2px solid var(--rose-deep); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--on-dark); padding: 0.5rem 1rem; z-index: 50; }
.skip-link:focus { left: 8px; }
.icon { width: 1rem; height: 1rem; flex: none; }
.eyebrow { font: 600 var(--fs-tiny)/1.3 var(--font-sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--umber); margin: 0 0 0.75rem; }
.lead { font-size: 1.15rem; }
.muted { color: var(--mute); font-size: var(--fs-small); }
.nowrap { white-space: nowrap; }

/* ---------------------------------------------------------------- Top bar and footer */
.topbar { position: relative; z-index: 20; display: flex; align-items: center; gap: 0 2rem; min-height: 60px; padding: 0 var(--gutter); background: var(--ink); color: var(--on-dark-2); }
.brand { display: inline-flex; align-items: center; gap: 0.7rem; color: var(--on-dark); text-decoration: none; }
.brand:hover { color: var(--on-dark); }
.brand__name { font: 400 1.4rem/1 var(--font-display); letter-spacing: -0.01em; }
.brand__product { padding: 0.2rem 0 0.2rem 0.7rem; border-left: 1px solid rgba(246, 241, 232, 0.25); font: 600 0.6875rem/1 var(--font-sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--glow); }
.topbar__nav { display: flex; align-self: stretch; gap: 0.25rem; }
.topbar__nav a { display: flex; align-items: center; padding: 0 0.8rem; color: var(--on-dark-2); text-decoration: none; font-size: var(--fs-small); font-weight: 500; box-shadow: inset 0 -2px 0 transparent; transition: color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
.topbar__nav a:hover { color: var(--on-dark); }
.topbar__nav a[aria-current] { color: var(--on-dark); box-shadow: inset 0 -2px 0 var(--rose); }
.topbar__user { margin-left: auto; display: flex; align-items: center; gap: 0.7rem; font-size: var(--fs-small); }
.avatar { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--dusk); color: var(--glow); font: 600 0.75rem/1 var(--font-sans); letter-spacing: 0.04em; }
.topbar__who { color: var(--on-dark-3); }
.topbar__logout { background: none; border: 1px solid rgba(246, 241, 232, 0.22); border-radius: var(--radius); color: var(--on-dark-2); font: 500 0.8125rem/1 var(--font-sans); padding: 0.55rem 0.8rem; cursor: pointer; transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.topbar__logout:hover { border-color: var(--glow); color: var(--on-dark); }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem 1.5rem; flex-wrap: wrap; padding: 1.4rem var(--gutter); font-size: var(--fs-tiny); color: var(--mute); border-top: 1px solid var(--sand); }
.foot__links { display: flex; gap: 1.25rem; }
.foot a { color: var(--mute); }
.foot a:hover { color: var(--ink); }

/* ---------------------------------------------------------------- Buttons, forms, notices */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 2.5rem; background: var(--ink); color: var(--on-dark); border: 1px solid var(--ink); border-radius: var(--radius); padding: 0.55rem 1.1rem; font: 500 var(--fs-small)/1.2 var(--font-sans); text-decoration: none; white-space: nowrap; cursor: pointer; transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.button:hover { background: var(--rose-deep); border-color: var(--rose-deep); color: #fff; }
.button--ghost { background: var(--paper); color: var(--ink); border-color: var(--sand-2); }
.button--ghost:hover { background: var(--paper); color: var(--ink); border-color: var(--ink); }
.button--small { min-height: 2.15rem; padding: 0.4rem 0.8rem; font-size: 0.8125rem; }
.button--block { width: 100%; }
.icon-button { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; flex: none; border: 1px solid var(--sand-2); border-radius: var(--radius); background: var(--inset); color: var(--ink); transition: border-color var(--dur-fast) var(--ease); }
.icon-button:hover { border-color: var(--ink); color: var(--ink); }
.icon-button.is-disabled { opacity: 0.35; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--rose-deep); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; cursor: pointer; }
.link-button:hover { color: var(--ink); }
.link-button--danger { color: var(--bad); }

input, select, textarea { width: 100%; font: 400 0.9375rem/1.45 var(--font-sans); color: var(--ink); background: var(--inset); border: 1px solid var(--sand-2); border-radius: var(--radius); padding: 0.55rem 0.75rem; transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
input:hover, select:hover, textarea:hover { border-color: var(--mute); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--rose-deep); box-shadow: 0 0 0 3px rgba(201, 106, 74, 0.2); }
textarea { resize: vertical; min-height: 5.5rem; }
select { appearance: none; padding-right: 2.25rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%236b6259' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.7rem center; background-size: 1rem; }
input[type="checkbox"], input[type="radio"] { width: 1rem; height: 1rem; padding: 0; accent-color: var(--rose-deep); box-shadow: none; }
input[type="file"] { padding: 0.4rem; font-size: var(--fs-small); }
input[type="file"]::file-selector-button { font: 500 0.8125rem/1.2 var(--font-sans); color: var(--ink); background: var(--paper); border: 1px solid var(--sand-2); border-radius: var(--radius); padding: 0.4rem 0.75rem; margin-right: 0.75rem; cursor: pointer; }
label { display: block; font-size: var(--fs-small); font-weight: 500; color: var(--ink-2); }
label > input, label > select, label > textarea { margin-top: 0.35rem; }
.check { display: flex; gap: 0.55rem; align-items: baseline; font-weight: 400; color: var(--ink-3); }
.check input { margin: 0; flex: none; transform: translateY(0.12rem); }
.stack { display: grid; gap: 1rem; }
.button-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); background: var(--inset); padding: 0.9rem 1.1rem 1.1rem; margin: 0; display: grid; gap: 0.6rem; min-width: 0; }
legend { font: 600 var(--fs-tiny)/1.3 var(--font-sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--umber); padding: 0 0.4rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.5rem; }
.form-grid fieldset, .form-grid .check { grid-column: 1 / -1; }
.field-narrow { max-width: 12rem; }
.field-wide { margin-top: 1.25rem; }
.label-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.chip { display: inline-block; font: 500 0.6875rem/1.6 var(--font-sans); letter-spacing: 0.03em; padding: 0 0.5rem; border-radius: 999px; background: var(--bone-2); color: var(--umber); }
.form-error { background: var(--bad-bg); color: var(--bad); padding: 0.7rem 0.9rem; border-left: 3px solid var(--bad); border-radius: var(--radius); font-size: var(--fs-small); }
.notice { display: flex; align-items: center; gap: 0.55rem; padding: 0.7rem 0.95rem; border-radius: var(--radius); background: var(--good-bg); color: var(--good); font-size: var(--fs-small); font-weight: 500; }
main > .notice { width: min(100% - 32px, var(--page) - 32px); margin: 1.25rem auto 0; }
.notice--warn { background: var(--warn-bg); color: var(--warn); margin: 0 0 1.25rem; }

/* ---------------------------------------------------------------- Tables and badges */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
th, td { padding: 0.55rem 0.75rem 0.55rem 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
thead th { font: 600 0.6875rem/1.3 var(--font-sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--umber); border-bottom-color: var(--sand-2); vertical-align: bottom; }
tbody th { font-weight: 500; color: var(--ink); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.list-table th, .list-table td { padding: 0.7rem 0.75rem; vertical-align: middle; }
.list-table th:first-child, .list-table td:first-child { padding-left: 0; }
.list-table th:last-child, .list-table td:last-child { padding-right: 0; }
.list-table tbody tr:last-child > * { border-bottom: 0; }
.list-table tbody th a { color: var(--ink); font-weight: 500; text-decoration: none; }
.list-table tbody th a:hover { color: var(--rose-deep); text-decoration: underline; }
.row-actions { text-align: right; white-space: nowrap; font-size: var(--fs-small); }
.row-actions > a, .row-actions > form { display: inline; margin-left: 1rem; }
.row-actions > :first-child { margin-left: 0; }
.form-table th, .form-table td { padding: 0.35rem 0.6rem 0.35rem 0; border-bottom: 0; vertical-align: middle; }
.form-table thead th { padding-bottom: 0.5rem; border-bottom: 1px solid var(--line); }
.form-table tbody tr:first-child td { padding-top: 0.7rem; }
.form-table input, .form-table select { min-width: 9rem; margin: 0; }
.badge { display: inline-flex; align-items: center; gap: 0.35rem; font: 500 0.75rem/1.55 var(--font-sans); letter-spacing: 0; text-transform: none; padding: 0 0.55rem; border-radius: 999px; background: var(--bone-2); color: var(--ink-2); white-space: nowrap; vertical-align: middle; }
.badge::before { content: ""; width: 0.4rem; height: 0.4rem; border-radius: 50%; background: currentColor; }
.badge--ok { background: var(--good-bg); color: var(--good); }
.badge--draft, .badge--partial { background: var(--warn-bg); color: var(--warn); }
.badge--error { background: var(--bad-bg); color: var(--bad); }
.badge--running { background: var(--info-bg); color: var(--info); }
.badge--muted { background: var(--bone-2); color: var(--mute); }

/* ---------------------------------------------------------------- Cards and empty states */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.15rem, 2.4vw, 1.75rem); box-shadow: var(--shadow-card); min-width: 0; }
.card__head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.35rem 1rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.card__head p { margin: 0; }
.card__head > a { font-size: var(--fs-small); }
.card__title { font-size: 1.3rem; margin: 0 0 0.9rem; }
.card__head .card__title { margin: 0; }
.card > .muted { margin-bottom: 1rem; }
.card__foot { margin-top: 1rem; }
.empty-state { max-width: 680px; margin: 0 auto; padding: clamp(3.5rem, 10vw, 7rem) 16px; }
.empty-state h1, .empty-state h2 { font-size: var(--fs-h2); margin-bottom: 1rem; }
.empty-card h2 { margin: 0 0 0.5rem; font-size: 1.5rem; }

/* ---------------------------------------------------------------- Login */
body.auth main { display: flex; }
.auth-split { flex: 1; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth__panel { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 3rem; padding: clamp(1.75rem, 4.5vw, 3.75rem); background: var(--ink); color: var(--on-dark-2); }
.auth__panel > * { position: relative; z-index: 1; }
.auth__pitch { max-width: 28rem; padding-bottom: clamp(5rem, 14vh, 9rem); }
.auth__claim { margin: 0 0 1rem; font: 400 clamp(1.8rem, 1.6vw + 1.2rem, 2.75rem)/1.12 var(--font-display); letter-spacing: -0.015em; color: var(--on-dark); }
.auth__sub { margin: 0; color: var(--on-dark-3); }
.auth__ridge { position: absolute; z-index: 0; left: 0; bottom: 0; width: 100%; height: 48%; }
.auth-card { place-self: center; width: min(400px, 100%); padding: clamp(2.5rem, 7vw, 4rem) 16px; }
.auth-card h1 { font-size: clamp(2.1rem, 1.5vw + 1.6rem, 2.75rem); margin-bottom: 1.5rem; }
.auth-card__lead { color: var(--ink-3); }
.auth-card .notice, .auth-card .form-error { margin-bottom: 1.25rem; }
.auth-card .stack { gap: 1.1rem; }
.auth-card .button { margin-top: 0.4rem; min-height: 2.75rem; }
.auth-card__alt { margin: 1.25rem 0 0; font-size: var(--fs-small); }

/* ---------------------------------------------------------------- Admin */
.admin { max-width: var(--page); margin: 0 auto; padding: clamp(1.75rem, 4vw, 2.75rem) 16px clamp(3rem, 6vw, 4.5rem); }
.admin h2 { margin: 2rem 0 0.75rem; }
.admin h3 { margin: 1.5rem 0 0.5rem; }
.admin .card__title { margin: 0 0 0.9rem; }
.admin .card__head .card__title { margin: 0; }
.admin__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem 1.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.admin__title { min-width: 0; }
.admin__title .eyebrow { margin-bottom: 0.45rem; }
.admin h1 { font-size: clamp(2rem, 1.3vw + 1.55rem, 2.75rem); display: flex; align-items: center; gap: 0.5rem 0.85rem; flex-wrap: wrap; }
.admin__meta { margin: 0.5rem 0 0; color: var(--mute); font-size: var(--fs-small); }
.crumbs { margin: 0 0 0.35rem; font-size: var(--fs-small); color: var(--mute); }
.crumbs a { color: var(--mute); text-decoration: none; }
.crumbs a:hover { color: var(--rose-deep); text-decoration: underline; }
.tabs { display: flex; gap: 0.25rem; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--sand); margin-bottom: 1.75rem; }
.tabs a { margin-bottom: -1px; padding: 0.7rem 0.85rem; color: var(--ink-3); text-decoration: none; font-size: var(--fs-small); font-weight: 500; white-space: nowrap; border-bottom: 2px solid transparent; }
.tabs a:first-child { padding-left: 0; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--rose); }
.split { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.aside-stack { display: grid; gap: 1.5rem; min-width: 0; }
.backfill { display: grid; gap: 0.6rem; margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.settings-form { display: grid; gap: 1.5rem; }
.form-actions { position: sticky; bottom: 0; z-index: 5; display: flex; gap: 0.75rem; padding: 1rem 0 1.1rem; margin-top: -0.5rem; background: linear-gradient(to top, var(--bone) 72%, rgba(246, 241, 232, 0)); }
.settings-form + .card { margin-top: 1.5rem; }

/* Client overview */
.client-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); gap: 1.25rem; }
.client-card { display: flex; flex-direction: column; gap: 1.15rem; }
.client-card.is-inactive { opacity: 0.78; }
.client-card__head { display: flex; align-items: center; gap: 0.9rem; }
.client-card__logo { flex: none; display: grid; place-items: center; width: 3rem; height: 3rem; overflow: hidden; border-radius: var(--radius); background: var(--ink); color: var(--glow); font: 400 1.15rem/1 var(--font-display); }
.client-card__logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 0.3rem; }
.client-card__name { flex: 1; min-width: 0; }
.client-card h2 { margin: 0; font-size: 1.3rem; }
.client-card h2 a { color: var(--ink); text-decoration: none; }
.client-card h2 a:hover { color: var(--rose-deep); text-decoration: underline; }
.client-card__name p { margin: 0.15rem 0 0; font-size: var(--fs-small); color: var(--mute); }
.facts { margin: 0; display: grid; gap: 0.55rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: var(--fs-small); }
.facts > div { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; }
.facts dt { color: var(--mute); }
.facts dd { margin: 0; color: var(--ink); display: flex; align-items: center; justify-content: flex-end; gap: 0.4rem; flex-wrap: wrap; text-align: right; }
.client-card__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: auto; }

/* Sync runs */
.runs { list-style: none; margin: 0; padding: 0; font-size: var(--fs-small); }
.run { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.65rem; padding: 0.65rem 0; border-bottom: 1px solid var(--line); }
.run:first-child { padding-top: 0; }
.run:last-child { border-bottom: 0; padding-bottom: 0; }
.run__job { min-width: 0; }
.run__time { margin-left: auto; color: var(--mute); font-variant-numeric: tabular-nums; white-space: nowrap; }
.run__details { flex-basis: 100%; }
.aside-stack .run__time { flex-basis: 100%; margin-left: 0; font-size: var(--fs-tiny); }
.run__details summary { cursor: pointer; color: var(--rose-deep); font-size: var(--fs-tiny); }
.run__details pre { white-space: pre-wrap; word-break: break-word; font-size: var(--fs-tiny); background: var(--bone); padding: 0.6rem 0.75rem; margin: 0.4rem 0 0; border-radius: var(--radius); max-height: 18rem; overflow: auto; }

/* Month review */
.review { display: grid; grid-template-columns: minmax(0, 1fr) 19rem; gap: 1.5rem; align-items: start; }
.review__main { display: grid; gap: 1.25rem; min-width: 0; }
.review__head { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.admin .review__head h2 { margin: 0; font-size: clamp(1.6rem, 1vw + 1.25rem, 2rem); }
.review__aside { position: sticky; top: 1.25rem; }
.publish { display: grid; gap: 0.9rem; }
.admin .publish .card__title { margin: 0; }
.publish p { margin: 0; }
.publish__state { display: flex; align-items: center; gap: 0.5rem; font-size: var(--fs-small); }
.publish__actions { display: grid; gap: 0.5rem; }
.publish__preview { display: inline-flex; align-items: center; gap: 0.4rem; font-size: var(--fs-small); justify-self: start; }
.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.25rem, 1fr)); gap: 0.75rem; }
.pick { position: relative; display: grid; gap: 0.15rem; padding: 0.45rem 0.45rem 0.6rem; background: var(--inset); border: 1px solid var(--line); border-radius: var(--radius); font-size: var(--fs-tiny); font-weight: 400; cursor: pointer; transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
.pick:hover { border-color: var(--sand-2); }
.pick:has(.pick__input:checked) { border-color: var(--rose-deep); box-shadow: 0 0 0 1px var(--rose-deep); }
.pick__input { position: absolute; top: 0.85rem; left: 0.85rem; z-index: 1; width: 1.15rem; height: 1.15rem; margin: 0; }
.pick__media { display: block; aspect-ratio: 1; margin-bottom: 0.35rem; overflow: hidden; background: var(--bone-2); }
.pick__media img { width: 100%; height: 100%; object-fit: cover; }
.pick__meta { color: var(--mute); }
.pick__stat { color: var(--ink); font-weight: 600; }

/* Report setup and uploads */
.module-groups { display: grid; gap: 1rem; }
.module-row { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding-top: 0.6rem; border-top: 1px solid var(--line); }
.module-row:first-of-type { padding-top: 0; border-top: 0; }
.module-row__order { display: flex; align-items: center; gap: 0.5rem; color: var(--mute); font-size: var(--fs-tiny); font-weight: 400; white-space: nowrap; }
.module-row__order input { width: 4.75rem; margin: 0; padding: 0.35rem 0.5rem; }
.upload-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.upload { display: grid; gap: 0.75rem; align-content: start; }
.upload__preview { display: grid; place-items: center; height: 8.5rem; overflow: hidden; background: var(--bone); border: 1px dashed var(--sand-2); border-radius: var(--radius); color: var(--mute); font-size: var(--fs-small); }
.upload__preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.upload__preview--logo img { padding: 0.75rem; }
.upload__preview--cover img { width: 100%; height: 100%; object-fit: cover; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; }
.chips li { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.2rem 0.65rem; background: var(--inset); border: 1px solid var(--line); border-radius: 999px; font-size: var(--fs-small); }
.chip__source { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }
.chip__source--excel { color: var(--good); }

/* ---------------------------------------------------------------- Report: shared base (screen and PDF) */
.cover { position: relative; background: var(--ink); color: var(--on-dark); overflow: hidden; }
.cover__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover--photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(28, 24, 21, 0.25), rgba(28, 24, 21, 0.72)); }
.cover__inner { position: relative; z-index: 1; }
.cover h1 { color: var(--on-dark); font-size: var(--fs-h1); }
.cover__eyebrow { font: 600 var(--fs-tiny)/1.3 var(--font-sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--glow); margin: 0 0 0.75rem; }
.cover__logo { max-height: 56px; max-width: 200px; }
.cover__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.cover__top .cover__logo { margin: 0; background: var(--bone); padding: 0.5rem 0.75rem; border-radius: var(--radius); }
.cover__brand { margin: 0; font: 400 1.35rem/1 var(--font-display); color: var(--on-dark); }
.cover__brand span { display: block; margin-top: 0.4rem; font: 600 var(--fs-tiny)/1 var(--font-sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--glow); }
.cover__month { margin: 0.75rem 0 0; font: italic 300 var(--fs-h3)/1.1 var(--font-display); color: var(--glow); }
.cover__meta { margin: 1rem 0 0; font-size: var(--fs-small); color: var(--on-dark-3); }
.cover__ridge { display: none; }
.module__channel { display: none; }
.module__head { margin-bottom: 1.5rem; }
.module__head h3 { font-size: var(--fs-h3); }
.module__lead { margin: 0.35rem 0 0; color: var(--mute); font-size: var(--fs-small); }

.tile-groups { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.tile-group h4 { margin-bottom: 0.9rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 1rem 1.5rem; margin: 0; }
.tile { min-width: 0; }
.tile dt { font-size: var(--fs-small); color: var(--mute); }
.tile dd { margin: 0.15rem 0 0; }
.tile__value { display: block; font: 400 clamp(1.5rem, 1vw + 1.15rem, 1.9rem)/1.15 var(--font-display); color: var(--ink); font-variant-numeric: lining-nums; white-space: nowrap; }
.tile__delta { display: block; font-size: var(--fs-tiny); color: var(--mute); margin-top: 0.15rem; font-variant-numeric: tabular-nums; }
.tile__delta--good { color: var(--good); }
.tile__delta--bad { color: var(--bad); }

.charts { display: grid; gap: 2.5rem; }
.charts--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.viz { margin: 0; min-width: 0; }
.viz figcaption { font-size: var(--fs-small); font-weight: 600; color: var(--ink); margin-bottom: 0.5rem; }
.viz__canvas { position: relative; height: 260px; }
.charts--1 .viz__canvas { height: 320px; }
.viz__note { margin: 0.5rem 0 0; font-size: var(--fs-tiny); color: var(--mute); }
.viz__table { margin-top: 0.5rem; font-size: var(--fs-small); }
.viz__table summary { cursor: pointer; color: var(--mute); font-size: var(--fs-tiny); }
.viz__table table { margin-top: 0.5rem; }

.posts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 2rem; max-width: 1080px; }
.post { min-width: 0; }
.post__media { position: relative; background: var(--bone-2); aspect-ratio: 1; margin-bottom: 0.75rem; overflow: hidden; }
.post__media img { width: 100%; height: 100%; object-fit: cover; }
.post__noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--mute); font-size: var(--fs-tiny); }
.post__rank { position: absolute; top: 0; left: 0; z-index: 1; background: var(--ink); color: var(--on-dark); font: 400 1rem/1 var(--font-display); padding: 0.4rem 0.65rem; }
.post__meta { font-size: var(--fs-tiny); color: var(--mute); margin: 0 0 0.25rem; }
.post__caption { font-size: var(--fs-small); margin: 0 0 0.75rem; overflow-wrap: anywhere; }
.post__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin: 0 0 0.5rem; }
.post__stats dt { font-size: var(--fs-tiny); color: var(--mute); }
.post__stats dd { margin: 0; color: var(--ink); font-weight: 600; font-size: var(--fs-small); font-variant-numeric: tabular-nums; }
.post__link { display: inline-flex; align-items: center; gap: 0.3rem; font-size: var(--fs-small); }
.post__link .icon { width: 0.85rem; height: 0.85rem; }

.ranked { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 2rem 3rem; }
.ranked h4 { margin-bottom: 0.5rem; }
.ranked th { font-weight: 400; color: var(--ink-3); width: 38%; }
.ranked td, .ranked th { border-bottom: 0; padding: 0.3rem 0.75rem 0.3rem 0; vertical-align: middle; }
.ranked__bar svg { display: block; width: 100%; height: 8px; }
.ranked__bar rect { fill: var(--rose); }
.ranked td.num { padding-right: 0; width: 3.5rem; }

.data-table { margin-bottom: 2rem; }
.data-table:last-child { margin-bottom: 0; }
.data-table h4, .ad-section h4 { margin-bottom: 0.6rem; }
.ad-section { margin-bottom: 2.5rem; }
.ad-section:last-child { margin-bottom: 0; }
.ad-table { min-width: 1080px; }
.ad-table__campaign td, .ad-table__campaign th { background: var(--bone-2); }
.ad-table tfoot th, .ad-table tfoot td { font-weight: 600; color: var(--ink); border-bottom: 0; border-top: 1px solid var(--sand-2); }
.block-note { margin: 1.25rem 0 0; font-size: var(--fs-small); color: var(--mute); }

.texts { display: grid; gap: 1.5rem; }
.texts--2, .texts--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.texts__title { font: 600 var(--fs-tiny)/1.3 var(--font-sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--umber); margin: 0 0 0.9rem; }
.text-card { background: var(--paper); padding: 1.25rem 1.5rem; }
.text-card h4 { color: var(--rose-deep); margin-bottom: 0.6rem; }
.text-card ul { margin: 0; padding-left: 1.1rem; }
.text-card li { margin-bottom: 0.35rem; }
.text-card li:last-child { margin-bottom: 0; }
.text-card p { margin: 0; }

/* ---------------------------------------------------------------- Report: screen */
@media screen {
  /* Cover: the brand is in the top bar already, so the screen cover shows client, month and logo */
  .cover__inner { max-width: var(--container); margin: 0 auto; padding: clamp(2.75rem, 7vw, 5rem) var(--gutter) clamp(2.25rem, 5vw, 3.75rem); display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem 2rem; }
  .cover__ridge { display: block; position: absolute; left: 0; bottom: 0; width: 100%; height: 78%; opacity: 0.85; }
  .cover--photo .cover__ridge { display: none; }
  .cover__brand { display: none; }
  .cover__top { order: 2; }
  .cover__top:not(:has(.cover__logo)) { display: none; }
  .cover__top .cover__logo { max-height: 64px; max-width: 220px; padding: 0.6rem 0.8rem; }
  .cover h1 { font-size: clamp(2.4rem, 3.4vw + 1.1rem, 4.4rem); letter-spacing: -0.02em; }
  .cover__month { font-size: clamp(1.35rem, 1vw + 1.05rem, 1.9rem); }

  /* Sticky toolbar: month, channels, PDF */
  .toolbar { position: sticky; top: 0; z-index: 10; background: rgba(251, 248, 242, 0.94); border-bottom: 1px solid var(--line); box-shadow: 0 6px 18px -16px rgba(28, 24, 21, 0.4); -webkit-backdrop-filter: saturate(1.3) blur(10px); backdrop-filter: saturate(1.3) blur(10px); }
  .toolbar__inner { max-width: var(--container); margin: 0 auto; min-height: 3.5rem; padding: 0 var(--gutter); display: flex; align-items: center; gap: 0.5rem 1.5rem; }
  .month-nav { display: flex; align-items: center; gap: 0.35rem; }
  .month-nav__form { margin: 0; }
  .month-nav select { width: auto; min-width: 11.5rem; margin: 0; padding-top: 0.4rem; padding-bottom: 0.4rem; font-weight: 500; }
  .toolbar__nav { display: flex; align-self: stretch; gap: 0.15rem; overflow-x: auto; scrollbar-width: none; }
  .toolbar__nav::-webkit-scrollbar { display: none; }
  .toolbar__nav a { display: flex; align-items: center; padding: 0 0.75rem; color: var(--ink-3); font-size: var(--fs-small); font-weight: 500; text-decoration: none; white-space: nowrap; box-shadow: inset 0 -2px 0 transparent; transition: color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
  .toolbar__nav a:hover { color: var(--ink); }
  .toolbar__nav a[aria-current] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--rose); }
  .toolbar__pdf { margin-left: auto; }
  .draft-banner { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin: 0; padding: 0.65rem max(var(--gutter), calc((100% - var(--container)) / 2 + var(--gutter))); background: var(--warn-bg); color: var(--warn); font-size: var(--fs-small); font-weight: 500; }
  .draft-banner a { color: inherit; font-weight: 600; }

  /* Channels and module cards */
  .report-body { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter) clamp(3rem, 6vw, 5rem); }
  .channel { padding-top: clamp(2.5rem, 5vw, 3.75rem); }
  .channel__head { display: flex; align-items: baseline; gap: 0.85rem; margin-bottom: 1.25rem; }
  .channel__head::after { content: ""; flex: 1; align-self: center; height: 1px; margin-left: 0.5rem; background: var(--sand-2); }
  .channel__index { font: italic 300 clamp(1.2rem, 0.6vw + 1rem, 1.5rem)/1 var(--font-display); color: var(--rose-deep); }
  .channel__head h2 { font-size: clamp(1.9rem, 1.5vw + 1.35rem, 2.6rem); }
  .module { container-type: inline-size; padding: clamp(1.2rem, 2.6vw, 2rem); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-card); }
  .module + .module { margin-top: 1.25rem; }
  .module__head { margin-bottom: clamp(1.25rem, 2.5vw, 1.75rem); }
  .module__head h3 { font-size: clamp(1.35rem, 0.7vw + 1.1rem, 1.65rem); }
  .module__lead { max-width: 80ch; }

  /* KPI bands: a row per group, the label column on the left once there is room */
  .tile-groups { display: block; }
  .tile-group { display: grid; gap: 0.9rem; padding: 1.35rem 0; border-top: 1px solid var(--line); }
  .tile-group:first-child { padding-top: 0; border-top: 0; }
  .tile-group:last-child { padding-bottom: 0; }
  .tile-group h4 { margin: 0; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.25rem), 1fr)); gap: 1.25rem 1.5rem; }
  .tile dt { font-size: 0.8125rem; }
  .tile dd { margin-top: 0.25rem; }
  .tile__value { font-size: clamp(1.4rem, 4.6cqi, 1.75rem); white-space: normal; }
  .tile__delta { display: inline-flex; align-items: center; gap: 0.2rem; margin-top: 0.4rem; padding: 0.05rem 0.45rem; border-radius: 999px; background: var(--bone-2); font: 600 0.75rem/1.5 var(--font-sans); }
  .tile__delta--good { background: var(--good-bg); }
  .tile__delta--bad { background: var(--bad-bg); }
  @container (min-width: 880px) {
    .tile-group { grid-template-columns: 10.5rem minmax(0, 1fr); gap: 1.5rem; align-items: start; }
    .tile-group h4 { padding-top: 0.15rem; }
    .tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .tile__value { font-size: clamp(1.4rem, 1.9cqi, 1.75rem); }
  }
  @container (max-width: 479px) {
    .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem 1rem; }
    .tile__value { font-size: 1.3rem; }
  }
  .tile-groups + .data-table, .tile-groups + .block-note, .tile-groups + .charts { margin-top: 2rem; }

  /* Charts */
  .charts { gap: 2.25rem 2.5rem; }
  .viz figcaption { font-size: 0.9375rem; margin-bottom: 0.6rem; }
  .module--ads_trends .charts--1:has(.viz + .viz) { grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); }
  .module--ads_trends .charts--1:has(.viz + .viz) .viz__canvas { height: 250px; }
  .viz__table summary { display: inline-flex; align-items: center; gap: 0.4rem; list-style: none; }
  .viz__table summary::-webkit-details-marker { display: none; }
  .viz__table summary::before { content: ""; width: 0.4rem; height: 0.4rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform var(--dur-fast) var(--ease); }
  .viz__table[open] summary::before { transform: rotate(45deg); }
  .viz__table summary:hover { color: var(--ink); }

  /* Tables in the report */
  .data-table h4, .ad-section h4 { margin-bottom: 0.75rem; }
  .data-table th, .data-table td, .ad-table th, .ad-table td, .viz__table th, .viz__table td { padding: 0.6rem 0.75rem; }
  .data-table th:first-child, .data-table td:first-child, .ad-table th:first-child, .ad-table td:first-child, .viz__table th:first-child, .viz__table td:first-child { padding-left: 0.5rem; }
  .data-table tbody tr:hover > *, .ad-table tbody tr:hover > *, .viz__table tbody tr:hover > * { background: var(--wash); }
  .ad-table__campaign td, .ad-table__campaign th { background: var(--bone-2); }
  .ad-section h4 { color: var(--rose-deep); }
  /* 13 columns: tighter cells and headers that may wrap, so the table fits a desktop card without scrolling */
  .ad-table th, .ad-table td { padding: 0.55rem 0.5rem; }
  .ad-table thead th { letter-spacing: 0.06em; white-space: normal; }
  .ad-table tbody th, .ad-table tbody td:first-child, .ad-table tfoot th { min-width: 11rem; }
  .ad-table tbody td:nth-child(2) { min-width: 8rem; }

  /* Posts and creatives */
  .posts { grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 21rem)); gap: 1.25rem; max-width: none; }
  .post { display: flex; flex-direction: column; overflow: hidden; background: var(--inset); border: 1px solid var(--line); border-radius: var(--radius); }
  .post__media { margin-bottom: 0; }
  .post__rank { top: 0.6rem; left: 0.6rem; min-width: 1.9rem; text-align: center; background: var(--rose-deep); border-radius: var(--radius); padding: 0.35rem 0.5rem; }
  .post__body { display: flex; flex-direction: column; flex: 1; padding: 0.9rem 1rem 1rem; }
  .post__meta { text-transform: uppercase; letter-spacing: 0.08em; }
  .post__caption { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .post__stats { grid-template-columns: repeat(3, auto); justify-content: space-between; gap: 0.5rem 0.75rem; margin: auto 0 0; padding-top: 0.75rem; border-top: 1px solid var(--line); }
  .post__stats dd { font: 400 1.1rem/1.25 var(--font-display); white-space: nowrap; }
  .post__link { margin-top: 0.75rem; align-self: flex-start; }

  /* Audience */
  .ranked { gap: 1.75rem 2.5rem; }
  .ranked__bar svg { height: 6px; }

  /* digipex comments: cards of their own, no module chrome around them */
  .module--texts { padding: 0; background: none; border: 0; box-shadow: none; }
  .texts { gap: 1.25rem; }
  .text-card { border: 1px solid var(--line); border-top: 3px solid var(--rose); border-radius: var(--radius); box-shadow: var(--shadow-card); }
  .text-card p, .text-card li { color: var(--ink-2); }
}

/* ---------------------------------------------------------------- Responsive (screen only, the PDF never sees these) */
@media screen and (max-width: 900px) {
  .charts--2, .split, .review, .upload-grid { grid-template-columns: minmax(0, 1fr); }
  .viz__canvas, .charts--1 .viz__canvas { height: 240px; }
  .review__aside { position: static; }
  .auth-split { grid-template-columns: minmax(0, 1fr); }
  .auth__panel { gap: 2rem; }
  .auth__pitch { padding-bottom: 4.5rem; }
  .auth__claim { font-size: 1.6rem; }
}
@media screen and (max-width: 720px) {
  html { scroll-padding-top: 116px; }
  .topbar { flex-wrap: wrap; gap: 0 1rem; }
  .topbar > .brand, .topbar__user { min-height: 56px; }
  .topbar__nav { order: 3; width: calc(100% + 2 * var(--gutter)); margin: 0 calc(var(--gutter) * -1); padding: 0 calc(var(--gutter) - 0.8rem); min-height: 44px; overflow-x: auto; border-top: 1px solid var(--dusk); scrollbar-width: none; }
  .topbar__who { display: none; }
  .toolbar__inner { flex-wrap: wrap; padding-top: 0.5rem; gap: 0 0.5rem; }
  .toolbar__nav { order: 3; width: calc(100% + 2 * var(--gutter)); min-height: 2.75rem; margin: 0.4rem calc(var(--gutter) * -1) 0; padding: 0 calc(var(--gutter) - 0.75rem); border-top: 1px solid var(--line); }
  .toolbar__pdf { padding-inline: 0.6rem; }
  .toolbar__pdf span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .month-nav select { min-width: 0; }
  .cover__inner { flex-direction: column-reverse; align-items: flex-start; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .module-row { flex-wrap: wrap; }
  .facts > div { flex-wrap: wrap; }
  .admin__head > .button, .admin__head > form { width: 100%; }
  .admin__head > .button, .admin__head > form .button { width: 100%; }
}

/* ---------------------------------------------------------------- PDF: "PDF herunterladen" prints this. A4 landscape, one module per page, cover and running footer. */
@page { size: A4 landscape; margin: 14mm 14mm 20mm; @bottom-left { content: "digipex Reporting"; font: 600 8pt "Work Sans", sans-serif; color: #1c1815; vertical-align: top; padding-top: 4mm; } @bottom-right { content: counter(page); font: 400 8pt "Work Sans", sans-serif; color: #6b6259; vertical-align: top; padding-top: 4mm; } }
@page cover { margin: 0; @bottom-left { content: none; } @bottom-right { content: none; } }
@media print {
  :root { --gutter: 0; }
  html, body { background: #fff; }
  body { display: block; font-size: 10pt; line-height: 1.5; }
  .topbar, .toolbar, .foot, .draft-banner, .viz__table, .notice, .skip-link, .channel__head, .post__link, .cover__meta { display: none !important; }
  * { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  a { color: inherit; text-decoration: none; }
  .table-wrap { overflow: visible; }

  /* Cover: full bleed, alpenglow ridgeline at the bottom */
  .cover { page: cover; position: relative; z-index: 5; width: 297mm; height: 210mm; margin: 0; display: block; overflow: hidden; background: var(--ink); break-after: page; }
  .cover--photo::after { background: linear-gradient(180deg, rgba(28, 24, 21, 0.35), rgba(28, 24, 21, 0.8)); }
  .cover__ridge { display: block; position: absolute; left: 0; bottom: 0; width: 100%; height: 95mm; }
  .cover--photo .cover__ridge { display: none; }
  .cover__inner { position: absolute; inset: 0; max-width: none; padding: 20mm 22mm 36mm; display: flex; flex-direction: column; justify-content: space-between; }
  .cover__top { display: flex; justify-content: space-between; align-items: flex-start; }
  .cover__brand { font: 400 20pt/1 var(--font-display); color: var(--on-dark); letter-spacing: -0.01em; }
  .cover__brand span { display: block; margin-top: 2mm; font: 600 7.5pt/1 var(--font-sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--glow); }
  .cover__logo { margin: 0; max-height: 18mm; max-width: 55mm; background: var(--bone); padding: 3mm 4mm; border-radius: 1mm; }
  .cover__title { max-width: 190mm; margin-bottom: 8mm; }
  .cover__eyebrow { font-size: 9pt; margin-bottom: 4mm; }
  .cover h1 { font-size: 54pt; line-height: 1.02; letter-spacing: -0.02em; }
  .cover__month { display: block; margin: 6mm 0 0; font: 300 italic 24pt/1.1 var(--font-display); color: var(--glow); }

  .report-body { max-width: none; padding: 0; }
  .channel { padding-top: 0; }
  .channel + .channel, .module + .module { break-before: page; }
  .module + .module--texts { break-before: auto; margin-top: 8mm; }
  .module { padding: 0; border: 0; break-inside: avoid; }
  .module--ads_details, .module--ads_sections { break-inside: auto; }

  /* Module header: rose rule, channel label, title */
  .module__head { position: relative; margin-bottom: 8mm; padding: 5mm 0 0; border-top: 0.3mm solid var(--sand-2); }
  .module__head::before { content: ""; position: absolute; top: -0.3mm; left: 0; width: 18mm; height: 1mm; background: var(--rose); }
  .module__channel { display: block; font: 600 7.5pt/1.3 var(--font-sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--rose-deep); margin: 0 0 1.5mm; }
  .module__head h3 { font-size: 24pt; letter-spacing: -0.015em; }
  .module__lead { font-size: 9.5pt; margin-top: 1.5mm; }

  /* Tiles: one card per group */
  .tile-groups { gap: 6mm; grid-template-columns: repeat(auto-fit, minmax(76mm, 1fr)); }
  .tile-group { background: var(--paper); border-top: 0.8mm solid var(--rose); padding: 5mm 6mm 6mm; break-inside: avoid; }
  .tile-group h4 { margin-bottom: 4mm; color: var(--rose-deep); font-size: 7.5pt; }
  .tiles { grid-template-columns: repeat(auto-fit, minmax(40mm, 1fr)); gap: 5mm 6mm; }
  .tile dt { font-size: 8.5pt; }
  .tile__value { font-size: 20pt; }
  .tile__delta { font-size: 8pt; margin-top: 0.5mm; }
  .module--overview .tile__value { font-size: 26pt; }
  .module--overview .tiles { grid-template-columns: 1fr; }
  .module--ads_kpis .tile-groups { grid-template-columns: 1fr; }
  .module--ads_kpis .tiles { grid-template-columns: repeat(4, 1fr); gap: 8mm 6mm; }
  .module--ads_kpis .tile__value { font-size: 24pt; }

  /* Charts sit on a card; canvas keeps its screen width in print, so it is forced to the card width */
  .viz { background: var(--paper); padding: 4mm 4mm 3mm; break-inside: avoid; }
  .viz figcaption { font-size: 9pt; margin-bottom: 2mm; }
  .viz__note { font-size: 7.5pt; }
  .viz__canvas canvas { width: 100% !important; height: 100% !important; }
  .charts { gap: 6mm; }
  .charts--2, .module--ads_trends .charts--1:has(.viz + .viz) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .viz__canvas { height: 48mm; }
  .charts--1 .viz__canvas { height: 108mm; }
  .module--ads_trends .charts--1:has(.viz + .viz) .viz__canvas { height: 48mm; }

  /* Tables */
  table { font-size: 9pt; }
  th, td { padding: 2.2mm 3mm 2.2mm 0; border-bottom: 0.2mm solid var(--sand); }
  thead th { font: 600 7pt/1.3 var(--font-sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--umber); border-bottom: 0.4mm solid var(--ink); }
  .num { white-space: normal; }
  td.num:last-child, th.num:last-child { padding-right: 0; }
  .data-table h4, .ad-section h4 { font-size: 8pt; color: var(--rose-deep); margin-bottom: 2.5mm; }
  .data-table { margin-bottom: 7mm; break-inside: avoid; }
  .tile-groups + .data-table, .tile-groups + .block-note { margin-top: 9mm; }
  .tile-groups + .charts { margin-top: 6mm; }
  .data-table tbody tr:nth-child(even) td { background: var(--paper); }
  .data-table td:first-child { padding-left: 2mm; }
  .module--ads_catalog { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10mm; align-content: start; }
  .module--ads_catalog > .module__head, .module--ads_catalog > .block-note { grid-column: 1 / -1; }
  .module--ads_catalog table { font-size: 8.5pt; }
  .module--ads_catalog th, .module--ads_catalog td { padding-top: 1.8mm; padding-bottom: 1.8mm; }
  .block-note { font-size: 8.5pt; margin-top: 4mm; }

  .ad-section, .data-table { break-inside: avoid; }
  .ad-section + .ad-section { break-before: page; }
  .ad-table { min-width: 0; font-size: 7.5pt; }
  .ad-table th, .ad-table td { padding: 1.6mm 2mm 1.6mm 0; }
  .ad-table__campaign td, .ad-table__campaign th { background: var(--bone-2); }
  .ad-table tfoot th, .ad-table tfoot td { border-top: 0.4mm solid var(--ink); }

  /* Posts */
  .posts { grid-template-columns: repeat(3, 1fr); gap: 8mm; max-width: none; }
  .post { background: var(--paper); }
  .post__media { aspect-ratio: 16 / 10; margin-bottom: 0; }
  .post__rank { font-size: 11pt; padding: 2mm 3mm; background: var(--rose-deep); }
  .post__meta, .post__caption, .post__stats { margin-left: 4mm; margin-right: 4mm; }
  .post__meta { margin-top: 3mm; font-size: 8pt; text-transform: uppercase; letter-spacing: 0.08em; }
  .post__caption { font-size: 9.5pt; }
  .post__stats { padding: 3mm 0 4mm; border-top: 0.2mm solid var(--sand); }
  .post__stats dt { font-size: 7.5pt; }
  .post__stats dd { font-size: 11pt; font-family: var(--font-display); font-weight: 400; }

  /* Audience */
  .ranked { gap: 8mm; }
  .ranked__bar svg { height: 2.2mm; }
  .ranked__bar rect { fill: var(--rose); }
  .ranked tr { break-inside: avoid; }
  .ranked td, .ranked th { padding: 1.6mm 3mm 1.6mm 0; font-size: 9pt; }

  /* Comments */
  .module--texts { padding-top: 0; }
  .texts__title { font-size: 7.5pt; margin-bottom: 3mm; }
  .texts { gap: 6mm; }
  .text-card { background: var(--paper); border-top: 0.8mm solid var(--rose); padding: 5mm 6mm; break-inside: avoid; }
  .text-card h4 { font: 600 7.5pt/1.3 var(--font-sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--rose-deep); margin-bottom: 2.5mm; }
  .text-card p, .text-card li { font-size: 10pt; }
}
