/* vinylfabric.com
   Basecoat (static/vendor/basecoat-1.1.0.min.css, loaded first) supplies the
   components: .btn, .input, .select, .textarea, .label, .field, .fieldset,
   .card, .alert, .badge, .table. Variants are data attributes
   (data-variant="outline", data-size="sm").

   This file sets the theme through Basecoat's variables, then page layout,
   the fabric swatches and the charts. Rules sit in Basecoat's own layers:
   element defaults in `base` (after Tailwind's reset), the rest in
   `components`, so Basecoat's component styles still win over the defaults. */

:root {
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 0.5rem;
  --background: #ffffff;
  --foreground: #16202a;
  --card: #ffffff;
  --card-foreground: #16202a;
  --popover: #ffffff;
  --popover-foreground: #16202a;
  --primary: #1c4e9b;           /* tarp blue, 7.9:1 on white */
  --primary-foreground: #ffffff;
  --secondary: #eef2f6;
  --secondary-foreground: #16202a;
  --muted: #f3f5f7;
  --muted-foreground: #536070;
  --accent: #eef2f6;
  --accent-foreground: #16202a;
  --destructive: #b42318;
  --border: #dbe1e7;
  --input: #c5ced7;
  --ring: #1c4e9b;

  --surface: #f6f8fa;           /* section bands */
  --highlight: #f2b705;         /* safety yellow: new-request marker */
  --swatch-upholstery: #233250;
  --swatch-tarpaulin: #1c4e9b;
  --swatch-mesh: #3a4048;
  --gutter: 1rem;
  --measure: 40rem;

  /* The home hero's photo: none for now, so the band is plain primary. To
     add one, put the file in static/images/ and set
       --hero-image: url("images/hero.jpg");
       --hero-shade: 0.65;
     The shade darkens the photo so the white type still reads. */
  --hero-image: none;
  --hero-shade: 0;
}

