/* Retail Radar — «полевая метка».
   Сплошной тёмный логотип-блок, моноширинная шапка, срезанные уголки,
   жёсткие тени-плашки и плоская нижняя панель. Свой визуальный язык,
   не повторяющий чужие капсулы, иконки и шапки. */

:root {
  --paper: #f3f0e8;
  --paper-2: #eae5d8;
  --card: #ffffff;
  --surface: #14130f;
  --ink: #14130f;
  --ink-2: #2c2a23;
  --muted: #7c7668;
  --muted-2: #a29b8b;
  --line: #e2dbcb;
  --line-2: #d3cab6;
  --red: #e5342a;
  --red-soft: #fdecea;
  --lime: #cdf24a;
  --lime-2: #b9e02e;
  --blue: #1652e0;
  --shadow: 0 10px 30px rgba(20, 19, 15, .11);
  --shadow-sm: 0 1px 2px rgba(20, 19, 15, .05);
  /* Цвета на «тушевых» плашках (фон var(--surface)) и на лайме.
     В тёмной теме плашка становится светлой — текст обязан стать тёмным. */
  --on-ink: #f7f4ec;
  --on-ink-accent: var(--lime);
  --on-ink-soft: rgba(255, 255, 255, .16);
  --on-lime: #14130f;
  --nav-bg: rgba(255, 255, 255, .93);
  --radius: 18px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Тёмная тема — тот же ценник, но на бумаге ночного цвета. */
:root[data-theme="dark"] {
  --paper: #0e1013;
  --paper-2: #191d22;
  --card: #1e2329;
  /* Плашки остаются тёмными: в ночной теме белый фон выглядит как дыра. */
  --surface: #15191e;
  --ink: #f2efe6;
  --ink-2: #d9d4c8;
  --muted: #9a9385;
  --muted-2: #726c61;
  --line: #343a43;
  --line-2: #464e58;
  --red: #ff6256;
  --red-soft: #351d1d;
  --lime: #cdf24a;
  --lime-2: #b9e02e;
  --blue: #86a9ff;
  --shadow: 0 10px 30px rgba(0, 0, 0, .5);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --on-ink: #f2efe6;
  --on-ink-accent: var(--lime);
  --on-ink-soft: rgba(255, 255, 255, .12);
  --nav-bg: rgba(22, 25, 30, .95);
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(760px 340px at 12% -120px, rgba(205, 242, 74, .09), transparent 70%),
    radial-gradient(620px 320px at 100% -60px, rgba(255, 98, 86, .06), transparent 72%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .014) 0 1px, transparent 1px 26px),
    var(--paper);
}

