/* Shared by the Jinja pages and the NiceGUI account/admin pages.
 * The header markup lives in templates/_header.html and is rendered by
 * both, so there is exactly one definition of how a header looks.
 * Per-tenant colours arrive as CSS custom properties from the page. */
* { box-sizing: border-box; }
    /* Long unbroken strings - a URL in an error, a call number - must wrap
       rather than push the page sideways. */
    body, .card, .meta { overflow-wrap: anywhere; }
    /* Sticky footer: the body fills the viewport and the footer is pushed to
       the bottom when the content is short, rather than floating mid-page. */
    html { min-height: 100%; }
    body {
      min-height: 100dvh; display: flex; flex-direction: column;
      /* Room for the fixed header and footer; the fallbacks cover a
         no-JavaScript load. */
      padding-top: var(--header-h, 64px);
      padding-bottom: var(--footer-h, 4.5rem);
      margin: 0; background: var(--canvas); color: var(--ink);
      font: 16px/1.6 var(--font);
      -webkit-font-smoothing: antialiased;
      font-feature-settings: "cv05" 1; /* Inter: single-storey l, clearer at small sizes */
    }
    h1, h2, h3, .display {
      font-family: var(--font-display);
      font-weight: 600; letter-spacing: -0.01em; line-height: 1.25;
    }
    /* Bibliographic titles read as the content they are, not as UI chrome. */
    .record-title {
      font-family: var(--font-display); font-size: 1.075rem; font-weight: 600;
      letter-spacing: -0.005em; text-decoration: none; display: inline-block;
      margin-bottom: .15rem;
    }
    .record-title:hover { text-decoration: underline; }
    .meta { font-size: .8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
    a { color: var(--link); }
    /* One header height across every page - public, account and admin. The
       account header sets the same value in pages/layout.py; changing one means
       changing both. min-height, not height, so the narrow layout can still
       drop the search box onto a second row. */
    header.site {
      background: var(--brand); color: var(--brand-ink); padding: 0 1rem;
      border-bottom: 1px solid var(--line);
      min-height: 64px; display: flex; align-items: center;
      /* Fixed for the same reason as the footer: it stays visible while
         scrolling. The body reserves --header-h, measured by static/chrome.js,
         because the header wraps to two rows on narrow screens. */
      position: fixed; top: 0; left: 0; right: 0; z-index: 21;
    }
    /* Three zones: identity left, search centred in the row, account links
       right. A grid rather than flex, so the middle stays optically centred
       even though the two sides are different widths. */
    header.site .bar {
      display: grid; gap: 1rem; width: 100%;
      /* The middle track is sized here, not by the search box: with an `auto`
         column a percentage width on the child resolves against a
         content-sized track, so the box silently stayed at its content width.
         Sides stay `auto` so they keep their content width - 1fr let them
         collapse and the wordmark wrapped to one letter per line. The middle
         grows to 1040px only if there is room. */
      grid-template-columns: auto minmax(0, 1040px) auto; align-items: center;
    }
    header.site .bar > .wordmark { justify-self: start; white-space: nowrap; }
    header.site .bar > .searchbox { width: 100%; }
    header.site .bar > .account-nav { justify-self: end; }
    /* Wide windows: the middle track is the content column (main.page's 1100px
       less its 1rem padding each side), with the wordmark and account links in
       the outer tracks. The search box is then pushed past the facet column so
       it shares its left and right edges with the results beneath it.
       264px = the 240px facet column + the 1.5rem gap in `.layout`; change
       those and this together. Below 1400px the outer tracks cannot hold the
       wordmark and links, so the header keeps the layout above. */
    @media (min-width: 1400px) {
      header.site .bar {
        grid-template-columns: minmax(max-content, 1fr) 1068px minmax(max-content, 1fr);
      }
      header.site .bar > .searchbox { margin-left: 264px; width: calc(100% - 264px); }
    }
    /* Too narrow for three abreast: three stacked rows - identity, search,
       then the links (the language switch sits on row one). The links used to share row one with
       the wordmark; their `nowrap` pushed the grid wider than the screen, which
       cut off both the links and the right edge of the search box. They wrap
       now, and the language switch moves up beside the wordmark. */
    @media (max-width: 720px) {
      header.site { padding: .5rem 1rem .6rem; }
      header.site .bar { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
      header.site .bar > .wordmark { grid-row: 1; }
      header.site .bar > .searchbox { grid-row: 2; width: 100%; }
      header.site .bar > .account-nav {
        grid-row: 3; justify-self: stretch;
        flex-wrap: wrap; gap: .25rem .9rem; white-space: normal;
      }
      /* The language switch rides on the wordmark's row, pinned to the right of
         the bar. It lives inside .account-nav in the markup (one header for both
         frontends), so it is lifted out with absolute positioning rather than a
         second copy. 34px = the logo's max-height. */
      header.site .bar { position: relative; }
      .account-nav .langs {
        position: absolute; top: 0; right: 0; height: 34px;
      }
      .account-nav .langs .globe { display: none; }
      header.site .account-nav a { font-size: .85rem; }
    }
    header.site a { color: var(--brand-ink); text-decoration: none; font-weight: 600; }
    /* :focus-visible only - a mouse click should not ring every header link,
       just tabbing to it. Negative offset on .seg-item because .seg clips
       with overflow:hidden; an outward ring there was invisible, clipped by
       the very edge the segmented control sits against. */
    header.site a:focus-visible, header.site .seg-item:focus-visible {
      outline: 2px solid var(--brand-ink); outline-offset: 2px; border-radius: 2px;
    }
    header.site .seg-item:focus-visible {
      outline-offset: -2px; position: relative; z-index: 1;
    }
    /* Visually hidden until it receives keyboard focus - the first tab stop on
       every page, so tangentbordsanvändare need not tab through the whole
       header before reaching the content. */
    .skip-link {
      position: absolute; left: -9999px; top: 0; z-index: 100;
      background: var(--surface); color: var(--ink);
      padding: .6rem 1rem; border-radius: 0 0 var(--radius) 0;
      font: 600 .9rem var(--font);
    }
    .skip-link:focus { left: 0; }
    header.site .wordmark { font-family: var(--font-display); font-size: 1.15rem;
      letter-spacing: -0.01em; display: flex; align-items: center; }
    header.site .logo { max-height: 34px; width: auto; display: block;
      margin-right: .55rem; }
    .account-nav { display: flex; gap: .9rem; align-items: center; white-space: nowrap; }
    header.site .account-nav a { font-weight: 600; font-size: .9rem; }
    .langs { display: inline-flex; gap: .4rem; align-items: center; }
    .langs .globe { flex-shrink: 0; }
    .seg {
      display: inline-flex; overflow: hidden;
      border: 1px solid color-mix(in srgb, var(--brand-ink) 25%, transparent);
      border-radius: var(--radius);
    }
    header.site .account-nav .seg-item {
      font: 600 .72rem var(--font); letter-spacing: .03em;
      padding: .2rem .45rem; line-height: 1.5;
      color: color-mix(in srgb, var(--brand-ink) 65%, transparent);
      text-decoration: none;
    }
    header.site .account-nav a.seg-item:hover {
      background: color-mix(in srgb, var(--brand-ink) 10%, transparent);
      color: var(--brand-ink);
    }
    header.site .account-nav .seg-item.current {
      background: var(--link); color: #fff;
    }
    .visually-hidden {
      position: absolute; width: 1px; height: 1px; overflow: hidden;
      clip-path: inset(50%); white-space: nowrap;
    }
    /* Same mark, size, colour and round flat-button behaviour as the sign-out
       control in the account area, so the header does not change shape when you
       cross between them. */
    .account-nav .icon-link {
      display: inline-flex; align-items: center; justify-content: center;
      width: 40px; height: 40px; border-radius: 50%;
      color: var(--link);
    }
    .account-nav .icon-link:hover { background: color-mix(in srgb, var(--link) 12%, transparent); }
    .searchbox { display: flex; gap: .5rem; }
    .searchbox input {
      flex: 1; min-width: 0;
      padding: .55rem .75rem; border-radius: var(--radius);
      font: 400 1rem var(--font); color: var(--ink);
      /* The field has to read as a field against the header, whatever colour a
         tenant picks for it: a tinted ground and a border mixed from the ink,
         rather than the near-white --line, which vanished on a white header. */
      background: var(--canvas);
      border: 1px solid color-mix(in srgb, var(--ink) 28%, transparent);
    }
    .searchbox input::placeholder { color: color-mix(in srgb, var(--ink) 70%, transparent); }
    .searchbox input:focus-visible {
      outline: 2px solid var(--link); outline-offset: 1px;
      background: var(--surface);
    }
    /* Scoped away from Quasar's controls: a bare `button` rule restyles
       every NiceGUI widget on the account and admin pages. */
    main.page button, header.site button, .btn {
      padding: .55rem .9rem; border: 0; border-radius: var(--radius);
      background: var(--accent); color: #fff; cursor: pointer;
      font: 600 .9rem var(--font); letter-spacing: .01em;
      text-decoration: none; display: inline-block;
    }
    a.btn, a.btn:hover { color: #fff; text-decoration: none; }
    /* Scoped: NiceGUI's page element is <main class="q-page">, so a bare
       `main` selector constrained the account and admin pages to 1100px
       and pulled their header in with them. */
    main.page {
      max-width: 1100px; margin: 0 auto; padding: 1.25rem 1rem 3rem;
      width: 100%; flex: 1 0 auto;
    }
    html, body { max-width: 100%; overflow-x: hidden; }
    /* Results come first in the DOM so mobile shows them without scrolling past
       the facet list; on desktop the sidebar is placed back on the left. */
    .layout { display: grid; grid-template-columns: 1fr; gap: 1rem; }
    .facets > summary {
      cursor: pointer; padding: .6rem .8rem; background: var(--surface);
      border: 1px solid var(--line); border-radius: var(--radius); font-weight: 600;
    }
    @media (min-width: 761px) {
      .layout { grid-template-columns: 240px 1fr; gap: 1.5rem; }
      .layout > aside { grid-column: 1; grid-row: 1; }
      .layout > div { grid-column: 2; grid-row: 1; }
      /* <details> renders open by default (see the template); on desktop the
         disclosure control is simply hidden. CSS cannot re-open a closed
         <details> in Chrome, so the open attribute has to come from the markup. */
      .facets > summary { display: none; }
    }
    .card {
      background: var(--surface); border: 1px solid var(--line);
      border-radius: var(--radius); padding: 1rem; margin-bottom: .75rem;
    }
    .muted { color: var(--muted); font-size: .875rem; }
    .facet li { font-variant-numeric: tabular-nums; }
    .facet h2 { font-family: var(--font); font-size: .6875rem; text-transform: uppercase;
      letter-spacing: .08em; font-weight: 600; color: var(--muted); margin: 0 0 .4rem; }
    .facet ul { list-style: none; margin: 0 0 1.25rem; padding: 0; }
    .facet li { margin: .15rem 0; font-size: .9rem; }
    /* Facet values are navigation, not emphasis: keep them in body ink so the
       accent colour stays meaningful on titles and actions. */
    .facet a { text-decoration: none; color: var(--ink); }
    .facet a:hover { color: var(--link); text-decoration: underline; }
    .facet .applied { font-weight: 700; color: var(--link); }
    .pill {
      display: inline-block; background: var(--canvas); border: 1px solid var(--line);
      border-radius: 999px; padding: .1rem .6rem; font-size: .75rem; color: var(--muted);
      margin-right: .3rem;
    }
    .htmx-request #results { opacity: .5; transition: opacity .1s; }

/* Account tabs: the centre zone on account pages, where public pages put the
   search box. Plain links, so the account header needs no JavaScript and uses
   the same markup as everything else. */
.tabs { display: inline-flex; gap: .25rem; justify-self: center; }
.tabs .tab {
  font: 600 .9rem var(--font); text-decoration: none;
  /* 65%, not 60%: measured 4.18:1 for the Sunet theme and 4.26:1 for the
     default navy theme against WCAG 1.4.3's 4.5:1 floor - both clear 65%. */
  color: color-mix(in srgb, var(--brand-ink) 65%, transparent);
  padding: .3rem .6rem; border-radius: var(--radius);
  border-bottom: 2px solid transparent;
}
.tabs .tab:hover { color: var(--brand-ink); }
.tabs .tab.current {
  color: var(--brand-ink); border-bottom-color: var(--link);
  border-bottom-left-radius: 0; border-bottom-right-radius: 0;
}
header.site .wordmark .suffix {
  font: 400 .8rem var(--font); margin-left: .4rem;
}

/* Status text (form errors, admin outcome messages). Fixed literal colours,
   not theme tokens - these are semantic (error/success/warning), not brand -
   with a lightened dark-mode variant each, since the light values measured
   2.5-2.8:1 against the dark --surface. */
.status-error { color: #b91c1c; }
.status-success { color: #2f6b46; }
.status-warning { color: #8a5a12; }
@media (prefers-color-scheme: dark) {
  .status-error { color: #d57777; }
  .status-success { color: #789f87; }
  .status-warning { color: #ad8c59; }
}

/* Request flow inside the record page's availability card. */
.notice {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--canvas); padding: .6rem .8rem; margin: 0 0 .75rem;
}
.request-panel {
  display: flex; flex-direction: column; gap: .35rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--canvas); padding: .75rem; text-align: left;
}
.request-panel label { font-size: .85rem; color: var(--muted); }
.request-panel select {
  width: 100%; min-width: 0; padding: .5rem .6rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  font: 400 1rem var(--font); color: var(--ink); background: var(--surface);
}
.request-actions { display: flex; align-items: center; gap: 1rem; margin-top: .4rem; }

/* Dark mode lightens --link only for body-text uses (record titles, footer
   links, the applied-facet marker), scoped to main.page/.site-footer so it
   never reaches header.site - .seg-item.current and .icon-link put --link on
   a background there, where lightening it would wreck the white-text
   contrast instead of helping it (the same trap as the --accent buttons,
   which is why --accent is not touched here either).
   45% white: measured 5.86:1 (default theme) and 6.99:1 (Sunet) against the
   dark --surface, both clear of WCAG 1.4.3's 4.5:1 - a tenant's own link
   colour was never guaranteed that against a canvas it was not chosen for. */
@media (prefers-color-scheme: dark) {
  /* :not(.btn): a.btn keeps the hardcoded white-on-accent pairing below -
     without the exclusion this rule's higher specificity (an extra type
     selector) overrode it, leaving "Beställ"/"Request" at 2.47:1. */
  main.page a:not(.btn), .site-footer .footer-links a, .facet .applied,
  body .logo-pick, body .logo-remove,
  /* The header now darkens too (see --brand/--brand-ink above), so its own
     use of --link as a foreground colour needs the same lightening -
     .seg-item.current and the account-nav sign-out icon are still fine
     unlit because --link is there a *background* under white text, not
     text on top of the (now dark) header. */
  header.site .account-nav .icon-link {
    color: color-mix(in srgb, var(--link) 45%, white);
  }
  /* body .logo-pick, not .logo-pick: apply_theme()'s inline <style> block
     sets the unconditional colour on the same class and loads after this
     stylesheet, so equal specificity would let it win regardless of the
     media query. The extra type selector breaks the tie. */
  body .logo-pick { border-color: color-mix(in srgb, var(--link) 45%, white); }
}

/* Footer, shared by both frontends. Sits below the content rather than being
   fixed: a library's opening hours should not eat a phone screen. */
.site-footer {
  /* Fixed, so it stays visible while scrolling. `sticky` cannot do this for a
     last child: it has no room below it inside its parent to travel, so it
     never pins. Being fixed takes it out of the flow, so the body reserves
     --footer-h (measured by static/footer.js) to keep content clear of it. */
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  border-top: 1px solid var(--line);
  background: var(--surface);
  margin-top: 2rem;
  padding: 1.25rem 1rem;
}
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: .6rem 2rem;
  align-items: baseline; justify-content: space-between;
}
.footer-text {
  white-space: pre-wrap;
  font-size: .85rem; color: var(--muted); max-width: 60ch;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; }
.footer-links a { font-size: .85rem; color: var(--link); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }

/* Real heading elements in the NiceGUI account/admin pages (see
   pages/layout.py:heading()), styled to match the plain-text section titles
   they replace rather than picking up h1-h3's serif display font - these are
   UI chrome, not bibliographic titles. */
.section-heading {
  font-family: var(--font); font-weight: 600; font-size: 1rem;
  line-height: 1.4; letter-spacing: normal; margin: 0;
}

/* Advanced search: the form at /advanced, and the "your search" line the
   results page shows for one. Every selector is scoped to our own classes -
   a bare `select`, `input` or `fieldset` rule would reach into the NiceGUI
   account and admin pages, which load this same sheet. */
.searchbox .search-more {
  align-self: center; font: 600 .8rem var(--font); white-space: nowrap;
  color: var(--brand-ink);
}
.searchbox .search-more:hover { opacity: 1; text-decoration: underline; }
@media (max-width: 480px) {
  /* Too narrow for field, button and link on one line - which includes a wide
     window at 200% zoom, where the viewport is ~420 CSS px. An earlier version
     hid the link here, so advanced search became unreachable at the very zoom
     level someone is most likely to be using it at. It wraps instead. */
  .searchbox { flex-wrap: wrap; }
  .searchbox .search-more { flex-basis: 100%; margin-top: .1rem; }
}
.fieldsearch .fs-group { margin-bottom: .75rem; }
.fieldsearch legend {
  font: 600 .6875rem var(--font); text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); padding: 0 .3rem;
}
.fieldsearch fieldset.fs-group { border: 1px solid var(--line); }
.fieldsearch .fs-row {
  display: grid; grid-template-columns: minmax(0, 12rem) minmax(0, 1fr);
  gap: .5rem; margin-bottom: .5rem;
}
@media (max-width: 560px) {
  .fieldsearch .fs-row { grid-template-columns: 1fr; }
}
.fieldsearch select, .fieldsearch input[type="text"], .fieldsearch input[type="number"] {
  padding: .5rem .6rem; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface);
  font: 400 1rem var(--font); color: var(--ink); min-width: 0; max-width: 100%;
}
.fieldsearch input[type="number"] { width: 7rem; }
.fieldsearch .fs-foot {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  margin-top: .75rem;
}
.fieldsearch .fs-label {
  font: 600 .8rem var(--font); color: var(--muted);
}
.fieldsearch .fs-limiter { margin-top: .5rem; }
.fieldsearch .fs-limiter h2 {
  font-family: var(--font); font-size: .6875rem; text-transform: uppercase;
  letter-spacing: .08em; font-weight: 600; color: var(--muted); margin: 0 0 .4rem;
}
.fieldsearch .fs-limiter ul {
  list-style: none; margin: 0 0 .5rem; padding: 0;
  /* 15rem, not 12: the longest format label this catalogue has is
     "Konferenspublikation", and a column narrower than the word made the
     global `overflow-wrap: anywhere` break it mid-word. Wide enough here
     means a narrow viewport drops to one full-width column instead. */
  display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: .1rem .75rem; align-items: start;
}
.fieldsearch .fs-limiter li { font-size: .9rem; font-variant-numeric: tabular-nums; }
/* flex-start, not center: a label that wraps to two lines otherwise pulls its
   tick box down to the middle of the pair. */
.fieldsearch .fs-limiter label {
  display: flex; align-items: flex-start; gap: .4rem;
}
.fieldsearch .fs-limiter label input { flex: 0 0 auto; margin-top: .25rem; }
/* The value in its own element rather than a bare text node, so it is the item
   that gives way when the column is tight - and wraps between words. */
.fieldsearch .fs-limiter .limiter-name { min-width: 0; overflow-wrap: break-word; }
/* The count is one token. `overflow-wrap: anywhere` on body applies to it too
   and split "220" across two lines. */
.fieldsearch .fs-limiter label .muted { white-space: nowrap; }
.fieldsearch .fs-years { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.fieldsearch .fs-years label { font-size: .9rem; color: var(--muted); }
.fieldsearch .fs-actions {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .25rem;
}
/* Secondary actions - add a row, add a group - must not read as the Search
   button; same shape, no fill. */
main.page .fieldsearch button.btn-quiet {
  background: transparent; color: var(--link);
  border: 1px solid color-mix(in srgb, var(--link) 45%, transparent);
  font-weight: 600;
}
main.page .fieldsearch button.btn-quiet:hover {
  background: color-mix(in srgb, var(--link) 10%, transparent);
}
/* "Your search" - one chip per row of the advanced query. The row label sits
   inside its chip, small and muted, so the terms are what the eye lands on
   and the operators stay readable between them. */
.searched {
  /* Row gap larger than the column gap: chips sit close along a line, but a
     query that wraps to several lines needs air between them or the rows run
     together. */
  display: flex; align-items: center; gap: .5rem .4rem; flex-wrap: wrap;
  margin: 0 0 .85rem; line-height: 1.4;
}
.searched .searched-label {
  font: 600 .6875rem var(--font); text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted);
}
.searched .searched-group {
  display: inline-flex; align-items: center; gap: .3rem .4rem; flex-wrap: wrap;
}
/* Only when the shape matters: several groups, or a negated one. A single
   plain group needs no bracket drawn around it. */
.searched .searched-group.bracketed {
  padding: .1rem .45rem;
  border-left: 2px solid var(--line); border-right: 2px solid var(--line);
  border-radius: 3px;
}
.searched .term {
  display: inline-flex; align-items: baseline; gap: .35rem;
  background: var(--canvas); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .1rem .5rem;
  font-size: .875rem; color: var(--ink);
}
.searched .term-field {
  font: 600 .625rem var(--font); text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted);
}
.searched .term-value { overflow-wrap: break-word; }
.searched .op {
  font: 600 .6875rem var(--font); letter-spacing: .06em; color: var(--muted);
}
.searched .op-not, .searched .op-join { color: var(--ink); }
/* Its own row: flex-basis 100% forces the wrap, so the link never reads as
   one more term in the query. */
.searched .searched-edit {
  flex-basis: 100%; font-size: .8125rem; margin-top: .1rem;
}


/* Accessibility (WCAG 2.1 AA) ------------------------------------------- */
/* Anchors and focus must not land under the fixed header (2.4.3, 2.4.7). */
html { scroll-padding-top: calc(var(--header-h, 64px) + .5rem);
       scroll-padding-bottom: calc(var(--footer-h, 4.5rem) + .5rem); }
/* A visible focus ring on everything in our content, whatever the tenant theme. */
main.page a:focus-visible, main.page button:focus-visible, main.page input:focus-visible,
main.page select:focus-visible, main.page summary:focus-visible, .site-footer a:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--link); outline-offset: 2px;
}
.facet a:focus-visible, .facets > summary:focus-visible { outline-offset: 1px; }
.record-heading { font-size: inherit; margin: 0; line-height: inherit; }
/* Links are not distinguished by colour alone (1.4.1). */
main.page .meta a, main.page p a, .footer-links a { text-decoration: underline; }
/* Fixed footer covers content at 400% zoom / small windows (1.4.10): let it flow. */
@media (max-width: 720px), (max-height: 640px) {
  .site-footer { position: static; }
  body { padding-bottom: 0 !important; }
}
/* Respect reduced motion (2.3.3 / good practice). */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
/* Windows high contrast / forced colours: keep borders and focus visible. */
@media (forced-colors: active) {
  .card, .pill, .searched .term { border-color: CanvasText; }
  .seg-item.current { outline: 2px solid CanvasText; }
}

/* Admin: how an outgoing message will look. Our own classes only - this file
   is shared with NiceGUI. Theme tokens, so it follows light and dark. */
.mail-preview {
  width: 100%; margin-top: .4rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); overflow: hidden;
}
.mail-preview .mail-head {
  margin: 0; padding: .6rem .9rem;
  display: grid; grid-template-columns: max-content 1fr; gap: .15rem .8rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 5%, var(--surface));
  font-size: .85rem;
}
.mail-preview dt { font-weight: 600; }
.mail-preview dd { margin: 0; overflow-wrap: anywhere; }
.mail-preview .mail-subject { font-weight: 600; }
.mail-preview .mail-body {
  padding: .9rem; white-space: pre-wrap; overflow-wrap: anywhere;
  font-size: .95rem; line-height: 1.55; max-width: 60ch;
}
.mail-preview .mail-note {
  margin: 0; padding: .45rem .9rem; font-size: .75rem;
  border-top: 1px solid var(--line);
}
