/* Фирменный стиль and28.ru: графит, терракота, PF Din Text Comp. */
@font-face {
  font-family: "PF Din";
  src: local("PF DinText Comp Pro Light"), local("PFDinTextCompPro-Light"), url("/fonts/pf-din-light.woff2") format("woff2");
  font-weight: 300 400;
  font-display: swap;
}
@font-face {
  font-family: "PF Din";
  src: local("PF DinText Comp Pro Medium"), local("PFDinTextCompPro-Medium"), url("/fonts/pf-din-medium.woff2") format("woff2");
  font-weight: 500 700;
  font-display: swap;
}
@font-face {
  font-family: "Roboto Condensed";
  src: url("/fonts/roboto-condensed/roboto-condensed-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
  font-weight: 100 900;
}
@font-face {
  font-family: "Roboto Condensed";
  src: url("/fonts/roboto-condensed/roboto-condensed-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
}

:root {
  --graphite: #272626;
  --graphite-2: #353333;
  --terracotta: #b33d26;
  --terracotta-dark: #962f1b;
  --terracotta-soft: #f3e1dc;
  --paper: #f4f2f0;
  --card: #ffffff;
  --ink: #272626;
  --muted: #8a8584;
  --line: #e2dedb;
  --line-strong: #cfc9c5;
  --ok: #4f7a4a;
  --warn: #b7791f;
  --font: "PF Din", "Roboto Condensed", "Arial Narrow", sans-serif;
  --radius: 2px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.35;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.upper { text-transform: uppercase; letter-spacing: 0.04em; }
[hidden] { display: none !important; }

/* ---------- шапка ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: var(--graphite); color: #fff;
  border-bottom: 2px solid var(--terracotta);
}
.top-inner { display: flex; align-items: center; gap: 36px; height: 72px; padding: 0 28px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand-logo { height: 60px; width: auto; display: block; }
.brand-sub { font-weight: 300; font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; color: #cfc9c5; padding-left: 20px; border-left: 1px solid #555; }
.nav { display: flex; gap: 28px; margin-left: auto; }
.nav a {
  text-decoration: none; text-transform: uppercase; font-weight: 500; font-size: 17px; white-space: nowrap;
  color: #fff; padding: 20px 0 18px; border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.nav a:hover { color: #e9d7d2; }
.nav a.active { border-bottom-color: #fff; }
.spec-chip {
  display: flex; align-items: center; gap: 8px; margin-left: 12px;
  background: var(--terracotta); color: #fff; text-decoration: none;
  padding: 7px 14px; font-size: 15px; white-space: nowrap; max-width: 280px;
}
.spec-chip span { overflow: hidden; text-overflow: ellipsis; }
.spec-chip b { font-weight: 500; }

main { padding: 28px; max-width: 1560px; margin: 0 auto; }
h1 { font-weight: 500; font-size: 34px; line-height: 1.1; margin: 0 0 6px; text-transform: uppercase; letter-spacing: 0.02em; }
h2 { font-weight: 500; font-size: 22px; margin: 0 0 12px; text-transform: uppercase; letter-spacing: 0.03em; }
h3 { font-weight: 500; font-size: 18px; margin: 0 0 8px; }
.lead { color: var(--muted); font-weight: 300; font-size: 18px; margin: 0 0 22px; }

/* ---------- элементы ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--graphite); background: var(--graphite); color: #fff;
  padding: 9px 18px; text-transform: uppercase; font-weight: 500; font-size: 15px; letter-spacing: 0.04em;
  cursor: pointer; border-radius: var(--radius); text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--graphite-2); }
.btn.accent { background: var(--terracotta); border-color: var(--terracotta); }
.btn.accent:hover { background: var(--terracotta-dark); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { border-color: var(--graphite); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: 0.45; cursor: default; }
.link-btn { background: none; border: none; padding: 0; color: var(--terracotta); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

input[type=text], input[type=number], input[type=search], select, textarea {
  border: 1px solid var(--line-strong); background: #fff; padding: 8px 10px; border-radius: var(--radius); width: 100%;
}
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--terracotta); outline-offset: -1px; }
label.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 16px; }
input[type=checkbox] { accent-color: var(--terracotta); width: 16px; height: 16px; margin: 0; }

.badge {
  display: inline-block; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 2px 7px; border: 1px solid currentColor; line-height: 1.3; white-space: nowrap;
}
.badge.kit { color: var(--terracotta); }
.badge.part { color: var(--muted); }
.badge.review { color: #fff; background: var(--warn); border-color: var(--warn); }
.badge.src { color: var(--muted); border-color: var(--line-strong); }

.swatch { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0,0,0,.15); flex: none; }

.empty { padding: 60px 20px; text-align: center; color: var(--muted); font-size: 19px; font-weight: 300; }
.notice { background: #fff; border-left: 3px solid var(--terracotta); padding: 12px 16px; margin: 0 0 18px; }
.notice.warn { border-left-color: var(--warn); }
.error { color: var(--terracotta); }

/* ---------- вход и роли ---------- */
.user-menu { display: flex; align-items: center; gap: 10px; margin-left: 8px; font-size: 14px; white-space: nowrap; }
.user-menu .who { color: #fff; font-weight: 500; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.user-menu .link-btn { color: #cfc9c5; font-size: 14px; }
.user-menu .link-btn:hover { color: #fff; }
body.logged-out .nav, body.logged-out .spec-chip, body.logged-out .user-menu, body.logged-out .fb-fab, body.logged-out #selbar { display: none !important; }
body[data-role="designer"] .nav a[data-route="system"], body[data-role="designer"] .nav a[href="/help.html"] { display: none; }
.discount-tag { background: var(--terracotta); color: #fff; padding: 2px 8px; font-size: 13px; font-weight: 500; }
.discount-lead { color: var(--terracotta); font-weight: 500; }
s.was { color: var(--muted); font-weight: 300; font-size: .85em; margin-right: 6px; white-space: nowrap; }
.variants .pr.stack { display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.variants .pr.stack s.was { margin-right: 0; font-size: 13px; }
.login-box { max-width: 420px; margin: 8vh auto 0; }
.login-form { display: grid; gap: 14px; background: #fff; border: 1px solid var(--line); padding: 24px; }
.login-form .btn { justify-self: start; }
.feedback { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.thumb { background: #fff; border: 1px solid var(--line-strong); font-size: 20px; line-height: 1; padding: 5px 10px; cursor: pointer; }
.thumb.on { border-color: var(--terracotta); background: var(--terracotta-soft); }
.feedback-comment { display: flex; gap: 8px; align-items: flex-start; width: 100%; }
.feedback-comment textarea { flex: 1; font-size: 15px; }
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line-strong); margin: 4px 0 16px; }
.tabs a { text-decoration: none; text-transform: uppercase; font-weight: 500; letter-spacing: .04em; padding: 8px 0; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--muted); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--terracotta); }
.log-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.log-stats div { background: #fff; border: 1px solid var(--line); padding: 10px 14px; display: grid; }
.log-stats b { font-weight: 500; font-size: 24px; }
.log-stats span { font-size: 13px; color: var(--muted); }
.log-row { cursor: pointer; }
.log-row:hover td { background: #faf8f6; }
.log-details td { background: #faf8f6; }
.small-list { margin: 0 0 8px; padding-left: 20px; font-size: 14px; }

/* ---------- каталог ---------- */
.catalog { display: grid; grid-template-columns: 250px 1fr; gap: 28px; align-items: start; }
.filters { position: sticky; top: 92px; max-height: calc(100vh - 110px); overflow: auto; padding-right: 6px; }
.filter-group { border-top: 1px solid var(--line-strong); padding: 12px 0 14px; }
.filter-group h4 { margin: 0 0 8px; font-weight: 500; font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.facet { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; background: none; border: none; padding: 3px 0; cursor: pointer; text-align: left; font-size: 16px; }
.facet:hover { color: var(--terracotta); }
.facet.on { color: var(--terracotta); font-weight: 500; }
.facet .n { color: var(--muted); font-size: 14px; }
.facet-list { max-height: 230px; overflow: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); background: #fff; padding: 3px 9px; cursor: pointer; font-size: 15px; }
.chip.on { border-color: var(--terracotta); color: var(--terracotta); background: var(--terracotta-soft); }

.searchbar { display: flex; gap: 10px; margin-bottom: 14px; }
.searchbar input { font-size: 19px; padding: 11px 14px; border-color: var(--graphite); }
.result-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.card { background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; }
.card:hover { border-color: var(--line-strong); }
.card .pic { position: relative; aspect-ratio: 4 / 3; background: #fff; border-bottom: 1px solid var(--line); cursor: zoom-in; overflow: hidden; }
.card .pic img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.card .pic .noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--line-strong); font-size: 60px; font-weight: 500; }
.card .pic .toggle { position: absolute; right: 8px; bottom: 8px; }
.card .badges { position: absolute; left: 8px; top: 8px; display: flex; gap: 4px; flex-wrap: wrap; }
.card .badges .badge { background: rgba(255,255,255,.92); }
.card .badges .badge.review { background: var(--warn); }
.card .body { padding: 12px 14px 8px; display: flex; flex-direction: column; gap: 3px; }
.card .vendor { font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: var(--terracotta); }
.card .title { font-weight: 500; font-size: 18px; line-height: 1.2; cursor: pointer; }
.card .title:hover { color: var(--terracotta); }
.card .orig { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .code { font-size: 14px; color: var(--muted); }
.variants { list-style: none; margin: 0; padding: 0 14px 10px; }
.variants li { display: grid; grid-template-columns: 18px 12px 1fr auto; align-items: center; gap: 8px; padding: 4px 0; border-top: 1px dashed var(--line); font-size: 15px; }
.variants li.sel { background: var(--terracotta-soft); margin: 0 -14px; padding: 4px 14px; }
.variants .fn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.variants .fn small { color: var(--muted); margin-left: 4px; }
.variants .pr { font-weight: 500; }
.variants .flag { color: var(--warn); font-weight: 500; }
.more { padding: 0 14px 12px; }
.pager { display: flex; justify-content: center; gap: 10px; margin: 26px 0 70px; }

.selbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 20px; z-index: 30;
  display: flex; align-items: center; gap: 16px; background: var(--graphite); color: #fff;
  padding: 10px 12px 10px 20px; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: 17px;
}
.selbar b { font-weight: 500; }

/* ---------- модальное окно ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(39,38,38,.6); z-index: 50; display: flex; justify-content: center; align-items: flex-start; overflow: auto; padding: 40px 20px; }
.modal { background: var(--paper); width: min(1180px, 100%); position: relative; }
.modal .close { position: absolute; right: 14px; top: 10px; background: none; border: none; font-size: 32px; cursor: pointer; line-height: 1; color: var(--muted); }
.modal-head { background: #fff; padding: 22px 28px 18px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 22px 28px 28px; display: grid; grid-template-columns: 1.05fr 1fr; gap: 28px; }
.gallery { display: grid; gap: 12px; }
.gallery figure { margin: 0; background: #fff; border: 1px solid var(--line); }
.gallery img { width: 100%; max-height: 420px; object-fit: contain; padding: 14px; }
.gallery figcaption { font-size: 13px; color: var(--muted); padding: 0 14px 8px; text-transform: uppercase; letter-spacing: .06em; }
.props { width: 100%; border-collapse: collapse; font-size: 16px; }
.props td { padding: 5px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.props td:first-child { color: var(--muted); width: 38%; padding-right: 12px; }
.section { margin-bottom: 22px; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 15px; background: #fff; }
.tbl th { text-align: left; font-weight: 500; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 8px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.tbl td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr.sel td { background: var(--terracotta-soft); }
.tbl .r { text-align: right; }
.tbl input[type=number], .tbl input[type=text] { padding: 4px 6px; }

/* ---------- ИИ-подбор ---------- */
.assistant { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; max-width: 1180px; }
.ask { background: #fff; border: 1px solid var(--line-strong); padding: 16px; }
.ask textarea { border: none; padding: 4px 2px; font-size: 20px; resize: vertical; min-height: 64px; }
.ask textarea:focus { outline: none; }
.ask-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 8px; }
.examples { display: flex; flex-wrap: wrap; gap: 8px; }
.examples button { background: none; border: 1px dashed var(--line-strong); padding: 4px 10px; cursor: pointer; font-size: 15px; color: var(--muted); }
.examples button:hover { color: var(--terracotta); border-color: var(--terracotta); }
.answer { background: #fff; border: 1px solid var(--line); padding: 18px 20px; }
.answer .summary { font-size: 19px; font-weight: 300; margin: 0 0 16px; white-space: pre-wrap; }
.picks { display: grid; gap: 10px; }
.pick { display: grid; grid-template-columns: 22px 110px 1fr auto; gap: 14px; align-items: center; border: 1px solid var(--line); padding: 10px 12px; }
.pick.sel { border-color: var(--terracotta); background: #fffaf8; }
.pick img, .pick .noimg { width: 110px; height: 82px; object-fit: contain; background: #fff; }
.pick .noimg { display: grid; place-items: center; color: var(--line-strong); font-size: 36px; }
.pick .why { color: var(--muted); font-size: 15px; margin-top: 3px; }
.pick .right { text-align: right; display: grid; gap: 6px; justify-items: end; }
.pick .right input { width: 70px; }
.steps { margin-top: 14px; font-size: 14px; color: var(--muted); }
.steps summary { cursor: pointer; text-transform: uppercase; letter-spacing: .05em; }
.steps code { font-size: 13px; }
.thinking { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 18px; }
.dot { width: 9px; height: 9px; background: var(--terracotta); border-radius: 50%; animation: pulse 1s infinite alternate; }
@keyframes pulse { from { opacity: .25 } to { opacity: 1 } }

/* ---------- спецификации ---------- */
.spec-list { display: grid; gap: 8px; max-width: 900px; }
.spec-row { display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center; background: #fff; border: 1px solid var(--line); padding: 12px 16px; text-decoration: none; }
.spec-row:hover { border-color: var(--terracotta); }
.spec-head { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: 12px; align-items: end; margin-bottom: 16px; }
.spec-head label { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); display: grid; gap: 4px; }
.settings { background: #fff; border: 1px solid var(--line); padding: 12px 16px; margin-bottom: 16px; }
.docs-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.docs-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.docs textarea, .settings textarea { font-size: 15px; }
.doc-label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.settings summary { cursor: pointer; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; font-size: 15px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 16px; margin-top: 12px; }
.settings-grid label { font-size: 14px; color: var(--muted); display: grid; gap: 3px; }
.settings-grid small { font-size: 12px; }
.room-row td { background: var(--graphite) !important; color: #fff; text-transform: uppercase; letter-spacing: .06em; font-weight: 500; font-size: 14px; }
.spec-tbl img { width: 64px; height: 50px; object-fit: contain; }
.spec-tbl .name { font-weight: 500; }
.spec-tbl .sub { font-size: 13px; color: var(--muted); }
.spec-tbl tr.calc-row td { background: #faf8f6; padding: 10px 14px 16px; }
/* Фото строки спецификации: миниатюра в строке и панель с тремя местами под фото и местом под чертёж */
.spec-tbl td.thumb { position: relative; cursor: pointer; width: 72px; }
.spec-tbl td.thumb .badge { position: absolute; right: 2px; bottom: 6px; background: var(--graphite); color: #fff; font-size: 11px; padding: 0 4px; border-radius: 3px; }
.spec-tbl .name.link { cursor: pointer; }
.spec-tbl .name.link:hover { color: var(--terracotta); }
.btn.on { border-color: var(--terracotta); color: var(--terracotta); }
.spec-tbl tr.media-row td { background: #faf8f6; padding: 10px 14px 16px; }
.media { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: flex-start; border: 1px dashed transparent; border-radius: 4px; padding: 4px; }
.media.over { border-color: var(--terracotta); background: var(--terracotta-soft); }
.media-title { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.media-slots { display: flex; gap: 10px; }
.media .slot { width: 150px; display: grid; gap: 4px; align-content: start; }
.spec-tbl .media .slot img { width: 150px; height: 112px; object-fit: contain; background: #fff; border: 1px solid #e6e1dd; }
.media .slot .tag { font-size: 12px; color: var(--muted); }
.media .slot-actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 8px; font-size: 13px; }
.media .slot-actions .main { color: var(--terracotta); font-size: 13px; }
.media .slot.empty { height: 112px; border: 1px dashed #c8c3bf; border-radius: 4px; cursor: pointer; place-items: center; align-content: center; color: var(--muted); background: #fff; }
.media .slot.empty span { font-size: 28px; line-height: 1; }
.media .slot.over, .media .slot.empty:hover { border-color: var(--terracotta); color: var(--terracotta); }
.media-help { flex-basis: 100%; font-size: 13px; }
/* Окно кадрирования фото строки спецификации */
.crop { background: var(--card); width: min(808px, 100%); margin: auto 0; padding: 18px 20px 16px; display: grid; gap: 12px; }
.crop h3 { margin: 0; font-weight: 500; font-size: 18px; text-transform: uppercase; letter-spacing: .04em; }
.crop canvas { display: block; max-width: 100%; touch-action: none; cursor: grab; justify-self: center; }
.crop-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-size: 14px; }
.crop-zoom, .crop-ratio { display: flex; align-items: center; gap: 6px; }
.crop-zoom input[type=range] { width: 170px; accent-color: var(--terracotta); }
.crop-zoom .muted { min-width: 44px; font-variant-numeric: tabular-nums; }
.crop-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.crop-foot > .muted { flex: 1 1 260px; font-size: 13px; }
.calc { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 16px; font-size: 14px; }
.calc .cell { display: grid; gap: 2px; }
.calc .cell span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.calc .cell input { padding: 3px 6px; font-size: 14px; }
.calc .cell.out b { font-weight: 500; font-size: 15px; }
.calc .cell.over input { border-color: var(--terracotta); background: var(--terracotta-soft); }
.calc .cell.spec input { border-color: var(--graphite); border-style: dashed; }
.calc .cell.vendor input { border-color: var(--warn); }
.calc .cell span em { font-style: normal; text-transform: none; letter-spacing: 0; color: var(--terracotta); }
.settings-grid input::placeholder, .tbl input::placeholder { color: #b5afab; }
.totals { display: flex; justify-content: flex-end; gap: 36px; background: var(--graphite); color: #fff; padding: 16px 22px; margin-top: 0; }
.totals div { display: grid; text-align: right; }
.totals span { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: #cfc9c5; }
.totals b { font-weight: 500; font-size: 24px; }

@media (max-width: 1100px) {
  .top-inner { gap: 20px; }
  .nav { gap: 18px; }
  .nav a { font-size: 15px; }
  .spec-chip { max-width: 180px; }
}
@media (max-width: 900px) {
  .spec-chip { display: none; }
}
@media (max-width: 1000px) {
  .catalog { grid-template-columns: 1fr; }
  .filters { position: static; max-height: none; }
  .modal-body { grid-template-columns: 1fr; }
  .nav { gap: 16px; }
  .brand-sub { display: none; }
  .brand-logo { height: 46px; }
  .spec-head { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  main { padding: 16px; }
  .top-inner { padding: 0 16px; gap: 14px; overflow-x: auto; }
  .nav a { font-size: 15px; }
  .spec-chip { display: none; }
  .pick { grid-template-columns: 22px 1fr; }
  .pick img, .pick .noimg { display: none; }
}

/* Форма правки карточки */
label.field { display: grid; gap: 4px; }
label.field > span { font-size: 13px; color: var(--muted); letter-spacing: .02em; }
label.field textarea { width: 100%; resize: vertical; }

/* ---------- обратная связь ---------- */
.fb-fab { position: fixed; right: 20px; bottom: 20px; z-index: 40; background: var(--graphite); color: #fff; border: none;
  padding: 11px 18px; font: inherit; font-size: 15px; font-weight: 500; letter-spacing: .03em; text-transform: uppercase;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); cursor: pointer; }
.fb-fab:hover { background: var(--terracotta); }
@media print { .fb-fab { display: none; } }
.fb-modal { width: min(680px, 100%); }
.fb-form { padding: 18px 28px 24px; display: grid; gap: 12px; }
.fb-form textarea, .fb-reply textarea { width: 100%; font-size: 15px; }
.fb-kinds, .fb-actions, .fb-filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fb-actions .check { margin-left: 8px; }
.picker { display: flex; gap: 10px; flex-wrap: wrap; border: 1px dashed transparent; border-radius: 4px; }
.picker.over { border-color: var(--terracotta); background: var(--terracotta-soft); }
.picker .shot { position: relative; width: 140px; height: 100px; }
.picker .shot img { width: 140px; height: 100px; object-fit: contain; background: #fff; border: 1px solid #e6e1dd; }
.picker .shot button { position: absolute; top: 4px; right: 4px; padding: 0 7px; background: #fff; }
.picker .shot.empty { border: 1px dashed #c8c3bf; border-radius: 4px; cursor: pointer; display: grid; place-items: center; align-content: center; color: var(--muted); background: #fff; }
.picker .shot.empty span { font-size: 26px; line-height: 1; }
.picker .shot.empty:hover { border-color: var(--terracotta); color: var(--terracotta); }
.fb-count { display: inline-block; margin-left: 6px; background: var(--terracotta); color: #fff; border-radius: 9px; padding: 0 7px; font-size: 12px; letter-spacing: 0; }
.fb-tbl .fb-row { cursor: pointer; }
.fb-tbl .fb-row:hover td { background: #faf8f6; }
.fb-excerpt { max-width: 560px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.fb-tbl .sub { font-size: 13px; color: var(--muted); }
.fb-kind { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.fb-kind.bug { color: var(--terracotta); }
.fb-status { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 10px; background: #eee9e5; color: var(--ink); white-space: nowrap; }
.fb-status.new { background: var(--terracotta); color: #fff; }
.fb-status.done { background: #e8c48a; }
.fb-status.closed { background: #e4e1de; color: var(--muted); }
.fb-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.fb-thread { display: grid; gap: 10px; margin-bottom: 16px; max-width: 900px; }
.fb-msg { background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--line-strong); padding: 10px 14px; }
.fb-msg.support { border-left-color: var(--terracotta); background: var(--terracotta-soft); }
.fb-msg-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.fb-msg-head .fb-status { margin-left: 6px; }
.fb-text { white-space: pre-wrap; margin-top: 6px; }
.fb-images { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.fb-images img { width: 200px; height: 140px; object-fit: contain; background: #fff; border: 1px solid #e6e1dd; }
.fb-reply { display: grid; gap: 10px; max-width: 900px; margin-bottom: 80px; }

/* ---------- система: вкладки под меню, статистика ---------- */
.subnav-bar { background: #fff; border-bottom: 1px solid var(--line); }
.subnav-bar .tabs.subnav { max-width: 1560px; margin: 0 auto; padding: 0 28px; border-bottom: none; gap: 28px; }
.subnav-bar .tabs.subnav a { padding: 12px 0 10px; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin: 14px 0 20px; }
.stat-card { background: #fff; border: 1px solid var(--line); padding: 12px 16px; display: grid; gap: 2px; }
.stat-card span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.stat-card b { font-weight: 500; font-size: 26px; }
.stat-card small { font-size: 13px; }
.stat-tbl th.sortable { cursor: pointer; white-space: nowrap; user-select: none; }
.stat-tbl th.sortable.on { color: var(--terracotta); }
.stat-tbl td.sub { font-size: 13px; color: var(--muted); }
.stat-tbl td.stat { position: relative; min-width: 92px; }
.stat-tbl td.stat .bar { position: absolute; left: 0; top: 0; bottom: 0; opacity: .18; }
.stat-tbl td.stat.ok .bar { background: #5d7a5a; }
.stat-tbl td.stat.mid .bar { background: #d9a43a; }
.stat-tbl td.stat.low .bar { background: var(--terracotta); }
.stat-tbl td.stat.low, .stat-tbl td.stat-low { color: var(--terracotta); }