:root[data-theme="dark"] input[type="text"]:focus,
:root[data-theme="dark"] textarea:focus {
  background: var(--card);
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(205, 242, 74, .12);
}
:root[data-theme="dark"] #helpText:focus,
:root[data-theme="dark"] .admin-block textarea:focus,
:root[data-theme="dark"] .admin-reply:focus { border-color: var(--lime); }
:root[data-theme="dark"] .banner.gold .banner-icon { background: rgba(0, 0, 0, .16); }
:root[data-theme="dark"] .banner.gold .banner-icon svg { stroke: #14130f; }
:root[data-theme="dark"] .quota.empty { color: #ff9d94; border-color: rgba(255, 98, 86, .4); }
:root[data-theme="dark"] .deal-img { background: #262a30; border-color: #343a42; }

/* Яркие «ценниковые» цвета магазинов — тёмные оттенки на ночном фоне
   превращались в нечитаемое месиво. */
:root[data-theme="dark"] .store-mark.magnit,
:root[data-theme="dark"] .store-badge.magnit,
:root[data-theme="dark"] .dot-magnit { background: rgba(225, 29, 72, .2); color: #ff9aab; }
:root[data-theme="dark"] .store-mark.pyaterochka,
:root[data-theme="dark"] .store-badge.pyaterochka,
:root[data-theme="dark"] .dot-5ka { background: rgba(22, 163, 74, .2); color: #75e0a0; }
:root[data-theme="dark"] .store-mark.vkusvill,
:root[data-theme="dark"] .store-badge.vkusvill,
:root[data-theme="dark"] .dot-vkusvill { background: rgba(45, 190, 100, .2); color: #8ae8ac; }
:root[data-theme="dark"] .store-mark.fixprice,
:root[data-theme="dark"] .store-badge.fixprice,
:root[data-theme="dark"] .dot-fixprice { background: rgba(242, 193, 78, .18); color: #ffd77a; }
:root[data-theme="dark"] .store-mark.metro,
:root[data-theme="dark"] .store-badge.metro,
:root[data-theme="dark"] .dot-metro { background: rgba(10, 92, 216, .22); color: #a9c6ff; }

/* Активная вкладка — светлая плашка, поэтому маркер на ней тёмный. */
:root[data-theme="dark"] .store-tab.active .store-mark {
  background: var(--on-ink-soft);
  color: var(--on-ink-accent);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(760px 340px at 12% -120px, rgba(205, 242, 74, .38), transparent 70%),
    radial-gradient(620px 320px at 100% -60px, rgba(229, 52, 42, .07), transparent 72%),
    repeating-linear-gradient(90deg, rgba(20, 19, 15, .018) 0 1px, transparent 1px 26px),
    var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

button, input { font-family: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.app {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 14px calc(104px + var(--safe-bottom));
}

/* ---------------------------------------------------------------- topbar */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 2px 14px;
}

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }

.brand-logo {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  border-radius: 13px;
  display: grid; place-items: center;
  background: var(--surface);
  color: var(--on-ink-accent);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -.5px;
  box-shadow: 0 6px 16px rgba(20, 19, 15, .22);
}

.brand-text { min-width: 0; }
.brand-text h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.45px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-text p {
  margin: 4px 0 0;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .2px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-actions { display: flex; gap: 8px; flex: 0 0 auto; }

.icon-btn {
  width: 38px; height: 38px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--card);
  color: var(--ink);
  display: inline-grid;
  place-items: center;
  padding: 0;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, background .12s ease;
}
.icon-btn:active { transform: scale(.94); background: var(--paper-2); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ----------------------------------------------------------------- views */

.view { animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.view-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 2px 14px;
}
.view-head h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 850;
  letter-spacing: -1px;
}
.view-sub { margin: 5px 0 0; color: var(--muted); font-size: 12px; font-weight: 500; }

/* ----------------------------------------------------------------- cards */

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.card-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.hint {
  margin: 9px 1px 0;
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.5;
}

input[type="text"] {
  width: 100%;
  height: 46px;
  border-radius: 13px;
  border: 1px solid var(--line-2);
  background: var(--paper);
  color: var(--ink);
  padding: 0 13px;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input[type="text"]::placeholder { color: var(--muted-2); font-weight: 400; }
input[type="text"]:focus {
  background: #fff;
  border-color: var(--surface);
  box-shadow: 0 0 0 3px rgba(20, 19, 15, .07);
}

.input-wrap { position: relative; }
.input-wrap > svg {
  position: absolute;
  left: 13px; top: 50%;
  width: 17px; height: 17px;
  transform: translateY(-50%);
  fill: none; stroke: var(--muted);
  stroke-width: 1.8; stroke-linecap: round;
}
.input-wrap > svg + input { padding-left: 39px; }
.input-clear {
  position: absolute;
  right: 9px; top: 50%;
  transform: translateY(-50%);
  width: 28px; height: 28px;
  border: 0; border-radius: 9px;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1;
}

/* ---------------------------------------------------------------- banner */

.banner {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
  background: var(--surface);
  color: var(--on-ink);
  text-align: left;
  box-shadow: 0 12px 26px rgba(20, 19, 15, .2);
}
.banner:active { filter: brightness(1.08); }
.banner-icon {
  flex: 0 0 auto;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: rgba(205, 242, 74, .16);
}
.banner-icon svg { width: 17px; height: 17px; fill: none; stroke: var(--lime); stroke-width: 1.8; stroke-linejoin: round; }
.banner-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.banner-text b { font-size: 14px; font-weight: 750; letter-spacing: -.2px; }
.banner-text small { font-size: 11.5px; opacity: .72; }

.banner.gold {
  background: linear-gradient(115deg, var(--red), #c1251d);
  box-shadow: 0 12px 26px rgba(197, 37, 29, .28);
}
.banner.gold .banner-icon { background: rgba(255, 255, 255, .18); }
.banner.gold .banner-icon svg { stroke: #fff; }
.banner.gold .banner-text small { opacity: .88; }

/* -------------------------------------------------------------- geo row */

.geo-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  text-align: left;
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.geo-row:active { border-color: var(--line-2); }

.geo-pin {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--red-soft);
}
.geo-pin svg { width: 17px; height: 17px; fill: none; stroke: var(--red); stroke-width: 1.9; }
.geo-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.geo-text b { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.geo-text small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { color: var(--muted-2); font-size: 20px; line-height: 1; }
.geo-art { display: none; }

/* ------------------------------------------------------------ store tabs */

.store-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 1px 12px;
  scrollbar-width: none;
}
.store-tabs::-webkit-scrollbar { display: none; }

.store-pager {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  margin-left: auto;
}
.pager-btn {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: var(--card);
  color: var(--ink);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}
.pager-btn:disabled { opacity: .35; cursor: default; }
.pager-label {
  font: 700 11px var(--mono);
  color: var(--muted);
  min-width: 30px;
  text-align: center;
}

.subscribe-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(20, 19, 15, .72);
  backdrop-filter: blur(4px);
}
.subscribe-gate.hidden { display: none; }
.subscribe-card {
  width: 100%;
  max-width: 340px;
  padding: 26px 22px 22px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: center;
}
.subscribe-icon { font-size: 38px; margin-bottom: 10px; }
.subscribe-card h2 { margin: 0 0 8px; font-size: 19px; color: var(--ink); }
.subscribe-card p { margin: 0 0 18px; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.subscribe-card .primary-btn { display: block; width: 100%; }

.store-tab {
  flex: 0 0 auto;
  height: 38px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--card);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  transition: .15s ease;
}
.store-tab:active { transform: scale(.97); }
.store-tab.active {
  border-color: var(--surface);
  background: var(--surface);
  color: var(--on-ink);
  box-shadow: 0 6px 16px rgba(20, 19, 15, .18);
}

.store-mark {
  width: 20px; height: 20px;
  border-radius: 6px;
  display: grid; place-items: center;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  background: var(--paper-2);
  color: var(--ink);
}
.store-mark.magnit { background: rgba(225, 29, 72, .12); color: #c9163f; }
.store-mark.pyaterochka { background: rgba(22, 163, 74, .13); color: #12803a; }
.store-mark.vkusvill { background: rgba(45, 190, 100, .14); color: #19974d; }
.store-mark.fixprice { background: rgba(242, 193, 78, .22); color: #96700f; }
.store-mark.metro { background: rgba(10, 92, 216, .12); color: #0a5cd8; }
.store-tab.active .store-mark { background: var(--on-ink-soft); color: var(--on-ink); }
.store-tab.locked {
  border-style: dashed;
  border-color: var(--line);
  background: transparent;
  color: var(--muted-2);
  opacity: .72;
}
.store-tab.locked .store-mark { background: var(--paper-2); color: var(--muted); }
.store-tab.locked::after { content: "🔒"; font-size: 10px; }

/* ----------------------------------------------------------------- stats */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 4px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 0 6px;
  border-right: 1px solid var(--line);
}
.stat:last-child { border-right: 0; }
.stat-num {
  font-family: var(--mono);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1;
}
.stat-cap {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--muted-2);
  text-align: center;
}

.quota {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -4px 2px 12px;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--paper-2);
  border: 1px dashed var(--line-2);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
}
.quota b { font-family: var(--mono); font-size: 12.5px; color: var(--ink); }
.quota.empty { background: var(--red-soft); border-color: rgba(229, 52, 42, .35); color: #8e1d16; }
.quota.empty b { color: var(--red); }

/* ------------------------------------------------------------ suggestions */

.suggest {
  position: absolute;
  left: 15px; right: 15px;
  top: 92px;
  z-index: 20;
  max-height: 320px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.suggest-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.suggest-item:last-child { border-bottom: 0; }
.suggest-item:active { background: var(--paper); }
.suggest-item img {
  width: 34px; height: 34px;
  border-radius: 9px;
  object-fit: cover;
  background: var(--paper-2);
  flex: 0 0 auto;
}
.suggest-item .s-title { flex: 1; min-width: 0; }
.suggest-item .s-title b {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.suggest-item .s-title small { font-size: 10.5px; color: var(--muted); }
.suggest-item .s-price { font-family: var(--mono); font-size: 12px; font-weight: 700; white-space: nowrap; }

/* ---------------------------------------------------------------- buttons */

.outline-btn {
  width: 100%;
  height: 44px;
  margin-top: 10px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--card);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.outline-btn:active { background: var(--paper); }
.outline-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.primary-btn {
  height: 46px;
  border-radius: 12px;
  border: 0;
  padding: 0 18px;
  background: var(--surface);
  color: var(--on-ink-accent);
  font-size: 13.5px;
  font-weight: 800;
}
.primary-btn:active { filter: brightness(1.2); }

.scan-btn {
  width: 100%;
  height: 58px;
  margin-top: 2px;
  border: 0;
  border-radius: 16px;
  background: var(--lime);
  color: var(--on-lime);
  font-size: 16px;
  font-weight: 850;
  letter-spacing: -.2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 12px 26px rgba(185, 224, 46, .45);
  transition: transform .12s ease, filter .12s ease;
}
.scan-btn:active { transform: scale(.99); filter: brightness(.97); }
.scan-btn:disabled { opacity: .5; box-shadow: none; }
.scan-btn-icon { display: grid; place-items: center; }
.scan-btn-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.scan-note {
  text-align: center;
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.5;
  padding: 12px 10px 2px;
}

/* --------------------------------------------------------------- progress */

.progress {
  margin-top: 12px;
  padding: 13px 14px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.progress-top { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.spinner {
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  border-top-color: var(--ink);
  animation: spin .8s linear infinite;
  flex: 0 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-bar {
  height: 5px;
  border-radius: 99px;
  background: var(--paper-2);
  margin-top: 11px;
  overflow: hidden;
}
.progress-bar i {
  display: block;
  height: 100%;
  width: 38%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--ink), var(--muted));
  animation: slide 1.5s ease-in-out infinite;
}
@keyframes slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(300%); }
}
.progress-meta { margin-top: 8px; font-size: 11px; color: var(--muted); }

/* ------------------------------------------------------------ article card */

.article-result {
  border: 1px solid var(--line-2);
  background: var(--card);
  border-radius: 16px;
  padding: 12px;
  margin: 12px 0;
  box-shadow: var(--shadow-sm);
}

/* ------------------------------------------------------------- chips/search */

.chip-row {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 1px 9px;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  border: 1px solid var(--line-2);
  background: var(--card);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.chip.active {
  border-color: var(--surface);
  background: var(--surface);
  color: var(--on-ink);
}
.chip-count {
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--paper-2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}
.chip.active .chip-count { background: var(--on-ink-soft); color: var(--on-ink); }
.chip-sort { color: var(--muted); border-style: dashed; }
.chip-sort::before { content: "↕"; margin-right: 5px; opacity: .6; }
.chip-sort.active { border-style: solid; color: var(--on-ink); }

.deals-search { margin-bottom: 12px; }

/* ------------------------------------------------------------------ deals */

.deal-list { display: flex; flex-direction: column; gap: 9px; }

.deal {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 10px 10px 14px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.deal::before {
  content: "";
  position: absolute;
  left: 0; top: 10px; bottom: 10px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--muted-2);
}
.deal.magnit::before { background: #e11d48; }
.deal.pyaterochka::before { background: #16a34a; }
.deal.vkusvill::before { background: #2dbe64; }
.deal.fixprice::before { background: #f2c14e; }
.deal.metro::before { background: #0a5cd8; }

.deal-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 62px; height: 62px;
}

.deal-img {
  width: 62px; height: 62px;
  border-radius: 11px;
  object-fit: contain;
  background: #f8f6f1;
  border: 1px solid #efebe0;
  display: block;
}

.deal-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.deal-title {
  font-size: 12.6px;
  font-weight: 600;
  line-height: 1.32;
  letter-spacing: -.1px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding-right: 30px;
}
.deal-bottom { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; margin-top: auto; }
.price-new {
  font-family: var(--mono);
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -.7px;
  color: var(--ink);
}
.price-old {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted-2);
  text-decoration: line-through;
}

.disc-badge {
  position: absolute;
  left: -6px;
  top: -6px;
  padding: 3px 6px;
  border-radius: 7px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--red);
  box-shadow: 0 3px 9px rgba(229, 52, 42, .35);
  border: 2px solid var(--card);
}

.deal-save {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
}
.deal-save b { color: var(--ink); font-weight: 800; }

.disc-pill {
  border-radius: 7px;
  padding: 3px 7px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  background: var(--red-soft);
  color: var(--red);
}
.store-badge {
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .2px;
  background: var(--paper-2);
  color: var(--ink-2);
}
.store-badge.magnit { background: rgba(225, 29, 72, .1); color: #c9163f; }
.store-badge.pyaterochka { background: rgba(22, 163, 74, .1); color: #12803a; }
.store-badge.vkusvill { background: rgba(45, 190, 100, .12); color: #19974d; }
.store-badge.fixprice { background: rgba(242, 193, 78, .2); color: #8d690c; }
.store-badge.metro { background: rgba(10, 92, 216, .1); color: #0a5cd8; }

.fav-btn {
  position: absolute;
  top: 8px; right: 8px;
  width: 26px; height: 26px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted-2);
  font-size: 15px;
  line-height: 1;
  display: grid;
  place-items: center;
}
.fav-btn.on { color: var(--red); }
.fav-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.fav-btn.on svg { fill: currentColor; }

.deal-link {
  align-self: center;
  flex: 0 0 auto;
  width: 30px; height: 30px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  display: grid; place-items: center;
  color: var(--ink-2);
  text-decoration: none;
}
.deal-link svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }

.more-btn {
  width: 100%;
  margin-top: 12px;
  height: 46px;
  border-radius: 13px;
  border: 1px dashed var(--line-2);
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
}

.empty {
  padding: 38px 16px;
  text-align: center;
  color: var(--muted-2);
  font-size: 13px;
  line-height: 1.55;
}
.empty b { display: block; color: var(--ink-2); margin-bottom: 5px; font-size: 14px; }

/* ---------------------------------------------------------------- history */

.history-list { display: flex; flex-direction: column; gap: 9px; }

.history-card {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card);
  color: var(--ink);
  padding: 13px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}
.history-card:active { border-color: var(--line-2); }
.history-date { font-size: 11.5px; color: var(--muted); margin-bottom: 3px; font-family: var(--mono); }
.history-store { font-size: 13.5px; font-weight: 750; letter-spacing: -.2px; }
.history-stats { margin-left: auto; text-align: right; flex: 0 0 auto; }
.history-stats b { display: block; font-family: var(--mono); font-size: 17px; font-weight: 700; letter-spacing: -.5px; }
.history-stats small { font-size: 10px; color: var(--muted-2); }

/* ---------------------------------------------------------------- profile */

.profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.avatar {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: grid; place-items: center;
  background: var(--surface);
  color: var(--on-ink-accent);
  font-weight: 800;
  font-size: 18px;
}
.profile-info { min-width: 0; flex: 1; }
.profile-info b { display: block; font-size: 15px; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-info small { color: var(--muted); font-size: 11.5px; }
.status-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 10px;
  font-weight: 800;
  background: var(--paper-2);
  color: var(--muted);
}
.status-pill.on { background: var(--lime); color: var(--on-lime); }

.sub-line { font-size: 13px; color: var(--ink-2); margin-bottom: 12px; line-height: 1.5; }
#subBtn { width: 100%; }

.store-list { display: flex; flex-direction: column; gap: 11px; }
.store-line { display: flex; align-items: center; gap: 9px; font-size: 12.5px; }
.store-line b { font-weight: 700; }
.store-line span:last-child { margin-left: auto; color: var(--muted-2); font-size: 11px; }
.store-line.locked { opacity: .5; }
.store-line.locked b { color: var(--muted); }
.store-dot {
  width: 24px; height: 24px;
  border-radius: 8px;
  display: grid; place-items: center;
  font-family: var(--mono);
  font-size: 9.5px; font-weight: 700;
}
.dot-magnit { background: rgba(225, 29, 72, .12); color: #c9163f; }
.dot-5ka { background: rgba(22, 163, 74, .13); color: #12803a; }
.dot-vkusvill { background: rgba(45, 190, 100, .14); color: #19974d; }
.dot-fixprice { background: rgba(242, 193, 78, .24); color: #8d690c; }
.dot-metro { background: rgba(10, 92, 216, .12); color: #0a5cd8; }

.version { text-align: center; color: var(--muted-2); font-size: 10.5px; padding: 18px 0 4px; }

/* -------------------------------------------------------------------- geo */

.geo-current { font-size: 14.5px; line-height: 1.45; color: var(--ink); font-weight: 600; }
.row-btns { display: flex; gap: 8px; margin-top: 10px; }
.row-btns .outline-btn { margin-top: 0; flex: 1; }
.row-btns .primary-btn { flex: 0 0 auto; }

/* ------------------------------------------------------------- bottom nav */

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: calc(10px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 30;
  width: min(532px, calc(100% - 20px));
  height: 64px;
  display: flex;
  align-items: stretch;
  padding: 6px;
  border-radius: 20px;
  border: 1px solid var(--line-2);
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  box-shadow: 0 16px 36px rgba(20, 19, 15, .16);
}

.nav-btn {
  flex: 1;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0;
  min-width: 0;
}
.nav-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.nav-btn span { font-size: 9px; font-weight: 700; letter-spacing: .1px; }
.nav-btn.active { color: var(--on-ink-accent); background: var(--surface); }
.nav-btn.active span { color: var(--on-ink-accent); }

/* ------------------------------------------------------------------ toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(86px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 50;
  max-width: min(480px, calc(100% - 28px));
  padding: 11px 15px;
  border-radius: 13px;
  border: 1px solid var(--surface);
  background: var(--surface);
  color: var(--on-ink);
  font-size: 12.5px;
  line-height: 1.45;
  text-align: center;
  box-shadow: var(--shadow);
  animation: toast-in .18s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ------------------------------------------------------------------ modal */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(20, 19, 15, .72);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
  backdrop-filter: blur(6px);
}
.modal-card {
  width: min(520px, 100%);
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 20px;
  padding: 14px;
  margin-bottom: calc(6px + var(--safe-bottom));
  box-shadow: var(--shadow);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.modal-head b { font-size: 15px; letter-spacing: -.2px; }
.modal-head .icon-btn { font-size: 20px; color: var(--ink-2); }
.barcode-box {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 4 / 3;
}
.barcode-box video { width: 100%; height: 100%; object-fit: cover; }
.barcode-frame {
  position: absolute;
  left: 12%; right: 12%;
  top: 28%; bottom: 28%;
  border: 2px solid var(--lime);
  border-radius: 12px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, .3);
}

/* ---------------------------------------------------------- profile extras */

.store-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.store-switch:last-child { border-bottom: 0; padding-bottom: 0; }
.store-switch b { font-weight: 700; }
.store-switch .sw-state { margin-left: auto; color: var(--muted-2); font-size: 11px; }
.switch-btn {
  flex: 0 0 auto;
  width: 38px; height: 22px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--paper-2);
  position: relative;
  transition: background .18s, border-color .18s;
}
.switch-btn::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform .18s, background .18s;
}
.switch-btn.on { background: var(--lime); border-color: var(--lime-2); }
.switch-btn.on::after { transform: translateX(16px); background: var(--on-lime); }
.switch-btn.locked { opacity: .45; }

.tariff-list { display: grid; gap: 8px; margin-bottom: 12px; }
.tariff-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 1.5px solid var(--line);
  border-radius: 13px;
  background: var(--card);
  padding: 11px 12px;
  transition: border-color .15s, box-shadow .15s;
}
.tariff-item.active {
  border-color: var(--surface);
  box-shadow: 0 0 0 2px var(--lime);
}
.tariff-top { display: flex; align-items: baseline; gap: 8px; }
.tariff-title { font-size: 13.5px; font-weight: 800; color: var(--ink); }
.tariff-price {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.tariff-old { font-family: var(--mono); font-size: 11px; color: var(--muted-2); text-decoration: line-through; }
.tariff-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .4px;
  text-transform: uppercase;
}
.tariff-sub { margin-top: 3px; font-size: 11px; line-height: 1.4; color: var(--muted); }

.ref-card .ref-text { margin: 2px 0 10px; font-size: 12px; line-height: 1.5; color: var(--ink-2); }
.ref-link {
  padding: 10px 11px;
  margin-bottom: 10px;
  border: 1px dashed var(--line-2);
  border-radius: 11px;
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--ink-2);
  word-break: break-all;
}

.legal-links { display: grid; gap: 6px; margin: 18px 2px 10px; }
.legal-links button {
  border: 0;
  background: transparent;
  padding: 5px 0;
  text-align: left;
  font-size: 11.5px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.disclaimer { margin: 0 2px; font-size: 10px; line-height: 1.5; color: var(--muted-2); }

.legal-card { width: min(540px, 94vw); }
.legal-body { max-height: 68vh; overflow-y: auto; padding-right: 4px; }
.legal-body h3 {
  margin: 18px 0 6px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink);
}
.legal-body h3:first-child { margin-top: 4px; }
.legal-body p { margin: 0 0 9px; font-size: 12px; line-height: 1.6; color: var(--ink-2); }
.legal-body .legal-date {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted-2);
  margin-bottom: 12px;
}

/* ------------------------------------------------------------------- help */

.help-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  margin: 16px 0 4px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.help-link > span:nth-child(2) { flex: 1; display: grid; gap: 2px; }
.help-link b { font-size: 13px; }
.help-link small { font-size: 10.5px; color: var(--muted); }
.help-link .chev { color: var(--muted-2); font-size: 18px; }

#helpText {
  width: 100%;
  resize: vertical;
  min-height: 104px;
  margin-top: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--paper-2);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  outline: none;
}
#helpText::placeholder { color: var(--muted-2); }
#helpText:focus { border-color: var(--surface); }
.help-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}
.help-foot .hint { margin: 0; flex: 1; }
.help-foot .primary-btn { flex: 0 0 auto; }
.theme-btn-on svg { opacity: 1; }

/* ------------------------------------------------------------- admin panel */

.admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.admin-head h2 { margin: 2px 0 0; font-size: 23px; letter-spacing: -.02em; }
.admin-head .eyebrow { font: 800 10px var(--mono); color: var(--red); letter-spacing: .14em; }
.admin-badge {
  padding: 6px 9px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--on-ink-accent);
  font: 800 9.5px var(--mono);
  letter-spacing: .08em;
  white-space: nowrap;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.admin-stat {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card);
}
.admin-stat b { display: block; font: 800 20px var(--mono); color: var(--ink); }
.admin-stat span { font-size: 11px; color: var(--muted); }

.admin-block {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  overflow: hidden;
}
.admin-block > summary {
  padding: 13px 14px;
  font-weight: 800;
  font-size: 13.5px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.admin-block > summary::-webkit-details-marker { display: none; }
.admin-block > summary::after { content: "＋"; float: right; color: var(--muted); }
.admin-block[open] > summary::after { content: "−"; }
.admin-block[open] > summary { border-bottom: 1px solid var(--line); }

.admin-form, .admin-search {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 12px 14px;
}
.admin-form input, .admin-search input,
.admin-block textarea, .admin-reply {
  width: 100%;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: 600 13px var(--ui-font, inherit);
  outline: none;
}
.admin-form input:focus, .admin-search input:focus,
.admin-block textarea:focus, .admin-reply:focus { border-color: var(--surface); }
.admin-form .primary-btn, .admin-search .outline-btn,
.admin-block > .primary-btn { grid-column: 1 / -1; }
.admin-search { grid-template-columns: 1fr auto; }
.admin-search .outline-btn { grid-column: auto; }
.admin-block textarea { margin: 0 14px; width: calc(100% - 28px); resize: vertical; }
.admin-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 4px;
  font-size: 12px;
  color: var(--muted);
}
.admin-block > .primary-btn { margin: 10px 14px 14px; width: calc(100% - 28px); }

.admin-list { padding: 0 14px 14px; }
.admin-row {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.admin-row:last-child { border-bottom: 0; }
.admin-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.admin-row-top b { font-size: 13px; color: var(--ink); word-break: break-all; }
.admin-row-meta { font-size: 11px; color: var(--muted); line-height: 1.45; }
.admin-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.admin-tools button, .admin-tools select {
  padding: 7px 9px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
  font: 700 11px inherit;
  cursor: pointer;
}
.admin-tools button.danger { color: var(--red); border-color: var(--red-soft); }
.admin-pill {
  padding: 3px 7px;
  border-radius: 7px;
  background: var(--paper-2);
  color: var(--muted);
  font: 800 9.5px var(--mono);
  white-space: nowrap;
}
.admin-pill.on { background: var(--lime); color: var(--on-lime); }
.admin-support-text {
  margin: 6px 0;
  padding: 9px;
  border-radius: 9px;
  background: var(--paper-2);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink);
}
.admin-reply { margin-top: 6px; }
.admin-empty { padding: 14px 0; font-size: 12px; color: var(--muted); }

/* ================================================================= IDENTITY 2
   «Полевая метка»: логотип-полоса, моно-шапка, срезанный уголок,
   жёсткие тени-плашки, плоская нижняя панель вместо плавающей капсулы. */

.app { padding: 0 0 calc(84px + var(--safe-bottom)); }
.content { padding: 0 14px; }

/* --------------------------------------------------------------- masthead */

.topbar {
  position: relative;
  display: block;
  margin: 0 0 14px;
  padding: 14px 14px 0;
  background: var(--surface);
  color: var(--on-ink);
  border-radius: 0 0 24px 24px;
  overflow: hidden;
}
.topbar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: repeating-linear-gradient(
    90deg, var(--on-ink-accent) 0 18px, var(--red) 18px 30px, transparent 30px 36px
  );
}
.masthead-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.topbar .brand { gap: 10px; }
.topbar .brand-logo {
  position: relative;
  width: 40px; height: 40px;
  border-radius: 9px;
  border: 2px solid var(--on-ink-accent);
  background: transparent;
  box-shadow: none;
  color: var(--on-ink-accent);
}
.topbar .brand-logo span { font-size: 0; }
.topbar .brand-logo::before {
  content: "";
  position: absolute; inset: 8px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}
.topbar .brand-logo::after {
  content: "";
  position: absolute;
  width: 5px; height: 5px;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--red);
}
.topbar .brand-text { min-width: 0; }
.brand-kicker {
  margin-bottom: 4px;
  font: 800 8.5px var(--mono);
  letter-spacing: .16em;
  color: var(--on-ink-accent);
  white-space: nowrap;
}
.topbar .brand-text h1 {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .09em;
  color: var(--on-ink);
}
.topbar .top-actions { gap: 6px; }
.topbar .icon-btn {
  width: 42px; height: 42px;
  flex-direction: column;
  gap: 2px;
  border-radius: 7px;
  border: 1px solid var(--on-ink-soft);
  background: rgba(127, 127, 127, .12);
  color: var(--on-ink);
  box-shadow: none;
}
.topbar .icon-btn:active { transform: none; background: var(--on-ink-soft); }
.topbar .icon-btn svg { width: 16px; height: 16px; }
.topbar .icon-btn small {
  font: 800 6.5px var(--mono);
  letter-spacing: .06em;
  color: var(--on-ink-accent);
}
.masthead-ticker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 0 10px;
  border-top: 1px solid var(--on-ink-soft);
  font: 700 8.5px var(--mono);
  letter-spacing: .09em;
  color: var(--on-ink);
  opacity: .85;
  white-space: nowrap;
  overflow: hidden;
}
.ticker-dot {
  flex: 0 0 auto;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(229, 52, 42, .22);
  animation: ticker-pulse 1.8s ease-in-out infinite;
}
@keyframes ticker-pulse { 50% { opacity: .35; transform: scale(.8); } }
.ticker-sep {
  flex: 1;
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--on-ink-soft) 0 4px, transparent 4px 8px);
}

/* ------------------------------------------------------------ alert strip */

.banner {
  border: 1.5px solid var(--surface);
  border-radius: 4px 15px 4px 15px;
  padding: 11px 12px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--surface);
}
.banner:active { filter: none; transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--surface); }
.banner-icon { border-radius: 5px; background: var(--red); }
.banner-icon svg { stroke: #fff; }
.banner-text b {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.banner.gold { background: var(--lime); box-shadow: 4px 4px 0 var(--surface); }
.banner.gold .banner-icon { background: var(--surface); }
.banner.gold .banner-icon svg { stroke: var(--lime); }
.banner.gold .banner-text small { color: var(--on-lime); opacity: .75; }

/* ---------------------------------------------------------------- geo card */

.geo-row {
  border: 1.5px solid var(--line-2);
  border-left: 5px solid var(--blue);
  border-radius: 4px 15px 4px 15px;
  box-shadow: none;
}
.geo-pin { border-radius: 5px; }
.geo-text b { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .02em; }

/* --------------------------------------------------------------- scoreboard */

.stats {
  background: var(--surface);
  border-color: var(--surface);
  border-radius: 4px 15px 4px 15px;
  padding: 13px 4px;
  box-shadow: 5px 5px 0 var(--lime);
}
.stat { border-right-color: var(--on-ink-soft); }
.stat-num { color: var(--on-ink-accent); }
.stat-cap { color: var(--on-ink); opacity: .62; }

/* -------------------------------------------------------------- tag shapes */

.card, .article-result, .progress, .history-card, .help-link, .profile-card,
.modal-card, .subscribe-card, .admin-block, .admin-stat {
  border-radius: 4px 15px 4px 15px;
}
.card { box-shadow: 3px 3px 0 var(--paper-2); }
.card-label {
  font-family: var(--mono);
  letter-spacing: .13em;
  color: var(--red);
}
.subscribe-card {
  border: 2px solid var(--surface);
  box-shadow: 7px 7px 0 var(--lime);
}

.store-tab, .chip {
  border-radius: 0;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 0 100%);
  border: 1.5px solid var(--line-2);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.store-tab.active, .chip.active {
  background: var(--surface);
  border-color: var(--surface);
  color: var(--on-ink-accent);
  box-shadow: none;
}
.pager-btn { border-radius: 0; clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 0 100%); }
.quota { border-radius: 4px 11px 4px 11px; border-left: 4px solid var(--red); }

/* ------------------------------------------------------------------ buttons */

.primary-btn, .outline-btn, .more-btn {
  border-radius: 0;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.primary-btn {
  background: var(--lime);
  color: var(--on-lime);
  border: 2px solid var(--surface);
  box-shadow: 4px 4px 0 var(--surface);
}
.primary-btn:active { filter: none; transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--surface); }
.outline-btn {
  border: 1.5px dashed var(--line-2);
  background: transparent;
  box-shadow: none;
}
.outline-btn:active { background: var(--paper-2); }
.more-btn { border-style: dashed; }

.scan-btn {
  position: relative;
  height: 62px;
  padding-right: 44px;
  border: 2px solid var(--surface);
  border-radius: 0;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  background: var(--surface);
  color: var(--on-ink);
  box-shadow: 6px 6px 0 var(--lime);
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.scan-btn:active { transform: translate(4px, 4px); box-shadow: 2px 2px 0 var(--lime); filter: none; }
.scan-btn-icon {
  width: 34px; height: 34px;
  border-radius: 4px;
  background: var(--lime);
  color: var(--on-lime);
}
.scan-btn::after {
  content: "→";
  position: absolute;
  right: 16px;
  font-size: 20px;
  color: var(--on-ink-accent);
}

/* -------------------------------------------------------------------- deals */

.deal { border-radius: 4px 14px 4px 14px; box-shadow: 3px 3px 0 var(--paper-2); }
.deal::before { width: 5px; }
.deal.magnit::before { background: repeating-linear-gradient(180deg, #e11d48 0 6px, transparent 6px 10px); }
.deal.pyaterochka::before { background: repeating-linear-gradient(180deg, #16a34a 0 6px, transparent 6px 10px); }
.deal.vkusvill::before { background: repeating-linear-gradient(180deg, #2dbe64 0 6px, transparent 6px 10px); }
.deal.fixprice::before { background: repeating-linear-gradient(180deg, #d4a421 0 6px, transparent 6px 10px); }
.deal.metro::before { background: repeating-linear-gradient(180deg, #0a5cd8 0 6px, transparent 6px 10px); }
.disc-badge { border-radius: 4px 9px 4px 9px; transform: rotate(-4deg); }
.price-new { font-family: var(--mono); }
.disc-pill { border-radius: 3px 8px 3px 8px; }
.store-badge { border-radius: 3px 7px 3px 7px; font-family: var(--mono); }

/* -------------------------------------------------------------- bottom rail */

.bottom-nav {
  left: 50%;
  bottom: 0;
  width: min(560px, 100%);
  height: auto;
  display: flex;
  gap: 2px;
  padding: 6px 6px calc(6px + var(--safe-bottom));
  border: 0;
  border-top: 2px solid var(--surface);
  border-radius: 16px 16px 0 0;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  box-shadow: 0 -8px 26px rgba(20, 19, 15, .12);
  transform: translateX(-50%);
}
.nav-btn {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 7px 0 4px;
  border-radius: 4px;
  gap: 3px;
}
.nav-btn::before {
  content: "";
  position: absolute;
  top: 0; left: 24%; right: 24%;
  height: 3px;
  background: transparent;
}
.nav-btn svg { width: 17px; height: 17px; }
.nav-btn span {
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.nav-btn.active { background: transparent; color: var(--ink); }
.nav-btn.active::before { background: var(--red); }
.nav-btn.active span { color: var(--ink); }

.toast {
  bottom: calc(80px + var(--safe-bottom));
  border-radius: 0;
  border-width: 1px 1px 1px 4px;
  border-left-color: var(--red);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
}
.modal-card { border: 2px solid var(--surface); }
.barcode-frame { border-radius: 4px 14px 4px 14px; }
.avatar { border-radius: 4px 12px 4px 12px; }
.status-pill, .admin-badge, .admin-pill { border-radius: 3px 8px 3px 8px; font-family: var(--mono); }
.admin-head h2 { font-family: var(--mono); letter-spacing: .02em; text-transform: uppercase; font-size: 20px; }
.admin-block > summary { font-family: var(--mono); text-transform: uppercase; font-size: 11.5px; letter-spacing: .04em; }

:root[data-theme="dark"] .stats { box-shadow: 5px 5px 0 var(--on-ink-accent); }
:root[data-theme="dark"] .card { box-shadow: 3px 3px 0 var(--paper-2); }
:root[data-theme="dark"] .banner { box-shadow: 4px 4px 0 var(--on-ink); }

/* ---------------------------------------------------------------- responsive */

@media (min-width: 700px) {
  .bottom-nav { bottom: 14px; border-radius: 16px; }
  .toast { bottom: calc(94px + var(--safe-bottom)); }
}
