/* ROM index — public styles. Workbench palette: ESD-mat blue, parts-label yellow. */
:root {
  --mat: #2c5a7a;
  --mat-ink: #ffffff;
  --label: #f3c63f;
  --label-ink: #2a2206;
  --bg: #f3f6f8;
  --ink: #17212b;
  --muted: #5b6977;
  --paper: #ffffff;
  --wash: #eef2f5;
  --line: #dde4ea;
  --line-strong: #b9c4ce;
  --link: #1f5f8b;
  --hero: #16324a;
  --hero-ink: #ffffff;
  --hero-muted: #b9cbdb;
  --tile: #ffffff;
  --shadow: 0 1px 2px rgba(16, 30, 45, .05), 0 6px 18px rgba(16, 30, 45, .06);
  --shadow-hover: 0 2px 4px rgba(16, 30, 45, .07), 0 12px 28px rgba(16, 30, 45, .11);
  --ok: #23774b;
  --ok-bg: #e3f3ea;
  --no: #9a3b30;
  --no-bg: #f7e7e4;
  --warn-bg: #fff6d9;
  --focus: #1b73e8;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r-s: 6px;
  --r-m: 10px;
  --r-l: 16px;
  --wrap: 1180px;
  color-scheme: light;
}
/* dark: only when the visitor picks it with the switch; light is the default */

:root[data-theme="dark"] {
  --bg: #0c141b; --ink: #e6edf3; --muted: #9aabba; --paper: #131f29; --wash: #1a2834; --line: #243645; --line-strong: #36506a;
  --link: #8cc0e6; --hero: #10283b; --hero-muted: #9fb7cc; --tile: #ffffff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-hover: 0 4px 18px rgba(0, 0, 0, .45);
  --ok: #6fd39d; --ok-bg: #133625; --no: #f19a8d; --no-bg: #3a1c18; --warn-bg: #3a3112; --focus: #79b2ff;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 16px/1.55 var(--sans);
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
code, .mono { font-family: var(--mono); font-size: .92em; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.4rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.lead { font-size: 1.08rem; color: var(--muted); max-width: 70ch; }
.block { margin-top: 40px; margin-bottom: 40px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.block-head > a { white-space: nowrap; flex-shrink: 0; }
.wrap-any { overflow-wrap: anywhere; word-break: break-all; }

/* ---------- header ---------- */
.site-head { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 20; }
.head-row { display: flex; align-items: center; gap: 18px; min-height: 60px; }
.logo { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.08rem; white-space: nowrap; }
.logo-mark { width: 28px; height: 28px; color: var(--link); }
.logo-dark { display: none !important; }
:root[data-theme="dark"] .logo-dark { display: block !important; }
:root[data-theme="dark"] .logo-light { display: none !important; }

.theme-btn { display: inline-grid; place-items: center; width: 36px; height: 34px; border: 1px solid var(--line-strong); border-radius: var(--r-s); background: transparent; color: var(--ink); cursor: pointer; padding: 0; }
.theme-btn:hover { border-color: var(--ink); }
.theme-btn svg { width: 18px; height: 18px; }
.theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: block; }
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }

.logo-img { display: block; height: 34px; width: auto; }
@media (max-width: 860px) { .logo-img { height: 30px; } }
.head-search { flex: 1; max-width: 460px; }
.head-search input { width: 100%; height: 38px; border: 1px solid var(--line-strong); border-radius: var(--r-s); padding: 0 12px; font: inherit; font-size: .95rem; background: var(--wash); color: var(--ink); }
.head-nav { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.head-nav > a, .dropdown > summary { color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem; cursor: pointer; }
.head-nav > a:hover, .dropdown > summary:hover { color: var(--link); }
.dropdown { position: relative; }
.dropdown > summary { list-style: none; padding: 6px 0; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown > summary::after { content: ""; display: inline-block; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); margin-left: 8px; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 8px); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-m); padding: 6px; min-width: 190px; box-shadow: 0 10px 30px rgba(10, 25, 40, .14); z-index: 30; display: grid; }
.dropdown-menu a { padding: 8px 10px; border-radius: var(--r-s); color: var(--ink); text-decoration: none; }
.dropdown-menu a:hover, .dropdown-menu a[aria-current] { background: var(--wash); }
.brands-menu { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
.head-tools { display: flex; align-items: center; gap: 8px; }
.lang-switch > summary { font-family: var(--mono); font-size: .85rem; border: 1px solid var(--line-strong); border-radius: var(--r-s); padding: 4px 8px; }
@media (max-width: 860px) {
  .head-row { flex-wrap: wrap; gap: 8px 12px; padding-top: 10px; }
  .logo { order: 1; }
  .head-tools { order: 2; margin-left: auto; }
  .head-search { order: 3; flex-basis: 100%; max-width: none; }
  .head-nav { order: 4; flex-basis: 100%; margin: 0; gap: 18px; overflow-x: auto; padding: 2px 0 8px; flex-wrap: nowrap; gap: 14px; scrollbar-width: none; }
  .head-nav::-webkit-scrollbar { display: none; }
  .head-nav > a, .dropdown > summary { white-space: nowrap; font-size: .9rem; }
  .head-nav .dropdown { position: static; }
  .head-nav .dropdown-menu { left: 12px; right: 12px; }
  .logo span { max-width: 60vw; overflow: hidden; text-overflow: ellipsis; }
  .site-head { position: static; }
}

/* ---------- breadcrumbs ---------- */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 0; padding: 14px 0 0; margin: 0; font-size: .875rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin: 0 8px; color: var(--line-strong); }
.crumbs a { color: var(--muted); }

