@layer components {
  /* The Nouveautés screen. One markup serves the desktop and the phone: the list's own width decides the layout. */
  .release-top { display: flex; flex-direction: column; gap: 8px; }
  .release-back {
    display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; min-height: 28px;
    margin-left: -2px; padding: 0 6px 0 2px; border-radius: var(--radius-sm);
    color: var(--muted-foreground); text-decoration: none;
  }
  .release-back--phone { display: none; }
  .release-back:hover { color: var(--foreground); text-decoration: none; }
  .release-back:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--jx-accent); }
  .release-header h1 { font-size: 22px; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; }

  .release-list { container-type: inline-size; display: flex; flex-direction: column; gap: 28px; }

  .release-head-card {
    padding: 24px 28px 22px; border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, var(--jx-accent-soft), transparent);
  }
  .release-hero:not(:has(.release-grid)) .release-head-card { border-bottom: 0; }
  .release-meta { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; color: var(--muted-foreground); }
  .release-vbadge {
    display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px;
    background: var(--primary); color: var(--primary-foreground); font: 600 13px/1 var(--font-mono);
  }
  .release-head-card h2 {
    margin-top: 12px; font-size: 24px; line-height: 1.2; letter-spacing: -0.02em; font-weight: 650; text-wrap: balance;
  }
  .release-head-card p { margin-top: 8px; max-width: 62ch; color: var(--muted-foreground); font-size: 14px; }

  .release-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 20px 28px 28px; }
  .release-hl { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
  .release-hl--full { grid-column: 1 / -1; }
  .release-hl--side { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 24px; }
  .release-hl--side .release-hl-media { flex: 1 1 58%; min-width: 0; }
  .release-hl--side .release-hl-text { flex: 1 1 42%; }
  .release-hl-text h3 { font-size: 15px; font-weight: 600; line-height: 1.3; }
  .release-hl-text p { margin-top: 4px; color: var(--muted-foreground); font-size: 14px; }

  .release-media {
    position: relative; margin: 0; overflow: hidden; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
  }
  .release-media-frame { position: relative; }
  .release-media img { display: block; width: 100%; height: auto; }
  /* A lazy image that is not displayed is never fetched: only the current theme's pictures load. */
  .release-media-dark { display: none; }
  :root[data-theme="dark"] .release-media-dark { display: block; }
  :root[data-theme="dark"] .release-media-light { display: none; }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .release-media-dark { display: block; }
    :root:not([data-theme="light"]) .release-media-light { display: none; }
  }
  /* The button covers the whole media, so the picture is clickable while its image stays out of the button. */
  .release-media-open {
    position: absolute; inset: 0; width: 100%; padding: 0; border: 0; background: none;
    border-radius: inherit; cursor: zoom-in;
  }
  .release-media-open:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--jx-accent); }
  .release-media-zoom {
    position: absolute; right: 10px; top: 10px; width: 30px; height: 30px; border-radius: 50%;
    display: grid; place-items: center; background: oklch(0 0 0 / 0.62); color: #fff; opacity: 0; transition: opacity 0.15s;
  }
  .release-media-open:focus-visible .release-media-zoom, .release-media:focus-within .release-media-zoom { opacity: 1; }
  /* A tap hovers too, and iOS Safari drops the click of a tap whose hover reveals content: a real hover only. */
  @media (hover: hover) { .release-media-open:hover .release-media-zoom { opacity: 1; } }
  @media (hover: none) { .release-media-zoom { opacity: 1; } }
  .release-media-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px;
    border-top: 1px solid var(--border); background: var(--card);
  }
  .release-anim-btn {
    display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 10px;
    border: 1px solid var(--input); border-radius: 999px; background: var(--card); color: var(--foreground);
    font-size: 13px; font-weight: 500;
  }
  .release-anim-btn:hover { background: var(--accent); }
  .release-anim-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--jx-accent); }
  .release-anim-btn svg { width: 14px; height: 14px; }
  .release-gif-tag {
    height: 20px; padding: 0 7px; border-radius: 5px; background: var(--muted); color: var(--muted-foreground);
    font: 600 13px/20px var(--font-mono); letter-spacing: 0.04em;
  }
  /* A finger answers on --tap around the control's center, rounded corners included; what is drawn keeps its size. */
  @media (pointer: coarse) {
    .release-anim-btn, .release-back { position: relative; }
    .release-anim-btn::after, .release-back::after {
      content: ""; position: absolute; inset: min(0px, calc((100% - var(--tap)) / 2));
    }
    .release-anim-btn { min-height: var(--tap); }
  }

  /* Improvements and fixes are long lists of sentences: each section takes the full width, one under the other. */
  .release-sections { display: grid; grid-template-columns: 1fr; gap: 16px; }
  .release-sec { gap: 12px; padding: 20px 24px; }
  .release-sec h2 { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; line-height: 1.3; }
  .release-sec h2 svg { width: 16px; height: 16px; color: var(--muted-foreground); }
  .release-sec ul, .release-past-body ul { margin: 0; padding: 0; list-style: none; }
  .release-sec li, .release-past-body li { position: relative; padding-left: 16px; font-size: 14px; }
  .release-sec li + li { margin-top: 10px; }
  /* An item's illustration is a thumbnail under its text, never wider than a half highlight. */
  .release-item-media { max-width: 360px; margin-top: 8px; }
  .release-past-body li + li { margin-top: 6px; }
  .release-sec li::before, .release-past-body li::before {
    content: ""; position: absolute; left: 2px; top: 0.62em; width: 5px; height: 5px;
    border-radius: 50%; background: var(--muted-foreground);
  }

  .release-history h2 { margin-bottom: 4px; font-size: 15px; font-weight: 600; }
  .release-history-hint { margin-bottom: 14px; color: var(--muted-foreground); }
  .release-timeline { position: relative; display: flex; flex-direction: column; gap: 10px; padding-left: 22px; }
  .release-timeline::before {
    content: ""; position: absolute; left: 5px; top: 14px; bottom: 14px; width: 2px; background: var(--border);
  }
  .release-timeline details {
    position: relative; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card);
  }
  .release-timeline details::before {
    content: ""; position: absolute; left: -22px; top: 19px; width: 12px; height: 12px; border-radius: 50%;
    background: var(--background); border: 2px solid var(--muted-foreground);
  }
  .release-timeline summary {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-height: 48px; padding: 8px 16px;
    cursor: pointer; list-style: none; border-radius: var(--radius-lg);
  }
  .release-timeline summary::-webkit-details-marker { display: none; }
  .release-timeline summary:hover { background: var(--accent); }
  .release-timeline summary:hover :is(.release-past-date, svg) { color: var(--accent-foreground); }
  .release-timeline summary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--jx-accent); }
  .release-version { font-family: var(--font-mono); font-size: 0.95em; }
  .release-ver { font-family: var(--font-mono); font-size: 13px; }
  .release-past-title { flex: 1 1 200px; font-weight: 500; }
  .release-past-date { color: var(--muted-foreground); }
  .release-timeline summary > svg { color: var(--muted-foreground); transition: transform 0.15s; }
  .release-timeline details[open] > summary > svg { transform: rotate(90deg); }
  .release-past-body { padding: 2px 16px 16px; }
  .release-past-body h3 {
    margin: 10px 0 6px; font-size: 13px; font-weight: 500; letter-spacing: 0.04em;
    text-transform: uppercase; color: var(--muted-foreground);
  }

  @container (max-width: 640px) {
    .release-head-card { padding: 18px 16px 16px; }
    .release-head-card h2 { font-size: 20px; }
    .release-head-card p { font-size: 15px; }
    .release-grid { grid-template-columns: 1fr; gap: 22px; padding: 16px; }
    .release-hl--side { flex-direction: column; align-items: stretch; gap: 12px; }
    .release-hl-text h3 { font-size: 16px; }
    .release-hl-text p { font-size: 15px; }
    .release-sec { padding: 16px; }
    .release-sec li, .release-past-body li { font-size: 15px; }
    .release-timeline summary { padding: 8px 12px; }
    .release-anim-btn { height: 40px; }
  }
  @media (prefers-reduced-motion: reduce) {
    .release-media-zoom, .release-timeline summary > svg { transition: none; }
  }

  /* Phone and tablet (the shell's breakpoint): the page opens on its own top bar (back, title) and ends at the screen's foot, with no tab bar. */
  @media (max-width: 1099px) {
    :root:has(.app-main--releases) { --stack-clearance: calc(24px + var(--safe-bottom)); }
  }
  @media (max-width: 1099px) {
    .release-top {
      position: sticky; top: 0; z-index: 2; flex-direction: row; align-items: center; gap: 4px; min-height: 52px;
      margin: 0 calc(-1 * var(--gutter)); padding: var(--safe-top) 8px 0;
      border-bottom: 1px solid var(--border); background: var(--background);
    }
    .release-back--desktop { display: none; }
    .release-back--phone { display: inline-flex; }
    .release-back { width: var(--tap); height: var(--tap); min-height: var(--tap); margin: 0; padding: 0; justify-content: center; }
    .release-back-text {
      position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
    }
    .release-back svg { width: 22px; height: 22px; }
    .release-header { padding: 0; }
    .release-header h1 { font-size: 17px; }
    .release-lead { display: none; }
  }

  /* Entry points: always rendered, shown only while the live sidebar carries the unread marker (a restored page
     must not keep a stale state). Hidden, they are out of the accessibility tree too. */
  .release-dot, .release-new, .release-unread-sr { display: none; }
  .release-dot {
    position: absolute; width: 9px; height: 9px; border-radius: 50%;
    background: var(--jx-accent); box-shadow: 0 0 0 2px var(--background);
  }
  :root:has(#app-sidebar .release-unread-marker) .release-dot { display: block; }
  :root:has(#app-sidebar .release-unread-marker) .release-new { display: inline-flex; }
  :root:has(#app-sidebar .release-unread-marker) .release-unread-sr { display: inline; }
}
