/* r11-s5.css: 05 The emails (desktop, r11). "So I emailed them about it": two small email cards side by
   side on the page's two-column system (from 1024px: 480 | the rest | 480, so at 1512 the cards are
   156–636 and 876–1356, symmetric about the figure axis, the left edge on s2's 480 card; polish r1), the
   "3 days later" connector between them, a source line. Each card is an article with an "Enlarge" button; a click
   on the button or on the card (not a drag that selects text; polish r2) makes r11-s5.js open the email in a
   reading panel (a modal <dialog>): the card grows into it (FLIP, the panel's
   geometry animated, the card's own face cross-fading into the panel's bigger type), Esc / close / the
   scrim close it back into the card. Reduced motion: a quick fade. No JS: the cards, no Read buttons.
   Gold appears once per view: the flagged credit note's attachment chip. */

@media (min-width: 768px) {

  .r11-s5 {
    --r11-s5-link: calc((100% - 11 * var(--r11-gap)) / 6 + 3 * var(--r11-gap));   /* 2 columns + 3 gutters */
    container: r11s5 / inline-size;
  }
  :where(.r11-s5) > * { margin: 0; }

  /* ---------- The row: card | connector | card ---------- */
  .r11-s5-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--r11-s5-link) minmax(0, 1fr);
    align-items: stretch;
  }
  /* The page's two-column system (polish r1, shared with Limitations and the footer): two 480px columns
     at the container's edges, the connector takes the rest (never under 120px). Under a 700px container
     the query below stacks the cards (it comes later, so it wins). */
  @media (min-width: 1024px) {
    .r11-s5-row { grid-template-columns: minmax(0, 480px) minmax(120px, 1fr) minmax(0, 480px); }
  }

  /* ---------- The card: a calm mail client's message ---------- */
  .r11-s5-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 24px;
    transition: border-color .18s ease;
  }
  .r11-s5-card > * { margin: 0; }

  .r11-s5-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin: 0;
    font: 500 11px/16px var(--mono);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--slate-800);
  }
  .r11-s5-meta time {
    letter-spacing: .03em;
    color: var(--ink-dim);
    font-variant-numeric: tabular-nums;
  }

  .r11-s5-subj {
    margin-top: 12px;
    font: 600 17px/1.3 var(--sans);
    letter-spacing: -.008em;
    color: var(--slate-900);
    text-wrap: balance;
  }
  .r11-s5-route {
    margin-top: 3px;
    font: 400 14px/20px var(--sans);
    color: var(--ink-dim);
  }
  .r11-s5-arw { display: inline-block; margin: 0 .45em; color: var(--slate-500); }

  /* The body excerpt: under a hairline, fades out. On the request it fills whatever height the reply
     sets (contain: size, so its long text never stretches the row); the reply shows its whole text. */
  .r11-s5-ex {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--slate-100);
    font: 400 15px/24px var(--sans);   /* the page's body size and leading, 15/24, in both cards (polish r1, r2) */
    color: var(--slate-800);
    text-wrap: pretty;
  }
  .r11-s5-ex > p { margin: 0; }
  .r11-s5-ex > p + p { margin-top: 8px; }
  /* Owner, 2026-10-20: the boxes open up, each card shows its whole email (Enlarge opens the reading panel). */
  .r11-s5-card:not(.r11-s5-card--reply) .r11-s5-ex { flex: 1 1 auto; }
  .r11-s5-ex > .r11-s5-inv {
    margin: 6px 0 0;
    padding-left: 18px;
  }
  .r11-s5-ex > .r11-s5-inv + p { margin-top: 8px; }
  .r11-s5-ex--all { flex: 0 0 auto; }   /* the attachments follow the text; the spare height goes above Enlarge */

  /* Attachments: non-link chips (a PDF icon, the file name); the flagged credit note in gold. One chip
     look for the card and, a size up, the reading panel (polish r1: sans 600 12/16, radius 4 like the
     page's other chips and stamps). */
  .r11-s5-files {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
  }
  .r11-s5-file {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border: 1px solid var(--slate-200);
    border-radius: 4px;
    background: var(--white);
    font: 600 12px/16px var(--sans);
    letter-spacing: 0;
    color: var(--slate-800);
    white-space: nowrap;
  }
  .r11-s5-file.is-flag {
    border-color: var(--tile-gold);
    background: var(--r11-wash, #F6F0E0);   /* the page's one flagged wash (polish r3, art director; was #FBF5E6) */
    color: var(--gold-lo);
  }

  /* The Read affordance: one button per card ("Enlarge", 14/20 like s2's "The files on orebro.se" link; polish r2).
     Its ::after spans the card but lets the pointer through (polish r2), so the email text can be selected:
     a plain click on the card opens the panel (r11-s5.js), a drag selects. The ::after still draws the
     card's keyboard ring when the button has focus. */
  .r11-s5-foot { margin-top: auto; padding-top: 14px; }
  .r11-s5-open {
    display: none;
    align-items: center;
    gap: 7px;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    font: 600 14px/20px var(--sans);
    color: var(--slate-900);
    text-decoration-line: underline;            /* drawn at rest in transparent, so the hover underline fades in (polish r3) */
    text-decoration-thickness: 1px;
    text-decoration-color: transparent;
    text-underline-offset: 3px;
    cursor: pointer;
    transition: color .18s ease, text-decoration-color .18s ease;
  }
  .r11-s5.is-live .r11-s5-open { display: inline-flex; }
  .r11-s5-open::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: var(--r11-radius);
  }
  .r11-s5.is-live .r11-s5-open::after { pointer-events: none; }
  .r11-s5.is-live .r11-s5-card { cursor: pointer; }
  .r11-s5-open:focus-visible { outline: none; }
  .r11-s5-open:focus-visible::after { outline: 2px solid var(--slate-900); outline-offset: 3px; }
  .r11-s5-open-i { flex: none; overflow: visible; }
  .r11-s5-open-i path { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
  .r11-s5.is-live .r11-s5-card:hover { border-color: var(--slate-300); }
  /* One hover style for the page's text actions (polish r3, engineer): slate-900 with a 1px underline, as s2's
     "The files on orebro.se". Gold marks the finding only. (Longhands: Safari reads them all.) */
  .r11-s5-card:hover .r11-s5-open { color: var(--slate-900); text-decoration-line: underline; text-decoration-thickness: 1px; text-decoration-color: currentColor; text-underline-offset: 3px; }

  /* ---------- The connector: "Response · 3 days" over a thin arrow ---------- */
  .r11-s5-link {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 calc(var(--r11-gap) * .75);
  }
  .r11-s5-link-t {
    font: 500 11px/16px var(--mono);   /* the page's one label style (.r11-label; polish r1) */
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--slate-800);
    white-space: nowrap;
  }
  .r11-s5-link-a {
    position: relative;
    display: block;
    width: 100%;
    height: 10px;
    margin-top: 9px;
  }
  .r11-s5-link-a::before {
    content: "";
    position: absolute;
    left: 0;
    right: 1px;
    top: 4.5px;
    border-top: 1px solid var(--slate-500);
  }
  .r11-s5-link-a svg { position: absolute; right: 0; top: 0; overflow: visible; }
  .r11-s5-link-a path { fill: none; stroke: var(--slate-500); stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; }

  /* ---------- Source: under my email (the row's first column) ---------- */
  .r11-s5-row > .r11-s5-src { grid-column: 1; grid-row: 2; margin-top: 12px; margin-bottom: 0; }   /* the page's caption-to-source step (polish r2); no UA 1em under it: s5 ends 56px below its last line */

  /* ---------- Narrow desktops (row under 700px): the cards stack, the connector turns down ---------- */
  @container r11s5 (max-width: 699px) {
    .r11-s5-row { grid-template-columns: minmax(0, 1fr); max-width: 520px; }
    .r11-s5-row > .r11-s5-src { grid-row: 2; }
    .r11-s5-row > .r11-s5-card--reply { grid-row: 4; }
    .r11-s5-row > .r11-s5-link { grid-row: 3; }
    .r11-s5-link { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 14px 0 14px 24px; }
    .r11-s5-link-a { display: none; }
    .r11-s5-link::before {
      content: "";
      order: -1;
      width: 1px;
      height: 28px;
      background: var(--slate-500);
    }
  }
}

