:root {
  --bg: #07111f;
  --surface: #0c1929;
  --surface-raised: #112238;
  --line: rgba(203, 225, 255, 0.14);
  --text: #f5f8fc;
  --muted: #9badc2;
  --accent: #63c7f5;
  --error: #ff8a83;
  --warning: #f4c966;
  --info: #71c9ff;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 85% -10%, rgba(50, 133, 190, 0.16), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
}
a { color: inherit; }
code { font-family: var(--mono); }
button, input { font: inherit; }

.site-header {
  width: min(1180px, calc(100% - 40px));
  min-height: 74px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-decoration: none;
}
.brand span { color: var(--accent); }
.site-header nav { display: flex; gap: 1.75rem; }
.site-header nav a {
  color: var(--muted);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 160ms ease;
}
.site-header nav a:hover,
.site-header nav a[aria-current="page"] { color: var(--text); }

main {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto;
}
.breadcrumbs {
  display: flex;
  gap: .65rem;
  padding: 2rem 0 0;
  color: var(--muted);
  font-size: .82rem;
}
.breadcrumbs a { text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); }

.notice-hero { padding: clamp(3.8rem, 9vw, 7.5rem) 0 4rem; }
.eyebrow {
  display: flex;
  align-items: center;
  gap: .85rem;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.severity {
  display: inline-flex;
  width: max-content;
  padding: .2rem .55rem;
  border: 1px solid currentColor;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .07em;
}
.severity.error { color: var(--error); background: rgba(255, 98, 91, .08); }
.severity.warning { color: var(--warning); background: rgba(244, 201, 102, .08); }
.severity.info { color: var(--info); background: rgba(113, 201, 255, .08); }
.notice-hero h1,
.index-intro h1 {
  max-width: 880px;
  margin: 1.2rem 0 1.5rem;
  font-size: clamp(2.35rem, 6.2vw, 5.4rem);
  line-height: .99;
  letter-spacing: -.055em;
}
.code-line {
  display: flex;
  align-items: center;
  gap: .8rem;
}
.code-line code {
  color: var(--accent);
  font-size: clamp(.9rem, 2vw, 1.05rem);
  overflow-wrap: anywhere;
}
.copy-button {
  padding: .4rem .65rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.copy-button:hover { border-color: var(--accent); color: var(--text); }
.fact-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 4rem 0 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.fact-strip div { padding: 1rem 1.25rem; border-right: 1px solid var(--line); }
.fact-strip div:first-child { padding-left: 0; }
.fact-strip div:last-child { border-right: 0; }
.fact-strip dt {
  color: var(--muted);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.fact-strip dd { margin: .18rem 0 0; font-weight: 700; }

.article-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 760px);
  gap: clamp(3rem, 8vw, 8rem);
  padding: 2rem 0 7rem;
  align-items: start;
}
.on-this-page {
  position: sticky;
  top: 1.5rem;
  display: grid;
  gap: .55rem;
  padding-top: 4rem;
}
.on-this-page p {
  margin: 0 0 .35rem;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.on-this-page a {
  color: var(--muted);
  font-size: .82rem;
  text-decoration: none;
}
.on-this-page a:hover { color: var(--accent); }
article section {
  padding: 4rem 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 2rem;
}
.section-kicker {
  margin: 0 0 .6rem;
  color: var(--accent);
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
article h2 {
  margin: 0 0 1.3rem;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -.035em;
}
article h3 { margin: 0 0 .8rem; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
article p { max-width: 68ch; color: #c7d3e2; }
article code { color: #bfeaff; }

.file-list,
.reference-list { display: grid; margin: 1.5rem 0 2rem; padding: 0; list-style: none; }
.file-list li,
.reference-list li { border-top: 1px solid var(--line); }
.file-list li:last-child,
.reference-list li:last-child { border-bottom: 1px solid var(--line); }
.file-list a,
.reference-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 0;
  text-decoration: none;
}
.file-list a::after,
.reference-list a::after { content: "↗"; color: var(--accent); }
.file-list span,
.reference-list span { margin-left: auto; color: var(--muted); font-size: .78rem; }
.reference-list a { display: grid; grid-template-columns: 1fr auto 18px; }
.reference-list a::after { grid-column: 3; grid-row: 1 / span 2; }
.reference-list span { margin: 0; }

.table-wrap { margin-top: 2rem; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th {
  padding: .7rem .8rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: .68rem;
  letter-spacing: .07em;
  text-align: left;
  text-transform: uppercase;
}
td { padding: .85rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
td:nth-child(2) { color: var(--muted); font-family: var(--mono); font-size: .76rem; }

.steps { display: grid; gap: 0; margin: 2rem 0 0; padding: 0; list-style: none; }
.steps li {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 1rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
}
.steps li > span { color: var(--accent); font-family: var(--mono); }
.steps strong { display: block; margin-bottom: .2rem; }
.steps p { margin: 0; color: var(--muted); font-size: .88rem; }

.example-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.example-grid > div { min-width: 0; }
pre {
  min-height: 100%;
  margin: 0;
  padding: 1.2rem;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #050c15;
}
pre code { color: #d4e2f2; font-size: .76rem; line-height: 1.6; }
.example-note { color: var(--muted); font-size: .8rem; }
.related-list { display: grid; }
.related-list a {
  display: grid;
  grid-template-columns: minmax(12rem, .8fr) 1.2fr;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
}
.related-list a:last-child { border-bottom: 1px solid var(--line); }
.related-list a:hover code { color: var(--accent); }
.related-list span { color: var(--muted); font-size: .85rem; }

.notice-index { min-height: 80vh; }
.index-intro { padding: clamp(4rem, 10vw, 8rem) 0 3.5rem; }
.index-intro > p:not(.section-kicker) { max-width: 700px; color: var(--muted); font-size: 1.05rem; }
.index-controls { display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; margin-top: 3rem; align-items: end; }
.index-controls label { display: grid; gap: .45rem; }
.index-controls label span { color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.index-controls input {
  width: 100%;
  padding: .9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  outline: none;
  background: var(--surface);
  color: var(--text);
}
.index-controls input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99, 199, 245, .12); }
.severity-filters { display: flex; gap: .45rem; flex-wrap: wrap; }
.severity-filters button {
  padding: .78rem .85rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.severity-filters button:hover,
.severity-filters button.active { border-color: var(--accent); color: var(--text); }
.severity-filters span { color: var(--accent); font-family: var(--mono); font-size: .72rem; }
.notice-directory { padding-bottom: 7rem; }
.directory-head,
.notice-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 230px;
  gap: 1rem;
  align-items: center;
}
.directory-head {
  padding: .7rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.notice-row {
  min-height: 76px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background 160ms ease, padding 160ms ease;
}
.notice-row[hidden] { display: none; }
.notice-row:hover { margin: 0 -.8rem; padding: 0 .8rem; background: var(--surface); }
.notice-row > span:nth-child(2) { display: grid; }
.notice-row code { color: var(--accent); font-size: .78rem; }
.notice-row strong { font-size: .88rem; font-weight: 600; }
.notice-row > span:last-child { color: var(--muted); font-family: var(--mono); font-size: .7rem; }
#no-results { padding: 2rem 0; color: var(--muted); }

footer {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto;
  padding: 2.5rem 0;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
}
footer p { margin: .3rem 0 0; color: var(--muted); font-size: .8rem; }
footer > div:last-child { display: flex; gap: 1.4rem; align-items: center; }
footer > div:last-child a { color: var(--muted); font-size: .8rem; text-decoration: none; }
footer > div:last-child a:hover { color: var(--text); }

/* Compatibility page ------------------------------------------------------- */

.compat { min-height: 80vh; padding-bottom: 6rem; }
.compat-baseline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 0 0 1rem;
}
.baseline-card {
  padding: 1.35rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.baseline-card p { margin: 0; }
.baseline-label {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.baseline-value { margin-top: .55rem; font-size: .95rem; word-break: break-word; }
.baseline-value code { color: var(--accent); font-size: .85rem; }
.baseline-value a { text-decoration: none; }
.baseline-value a:hover code { text-decoration: underline; }
.baseline-meta { margin-top: .35rem; color: var(--muted); font-size: .78rem; }

.compat-section { padding: 3rem 0 0; }
.compat-section h2 { font-size: 1.5rem; letter-spacing: -0.02em; }
.compat-section h3 { margin: 2rem 0 .35rem; font-size: 1rem; }
.compat-section h3 .count {
  margin-left: .5rem;
  color: var(--accent);
  font-family: var(--mono);
  font-size: .75rem;
  font-weight: 500;
}
.compat-section > p { max-width: 760px; color: var(--muted); }
.compat-section pre {
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow-x: auto;
  background: var(--surface);
}
.compat-section pre code { color: var(--accent); font-size: .82rem; }
.category-blurb { max-width: 760px; margin: 0 0 1rem; color: var(--muted); font-size: .88rem; }
.compat-note, .compat-empty { max-width: 760px; color: var(--muted); font-size: .88rem; }
.compat-empty { padding: 1rem 1.1rem; border: 1px dashed var(--line); border-radius: 6px; }

.change-list { display: grid; gap: .85rem; }
.change-card {
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.change-card p { margin: .45rem 0 0; font-size: .9rem; }
.change-head {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: baseline;
  justify-content: space-between;
}
.change-id { margin: 0; font-size: .9rem; font-weight: 600; }
.change-head code { color: var(--accent); font-size: .82rem; }
.change-badges { display: flex; flex-wrap: wrap; gap: .4rem; }
.change-title { font-weight: 600; }
.change-summary { color: var(--muted); }
.change-notices { color: var(--muted); font-size: .82rem; }
.change-notices code { color: var(--accent); font-size: .76rem; }
.change-source { color: var(--muted); font-size: .78rem; }
.change-source a { color: var(--accent); }

.status, .badge {
  padding: .2rem .55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.status code { font-size: .68rem; text-transform: none; }
.status.supported { border-color: rgba(113, 201, 255, .5); color: var(--info); }
.status.accepted { border-color: rgba(244, 201, 102, .45); color: var(--warning); }
.status.unsupported { border-color: rgba(255, 138, 131, .5); color: var(--error); }
.status.planned { border-color: rgba(99, 199, 245, .4); color: var(--accent); }
/* Not a status: the flag the behaviour is gated behind, and the release that
   gained it. Kept deliberately quiet so they read as context, not as verdicts. */
.status.flag, .status.version { border-style: dashed; }
.badge.guru { border-color: rgba(99, 199, 245, .4); color: var(--accent); }
.badge.deprecated { border-color: rgba(244, 201, 102, .45); color: var(--warning); }

/* The correspondence table reuses .notice-row, so only its last column, which
   carries a badge rather than a filename, needs a different treatment. */
.compat-row > span:last-child { font-family: var(--sans); font-size: .72rem; }
.compat-row > span:last-child a { color: var(--accent); }

.table-scroll { overflow-x: auto; margin-top: 1rem; }
.compat-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.compat-table th, .compat-table td {
  padding: .7rem .9rem .7rem 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.compat-table th {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.compat-table td { color: var(--muted); }
.compat-table td:first-child { color: var(--text); white-space: nowrap; }
.compat-table code { color: var(--accent); font-size: .78rem; }
.compat-table a { color: var(--accent); }

@media (max-width: 820px) {
  .compat-baseline { grid-template-columns: 1fr; }
  .compat-head { display: none; }
}

@media (max-width: 820px) {
  .site-header nav a:first-child { display: none; }
  .fact-strip { grid-template-columns: 1fr 1fr; }
  .fact-strip div:nth-child(2) { border-right: 0; }
  .fact-strip div:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .fact-strip div:nth-child(3) { padding-left: 0; }
  .article-layout { display: block; }
  .on-this-page { display: none; }
  .index-controls { grid-template-columns: 1fr; }
  .directory-head { display: none; }
  .notice-row { grid-template-columns: 86px 1fr; padding: .75rem 0; }
  .notice-row > span:last-child { grid-column: 2; }
}

@media (max-width: 560px) {
  .site-header, main, footer { width: min(100% - 28px, 1100px); }
  .site-header nav { gap: 1rem; }
  .site-header nav a { font-size: .78rem; }
  .notice-hero h1, .index-intro h1 { font-size: clamp(2.25rem, 12vw, 3.4rem); }
  .fact-strip { grid-template-columns: 1fr; }
  .fact-strip div { padding-left: 0; border-right: 0; border-top: 1px solid var(--line); }
  .fact-strip div:first-child { border-top: 0; }
  .example-grid { grid-template-columns: 1fr; }
  .file-list a { align-items: flex-start; }
  .file-list span { display: none; }
  .related-list a { grid-template-columns: 1fr; gap: .25rem; }
  .severity-filters button { flex: 1; }
  .notice-row { grid-template-columns: 1fr; gap: .35rem; }
  .notice-row > span:last-child { grid-column: 1; }
  footer { display: grid; gap: 1.5rem; }
  footer > div:last-child { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}

/* Common causes: the list a reader scans to recognise their own situation. */
.cause-list { display: grid; gap: .6rem; margin: 1.25rem 0 0; padding: 0 0 0 1.1rem; }
.cause-list li { color: var(--muted); line-height: 1.6; }
.cause-list li::marker { color: var(--accent); }

.cross-check {
  margin: 1.25rem 0 0;
  padding: .85rem 1rem;
  border-left: 2px solid var(--accent);
  background: rgba(99, 199, 245, .07);
  color: var(--muted);
  line-height: 1.6;
}
.cross-check strong { color: var(--text); }

/* The repair that silences the notice without fixing the data. It is called
   out rather than buried, because it is usually the easier of the two. */
.pitfall {
  margin: 1.5rem 0 0;
  padding: .85rem 1rem;
  border-left: 2px solid var(--warning);
  background: rgba(244, 201, 102, .08);
  color: var(--muted);
  line-height: 1.6;
}
.pitfall strong { color: var(--warning); }

/* Step 3 says "validate again"; this is the way back to the validator. */
.revalidate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .9rem;
  margin: 1.75rem 0 0;
}
.revalidate span { color: var(--muted); font-size: .8rem; }
.revalidate-link {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .6rem 1.1rem;
  border-radius: 8px;
  background: var(--accent);
  color: #05131f;
  font-weight: 650;
  font-size: .9rem;
  text-decoration: none;
}
.revalidate-link::after { content: "→"; }
.revalidate-link:hover { filter: brightness(1.08); }
