/* Cubbit release notes. Brand tokens from cubbit.io (blue #0065ff, Titillium Web + Source Sans 3). */
:root {
  --blue-500: #0065ff;
  --blue-700: #0048b5;
  --violet-500: #8739b1;
  --green-600: #23a675;

  --bg: #ffffff;
  --bg-elev: #ffffff;
  --surface: #f4f6f8;
  --surface-2: #eceff2;
  --text: #1c1c1c;
  --text-2: #3f4952;
  --muted: #596773;
  --faint: #7a858f;
  --border: #dee4ea;
  --border-strong: #ccd0d4;
  --primary: var(--blue-500);
  --primary-hover: var(--blue-700);
  --primary-soft: #e6f0ff;
  --mark: #fff1b8;
  --shadow: 0 1px 2px rgb(16 24 40 / 0.06), 0 8px 24px rgb(16 24 40 / 0.06);

  --c-action: #9a5b00;   --c-action-bg: #fdf3e3;   --c-action-line: #f3b356;
  --c-new: #0058e0;      --c-new-bg: #e6f0ff;
  --c-improved: #7a2fa3; --c-improved-bg: #f3eaf8;
  --c-fixed: #1c815c;    --c-fixed-bg: #e3f5ee;
  --c-security: #c4302b; --c-security-bg: #fdecec;
  --c-deprecated: #515e69; --c-deprecated-bg: #eceff2;
  --c-known: #515e69;    --c-known-bg: #eceff2;
  --c-ea: #ffffff;       --c-ea-bg: var(--violet-500);

  --font-head: "Titillium Web", Arial, sans-serif;
  --font-body: "Source Sans 3", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  --radius: 14px;
  --topbar-h: 60px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #070809; --bg-elev: #0f1113; --surface: #121417; --surface-2: #1a1e22;
    --text: #e8ecf0; --text-2: #c3cad1; --muted: #9099a1; --faint: #7a858f;
    --border: #22282d; --border-strong: #31393f;
    --primary: #4d8fff; --primary-hover: #8ab8ff; --primary-soft: #0d2147;
    --mark: #5c4a00; --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px rgb(0 0 0 / 0.35);
    --c-action: #f3b356;   --c-action-bg: #2a1f0c;   --c-action-line: #f3b356;
    --c-new: #8ab8ff;      --c-new-bg: #0d2147;
    --c-improved: #c8a4db; --c-improved-bg: #2a1736;
    --c-fixed: #4fd1a1;    --c-fixed-bg: #0e2e22;
    --c-security: #ff8a85; --c-security-bg: #3a1414;
    --c-deprecated: #b3b9bf; --c-deprecated-bg: #22282d;
    --c-known: #b3b9bf;    --c-known-bg: #22282d;
    --c-ea-bg: #8f44ba;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #070809; --bg-elev: #0f1113; --surface: #121417; --surface-2: #1a1e22;
  --text: #e8ecf0; --text-2: #c3cad1; --muted: #9099a1; --faint: #7a858f;
  --border: #22282d; --border-strong: #31393f;
  --primary: #4d8fff; --primary-hover: #8ab8ff; --primary-soft: #0d2147;
  --mark: #5c4a00; --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px rgb(0 0 0 / 0.35);
  --c-action: #f3b356;   --c-action-bg: #2a1f0c;   --c-action-line: #f3b356;
  --c-new: #8ab8ff;      --c-new-bg: #0d2147;
  --c-improved: #c8a4db; --c-improved-bg: #2a1736;
  --c-fixed: #4fd1a1;    --c-fixed-bg: #0e2e22;
  --c-security: #ff8a85; --c-security-bg: #3a1414;
  --c-deprecated: #b3b9bf; --c-deprecated-bg: #22282d;
  --c-known: #b3b9bf;    --c-known-bg: #22282d;
  --c-ea-bg: #8f44ba;
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 24px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16.5px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased; overflow-wrap: break-word;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; line-height: 1.2; margin: 0; letter-spacing: -0.005em; }
p { margin: 0; }
code {
  font: 0.86em var(--font-mono); background: var(--surface); border: 1px solid var(--border);
  border-radius: 5px; padding: 0.05em 0.35em; overflow-wrap: anywhere;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 1px; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.skip { position: absolute; left: 16px; top: -48px; z-index: 50; background: var(--primary); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip:focus { top: 12px; color: #fff; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; height: var(--topbar-h); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; align-items: center; height: 100%; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); margin-right: auto; }
.brand:hover { text-decoration: none; color: var(--text); }
.logo { display: flex; color: var(--text); }
.logo svg { width: 86px; height: auto; }
.brand-sep { color: var(--border-strong); font-size: 20px; }
.brand-sub { font: 600 16px var(--font-head); }
.topnav { display: flex; gap: 22px; font-weight: 600; font-size: 15px; }
.topnav a { color: var(--muted); }
.topnav a:hover { color: var(--text); text-decoration: none; }
.theme { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.theme button { display: grid; place-items: center; width: 28px; height: 26px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.theme button:hover { color: var(--text); }
.theme button[aria-pressed="true"] { background: var(--bg-elev); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / 0.12); }

/* ---------- Hero ---------- */
.hero { border-bottom: 1px solid var(--border); background:
  radial-gradient(600px 220px at 85% 0%, color-mix(in srgb, var(--blue-500) 14%, transparent), transparent 70%); }
.hero .wrap { padding-top: 44px; padding-bottom: 36px; }
.edition-tabs { display: inline-flex; gap: 2px; padding: 3px; margin-bottom: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; }
.edition-tabs a { padding: 5px 14px; border-radius: 8px; color: var(--muted); font: 600 14.5px var(--font-body); }
.edition-tabs a:hover { color: var(--text); text-decoration: none; }
.edition-tabs a[aria-current="page"] { background: var(--bg-elev); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / 0.12); }
.hero h1 { font-size: clamp(32px, 4.6vw, 46px); }
.lead { max-width: 680px; color: var(--muted); font-size: 18px; margin-top: 10px; }
.hero-links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 18px; font-weight: 600; font-size: 15px; }
.link-rss { display: inline-flex; align-items: center; gap: 7px; }

.notice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; max-width: 760px; margin-bottom: 22px; padding: 10px 12px 10px 14px; border-radius: 12px; background: var(--c-action-bg); border: 1px solid color-mix(in srgb, var(--c-action-line) 50%, transparent); color: var(--text); font-size: 15px; }
.notice svg { color: var(--c-action); flex: none; }
.notice span { flex: 1 1 320px; }
.notice-cta { border: 0; border-radius: 8px; padding: 6px 12px; background: var(--text); color: var(--bg); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
.notice-cta:hover { opacity: 0.88; }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: 64px; align-items: start; }
.releases { min-width: 0; padding-bottom: 32px; }
.releases:focus { outline: none; }

/* ---------- Sidebar ---------- */
.sidebar { position: sticky; top: calc(var(--topbar-h) + 24px); max-height: calc(100vh - var(--topbar-h) - 48px); overflow: auto; padding: 32px 4px 24px 0; scrollbar-width: thin; display: flex; flex-direction: column; gap: 26px; }
.panel-title { font: 700 12px var(--font-head); letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); margin-bottom: 10px; }
.field { display: grid; gap: 4px; margin-top: 10px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
select, .search-box {
  width: 100%; height: 38px; border: 1px solid var(--border-strong); border-radius: 9px; background-color: var(--bg-elev); color: var(--text); font: 15px var(--font-body);
}
select { appearance: none; padding: 0 34px 0 11px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='%237a858f' d='M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; }
select:hover, .search-box:hover { border-color: var(--faint); }
select:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.search-box { display: flex; align-items: center; gap: 8px; padding: 0 8px 0 11px; color: var(--faint); }
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }
.search-box input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; outline: none; }
.search-box input::-webkit-search-cancel-button { cursor: pointer; }
kbd { font: 600 11px var(--font-mono); color: var(--faint); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; }
.search-box:focus-within kbd { display: none; }
.planner { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.planner .field:first-of-type { margin-top: 0; }
.reset { margin-top: 12px; border: 0; background: none; padding: 0; color: var(--primary); font-weight: 600; font-size: 14px; cursor: pointer; }
.reset:hover { text-decoration: underline; }

.versions ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.versions a { display: flex; align-items: center; gap: 8px; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); font-size: 15px; }
.versions a:hover { color: var(--text); text-decoration: none; }
.versions a[aria-current] { color: var(--text); border-left-color: var(--primary); font-weight: 600; }
.versions .v { font-variant-numeric: tabular-nums; }
.versions .d { margin-left: auto; font-size: 12.5px; color: var(--faint); font-weight: 400; }
.versions .is-patch a { padding-left: 28px; font-size: 14px; }
.versions .is-hidden a { opacity: 0.35; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--border-strong); }
.dot.is-supported { background: var(--green-600); }
.legend p { font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.legend .stage { margin-right: 4px; }

/* ---------- Results + empty ---------- */
.results { margin: 28px 0 -8px; color: var(--muted); font-size: 14px; font-weight: 600; }
.empty { padding: 72px 0; text-align: center; color: var(--muted); }
.empty .reset { margin-top: 10px; }

/* ---------- Upgrade summary ---------- */
.summary { margin-top: 32px; padding: 28px; border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); background: var(--bg-elev); box-shadow: var(--shadow); }
.summary-kicker { font: 700 12px var(--font-head); letter-spacing: 0.1em; text-transform: uppercase; color: var(--primary); }
.summary h2 { font-size: 26px; margin-top: 4px; }
.summary-stats { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 14px 0 0; }
.summary-stats li { padding: 4px 11px; border-radius: 999px; background: var(--surface); font-size: 14px; color: var(--text-2); }
.summary-stats strong { color: var(--text); }
.summary-stats .is-action { background: var(--c-action-bg); color: var(--c-action); }
.summary-stats .is-action strong { color: var(--c-action); }
.summary-stats .is-security { background: var(--c-security-bg); color: var(--c-security); }
.summary-stats .is-security strong { color: var(--c-security); }
.summary-block { margin-top: 22px; }
.summary-ok { margin-top: 20px; padding: 12px 16px; border-radius: 10px; background: var(--c-fixed-bg); color: var(--c-fixed); font-weight: 600; }
.summary-foot { margin-top: 20px; font-size: 14px; color: var(--muted); }
.from-version { margin-left: 8px; font: 600 12px var(--font-mono); color: var(--faint); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; white-space: nowrap; }
.from-version:hover { color: var(--primary); border-color: var(--primary); text-decoration: none; }