/* ---------- hero & search ---------- */
.hero { background: var(--wash); border-bottom: 1px solid var(--line); padding: 56px 0 44px; }
.hero h1 { max-width: 20ch; }
.hero-sub { color: var(--muted); font-size: 1.05rem; }
.big-search { display: flex; gap: 0; max-width: 720px; margin: 20px 0 12px; }
.big-search input { flex: 1; min-width: 0; height: 56px; border: 2px solid var(--ink); border-right: 0; border-radius: var(--r-m) 0 0 var(--r-m); padding: 0 18px; font: inherit; font-size: 1.08rem; background: var(--paper); color: var(--ink); }
.big-search button { height: 56px; border: 0; padding: 0 26px; border-radius: 0 var(--r-m) var(--r-m) 0; background: var(--ink); color: var(--paper); font: 600 1rem var(--sans); cursor: pointer; }
.big-search button:hover { background: var(--mat); color: var(--mat-ink); }
.examples { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); font-size: .9rem; margin: 0; }
.examples a { font-family: var(--mono); font-size: .85rem; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; text-decoration: none; color: var(--ink); }
.examples a:hover { border-color: var(--link); }
.page-head { padding-top: 22px; }
.page-head .big-search { margin-top: 16px; }

/* search suggestions */
.suggest { position: absolute; z-index: 40; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: 0 12px 30px rgba(10, 25, 40, .16); max-height: 70vh; overflow: auto; padding: 4px; }
.suggest a { display: block; padding: 8px 10px; border-radius: var(--r-s); color: var(--ink); text-decoration: none; }
.suggest a:hover, .suggest a.is-active { background: var(--wash); }
.suggest .s-sub { display: block; font-size: .8rem; color: var(--muted); }
.suggest .s-f { font-family: var(--mono); font-size: .9rem; }
.suggest .s-empty { padding: 10px; color: var(--muted); font-size: .9rem; }

/* ---------- brands ---------- */
.brand-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.brand-grid a { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-m); text-decoration: none; color: var(--ink); background: var(--paper); }
.brand-grid a:hover { border-color: var(--link); }
.brand-grid img { grid-row: span 2; }
.brand-grid strong { font-size: 1.05rem; }
.brand-grid span { font-size: .82rem; color: var(--muted); grid-column: 2; }
.brand-grid a:not(:has(img)) { grid-template-columns: 1fr; }
.brand-grid a:not(:has(img)) span { grid-column: 1; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 24px; } }

/* firmware list rows */
.fw-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.fw-list li { border-bottom: 1px solid var(--line); }
.fw-list a { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 11px 4px; text-decoration: none; color: var(--ink); }
.fw-list a:hover { background: var(--wash); }
.fw-dev { font-weight: 500; }
.fw-ver { color: var(--link); overflow-wrap: anywhere; }
.fw-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .82rem; color: var(--muted); align-items: center; }