/* ---------- The reading panel (a modal dialog; any width, but only opened from the desktop cards) ---------- */
.r11-s5-dlg {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
  color: var(--slate-900);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.r11-s5-dlg:not([open]) { display: none; }
.r11-s5-dlg::backdrop { background: transparent; }

.r11-s5-scrim {
  position: absolute;
  inset: 0;
  background: rgba(36, 38, 42, .44);
}

.r11-s5-panel {
  --r11-s5-pad: 40px;
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  width: min(720px, calc(100% - 64px));
  height: -webkit-fit-content;
  height: fit-content;
  max-height: calc(100% - 64px);
  margin: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 14px;
  box-shadow: 0 28px 72px -24px rgba(24, 26, 30, .32);
}
.r11-s5-inner {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
/* During the FLIP (r11-s5.js): the panel's box is animated; its content keeps its final size. */
.r11-s5-panel.is-flip { right: auto; bottom: auto; margin: 0; max-height: none; }
.r11-s5-panel.is-flip > .r11-s5-inner { position: absolute; top: 0; left: 0; flex: none; }
.r11-s5-ghost {
  position: absolute !important;
  top: -1px;
  left: -1px;
  margin: 0 !important;
  border-color: transparent !important;
  pointer-events: none;
}

.r11-s5-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 14px 12px var(--r11-s5-pad);
  border-bottom: 1px solid var(--slate-200);
}
.r11-s5-bar > .r11-s5-meta {
  flex: 1 1 auto;
  justify-content: flex-start;
  gap: 14px;
  font: 500 12px/16px var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--slate-800);
}
.r11-s5-bar > .r11-s5-meta time { letter-spacing: .03em; color: var(--ink-dim); }