/* ---------- Release ---------- */
.release { padding: 44px 0 40px; border-bottom: 1px solid var(--border); }
.release:last-of-type { border-bottom: 0; }
.release-head { margin-bottom: 22px; }
.release-title { display: flex; align-items: center; gap: 8px; }
.release h2 { font-size: 34px; font-variant-numeric: tabular-nums; }
.release h2 a { color: var(--text); }
.release h2 a:hover { color: var(--primary); text-decoration: none; }
.release.is-patch { padding-top: 32px; padding-bottom: 30px; }
.release.is-patch h2 { font-size: 24px; }
.copy-link { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--faint); cursor: pointer; opacity: 0; transition: opacity 0.15s; }
.release-head:hover .copy-link, .copy-link:focus-visible { opacity: 1; }
.copy-link:hover { background: var(--surface); color: var(--text); }
.release-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 6px; color: var(--muted); font-size: 14.5px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid var(--border); }
.pill-latest { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 35%, transparent); background: var(--primary-soft); }
.pill-support::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green-600); }
.pill-support { color: var(--text-2); }
.pill-support.is-eol { color: var(--muted); }
.pill-support.is-eol::before { background: var(--faint); }
.pill-support.is-ending { color: var(--c-action); border-color: color-mix(in srgb, var(--c-action-line) 55%, transparent); background: var(--c-action-bg); }
.pill-support.is-ending::before { background: var(--c-action-line); }
.dot.is-ending { background: var(--c-action-line); }
.release-counts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.count { font-size: 13px; font-weight: 600; padding: 2px 9px; border-radius: 6px; }
.count-action { color: var(--c-action); background: var(--c-action-bg); }
.count-new { color: var(--c-new); background: var(--c-new-bg); }
.count-security { color: var(--c-security); background: var(--c-security-bg); }
.release-highlight { font-size: 18.5px; line-height: 1.55; color: var(--text); margin-bottom: 28px; max-width: 72ch; }