.popular { margin: 0 0 28px; padding: 0 0 0 1.4em; }
.popular li { margin: 0 0 10px; }
.popular a { text-decoration: none; color: var(--ink); display: grid; }
.popular code { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.facts { background: var(--wash); border-radius: var(--r-m); padding: 18px 20px; }
.facts p { font-size: .95rem; }
.facts h2 { font-size: 1.1rem; }

/* ---------- brand page ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: end; margin: 18px 0 22px; }
.filter-bar input[type=search], .filter-bar select { height: 40px; border: 1px solid var(--line-strong); border-radius: var(--r-s); padding: 0 10px; font: inherit; font-size: .95rem; background: var(--paper); color: var(--ink); }
.filter-bar > input[type=search] { flex: 1 1 280px; max-width: 420px; }
.filter-bar label { display: grid; gap: 4px; font-size: .8rem; color: var(--muted); font-weight: 500; }
.filter-bar label.grow { flex: 1 1 200px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); border-radius: 999px; padding: 6px 12px; font: 500 .88rem var(--sans); cursor: pointer; }
.chip.is-on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.cat-group { margin: 0 0 30px; }
.cat-group h2 .count { color: var(--muted); font-weight: 400; font-size: .9rem; }
.model-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0 28px; }
.model-list li { border-bottom: 1px solid var(--line); }
.model-list a { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; padding: 11px 2px; text-decoration: none; color: var(--ink); align-items: center; }
.model-list a:hover .ml-name { color: var(--link); text-decoration: underline; }
.model-list img { grid-row: span 3; width: 40px; height: 40px; object-fit: contain; }
.model-list a:not(:has(img)) { grid-template-columns: 1fr; }
.ml-name { font-weight: 500; }
.ml-codes { font-size: .78rem; color: var(--muted); overflow-wrap: anywhere; }
.ml-meta { font-size: .8rem; color: var(--muted); }
.guide-links { padding-left: 1.2em; }
.guide-links li { margin-bottom: 8px; }
.empty-filter { color: var(--muted); padding: 20px 0; }

/* ---------- model page ---------- */
.specs-source { margin-top: 18px; }
.spec-row { display: flex; flex-wrap: wrap; gap: 14px 30px; margin: 16px 0 0; }
.spec-row dt { font-size: .78rem; color: var(--muted); }
.spec-row dd { margin: 0; font-weight: 500; }
.latest-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.latest-cards a { display: grid; gap: 4px; border: 1px solid var(--line); border-left: 4px solid var(--mat); border-radius: var(--r-s); padding: 12px 14px; text-decoration: none; color: var(--ink); }
.latest-cards a:hover { border-color: var(--link); }
.latest-cards code { font-size: .95rem; overflow-wrap: anywhere; color: var(--ink); }
.latest-cards .muted { font-size: .82rem; }
.lc-tag { font-size: .8rem; font-weight: 600; color: var(--muted); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-m); }
.fw-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.fw-table th, .fw-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.fw-table thead th { background: var(--wash); font-size: .8rem; font-weight: 600; color: var(--muted); position: sticky; top: 0; white-space: nowrap; }
.fw-table tbody th { font-weight: 400; }
.fw-table tbody th code { overflow-wrap: anywhere; }
.fw-table tbody tr:hover { background: var(--wash); }
.fw-table tbody tr:last-child > * { border-bottom: 0; }
.fw-table .num { text-align: right; white-space: nowrap; }
.fw-table td { white-space: nowrap; }
.fw-table .small { display: block; }
@media (max-width: 760px) {
  .table-wrap { border: 0; overflow: visible; }
  .fw-table thead { display: none; }
  .fw-table, .fw-table tbody, .fw-table tr, .fw-table th, .fw-table td { display: block; }
  .fw-table tr { border: 1px solid var(--line); border-radius: var(--r-m); margin-bottom: 10px; padding: 8px 12px; }
  .fw-table th, .fw-table td { border: 0; padding: 3px 0; white-space: normal; }
  .fw-table td { display: flex; justify-content: space-between; gap: 12px; font-size: .88rem; }
  .fw-table td::before { content: attr(data-label); color: var(--muted); }
  .fw-table td:empty { display: none; }
  .fw-table .num { text-align: left; }
}
.pill { display: inline-block; font-size: .72rem; border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 7px; margin-left: 6px; color: var(--muted); vertical-align: 1px; }
.sign { display: inline-block; font-size: .76rem; font-weight: 600; border-radius: var(--r-s); padding: 1px 7px; }
.sign-yes { background: var(--ok-bg); color: var(--ok); }
.sign-no { background: var(--no-bg); color: var(--no); }
.specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px 32px; }
.specs dl { display: grid; grid-template-columns: 120px 1fr; gap: 4px 12px; margin: 0; font-size: .9rem; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; }

