.format-main code,
.format-page pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.format-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
  align-items: center;
  gap: clamp(54px, 8vw, 112px);
  padding: 92px 0 104px;
  border-bottom: 1px solid var(--line-strong);
}

.format-intro { max-width: 700px; }

.format-kicker,
.section-label {
  margin: 0 0 18px;
  padding-left: 12px;
  color: var(--muted);
  border-left: 3px solid var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.format-hero h1 {
  max-width: 780px;
  margin-bottom: 26px;
  font-size: clamp(50px, 7vw, 88px);
}

.format-lead {
  max-width: 700px;
  margin-bottom: 40px;
  color: var(--ink-soft);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.55;
}

.format-lead code {
  padding: 0.08em 0.28em;
  background: var(--surface-muted);
  font-size: 0.82em;
}

.format-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0;
}

.format-counts div {
  min-width: 124px;
  padding: 0 26px;
  border-left: 1px solid var(--line-strong);
}

.format-counts div:first-child { padding-left: 0; border-left: 0; }
.format-counts dt { font-size: 30px; font-weight: 700; letter-spacing: -0.04em; }
.format-counts dd { margin: 0; color: var(--muted); font-size: 13px; }

.package-map {
  overflow: hidden;
  color: #e9ece9;
  background: var(--dark);
  border: 1px solid #111411;
  border-top: 3px solid var(--accent);
}

.package-map-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 18px;
  border-bottom: 1px solid #424745;
  font-size: 13px;
  font-weight: 650;
}

.package-map-heading code { color: #adb4af; font-size: 10px; font-weight: 400; }

.package-map pre {
  margin: 0;
  padding: 28px 28px 24px;
  color: #bfc5c1;
  font-size: 13px;
  line-height: 1.8;
}

.package-map pre span { color: #ff8a70; }
.package-map pre b { color: white; font-weight: 600; }
.package-map > p { margin: 0; padding: 16px 18px; color: #aeb5b0; border-top: 1px solid #424745; font-size: 12px; }

.format-principles {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1.18fr);
  gap: clamp(48px, 9vw, 130px);
  padding: 112px 0 116px;
  border-bottom: 1px solid var(--line-strong);
}

.format-principles h2,
.row-anatomy h2,
.native-gallery h2,
.row-reference h2 {
  margin-bottom: 0;
  font-size: clamp(38px, 4.8vw, 60px);
}

.principle-list article {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 16px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.principle-list article:last-child { border-bottom: 1px solid var(--line); }
.principle-list article > span { color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.principle-list h3 { margin-bottom: 5px; font-size: 17px; }
.principle-list p { margin: 0; color: var(--muted); }
.principle-list code { color: var(--ink); font-size: 0.88em; }

.row-anatomy {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(420px, 1.18fr);
  gap: clamp(48px, 9vw, 130px);
  align-items: center;
  padding: 104px 0;
  border-bottom: 1px solid var(--line-strong);
}

.anatomy-copy > p:not(.section-label) { max-width: 610px; margin-top: 24px; color: var(--muted); }
.anatomy-copy code { color: var(--ink); font-size: 0.88em; }
.anatomy-copy .reference-note { padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; }

.row-example {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line-strong);
}

.row-example-preview {
  padding: 34px 32px;
  background: var(--surface-muted);
}

.row-example-preview span {
  display: block;
  padding: 15px 17px;
  background: white;
  border: 1px solid rgba(25, 28, 26, 0.18);
  font-size: 16px;
  font-weight: 650;
}

.row-example pre {
  max-height: 330px;
  overflow: auto;
  margin: 0;
  padding: 24px 26px;
  color: #dce1dd;
  background: var(--dark);
  font-size: 12px;
  line-height: 1.65;
}

.native-gallery {
  padding: 104px 0 112px;
  border-bottom: 1px solid var(--line-strong);
}

.native-gallery-heading {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.1fr);
  gap: clamp(48px, 9vw, 130px);
  align-items: end;
  margin-bottom: 54px;
}

.native-gallery-heading p:not(.section-label) {
  max-width: 620px;
  margin-bottom: 18px;
  color: var(--muted);
}

.native-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 34px);
}

.native-gallery figure { min-width: 0; margin: 0; }

.native-gallery figure:nth-child(2) { padding-top: 54px; }

.native-gallery img {
  width: 100%;
  height: auto;
  background: #eef8f4;
  border: 1px solid var(--line-strong);
}

.native-gallery figcaption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  border-top: 2px solid var(--ink);
  font-size: 13px;
}

.native-gallery figcaption span { color: var(--muted); text-align: right; }

.row-reference { padding: 104px 0 118px; }

.reference-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 42px;
}

.reference-heading > div > p:last-child { max-width: 680px; margin: 20px 0 0; color: var(--muted); }

.reference-links {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 24px;
}

.registry-link {
  flex: 0 0 auto;
  padding: 11px 0;
  border-bottom: 1px solid var(--accent);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.registry-link span { margin-left: 8px; }

.reference-controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 210px 210px;
  gap: 12px;
  padding: 18px 0;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.reference-controls label > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.reference-controls input,
.reference-controls select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  outline: none;
  font: inherit;
}