/* ---------- Sections + items ---------- */
.cat { margin-top: 28px; max-width: 78ch; }
.release-head + .cat, .release-highlight + .cat { margin-top: 0; }
.cat-title { display: flex; align-items: center; gap: 8px; font: 700 13px var(--font-head); letter-spacing: 0.09em; text-transform: uppercase; color: var(--cat, var(--muted)); margin-bottom: 4px; }
.cat-dot { width: 8px; height: 8px; border-radius: 2px; background: currentColor; }
.cat-n { font: 600 12px var(--font-body); letter-spacing: 0; color: var(--faint); }
.cat-action { --cat: var(--c-action); }
.cat-new { --cat: var(--c-new); }
.cat-improved { --cat: var(--c-improved); }
.cat-fixed { --cat: var(--c-fixed); }
.cat-security { --cat: var(--c-security); }
.cat-deprecated { --cat: var(--c-deprecated); }
.cat-known { --cat: var(--c-known); }
.cat > ul, .cat > ol, .summary-block > ul { list-style: none; margin: 0; padding: 0; }
.item { position: relative; padding: 11px 0; color: var(--text-2); }
.item:not([hidden]) ~ .item { border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
.item strong { color: var(--text); font-weight: 600; }
.item-tags { display: block; font-size: 12.5px; font-weight: 600; color: var(--faint); letter-spacing: 0.01em; margin-bottom: 1px; }
.item ul { margin: 6px 0 2px; padding-left: 18px; }
.item ul li { margin: 3px 0; }
.item ul li::marker { color: var(--faint); }
.stage { display: inline-block; font: 700 10.5px var(--font-head); letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-ea); background: var(--c-ea-bg); border-radius: 4px; padding: 1px 6px; vertical-align: 1.5px; white-space: nowrap; }