/* ---------- firmware page: the label ---------- */
.fw-page { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; padding-top: 22px; }
@media (max-width: 960px) { .fw-page { grid-template-columns: 1fr; gap: 0; } }
.fw-side { padding-top: 4px; }
.label-card {
  position: relative;
  border: 2px solid var(--ink);
  border-radius: var(--r-m);
  padding: 18px 22px 18px 36px;
  background:
    linear-gradient(90deg, var(--label) 0 14px, transparent 14px),
    var(--paper);
}
.label-card::after {
  /* perforation on the yellow band */
  content: ""; position: absolute; left: 5px; top: 10px; bottom: 10px; width: 4px;
  background: radial-gradient(circle, var(--paper) 1.5px, transparent 1.6px) 0 0 / 4px 10px repeat-y;
  opacity: .9;
}
.label-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.label-device { font-weight: 600; font-size: 1.02rem; }
.label-version { display: flex; align-items: center; gap: 12px; margin: 10px 0 8px; flex-wrap: wrap; }
.label-version code { font-size: clamp(1.25rem, .9rem + 1.6vw, 2rem); font-weight: 600; letter-spacing: -.01em; overflow-wrap: anywhere; line-height: 1.15; }
.label-codes, .label-os { margin: 0; color: var(--muted); font-size: .92rem; }
.label-codes code { color: var(--ink); }
.label-os { margin-top: 4px; font-weight: 500; color: var(--ink); }
.small-label .label-version code { font-size: 1.3rem; }
.copy { border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); font: 500 .78rem var(--sans); border-radius: var(--r-s); padding: 4px 9px; cursor: pointer; }
.copy:hover { border-color: var(--ink); }
.copy.is-done { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.notice { background: var(--wash); border-left: 4px solid var(--mat); padding: 10px 14px; border-radius: var(--r-s); margin: 16px 0 0; }
.notice-warn { background: var(--warn-bg); border-left-color: var(--label); }
.dl-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin: 22px 0 6px; }
.btn-dl { display: inline-flex; align-items: baseline; gap: 10px; background: var(--mat); color: var(--mat-ink) !important; text-decoration: none; font-weight: 600; font-size: 1.08rem; padding: 14px 26px; border-radius: var(--r-m); }
.btn-dl:hover { filter: brightness(1.1); text-decoration: none; }
.btn-dl small { font-weight: 400; opacity: .85; font-size: .9rem; }
.dl-note { margin: 0; color: var(--muted); font-size: .88rem; }
.btn-line { display: inline-block; border: 1.5px solid var(--mat); border-radius: var(--r-m); padding: 8px 16px; text-decoration: none; font-weight: 600; }
.facts-table { margin: 0; border-top: 1px solid var(--line); }
.facts-table > div { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.facts-table dt { color: var(--muted); font-size: .9rem; }
.facts-table dd { margin: 0; }
.facts-table .hash { display: flex; gap: 10px; align-items: start; }
@media (max-width: 560px) { .facts-table > div { grid-template-columns: 1fr; gap: 2px; } }
.checklist ul { padding-left: 1.2em; }
.checklist li { margin-bottom: 6px; }
.prose { max-width: 72ch; }
.prose h3 { margin-top: 1.6em; }
.prose ol, .prose ul { padding-left: 1.4em; }
.prose li { margin-bottom: .45em; }
.prose code { background: var(--wash); padding: 1px 5px; border-radius: 3px; }
.prose .note { background: var(--warn-bg); padding: 10px 14px; border-radius: var(--r-s); }
.changelog { font-size: .95rem; }

/* download page */
.dl-page { max-width: 760px; padding-top: 32px; }
.dl-status { margin: 24px 0; }
.dl-msg { font-size: 1.1rem; }

/* guides & articles */
.guide-cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.guide-cards a { display: grid; gap: 6px; border: 1px solid var(--line); border-radius: var(--r-m); padding: 16px 18px; text-decoration: none; color: var(--ink); height: 100%; }
.guide-cards a:hover { border-color: var(--link); }
.guide-cards span { color: var(--muted); font-size: .9rem; }
.article { max-width: 820px; padding-top: 22px; }
.chip-links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip-links a { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; text-decoration: none; font-size: .9rem; }
.empty { background: var(--wash); border-radius: var(--r-m); padding: 18px 22px; }
.empty-page { padding: 60px 20px; }
.pager { display: flex; justify-content: space-between; margin: 24px 0; }

/* ads */
.ad { margin: 24px auto; text-align: center; position: relative; }
.ad img { display: block; margin: 0 auto; border-radius: var(--r-s); }
.ad-label { display: block; font-size: .7rem; color: var(--muted); margin-bottom: 4px; }
.ad-side { margin-top: 0; }

/* footer */
.site-foot { margin-top: 64px; border-top: 1px solid var(--line); background: var(--wash); padding: 32px 0 20px; font-size: .92rem; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; }
.foot-grid nav { display: flex; flex-wrap: wrap; gap: 10px 20px; align-content: start; justify-content: end; }
.foot-name { font-weight: 700; margin-bottom: 4px; }
.foot-small { font-size: .8rem; margin-top: 18px; }
@media (max-width: 700px) { .foot-grid { grid-template-columns: 1fr; } .foot-grid nav { justify-content: start; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- phones ---------- */
.dl-sticky { display: none; }
@media (max-width: 960px) {
  .dl-sticky { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(10, 25, 40, .12);
    transform: translateY(110%); transition: transform .2s ease; visibility: hidden; }
  .dl-sticky.is-on { transform: none; visibility: visible; }
  .dl-sticky-ver { min-width: 0; display: grid; }
  .dl-sticky-ver code { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dl-sticky-ver small { color: var(--muted); font-size: .8rem; }
  .dl-sticky .btn-dl { padding: 11px 20px; font-size: 1rem; flex-shrink: 0; }
}
@media (max-width: 600px) {
  .hero { padding: 32px 0 28px; }
  .big-search input { height: 50px; font-size: 1rem; padding: 0 14px; }
  .big-search button { height: 50px; padding: 0 18px; }
  .brand-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .brand-grid a { padding: 12px; }
  .brand-grid strong { font-size: 1rem; }
  .dl-row .btn-dl { display: flex; justify-content: center; width: 100%; }
  .dl-page .btn-dl, .dl-box .btn-dl { display: flex; justify-content: center; width: 100%; }
  .copy { min-height: 32px; }
}

/* =================================================================
   1.0.2 — friendlier look: surfaces, hero band, device photos
   ================================================================= */
.site-head { background: var(--paper); box-shadow: 0 1px 0 var(--line); border-bottom: 0; }
.head-search input { border-radius: 999px; padding: 0 16px; }

/* hero: deep blue band with the label-yellow button */
.hero { background: var(--hero); color: var(--hero-ink); border-bottom: 0; padding: 60px 0 52px; }
.hero h1 { color: var(--hero-ink); }
.hero-sub { color: var(--hero-muted); }
.hero .big-search input { border: 0; border-radius: 999px 0 0 999px; padding: 0 22px; background: #fff; color: #17212b; }
.hero .big-search button { border-radius: 0 999px 999px 0; background: var(--label); color: var(--label-ink); padding: 0 30px; }
.hero .big-search button:hover { background: #ffd65a; color: var(--label-ink); }
.hero .examples { color: var(--hero-muted); }
.hero .examples a { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .18); color: var(--hero-ink); }
.hero .examples a:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .4); }

/* shared surface */
.surface, .brand-grid a, .latest-cards a, .guide-cards a, .table-wrap, .fw-list, .facts, .device-grid a {
  background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.brand-grid a, .guide-cards a, .device-grid a, .latest-cards a { transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease; }
.brand-grid a:hover, .guide-cards a:hover, .device-grid a:hover, .latest-cards a:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); border-color: var(--line-strong); }

/* brand tiles with a monogram */
.brand-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.brand-grid li { display: flex; }
.brand-grid a { flex: 1; min-height: 84px; grid-template-rows: auto auto; align-content: center; }
.brand-grid .bg-counts { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-grid a { grid-template-columns: 44px 1fr; column-gap: 12px; border-radius: var(--r-m); padding: 14px; }
.brand-grid a:not(:has(img)) { grid-template-columns: 44px 1fr; }
.brand-grid a:not(:has(img)) span { grid-column: 2; }
.brand-grid img, .brand-grid .mono-badge { grid-column: 1; grid-row: 1 / span 2; width: 44px; height: 44px; border-radius: 12px; }
.brand-grid strong { grid-column: 2; align-self: end; }
.brand-grid span:not(.mono-badge) { grid-column: 2; align-self: start; }
.brand-grid img { object-fit: contain; background: var(--tile); padding: 6px; border: 1px solid var(--line); }
.mono-badge { display: grid; place-items: center; font-weight: 700; font-size: 1.15rem; color: #fff; background: hsl(var(--h, 205) 45% 42%); }

/* firmware rows with a device thumbnail */
.fw-list { border-radius: var(--r-m); overflow: hidden; border-top: 1px solid var(--line); }
.fw-list li:last-child { border-bottom: 0; }
.fw-list a { grid-template-columns: 44px minmax(0, 1fr); column-gap: 14px; align-items: center; padding: 12px 16px; }
.fw-list a > .fw-text { display: grid; gap: 2px; min-width: 0; }
.fw-thumb { width: 44px; height: 52px; border-radius: 8px; background: var(--tile); display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); }
.fw-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.fw-thumb svg { width: 22px; height: 22px; color: #8a99a8; }
.popular { list-style: none; padding: 0; counter-reset: pop; }
.popular li { counter-increment: pop; display: grid; grid-template-columns: 28px 1fr; gap: 8px; align-items: start; }
.popular li::before { content: counter(pop); width: 24px; height: 24px; border-radius: 50%; background: var(--wash); color: var(--muted); font: 600 .78rem var(--sans); display: grid; place-items: center; margin-top: 1px; }
.facts { border-radius: var(--r-m); }

/* brand page: device grid with photos */
.device-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; }
.device-grid a { display: grid; grid-template-rows: auto 1fr; height: 100%; border-radius: var(--r-m); text-decoration: none; color: var(--ink); overflow: hidden; }
.dg-photo { background: var(--tile); height: 150px; display: grid; place-items: center; border-bottom: 1px solid var(--line); }
.dg-photo img { max-width: 78%; max-height: 132px; object-fit: contain; }
.dg-photo svg { width: 46px; height: 46px; color: #9aa8b5; }
.dg-body { display: grid; gap: 3px; padding: 10px 12px 12px; align-content: start; }
.dg-name { font-weight: 600; line-height: 1.3; }
.dg-meta { font-size: .8rem; color: var(--muted); }
.dg-codes { font-size: .74rem; color: var(--muted); overflow-wrap: anywhere; }
.device-grid a:hover .dg-name { color: var(--link); }
@media (max-width: 600px) { .device-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .dg-photo { height: 120px; } .dg-photo img { max-height: 104px; } }

/* model page: the device card */
.device-card { margin-top: 18px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow); padding: 26px; display: grid; gap: 22px 28px; }
.device-card.has-img { grid-template-columns: 190px minmax(0, 1fr); }
.device-photo { background: var(--tile); border-radius: 14px; border: 1px solid var(--line); height: 240px; display: grid; place-items: center; padding: 14px; }
.device-photo img { max-height: 210px; width: auto; object-fit: contain; }
.device-main h1 { margin-bottom: .3em; }
.device-main .lead { margin-bottom: 14px; }
.device-facts { display: flex; flex-wrap: wrap; gap: 12px 28px; margin: 0 0 16px; }
.device-facts dt { font-size: .76rem; color: var(--muted); }
.device-facts dd { margin: 0; font-weight: 500; }
.device-actions { margin: 0; }
.btn-dl.btn-sm { font-size: .95rem; padding: 10px 18px; }
.key-specs { grid-column: 1 / -1; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); gap: 10px; }
.key-specs li { background: var(--wash); border-radius: var(--r-m); padding: 12px 14px; display: grid; grid-template-columns: 26px 1fr; grid-template-rows: auto 1fr; column-gap: 10px; align-content: start; }
.key-specs svg { grid-row: 1 / span 2; width: 24px; height: 24px; color: var(--link); margin-top: 2px; }
.ks-label { font-size: .74rem; color: var(--muted); }
.ks-value { font-weight: 600; font-size: .95rem; line-height: 1.3; }
.all-specs { grid-column: 1 / -1; }
.all-specs > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--link); border: 1px solid var(--line-strong); border-radius: 999px; padding: 8px 16px; }
.all-specs > summary::-webkit-details-marker { display: none; }
.all-specs > summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
.all-specs[open] > summary::after { transform: rotate(-135deg) translate(-2px, -1px); }
.all-specs .when-open, .all-specs[open] .when-closed { display: none; }
.all-specs[open] .when-open { display: inline; }
.all-specs > summary:hover { border-color: var(--link); }
.all-specs .specs { margin-top: 20px; }
.all-specs h3 { color: var(--link); font-size: .95rem; }
.all-specs .specs-source { margin: 20px 0 0; }
@media (max-width: 700px) {
  .device-card { padding: 16px; gap: 16px; border-radius: var(--r-m); }
  .device-card.has-img { grid-template-columns: 96px minmax(0, 1fr); align-items: center; }
  .device-card.has-img .device-main { display: contents; }
  .device-card.has-img .device-main > :not(h1) { grid-column: 1 / -1; }
  .device-card h1 { font-size: 1.35rem; margin: 0; }
  .device-main .lead { font-size: 1rem; margin: 0; }
  .device-photo { height: 124px; padding: 8px; border-radius: 10px; }
  .device-photo img { max-height: 106px; }
  .device-facts { margin: 0; }
  .device-facts { gap: 8px 18px; }
  .device-actions { display: none; }
  .key-specs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .key-specs li { padding: 10px; grid-template-columns: 22px 1fr; column-gap: 8px; }
  .key-specs svg { width: 20px; height: 20px; }
  .ks-value { font-size: .86rem; }
}

