:root, html[data-theme="dark"] {
  --navy: #e8eef6;
  --navy-2: #c5d2e3;
  --deep: #12151c;
  --cyan: #f0c75e;
  --cyan-2: #ffe9a8;
  --gold: #f0c75e;
  --gold-2: #e8b84a;
  --bg: #151922;
  --bg-glow-1: rgba(240, 199, 94, .1);
  --bg-glow-2: rgba(255, 255, 255, .04);
  --card: rgba(28, 33, 44, .92);
  --text: #ffffff;
  --muted: #c8d0db;
  --line: #2c3342;
  --link: #ffffff;
  --link-hover: #f0f4f8;
  --heading: #ffffff;
  --header-bg: rgba(22, 26, 34, .94);
  --nav-bg: rgba(18, 21, 28, .96);
  --nav-text: #ffffff;
  --nav-hover: #232833;
  --search-bg: linear-gradient(90deg, #1d2230, #181d28 55%, #1a2220);
  --search-border: rgba(255, 255, 255, .12);
  --input-bg: #1c212c;
  --surface: #1c212c;
  --surface-2: #232833;
  --table-head: #1a1f2a;
  --table-hover: #1f2531;
  --footer-bg: #10131a;
  --chip-bg: #232833;
  --logo-title: #ffffff;
  --ok: #3dd68c;
  --warn: #f0c75e;
  --err: #ff6b6b;
  --shadow: 0 18px 50px rgba(0, 0, 0, .28);
  --shadow-hover: 0 22px 40px rgba(0, 0, 0, .38);
  --radius: 20px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --theme-icon-dark: none;
  --theme-icon-light: inline;
}

html[data-theme="light"] {
  --navy: #111827;
  --navy-2: #374151;
  --deep: #111827;
  --cyan: #b8860b;
  --cyan-2: #8a6a12;
  --gold: #c9962e;
  --gold-2: #a67c1a;
  --bg: #ffffff;
  --bg-glow-1: rgba(0, 0, 0, .03);
  --bg-glow-2: rgba(0, 0, 0, .02);
  --card: #ffffff;
  --text: #111111;
  --muted: #4b5563;
  --line: #d1d5db;
  --link: #111111;
  --link-hover: #000000;
  --heading: #000000;
  --header-bg: rgba(255, 255, 255, .96);
  --nav-bg: #f3f4f6;
  --nav-text: #111111;
  --nav-hover: #e5e7eb;
  --search-bg: linear-gradient(90deg, #f3f4f6, #eef2f7 55%, #f3f4f6);
  --search-border: #d1d5db;
  --input-bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f4f6;
  --table-head: #f3f4f6;
  --table-hover: #f9fafb;
  --footer-bg: #f3f4f6;
  --chip-bg: #e5e7eb;
  --logo-title: #000000;
  --ok: #166534;
  --warn: #92400e;
  --err: #991b1b;
  --shadow: 0 12px 30px rgba(0, 0, 0, .08);
  --shadow-hover: 0 16px 36px rgba(0, 0, 0, .12);
  --theme-icon-dark: inline;
  --theme-icon-light: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Outfit, Manrope, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(980px 460px at 6% -12%, var(--bg-glow-1), transparent 55%),
    radial-gradient(760px 420px at 100% 0%, var(--bg-glow-2), transparent 48%),
    var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  letter-spacing: .01em;
  transition: background .25s var(--ease), color .25s var(--ease);
}
a { color: var(--link); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--link-hover); }
img { max-width: 100%; }
button, input, textarea, select { font-family: inherit; color: inherit; }

.header-inner, .nav-inner, .search-inner, .container, .footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--deep);
  /* без backdrop-filter — на скролле даёт мерцание */
  transform: translateZ(0);
}
html[data-theme="light"] .site-head {
  background: #ffffff;
}
body.is-scrolled .site-head {
  box-shadow: 0 10px 28px rgba(0, 0, 0, .28);
}
body.is-scrolled .contacts-panel { display: none; }
body.is-scrolled .header-inner {
  padding: 8px 0;
  grid-template-columns: minmax(160px, 220px) auto;
}
body.is-scrolled .logo small { display: none; }
body.is-scrolled .auth-meta em { display: none; }

