:root {
  --panel: #EDEFF2;
  --surface: #FFFFFF;
  --ink: #1B2430;
  --ink-soft: #5C6B7A;
  --ink-faint: #7A8896;
  --hair: #D2D8DF;
  --signal: #0E6E86;
  --signal-strong: #0B5E73;
  --signal-weak: #E3F0F3;
  --ok: #2E7D52;
  --caution: #9A6400;
  --stop: #A8271E;
  --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Consolas, monospace;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  background: var(--panel);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--signal); }
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 4px; }
mark { background: #FFF1B8; color: inherit; border-radius: 2px; padding: 0 1px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px;
}
.skip:focus { top: 10px; }
.mono { font-family: var(--mono); }
.wrap { max-width: 1440px; margin: 0 auto; padding: 20px 24px 48px; }
.wrap:focus { outline: none; }

/* ---------- шапка ---------- */
.top {
  background: var(--surface);
  border-bottom: 1px solid var(--hair);
  padding: 14px 24px;
  position: sticky; top: 0; z-index: 10;
}
.top-row { display: flex; align-items: center; gap: 20px; max-width: 1440px; margin: 0 auto; }
.brand { display: flex; align-items: baseline; gap: 10px; flex-shrink: 0; color: inherit; text-decoration: none; }
.brand b { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.brand span { font-size: 12px; color: var(--ink-soft); }
.searchwrap { flex: 1; position: relative; min-width: 0; }
.search {
  width: 100%;
  border: 1.5px solid var(--hair);
  border-radius: 10px;
  padding: 11px 14px 11px 40px;
  font: inherit;
  background: var(--surface);
  transition: border-color .15s;
  -webkit-appearance: none; appearance: none;
}
.search:focus { border-color: var(--signal); outline: none; }
.search::placeholder { color: #8B98A5; }
.mag { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-soft); }

/* ---------- общие элементы ---------- */
.card { background: var(--surface); border: 1px solid var(--hair); border-radius: 12px; margin-top: 16px; }
.card-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px; border-bottom: 1px solid var(--hair);
}
.card-head h2 { font-size: 15px; font-weight: 600; }
.card-body { padding: 16px 18px; }
.muted { color: var(--ink-soft); }
.small { font-size: 13px; }