/* tables & cards */
.table-wrap { border-radius: var(--r-m); }
.fw-table thead th { background: var(--wash); }
.latest-cards a { border-left: 4px solid var(--label); border-radius: var(--r-m); }
.guide-cards a { border-radius: var(--r-m); }
.label-card { background: linear-gradient(90deg, var(--label) 0 14px, transparent 14px), var(--paper); box-shadow: var(--shadow); }
@media (max-width: 760px) {
  .table-wrap { background: transparent; box-shadow: none; border: 0; }
  .fw-table tr { background: var(--paper); box-shadow: var(--shadow); }
}
.site-foot { background: var(--paper); }
.brand-grid .mono-badge { color: #fff; font-size: 1.1rem; font-weight: 700; }
.fw-thumb:not(:has(img)), .dg-photo:not(:has(img)) { background: var(--wash); }
.side-device { display: grid; text-decoration: none; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 20px; }
.side-device .dg-photo { height: 190px; }
.side-device .dg-photo img { max-height: 170px; }
.side-device .dg-body { gap: 5px; padding: 14px 16px 16px; }
.side-more { margin-top: 6px; font-weight: 600; color: var(--link); font-size: .9rem; }
.side-device:hover { box-shadow: var(--shadow-hover); }
@media (max-width: 960px) { .side-device { grid-template-columns: 110px 1fr; margin-top: 28px; } .side-device .dg-photo { height: 100%; min-height: 130px; border-bottom: 0; border-right: 1px solid var(--line); } .side-device .dg-photo img { max-height: 120px; } }

/* Telegram channel invitation */
.tg-join { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-left: 4px solid #2aa3df; border-radius: var(--r-m); box-shadow: var(--shadow); padding: 14px 16px; margin: 0 0 22px; }
.tg-icon { width: 40px; height: 40px; border-radius: 50%; background: #2aa3df; color: #fff; display: grid; place-items: center; }
.tg-icon svg { width: 21px; height: 21px; margin-left: -2px; }
.tg-text { display: grid; gap: 2px; min-width: 0; }
.tg-text strong { font-size: .98rem; }
.tg-text span { font-size: .87rem; color: var(--muted); }
.tg-btn { background: #2aa3df; color: #fff !important; text-decoration: none; font-weight: 600; font-size: .9rem; padding: 9px 16px; border-radius: 999px; white-space: nowrap; }
.tg-btn:hover { filter: brightness(1.08); }
.tg-card { grid-template-columns: auto 1fr; }
.tg-card .tg-btn { grid-column: 1 / -1; text-align: center; }
.tg-slim { margin: 18px 0 6px; }
.tg-head svg { width: 18px; height: 18px; }
.tg-head { color: #2aa3df; }
@media (max-width: 560px) { .tg-join { grid-template-columns: auto 1fr; } .tg-join .tg-btn { grid-column: 1 / -1; text-align: center; } }