.header {
  background: var(--header-bg);
  border-bottom: 1px solid rgba(240, 199, 94, .12);
}
.header-inner {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr auto;
  gap: 18px 24px;
  padding: 14px 0;
  align-items: center;
}
.logo {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text);
  min-width: 0;
}
.logo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(240, 199, 94, .12), rgba(240, 199, 94, .03));
  border: 1px solid rgba(240, 199, 94, .2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
  transition: transform .3s var(--ease), border-color .3s;
}
.logo:hover .logo-text {
  transform: translateY(-1px);
  border-color: rgba(240, 199, 94, .4);
}
.logo-text strong {
  font-family: Syne, Outfit, sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--logo-title);
  line-height: 1.15;
}
.logo-text em {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .02em;
}
.logo small {
  letter-spacing: 2.8px;
  text-transform: uppercase;
  color: var(--muted);
  font-size: 10px;
  margin-left: 8px;
}
body.is-scrolled .logo-text { padding: 4px 8px; }
body.is-scrolled .logo-text strong { font-size: 16px; }
body.is-scrolled .logo-text em { display: none; }
.contacts-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 24px;
  justify-self: stretch;
  font-size: 14px;
}
.contacts-panel a { color: var(--text); font-weight: 700; }
.contacts-panel .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.messengers { display: flex; gap: 8px; align-items: center; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--chip-bg);
  font-size: 12px;
  font-weight: 800;
  transition: transform .2s var(--ease), background .2s;
}
.chip:hover { transform: translateY(-1px); }
.chip.tg { color: #7ec8ff; }
.chip.max { color: #c5b4ff; }
.addr { color: var(--muted); font-size: 13px; text-align: right; }

.auth-rail {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.auth-rail-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(240, 199, 94, .35);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  place-items: center;
  padding: 0;
  flex: 0 0 auto;
}
.nav-toggle-bars {
  display: grid;
  gap: 5px;
  width: 18px;
}
.nav-toggle-bars i {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .22s var(--ease), opacity .22s var(--ease);
}
body.nav-open .nav-toggle-bars i:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .nav-toggle-bars i:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle-bars i:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.site-menu-contacts,
.site-menu-auth,
.nav-backdrop {
  display: none;
}
.search-actions {
  display: contents;
}
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(240, 199, 94, .35);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  font-size: 16px;
  transition: transform .2s var(--ease), background .2s, border-color .2s;
}
.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(240, 199, 94, .6);
}
.theme-toggle .icon-sun { display: var(--theme-icon-dark); }
.theme-toggle .icon-moon { display: var(--theme-icon-light); }
.auth-user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  background: rgba(240, 199, 94, .08);
  border: 1px solid rgba(240, 199, 94, .18);
  color: var(--text) !important;
  max-width: 240px;
  transition: background .2s var(--ease), border-color .2s, transform .2s;
}
.auth-user:hover {
  background: rgba(240, 199, 94, .14);
  border-color: rgba(240, 199, 94, .32);
  transform: translateY(-1px);
}
.auth-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f0c75e, #c9962e);
  color: #1a1508;
  font-weight: 800;
  flex: 0 0 auto;
}
.auth-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}
.auth-meta strong {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}
.auth-meta em {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
}
.auth-out {
  color: var(--muted) !important;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 10px;
}
.auth-out:hover { color: var(--heading) !important; }
.auth-login {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(240, 199, 94, .35);
  color: #ffe9a8 !important;
  font-weight: 700;
  font-size: 14px;
  transition: background .2s, transform .2s, border-color .2s;
}
.auth-login:hover {
  background: rgba(240, 199, 94, .1);
  border-color: rgba(240, 199, 94, .55);
  transform: translateY(-1px);
}
.auth-register {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f5d57a, #e0ad3a);
  color: #1a1508 !important;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 8px 18px rgba(224, 173, 58, .25);
  transition: transform .2s, filter .2s;
}
.auth-register:hover { transform: translateY(-1px); filter: brightness(1.05); }