.badge {
  display: inline-block; font-size: 11.5px; line-height: 1.4; border-radius: 5px; padding: 1px 7px;
  border: 1px solid; white-space: nowrap;
}
.badge.ok { color: var(--ok); border-color: #B5D8C4; background: #F1F8F4; }
.badge.caution { color: var(--caution); border-color: #E4CFA3; background: #FBF6EC; }
.badge.stop { color: var(--stop); border-color: #E8BDB9; background: #FCF2F1; }
.badge.vendor { color: var(--signal); border-color: #B6D6DE; background: var(--signal-weak); }
.badge.web { color: var(--ink-soft); border-color: var(--hair); background: #F6F8FA; }
.badge.demo { color: #6B3FA0; border-color: #D5C4EA; background: #F6F1FC; }

.btn {
  display: inline-block; border: 1px solid var(--hair); border-radius: 8px; padding: 8px 14px;
  font-size: 13.5px; background: var(--surface); white-space: nowrap; text-decoration: none; color: var(--ink);
}
.btn:hover { border-color: var(--signal); color: var(--signal); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.notice {
  border: 1px solid #B6D6DE; background: var(--signal-weak); border-radius: 10px;
  padding: 12px 14px; font-size: 13.5px; margin-top: 16px;
}
.notice.warn { border-color: #E4CFA3; background: #FBF6EC; }
.state { padding: 48px 16px; text-align: center; color: var(--ink-soft); }
.state b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

.loading { height: 3px; overflow: hidden; border-radius: 2px; background: var(--hair); max-width: 240px; margin: 48px auto; }
.loading::after {
  content: ""; display: block; height: 100%; width: 40%; background: var(--signal);
  animation: slide 1s ease-in-out infinite;
}
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* ---------- поиск ---------- */
.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px; align-items: start; }
.facets { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 12px; }
.facet { background: var(--surface); border: 1px solid var(--hair); border-radius: 12px; padding: 10px 6px 10px 12px; }
.facet > summary {
  font-size: 13px; font-weight: 600; cursor: pointer; padding: 2px 6px 6px 0;
  list-style: none; display: flex; justify-content: space-between; gap: 8px;
}
.facet > summary::-webkit-details-marker { display: none; }
.facet > summary::after { content: "▾"; color: var(--ink-faint); }
.facet:not([open]) > summary { padding-bottom: 2px; }
.facet:not([open]) > summary::after { content: "▸"; }
.facet-list { max-height: 320px; overflow-y: auto; padding-right: 6px; }
.facet-opt {
  display: flex; justify-content: space-between; gap: 10px; align-items: baseline;
  padding: 5px 8px; border-radius: 7px; font-size: 13.5px; color: var(--ink); text-decoration: none;
}
.facet-opt:hover { background: #F2F5F7; }
.facet-opt span { color: var(--ink-faint); font-family: var(--mono); font-size: 12px; }
.facet-opt.on { background: var(--signal-weak); color: var(--signal-strong); font-weight: 550; }

.results-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.results-head h1 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip {
  display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; border: 1px solid #B6D6DE;
  background: var(--signal-weak); color: var(--signal-strong); border-radius: 16px; padding: 3px 10px; text-decoration: none;
}
.chip::after { content: "×"; font-size: 14px; line-height: 1; }

.hits { list-style: none; margin-top: 12px; background: var(--surface); border: 1px solid var(--hair); border-radius: 12px; }
.hits li + li { border-top: 1px solid var(--hair); }
.hit {
  display: flex; gap: 14px; align-items: center; justify-content: space-between;
  padding: 12px 16px; color: inherit; text-decoration: none;
}
.hit:hover { background: #F7F9FA; }
.hits li:first-child .hit { border-radius: 12px 12px 0 0; }
.hits li:last-child .hit { border-radius: 0 0 12px 12px; }
.hit-main { min-width: 0; }
.hit-name { font-size: 14.5px; font-weight: 550; }
.hit-meta { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; overflow-wrap: anywhere; }
.hit-meta .mono { color: var(--ink); }
.hit-desc { font-size: 12.5px; color: var(--ink-faint); margin-top: 3px; }
.hit-badges { display: flex; gap: 5px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.more { display: block; margin: 14px auto 0; }

/* ---------- фото: галерея карточки и миниатюры выдачи ---------- */
.model-top { display: grid; grid-template-columns: minmax(220px, 340px) minmax(0, 1fr); gap: 16px; align-items: start; }
.gallery { background: var(--surface); border: 1px solid var(--hair); border-radius: 12px; padding: 10px; }
.gallery-main {
  display: grid; place-items: center; aspect-ratio: 1 / 1; background: #fff; border-radius: 8px; overflow: hidden;
}
.gallery-main img { max-width: 100%; max-height: 100%; object-fit: contain; }
.gallery-thumbs { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; padding-bottom: 2px; }
.gallery-thumb {
  width: 58px; height: 58px; flex-shrink: 0; border: 1.5px solid var(--hair); border-radius: 7px; background: #fff; padding: 3px;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: contain; }
.gallery-thumb[aria-pressed="true"] { border-color: var(--signal); box-shadow: 0 0 0 2px var(--signal-weak); }
.gallery-empty { display: grid; place-items: center; aspect-ratio: 1 / 1; color: var(--ink-faint); font-size: 13px; }
.plate-subtitle { font-size: 12px; font-weight: 600; color: #A9BCCB; text-transform: uppercase; letter-spacing: .05em; margin-top: 16px; }
.plate-subtitle + .specs { margin-top: 8px; }
.hit-thumb {
  width: 52px; height: 52px; object-fit: contain; flex-shrink: 0; background: #fff;
  border: 1px solid var(--hair); border-radius: 7px;
}
.hit-thumb-empty { display: inline-block; background: #F2F5F7; }
.hit-main { flex: 1; }
.spec-table { gap: 6px 16px; }
.spec-table dt { font-size: 13px; }
.spec-table dd { font-family: var(--sans); font-size: 13.5px; }
.spec-source { margin-top: 12px; }

/* ---------- карточка модели ---------- */
.back { display: inline-block; font-size: 13.5px; margin-bottom: 12px; text-decoration: none; }
.back:hover { text-decoration: underline; }
.plate {
  background: linear-gradient(180deg, #20303F 0%, #17232F 100%);
  color: #E8EDF2; border-radius: 12px; padding: 20px 22px; border: 1px solid #0E1922;
}
.plate-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.plate h1 { font-size: 22px; font-weight: 600; letter-spacing: -.015em; overflow-wrap: anywhere; }
.plate .sn { font-family: var(--mono); font-size: 13px; color: #A9BCCB; margin-top: 3px; overflow-wrap: anywhere; }
.plate .sn span { font-family: var(--sans); }
.plate-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.rev {
  background: #0E6E86; color: #fff; border-radius: 8px; padding: 7px 13px;
  font-size: 12.5px; line-height: 1.25; text-align: right;
}
.rev b { display: block; font-family: var(--mono); font-size: 16px; font-weight: 600; }
.specs {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px; background: #2C3E4E; border-radius: 8px; overflow: hidden; margin-top: 17px;
}
.spec { background: #1B2A37; padding: 10px 12px; }
.spec dt { font-size: 11.5px; color: #A9BCCB; margin-bottom: 2px; }
.spec dd { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.plate-empty { margin-top: 14px; font-size: 13px; color: #A9BCCB; }
.plate-foot { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px; font-size: 12.5px; color: #A9BCCB; }
.plate-foot b { color: #E8EDF2; font-weight: 500; }
.plate-foot a { color: #9FD6E4; }

.tabs { display: flex; gap: 2px; padding: 0 18px; border-bottom: 1px solid var(--hair); overflow-x: auto; }
.tab {
  padding: 11px 13px; font-size: 13.5px; color: var(--ink-soft); white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--signal); font-weight: 550; }
.tab .count { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); margin-left: 4px; }
.tabpanel { padding: 16px 18px; }

.row { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--hair); align-items: flex-start; }
.row:first-child { padding-top: 0; }
.row:last-child { border-bottom: none; padding-bottom: 0; }
.row-ic {
  width: 34px; height: 34px; border-radius: 7px; background: #F2F5F7; border: 1px solid var(--hair);
  display: grid; place-items: center; font-family: var(--mono); font-size: 10px; color: var(--ink-soft); flex-shrink: 0;
}
.row-body { flex: 1; min-width: 0; }
.row-title { font-size: 14px; display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.row-meta { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; font-size: 13px; margin-top: 6px; }
.kv dt { color: var(--ink-soft); }
.kv dd { font-family: var(--mono); overflow-wrap: anywhere; }
.prose p + p { margin-top: 8px; }
.prose { font-size: 14px; max-width: 72ch; }

/* ---------- совпадение по серийному номеру ---------- */
.serial-hit {
  display: grid; gap: 2px; margin-top: 12px; padding: 14px 16px; border-radius: 12px;
  background: var(--signal-weak); border: 1.5px solid var(--signal); color: var(--ink); text-decoration: none;
}
.serial-hit:hover { background: #D6EAEF; }
.serial-hit-label { font-size: 12px; font-weight: 600; color: var(--signal-strong); text-transform: uppercase; letter-spacing: .04em; }
.serial-hit-main { font-size: 15.5px; font-weight: 600; overflow-wrap: anywhere; }
.serial-hit-meta { font-size: 13px; color: var(--ink-soft); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.serial-hit-go { margin-left: auto; color: var(--signal-strong); font-weight: 550; }

/* ---------- паспорт ---------- */
.plate-link { color: inherit; text-decoration: none; }
.plate-link:hover { text-decoration: underline; }
.notice b { font-weight: 600; }

.current-form { padding: 14px 18px; border-bottom: 1px solid var(--hair); display: grid; gap: 6px; }
.current-form label { font-size: 13px; font-weight: 600; }
.current-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.current-controls input {
  flex: 0 1 220px; min-width: 0; border: 1.5px solid var(--hair); border-radius: 8px; padding: 7px 10px; font-size: 14px;
}
.current-controls input:focus { border-color: var(--signal); outline: none; }

.fw { display: flex; gap: 13px; padding: 13px 0; border-bottom: 1px solid var(--hair); align-items: flex-start; }
.fw:first-child { padding-top: 0; }
.fw:last-child { border-bottom: none; padding-bottom: 0; }
.led { width: 10px; height: 10px; border-radius: 50%; margin-top: 7px; flex-shrink: 0; }
.led.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(46, 125, 82, .18); }
.led.caution { background: var(--caution); box-shadow: 0 0 0 3px rgba(154, 100, 0, .18); }
.led.stop { background: var(--stop); box-shadow: 0 0 0 3px rgba(168, 39, 30, .18); }
.led.neutral { background: #fff; border: 2px solid var(--ink-faint); }
.fw-body { flex: 1; min-width: 0; }
.fw-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.fw-ver { font-family: var(--mono); font-size: 15px; font-weight: 600; }
.fw-rule { font-size: 13.5px; color: var(--ink); margin-top: 5px; }
.fw-meta { font-family: var(--mono); font-size: 11.5px; color: var(--ink-faint); margin-top: 5px; }
.fw-act { flex-shrink: 0; padding-top: 2px; }
.fw-path { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; font-size: 12.5px; }
.fw-path li { background: #F2F5F7; border: 1px solid var(--hair); border-radius: 5px; padding: 1px 7px; }
.fw-path li + li::before { content: "→"; margin: 0 6px 0 -2px; color: var(--ink-faint); font-family: var(--sans); }

.issue { border-left: 3px solid var(--caution); background: #FBF8F2; border-radius: 0 8px 8px 0; padding: 12px 14px; }
.issue + .issue { margin-top: 10px; }
.issue h3 { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.issue p { font-size: 13px; color: var(--ink-soft); }
.issue p + p { margin-top: 3px; }
.issue p b { color: var(--ink); font-weight: 600; }
.issue-meta { font-family: var(--mono); font-size: 12px !important; margin-top: 6px !important; }

.row-on { background: var(--signal-weak); margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 8px; }
.row-title a { color: inherit; }
.tone-ok { color: var(--ok); border-color: #B5D8C4; background: #F1F8F4; font-size: 15px; }
.tone-caution { color: var(--caution); border-color: #E4CFA3; background: #FBF6EC; font-size: 15px; }
.tone-stop { color: var(--stop); border-color: #E8BDB9; background: #FCF2F1; font-size: 15px; }
.tone-neutral { font-size: 15px; }

/* ---------- навигация и кнопки ---------- */
.nav-link {
  flex-shrink: 0; font-size: 13.5px; color: var(--ink-soft); text-decoration: none;
  border: 1px solid var(--hair); border-radius: 8px; padding: 9px 12px; background: var(--surface);
}
.nav-link:hover, .nav-link[aria-current] { color: var(--signal-strong); border-color: var(--signal); }
.btn.primary { background: var(--signal); border-color: var(--signal); color: #fff; }
.btn.primary:hover { background: var(--signal-strong); border-color: var(--signal-strong); color: #fff; }

/* ---------- вход и пользователи ---------- */
.anon .sidebar, .anon .searchwrap, .anon .burger, .anon .top .brand { display: none; }
.auth-card {
  max-width: 440px; margin: 40px auto; background: var(--surface); border: 1px solid var(--hair);
  border-radius: 12px; padding: 24px;
}
.auth-card h1 { font-size: 20px; font-weight: 600; }
.auth-form { display: grid; gap: 12px; margin: 16px 0 12px; }
.auth-msg { color: var(--stop); min-height: 1.3em; }
.invite-form { display: grid; grid-template-columns: 2fr 2fr 1fr auto; gap: 10px; align-items: end; }
.invite-result { grid-column: 1 / -1; }
.invite-link { display: flex; gap: 8px; margin-top: 6px; }
.invite-link input {
  flex: 1; min-width: 0; font: inherit; font-family: var(--mono); font-size: 12.5px;
  border: 1.5px solid var(--hair); border-radius: 8px; padding: 7px 9px;
}
.admin-user { align-items: center; flex-wrap: wrap; }
.admin-controls { display: flex; gap: 8px; align-items: center; }
.admin-controls select {
  font: inherit; font-size: 13.5px; border: 1.5px solid var(--hair); border-radius: 8px; padding: 7px 9px; background: var(--surface);
}
.row-msg:empty { display: none; }

/* ---------- скачивание, ссылки клиенту, «не нашёл» ---------- */
.row-actions { display: flex; gap: 6px; flex-shrink: 0; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.share-result { margin-top: 8px; }
.miss {
  margin-top: 18px; border: 1px dashed var(--hair); border-radius: 12px; padding: 14px 16px; background: var(--surface);
}
.miss h2 { font-size: 15px; font-weight: 600; }
.miss-form { display: grid; gap: 10px; margin-top: 10px; }
.qi-field textarea {
  font: inherit; font-size: 14px; color: var(--ink); border: 1.5px solid var(--hair); border-radius: 8px;
  padding: 7px 9px; background: var(--surface); width: 100%; resize: vertical;
}
.qi-field textarea:focus { border-color: var(--signal); outline: none; }

/* ---------- очередь подтверждения ---------- */
.queue-hint { margin-top: 6px; max-width: 82ch; }
.queue-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.chip-filter {
  display: inline-flex; gap: 6px; font-size: 12.5px; border: 1px solid var(--hair); border-radius: 16px;
  padding: 3px 10px; color: var(--ink); text-decoration: none; background: var(--surface);
}
.chip-filter span { font-family: var(--mono); color: var(--ink-faint); }
.chip-filter.on { border-color: #B6D6DE; background: var(--signal-weak); color: var(--signal-strong); }
.queue-list { display: grid; gap: 12px; margin-top: 14px; }
.qi { background: var(--surface); border: 1px solid var(--hair); border-radius: 12px; padding: 14px 16px; }
.qi-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.qi-model { font-weight: 550; overflow-wrap: anywhere; }
.qi-badges { display: flex; gap: 5px; flex-wrap: wrap; }
.qi-file { margin-top: 3px; overflow-wrap: anywhere; }
.qi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.qi-title { grid-column: 1 / -1; }
.qi-field { display: grid; gap: 3px; }
.qi-field label { font-size: 12px; color: var(--ink-soft); }
.qi-field input, .qi-field select {
  font: inherit; font-size: 14px; color: var(--ink); border: 1.5px solid var(--hair); border-radius: 8px;
  padding: 7px 9px; background: var(--surface); min-width: 0; width: 100%;
}
.qi-field input:focus, .qi-field select:focus { border-color: var(--signal); outline: none; }
.qi-field.changed input, .qi-field.changed select { border-color: var(--caution); background: #FBF6EC; }
.qi-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.qi-actions { display: flex; gap: 8px; margin-left: auto; }
.qi.done { border-color: #B5D8C4; background: #F7FBF8; }
.qi.done .qi-msg { color: var(--ok); }
.qi.skipped { opacity: .65; }
.queue-next { margin-top: 16px; text-align: center; }

/* ---------- адаптивность ---------- */
@media (max-width: 900px) {
  .model-top { grid-template-columns: 1fr; }
  .gallery-main { aspect-ratio: 4 / 3; }
  .layout { grid-template-columns: 1fr; }
  .facets { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}
@media (max-width: 600px) {
  .top { padding: 10px 12px; }
  .top-row { gap: 10px; }
  .wrap { padding: 14px 12px 40px; }
  .plate { padding: 16px; }
  .plate h1 { font-size: 19px; }
  .specs { grid-template-columns: 1fr 1fr; }
  .hit { flex-direction: column; align-items: flex-start; gap: 6px; padding: 11px 12px; }
  .hit-badges { justify-content: flex-start; }
  /* на телефоне вкладки переносятся, а не прячутся за горизонтальной прокруткой */
  .tabs { padding: 0 8px; flex-wrap: wrap; overflow-x: visible; }
  .tab { padding: 10px 9px; }
  .tabpanel, .card-body { padding: 14px 12px; }
  .kv { grid-template-columns: 1fr; }
  .kv dd { margin-bottom: 4px; }
  .current-form { padding: 12px; }
  .nav-link { padding: 9px 9px; }
  .top-row { flex-wrap: wrap; }
  .searchwrap { order: 3; flex-basis: 100%; }
  .row-actions { width: 100%; justify-content: flex-start; padding-left: 46px; }
  .invite-form { grid-template-columns: 1fr; }
  .admin-controls { width: 100%; }
  .admin-controls select { flex: 1; }
  .auth-card { margin: 16px auto; padding: 18px; }
  .qi { padding: 12px; }
  .qi-grid { grid-template-columns: 1fr 1fr; }
  .qi-actions { width: 100%; }
  .qi-actions .btn { flex: 1; }
  .current-controls input { flex: 1 1 140px; }
  .fw { flex-wrap: wrap; gap: 10px; }
  .fw-act { width: 100%; padding: 0 0 0 23px; }
  .serial-hit-go { margin-left: 0; width: 100%; }
}
/* ---------- голос, камера, кнопки-иконки ---------- */
.search { padding-right: 90px; }
.search-tools { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: flex; gap: 2px; }
.icon-btn {
  width: 36px; height: 34px; border-radius: 8px; display: inline-grid; place-items: center; flex-shrink: 0;
  color: var(--ink-soft); border: 1px solid transparent; font-size: 17px;
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover { background: #F2F5F7; color: var(--signal); }
.icon-btn[aria-pressed="true"] { background: #FCF2F1; color: var(--stop); border-color: #E8BDB9; animation: listen 1.2s ease-in-out infinite; }
@keyframes listen { 50% { box-shadow: 0 0 0 5px rgba(168, 39, 30, .12); } }
.assist-toggle { display: inline-flex; gap: 6px; align-items: center; background: var(--signal); border-color: var(--signal); color: #fff; }
.assist-toggle svg { width: 17px; height: 17px; }
.assist-toggle:hover, .assist-toggle[aria-expanded="true"] { background: var(--signal-strong); color: #fff; }
.anon .assist-toggle, .anon .fab { display: none; }

/* ---------- помощник ---------- */
.assistant {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 40; width: min(440px, 100vw);
  background: var(--surface); border-left: 1px solid var(--hair); box-shadow: -12px 0 32px rgba(27, 36, 48, .12);
  display: flex; flex-direction: column;
}
.assistant[hidden] { display: none; }
.as-backdrop { position: fixed; inset: 0; background: rgba(27, 36, 48, .28); z-index: 35; }
.as-head { display: flex; justify-content: space-between; gap: 10px; padding: 14px 14px 12px 18px; border-bottom: 1px solid var(--hair); }
.as-head h2 { font-size: 15.5px; font-weight: 600; }
.as-head-tools { display: flex; gap: 2px; align-items: flex-start; }
.as-mode { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-faint); flex-shrink: 0; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(46, 125, 82, .16); }
.dot.off { background: var(--caution); }
.as-log { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; background: #F8FAFB; }
.as-msg { font-size: 14px; line-height: 1.55; max-width: 92%; overflow-wrap: anywhere; }
.as-msg.me { align-self: flex-end; background: var(--signal); color: #fff; border-radius: 14px 14px 4px 14px; padding: 9px 13px; }
.as-msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--hair); border-radius: 14px 14px 14px 4px; padding: 11px 13px; }
.as-msg.bot p + p, .as-msg.bot p + ul, .as-msg.bot ul + p { margin-top: 7px; }
.as-msg.bot ul { padding-left: 18px; }
.as-msg.bot li + li { margin-top: 3px; }
.as-msg.intro { max-width: 100%; }
.as-msg.intro b { display: block; margin-bottom: 4px; }
.cite {
  display: inline-block; font-size: 11px; line-height: 1.3; font-weight: 600; vertical-align: 2px;
  padding: 0 5px; margin: 0 1px; border-radius: 5px; background: var(--signal-weak); color: var(--signal-strong); text-decoration: none;
}
.as-notice { margin-top: 8px; font-size: 12.5px; color: var(--caution); }
.as-sources { list-style: none; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--hair); display: grid; gap: 5px; }
.as-sources li { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; font-size: 12.5px; }
.as-sources a { color: var(--signal-strong); }
.as-sources .cite { vertical-align: 0; }
.as-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.as-actions .btn { padding: 5px 10px; font-size: 12.5px; }
.as-meta { margin-top: 6px; font-size: 11.5px; color: var(--ink-faint); }
.typing { display: inline-flex; gap: 4px; align-items: center; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-faint); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .25; } }
.as-suggest { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 18px 0; }
.as-suggest:empty { display: none; }
.suggest-chip, .hero-chip, .ask-chip {
  font-size: 12.5px; border: 1px solid var(--hair); border-radius: 16px; padding: 4px 11px; color: var(--ink-soft);
  background: var(--surface); text-align: left;
}
.suggest-chip:hover, .ask-chip:hover { border-color: var(--signal); color: var(--signal-strong); }
.as-form { display: flex; gap: 6px; align-items: flex-end; padding: 10px 12px 12px 18px; }
.as-form textarea {
  flex: 1; min-width: 0; resize: none; font: inherit; font-size: 14px; line-height: 1.45; max-height: 140px;
  border: 1.5px solid var(--hair); border-radius: 10px; padding: 8px 11px; color: var(--ink);
}
.as-form textarea:focus { border-color: var(--signal); outline: none; }
.as-form .send { background: var(--signal); color: #fff; width: 40px; height: 38px; }
.as-form .send:hover { background: var(--signal-strong); color: #fff; }
.as-form .send:disabled { opacity: .5; }
.fab {
  position: fixed; right: 16px; bottom: 16px; z-index: 30; width: 56px; height: 56px; border-radius: 50%;
  background: var(--signal); color: #fff; display: none; place-items: center; box-shadow: 0 6px 18px rgba(14, 110, 134, .35);
}
.fab svg { width: 24px; height: 24px; }
.ask-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.ask-question {
  display: grid; gap: 2px; width: 100%; margin-top: 12px; padding: 12px 16px; border-radius: 12px; text-align: left;
  background: var(--surface); border: 1.5px dashed var(--signal); color: var(--ink);
}
.ask-question:hover { background: var(--signal-weak); }
.as-mode .dot + span { overflow-wrap: anywhere; }
.ask-row .muted { margin-right: 2px; }

/* ---------- снимок шильдика ---------- */
.plate-dialog {
  border: none; border-radius: 14px; padding: 0; width: min(460px, calc(100vw - 24px)); margin: auto;
  box-shadow: 0 20px 50px rgba(27, 36, 48, .3); color: var(--ink);
}
.plate-dialog::backdrop { background: rgba(27, 36, 48, .45); }
.plate-box { padding: 16px 18px 18px; display: grid; gap: 12px; }
.plate-dialog-head { display: flex; justify-content: space-between; align-items: center; }
.plate-dialog-head h2 { font-size: 17px; font-weight: 600; }
.plate-pick { display: inline-flex; justify-content: center; align-items: center; gap: 8px; cursor: pointer; padding: 11px 14px; }
.plate-pick svg { width: 19px; height: 19px; }
.plate-pick:focus-within { outline: 2px solid var(--signal); outline-offset: 2px; }
#plate-preview { max-height: 240px; width: 100%; object-fit: contain; border-radius: 8px; background: #F2F5F7; }
.plate-result:empty { display: none; }
.plate-result { font-size: 13.5px; display: grid; gap: 8px; }
.plate-result .btn { text-align: center; }

.toast {
  position: fixed; left: 50%; bottom: 22px; z-index: 60; transform: translate(-50%, 120px);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 9px; font-size: 13.5px;
  transition: transform .25s; max-width: calc(100vw - 32px);
}
.toast.on { transform: translate(-50%, 0); }

/* ---------- стартовая страница: общие элементы (каркас главной — в workspace.css) ---------- */
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.section-head a { font-size: 13.5px; }
.tile-img { aspect-ratio: 4 / 3; display: grid; place-items: center; background: #fff; border-radius: 9px; overflow: hidden; }
.tile-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.tile-img.empty { background: linear-gradient(135deg, var(--signal-weak), #F2F5F7); color: var(--signal-strong); font-size: 26px; font-weight: 650; }
.tile-name { font-size: 14px; font-weight: 550; line-height: 1.3; }
.tile-meta { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.tile-meta .mono { color: var(--ink); }
.feed-item { display: flex; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--hair); }
.feed-item:last-child { border-bottom: none; }
.feed-ic {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; font-size: 15px;
  background: var(--signal-weak); color: var(--signal-strong);
}
.feed-ic.withdrawn { background: #FCF2F1; color: var(--stop); }
.feed-ic.issue { background: #FBF6EC; color: var(--caution); }
.feed-ic.document { background: #F2F5F7; color: var(--ink-soft); }
.feed-body { min-width: 0; flex: 1; }
.feed-title { font-size: 13.5px; font-weight: 550; overflow-wrap: anywhere; }
.feed-meta { font-size: 12.5px; color: var(--ink-soft); margin-top: 1px; display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }

/* ---------- связка прошивок ---------- */
.plan { border: 1.5px solid #B5D8C4; background: #F7FBF8; border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.plan.caution { border-color: #E4CFA3; background: #FDFAF3; }
.plan h3 { font-size: 14.5px; font-weight: 600; }
.plan-steps { list-style: none; counter-reset: step; display: grid; gap: 8px; margin-top: 10px; }
.plan-steps li { counter-increment: step; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.plan-steps li::before {
  content: counter(step); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: var(--ok); color: #fff; font-size: 12px; font-weight: 600;
}
.plan-steps .fw-ver { font-size: 14px; }
.plan-steps .btn { padding: 5px 11px; font-size: 13px; margin-left: auto; }
.howto { counter-reset: how; list-style: none; display: grid; gap: 12px; }
.howto li { counter-increment: how; position: relative; padding-left: 34px; font-size: 13.5px; }
.howto li::before {
  content: counter(how); position: absolute; left: 0; top: -1px; width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid var(--hair); display: grid; place-items: center; font-family: var(--mono); font-size: 11.5px; color: var(--ink-soft);
}
.howto b { display: block; font-weight: 600; font-size: 14px; }
.howto-note { margin-top: 14px; }

@media (max-width: 1100px) {
  .assist-toggle span { display: none; }
}
@media (max-width: 600px) {
  .assist-toggle { display: none; }
  .fab { display: grid; }
  .assistant { width: 100vw; border-left: none; }
  .as-log { padding: 12px; }
  .as-msg { max-width: 100%; }
  .as-form { padding: 8px 10px 10px; }
  .as-suggest { padding: 8px 12px 0; }
  .plan-steps .btn { margin-left: 34px; }
  body.assistant-on { overflow: hidden; }
}
@media (min-width: 601px) {
  .as-backdrop { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