.cat-action, .summary-block.cat-action { padding: 16px 20px 8px; border-radius: var(--radius); background: var(--c-action-bg); border: 1px solid color-mix(in srgb, var(--c-action-line) 45%, transparent); }
.cat-action .item { color: var(--text); }
.cat-action .item:not([hidden]) ~ .item { border-top-color: color-mix(in srgb, var(--c-action-line) 30%, transparent); }

.show-more { margin: 2px 0 0; border: 0; background: none; padding: 4px 0; color: var(--primary); font-weight: 600; font-size: 14.5px; cursor: pointer; }
.show-more:hover { text-decoration: underline; }

body.is-filtering .release-counts, body.is-filtering .cat-n { display: none; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 40; background: var(--text); color: var(--bg); padding: 9px 16px; border-radius: 10px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); margin-top: 24px; color: var(--muted); font-size: 14px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-top: 26px; padding-bottom: 26px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 20px; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--text); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .sidebar { position: static; max-height: none; overflow: visible; padding: 24px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .sidebar .versions, .sidebar .legend { display: none; }
  .planner, .filters { grid-column: span 2; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
  .filters .panel-title, .filters .search-box, .filters .reset { grid-column: span 2; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .topnav { display: none; }
  .hero .wrap { padding-top: 28px; padding-bottom: 26px; }
  .lead { font-size: 16.5px; }
  .sidebar { gap: 14px; padding-top: 20px; }
  .planner { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; padding: 14px; }
  .planner .panel-title { grid-column: span 2; }
  .planner .field { margin-top: 0; }
  .filters .panel-title { display: none; }
  .filters .field { margin-top: 8px; }
  .notice-cta { width: 100%; }
  .release { padding: 32px 0 28px; }
  .release h2 { font-size: 28px; }
  .copy-link { opacity: 1; }
  .summary { padding: 20px; }
  .cat-action { padding: 14px 14px 6px; }
}

/* ---------- Print: everything expanded, no chrome ---------- */
@media print {
  .topbar, .sidebar, .copy-link, .show-more, .toast, .edition-tabs, .hero-links, .footer nav, .skip { display: none !important; }
  .layout { display: block; }
  .item[hidden] { display: block !important; }
  .release { break-inside: avoid-page; }
  body { font-size: 12pt; }
  a { color: inherit; }
}

@media (hover: none) { kbd { display: none; } }
.notice-cta:hover { text-decoration: none; color: var(--bg); }

/* ---------- Product groups ---------- */
.cat-group { margin-top: 34px; }
.release-head + .cat-group, .release-highlight + .cat-group, .cat-action + .cat-group { margin-top: 30px; }
.group-title { display: flex; align-items: baseline; gap: 8px; font: 700 19px var(--font-head); color: var(--text); padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 2px; }
.group-title .cat-n { font-size: 13px; }
.cat-group .item { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: baseline; }
.item-body > p { margin: 0; }
.item-body > p + p, .item-body > p + ul { margin-top: 6px; }
.type { justify-self: start; font: 700 11px var(--font-head); letter-spacing: 0.07em; text-transform: uppercase; padding: 2px 7px; border-radius: 5px; white-space: nowrap; color: var(--cat); background: var(--cat-bg); }
.type-new { --cat: var(--c-new); --cat-bg: var(--c-new-bg); }
.type-improved { --cat: var(--c-improved); --cat-bg: var(--c-improved-bg); }
.type-fixed { --cat: var(--c-fixed); --cat-bg: var(--c-fixed-bg); }
.type-security { --cat: var(--c-security); --cat-bg: var(--c-security-bg); }
.type-deprecated { --cat: var(--c-deprecated); --cat-bg: var(--c-deprecated-bg); }
.type-other { --cat: var(--muted); --cat-bg: var(--surface); }
.also { display: block; margin-top: 3px; font-size: 13px; color: var(--faint); }
.cat-known { margin-top: 34px; padding: 16px 20px 8px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.cat-group .show-more { margin-left: 110px; }
@media (max-width: 640px) {
  .cat-group .item { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .cat-group .show-more { margin-left: 0; }
  .cat-known { padding: 14px 14px 6px; }
}
