/* Settli — styles for legal.html (extracted from inline <style>) */
:root {
    interpolate-size: allow-keywords; /* lets ::details-content animate to height:auto */
    --shadow: 0,0,0;
    --accent: #007AFF;
    --accent-deep: #0040A0;
    --bg: #ffffff;
    --bg-alt: #f5f5f7;
    --ink: #1d1d1f;
    --ink-muted: #6e6e73;
    --ink-light: #86868b;
    --nav-bg: rgba(255,255,255,0.72);
    --hairline: rgba(0,0,0,0.08);
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  }
  [data-theme="dark"] {
    --shadow: 150,150,150;
    --bg: #000000;
    --bg-alt: #161618;
    --ink: #f5f5f7;
    --ink-muted: #a1a1a6;
    --ink-light: #86868b;
    --nav-bg: rgba(0,0,0,0.72);
    --hairline: rgba(255,255,255,0.10);
  }
  @media (prefers-color-scheme: dark) {
    [data-theme="auto"] {
      --shadow: 150,150,150;
      --bg: #000000;
      --bg-alt: #161618;
      --ink: #f5f5f7;
      --ink-muted: #a1a1a6;
      --ink-light: #86868b;
      --nav-bg: rgba(0,0,0,0.72);
      --hairline: rgba(255,255,255,0.10);
    }
  }
  

  * { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }
  body {
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    transition: background-color .3s ease, color .3s ease;
  }
  ::selection { background: var(--accent); color: #fff; }
  a { color: var(--accent); text-decoration: none; }
  a:hover { text-decoration: underline; }

  /* ── Nav (matches home) ────────────────────────────────── */
  .nav {
    position: sticky; top: 0; z-index: 100;
    height: 48px;
    background: var(--nav-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 0.5px solid var(--hairline);
    transition: background-color .3s ease;
  }
  .nav-inner {
    max-width: 1080px; margin: 0 auto; height: 100%;
    padding: 0 22px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 18px;
    font-size: 14px; letter-spacing: -0.01em;
  }
  .nav-logo {
    font-weight: 600; font-size: 19px; letter-spacing: -0.025em;
    display: flex; align-items: center; gap: 8px;
    color: var(--ink); text-decoration: none;
  }
  .nav-logo:hover { text-decoration: none; }
  .nav-logo-mark {
    width: 28px; height: 28px; border-radius: 7px;
    background-image: url('../logo/logo-light.svg');
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
  }
  [data-theme="dark"] .nav-logo-mark {
    background-image: url('../logo/logo-dark.svg');
  }
  @media (prefers-color-scheme: dark) {
    [data-theme="auto"] .nav-logo-mark {
      background-image: url('../logo/logo-dark.svg');
    }
  }
  .nav-tools { display: flex; align-items: center; gap: 6px; }

  /* Language picker (popover) */
  .lang-picker { position: relative; }
  .lang-trigger {
    background: transparent; border: none; cursor: pointer;
    color: var(--ink); opacity: 0.7;
    height: 32px; padding: 0 8px;
    border-radius: 8px;
    display: inline-flex; align-items: center; gap: 6px;
    font-family: inherit; font-size: 12px; font-weight: 600;
    letter-spacing: 0.02em;
    transition: opacity .15s ease, background-color .15s ease;
  }
  .lang-trigger:hover { opacity: 1; background: var(--hairline); }
  .lang-trigger .flag { width: 18px; height: 13px; border-radius: 2px; display: block; flex-shrink: 0; }
  .lang-trigger .caret {
    width: 6px; height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translate(-1px,-1px);
    opacity: 0.6;
  }
  .lang-menu {
    position: absolute; top: calc(100% + 6px); right: 0;
    z-index: 1000;
    background: #ffffff;
    border: 0.5px solid var(--hairline);
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 18px 36px rgba(var(--shadow),0.18), 0 4px 10px rgba(var(--shadow),0.08);
    display: none;
    min-width: 200px;
    isolation: isolate;
  }
  [data-theme="dark"] .lang-menu {
    background: #1c1c1e;
    box-shadow: 0 18px 36px rgba(var(--shadow),0.5), 0 4px 10px rgba(var(--shadow),0.3);
  }
  @media (prefers-color-scheme: dark) {
    [data-theme="auto"] .lang-menu {
      background: #1c1c1e;
      box-shadow: 0 18px 36px rgba(var(--shadow),0.5), 0 4px 10px rgba(var(--shadow),0.3);
    }
  }
  .lang-picker.is-open .lang-menu { display: block; }
  .lang-option {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 9px 12px;
    border-radius: 8px;
    background: transparent; border: none; cursor: pointer;
    text-align: left;
    font-family: inherit; font-size: 14px; font-weight: 500;
    color: var(--ink); letter-spacing: -0.005em;
    transition: background-color .12s ease;
    white-space: nowrap;
  }
  .lang-option + .lang-option { margin-top: 1px; }
  .lang-option:hover { background: var(--bg-alt); }
  .lang-option .flag { width: 22px; height: 16px; border-radius: 2px; display: block; flex-shrink: 0; }
  .lang-option > span:nth-child(2) {
    flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis;
  }
  .lang-option.is-active { color: var(--accent); }
  .lang-option .check {
    margin-left: auto;
    width: 14px; height: 14px;
    opacity: 0;
    color: var(--accent);
    flex-shrink: 0;
  }
  .lang-option.is-active .check { opacity: 1; }
  .nav-cta {
    color: var(--accent); font-weight: 500; text-decoration: none;
    white-space: nowrap; margin-left: 6px;
  }

  .nav-btn {
    background: transparent; border: none; cursor: pointer;
    color: var(--ink); opacity: 0.7;
    width: 32px; height: 32px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    transition: opacity .15s ease, background-color .15s ease;
    font-family: inherit; font-size: 12px; font-weight: 600;
    letter-spacing: 0.02em;
  }
  .nav-btn:hover { opacity: 1; background: var(--hairline); }

  /* ── Page ──────────────────────────────────────────────── */
  main, article[role="main"] {
    max-width: 720px; margin: 0 auto;
    padding: 80px 22px 80px;
  }
  .eyebrow {
    font-size: 15px; font-weight: 600; color: var(--accent);
    letter-spacing: -0.005em; margin-bottom: 12px;
  }
  h1 {
    margin: 0 0 14px; font-weight: 600;
    font-size: clamp(40px, 5.6vw, 64px); line-height: 1.05;
    letter-spacing: -0.04em;
  }
  .meta {
    color: var(--ink-light); font-size: 14px; letter-spacing: -0.005em;
    margin: 0 0 56px;
  }
  h2 {
    margin: 56px 0 16px; font-weight: 600;
    font-size: 26px; line-height: 1.2; letter-spacing: -0.025em;
  }
  h2:first-of-type { margin-top: 0; }
  p {
    margin: 0 0 18px; font-size: 18px; line-height: 1.55;
    color: var(--ink); letter-spacing: -0.011em;
    text-wrap: pretty;
  }
  p.muted { color: var(--ink-muted); }
  ul {
    margin: 0 0 18px; padding-left: 22px;
    font-size: 18px; line-height: 1.55;
    color: var(--ink); letter-spacing: -0.011em;
  }
  li { margin-bottom: 8px; }
  hr {
    margin: 56px 0 32px;
    border: none; border-top: 0.5px solid var(--hairline);
  }
  .generated {
    font-size: 13px; color: var(--ink-light); letter-spacing: -0.005em;
  }

  /* ── Footer (matches home) ─────────────────────────────── */
  footer {
    background: var(--bg-alt);
    padding: 36px 22px;
    font-size: 12px; color: var(--ink-light);
    border-top: 0.5px solid var(--hairline);
    transition: background-color .3s ease;
  }
  .foot-inner {
    max-width: 1080px; margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 12px;
  }
  .foot-links { display: flex; gap: 22px; }
  .foot-links a { color: var(--ink-muted); text-decoration: none; }
  .foot-links a:hover { color: var(--ink); }

  /* ── Changelog list ────────────────────────────────────── */
  .changelog { margin-top: 8px; }
  .cl-entry {
    border-top: 0.5px solid var(--hairline);
    scroll-margin-top: 64px;
  }
  .cl-head {
    display: flex; align-items: baseline; gap: 14px;
    flex-wrap: wrap;
    margin: 0; padding: 22px 0;
    cursor: pointer;
    list-style: none;
    -webkit-tap-highlight-color: transparent;
  }
  .cl-head::-webkit-details-marker { display: none; }
  .cl-head::marker { content: ""; }
  .cl-head:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
  .cl-entry:first-child { border-top: none; }
  .cl-entry:first-child > .cl-head { padding-top: 0; }
  /* Content wrapper — height/opacity animated by changelog.js for a smooth
     open AND close in every browser (native <details> hides instantly). */
  .cl-body { padding-bottom: 30px; }
  /* Smooth open/close handled natively by the browser via the ::details-content
     box (no JS). Falls back to an instant toggle where unsupported. */
  .cl-entry::details-content {
    block-size: 0;
    overflow: clip;
    transition: block-size .25s ease, content-visibility .25s;
    transition-behavior: allow-discrete;
  }
  .cl-entry[open]::details-content { block-size: auto; }
  @media (prefers-reduced-motion: reduce) {
    .cl-entry::details-content { transition: none; }
  }
  .cl-chevron {
    align-self: center;
    width: 8px; height: 8px;
    border-right: 2px solid var(--ink-light);
    border-bottom: 2px solid var(--ink-light);
    transform: translateY(-2px) rotate(45deg);
    transition: transform .2s ease;
    flex-shrink: 0;
  }
  details.cl-entry[open] > .cl-head .cl-chevron { transform: translateY(2px) rotate(-135deg); }
  .cl-head:hover .cl-chevron { border-color: var(--ink); }
  @media (prefers-reduced-motion: reduce) {
    .cl-chevron { transition: none; }
  }
  .cl-version {
    margin: 0;
    font-weight: 600; font-size: 15px; letter-spacing: 0.01em;
    color: var(--accent);
    background: rgba(0,122,255,0.10);
    padding: 5px 12px; border-radius: 980px;
    line-height: 1;
  }
  [data-theme="dark"] .cl-version { background: rgba(10,132,255,0.18); }
  @media (prefers-color-scheme: dark) {
    [data-theme="auto"] .cl-version { background: rgba(10,132,255,0.18); }
  }
  .cl-status {
    font-size: 12px; font-weight: 600; letter-spacing: 0.01em;
    padding: 4px 10px; border-radius: 980px; line-height: 1;
  }
  .cl-status--upcoming {
    color: #b25e00; background: rgba(255,149,0,0.16);
  }
  [data-theme="dark"] .cl-status--upcoming { color: #ffb340; background: rgba(255,159,10,0.20); }
  @media (prefers-color-scheme: dark) {
    [data-theme="auto"] .cl-status--upcoming { color: #ffb340; background: rgba(255,159,10,0.20); }
  }
  .cl-date {
    font-size: 14px; color: var(--ink-light); letter-spacing: -0.005em;
    text-transform: capitalize;
  }

  /* Count summary — shown only when the version is collapsed */
  .cl-count { font-size: 13px; color: var(--ink-light); letter-spacing: -0.005em; }
  details.cl-entry[open] > .cl-head .cl-count { display: none; }

  /* Copy-link button — pushed to the right, revealed on hover/focus */
  .cl-copy {
    margin-left: auto; align-self: center; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; padding: 0;
    border: none; background: transparent; border-radius: 7px;
    cursor: pointer; color: var(--ink-light);
    opacity: 0;
    transition: opacity .15s ease, background-color .15s ease, color .15s ease;
  }
  .cl-head:hover .cl-copy, .cl-copy:focus-visible, .cl-copy.is-copied { opacity: 1; }
  .cl-copy:hover { background: var(--bg-alt); color: var(--ink); }
  .cl-copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  @media (hover: none) { .cl-copy { opacity: 0.55; } }
  .cl-copy-ic { width: 16px; height: 16px; display: block; }
  .cl-ic-check { display: none; color: #2e7d32; }
  .cl-copy.is-copied { color: #2e7d32; }
  .cl-copy.is-copied .cl-ic-link { display: none; }
  .cl-copy.is-copied .cl-ic-check { display: block; }
  [data-theme="dark"] .cl-ic-check, [data-theme="dark"] .cl-copy.is-copied { color: #5fd47e; }
  @media (prefers-color-scheme: dark) {
    [data-theme="auto"] .cl-ic-check, [data-theme="auto"] .cl-copy.is-copied { color: #5fd47e; }
  }

  /* Section divider ("Upcoming" vs released history) */
  .cl-section {
    margin: 34px 0 2px;
    font-size: 12px; font-weight: 600; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--ink-light);
  }
  .cl-section:first-child { margin-top: 0; }
  .cl-section + .cl-entry { border-top: none; }

  .cl-group {
    margin: 18px 0 10px; padding: 0; border: none;
    font-weight: 600; font-size: 17px; line-height: 1.2;
    letter-spacing: -0.015em; color: var(--ink);
  }
  .cl-group:first-of-type { margin-top: 0; }
  .cl-list {
    list-style: none; margin: 0 0 4px; padding: 0;
  }
  .cl-list:last-child { margin-bottom: 0; }
  .cl-list li {
    position: relative;
    padding-left: 26px;
    margin-bottom: 12px;
    font-size: 18px; line-height: 1.5; letter-spacing: -0.011em;
    color: var(--ink);
    text-wrap: pretty;
  }
  .cl-list li:last-child { margin-bottom: 0; }
  .cl-list li::before {
    content: "";
    position: absolute; left: 4px; top: 12px;
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent);
  }

  /* ── Toolbar (expand / collapse all) ───────────────────── */
  .cl-toolbar { display: flex; justify-content: flex-end; margin: 0 0 4px; }
  .cl-toggle-all {
    background: transparent; border: none; cursor: pointer;
    font-family: inherit; font-size: 14px; font-weight: 500;
    color: var(--accent); letter-spacing: -0.01em;
    padding: 6px 4px; border-radius: 6px;
  }
  .cl-toggle-all:hover { text-decoration: underline; }
  .cl-toggle-all:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  /* Current-version marker (green) */
  .cl-current {
    font-size: 12px; font-weight: 600; letter-spacing: 0.01em;
    color: #2e7d32; background: rgba(52,199,89,0.14);
    padding: 4px 10px; border-radius: 980px; line-height: 1;
  }
  [data-theme="dark"] .cl-current { color: #5fd47e; background: rgba(48,209,88,0.18); }
  @media (prefers-color-scheme: dark) {
    [data-theme="auto"] .cl-current { color: #5fd47e; background: rgba(48,209,88,0.18); }
  }

  /* Error state */
  .cl-error { color: var(--ink-muted); font-size: 17px; letter-spacing: -0.011em; }

  /* ── i18n loader overlay ─────────────────────────────── */
  html.is-i18n-loading body { visibility: hidden; }
  .i18n-overlay {
    position: fixed; inset: 0;
    background: var(--bg, #fff);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
    visibility: visible !important;
    opacity: 1; transition: opacity .25s ease;
  }
  .i18n-overlay.is-hiding { opacity: 0; pointer-events: none; }
  .i18n-overlay .spinner {
    width: 28px; height: 28px; border-radius: 50%;
    border: 2.5px solid rgba(0,0,0,0.12);
    border-top-color: var(--accent, #007AFF);
    animation: i18n-spin 0.8s linear infinite;
  }
  [data-theme="dark"] .i18n-overlay .spinner { border-color: rgba(255,255,255,0.18); border-top-color: var(--accent, #007AFF); }
  @media (prefers-color-scheme: dark) {
    [data-theme="auto"] .i18n-overlay .spinner { border-color: rgba(255,255,255,0.18); border-top-color: var(--accent, #007AFF); }
  }
  @keyframes i18n-spin { to { transform: rotate(360deg); } }
  @media (prefers-reduced-motion: reduce) {
    .i18n-overlay .spinner { animation: none; }
  }