.nav {
  background: var(--nav-bg);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  gap: 8px;
  overflow: auto;
  padding: 8px 0;
}
.nav a {
  padding: 8px 16px;
  color: var(--nav-text);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  border-radius: 999px;
  transition: background .22s var(--ease), color .22s var(--ease), box-shadow .22s var(--ease), transform .22s var(--ease);
}
.nav a:hover {
  background: var(--nav-hover);
  color: var(--heading);
  transform: translateY(-2px);
}
.nav a.active {
  background: linear-gradient(135deg, #e0ad3a, #f0c75e);
  color: #1a1508;
  box-shadow: 0 8px 18px rgba(224, 173, 58, .22);
}
.nav a.active:hover { color: #1a1508; transform: none; }

.searchbar {
  background: var(--search-bg);
  border-top: 1px solid var(--search-border);
}
.search-inner {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 8px;
  padding: 12px 0;
  align-items: center;
}
.searchbar .label {
  background: var(--surface);
  color: var(--link);
  border: 1px solid rgba(240, 199, 94, .2);
  padding: 11px 18px;
  font-weight: 800;
  border-radius: 999px;
}
.searchbar input, .searchbar textarea {
  border: 1px solid var(--line);
  min-height: 46px;
  padding: 12px 18px;
  font-size: 15px;
  border-radius: 18px;
  outline: none;
  background: var(--input-bg);
  color: var(--text);
  box-shadow: var(--shadow);
  resize: vertical;
  width: 100%;
}
.searchbar input:focus, .searchbar textarea:focus { box-shadow: 0 0 0 3px rgba(240, 199, 94, .28); }
.search-multi { align-items: start; }
.search-guest textarea[data-auth-required] {
  cursor: pointer;
  caret-color: transparent;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-modal[hidden] { display: none !important; }
.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 18, .62);
  backdrop-filter: blur(4px);
}
html[data-theme="light"] .auth-modal-backdrop {
  background: rgba(17, 24, 39, .42);
}
.auth-modal-card {
  position: relative;
  width: min(420px, 100%);
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  padding: 24px 22px 20px;
  animation: auth-pop .22s var(--ease);
}
.auth-modal-card h3 {
  margin: 0 0 8px;
  font-family: Syne, Outfit, sans-serif;
  font-size: 22px;
  color: var(--heading);
}
.auth-modal-card p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.45;
}
.auth-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
@keyframes auth-pop {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-modal-card { animation: none; }
}
.searchbar button.icon, .searchbar a.icon, .cart-pill {
  height: 46px;
  border: 0;
  background: var(--deep);
  color: #fff;
  padding: 0 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  border-radius: 999px;
  transition: transform .2s var(--ease), filter .2s, box-shadow .2s;
  text-decoration: none;
}
.searchbar button.icon, .searchbar a.icon {
  background: linear-gradient(180deg, #f5d57a, #e0ad3a);
  color: #1a1508 !important;
}
.search-locked .search-lock-note {
  height: 46px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 600;
  border: 1px solid var(--line);
}
.searchbar button.icon:hover, .cart-pill:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}
.cart-pill { text-decoration: none; color: #fff !important; border: 1px solid rgba(240, 199, 94, .2); }
html[data-theme="light"] .cart-pill { background: #1c2430; }
.cart-pill span { display: block; font-size: 12px; font-weight: 500; opacity: .85; }

.balance-pill {
  display: inline-flex;
  flex-direction: column;
  background: rgba(48, 64, 36, .7);
  border: 1px solid #4e6b3a;
  color: #d8f5b7;
  padding: 5px 10px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.2;
}
.balance-pill b { font-size: 14px; }
.balance-pill.debt { background: rgba(80, 24, 24, .7); border-color: #7a3030; color: #ffb4b4; }

.container { padding: 28px 0 56px; flex: 1; animation: page-in .45s var(--ease); }
.footer {
  background: var(--footer-bg);
  color: var(--muted);
  padding: 32px 0;
  font-size: 13px;
  border-top: 1px solid rgba(240, 199, 94, .1);
}
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-links {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  text-align: right;
}
.footer a {
  color: var(--link);
  font-weight: 700;
  border-bottom: 1px solid rgba(240, 199, 94, .35);
  padding-bottom: 1px;
}
.footer a:hover { color: var(--link-hover); }
.app-version {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
}

.hero-note, .flash, .card, .panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.hero-note { padding: 18px 20px; margin-bottom: 18px; border-left: 4px solid var(--gold); }
.flash { padding: 12px 16px; margin-bottom: 12px; }
.flash.ok { border-left: 4px solid var(--ok); }
.flash.warn { border-left: 4px solid var(--warn); }
.flash.error { border-left: 4px solid var(--err); }

h1, h2, h3 {
  font-family: Syne, Unbounded, sans-serif;
  color: var(--heading);
  margin: 0 0 12px;
  letter-spacing: -.02em;
}
h1 { font-size: 30px; font-weight: 700; }
.muted { color: var(--muted); }

.news-list { display: flex; flex-direction: column; gap: 14px; }
.news-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px;
  background: var(--card);
  padding: 12px;
  border-radius: 18px;
  box-shadow: var(--shadow);
  align-items: center;
  border: 1px solid var(--line);
  transition: transform .28s var(--ease), box-shadow .28s var(--ease);
}
.news-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.thumb {
  height: 110px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
}
.thumb.fuel { background: linear-gradient(135deg, #5a4318, #f0c75e); color: #1a1508; }
.thumb.hours { background: linear-gradient(135deg, #2a2418, #8a6a2a); }
.thumb.warehouse { background: linear-gradient(135deg, #2c3342, #6b7280); }
.thumb.courier { background: linear-gradient(135deg, #f5c518, #222); color: #111; }
.thumb.note { background: linear-gradient(135deg, #3a321c, #c9a227); color: #1a1508; }
.date-badge {
  display: inline-block;
  background: var(--surface-2);
  color: var(--link);
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  margin-right: 8px;
  font-weight: 700;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.table th, .table td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.table th { background: var(--table-head); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.table tr:hover td { background: var(--table-hover); }
.row-in-stock td { color: #b7f5d4; }
.row-in-stock td:first-child { box-shadow: inset 3px 0 0 #3dd68c; }
.qty-changed { color: #ff6b6b !important; font-weight: 800; background: rgba(255, 107, 107, .12); }

.status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}
.s-new { background: #3a321c; color: #ffffff; }
.s-confirmed { background: #2a3038; color: #ffffff; }
.s-ready { background: #143628; color: #3dd68c; }
.s-delivered { background: #1c3324; color: #8fe0b0; }
.s-closed { background: #243044; color: #c5d2e3; }
.s-cancelled { background: #3a1818; color: #ff6b6b; }
.s-answered { background: #143628; color: #3dd68c; }
.s-pending { background: #3a2e12; color: #f0c75e; }
.s-active { background: #143628; color: #3dd68c; }
.s-blocked { background: #3a1818; color: #ff6b6b; }
.s-waiting { background: #3a2e12; color: #f0c75e; }
.s-paid { background: #143628; color: #3dd68c; }
.s-partial { background: #3a2e12; color: #f0c75e; }
.s-unpaid { background: #3a1818; color: #ff6b6b; }

body.auth-modal-open { overflow: hidden; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(180deg, #f5d57a, #e0ad3a);
  color: #1a1508 !important;
  border: 0;
  padding: 11px 16px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  font: inherit;
  font-weight: 800;
  transition: transform .18s var(--ease), filter .18s;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.cyan { background: #147a68; color: #fff !important; }
.btn.ghost { background: transparent; color: var(--text) !important; border: 1px solid var(--line); }
.btn.gold { background: linear-gradient(180deg, #ffe9a8, #e0ad3a); color: #1a1508 !important; }
.btn.small { padding: 7px 11px; font-size: 13px; }
.qty {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--input-bg);
}
.qty button, .qty input {
  border: 0;
  background: var(--input-bg);
  height: 38px;
  width: 38px;
  text-align: center;
  cursor: pointer;
  color: var(--text);
}
.qty button:hover { background: var(--surface-2); }
.qty input { width: 48px; }
.qty-add { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.qty-add input {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 8px;
  background: var(--input-bg);
  width: 64px;
}

.grid-2 { display: grid; grid-template-columns: 1.4fr .8fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.panel { padding: 20px; }
.form input, .form textarea, .form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  margin: 0 0 12px;
  font: inherit;
  background: var(--input-bg);
  color: var(--text);
}
.form input:focus, .form textarea:focus, .form select:focus {
  outline: none;
  border-color: #f0c75e;
  box-shadow: 0 0 0 4px rgba(240, 199, 94, .15);
}
.form label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.timeline { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 20px; }
.timeline span {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
}
.timeline span.on { background: linear-gradient(135deg, #e0ad3a, #f0c75e); color: #1a1508; }
.courier-link {
  display: block;
  background: var(--deep);
  color: var(--link) !important;
  padding: 14px 16px;
  border-radius: 14px;
  font-weight: 800;
  margin-top: 10px;
}
.msg { padding: 12px 14px; border-radius: 14px; margin-bottom: 10px; }
.msg.client { background: var(--surface-2); }
.msg.manager { background: rgba(61, 214, 140, .12); }
.price-box { display: flex; gap: 16px; margin-top: 8px; font-weight: 700; }
.contacts-layout { display: grid; grid-template-columns: 1fr 1.2fr; gap: 20px; align-items: start; }
.map-preview {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--card);
  cursor: zoom-in;
  text-align: left;
  box-shadow: var(--shadow);
  position: relative;
}
.map-preview img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
}
.map-preview-hint {
  display: block;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.map-preview:hover .map-preview-hint { color: var(--heading); }

.map-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1400;
  background: rgba(8, 10, 14, .92);
  display: grid;
  grid-template-rows: auto 1fr;
}
.map-lightbox[hidden] { display: none !important; }
.map-lightbox-backdrop {
  position: absolute;
  inset: 0;
}
.map-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #f5d57a, #e0ad3a);
  color: #1a1508;
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.map-lightbox-close:hover { filter: brightness(1.05); }
.map-lightbox-stage {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  display: grid;
  place-items: center;
}
.map-lightbox-stage.is-dragging { cursor: grabbing; }
.map-lightbox-stage img {
  max-width: min(96vw, 1400px);
  max-height: 92vh;
  width: auto;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  transform-origin: center center;
  will-change: transform;
}
body.map-lightbox-open { overflow: hidden; }
html[data-theme="light"] .map-lightbox {
  background: rgba(17, 24, 39, .88);
}
.login-box { max-width: 420px; margin: 20px auto; padding: 28px; }
.pending-box { max-width: 560px; margin: 40px auto; padding: 36px; text-align: center; }
.filter-panel { display: none; margin: 12px 0 18px; }
.filter-panel.open { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 10px; align-items: end; }
.ms-match {
  display: block;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 8px;
  background: var(--surface);
}
html[data-theme="light"] .s-new,
html[data-theme="light"] .s-confirmed { background: #e5e7eb; color: #111111; }
html[data-theme="light"] .s-pending,
html[data-theme="light"] .s-waiting,
html[data-theme="light"] .s-partial { background: #fef3c7; color: #92400e; }
html[data-theme="light"] .s-ready,
html[data-theme="light"] .s-answered,
html[data-theme="light"] .s-active,
html[data-theme="light"] .s-paid,
html[data-theme="light"] .s-delivered { background: #dcfce7; color: #166534; }
html[data-theme="light"] .s-closed { background: #e5e7eb; color: #111111; }
html[data-theme="light"] .s-cancelled,
html[data-theme="light"] .s-blocked,
html[data-theme="light"] .s-unpaid { background: #fee2e2; color: #991b1b; }
html[data-theme="light"] .row-in-stock td { color: #166534; }
html[data-theme="light"] .chip.tg { color: #1d4ed8; }
html[data-theme="light"] .chip.max { color: #6d28d9; }
html[data-theme="light"] .auth-login { color: #111111 !important; }
html[data-theme="light"] .logo-text {
  background: #f9fafb;
  border-color: #d1d5db;
}
html[data-theme="light"] .header {
  border-bottom-color: #d1d5db;
}
html[data-theme="light"] .panel,
html[data-theme="light"] .hero-note,
html[data-theme="light"] .flash,
html[data-theme="light"] .news-item,
html[data-theme="light"] .table {
  border-color: #d1d5db;
}
html[data-theme="light"] .theme-toggle,
html[data-theme="light"] .nav-toggle {
  background: #ffffff;
  border-color: #d1d5db;
}
html[data-theme="light"] .nav a.active {
  color: #111111;
}
html[data-theme="dark"] .searchbar .label,
html[data-theme="dark"] .footer a,
html[data-theme="dark"] .auth-login {
  color: #ffffff !important;
}
.price-hidden { color: var(--muted); letter-spacing: .2em; }
.page-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.page-head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
body.is-leaving .container { animation: page-out .18s ease forwards; }
@keyframes page-out { to { opacity: 0; transform: translateY(-6px); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 980px) {
  .header-inner {
    grid-template-columns: 1fr;
  }
  .auth-rail { justify-content: flex-start; }
  .contacts-panel { justify-self: start; }
  .addr { text-align: left; }
}

/* ——— Мобильная версия ——— */
@media (max-width: 900px) {
  .header-inner,
  .nav-inner,
  .search-inner,
  .container,
  .footer-inner,
  .site-menu-panel {
    width: min(1180px, calc(100% - 24px));
  }

  .header-inner {
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 10px 0;
    align-items: center;
  }
  .header .contacts-panel,
  .header .auth-rail-main {
    display: none !important;
  }
  .auth-rail {
    gap: 8px;
    flex-wrap: nowrap;
  }
  .nav-toggle { display: inline-grid; }
  .logo-text { padding: 6px 10px; border-radius: 14px; }
  .logo-text strong { font-size: 18px; }
  .logo-text em,
  .logo small { display: none; }
  .theme-toggle {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  body.is-scrolled .header-inner {
    grid-template-columns: 1fr auto;
    padding: 8px 0;
  }
  body.is-scrolled .contacts-panel { display: none !important; }

  .site-menu {
    display: none;
    border-bottom: 1px solid var(--line);
    background: var(--nav-bg);
    max-height: min(78vh, 640px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  body.nav-open .site-menu { display: block; }
  .site-menu-panel {
    display: grid;
    gap: 14px;
    padding: 14px 0 18px;
  }
  .site-menu-contacts,
  .site-menu-auth {
    display: grid;
    gap: 10px;
  }
  .site-menu-contacts {
    padding: 12px 14px;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    font-size: 14px;
  }
  .site-menu-contacts a { color: var(--text); font-weight: 700; }
  .site-menu-phone { font-size: 18px; }
  .site-menu-addr { color: var(--muted) !important; font-weight: 600 !important; line-height: 1.35; }
  .site-menu-auth {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }
  .site-menu-auth .auth-user,
  .site-menu-auth .auth-login,
  .site-menu-auth .auth-register,
  .site-menu-auth .auth-out,
  .site-menu-auth .balance-pill {
    width: 100%;
    max-width: none;
    justify-content: center;
  }
  .site-menu-auth .auth-user { justify-content: flex-start; }
  .site-menu-auth .auth-meta strong { max-width: none; }
  .site-menu-auth .auth-out {
    text-align: center;
    border: 1px solid var(--line);
    border-radius: 999px;
  }

  .nav {
    background: transparent;
    border: 0;
  }
  .nav-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    width: 100%;
    padding: 0;
    overflow: visible;
  }
  .nav a {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    font-size: 15px;
    transform: none !important;
  }
  .nav a:hover { transform: none; }

  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(8, 10, 14, .45);
  }
  .nav-backdrop[hidden] { display: none !important; }
  body.nav-open { overflow: hidden; }
  body.nav-open .site-head { z-index: 55; }

  .searchbar .label { display: none; }
  .search-inner,
  .search-locked {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px 0 12px;
  }
  .search-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .searchbar button.icon,
  .searchbar a.icon,
  .cart-pill {
    width: 100%;
    height: 48px;
    justify-content: center;
    padding: 0 12px;
    font-size: 14px;
  }
  .searchbar textarea {
    min-height: 72px;
    border-radius: 16px;
    font-size: 16px; /* без автозума iOS */
  }
  .search-locked .search-lock-note {
    height: auto;
    min-height: 48px;
    border-radius: 16px;
    white-space: normal;
    line-height: 1.35;
  }
  .cart-pill span { display: inline; font-size: inherit; opacity: .9; }
  .cart-pill-sum::before { content: " · "; }

  .container { padding: 18px 0 40px; }
  h1 { font-size: 24px; }
  h2 { font-size: 18px; }
  .hero-note, .panel, .flash { padding: 14px; border-radius: 16px; }
  .login-box, .pending-box {
    max-width: none;
    margin: 8px 0;
    padding: 18px 14px;
  }

  .news-item,
  .grid-2,
  .grid-3,
  .contacts-layout,
  .filter-panel.open {
    grid-template-columns: 1fr;
  }
  .news-item {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }
  .thumb { height: 120px; }

  .footer-inner { gap: 12px; }
  .footer-links {
    align-items: flex-start;
    text-align: left;
    width: 100%;
  }

  .qty-add {
    justify-content: stretch;
    flex-wrap: wrap;
  }
  .qty-add input { flex: 1 1 72px; }
  .qty-add .btn { flex: 1 1 auto; }

  .price-box {
    flex-direction: column;
    gap: 6px;
  }
  .timeline { gap: 6px; }
  .auth-modal { padding: 16px; }
  .auth-modal-card { padding: 18px 16px 16px; }
  .auth-modal-actions .btn { flex: 1 1 calc(50% - 8px); }

  .map-lightbox-close {
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
  }
  .map-lightbox-stage img {
    max-width: 100vw;
    max-height: 100vh;
  }

  .to-top {
    right: 14px;
    bottom: max(14px, env(safe-area-inset-bottom));
    width: 48px;
    height: 48px;
  }

  /* Таблицы → карточки на телефоне */
  .table {
    display: block;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
  }
  .table thead { display: none; }
  .table tbody { display: grid; gap: 10px; }
  .table tr {
    display: grid;
    gap: 8px;
    padding: 12px 14px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
  }
  .table td {
    display: grid;
    grid-template-columns: minmax(88px, 38%) 1fr;
    gap: 10px;
    align-items: start;
    padding: 0;
    border: 0;
    font-size: 14px;
  }
  .table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding-top: 2px;
  }
  .table td:not([data-label]) {
    grid-template-columns: 1fr;
  }
  .table td:not([data-label])::before { content: none; }
  .table tr:hover td { background: transparent; }
  .row-in-stock td:first-child { box-shadow: none; }
  .row-in-stock {
    box-shadow: inset 3px 0 0 #3dd68c, var(--shadow);
  }
  .table .qty-add,
  .table .qty {
    width: 100%;
    justify-content: flex-start;
  }

  .btn, .btn.small {
    min-height: 44px;
  }
  .form input,
  .form textarea,
  .form select {
    font-size: 16px;
    margin-bottom: 10px;
  }
  .page-head,
  .page-head-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .page-head-actions .btn {
    width: 100%;
  }
  .filter-panel.open {
    gap: 8px;
  }
  .filter-panel.open .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .header-inner,
  .nav-inner,
  .search-inner,
  .container,
  .footer-inner,
  .site-menu-panel {
    width: min(1180px, calc(100% - 16px));
  }
  .search-actions {
    grid-template-columns: 1fr;
  }
  .logo-text strong { font-size: 16px; }
  h1 { font-size: 22px; }
  .site-menu-auth .auth-login,
  .site-menu-auth .auth-register {
    height: 46px;
    justify-content: center;
  }
}

.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #f5d57a, #e0ad3a);
  color: #1a1508;
  font-size: 22px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.to-top.is-visible { opacity: 1; pointer-events: auto; transform: none; }

@media print {
  .header, .nav, .searchbar, .footer, .no-print, .site-head, .to-top { display: none !important; }
  body { background: #fff; color: #111; }
  .container { width: 100%; animation: none; }
}