@layer base {
  body {
    background: var(--background);
    color: var(--foreground);
    font-family: var(--font-sans);
    line-height: 1.55;
    font-variant-numeric: tabular-nums;
    /* The footer sits at the bottom of a short page. */
    min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  }
  #main { flex: 1 0 auto; }
  h1 { font-size: clamp(2rem, 6vw, 3rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
  h2 { font-size: clamp(1.3rem, 3.4vw, 1.65rem); font-weight: 700; letter-spacing: -0.015em; line-height: 1.2; }
  h3 { font-size: 1.0625rem; font-weight: 650; line-height: 1.3; }
  /* Links inside sentences stay underlined, so they don't rely on colour
     alone. Site chrome (header, breadcrumb, footer) opts out below, as on
     corrections.org: muted text that darkens on hover. */
  a { color: var(--primary); text-decoration: underline; text-underline-offset: 0.15em; }
  ::selection { background: var(--primary); color: var(--primary-foreground); }
  input, textarea { caret-color: var(--primary); }
  a:focus-visible, summary:focus-visible {
    outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 2px;
  }
}

@layer components {
  /* ---------- layout ---------- */

  .btn { text-decoration: none; } /* links styled as buttons */

  /* Tailwind's container, as corrections.org uses it: full width under 40rem,
     then capped at each breakpoint the viewport has passed. */
  .wrap { width: 100%; margin: 0 auto; padding: 0 var(--gutter); }
  @media (min-width: 40rem) { .wrap { max-width: 40rem; } }
  @media (min-width: 48rem) { .wrap { max-width: 48rem; } }
  @media (min-width: 64rem) { .wrap { max-width: 64rem; } }
  @media (min-width: 80rem) { .wrap { max-width: 80rem; } }
  @media (min-width: 96rem) { .wrap { max-width: 96rem; } }
  .stack > * + * { margin-top: var(--stack, 1rem); }
  .muted { color: var(--muted-foreground); }
  .small { font-size: 0.875rem; }
  .lead { font-size: 1.125rem; color: var(--muted-foreground); max-width: var(--measure); }
  .vh {
    position: absolute !important; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
  .skip { position: absolute; left: -999px; top: 0; background: var(--foreground); color: #fff; padding: 0.5rem 1rem; z-index: 10; }
  .skip:focus { left: 0; }
  .plain-list { display: grid; gap: 0.35rem; }

  .site-header { border-bottom: 1px solid var(--border); background: var(--background); }
  .site-header__row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.5rem 1.25rem; flex-wrap: wrap; min-height: 4rem; padding-top: 0.5rem; padding-bottom: 0.5rem;
  }
  .wordmark { font-weight: 850; font-size: 1.25rem; letter-spacing: -0.03em; color: var(--foreground); text-decoration: none; }
  .wordmark__tag { font-weight: 500; color: var(--muted-foreground); font-size: 0.875rem; letter-spacing: 0; }
  .nav { display: flex; align-items: center; gap: 0.5rem 1rem; flex-wrap: wrap; }
  .nav a:not(.btn) { color: var(--muted-foreground); text-decoration: none; font-size: 0.875rem; font-weight: 500; transition: color 0.15s; }
  .nav a:not(.btn):hover, .nav a[aria-current="page"] { color: var(--foreground); }

  .site-footer { background: var(--foreground); color: #d9dfe5; margin-top: 4rem; padding: 2.5rem 0 1.5rem; --ring: #fff; }
  .site-footer a { color: #d9dfe5; text-decoration: none; transition: color 0.15s; }
  .site-footer a:hover { color: #fff; }
  .site-footer__grid { display: grid; gap: 2rem; }
  .site-footer__name { font-weight: 800; color: #fff; font-size: 1.125rem; }
  .site-footer__heading { font-weight: 700; color: #fff; margin-bottom: 0.5rem; }
  .site-footer__small { font-size: 0.875rem; color: #aeb8c2; margin-top: 2rem; }
  @media (min-width: 48rem) { .site-footer__grid { grid-template-columns: 2fr 1.5fr 1fr; } }

  .admin-footer {
    margin-top: 4rem; padding: 1.25rem 0; border-top: 1px solid var(--border);
    background: var(--surface); color: var(--muted-foreground); font-size: 0.875rem;
  }
  .admin-footer__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; }
  .admin-footer a { color: var(--muted-foreground); text-decoration: none; }
  .admin-footer a:hover { color: var(--foreground); }

  /* ---------- swatches: each fabric, drawn in CSS ---------- */

  .swatch {
    display: block; aspect-ratio: 1; border-radius: calc(var(--radius) - 2px);
    background-color: var(--muted); box-shadow: inset 0 0 0 1px rgb(22 32 42 / 0.12);
  }
  .swatch--upholstery {   /* pebble grain on marine navy */
    background-color: var(--swatch-upholstery);
    background-image:
      radial-gradient(circle at 30% 40%, rgb(255 255 255 / 0.10) 0 1px, transparent 1.6px),
      radial-gradient(circle at 70% 70%, rgb(0 0 0 / 0.28) 0 1.2px, transparent 1.8px);
    background-size: 5px 5px, 7px 7px;
  }
  .swatch--tarpaulin {    /* scrim weave under a glossy coat */
    background-color: var(--swatch-tarpaulin);
    background-image:
      linear-gradient(135deg, rgb(255 255 255 / 0.16), transparent 45%),
      repeating-linear-gradient(0deg, rgb(0 0 0 / 0.14) 0 1px, transparent 1px 4px),
      repeating-linear-gradient(90deg, rgb(255 255 255 / 0.08) 0 1px, transparent 1px 4px);
  }
  .swatch--mesh {         /* open squares */
    background-color: var(--card);
    background-image:
      repeating-linear-gradient(0deg, var(--swatch-mesh) 0 3px, transparent 3px 8px),
      repeating-linear-gradient(90deg, var(--swatch-mesh) 0 3px, transparent 3px 8px);
  }
  .swatch--clear-film {   /* a checkerboard seen through a tinted sheet */
    background-color: #fbfcfd;
    background-image:
      linear-gradient(120deg, transparent 30%, rgb(255 255 255 / 0.85) 42%, transparent 54%),
      linear-gradient(rgb(150 190 205 / 0.22), rgb(150 190 205 / 0.22)),
      conic-gradient(#d5dbe1 25%, transparent 0 50%, #d5dbe1 0 75%, transparent 0);
    background-size: 100% 100%, 100% 100%, 14px 14px;
  }
  .swatch--banner {       /* white flex with a printed band */
    background-color: #fff;
    background-image: linear-gradient(var(--highlight), var(--highlight)), linear-gradient(var(--foreground), var(--foreground));
    background-size: 62% 22%, 38% 8%;
    background-position: 14% 36%, 14% 68%;
    background-repeat: no-repeat;
  }
  .swatch--fashion-craft { /* patent and holographic */
    background-color: #c7c9d6;
    background-image:
      linear-gradient(160deg, rgb(255 255 255 / 0.75) 0%, transparent 28%),
      linear-gradient(115deg, #e7b8d3 0%, #b9c8ef 35%, #bfe8de 62%, #f1e2b4 100%);
  }
  .swatch--other { background: transparent; box-shadow: none; border: 2px dashed var(--input); }

  /* ---------- home ---------- */

  /* corrections.org's hero: a full-width primary band (a photo under a
     shade once --hero-image is set), centred white type, two buttons. */
  .hero {
    position: relative; isolation: isolate; text-align: center; color: #fff;
    background: var(--primary) var(--hero-image) center / cover no-repeat;
    padding: 5rem 0;
    --ring: #fff; --color-ring: #fff; /* focus rings that show on the band */
  }
  .hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgb(0 0 0 / var(--hero-shade)); }
  .hero .wrap { display: flex; flex-direction: column; align-items: center; text-wrap: balance; }
  .hero h1 { font-size: 2.25rem; font-weight: 800; letter-spacing: -0.025em; line-height: 1.1; }
  .hero__lead { font-size: 1.25rem; font-weight: 600; line-height: 1.4; color: #cbd5e1; max-width: 42rem; margin-top: 1rem; }
  .hero__offer { color: #e2e8f0; max-width: 42rem; margin-top: 1rem; }
  .hero__actions { display: flex; flex-direction: column; gap: 1rem; justify-content: center; margin-top: 2rem; }
  .hero__actions .btn { height: 2.75rem; padding-inline: 2rem; }
  .hero__actions .btn[data-variant="light"] { background: #fff; color: var(--primary); }
  .hero__actions .btn[data-variant="light"]:hover { background: rgb(255 255 255 / 0.9); }
  .hero__actions .btn[data-variant="glass"] {
    color: #fff; border-color: rgb(203 213 225 / 0.4); background: rgb(255 255 255 / 0.15);
    backdrop-filter: blur(4px); box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
  }
  .hero__actions .btn[data-variant="glass"]:hover { background: rgb(255 255 255 / 0.2); }
  @media (min-width: 40rem) {
    .hero h1 { font-size: 3rem; line-height: 1; }
    .hero__lead { font-size: 1.5rem; }
    .hero__offer { font-size: 1.25rem; line-height: 2rem; }
    .hero__actions { flex-direction: row; }
  }
  @media (min-width: 48rem) { .hero { padding: 7rem 0; } }
  @media (min-width: 64rem) { .hero h1 { font-size: 3.75rem; } }
  .section__actions { margin-top: 1.5rem; }

  .section { padding-top: 3rem; }
  .section__intro { color: var(--muted-foreground); max-width: var(--measure); margin-top: 0.5rem; }
  .section--band { background: var(--surface); padding: 3rem 0; margin-top: 3rem; }
  .hero + .section--band { margin-top: 0; }

  .fabric-grid { display: grid; gap: 1rem; margin-top: 1.5rem; }
  @media (min-width: 36rem) { .fabric-grid { grid-template-columns: repeat(2, 1fr); } }
  @media (min-width: 60rem) { .fabric-grid { grid-template-columns: repeat(3, 1fr); } }
  .fabric-card { position: relative; }
  .fabric-card > header { display: grid; grid-template-columns: 4.5rem 1fr; gap: 0.25rem 1rem; align-items: start; }
  .fabric-card .swatch { grid-row: span 2; }
  .fabric-card h3 a { color: var(--foreground); text-decoration: none; }
  .fabric-card h3 a::after { content: ""; position: absolute; inset: 0; } /* the whole card is the link */
  .fabric-card:hover { border-color: var(--input); }
  .fabric-card:hover h3 a { text-decoration: underline; }
  .fabric-card h3 a:focus-visible { outline: none; }
  .fabric-card:focus-within { outline: 2px solid var(--ring); outline-offset: 2px; }
  .fabric-card--other { background: transparent; border-style: dashed; }

  .steps { counter-reset: step; display: grid; gap: 1.5rem; margin-top: 1.5rem; }
  .steps li { counter-increment: step; position: relative; padding-left: 3rem; max-width: 34rem; }
  .steps li::before {
    content: counter(step); position: absolute; left: 0; top: -0.1rem;
    width: 2.1rem; height: 2.1rem; border-radius: 50%; display: grid; place-items: center;
    background: var(--primary); color: var(--primary-foreground); font-weight: 800;
  }
  .steps p { color: var(--muted-foreground); margin-top: 0.25rem; }
  @media (min-width: 52rem) { .steps { grid-template-columns: repeat(3, 1fr); gap: 2rem; } }

  /* ---------- category pages ---------- */

  /* Basecoat's breadcrumb lays it out; links drop the sentence underline. */
  .breadcrumb > ol { margin-top: 1.25rem; }
  .breadcrumb a { color: inherit; text-decoration: none; }
  .breadcrumb a:hover { color: var(--foreground); }
  .fabric-hero { display: grid; gap: 2rem; align-items: center; padding: 1.5rem 0 1rem; }
  .fabric-hero h1 { font-size: clamp(2.25rem, 8vw, 3.75rem); letter-spacing: -0.035em; line-height: 1; }
  .fabric-hero > .swatch { display: none; }
  @media (min-width: 52rem) {
    .fabric-hero { grid-template-columns: 1.6fr 1fr; }
    .fabric-hero > .swatch { display: block; justify-self: end; width: 100%; max-width: 16rem; aspect-ratio: 4 / 3; }
  }
  .spec-cards { display: grid; gap: 1rem; margin-top: 1rem; align-items: start; }
  @media (min-width: 48rem) { .spec-cards { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); } }
  .tick-list li { padding: 0.5rem 0 0.5rem 1.5rem; border-top: 1px solid var(--border); position: relative; }
  .tick-list li::before {
    content: ""; position: absolute; left: 0.2rem; top: 0.95rem;
    width: 0.55rem; height: 0.55rem; background: var(--primary); border-radius: 1px;
  }
  /* "Specs to include": each spec with what it means for this fabric. */
  .spec-list > div { padding: 0.75rem 0 0.75rem 1.5rem; border-top: 1px solid var(--border); position: relative; }
  .spec-list > div::before {
    content: ""; position: absolute; left: 0.2rem; top: 1.2rem;
    width: 0.55rem; height: 0.55rem; background: var(--primary); border-radius: 1px;
  }
  .spec-list dt { font-weight: 600; color: var(--foreground); }
  .spec-list dd { color: var(--muted-foreground); margin-top: 0.125rem; max-width: 65ch; }
  .link-grid { display: grid; gap: 0.75rem; margin-top: 1rem; }
  @media (min-width: 36rem) { .link-grid { grid-template-columns: repeat(2, 1fr); } }
  @media (min-width: 60rem) { .link-grid { grid-template-columns: repeat(3, 1fr); } }
  .link-grid a { display: flex; align-items: center; gap: 0.75rem; color: var(--foreground); text-decoration: none; font-weight: 600; }
  .link-grid a:hover span { text-decoration: underline; }
  .link-grid .swatch { width: 2.5rem; flex: none; }

  /* ---------- prose pages ---------- */

  .prose { max-width: calc(var(--measure) + 2 * var(--gutter)); padding-top: 2.5rem; }
  .prose > * + * { margin-top: 1rem; }
  .prose h2 { margin-top: 2rem; font-size: 1.3rem; }
  .ref-number {
    display: inline-block; font-size: clamp(1.75rem, 8vw, 2.5rem); font-weight: 850; letter-spacing: 0.02em;
    border: 2px solid var(--foreground); border-radius: var(--radius); padding: 0.35rem 1rem;
  }

  /* ---------- quote form ---------- */

  .form-page { max-width: 46rem; padding-top: 2.5rem; }
  .form-page > .lead { margin-top: 0.5rem; }
  .form-page > .alert { margin-top: 1.5rem; }
  .form-section { margin-top: 2.25rem; }
  .form-section > h2 { margin-bottom: 1rem; }
  .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
  .grid-2 { display: grid; gap: 1.25rem; }
  @media (min-width: 40rem) {
    .grid-2 { grid-template-columns: 1fr 1fr; }
    .span-2 { grid-column: 1 / -1; }
  }
  .hint { color: var(--muted-foreground); font-size: 0.875rem; }
  /* A div, not a p, so Basecoat's muted description colour stays off it. */
  .field-error { color: var(--destructive); font-size: 0.875rem; }
  .pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(6.5rem, auto); gap: 0.5rem; }
  .pair--three { grid-template-columns: minmax(0, 1fr) 6rem; }
  .pair--three > :last-child { grid-column: 1 / -1; }
  @media (min-width: 40rem) {
    .pair--three { grid-template-columns: minmax(0, 1fr) 6rem minmax(10rem, 1fr); }
    .pair--three > :last-child { grid-column: auto; }
  }
  .quote-form .input, .quote-form .select, .quote-form .textarea { width: 100%; font-size: 1rem; } /* 16px: no iOS zoom */
  .quote-form .input[type="checkbox"], .quote-form .input[type="radio"] { width: auto; }

  /* One Basecoat card per fabric; its remove button is the card action. */
  .line { margin-top: 1rem; font-size: 1rem; }
  .line > header > h3[data-line-number] { font-size: 1.0625rem; font-weight: 700; }
  .line > header > h3[data-line-number]:focus { outline: none; }
  .line__body { display: grid; gap: 1.25rem; }

  details.line__more { border-top: 1px solid var(--border); padding-top: 0.75rem; }
  details > summary {
    cursor: pointer; font-weight: 600; color: var(--primary); list-style: none;
    display: inline-flex; align-items: center; gap: 0.375rem;
  }
  details > summary::-webkit-details-marker { display: none; }
  details > summary svg { flex: none; transition: rotate 0.15s ease-out; }
  details[open] > summary svg { rotate: 180deg; }
  @media (prefers-reduced-motion: reduce) { details > summary svg { transition: none; } }
  .details-body { display: grid; gap: 1.25rem; margin-top: 1rem; }
  .specs { background: var(--surface); border-radius: var(--radius); padding: 1rem; }
  .specs > legend { float: left; width: 100%; font-weight: 700; margin-bottom: 0.75rem; }
  .specs > legend + * { clear: both; }
  .check-grid { display: grid; gap: 0.5rem 1rem; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); }

  /* ---------- admin ----------
     Operate surface: a fixed type scale, Basecoat components, accent only
     for actions and state. */

  .admin { padding-top: 1.5rem; }
  .admin h1 { font-size: 1.875rem; letter-spacing: -0.025em; line-height: 1.2; }
  .admin .breadcrumb ol { margin-top: 0; margin-bottom: 0.75rem; }
  .admin-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1rem; margin-bottom: 1rem; }
  .admin-head--bar { justify-content: space-between; align-items: center; gap: 0.75rem 1rem; margin-bottom: 0.25rem; }
  /* Right-aligned even when it wraps under the heading, so its end-aligned
     menu opens over the page, not off its left edge. */
  .admin-head--bar .button-group { margin-left: auto; }
  /* Menu items here are links (downloads), so drop the link styling. */
  .dropdown-menu [role="menuitem"] { color: inherit; text-decoration: none; cursor: pointer; }
  .admin-section { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
  .admin-section:first-child { margin-top: 0.5rem; }
  .admin-section > h2 { font-size: 1.125rem; margin-bottom: 0.75rem; }
  .admin-note { color: var(--muted-foreground); max-width: 65ch; }
  .admin-section .button-row { margin-top: 1rem; }
  /* Links that stand alone (a reference, an email) need no underline. */
  .admin .table a, .facts a, .files a { text-decoration: none; font-weight: 600; }
  .admin .table a:hover, .facts a:hover, .files a:hover { text-decoration: underline; }

  /* Sign-in and delete confirmation: one centred card. */
  .login, .confirm { max-width: calc(26rem + 2 * var(--gutter)); padding-top: clamp(3rem, 14vh, 7rem); }
  .confirm { max-width: calc(32rem + 2 * var(--gutter)); }
  .login h1, .confirm h1 { font-size: 1.5rem; letter-spacing: -0.02em; line-height: 1.2; }
  .login header > p { color: var(--muted-foreground); margin-top: 0.375rem; }
  .login__body { display: grid; gap: 1rem; }
  .login footer .btn { width: 100%; }

  .filters {
    display: grid; gap: 0.75rem 1rem; align-items: end; margin: 0.5rem 0 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  }
  .filters .field { padding: 0; min-width: 0; }
  .filters .select, .filters .input:not([type="checkbox"]) { width: 100%; min-width: 0; }
  .filters__check { min-height: 2.25rem; align-items: center; }
  .filters__actions { display: flex; gap: 0.5rem; align-items: center; }
  .button-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
  .exports { margin-bottom: 0.5rem; }
  .pager { display: flex; gap: 0.5rem; margin-top: 1rem; }
  .table td.num, .table th.num { text-align: right; }
  .table td.num { white-space: nowrap; }
  .inbox tr:not(.is-new) .inbox__ref a { font-weight: 500; }
  .inbox__when { white-space: nowrap; }
  .admin .empty { margin-top: 1rem; border: 1px dashed var(--input); }
  .admin .empty h2 { font-size: 1.125rem; }

  /* On a phone the inbox drops its header row and each request becomes a
     block: reference and status, buyer, fabrics, then date and country. */
  @media (max-width: 47.99rem) {
    .inbox, .inbox tbody { display: block; }
    .inbox thead { display: none; }
    .inbox tr {
      display: grid; grid-template-columns: 1fr auto; gap: 0.2rem 0.75rem;
      padding: 0.75rem 0.5rem; border-bottom: 1px solid var(--border);
    }
    .inbox td { display: block; padding: 0; border: 0; white-space: normal; }
    .inbox__ref { grid-column: 1; }
    .inbox__status { grid-column: 2; grid-row: 1; text-align: right; }
    .inbox__buyer, .inbox__fabrics { grid-column: 1 / -1; }
    .inbox__when, .inbox__country { grid-row: 4; color: var(--muted-foreground); font-size: 0.8125rem; }
    .inbox__when { grid-column: 1; }
    .inbox__country { grid-column: 2; text-align: right; }
  }

  /* A request: what the buyer sent on the left, what you do with it on the
     right (status, reply, notes, delete). One column on a phone. */
  .rfq { display: grid; gap: 1.5rem; }
  @media (min-width: 64rem) {
    .rfq { grid-template-columns: minmax(0, 1fr) 22rem; gap: 2.5rem; align-items: start; }
    .rfq__side { position: sticky; top: 1rem; }
  }
  .rfq__side { display: grid; gap: 1rem; }
  .rfq__side .card > header h2 { font-size: 1rem; }
  .status-form { display: flex; gap: 0.5rem; }
  .status-form .select { flex: 1; min-width: 0; }
  .rfq__reply { width: 100%; margin-top: 0.75rem; }
  .rfq__delete { padding: 0.25rem 0.25rem 0; }
  .rfq__delete h2 { font-size: 0.875rem; font-weight: 650; }
  .rfq__delete .btn { margin-top: 0.5rem; }
  .facts { display: grid; gap: 0.15rem 1.5rem; }
  .facts dt { font-weight: 600; color: var(--muted-foreground); font-size: 0.875rem; margin-top: 0.5rem; }
  .facts dd { overflow-wrap: anywhere; }
  @media (min-width: 40rem) {
    .facts { grid-template-columns: 11rem 1fr; }
    .facts dt, .facts dd { margin-top: 0; padding: 0.3rem 0; }
  }
  .files { margin-top: 0.75rem; }
  .note { border-bottom: 1px solid var(--border); padding-bottom: 0.75rem; white-space: pre-wrap; overflow-wrap: anywhere; }

  /* ---------- reports and charts ---------- */

  .kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin: 1rem 0 0.5rem; }
  .kpis .card > section { padding-inline: 1rem; }
  .kpi__value { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
  .kpi__label { color: var(--muted-foreground); font-size: 0.875rem; margin-top: 0.375rem; }
  .report-section { margin-top: 2.5rem; }
  .report-section h2 { font-size: 1.25rem; margin-bottom: 0.5rem; }
  .report-section h3 { margin-top: 1.25rem; }
  .report-section > p { margin-bottom: 0.75rem; max-width: 65ch; }
  .report-grid { display: grid; gap: 1.5rem 2.5rem; align-items: start; }
  @media (min-width: 56rem) { .report-grid, .spec-tops { grid-template-columns: 1fr 1fr; } }
  .spec-tops { display: grid; gap: 1rem 2.5rem; }

  .bar-chart { margin: 0.5rem 0 1rem; }
  .bar-chart__caption { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; align-items: baseline; margin-bottom: 0.5rem; font-size: 0.875rem; }
  .bar-chart__title { font-weight: 650; }
  .bar-chart__n, .bar-chart__empty { color: var(--muted-foreground); font-size: 0.875rem; }
  .bars { display: grid; gap: 2px; }
  /* On a phone the label takes its own line above the bar. */
  .bars__row { display: grid; grid-template-columns: 1fr auto; gap: 0.15rem 0.6rem; align-items: center; font-size: 0.875rem; padding: 0.2rem 0; }
  .bars__label { grid-column: 1 / -1; }
  @media (min-width: 40rem) {
    .bars__row { grid-template-columns: minmax(7rem, 38%) 1fr auto; padding: 0.15rem 0; }
    .bars__label { grid-column: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  }
  .bars__track { width: 100%; height: 0.9rem; display: block; border-left: 1px solid var(--input); }
  .bars__bar, .bars__base { fill: var(--primary); }
  .bars__value { white-space: nowrap; min-width: 4.5rem; text-align: right; }
  .summary__period { font-weight: 600; }
}

@media print {
  @page { margin: 14mm 12mm; }
  body { font-size: 10.5pt; }
  .site-header, .site-footer, .admin-footer, .no-print, .skip, .filters, .button-row { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .report-section, .bar-chart, .table-container { break-inside: avoid; }
  .bars__bar, .bars__base { fill: #1c4e9b; }
  a { color: inherit; text-decoration: none; }
}