.r11-s5-langs {
  flex: none;
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  background: var(--slate-50);
}
.r11-s5-lang {
  margin: 0;
  padding: 5px 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font: 600 12.5px/18px var(--sans);
  color: var(--ink-dim);
  cursor: pointer;
}
.r11-s5-lang[aria-pressed="true"] {
  background: var(--white);
  color: var(--slate-900);
  box-shadow: 0 0 0 1px var(--slate-200);
}
.r11-s5-lang:hover { color: var(--slate-900); }
.r11-s5-lang:focus-visible { outline-offset: 1px; }

.r11-s5-x {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--slate-800);
  cursor: pointer;
}
.r11-s5-x:hover { background: var(--slate-100); color: var(--slate-900); }
.r11-s5-x path { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }

.r11-s5-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 28px var(--r11-s5-pad) 30px;
}
.r11-s5-scroll:focus { outline: none; }   /* focused on open (tabindex -1) so the keys scroll the email */
/* Both languages share one grid cell: switching never changes the panel's size. */
.r11-s5-doc { display: grid; }
.r11-s5-v { grid-area: 1 / 1; min-width: 0; }
.r11-s5-v > * { margin: 0; }
.r11-s5-dlg[data-lang="en"] .r11-s5-v[data-lang="sv"],
.r11-s5-dlg[data-lang="sv"] .r11-s5-v[data-lang="en"] { visibility: hidden; }

.r11-s5-v > .r11-s5-subj {
  font: 600 25px/1.22 var(--sans);
  letter-spacing: -.014em;
  color: var(--slate-900);
  text-wrap: balance;
}
.r11-s5-v > .r11-s5-route {
  margin-top: 6px;
  font: 400 15px/22px var(--sans);
  color: var(--ink-dim);
}
.r11-s5-v .r11-s5-arw { display: inline-block; margin: 0 .45em; color: var(--slate-500); }

.r11-s5-body {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--slate-100);
  font: 400 17px/1.6 var(--sans);
  color: var(--slate-900);
  text-wrap: pretty;
}
.r11-s5-body > * { margin: 0; }
.r11-s5-body > * + * { margin-top: .7em; }
.r11-s5-inv {
  padding: 0;
  list-style: none;
}
.r11-s5-inv li { position: relative; padding-left: 1.3em; }
.r11-s5-inv li::before { content: "–"; position: absolute; left: .2em; color: var(--ink-dim); }