.reference-controls input:focus,
.reference-controls select:focus { box-shadow: inset 0 0 0 2px var(--ink); }

.support-key {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 54px;
  color: var(--muted);
  font-size: 12px;
}

.support-key > span { display: inline-flex; align-items: center; gap: 7px; }
.support-key .results-count { margin-left: auto; color: var(--ink); font-weight: 650; }

.registry-table-wrap { border-top: 1px solid var(--line-strong); }
.registry-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.registry-table th, .registry-table td { border-bottom: 1px solid var(--line); text-align: left; }
.registry-table thead th { padding: 13px 12px; color: var(--muted); font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; }
.registry-table thead th:first-child { width: 56%; padding-left: 0; }
.registry-table thead th:nth-child(2) { width: 20%; }
.registry-table thead th:nth-child(n + 3) { width: 12%; text-align: center; }
.registry-table tbody th { padding: 18px 20px 18px 0; font-weight: 400; }
.registry-table tbody td { padding: 18px 12px; }
.registry-table tbody tr:hover { background: var(--surface); }

.row-name { display: inline; margin-right: 10px; font-size: 15px; font-weight: 700; }
.registry-table tbody th code { display: inline; color: #3f4843; font-size: 11px; }
.registry-table tbody th small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; font-weight: 400; }
.category-cell { color: var(--muted); font-size: 13px; }
.support-cell { text-align: center !important; }

.support-mark {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  color: #909692;
  border: 1px solid var(--line);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.support-mark.is-supported { color: #fff; background: var(--accent); border-color: var(--accent-hover); }
.registry-error, .empty-results { margin: 0; padding: 28px 0; color: var(--muted); border-bottom: 1px solid var(--line); }
.registry-error { color: #9a2f1d; }

@media (max-width: 980px) {
  .format-hero,
  .format-principles,
  .row-anatomy,
  .native-gallery-heading { grid-template-columns: 1fr; }
  .format-hero { align-items: start; }
  .package-map { width: min(650px, calc(100% - 16px)); }
  .format-principles,
  .row-anatomy,
  .native-gallery-heading { gap: 52px; }
  .native-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .native-gallery figure:nth-child(2) { padding-top: 0; }
  .native-gallery figure:last-child { grid-column: 1 / -1; width: calc(50% - 9px); }
  .reference-controls { grid-template-columns: 1fr 1fr; }
  .search-control { grid-column: 1 / -1; }
  .registry-table thead th:first-child { width: 50%; }
  .registry-table thead th:nth-child(2) { width: 20%; }
  .registry-table thead th:nth-child(n + 3) { width: 15%; }
}

@media (max-width: 680px) {
  .format-hero { gap: 54px; padding: 56px 0 72px; }
  .format-hero h1 { font-size: clamp(46px, 14vw, 64px); }
  .format-counts { gap: 20px 0; }
  .format-counts div { min-width: 50%; padding: 0 18px; }
  .format-counts div:nth-child(3) { padding-left: 0; border-left: 0; }
  .package-map { width: 100%; }
  .package-map-heading { align-items: start; flex-direction: column; gap: 4px; }
  .package-map pre { padding: 22px 18px; font-size: 11px; }
  .format-principles,
  .row-anatomy,
  .native-gallery,
  .row-reference { padding: 76px 0; }
  .row-anatomy { grid-template-columns: minmax(0, 1fr); }
  .row-example-preview { padding: 24px 18px; }
  .row-example pre { padding: 20px 18px; font-size: 10px; }
  .native-gallery-heading { margin-bottom: 34px; }
  .native-gallery-grid { grid-template-columns: 1fr; gap: 34px; }
  .native-gallery figure:last-child { grid-column: auto; width: 100%; }
  .native-gallery figcaption { align-items: start; flex-direction: column; gap: 2px; }
  .native-gallery figcaption span { text-align: left; }
  .reference-heading { align-items: start; flex-direction: column; gap: 24px; }
  .reference-links { align-items: start; flex-direction: column; gap: 8px; }
  .reference-controls { grid-template-columns: 1fr; padding: 14px 0; }
  .search-control { grid-column: auto; }
  .support-key { align-items: flex-start; flex-wrap: wrap; padding: 14px 0; }
  .support-key .results-count { width: 100%; margin-left: 0; }
  .registry-table,
  .registry-table tbody,
  .registry-table tr,
  .registry-table th,
  .registry-table td { display: block; }
  .registry-table thead { display: none; }
  .registry-table tbody tr {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 18px 0;
    border-bottom: 1px solid var(--line-strong);
  }
  .registry-table th,
  .registry-table td { border: 0; }
  .registry-table tbody th { grid-column: 1 / -1; padding: 0 0 16px; }
  .registry-table tbody td { padding: 0; }
  .category-cell,
  .support-cell { text-align: left !important; }
  .category-cell::before,
  .support-cell::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .category-cell { padding-right: 8px !important; font-size: 11px; }
  .format-footer nav { flex-wrap: wrap; }
}