.r11-s5-v > .r11-s5-files { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; padding: 0; list-style: none; }
.r11-s5-v .r11-s5-file {
  padding: 5px 10px 4px;
  border: 1px solid var(--slate-200);
  border-radius: 6px;
  background: var(--slate-50);
  font: 500 13px/18px var(--mono);
  color: var(--slate-800);
  white-space: nowrap;
}
.r11-s5-v .r11-s5-file.is-flag { border-color: var(--tile-gold); background: rgba(216, 174, 72, .13); color: var(--gold-lo); }

.r11-s5-note {
  margin-top: 24px !important;
  padding-top: 12px;
  border-top: 1px solid var(--slate-100);
  font: 400 12.5px/18px var(--sans);
  color: var(--ink-dim);
}

/* Scroll lock while the panel is open (r11-s5.js); the gutter stays, so nothing shifts sideways. */
html.r11-s5-lock { overflow: hidden; scrollbar-gutter: stable; }

@media (max-width: 767px) {
  .r11-s5-panel { --r11-s5-pad: 24px; width: calc(100% - 32px); max-height: calc(100% - 32px); }
}

/* ---------- The owner's pick "C" (2026-10-20): the two cards as real messages ----------
   A mail header (an avatar circle, MJ dark, ÖK gold; the sender with "to …" under it; the time at the right),
   the subject, the whole email, PDF icons on the reply's attachments. The cards keep their natural heights;
   my email gets a little more air between its parts so it reads structured. */
@media (min-width: 768px) {
  .r11-s5-row { align-items: start; }
  .r11-s5-head {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    column-gap: 12px;
    align-items: center;
  }
  .r11-s5-av {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    box-sizing: border-box;
    background: var(--slate-900);
    font: 600 12px/1 var(--sans);
    letter-spacing: .02em;
    color: var(--white);
  }
  .r11-s5-av--ok { background: #F8F0DB; border: 1px solid var(--tile-gold); color: var(--gold-lo); }
  .r11-s5-from { margin: 0; min-width: 0; font: 400 14px/1.35 var(--sans); color: var(--slate-900); }
  .r11-s5-from b { font-weight: 600; }
  .r11-s5-dim { color: var(--ink-dim); }
  .r11-s5-to { display: block; margin-top: 1px; font-size: 12px; color: var(--ink-dim); }
  .r11-s5-time { align-self: start; padding-top: 2px; font: 400 12px/1.4 var(--sans); white-space: nowrap; color: var(--ink-dim); }
  .r11-s5-card > .r11-s5-subj { margin-top: 16px; font-size: 16px; }
  .r11-s5-card .r11-s5-ex { margin-top: 10px; padding-top: 12px; }

  /* My email: a little more structure (the owner, 2026-10-20). Polish r2: the same 15/24 leading as the
     reply (the side-by-side cards share one baseline grid); the extra air is in the paragraph gaps, 14px
     against the reply's 8px. */
  .r11-s5-card:not(.r11-s5-card--reply) .r11-s5-ex > p + p { margin-top: 14px; }
  .r11-s5-card:not(.r11-s5-card--reply) .r11-s5-ex > .r11-s5-inv { margin: 10px 0 0; padding: 10px 14px 10px 30px; border-radius: 10px; background: var(--slate-50); }   /* radius as the cards (polish r1) */
  .r11-s5-card:not(.r11-s5-card--reply) .r11-s5-ex > .r11-s5-inv li + li { margin-top: 2px; }
  .r11-s5-card:not(.r11-s5-card--reply) .r11-s5-ex > .r11-s5-inv + p { margin-top: 14px; }

  .r11-s5-pdf { flex: none; fill: none; stroke: var(--slate-700); stroke-width: 1.1; stroke-linejoin: round; }
  .r11-s5-file.is-flag .r11-s5-pdf { stroke: var(--gold); }
  .r11-s5-card > .r11-s5-foot { margin-top: 0; padding-top: 14px; }
}

/* The reading panel uses the same mail header (avatar, sender, "to …"). */
.r11-s5-dlg .r11-s5-head { display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 12px; align-items: center; margin-top: 14px; }
.r11-s5-dlg .r11-s5-av { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; box-sizing: border-box; background: var(--slate-900); font: 600 13px/1 var(--sans); color: var(--white); }
.r11-s5-dlg .r11-s5-av--ok { background: #F8F0DB; border: 1px solid var(--tile-gold); color: var(--gold-lo); }
.r11-s5-dlg .r11-s5-from { margin: 0; font: 400 15px/1.35 var(--sans); color: var(--slate-900); }
.r11-s5-dlg .r11-s5-from b { font-weight: 600; }
.r11-s5-dlg .r11-s5-dim { color: var(--ink-dim); }
.r11-s5-dlg .r11-s5-to { display: block; margin-top: 1px; font-size: 13px; color: var(--ink-dim); }

/* The reading panel on the desktop (polish r1): its chips are the card's chips a size up (sans 600 13/18,
   white, radius 4, the same PDF icon drawn as a mask, so the markup stays as it is), and its small type
   joins the page's 12px step. Desktop only: the phone (m-s5.css) shares the any-width rules above. */
@media (min-width: 768px) {
  .r11-s5-v .r11-s5-file {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border: 1px solid var(--slate-200);
    border-radius: 4px;
    background: var(--white);
    font: 600 13px/18px var(--sans);
    letter-spacing: 0;
    color: var(--slate-800);
  }
  .r11-s5-v .r11-s5-file.is-flag { border-color: var(--tile-gold); background: var(--r11-wash, #F6F0E0); color: var(--gold-lo); }   /* one flagged wash (polish r3; was #FBF5E6) */
  .r11-s5-v .r11-s5-file::before {
    content: "";
    flex: none;
    width: 10px;
    height: 13px;
    background-color: var(--slate-700);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 13'%3E%3Cpath d='M1 .75h5.2L9 3.6v8.65H1Z' fill='none' stroke='%23000' stroke-width='1.1' stroke-linejoin='round'/%3E%3C/svg%3E") center / 10px 13px no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 13'%3E%3Cpath d='M1 .75h5.2L9 3.6v8.65H1Z' fill='none' stroke='%23000' stroke-width='1.1' stroke-linejoin='round'/%3E%3C/svg%3E") center / 10px 13px no-repeat;
  }
  .r11-s5-v .r11-s5-file.is-flag::before { background-color: var(--gold); }
  .r11-s5-lang { font-size: 12px; }
  .r11-s5-note { font-size: 12px; }

  /* The FLIP's copy of the card (.r11-s5-ghost) sits inside the dialog, where the panel's bigger header
     rules (.r11-s5-dlg .r11-s5-head …) match it too: keep the card's own header there, so the face that
     fades out on open, and back in on close, is exactly the card (no 35px jump of its text). */
  .r11-s5-ghost .r11-s5-head { grid-template-columns: 38px minmax(0, 1fr) auto; margin-top: 0; }
  .r11-s5-ghost .r11-s5-av { width: 38px; height: 38px; font: 600 12px/1 var(--sans); }
  .r11-s5-ghost .r11-s5-from { font: 400 14px/1.35 var(--sans); }
  .r11-s5-ghost .r11-s5-to { font-size: 12px; }
}

/* Polish r3 (engineer): the reading panel is its card a size up, not a different-looking document. The card
   reads avatar + sender, then the subject, then the email; the panel had the subject first. Here the panel's
   mail header comes first (order only: the DOM, aria-labelledby and copy are unchanged), the subject under it,
   and my invoice list sits on the card's slate-50 box (radius 10, padding the card's 10 14 10 30 a size up).
   None of these selectors can match the FLIP ghost (.r11-s5-ghost, a clone of the card: it has no
   .r11-s5-v and no .r11-s5-body). Both languages still share one grid cell, so the size never changes. */
@media (min-width: 768px) {
  .r11-s5-dlg .r11-s5-v { display: flex; flex-direction: column; }
  .r11-s5-dlg .r11-s5-v > .r11-s5-head { order: -1; margin-top: 0; }
  .r11-s5-dlg .r11-s5-v > .r11-s5-subj { margin-top: 18px; }
  .r11-s5-dlg .r11-s5-body > .r11-s5-inv:not(.ph) { padding: 12px 18px 12px 34px; border-radius: 10px; background: var(--slate-50); }
}

/* Polish r3 (engineer): on windows under ~940px tall a rail or link jump to s5 cut its source line (1440x900).
   Land 24px higher there (the h2 at 32px instead of 56px); the 1512x945 landing is unchanged. */
@media (min-width: 768px) and (max-height: 940px) {
  #s5.r11 { scroll-margin-top: -24px; }
}
