:root {
  color-scheme: dark;
  --bg: #070c10;
  --panel: #10161b;
  --panel-2: #181f26;
  --line: #2d363d;
  --text: #f3f4f5;
  --muted: #929aa1;
  --accent: #ff6b4f;
  --accent-soft: rgba(255, 107, 79, 0.13);
  --green: #4ed080;
  --blue: #55a6ff;
  --yellow: #e5aa3d;
  --red: #ff5f67;
  --purple: #9d72ff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-width: 320px; background: var(--bg); }
button, input, select { font: inherit; }
button { cursor: pointer; }

.ui-icon { display: block; width: 1em; height: 1em; flex: 0 0 auto; }
.logo .ui-icon { width: 45px; height: 45px; stroke-width: 1.6; }
.nav-icon { display: grid; place-items: center; min-height: 27px; margin-bottom: 3px; }
.nav-icon .ui-icon { width: 24px; height: 24px; }
.menu-icon .ui-icon { width: 27px; height: 27px; }
.action span .ui-icon { width: 21px; height: 21px; margin: 0 auto; }
.empty-icon { display: grid; place-items: center; min-height: 58px; }
.empty-icon .ui-icon { width: 52px; height: 52px; }
.badge-icon .ui-icon { width: 22px; height: 22px; }

.shell {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: calc(112px + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 126px;
  padding: 26px 24px;
  border-bottom: 1px solid #192127;
  background: rgba(7, 12, 16, 0.975);
  backdrop-filter: blur(16px);
}

.logo {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  flex: 0 0 74px;
  border: 1px solid rgba(255, 107, 79, 0.45);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255,107,79,.10), rgba(16,22,27,.98));
  color: var(--accent);
  box-shadow: inset 0 0 24px rgba(255,107,79,.05), 0 8px 28px rgba(0,0,0,.18);
}

.brand { min-width: 0; }
.brand-title { font-size: clamp(25px, 4.4vw, 31px); font-weight: 760; line-height: 1.05; white-space: nowrap; letter-spacing: -.02em; }
.brand-title span { color: var(--accent); }
.brand-subtitle { margin-top: 8px; color: #8f969c; font-size: 14px; letter-spacing: .13em; text-transform: uppercase; }

.content { padding: 34px 18px 12px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
h1 { margin: 0; font-size: clamp(34px, 7vw, 42px); line-height: 1.08; font-weight: 760; letter-spacing: -.02em; }
h2 { margin: 0; font-size: 24px; }
.lead { margin: 8px 0 0; color: #92989d; font-size: 18px; line-height: 1.35; }
.primary-button,
.secondary-button,
.danger-button {
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: var(--panel-2);
  min-height: 44px;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 700;
}
.primary-button { background: var(--accent); border-color: var(--accent); color: #151515; }
.secondary-button { background: var(--panel-2); }
.danger-button { color: var(--red); border-color: rgba(255,95,103,.35); }
.wide { width: 100%; }

.panel {
  margin-bottom: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(145deg, #11181d, #0e1418);
  box-shadow: 0 14px 34px rgba(0,0,0,.15);
}
.panel-title { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; font-size: 22px; font-weight: 760; }
.panel-title .badge-icon { color: var(--accent); }

.search, .field {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  background: var(--panel-2);
  color: var(--text);
  font-size: 15px;
}
.search:focus, .field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-row { margin-bottom: 16px; }
.chips { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 18px; scrollbar-width: none; }
.chip { flex: 0 0 auto; padding: 10px 20px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); }
.chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }

.orders-content { padding-top: 26px; }

.search-with-icon { position: relative; }
.search-with-icon > .ui-icon {
  position: absolute;
  z-index: 2;
  left: 18px;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  color: #9aa2a9;
}
.search-with-icon .search {
  min-height: 46px;
  padding-left: 48px;
  border-radius: 14px;
  font-size: 15px;
  background: #181f26;
}
.search-with-icon .search::placeholder { color: #707980; }

.order-card { position: relative; overflow: hidden; }
.order-card {
  margin-bottom: 18px;
  padding: 24px 25px 26px;
  border-radius: 24px;
  background: linear-gradient(145deg, #11181d, #0d1317);
}
.order-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--accent); }
.order-card.closed::before { background: var(--green); }
.order-card.declined::before { background: var(--red); }
.status { display: inline-flex; margin-top: 7px; padding: 7px 14px; border: 1px solid rgba(255,107,79,.55); border-radius: 12px; color: #ffb39d; background: rgba(255,107,79,.11); font-weight: 700; }
.status.closed { color: var(--green); border-color: rgba(78,208,128,.55); background: rgba(78,208,128,.10); }
.status.declined { color: var(--red); border-color: rgba(255,95,103,.5); background: rgba(255,95,103,.09); }

.appliance { display: flex; align-items: center; gap: 14px; padding: 20px 0 16px; }

.order-money { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 17px; }

.meta { display: flex; flex-wrap: wrap; gap: 9px 16px; padding: 15px 2px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.chevron { display: grid; place-items: center; color: var(--muted); }
.chevron .ui-icon { width: 20px; height: 20px; }
.photo-missing .ui-icon { width: 34px; height: 34px; }

.actions { display: grid; gap: 8px; margin-top: 16px; }
.action {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  min-height: 78px;
  min-width: 0;
  padding: 8px 3px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #171e25;
  color: #9aa2a9;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.1;
  text-decoration: none;
}
.action span { display: grid; place-items: center; margin: 0; color: var(--accent); }
.action span .ui-icon { width: 25px; height: 25px; }
.warehouse-head { margin-bottom: 18px; }
.warehouse-search .search { min-height: 46px; }
.warehouse-filter { margin-bottom: 18px; }
.warehouse-shortcuts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
.warehouse-shortcut {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 74px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #181f26;
  color: #f0f2f3;
  text-decoration: none;
  font-size: 18px;
  font-weight: 700;
}
.warehouse-shortcut .ui-icon { width: 25px; height: 25px; }
.warehouse-check {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 1px solid #788087;
  border-radius: 5px;
  background: #353a3e;
}
.readonly-field {
  display: flex;
  align-items: center;
  color: #f0f2f3;
}
.warehouse-movements { scroll-margin-top: 150px; }
.warehouse-group {
  padding: 20px;
  border-radius: 24px;
}

.legacy-stock-card {
  position: relative;
  padding: 18px 20px 18px 24px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  border-radius: 22px;
  background: linear-gradient(145deg,#11181d,#0e1418);
}
.stock-copy { min-width: 0; }
.stock-copy .stock-name { font-size: 20px; }
.legacy-stock-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}
.legacy-stock-actions button {
  min-height: 46px;
  padding: 9px 8px;
  border-radius: 15px;
  font-size: 14px;
}
.legacy-stock-actions button:last-child { grid-column: 1 / span 1; }
.legacy-stock-actions .ui-icon { width: 18px; height: 18px; }
.stock-card { border-left: 4px solid var(--green); }
.stock-name { font-size: 20px; font-weight: 750; }
.small { color: var(--muted); font-size: 13px; }
.quantity { color: var(--green); font-size: 22px; font-weight: 800; }
.stock-actions { display: flex; gap: 8px; margin-top: 16px; }
.stock-actions button { flex: 1; }
.metric { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel-2); }
.metric-label { color: var(--muted); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
.metric-value { margin-top: 7px; font-size: clamp(22px, 6vw, 30px); white-space: nowrap; }
.green { color: var(--green); }
.blue { color: var(--blue); }
.yellow { color: var(--yellow); }
.red { color: var(--red); }
.purple { color: var(--purple); }

.analytics-content { padding-top: 28px; }
.analytics-period-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
  margin-bottom: 18px;
}
.analytics-period-grid .chip {
  width: 100%;
  min-height: 46px;
  padding: 10px 8px;
  border-radius: 999px;
  font-size: 16px;
}
.analytics-period-grid .chip.active {
  border-color: var(--accent);
  background: rgba(255,107,79,.15);
  color: #f5f6f7;
}
.analytics-range-nav {
  display: grid;
  grid-template-columns: 58px minmax(0,1fr) 58px;
  gap: 15px;
  align-items: center;
  margin: 3px 0 20px;
}
.analytics-range-nav > div { text-align: center; }
.analytics-range-nav strong {
  display: block;
  font-size: 22px;
  text-transform: lowercase;
}
.analytics-range-nav small { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.analytics-arrow {
  width: 58px;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #171e25;
  color: #f0f2f3;
  font-size: 42px;
  line-height: 1;
}
.analytics-arrow:disabled { color: #4c555c; opacity: .55; cursor: default; }

.analytics-kpi-panel .panel-title small {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.analytics-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.analytics-kpi {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #171e25;
}
.analytics-kpi > span {
  display: block;
  color: #969ea5;
  font-size: 12px;
  letter-spacing: .06em;
}
.analytics-kpi > strong {
  display: block;
  margin-top: 8px;
  font-size: 27px;
  font-weight: 500;
  white-space: nowrap;
}
.analytics-kpi > small {
  display: block;
  margin-top: 10px;
  color: var(--green);
  font-size: 11px;
}
.analytics-gem { color: var(--accent); }
.analytics-gem .ui-icon { width: 25px; height: 25px; }
.analytics-focus .panel-title { margin-bottom: 18px; }
.analytics-work .metric { min-height: 96px; }
.analytics-work-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.analytics-ranking-list { display: grid; gap: 10px; }
.analytics-ranking-row {
  display: grid;
  grid-template-columns: 34px minmax(0,1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 66px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #171e25;
}
.analytics-ranking-row > span:nth-child(2) { min-width: 0; }
.analytics-ranking-row strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.analytics-ranking-row small { display: block; margin-top: 3px; color: var(--muted); }
.analytics-ranking-row b { color: #f0f2f3; white-space: nowrap; }
.ranking-place {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255,107,79,.10);
  color: var(--accent);
  font-weight: 800;
}
.analytics-stock-summary .metric-value { font-size: clamp(20px, 5vw, 28px); }

.bars { display: flex; align-items: flex-end; gap: 8px; height: 170px; margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--line); }
.bar-wrap { flex: 1; display: flex; height: 100%; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.bar { width: 100%; max-width: 72px; min-height: 5px; border-radius: 8px 8px 0 0; background: var(--accent); }

.menu-list { display: grid; gap: 14px; }
.more-content { padding-top: 28px; }
.legacy-more-list { gap: 16px; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  min-height: 112px;
  padding: 18px 22px;
  border: 1px solid #2b343b;
  border-radius: 24px;
  background: linear-gradient(145deg,#11171c,#0d1317);
  color: var(--text);
  text-align: left;
  box-shadow: 0 10px 26px rgba(0,0,0,.12);
}
.menu-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  border-radius: 20px;
  background: rgba(255,107,79,.10);
  color: var(--accent);
}
.menu-icon .ui-icon { width: 36px; height: 36px; stroke-width: 1.8; }
.menu-copy { flex: 1; min-width: 0; }
.menu-name { display: block; font-size: 24px; line-height: 1.1; font-weight: 760; }
.menu-description { display: block; margin-top: 7px; color: #8f969c; font-size: 17px; line-height: 1.25; }
.menu-item .chevron .ui-icon { width: 28px; height: 28px; }
.menu-item .chevron { color: #8b949b; }
.price-tech-filter {
  position: relative;
  margin-bottom: 18px;
}
.price-tech-filter .field {
  min-height: 46px;
  padding-right: 56px;
  appearance: none;
  border-radius: 18px;
  background: #181f26;
  font-size: 17px;
}
.price-groups { display: grid; gap: 22px; }

.goods-content { padding-top: 28px; }
.goods-preview-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 14px 4px;
  font-size: 21px;
}
.goods-preview-total strong:last-child { color: var(--accent); font-size: 28px; }

.settings-links { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.settings-links .secondary-button { display: flex; align-items: center; justify-content: flex-start; gap: 9px; text-align: left; }
.settings-links .ui-icon { width: 19px; height: 19px; color: var(--accent); }

.shopping-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.shopping-need { text-align: right; flex: 0 0 auto; }
.shopping-need span { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.shopping-need strong { display: block; margin-top: 4px; color: var(--yellow); font-size: 20px; }

.chevron { color: var(--muted); }

.backup-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.backup-grid button { min-height: 46px; }
.legacy-backup-page .toggle,
.legacy-settings-row .toggle { width: 54px; height: 30px; padding: 3px; border: 0; border-radius: 999px; background: #303840; }
.legacy-backup-page .toggle::after,
.legacy-settings-row .toggle::after { content: ""; display: block; width: 24px; height: 24px; border-radius: 50%; background: white; transition: transform .2s; }
.legacy-backup-page .toggle.on,
.legacy-settings-row .toggle.on { background: var(--green); }
.legacy-backup-page .toggle.on::after,
.legacy-settings-row .toggle.on::after { transform: translateX(24px); }

.empty { padding: 44px 18px; text-align: center; color: var(--muted); }
.empty-icon { font-size: 52px; margin-bottom: 10px; }
.empty-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 500px; margin: 22px auto 0; }
.list { margin: 0; padding: 0; list-style: none; }
.price-row { display: flex; justify-content: space-between; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.price-row:last-child { border-bottom: 0; }
.client-list { display: grid; gap: 14px; }
.client-card { margin-bottom: 0; }
.legacy-client-card {
  padding: 20px;
  border-radius: 22px;
  background: linear-gradient(145deg,#11181d,#0f1519);
}
.client-avatar {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 17px;
  background: rgba(91,168,255,.10);
  color: #5ba8ff;
  border: 1px solid rgba(91,168,255,.22);
}
.client-avatar .ui-icon { width: 29px; height: 29px; }
.client-meta {
  display: flex;
  gap: 14px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.client-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 14px;
}
.client-actions a { text-decoration: none; }
.legacy-finance-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.legacy-finance-actions button { min-height: 46px; }
.finance-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto 42px;
  gap: 11px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.finance-row:last-child { border-bottom: 0; }
.legacy-finance-row .remove-line {
  width: 40px;
  height: 40px;
}
.legacy-finance-row .remove-line .ui-icon { width: 18px; height: 18px; }
.goods-list { display: grid; gap: 10px; }
.goods-sheet { display: grid; grid-template-columns: minmax(0,1fr) auto 22px; align-items: center; gap: 12px; width: 100%; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel-2); color: var(--text); text-align: left; }
.goods-sheet small { display: block; margin-top: 4px; color: var(--muted); }
.readonly-field { display: flex; align-items: center; color: var(--accent); font-size: 21px; font-weight: 800; }
.photo-input { padding: 12px 14px; }
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.photo-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--panel-2); }
.photo-card img, .photo-missing { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.photo-missing { display: grid; place-items: center; align-content: center; gap: 4px; color: var(--muted); font-size: 30px; }
.photo-caption { padding: 8px 34px 9px 9px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.photo-remove { position: absolute; right: 6px; bottom: 6px; width: 28px; height: 28px; padding: 0; border: 1px solid rgba(255,95,103,.45); border-radius: 9px; background: rgba(8,13,17,.88); color: var(--red); font-size: 20px; line-height: 1; }
.settings-save { margin-top: 18px; }
.compact-modal { max-width: 560px; }

.act-sheet {
  width: 100%;
  margin: 18px auto 0;
  padding: 44px 46px 50px;
  background: #fff;
  color: #111;
  border-radius: 6px;
  box-shadow: 0 16px 48px rgba(0,0,0,.28);
  font-family: "Times New Roman", Times, serif;
}
.act-sheet h2 {
  margin: 0;
  text-align: center;
  font-size: 25px;
  letter-spacing: .02em;
}
.act-contract-line {
  margin: 14px 0 26px;
  text-align: center;
  font-size: 14px;
}
.act-main-fields {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}
.act-main-fields > div {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 10px;
  min-height: 28px;
  padding-bottom: 5px;
  border-bottom: 1px solid #555;
  align-items: end;
}
.act-main-fields b { font-weight: 700; }
.act-main-fields span { min-width: 0; }

.act-sheet table {
  width: 100%;
  margin-top: 12px;
  border-collapse: collapse;
  font-size: 12px;
}
.act-sheet th,
.act-sheet td {
  padding: 8px 6px;
  border: 1px solid #222;
  text-align: center;
  vertical-align: middle;
}
.act-sheet th { font-weight: 700; }
.act-sheet th:nth-child(2),
.act-sheet td:nth-child(2) { text-align: left; }

.act-total {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 15px;
  padding-top: 8px;
  font-size: 18px;
}
.act-total strong { font-size: 20px; }

.act-acceptance {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid #999;
}
.act-acceptance h3 {
  margin: 0 0 14px;
  text-align: center;
  font-size: 17px;
}
.act-acceptance p {
  margin: 0;
  line-height: 1.45;
  text-align: justify;
}
.act-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  margin-top: 34px;
  line-height: 1.8;
}

.bottom-nav {
  position: fixed;
  z-index: 30;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(100%, 760px);
  padding: 10px 8px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid #283138;
  background: rgba(7,12,16,.985);
  backdrop-filter: blur(18px);
}
.nav-button { display: grid; place-items: center; align-content: center; gap: 7px; border: 0; background: transparent; color: #a0a7ad; min-height: 76px; border-radius: 0; font-size: 14px; font-weight: 500; }
.nav-button .nav-icon { margin: 0; }
.nav-button .nav-icon .ui-icon { width: 29px; height: 29px; stroke-width: 1.85; }
.nav-button.active { color: var(--accent); background: transparent; }
.nav-button.active .nav-icon { transform: none; }

.modal-backdrop {
  position: fixed;
  z-index: 25;
  top: 126px;
  right: 0;
  bottom: calc(96px + env(safe-area-inset-bottom));
  left: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  padding: 16px 0 34px;
  background: rgba(7,12,16,.985);
}
.modal {
  width: min(100%, 760px);
  max-height: none;
  overflow: visible;
  padding: 20px 18px 48px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.modal.compact-modal {
  width: min(calc(100% - 32px), 640px);
  margin: 10px 16px 30px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(145deg,#11181d,#0e1418);
  box-shadow: 0 20px 50px rgba(0,0,0,.28);
}
.modal h2 { margin: 0 0 22px; font-size: 30px; line-height: 1.1; }
.compact-modal h2 { font-size: 24px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 12px; }
.form-group { display: grid; gap: 8px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { color: #a0a7ad; font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; }
.modal .field {
  min-height: 46px;
  border-radius: 14px;
  background: #181f26;
  font-size: 15px;
}
.textarea { min-height: 112px; padding-top: 16px; resize: vertical; font: inherit; }
.form-section-title {
  margin: 28px 0 14px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: #a0a7ad;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.line-list { display: grid; gap: 10px; }

.catalog-modal-backdrop {
  z-index: 70;
  top: 0;
  bottom: 0;
  padding: max(18px, env(safe-area-inset-top)) 12px max(18px, env(safe-area-inset-bottom));
  align-items: center;
  /* было rgba(...,.88) + backdrop-filter: blur(12px) — если blur не
     поддерживается устройством (нередко на Android/webview), фон под
     модалкой оставался почти прозрачным и просвечивал (баг с "призрачным"
     наложением текста). Подняли непрозрачность так, чтобы читалось
     нормально даже без blur; сам blur оставили как приятный бонус там,
     где он работает. */
  background: rgba(3,7,10,.97);
  backdrop-filter: blur(12px);
}
.catalog-modal {
  width: min(calc(100% - 20px), 720px);
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  padding: 22px;
  border: 1px solid #242d34;
  border-radius: 28px;
  background: #11181d;
  box-shadow: 0 24px 80px rgba(0,0,0,.48);
}
.catalog-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.catalog-modal-head h2 { margin: 4px 0 0; font-size: 26px; }
.catalog-modal-head .small { color: var(--accent); text-transform: uppercase; letter-spacing: .08em; }
.catalog-close { min-height: 46px; }
.catalog-search-row { margin-bottom: 12px; }
.catalog-search-row .search {
  min-height: 46px;
  border-color: rgba(255,107,79,.78);
  box-shadow: 0 0 0 3px rgba(255,107,79,.08);
}
.catalog-service-list { display: grid; gap: 18px; }
.catalog-service-group h3 {
  margin: 0 0 8px;
  color: #ff8168;
  font-size: 17px;
}
.catalog-service-option {
  display: grid;
  grid-template-columns: 42px minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 4px;
  border-bottom: 1px solid #30383e;
  cursor: pointer;
}
.catalog-service-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.catalog-check {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 2px solid #313a42;
  border-radius: 8px;
  background: #11171c;
  color: #101315;
  font-size: 23px;
  font-weight: 900;
}
.catalog-service-option.selected .catalog-check {
  border-color: #ff8067;
  background: #ff8067;
}
.catalog-service-copy { min-width: 0; }
.catalog-service-copy strong {
  display: block;
  color: #f1f3f4;
  font-size: 17px;
  font-weight: 550;
}
.catalog-service-copy small {
  display: block;
  margin-top: 3px;
  color: #818a91;
}
.catalog-service-price {
  color: #dfe3e5;
  font-size: 17px;
  white-space: nowrap;
}
.catalog-fit-summary {
  display: grid;
  gap: 6px;
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 16px;
  background: #20272d;
}
.catalog-fit-summary > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}
.catalog-fit-summary span { color: #a3abb1; }
.catalog-fit-summary strong { font-size: 18px; }
.catalog-modal-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  position: sticky;
  bottom: -22px;
  margin: 18px -22px -22px;
  padding: 14px 22px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid #293139;
  background: rgba(17,24,29,.98);
}
.catalog-modal-actions button { min-height: 46px; }
.legacy-catalog-button,
.legacy-stock-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  min-height: 78px;
  padding: 14px 18px;
  border: 1px solid rgba(255,107,79,.58);
  border-radius: 18px;
  background: rgba(255,107,79,.055);
  color: var(--accent);
  font-size: 18px;
  font-weight: 650;
  cursor: pointer;
}
.legacy-catalog-button .ui-icon,
.legacy-stock-button .ui-icon {
  width: 26px;
  height: 26px;
}
.legacy-stock-button {
  border-color: var(--line);
  background: #171e25;
  color: #f1f3f4;
}
.legacy-service-list { gap: 0; }
.legacy-service-total {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 4px 2px;
  color: #f1f3f4;
  font-size: 17px;
}
.legacy-service-total > span { color: #a0a7ad; }
.legacy-service-total > span.green { color: var(--green); }
.legacy-material-help {
  margin: -2px 0 14px;
  color: #8f979e;
  font-size: 14px;
  line-height: 1.45;
}
.manual-material-details {
  margin-top: 12px;
  border: 1px dashed #3a444c;
  border-radius: 16px;
  background: rgba(23,30,37,.34);
}
.manual-material-details summary {
  padding: 16px 18px;
  color: #9aa2a9;
  cursor: pointer;
  list-style: none;
}
.manual-material-details summary::-webkit-details-marker { display: none; }
.manual-material-details summary::before {
  content: "▸";
  margin-right: 7px;
  color: #737d84;
}
.manual-material-details[open] summary::before { content: "▾"; }
.manual-material-details button {
  width: calc(100% - 24px);
  margin: 0 12px 12px;
}

.legacy-service-row {
  display: grid;
  grid-template-columns: 28px minmax(0,1fr) 58px 112px 42px;
  gap: 7px;
  align-items: center;
  min-height: 58px;
  padding: 5px 0;
  border-bottom: 1px solid #2a333a;
}
.legacy-service-row:last-child { border-bottom: 0; }
.service-check {
  display: grid;
  place-items: center;
  color: #f0f2f3;
}
.service-check .ui-icon { width: 22px; height: 22px; stroke-width: 2.2; }
.service-name-field {
  min-height: 48px !important;
  padding: 0 6px !important;
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 17px !important;
}
.service-qty-field { min-height: 44px !important; padding: 0 4px !important; border-color: transparent !important; background: transparent !important; text-align: center; color: #a9b0b5 !important; }
.service-price-field { position: relative; }
.service-price-field .field { min-height: 44px !important; padding-right: 24px !important; border-color: transparent !important; background: transparent !important; text-align: right; font-size: 17px !important; }
.service-price-field > span {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}
.service-remove,
.material-remove {
  display: grid;
  place-items: center;
  font-size: 0;
}
.service-remove .ui-icon,
.material-remove .ui-icon { width: 22px; height: 22px; }

.legacy-material-card {
  display: block;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #171e25;
}
.material-card-head {
  display: grid;
  grid-template-columns: minmax(0,1fr) 52px;
  gap: 12px;
  align-items: start;
}
.material-card-head small {
  display: block;
  margin: 4px 0 0 6px;
  color: var(--muted);
  font-size: 12px;
}
.material-name-field {
  min-height: 46px !important;
  padding: 0 6px !important;
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 18px !important;
  font-weight: 700;
}
.material-remove {
  width: 52px;
  height: 52px;
  border-radius: 16px;
}
.material-card-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.material-card-controls label {
  display: grid;
  gap: 7px;
}
.material-card-controls label > span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.material-card-controls .field { min-height: 46px !important; }
.material-unit {
  display: flex;
  align-items: center;
  justify-content: center;
}
.line-item { display: grid; grid-template-columns: minmax(160px, 1fr) 92px 120px 44px; gap: 8px; align-items: center; }
.line-item .field { min-height: 46px; padding: 0 12px; border-radius: 15px; }
.remove-line { width: 48px; height: 48px; border: 1px solid rgba(255,95,103,.38); border-radius: 15px; background: rgba(255,95,103,.09); color: var(--red); font-size: 25px; }
.calculated-total { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; margin-top: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: #171e25; }
.calculated-total strong { color: var(--accent); font-size: 22px; }
.calculated-total button { grid-column: 1 / -1; }

.legacy-payment-grid { margin-top: 2px; }

.legacy-guarantee-card {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid rgba(255,107,79,.38);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(30,21,21,.72), rgba(18,18,20,.55));
}
.legacy-guarantee-head {
  display: grid;
  grid-template-columns: 34px minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.guarantee-icon { color: #f2f4f5; }
.guarantee-icon .ui-icon { width: 28px; height: 28px; }
.legacy-guarantee-head strong { font-size: 20px; }
.guarantee-date {
  padding: 7px 12px;
  border: 1px solid rgba(91,168,255,.55);
  border-radius: 999px;
  color: #65aaf6;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.legacy-guarantee-card > label,
.order-comment > label {
  display: block;
  margin-bottom: 8px;
  color: #a0a7ad;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.legacy-guarantee-card .textarea {
  min-height: 110px;
  border-color: rgba(255,107,79,.22);
}
.order-comment { margin-top: 18px; }

.modal-actions { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-top: 24px; }

.order-editor-modal > h2 {
  margin-bottom: 24px;
  font-size: 31px;
  font-weight: 760;
}
.order-editor-modal [data-service-row] {
  padding: 7px 0 9px;
  border-bottom: 1px solid #2b343b;
}
.order-editor-modal [data-service-row] .field {
  min-height: 48px;
  border-color: transparent;
  background: transparent;
}
.order-editor-modal [data-service-row] [data-line="name"] {
  color: #f0f2f3;
  font-size: 16px;
}
.order-editor-modal [data-service-row] [data-line="price"] {
  text-align: right;
}
.order-editor-modal [data-material-row] {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #151c22;
}
.order-editor-modal .photo-input {
  border-style: dashed;
  border-color: #3a444c;
}
.order-calculation-summary {
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 18px;
}
.order-calculation-summary > div {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #2b343b;
  border-radius: 15px;
  background: #151c22;
}
.order-calculation-summary > div > span {
  display: block;
  color: #969ea5;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.order-calculation-summary > div > strong {
  display: block;
  margin-top: 7px;
  font-size: 21px;
}
.order-calculation-summary .calculation-grand {
  grid-column: 1 / -1;
}
.order-calculation-summary .calculation-grand strong {
  color: var(--accent);
  font-size: 25px;
}
.order-calculation-summary button {
  grid-column: 1 / -1;
  min-height: 46px;
}
.order-editor-modal .modal-actions {
  position: sticky;
  bottom: -42px;
  z-index: 4;
  margin-right: -16px;
  margin-left: -16px;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid #273038;
  background: rgba(7,12,16,.97);
  backdrop-filter: blur(16px);
}
.order-editor-modal .modal-actions button {
  min-height: 46px;
}

.toast { position: fixed; z-index: 100; left: 50%; bottom: 104px; transform: translate(-50%, 20px); width: min(calc(100% - 32px), 540px); padding: 13px 16px; border: 1px solid var(--line); border-radius: 14px; background: #202830; color: white; opacity: 0; pointer-events: none; transition: .2s; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 520px) {
  .menu-item { min-height: 106px; padding: 16px 18px; gap: 15px; }
  .menu-icon { width: 66px; height: 66px; flex-basis: 66px; border-radius: 18px; }
  .menu-icon .ui-icon { width: 33px; height: 33px; }
  .menu-name { font-size: 21px; }
  .menu-description { font-size: 15px; }

  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-head { flex-wrap: wrap; }
  .page-head > .finance-actions { width: 100%; }
  .brand-title { white-space: nowrap; font-size: clamp(21px, 6.2vw, 28px); line-height: 1.08; }
  .metric-value { white-space: normal; overflow-wrap: anywhere; }
  .modal-backdrop { top: 126px; bottom: calc(96px + env(safe-area-inset-bottom)); padding-top: 10px; }
  .modal { padding: 18px 16px 42px; }
  .modal.compact-modal { margin: 8px 14px 24px; padding: 20px; }
  .catalog-modal { width: calc(100% - 12px); max-height: calc(100dvh - 18px); padding: 18px; border-radius: 24px; }
  .catalog-modal-actions { margin-right: -18px; margin-left: -18px; margin-bottom: -18px; padding-right: 18px; padding-left: 18px; }
  .topbar { min-height: 126px; padding: 24px 22px; gap: 16px; }
  .logo { width: 72px; height: 72px; flex-basis: 72px; border-radius: 21px; }
  .logo .ui-icon { width: 43px; height: 43px; }
  .brand-subtitle { margin-top: 7px; font-size: 11px; letter-spacing: .12em; }
  .content { padding: 34px 16px 10px; }
  .act-sheet { padding: 28px 22px 34px; overflow-x: auto; }
.act-main-fields > div { grid-template-columns: 1fr; gap: 3px; }
  .act-signatures { gap: 28px; }
  .warehouse-group { padding: 18px; }
  .client-avatar { width: 50px; height: 50px; }
  .legacy-stock-card { padding: 17px 16px 17px 20px; }
  .legacy-stock-actions { grid-template-columns: repeat(3, 1fr); }
  .analytics-work-grid { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 9px; }
  .analytics-work-grid .metric { padding: 13px 10px; }
  .analytics-work-grid .metric-label { font-size: 10px; }
  .analytics-work-grid .metric-value { font-size: 20px; }
  .legacy-service-row { grid-template-columns: 24px minmax(0,1fr) 58px 96px 44px; gap: 6px; }
  .legacy-service-row .field { font-size: 14px !important; }
  .material-card-controls { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .legacy-guarantee-card { padding: 18px; }
  .legacy-guarantee-head { grid-template-columns: 30px minmax(0,1fr) auto; }
  .legacy-guarantee-head strong { font-size: 18px; }
  .guarantee-date { padding: 6px 10px; font-size: 11px; }
  .panel { padding: 18px; border-radius: 22px; }
  .action { min-height: 70px; font-size: 10px; }
  .action span .ui-icon { width: 23px; height: 23px; }
  .order-card { padding: 22px 20px 24px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-group.full { grid-column: auto; }
  .line-item { grid-template-columns: minmax(0, 1fr) 78px 42px; padding: 10px; border: 1px solid var(--line); border-radius: 16px; }
  .line-item [data-line="name"] { grid-column: 1 / -1; }
  .line-item [data-line="price"], .line-item [data-line="unit-cost"] { grid-column: 1; }
  .line-item [data-line="qty"] { grid-column: 2; grid-row: 2; }
  .line-item .remove-line { grid-column: 3; grid-row: 2; }
  .order-editor-modal [data-service-row] {
    grid-template-columns: minmax(0, 1fr) 72px 42px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
  }
  .order-editor-modal [data-service-row] [data-line="name"] { grid-column: 1 / -1; }
  .order-editor-modal [data-service-row] [data-line="price"] { grid-column: 1; grid-row: 2; text-align: left; }
  .order-editor-modal [data-service-row] [data-line="qty"] { grid-column: 2; grid-row: 2; }
  .order-editor-modal [data-service-row] .remove-line { grid-column: 3; grid-row: 2; }
  .order-calculation-summary { grid-template-columns: 1fr 1fr; }

  .warehouse-shortcuts { grid-template-columns: 1fr 1fr; gap: 9px; }
  .warehouse-shortcut { min-height: 68px; padding: 10px 8px; gap: 8px; font-size: 14px; }
  .warehouse-shortcut .ui-icon { width: 21px; height: 21px; }
  .analytics-period-grid { gap: 8px; }
  .analytics-period-grid .chip { min-height: 52px; font-size: 14px; }
  .analytics-range-nav { grid-template-columns: 52px minmax(0,1fr) 52px; gap: 10px; }
  .analytics-arrow { width: 52px; height: 52px; }
  .analytics-kpi { padding: 15px; }
  .analytics-kpi > strong { font-size: 23px; }
  .backup-grid { grid-template-columns: 1fr; }
  .empty-actions { grid-template-columns: 1fr; }
  .finance-actions { grid-template-columns: 1fr; }
  .act-sheet { padding: 18px 12px; overflow-x: auto; font-size: 13px; }
  .act-sheet h2 { font-size: 21px; }
  .act-sheet table { min-width: 650px; }
  .act-signatures { grid-template-columns: 1fr; gap: 22px; }
}

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: white; }
  .topbar, .bottom-nav, .no-print, .toast { display: none !important; }
  .shell, .content { width: 100%; max-width: none; padding: 0; margin: 0; }
  .act-sheet { padding: 0; border: 0; box-shadow: none; }
  .act-sheet table { min-width: 0; font-size: 11px; }
  .act-sheet tr, .act-sheet td, .act-sheet th { break-inside: avoid; }
  .act-acceptance, .act-signatures { break-inside: avoid; }
}

@media (max-width: 380px) {
  .modal .form-grid { grid-template-columns: 1fr; }
  .modal .form-group.full { grid-column: 1; }
  .modal-actions { grid-template-columns: 1fr; }
  .legacy-stock-actions { grid-template-columns: repeat(2, 1fr); }
  .legacy-stock-actions button:last-child { grid-column: auto; }
  .analytics-work-grid { grid-template-columns: 1fr; }
  .client-actions { grid-template-columns: 1fr; }
  .finance-row { grid-template-columns: 40px minmax(0,1fr) 38px; }
  .legacy-service-row { grid-template-columns: 22px minmax(0,1fr) 50px 82px 40px; }
  .service-remove { width: 40px; height: 40px; }
  .material-card-controls { grid-template-columns: 1fr; }
  .analytics-kpis { grid-template-columns: 1fr 1fr; }
  .analytics-kpi > strong { font-size: 20px; }
  .photo-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
}

.legacy-settings-links {
  grid-template-columns: 1fr;
  gap: 0;
}
.legacy-settings-links .secondary-button {
  display: grid;
  grid-template-columns: 44px minmax(0,1fr) 22px;
  gap: 12px;
  min-height: 46px;
  padding: 13px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
}
.legacy-settings-links .secondary-button:last-child { border-bottom: 0; }
.legacy-settings-links .secondary-button > span:nth-child(2) { min-width: 0; }
.legacy-settings-links strong,
.legacy-settings-links small { display: block; }
.legacy-settings-links strong { font-size: 16px; }
.legacy-settings-links small { margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 500; }
.settings-link-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: rgba(91,168,255,.09);
  color: #5ba8ff;
}
.settings-link-icon .ui-icon { width: 21px; height: 21px; }
.legacy-settings-links .chevron { justify-self: end; }

@media (max-width: 520px) {
}
/* 0.38.0 · Общие формы,
модалки и состояния */
button,
a.secondary-button,
.chip,
.menu-item,
.nav-button,
.goods-sheet,
.warehouse-shortcut {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.primary-button,
.secondary-button,
.danger-button,
.chip,
.field,
.search,
.menu-item,
.nav-button {
  transition: border-color .16s ease, background-color .16s ease, color .16s ease, box-shadow .16s ease, opacity .16s ease, transform .16s ease;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled,
.secondary-button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .46;
  filter: saturate(.55);
}

.field:disabled,
.search:disabled {
  border-color: #252d34;
  background: #11171c;
  color: #737c83;
  box-shadow: none;
}
.primary-button:focus-visible,
.secondary-button:focus-visible,
.danger-button:focus-visible,
.chip:focus-visible,
.menu-item:focus-visible,
.nav-button:focus-visible,
.goods-sheet:focus-visible,
.warehouse-shortcut:focus-visible,
.field:focus-visible,
.search:focus-visible,
a.secondary-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.field:focus-visible,
.search:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.modal-actions {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  align-items: stretch;
}
.modal-actions > * { min-width: 0; }

.compact-modal .modal-actions {
  position: sticky;
  bottom: -22px;
  z-index: 3;
  margin-right: -22px;
  margin-left: -22px;
  margin-bottom: -22px;
  padding: 14px 22px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid #293139;
  background: rgba(17,24,29,.97);
  backdrop-filter: blur(16px);
}
.compact-modal .form-group label {
  line-height: 1.25;
}

.modal input.field,
.modal select.field,
.modal textarea.field {
  scroll-margin-top: 150px;
}

@media (hover: hover) and (pointer: fine) {
.primary-button:not(:disabled):hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
  }
.secondary-button:not(:disabled):hover,
.danger-button:not(:disabled):hover,
.chip:not(:disabled):hover,
.menu-item:hover,
.goods-sheet:hover,
.warehouse-shortcut:hover {
    border-color: #46515a;
    background-color: #1d252c;
  }
  .nav-button:hover { color: #c8cdd1; }
}
.primary-button:not(:disabled):active,
.secondary-button:not(:disabled):active,
.danger-button:not(:disabled):active,
.chip:not(:disabled):active,
.menu-item:active,
.goods-sheet:active,
.warehouse-shortcut:active {
  transform: translateY(1px);
}

@media (max-width: 520px) {
  .compact-modal .modal-actions {
    bottom: -20px;
    margin-right: -20px;
    margin-left: -20px;
    margin-bottom: -20px;
    padding-right: 20px;
    padding-left: 20px;
  }
  .modal-actions { grid-template-columns: 1fr 1fr; }
  .modal-actions > :only-child { grid-column: 1 / -1; }
}

@media (max-width: 380px) {
  .modal-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}


/* 0.39.0 · Нормализация визуального фундамента */
:root {
  --surface-2: #181f26;
  --surface-3: #11181d;
  --surface-4: #0e1418;
  --radius-card: 24px;
  --radius-control: 18px;
  --radius-icon: 17px;
  --control-height: 60px;
  --control-height-lg: 68px;
  --card-shadow: 0 14px 34px rgba(0,0,0,.15);
  --card-gradient: linear-gradient(145deg, var(--surface-3), var(--surface-4));
  --text-secondary: #929aa1;
}

body {
  line-height: 1.35;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
.panel,
.order-card,
.legacy-client-card,
.warehouse-group {
  border-color: var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
}
.panel,
.legacy-client-card {
  background: var(--card-gradient);
}

.search,
.field {
  min-height: var(--control-height);
  border-radius: var(--radius-control);
  background: var(--surface-2);
}
.search-with-icon .search {
  min-height: var(--control-height-lg);
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 50px;
  border-radius: 17px;
}
.page-head h1,
.brand-title,
.menu-name,
.panel-title {
  text-wrap: balance;
}
.lead,
.menu-description,
.small,
.form-group label,
.metric-label {
  color: var(--text-secondary);
}
.badge-icon,
.settings-link-icon,
.client-avatar {
  border-radius: var(--radius-icon);
}
.metric,
.analytics-kpi {
  min-width: 0;
}
.metric-value,
.analytics-kpi > strong {
  font-variant-numeric: tabular-nums;
}
.analytics-kpi > strong,
.metric-value {
  overflow-wrap: anywhere;
}
.menu-copy,
.stock-copy {
  min-width: 0;
}
.menu-description {
  overflow-wrap: anywhere;
}

@media (max-width: 520px) {
  h1 { font-size: clamp(32px, 9vw, 39px); }
  .lead { font-size: 17px; }
  .panel-title { font-size: 20px; }
  .menu-name { font-size: 21px; }
  .menu-description { font-size: 15px; }

  .analytics-kpi > strong {
    font-size: clamp(20px, 6.5vw, 25px);
    white-space: normal;
  }
  .metric-value {
    font-size: clamp(20px, 6.2vw, 25px);
  }
.order-card,
.panel,
.legacy-client-card {
    border-radius: 22px;
  }
}

@media (max-width: 380px) {
  .topbar { padding-right: 16px; padding-left: 16px; }
  .content { padding-right: 14px; padding-left: 14px; }
  .brand-title { font-size: 20px; }
  .brand-subtitle { font-size: 10px; }
  .logo { width: 64px; height: 64px; flex-basis: 64px; border-radius: 18px; }
  .logo .ui-icon { width: 38px; height: 38px; }
  .status { padding: 6px 10px; font-size: 12px; }
}
.draft-card {
  margin-bottom: 14px;
  padding: 20px;
  border-radius: 22px;
  background: var(--card-gradient);
}
.draft-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 16px;
}
.draft-actions button { min-height: 46px; }

@media (max-width: 380px) {
  .draft-actions { grid-template-columns: 1fr; }
}
/* 0.40.0 · Бэкапы,
.shopping-content { padding-top: 28px; }

.backup-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
}
.backup-grid button {
  min-width: 0;
  min-height: 46px;
}

.legacy-shopping-card {
  min-height: 86px;
  margin-bottom: 0;
  padding: 18px 20px;
  border-radius: 22px;
}
.legacy-shopping-card > div:first-child { min-width: 0; }
.legacy-shopping-card .stock-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shopping-content .client-list { gap: 12px; }

@media (max-width: 520px) {
  .backup-grid { grid-template-columns: 1fr; }
  .legacy-shopping-card { align-items: flex-start; }
}

@media (max-width: 380px) {
  .legacy-shopping-card { display: grid; gap: 10px; }
  .shopping-need { text-align: left; }
}


/* 0.40.1 · Узкие экраны 320–360 px */
@media (max-width: 360px) {
  .topbar {
    min-height: 112px;
    gap: 12px;
    padding: 20px 14px;
  }
  .logo {
    width: 60px;
    height: 60px;
    flex-basis: 60px;
    border-radius: 17px;
  }
  .logo .ui-icon { width: 35px; height: 35px; }
  .brand-title {
    font-size: clamp(17px, 5.55vw, 20px);
    letter-spacing: -.025em;
  }
  .brand-subtitle {
    margin-top: 6px;
    font-size: 9px;
    letter-spacing: .1em;
  }

  .modal-backdrop { top: 112px; }
  .content { padding-top: 28px; }
  .order-card { padding: 20px 16px 22px; }
  .appliance {
    padding-top: 16px;
    padding-bottom: 14px;
  }

  .order-money {
    grid-template-columns: 1fr;
    gap: 9px;
  }
.action {
    min-height: 68px;
    font-size: 10px;
  }
  .action span .ui-icon { width: 22px; height: 22px; }

  .warehouse-shortcuts { grid-template-columns: 1fr; }
  .analytics-period-grid { grid-template-columns: repeat(2, 1fr); }
  .analytics-kpis { grid-template-columns: 1fr; }
}


/* 0.40.5 · Компактный визуальный масштаб */
.shell {
  width: min(100%, 700px);
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
}

.topbar {
  min-height: 104px;
  gap: 14px;
  padding: 18px;
}
.logo {
  width: 60px;
  height: 60px;
  flex-basis: 60px;
  border-radius: 18px;
}
.logo .ui-icon { width: 35px; height: 35px; }
.brand-title { font-size: clamp(22px, 4vw, 27px); }
.brand-subtitle { margin-top: 6px; font-size: 11px; }
.content,
.orders-content,
.analytics-content,
.more-content,
.goods-content,
.shopping-content {
  padding-top: 24px;
}
.content { padding-right: 16px; padding-left: 16px; }
.page-head { gap: 12px; margin-bottom: 16px; }
h1 { font-size: clamp(28px, 5.5vw, 35px); }
h2 { font-size: 21px; }
.lead { margin-top: 6px; font-size: 15px; }

.panel {
  margin-bottom: 14px;
  padding: 16px;
  border-radius: 20px;
}
.panel-title { gap: 8px; margin-bottom: 13px; font-size: 18px; }
.badge-icon .ui-icon { width: 18px; height: 18px; }
.primary-button,
.secondary-button,
.danger-button {
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
}
.search,
.field,
.modal .field {
  min-height: 52px;
  padding-right: 15px;
  padding-left: 15px;
  border-radius: 15px;
  font-size: 15px;
}
.search-with-icon > .ui-icon { left: 18px; width: 22px; height: 22px; }
.search-with-icon .search,
.warehouse-search .search {
  min-height: 46px;
  padding-left: 50px;
  border-radius: 17px;
  font-size: 15px;
}
.chip { padding: 8px 16px; font-size: 14px; }

.order-card { margin-bottom: 14px; padding: 18px 19px 20px; border-radius: 20px; }
.status { margin-top: 5px; padding: 6px 10px; border-radius: 10px; font-size: 12px; }
.appliance { gap: 12px; padding: 16px 0 13px; }
.meta { gap: 7px 13px; padding: 12px 2px; font-size: 12px; }
.actions { margin-top: 13px; }
.action { min-height: 62px; font-size: 10px; }
.action span .ui-icon { width: 21px; height: 21px; }

.warehouse-shortcuts { gap: 10px; margin-bottom: 14px; }
.warehouse-shortcut { gap: 9px; min-height: 56px; padding: 10px 13px; border-radius: 15px; font-size: 15px; }
.warehouse-shortcut .ui-icon { width: 21px; height: 21px; }
.warehouse-group { padding: 16px; border-radius: 20px; }
.legacy-stock-card { padding: 15px 16px 15px 19px; border-radius: 18px; }
.stock-copy .stock-name,
.stock-name { font-size: 17px; }
.legacy-stock-actions button { min-height: 46px; font-size: 12px; }

.analytics-period-grid { gap: 9px; margin-bottom: 15px; }
.analytics-period-grid .chip { min-height: 46px; font-size: 14px; }
.analytics-range-nav { grid-template-columns: 48px minmax(0,1fr) 48px; gap: 12px; margin-bottom: 16px; }
.analytics-range-nav strong { font-size: 18px; }
.analytics-range-nav small { font-size: 11px; }
.analytics-arrow { width: 48px; height: 48px; border-radius: 14px; font-size: 34px; }
.analytics-kpi { padding: 14px; border-radius: 15px; }
.analytics-kpi > strong { margin-top: 6px; font-size: 23px; }
.analytics-kpi > small { margin-top: 7px; }
.analytics-gem .ui-icon { width: 21px; height: 21px; }
.metric { padding: 13px; border-radius: 15px; }
.metric-value { font-size: clamp(20px, 5vw, 25px); }
.analytics-work .metric { min-height: 82px; }

.menu-list { gap: 11px; }
.legacy-more-list { gap: 12px; }
.menu-item { gap: 14px; min-height: 90px; padding: 14px 17px; border-radius: 20px; }
.menu-icon { width: 56px; height: 56px; flex-basis: 56px; border-radius: 16px; }
.menu-icon .ui-icon { width: 28px; height: 28px; }
.menu-name { font-size: 20px; }
.menu-description { margin-top: 5px; font-size: 14px; }
.menu-item .chevron .ui-icon { width: 22px; height: 22px; }

.empty { padding: 34px 15px; }
.empty-icon { min-height: 46px; font-size: 42px; }
.empty-icon .ui-icon { width: 40px; height: 40px; }
.backup-grid button { min-height: 50px; }
.legacy-shopping-card { min-height: 72px; padding: 14px 16px; border-radius: 18px; }

.bottom-nav {
  width: min(100%, 700px);
  padding: 8px 8px calc(9px + env(safe-area-inset-bottom));
}
.nav-button { gap: 4px; min-height: 62px; font-size: 12px; }
.nav-button .nav-icon { min-height: 23px; }
.nav-button .nav-icon .ui-icon { width: 24px; height: 24px; }

.modal-backdrop { top: 104px; bottom: calc(78px + env(safe-area-inset-bottom)); }
.modal { width: min(100%, 700px); padding: 16px 16px 38px; }
.modal.compact-modal { padding: 18px; border-radius: 20px; }
.modal h2 { margin-bottom: 18px; font-size: 25px; }
.compact-modal h2 { font-size: 21px; }
.form-grid { gap: 12px 10px; }
.form-group { gap: 6px; }
.form-section-title { margin-top: 23px; padding-top: 18px; }

@media (max-width: 520px) {
  .topbar { min-height: 94px; padding: 16px 14px; }
  .logo { width: 54px; height: 54px; flex-basis: 54px; border-radius: 16px; }
  .logo .ui-icon { width: 31px; height: 31px; }
  .brand-title { font-size: clamp(20px, 5.5vw, 24px); }
  .brand-subtitle { font-size: 9px; }
  .modal-backdrop { top: 94px; }
  h1 { font-size: clamp(27px, 8vw, 32px); }
  .lead { font-size: 14px; }
  .panel-title { font-size: 18px; }
  .menu-name { font-size: 18px; }
  .menu-description { font-size: 13px; }
}

@media (max-width: 360px) {
  .topbar { min-height: 88px; padding: 14px 12px; }
  .logo { width: 50px; height: 50px; flex-basis: 50px; border-radius: 15px; }
  .logo .ui-icon { width: 29px; height: 29px; }
  .brand-title { font-size: clamp(17px, 5.3vw, 19px); }
  .brand-subtitle { font-size: 8px; }
  .modal-backdrop { top: 88px; }
  .content { padding-top: 20px; padding-right: 12px; padding-left: 12px; }
  h1 { font-size: 27px; }
  .order-card { padding: 17px 14px 19px; }
.action { min-height: 60px; }
}


/* 0.41.0 · Компактный масштаб и более собранная визуальная иерархия */
:root {
  --radius-card: 20px;
  --radius-control: 15px;
  --radius-icon: 14px;
  --control-height: 52px;
  --control-height-lg: 58px;
}

.topbar {
  min-height: 104px;
  gap: 14px;
  padding: 20px 20px;
}
.logo {
  width: 60px;
  height: 60px;
  flex-basis: 60px;
  border-radius: 17px;
}
.logo .ui-icon { width: 35px; height: 35px; }
.brand-title { font-size: clamp(22px, 4vw, 27px); }
.brand-subtitle { margin-top: 6px; font-size: 11px; }

.content { padding: 24px 16px 8px; }
.page-head { margin-bottom: 15px; }
h1 { font-size: clamp(30px, 6vw, 36px); }
.lead { margin-top: 5px; font-size: 15px; }

.panel {
  margin-bottom: 12px;
  padding: 16px;
  border-radius: 20px;
}
.panel-title { gap: 8px; margin-bottom: 12px; font-size: 18px; }

.search,
.field {
  min-height: 52px;
  padding-right: 15px;
  padding-left: 15px;
  border-radius: 15px;
  font-size: 15px;
}
.primary-button,
.secondary-button,
.danger-button {
  min-height: 46px;
  padding: 10px 15px;
  border-radius: 14px;
  font-size: 14px;
}
.chip { padding: 8px 16px; }

.search-with-icon > .ui-icon {
  left: 18px;
  width: 22px;
  height: 22px;
}
.search-with-icon .search {
  min-height: 46px;
  padding-left: 50px;
  border-radius: 17px;
  font-size: 15px;
}

.order-card {
  margin-bottom: 12px;
  padding: 18px 18px 19px;
  border-radius: 20px;
}
.order-card::before { width: 4px; }
.status {
  margin-top: 5px;
  padding: 5px 10px;
  border-radius: 10px;
  font-size: 12px;
}
.appliance { padding: 14px 0 12px; }

.order-money { gap: 8px; margin-bottom: 12px; }

.meta { gap: 7px 12px; padding: 11px 2px; font-size: 12px; }

.actions { gap: 6px; margin-top: 12px; }
.action {
  min-height: 52px;
  gap: 4px;
  padding: 6px 2px;
  border-radius: 12px;
  font-size: 9px;
}
.action span .ui-icon { width: 20px; height: 20px; }

.menu-list { gap: 8px; }
.menu-item {
  min-height: 86px;
  gap: 14px;
  padding: 13px 16px;
  border-radius: 19px;
}
.menu-icon {
  width: 54px;
  height: 54px;
  flex-basis: 54px;
  border-radius: 15px;
}
.menu-icon .ui-icon { width: 28px; height: 28px; }
.menu-name { font-size: 19px; }
.menu-description { margin-top: 4px; font-size: 13px; }
.menu-item .chevron .ui-icon { width: 22px; height: 22px; }

.bottom-nav {
  padding-top: 7px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
}
.nav-button {
  min-height: 46px;
  gap: 5px;
  font-size: 12px;
}
.nav-button .nav-icon .ui-icon { width: 25px; height: 25px; }
.settings-link-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
}
.settings-link-icon .ui-icon { width: 18px; height: 18px; }

.modal-backdrop {
  top: 104px;
  bottom: calc(78px + env(safe-area-inset-bottom));
}
.modal { padding-top: 15px; }
.modal.compact-modal { border-radius: 20px; }
.modal h2 { font-size: 26px; }
.compact-modal h2 { font-size: 21px; }
.form-section-title {
  margin-top: 22px;
  padding-top: 17px;
}
.modal .field { min-height: 44px; border-radius: 15px; font-size: 15px; }
.textarea { min-height: 92px; padding-top: 13px; }

@media (max-width: 520px) {
  .topbar { min-height: 100px; padding: 18px 16px; }
  .logo { width: 56px; height: 56px; flex-basis: 56px; }
  .brand-title { font-size: clamp(19px, 5.5vw, 23px); }
  .brand-subtitle { font-size: 9px; }
  .content { padding: 22px 13px 8px; }
  .menu-item { min-height: 80px; padding: 12px 14px; }
  .menu-icon { width: 50px; height: 50px; flex-basis: 50px; }
  .menu-icon .ui-icon { width: 26px; height: 26px; }
  .modal-backdrop { top: 100px; bottom: calc(78px + env(safe-area-inset-bottom)); }
}

@media (max-width: 360px) {
  .topbar { min-height: 92px; padding: 16px 12px; }
  .logo { width: 50px; height: 50px; flex-basis: 50px; }
  .logo .ui-icon { width: 30px; height: 30px; }
  .brand-title { font-size: 17px; }
  .brand-subtitle { font-size: 8px; }
  .modal-backdrop { top: 92px; }
}

/* Печать: один компактный лист A4 */
@media print {
  @page { size: A4 portrait; margin: 5mm; }

  html,
  body {
    width: 210mm;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  .topbar,
  .bottom-nav,
  .no-print,
  .toast { display: none !important; }
.shell,
.content {
    width: 100% !important;
    max-width: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .act-sheet {
    width: 200mm !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    zoom: var(--act-print-zoom, .82);
    color: #000 !important;
    background: #fff !important;
    font-size: 9px !important;
    line-height: 1.15 !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .act-sheet h2 {
    margin: 0 0 3mm !important;
    font-size: 16px !important;
    line-height: 1 !important;
  }
  .act-contract-line { margin-bottom: 3mm !important; font-size: 9px !important; }
  .act-main-fields { gap: 1mm !important; margin-bottom: 3mm !important; }
.act-main-fields > div {
    grid-template-columns: 42mm 1fr !important;
    gap: 2mm !important;
    padding: 1mm 0 !important;
    font-size: 8.5px !important;
  }

  .act-sheet table {
    width: 100% !important;
    min-width: 0 !important;
    margin: 2mm 0 !important;
    border-collapse: collapse !important;
    font-size: 8px !important;
    table-layout: fixed !important;
  }
  .act-sheet th,
  .act-sheet td {
    padding: 1.2mm 1mm !important;
    line-height: 1.1 !important;
    word-break: break-word !important;
  }
  .act-sheet th:nth-child(1),
  .act-sheet td:nth-child(1) { width: 5%; }
  .act-sheet th:nth-child(2),
  .act-sheet td:nth-child(2) { width: 43%; }
  .act-sheet th:nth-child(3),
  .act-sheet td:nth-child(3) { width: 15%; }
  .act-sheet th:nth-child(4),
  .act-sheet td:nth-child(4) { width: 9%; }
  .act-sheet th:nth-child(5),
  .act-sheet td:nth-child(5) { width: 15%; }
  .act-sheet th:nth-child(6),
  .act-sheet td:nth-child(6) { width: 13%; }

  .act-total {
    margin: 2mm 0 !important;
    padding: 2mm 0 !important;
    font-size: 11px !important;
  }
  .act-acceptance {
    margin-top: 3mm !important;
    padding-top: 2mm !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
  .act-acceptance h3 { margin: 0 0 1.5mm !important; font-size: 10px !important; }
  .act-acceptance p { margin: 0 0 2mm !important; font-size: 8px !important; line-height: 1.2 !important; }
  .act-signatures {
    gap: 8mm !important;
    margin-top: 2mm !important;
    font-size: 8.5px !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
}
.settings-checkbox {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border: 1px solid #56616a;
  border-radius: 6px;
  background: #171e25;
}
.catalog-modal-actions {
  grid-template-columns: 1fr;
}
.catalog-modal-actions .primary-button {
  width: 100%;
}


/* 0.42.0 · Компактный UX по эталонным мобильным скриншотам */
:root {
  --radius-card: 17px;
  --radius-control: 13px;
  --radius-icon: 12px;
  --control-height: 46px;
  --control-height-lg: 52px;
}

body {
  font-size: 14px;
  line-height: 1.3;
}

.topbar {
  min-height: 88px;
  gap: 12px;
  padding: 16px 15px;
}
.logo {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
  border-radius: 15px;
}
.logo .ui-icon { width: 29px; height: 29px; }
.brand-title { font-size: clamp(19px, 5vw, 22px); }
.brand-subtitle { margin-top: 4px; font-size: 8.5px; letter-spacing: .11em; }

.content { padding: 18px 12px 6px; }
.page-head { margin-bottom: 12px; }
h1 { font-size: clamp(26px, 6vw, 31px); }
h2 { font-size: 21px; }
.lead { margin-top: 3px; font-size: 13px; }

.panel {
  margin-bottom: 10px;
  padding: 14px;
  border-radius: 17px;
  box-shadow: 0 9px 24px rgba(0,0,0,.13);
}
.panel-title { margin-bottom: 10px; font-size: 16px; }

.search,
.field {
  min-height: 46px;
  padding: 0 12px;
  border-radius: 13px;
  font-size: 14px;
}
.primary-button,
.secondary-button,
.danger-button {
  min-height: 42px;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
}
.chip { padding: 7px 13px; font-size: 12px; }

.orders-content { padding-top: 17px; }

.search-with-icon > .ui-icon {
  left: 15px;
  width: 19px;
  height: 19px;
}
.search-with-icon .search {
  min-height: 48px;
  padding-left: 42px;
  border-radius: 14px;
  font-size: 13px;
}

.order-card {
  margin-bottom: 10px;
  padding: 15px 14px 16px;
  border-radius: 17px;
}
.status { margin-top: 4px; padding: 4px 8px; border-radius: 8px; font-size: 10px; }

.appliance { padding: 11px 0 9px; }

.order-money { gap: 7px; margin-bottom: 9px; }

/* Телефон, адрес, гарантия и фото — одна компактная строка */
.meta {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto auto;
  align-items: center;
  gap: 7px;
  padding: 9px 0;
  overflow: hidden;
  font-size: 10px;
  white-space: nowrap;
}
.action {
  min-height: 52px;
  gap: 3px;
  padding: 5px 1px;
  border-radius: 10px;
  font-size: 8.5px;
}
.action span .ui-icon { width: 18px; height: 18px; }
.action-more span { color: #b8bec3; }

/* Меню дополнительных действий заявки */
.order-actions-backdrop {
  z-index: 90;
  top: 0 !important;
  bottom: 0 !important;
  align-items: flex-end;
  padding: 12px;
  /* было .76 без backdrop-filter вообще — почти прозрачно, тот же баг
     просвечивания, что и у catalog-modal-backdrop. */
  background: rgba(3,7,10,.95);
}
.order-actions-sheet {
  width: min(100%, 430px);
  margin: 0 auto max(6px, env(safe-area-inset-bottom));
  padding: 14px;
  border: 1px solid #2b343b;
  border-radius: 18px;
  background: #12191f;
  box-shadow: 0 24px 70px rgba(0,0,0,.5);
}
.order-actions-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}
.order-actions-head strong,
.order-actions-head small { display: block; }
.order-actions-head strong { font-size: 14px; }
.order-actions-head small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.order-actions-close,
.catalog-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  padding: 0;
  border: 1px solid #38434b;
  border-radius: 11px;
  background: #1a2229;
  color: #d9dde0;
  font-size: 23px;
  line-height: 1;
}
.order-actions-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 7px;
}
.order-actions-grid button,
.order-actions-grid a {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 9px 11px;
  border: 1px solid #303a42;
  border-radius: 12px;
  background: #192128;
  color: #edf0f2;
  text-decoration: none;
  text-align: left;
}
.order-actions-grid .ui-icon { width: 19px; height: 19px; color: var(--accent); }
.order-actions-grid b { font-size: 12px; }
.order-actions-grid .danger .ui-icon,
.order-actions-grid .danger b { color: var(--red); }
.order-actions-grid button:disabled { opacity: .42; }

/* Редактор заявки: плотная двухколоночная сетка */
.modal-backdrop {
  top: 88px;
  bottom: calc(68px + env(safe-area-inset-bottom));
  padding-top: 7px;
}
.modal {
  width: min(100%, 700px);
  padding: 12px 12px 28px;
}
.modal h2 { margin-bottom: 14px; font-size: 23px; }
.form-grid { gap: 9px 8px; }
.form-group { gap: 5px; min-width: 0; }
.form-group label {
  font-size: 10px;
  letter-spacing: .055em;
}
.modal .field {
  min-width: 0;
  min-height: 46px;
  border-radius: 13px;
  font-size: 13px;
}
.textarea {
  min-height: 76px;
  padding-top: 11px;
  font-size: 13px;
}
.compact-textarea { min-height: 46px; }
.form-section-title {
  margin: 18px 0 9px;
  padding-top: 13px;
  font-size: 10.5px;
}
.legacy-catalog-button,
.legacy-stock-button {
  min-height: 50px;
  padding: 9px 12px;
  border-radius: 13px;
  font-size: 13px;
}
.legacy-catalog-button .ui-icon,
.legacy-stock-button .ui-icon { width: 19px; height: 19px; }
.legacy-material-help { margin-bottom: 9px; font-size: 11px; }
.legacy-service-total { padding-top: 9px; font-size: 13px; }
.legacy-guarantee-card { padding: 12px; }
.order-calculation-summary { gap: 7px; padding: 10px; }

/* Каталог услуг: неподвижный фон, фиксированная шапка, скролл только списка */
.catalog-modal-backdrop {
  top: 0 !important;
  bottom: 0 !important;
  align-items: stretch;
  overflow: hidden;
  padding: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom));
}
.catalog-modal {
  display: flex;
  flex-direction: column;
  width: min(100%, 650px);
  max-height: 100%;
  margin: auto;
  padding: 12px;
  overflow: hidden;
  border-radius: 18px;
}
.catalog-modal-head {
  flex: 0 0 auto;
  align-items: center;
  margin-bottom: 8px;
}
.catalog-modal-head h2 { margin-top: 1px; font-size: 18px; }
.catalog-modal-head .small { font-size: 9px; }
.catalog-search-row { flex: 0 0 auto; margin-bottom: 7px; }
.catalog-search-row .search {
  min-height: 44px;
  padding-left: 41px;
  font-size: 13px;
}
.catalog-service-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  align-content: start;
  gap: 10px;
  padding-right: 2px;
}
.catalog-service-group h3 { margin-bottom: 4px; font-size: 13px; }
.catalog-service-option {
  grid-template-columns: 30px minmax(0,1fr) auto;
  gap: 7px;
  min-height: 48px;
  padding: 5px 2px;
}
.catalog-check {
  width: 28px;
  height: 28px;
  border-width: 1px;
  border-radius: 7px;
  font-size: 17px;
}
.catalog-service-copy strong { font-size: 13px; }
.catalog-service-copy small { margin-top: 1px; font-size: 10px; }
.catalog-service-price { font-size: 13px; }
.catalog-fit-summary {
  flex: 0 0 auto;
  gap: 3px;
  margin-top: 7px;
  padding: 8px 10px;
  border-radius: 11px;
  font-size: 10px;
}
.catalog-fit-summary strong { font-size: 12px; }
.catalog-modal-actions {
  position: static;
  flex: 0 0 auto;
  margin: 7px 0 0;
  padding: 0;
  border-top: 0;
  background: transparent;
}
.catalog-modal-actions button { min-height: 44px; }

/* Нижняя навигация компактнее */
.bottom-nav {
  padding-top: 5px;
  padding-bottom: calc(6px + env(safe-area-inset-bottom));
}
.nav-button { min-height: 56px; gap: 3px; font-size: 10px; }
.nav-button .nav-icon .ui-icon { width: 22px; height: 22px; }

@media (max-width: 520px) {
  .topbar { min-height: 84px; padding: 14px 12px; }
  .logo { width: 46px; height: 46px; flex-basis: 46px; }
  .logo .ui-icon { width: 27px; height: 27px; }
  .brand-title { font-size: clamp(18px, 5.2vw, 21px); }
  .brand-subtitle { font-size: 8px; }
  .content { padding: 16px 10px 6px; }
  .panel { padding: 13px; border-radius: 16px; }

  .order-editor-backdrop { top: 84px; bottom: calc(66px + env(safe-area-inset-bottom)); }
  .order-editor-modal .form-grid,
  .order-editor-modal .legacy-payment-grid {
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 8px 7px;
  }
  .order-editor-modal .form-group.full { grid-column: 1 / -1; }
  .order-editor-modal .field { min-width: 0; }
  .order-editor-modal input[type="datetime-local"] { font-size: 11px; }

  .catalog-modal { width: 100%; max-height: 100%; padding: 11px; border-radius: 16px; }
  .catalog-modal-actions { margin: 7px 0 0; padding: 0; }

  .menu-item { min-height: 70px; padding: 10px 12px; gap: 11px; }
  .menu-icon { width: 44px; height: 44px; flex-basis: 44px; border-radius: 13px; }
  .menu-icon .ui-icon { width: 23px; height: 23px; }
  .menu-name { font-size: 16px; }
  .menu-description { font-size: 11px; }
}

@media (max-width: 360px) {
  .topbar { min-height: 80px; }
  .modal-backdrop,
  .order-editor-backdrop { top: 80px; }
  .catalog-modal-backdrop,
  .order-actions-backdrop { top: 0 !important; }
  .action { min-height: 49px; font-size: 7.5px; }
  .action span .ui-icon { width: 16px; height: 16px; }
  .meta { gap: 5px; font-size: 9px; }
}


/* 0.42.1 · Viewport safety audit — все формы и модалки */
html,
body,
.shell {
  max-width: 100%;
  overflow-x: hidden;
}
.content,
.panel,
.modal,
.modal form,
.compact-modal,
.form-grid,
.form-group,
.line-list,
.line-item,
.modal-actions,
.material-card-head,
.material-card-controls {
  min-width: 0;
  max-width: 100%;
}

.modal-backdrop {
  overflow-x: hidden;
  overscroll-behavior: contain;
}

.modal {
  width: min(calc(100vw - 16px), 700px);
  max-width: calc(100vw - 16px);
  margin-right: auto;
  margin-left: auto;
  overflow-x: hidden;
}

.modal.compact-modal {
  width: min(calc(100vw - 20px), 620px);
  max-width: calc(100vw - 20px);
  margin: 6px auto 18px;
  padding: 14px;
}

.modal input,
.modal select,
.modal textarea,
.modal button,
.modal a,
.modal .field,
.modal .readonly-field {
  min-width: 0;
  max-width: 100%;
}

.modal input,
.modal select,
.modal textarea,
.modal .field {
  width: 100%;
}

.modal select,
.modal input[type="date"],
.modal input[type="datetime-local"] {
  max-inline-size: 100%;
}

.modal h1,
.modal h2,
.modal h3,
.modal label,
.modal strong,
.modal small,
.modal p,
.modal button,
.modal a {
  overflow-wrap: anywhere;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.modal-actions {
  grid-template-columns: repeat(auto-fit, minmax(min(128px, 100%), 1fr));
  gap: 7px;
}
.modal-actions > * {
  width: 100%;
  min-width: 0;
}

/* Строки услуг — без фиксированной ширины */
.order-editor-modal .legacy-service-row {
  grid-template-columns: 20px minmax(0, 1fr) minmax(44px, .32fr) minmax(70px, .52fr) 36px;
  gap: 4px;
  width: 100%;
  min-width: 0;
}
.order-editor-modal .legacy-service-row > * { min-width: 0; }
.order-editor-modal .legacy-service-row .field {
  width: 100%;
  min-width: 0;
  padding-right: 5px !important;
  padding-left: 5px !important;
  font-size: 12px !important;
}
.order-editor-modal .service-price-field {
  min-width: 0;
}
.order-editor-modal .service-price-field .field {
  padding-right: 18px !important;
}
.order-editor-modal .service-price-field > span {
  right: 5px;
  font-size: 10px;
}
.order-editor-modal .service-remove {
  width: 34px;
  height: 34px;
}

/* Материалы */
.order-editor-modal .legacy-material-card {
  width: 100%;
  min-width: 0;
  padding: 10px;
}
.order-editor-modal .material-card-head {
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 6px;
}
.order-editor-modal .material-card-head > div { min-width: 0; }
.order-editor-modal .material-name-field {
  width: 100%;
  min-width: 0;
  font-size: 13px !important;
}
.order-editor-modal .material-remove {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}
.order-editor-modal .material-card-controls {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 9px;
}
.order-editor-modal .material-card-controls label { min-width: 0; }
.order-editor-modal .material-card-controls label > span {
  font-size: 8.5px;
  letter-spacing: .025em;
}
.order-editor-modal .material-card-controls .field {
  min-width: 0;
  min-height: 42px !important;
  padding: 0 6px;
  font-size: 11px;
}
#goods-form .line-item {
  grid-template-columns: minmax(0, 1fr) 58px 76px 34px;
  gap: 5px;
  width: 100%;
  min-width: 0;
}
#goods-form .line-item > * { min-width: 0; }
#goods-form .line-item .field {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0 6px;
  font-size: 11px;
}
#goods-form .remove-line {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

/* Гарантия и summary-блоки */
.legacy-guarantee-head {
  grid-template-columns: 25px minmax(0, 1fr) auto;
  gap: 7px;
}
.guarantee-date {
  max-width: 100%;
  padding: 5px 7px;
  font-size: 9px;
}
.order-calculation-summary,
.calculated-total {
  min-width: 0;
  max-width: 100%;
}
.order-calculation-summary > div,
.calculated-total > * { min-width: 0; }
.finance-row,
.goods-sheet {
  min-width: 0;
  max-width: 100%;
}
.finance-row > *,
.goods-sheet > * {
  min-width: 0;
}
/* Long values never force page width */
.stock-name,
.finance-copy,
.menu-copy,
.small,
.order-comment {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 520px) {
  .modal {
    width: calc(100vw - 10px);
    max-width: calc(100vw - 10px);
    padding-right: 9px;
    padding-left: 9px;
  }
  .modal.compact-modal {
    width: calc(100vw - 12px);
    max-width: calc(100vw - 12px);
    margin: 3px auto 14px;
    padding: 12px;
  }

  /* Основной редактор заявки остаётся 2 колонки только для простых полей */
  .order-editor-modal .form-grid,
  .order-editor-modal .legacy-payment-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .order-editor-modal .form-group.full { grid-column: 1 / -1; }

  /* Остальные компактные формы безопаснее в одну колонку */
  .compact-modal .form-grid {
    grid-template-columns: 1fr;
  }
  .compact-modal .form-group.full { grid-column: 1; }

  .order-editor-modal .legacy-service-row {
    grid-template-columns: 18px minmax(0, 1fr) 42px 65px 32px;
    gap: 3px;
  }
  .order-editor-modal .service-check .ui-icon { width: 15px; height: 15px; }
  .order-editor-modal .service-remove { width: 30px; height: 30px; }

  .order-editor-modal .material-card-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  #goods-form .line-item {
    grid-template-columns: minmax(0, 1fr) 52px 68px 32px;
  }

  .legacy-guarantee-head {
    grid-template-columns: 22px minmax(0,1fr);
  }
  .guarantee-date {
    grid-column: 2;
    justify-self: start;
  }

  .modal-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .modal-actions > :only-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 380px) {
  /* На 320–380 px сложные строки переходят в вертикально безопасную компоновку */
  .order-editor-modal .legacy-service-row {
    grid-template-columns: 18px minmax(0, 1fr) 30px;
    padding: 6px 0;
  }
  .order-editor-modal .legacy-service-row .service-check {
    grid-column: 1;
    grid-row: 1;
  }
  .order-editor-modal .legacy-service-row .service-name-field {
    grid-column: 2;
    grid-row: 1;
  }
  .order-editor-modal .legacy-service-row .service-remove {
    grid-column: 3;
    grid-row: 1;
  }
  .order-editor-modal .legacy-service-row .service-qty-field {
    grid-column: 2;
    grid-row: 2;
    width: 52px;
    justify-self: start;
  }
  .order-editor-modal .legacy-service-row .service-price-field {
    grid-column: 2 / 4;
    grid-row: 2;
    margin-left: 58px;
  }

  .order-editor-modal .material-card-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .order-editor-modal .material-card-controls label:last-child {
    grid-column: auto;
  }

  #goods-form .line-item {
    grid-template-columns: minmax(0, 1fr) 48px 30px;
    padding: 7px;
  }
  #goods-form .line-item [data-line="name"] {
    grid-column: 1 / -1;
  }
  #goods-form .line-item [data-line="price"] {
    grid-column: 1;
    grid-row: 2;
  }
  #goods-form .line-item [data-line="qty"] {
    grid-column: 2;
    grid-row: 2;
  }
  #goods-form .line-item .remove-line {
    grid-column: 3;
    grid-row: 2;
  }

  .modal-actions {
    grid-template-columns: 1fr;
  }
}


/* 0.50.0 · Единый непрозрачный слой для модалок
   Не зависит от поддержки backdrop-filter и не даёт контенту нижнего
   экрана накладываться на форму или принимать нажатия. */
.modal-backdrop {
  z-index: 95;
  top: var(--modal-top);
  bottom: var(--modal-bottom);
  background: #050b0f;
  isolation: isolate;
}

:root {
  --modal-top: 88px;
  --modal-bottom: calc(68px + env(safe-area-inset-bottom));
}

@media (max-width: 520px) {
  :root {
    --modal-top: 82px;
    --modal-bottom: calc(64px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 360px) {
  :root {
    --modal-top: 78px;
    --modal-bottom: calc(62px + env(safe-area-inset-bottom));
  }
}

/* 0.42.2 · Финальная стабилизация модальных футеров */
.modal-backdrop > .modal {
  flex: 0 0 auto;
}

.compact-modal .modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin: 12px 0 0;
  padding: 9px 0 calc(4px + env(safe-area-inset-bottom));
  border-top: 1px solid #293139;
  background: rgba(17,24,29,.96);
  backdrop-filter: blur(14px);
}

.compact-modal .modal-actions > * {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 520px) {
  .compact-modal .modal-actions {
    bottom: 0;
    margin: 10px 0 0;
    padding-right: 0;
    padding-left: 0;
  }
}
.analytics-content {
  padding-top: 16px;
}
.analytics-content .page-head {
  margin-bottom: 11px;
}

/* Склад */
.warehouse-search { margin-bottom: 8px; }
.warehouse-search .search { min-height: 46px; font-size: 13px; }
.warehouse-filter { margin-bottom: 8px; }
.warehouse-filter .field { min-height: 44px; font-size: 12px; }

.warehouse-shortcuts {
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 6px;
  margin-bottom: 8px;
}
.warehouse-shortcut {
  min-height: 46px;
  gap: 6px;
  padding: 8px 9px;
  border-radius: 12px;
  font-size: 11px;
}
.warehouse-shortcut .ui-icon { width: 17px; height: 17px; }
.warehouse-check {
  width: 18px;
  height: 18px;
  border-radius: 5px;
}
.warehouse-movements {
  padding: 12px;
}
.warehouse-movements .price-row {
  min-height: 50px;
  padding: 8px 0;
}
.warehouse-movements .price-row strong { font-size: 12px; }
.warehouse-movements .price-row .small { font-size: 9px; }

.warehouse-group {
  padding: 10px;
  border-radius: 15px;
}

.legacy-stock-card {
  padding: 10px 11px 11px 13px;
  border-radius: 13px;
}
.stock-copy .stock-name,
.stock-name { font-size: 13px; line-height: 1.2; }
.stock-copy .small { margin-top: 2px; font-size: 8.5px; }

.legacy-stock-actions {
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 5px;
  margin-top: 8px;
}
.legacy-stock-actions button {
  min-height: 36px;
  padding: 6px 7px;
  border-radius: 10px;
  font-size: 10px;
}
.legacy-stock-actions .ui-icon { width: 14px; height: 14px; }

/* Аналитика */
.analytics-period-grid {
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 5px;
  margin-bottom: 8px;
}
.analytics-period-grid .chip {
  min-height: 36px;
  padding: 6px 4px;
  border-radius: 10px;
  font-size: 10px;
}
.analytics-range-nav {
  grid-template-columns: 36px minmax(0,1fr) 36px;
  gap: 7px;
  margin-bottom: 9px;
}
.analytics-arrow {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 24px;
}
.analytics-range-nav strong { font-size: 13px; }
.analytics-range-nav small { margin-top: 1px; font-size: 9px; }

.analytics-content .panel {
  padding: 12px;
  margin-bottom: 9px;
  border-radius: 15px;
}
.analytics-content .panel-title {
  margin-bottom: 9px;
  font-size: 14px;
}
.analytics-kpi-panel .panel-title small {
  font-size: 9px;
}
.analytics-kpis {
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 6px;
}
.analytics-kpi {
  min-height: 70px;
  padding: 9px 10px;
  border-radius: 11px;
}
.analytics-kpi > span {
  font-size: 8px;
  letter-spacing: .045em;
}
.analytics-kpi > strong {
  margin-top: 6px;
  font-size: clamp(16px,5vw,20px);
  line-height: 1.05;
}
.analytics-kpi > small { display: block; margin-top: 5px; color: #43c77b; font-size: 8px; }


.analytics-work-grid {
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 5px;
}
.analytics-work-grid .metric {
  padding: 8px 6px;
  border-radius: 10px;
}
.analytics-work-grid .metric-label { font-size: 8px; }
.analytics-work-grid .metric-value {
  margin-top: 4px;
  font-size: 16px;
}

.analytics-ranking-row {
  grid-template-columns: 26px minmax(0,1fr) auto;
  gap: 7px;
  min-height: 46px;
  padding: 7px 0;
  border-width: 0 0 1px;
  border-radius: 0;
  background: transparent;
}
.analytics-ranking-row:last-child { border-bottom: 0; }
.ranking-place {
  width: 25px;
  height: 25px;
  border-radius: 7px;
  font-size: 10px;
}
.analytics-ranking-row strong { font-size: 11px; }
.analytics-ranking-row small { margin-top: 1px; font-size: 8px; }
.analytics-ranking-row b { font-size: 11px; }

.analytics-content .goods-sheet {
  min-height: 48px;
  padding: 7px 0;
}
.analytics-content .goods-sheet strong { font-size: 11px; }
.analytics-content .goods-sheet small { font-size: 8px; }
.analytics-content .goods-sheet b { font-size: 11px; }

.analytics-content .bars {
  min-height: 110px;
  gap: 5px;
}
.analytics-content .bar { max-height: 82px; }
.analytics-content .bar-wrap > span {
  font-size: 8px;
}
.legacy-finance-actions {
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 6px;
  margin-bottom: 9px;
}
.legacy-finance-actions button {
  min-height: 40px;
  font-size: 11px;
}
.legacy-finance-row {
  grid-template-columns: 30px minmax(0,1fr) auto 28px;
  gap: 7px;
  min-height: 48px;
  padding: 7px 0;
}
.legacy-finance-row > div:nth-child(2) strong { font-size: 11px; }
.legacy-finance-row .small { margin-top: 1px; font-size: 8.5px; }
.legacy-finance-row .remove-line {
  width: 27px;
  height: 27px;
  border-radius: 8px;
}
.legacy-finance-row .remove-line .ui-icon { width: 13px; height: 13px; }

/* Прайс */
.price-head {
  align-items: flex-start;
}
.price-tech-filter { margin-bottom: 10px; }
.price-tech-filter .field {
  min-height: 42px;
  font-size: 11px;
}

@media (max-width: 380px) {

  .analytics-kpi-panel .panel-title small {
    display: none;
  }
  .analytics-work-grid {
    grid-template-columns: repeat(3,minmax(0,1fr));
  }
  .analytics-work-grid .metric-label { font-size: 7px; }
  .analytics-work-grid .metric-value { font-size: 14px; }
  .legacy-finance-row {
    grid-template-columns: 28px minmax(0,1fr) 27px;
  }
  .legacy-finance-row .remove-line {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .price-head {
    display: grid;
    grid-template-columns: minmax(0,1fr);
  }
}


/* 0.43.1 · Мелкая функциональная полировка вторичных экранов */
#warehouse-movements {
  scroll-margin-top: 96px;
}
/* 0.44.0 · Компактные вторичные экраны */
.more-content,
.goods-content,
.shopping-content {
  padding-top: 16px;
}
.more-content .page-head,
.goods-content .page-head,
.shopping-content .page-head {
  margin-bottom: 11px;
}
.goods-content .page-head > .secondary-button,
.shopping-content .page-head > .secondary-button {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 11px;
}
.legacy-more-list {
  gap: 5px;
}
.legacy-more-list .menu-item {
  min-height: 58px;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 13px;
}
.legacy-more-list .menu-icon {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
  border-radius: 11px;
}
.legacy-more-list .menu-icon .ui-icon {
  width: 20px;
  height: 20px;
}
.legacy-more-list .menu-name {
  font-size: 13px;
  line-height: 1.15;
}
.legacy-more-list .menu-description {
  margin-top: 2px;
  font-size: 9px;
  line-height: 1.2;
}
.legacy-more-list .chevron .ui-icon {
  width: 17px;
  height: 17px;
}
.client-list {
  gap: 7px;
}
.legacy-client-card {
  padding: 11px 12px;
  border-radius: 14px;
}
.client-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}
.client-avatar .ui-icon {
  width: 19px;
  height: 19px;
}
.client-meta {
  gap: 8px;
  margin-top: 8px;
  padding-top: 7px;
  font-size: 9px;
}
.client-actions {
  gap: 5px;
  margin-top: 8px;
}
.client-actions .primary-button,
.client-actions .secondary-button {
  min-height: 36px;
  padding: 6px 8px;
  font-size: 10px;
}
.client-actions .ui-icon {
  width: 14px;
  height: 14px;
}
.goods-preview-total {
  padding: 9px 5px 1px;
  font-size: 12px;
}
.goods-preview-total strong:last-child {
  font-size: 15px;
}
.settings-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 5px;
}
.settings-save {
  min-height: 39px;
  font-size: 11px;
}
.draft-card {
  margin-bottom: 7px;
  padding: 11px 12px;
  border-radius: 14px;
}
.draft-actions {
  gap: 5px;
  margin-top: 8px;
}
.draft-actions button {
  min-height: 36px;
  padding: 6px 8px;
  font-size: 10px;
}
.backup-grid {
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 5px;
  margin-bottom: 10px;
}
.backup-grid button {
  min-height: 38px;
  padding: 6px 7px;
  border-radius: 10px;
  font-size: 9px;
}

/* Список покупок */
.shopping-content .client-list {
  gap: 6px;
}
.legacy-shopping-card {
  min-height: 54px;
  padding: 9px 11px;
  border-radius: 13px;
}
.legacy-shopping-card .stock-name {
  font-size: 11px;
}
.legacy-shopping-card .small {
  margin-top: 2px;
  font-size: 8px;
}
.shopping-need span {
  font-size: 8px;
}
.shopping-need strong {
  margin-top: 2px;
  font-size: 11px;
}

@media (max-width: 380px) {

  .backup-grid {
    grid-template-columns: 1fr 1fr;
  }

  .legacy-shopping-card {
    grid-template-columns: minmax(0,1fr) auto;
  }
}


/* 0.44.1 · Навигационная мелочь */
#product-price-panel { scroll-margin-top: 96px; }


/* 0.47.0 · Финальная мобильная сверка по доступным эталонным скриншотам */
body.modal-open { overflow: hidden !important; }

/* Фон, линии и глубина ближе к старой CRM */
:root {
  --bg: #050b0f;
  --panel: #11181d;
  --panel-2: #182028;
  --line: #2b353d;
  --muted: #92999f;
  --text: #f0f2f3;
  --accent: #ff6b57;
}

body {
  background:
    radial-gradient(circle at 18% 86%, rgba(255,107,87,.045), transparent 22%),
    linear-gradient(180deg,#050b0f 0%,#03080c 100%);
}
.panel,
.order-card,
.menu-item,
.compact-modal,
.warehouse-group,
.legacy-stock-card,
.legacy-client-card {
  border-color: #2a343c;
  box-shadow: 0 8px 22px rgba(0,0,0,.16);
}

/* Главная карточка — плотнее по пропорциям референса */
.order-card {
  padding: 14px 13px 15px;
  border-radius: 16px;
}
.status { padding: 4px 8px; font-size: 9.5px; }
.appliance { padding: 10px 0 8px; }
.order-money { margin-bottom: 8px; }
.meta {
  gap: 6px;
  padding: 8px 0;
  font-size: 9.5px;
}
.action {
  min-height: 48px;
  border-radius: 9px;
  font-size: 8px;
}
.action span .ui-icon { width: 17px; height: 17px; }

/* Редактор заявки — размеры соответствуют старому мобильному ритму */
.order-editor-modal {
  padding-top: 10px;
}
.order-editor-modal h2 {
  margin-bottom: 10px;
  font-size: 20px;
}
.order-editor-modal .form-section-title {
  margin: 14px 0 7px;
  padding-top: 10px;
  font-size: 9px;
}
.order-editor-modal .form-group { gap: 3px; }
.order-editor-modal .form-group label {
  font-size: 8.5px;
  letter-spacing: .045em;
}
.order-editor-modal .field {
  min-height: 42px;
  padding: 0 10px;
  border-radius: 11px;
  font-size: 12px;
}
.order-editor-modal .textarea {
  min-height: 66px;
  padding-top: 9px;
}
.order-editor-modal .compact-textarea { min-height: 42px; }
.order-editor-modal .legacy-catalog-button,
.order-editor-modal .legacy-stock-button {
  min-height: 44px;
  font-size: 11px;
}
.order-editor-modal .legacy-material-help {
  margin: 0 0 7px;
  font-size: 9px;
  line-height: 1.3;
}
.order-editor-modal .legacy-service-total {
  padding-top: 7px;
  font-size: 11px;
}
.order-editor-modal .order-calculation-summary {
  padding: 8px;
  font-size: 10px;
}
.order-editor-modal .legacy-guarantee-card {
  padding: 10px;
}
.order-editor-modal .modal-actions {
  gap: 5px;
}
.order-editor-modal .modal-actions button {
  min-height: 40px;
  font-size: 11px;
}

/* Каталог услуг — компактный список, видимая шапка, скролл только внутри */
.catalog-modal {
  border-radius: 15px;
}
.catalog-modal-head {
  margin-bottom: 6px;
}
.catalog-modal-head h2 { font-size: 16px; }
.catalog-search-row .search {
  min-height: 40px;
  font-size: 12px;
}
.catalog-service-list { gap: 7px; }
.catalog-service-group h3 {
  margin: 4px 2px 2px;
  font-size: 11px;
}
.catalog-service-option {
  min-height: 42px;
  padding: 4px 2px;
}
.catalog-check {
  width: 25px;
  height: 25px;
  border-radius: 7px;
  font-size: 15px;
}
.catalog-service-copy strong { font-size: 12px; }
.catalog-service-copy small { font-size: 9px; }
.catalog-service-price { font-size: 12px; }
.catalog-modal-actions button {
  min-height: 40px;
  font-size: 11px;
}

/* Ещё — семь старых основных пунктов без отдельного системного блока */
.more-content .page-head { margin-bottom: 9px; }
.legacy-more-list { gap: 4px; }
.legacy-more-list .menu-item {
  min-height: 54px;
  padding: 7px 9px;
  border-radius: 12px;
}
.legacy-more-list .menu-icon {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
  border-radius: 10px;
}
.legacy-more-list .menu-icon .ui-icon {
  width: 19px;
  height: 19px;
}
.legacy-more-list .menu-name { font-size: 12.5px; }
.legacy-more-list .menu-description { font-size: 8.5px; }

@media (max-width: 520px) {
  .topbar {
    min-height: 82px;
    padding: 13px 12px;
    gap: 11px;
  }
  .logo {
    width: 45px;
    height: 45px;
    flex-basis: 45px;
    border-radius: 14px;
  }
  .logo .ui-icon { width: 27px; height: 27px; }
  .brand-title {
    font-size: clamp(18px,5vw,20px);
    line-height: 1.04;
  }
  .brand-subtitle {
    margin-top: 4px;
    font-size: 7.7px;
  }

  .content { padding: 14px 10px 5px; }
  .orders-content { padding-top: 14px; }

  .order-editor-backdrop {
    top: 82px;
    bottom: calc(64px + env(safe-area-inset-bottom));
  }

  .order-editor-modal .form-grid,
  .order-editor-modal .legacy-payment-grid {
    gap: 6px;
  }

  .bottom-nav {
    padding-top: 4px;
    padding-bottom: calc(5px + env(safe-area-inset-bottom));
  }
  .nav-button {
    min-height: 54px;
    font-size: 9.5px;
  }
  .nav-button .nav-icon .ui-icon {
    width: 21px;
    height: 21px;
  }
}

@media (max-width: 360px) {
  .topbar { min-height: 78px; }
  .order-editor-backdrop {
    top: 78px;
    bottom: calc(62px + env(safe-area-inset-bottom));
  }
  .order-card { padding-right: 11px; padding-left: 11px; }
  .action { min-height: 46px; font-size: 7.2px; }
}

/* 0.48.0 · Акт по эталону из архива */
.act-sheet {
  width: min(100%, 794px);
  margin: 0 auto 18px;
  padding: 28px 32px 34px;
  border: 1px solid #d6d6d6;
  border-radius: 0;
  background: #fff;
  color: #111;
  font-family: "Times New Roman", Times, serif;
  font-size: 14px;
  line-height: 1.22;
  box-shadow: 0 8px 30px rgba(0,0,0,.24);
}
.act-sheet h2 {
  margin: 0 0 8px;
  text-align: center;
  font-size: 24px;
  line-height: 1;
}
.act-contract-line {
  margin: 0 0 16px;
  text-align: right;
  font-size: 13px;
}
.act-main-fields {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
}
.act-main-fields > div {
  display: grid;
  grid-template-columns: 190px minmax(0,1fr);
  gap: 8px;
  align-items: end;
}
.act-main-fields b { font-size: 14px; }
.act-main-fields span {
  min-height: 22px;
  padding: 0 4px 2px;
  border-bottom: 1px solid #111;
}
.act-work-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}
.act-work-table th,
.act-work-table td {
  padding: 5px;
  border: 1px solid #111;
  text-align: center;
  vertical-align: middle;
}
.act-work-table th:nth-child(1),
.act-work-table td:nth-child(1) { width: 6%; }
.act-work-table th:nth-child(2),
.act-work-table td:nth-child(2) { width: 45%; }
.act-work-table th:nth-child(3),
.act-work-table td:nth-child(3) { width: 15%; }
.act-work-table th:nth-child(4),
.act-work-table td:nth-child(4) { width: 10%; }
.act-work-table th:nth-child(5),
.act-work-table td:nth-child(5) { width: 13%; }
.act-work-table th:nth-child(6),
.act-work-table td:nth-child(6) { width: 11%; }
.act-totals {
  display: grid;
  gap: 5px;
  margin-top: 10px;
}
.act-totals > div {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 12px;
  align-items: baseline;
  font-size: 14px;
}
.act-totals strong { font-size: 14px; }
.act-total-words {
  grid-template-columns: auto minmax(0,1fr) !important;
  justify-content: start;
}
.act-total-words span { font-weight: 700; }
.act-acceptance { margin-top: 22px; }
.act-acceptance h3 {
  margin: 0 0 10px;
  text-align: center;
  font-size: 18px;
}
.act-acceptance-date {
  margin-bottom: 10px;
  text-align: right;
  font-size: 13px;
}
.act-acceptance p {
  margin: 0;
  text-align: justify;
  font-size: 13px;
  line-height: 1.25;
}
.act-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 16px;
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 520px) {
  .act-sheet {
    padding: 16px 12px 20px;
    font-size: 10px;
  }
  .act-sheet h2 { font-size: 17px; }
  .act-contract-line { margin-bottom: 10px; font-size: 9px; }
  .act-main-fields { gap: 4px; margin-bottom: 8px; }
  .act-main-fields > div {
    grid-template-columns: 112px minmax(0,1fr);
    gap: 5px;
  }
  .act-main-fields b { font-size: 9px; }
  .act-main-fields span { min-height: 16px; font-size: 9px; }
  .act-work-table { font-size: 7.5px; }
  .act-work-table th,
  .act-work-table td { padding: 3px 2px; }
  .act-totals { gap: 3px; margin-top: 7px; }
  .act-totals > div,
  .act-totals strong { font-size: 9px; }
  .act-acceptance { margin-top: 14px; }
  .act-acceptance h3 { margin-bottom: 7px; font-size: 12px; }
  .act-acceptance-date,
  .act-acceptance p,
  .act-signatures { font-size: 8.5px; }
  .act-signatures { gap: 14px; margin-top: 10px; }
}

/* 0.48.1 · Список покупок — отдельный экран склада */
button.warehouse-shortcut {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  cursor: pointer;
}

/* 0.49.0 · Функциональная компоновка перед редизайном */

/* Ещё — не мелкое меню, но и не гигантские плитки */
.legacy-more-list {
  gap: 7px;
}
.legacy-more-list .menu-item {
  min-height: 70px;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 15px;
}
.legacy-more-list .menu-icon {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
  border-radius: 12px;
}
.legacy-more-list .menu-icon .ui-icon {
  width: 23px;
  height: 23px;
}
.legacy-more-list .menu-name {
  font-size: 15px;
  line-height: 1.15;
}
.legacy-more-list .menu-description {
  margin-top: 3px;
  font-size: 10px;
  line-height: 1.2;
}
.legacy-more-list .chevron .ui-icon {
  width: 18px;
  height: 18px;
}

/* Редактор заявки — чистая структура и сворачиваемые второстепенные блоки */
.order-editor-head {
  position: sticky;
  top: -12px;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0,1fr) 36px;
  align-items: center;
  gap: 8px;
  margin: -2px -2px 8px;
  padding: 8px 2px 7px;
  background: rgba(17,24,29,.97);
  backdrop-filter: blur(12px);
}
.order-editor-head h2 {
  margin: 0 !important;
}
.order-editor-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #182028;
  color: var(--text);
  font-size: 22px;
}
.order-extra-details {
  margin: 10px 0 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #11181d;
}
.order-extra-details > summary {
  min-height: 40px;
  padding: 10px 11px;
  cursor: pointer;
  color: #d8dcdf;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .035em;
  text-transform: uppercase;
}
.order-extra-body {
  padding: 0 10px 10px;
}
.order-extra-details .legacy-guarantee-card {
  margin: 0 0 8px;
}
.order-editor-modal .legacy-payment-grid {
  grid-template-columns: repeat(2,minmax(0,1fr)) !important;
  gap: 6px !important;
}

/* Список покупок — отдельный раздел с копированием */
.shopping-page-actions {
  margin: 0 0 9px;
}
.shopping-page-actions .primary-button {
  width: 100%;
  min-height: 40px;
  font-size: 11px;
}
.warehouse-check {
  width: 16px !important;
  height: 16px !important;
}
.warehouse-group {
  padding: 9px !important;
}
.legacy-stock-card {
  padding: 9px 10px 10px 12px !important;
}

/* Аналитика — показатели остаются информативными, но не огромными */
.analytics-content .panel {
  padding: 10px !important;
  margin-bottom: 7px !important;
}
.analytics-kpis {
  gap: 5px !important;
}
.analytics-kpi {
  min-height: 58px !important;
  padding: 7px 8px !important;
}
.analytics-kpi > span {
  font-size: 7.5px !important;
}
.analytics-kpi > strong {
  margin-top: 4px !important;
  font-size: 17px !important;
}
.analytics-kpi > small {
  margin-top: 3px !important;
  font-size: 6.8px !important;
}
.analytics-work-grid .metric {
  padding: 6px 5px !important;
}
.analytics-work-grid .metric-value {
  font-size: 14px !important;
}
.legacy-finance-actions {
  gap: 5px !important;
  margin-bottom: 7px !important;
}
.legacy-finance-actions button {
  min-height: 37px !important;
  font-size: 10px !important;
}
.legacy-finance-row {
  min-height: 43px !important;
  padding: 6px 0 !important;
}

@media (max-width: 360px) {
  .order-editor-modal .legacy-payment-grid {
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
  }
}


/* 0.50.1 · Строки услуг в редакторе заявки
   Старый mobile-слой переносил название и цену на разные ряды. Сбрасываем
   эти координаты: чекбокс, название, количество, цена и удаление всегда
   остаются в одной компактной строке. */
@media (max-width: 520px) {
  .order-editor-modal .legacy-service-row {
    grid-template-columns: 18px minmax(0, 1fr) 42px 65px 32px;
    gap: 3px;
  }
  .order-editor-modal .legacy-service-row .service-check,
  .order-editor-modal .legacy-service-row .service-name-field,
  .order-editor-modal .legacy-service-row .service-qty-field,
  .order-editor-modal .legacy-service-row .service-price-field,
  .order-editor-modal .legacy-service-row .service-remove {
    grid-column: auto;
    grid-row: auto;
    margin-left: 0;
  }
}

@media (max-width: 380px) {
  .order-editor-modal .legacy-service-row {
    grid-template-columns: 18px minmax(0, 1fr) 40px 60px 30px;
  }
}

/* Карточка материала не должна наследовать сетку технического .line-item.
   Иначе заголовок и блок контролов делят одну строку и сжимают подписи. */
.order-editor-modal .legacy-material-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
}
.order-editor-modal .material-card-head {
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 8px;
}
.order-editor-modal .material-card-head small {
  margin: 2px 0 0;
  font-size: 9px;
  line-height: 1.25;
}
.order-editor-modal .material-card-controls {
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 0;
}
.order-editor-modal .material-card-controls label > span {
  overflow: hidden;
  font-size: 8px;
  line-height: 1.1;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.order-editor-modal .material-card-controls .field {
  min-height: 40px !important;
  padding: 0 5px;
  font-size: 11px;
}

/* 0.48.0 · Канонический A4 по эталонному акту — последний CSS-блок */
@media print {
  @page { size: A4 portrait; margin: 7mm 10mm; }

  html,
  body {
    width: 210mm !important;
    min-width: 210mm !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #fff !important;
  }

  body {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .topbar,
  .bottom-nav,
  .no-print,
  .toast,
  .modal-backdrop {
    display: none !important;
  }
.shell,
.content {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .act-sheet {
    box-sizing: border-box !important;
    width: 190mm !important;
    max-width: 190mm !important;
    min-width: 190mm !important;
    margin: 0 auto !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
    background: #fff !important;
    color: #000 !important;
    font-family: "Times New Roman", Times, serif !important;
    font-size: 10pt !important;
    line-height: 1.12 !important;
    zoom: var(--act-print-zoom, 1);
    height: 277mm !important;
    min-height: 277mm !important;
    display: flex !important;
    flex-direction: column !important;
    break-inside: avoid-page !important;
    page-break-inside: avoid !important;
  }

  .act-sheet h2 {
    margin: 0 0 2mm !important;
    text-align: center !important;
    font-size: 17pt !important;
    line-height: 1 !important;
  }

  .act-contract-line {
    margin: 0 0 4mm !important;
    text-align: right !important;
    font-size: 9pt !important;
  }

  .act-main-fields {
    display: grid !important;
    gap: 1mm !important;
    margin: 0 0 3mm !important;
  }

  .act-main-fields > div {
    display: grid !important;
    grid-template-columns: 43mm minmax(0,1fr) !important;
    gap: 2mm !important;
    align-items: end !important;
    padding: 0 !important;
    border: 0 !important;
  }

  .act-main-fields b { font-size: 9.2pt !important; }
  .act-main-fields span {
    min-height: 5mm !important;
    padding: 0 1mm .7mm !important;
    border-bottom: .25mm solid #000 !important;
    font-size: 9pt !important;
  }

  .act-work-table {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    border-collapse: collapse !important;
    table-layout: fixed !important;
    font-size: 8.8pt !important;
    line-height: 1.05 !important;
  }

  .act-work-table th,
  .act-work-table td {
    padding: 1.35mm 1mm !important;
    border: .25mm solid #000 !important;
    text-align: center !important;
    vertical-align: middle !important;
    overflow-wrap: break-word !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .act-work-table th:nth-child(1),
  .act-work-table td:nth-child(1) { width: 5% !important; }
  .act-work-table th:nth-child(2),
  .act-work-table td:nth-child(2) { width: 46% !important; }
  .act-work-table th:nth-child(3),
  .act-work-table td:nth-child(3) { width: 15% !important; }
  .act-work-table th:nth-child(4),
  .act-work-table td:nth-child(4) { width: 10% !important; }
  .act-work-table th:nth-child(5),
  .act-work-table td:nth-child(5) { width: 13% !important; }
  .act-work-table th:nth-child(6),
  .act-work-table td:nth-child(6) { width: 11% !important; }

  .act-totals {
    display: grid !important;
    gap: 1.2mm !important;
    margin: 3mm 0 0 !important;
  }

  .act-totals > div {
    display: grid !important;
    grid-template-columns: minmax(0,1fr) auto !important;
    gap: 4mm !important;
    align-items: baseline !important;
    font-size: 9.5pt !important;
  }

  .act-totals strong { font-size: 9.5pt !important; }
  .act-total-words {
    grid-template-columns: auto minmax(0,1fr) !important;
    justify-content: start !important;
  }

  .act-acceptance {
    margin: 8mm 0 0 !important;
    padding: 0 !important;
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    border: 0 !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .act-acceptance h3 {
    margin: 0 0 3mm !important;
    text-align: center !important;
    font-size: 12pt !important;
    line-height: 1 !important;
  }

  .act-acceptance-date {
    margin: 0 0 3mm !important;
    text-align: right !important;
    font-size: 8.7pt !important;
  }

  .act-acceptance p {
    margin: 0 !important;
    font-size: 8.7pt !important;
    line-height: 1.2 !important;
    text-align: justify !important;
  }

  .act-signatures {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 18mm !important;
    margin: auto 0 0 !important;
    font-size: 8.7pt !important;
    line-height: 1.45 !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
}



/* 0.53.0 · финальный приоритет: Visual_koncept / лист 01, главная заявок. */
@media screen and (max-width: 520px) {
  .orders-content { padding: 10px 10px 4px; }
  .orders-content h1 { font-size: 22px; line-height: 1.05; }
  .orders-content .lead { margin-top: 2px; font-size: 10px; }
  .orders-content .search-row { margin-bottom: 8px; }
  .orders-content .search-with-icon > .ui-icon { left: 13px; width: 17px; height: 17px; }
  .orders-content .search-with-icon .search { min-height: 40px; padding-left: 37px; border-radius: 12px; font-size: 11px; }
  .orders-content .order-card { margin-bottom: 8px; padding: 10px 11px 11px; border-radius: 14px; }
  .orders-content .order-card::before { width: 3px; }
  .orders-content .status { margin-top: 3px; padding: 3px 6px; border-radius: 7px; font-size: 8px; }
  .orders-content .appliance { padding: 7px 0; }
  .orders-content .order-money { gap: 5px; margin-bottom: 6px; }
  .orders-content .meta { gap: 4px; padding: 6px 0; font-size: 8px; }
  .orders-content .action { min-height: 40px; gap: 2px; padding: 3px 1px; border-radius: 8px; font-size: 7px; }
  .orders-content .action span .ui-icon { width: 15px; height: 15px; }
}


/* 0.54.0 · Лист 01: фактическая структура главной заявок. */
@media screen and (max-width: 520px) {
  .topbar { min-height: 66px; padding: 10px 13px; gap: 8px; }
  .topbar .logo { display: none; }
  .brand-title { font-size: 18px; }
  .brand-subtitle { margin-top: 2px; font-size: 7px; letter-spacing: .1em; }
  .orders-content { padding-top: 8px; }
  .orders-content .order-card { min-height: 93px; padding: 8px 10px; border-radius: 12px; cursor: pointer; }
}


/* 0.55.0 · Лист 01: просмотр заявки. */
@media screen and (max-width: 520px) {
  .order-detail-backdrop { z-index: 110; top: 0 !important; right: 0; bottom: 0 !important; left: 0; display: block; padding: 0; background: #070c10; }
  .order-detail-modal { width: 100%; max-width: none; min-height: 100%; margin: 0; padding: 0 0 calc(68px + env(safe-area-inset-bottom)); border: 0; border-radius: 0; background: linear-gradient(180deg, #090f16, #080d12); box-shadow: none; }
  .order-detail-back { font-size: 30px; font-weight: 300; line-height: 1; }
  .order-detail-content { padding: 11px 12px 0; }
  .detail-actions { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 5px; margin: 10px 0; }
  .detail-actions > * { display: grid; place-items: center; align-content: center; gap: 3px; min-height: 52px; padding: 4px 2px; border: 1px solid #283641; border-radius: 10px; background: #18232e; color: #d8e0e5; font-size: 8px; text-decoration: none; }
  .detail-actions button { font: inherit; }
  .detail-actions .ui-icon { width: 18px; height: 18px; color: var(--accent); }
  .detail-actions > :nth-child(2) .ui-icon { color: #52d487; }
  .detail-actions > :nth-child(3) .ui-icon { color: #59a8ff; }
  .detail-actions > :nth-child(4) .ui-icon { color: #5ad284; }
  .detail-total { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); padding: 9px 0; border: 1px solid #263440; border-radius: 11px; background: #131d27; }
  .detail-total > div { min-width: 0; padding: 0 8px; border-left: 1px solid #263440; }
  .detail-total > div:first-child { border-left: 0; }
  .detail-total span, .detail-total strong { display: block; }
  .detail-total span { color: #9ca6ae; font-size: 7px; line-height: 1.2; }
  .detail-total strong { margin-top: 4px; font-size: 12px; white-space: nowrap; }
  .detail-total > div:last-child strong { color: var(--accent); font-size: 15px; }
  .detail-lines { margin-top: 13px; }
  .detail-lines h3 { margin: 0 0 5px; color: var(--accent); font-size: 11px; }
  .detail-lines > div { display: grid; grid-template-columns: 29px minmax(0,1fr) auto; gap: 7px; align-items: center; min-height: 47px; border-top: 1px solid #22303a; }
  .detail-lines > div > span { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 7px; background: #1a2632; color: #d8e2ea; }
  .detail-lines .ui-icon { width: 14px; height: 14px; }
  .detail-lines p { min-width: 0; margin: 0; }
  .detail-lines p strong, .detail-lines p small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .detail-lines p strong { font-size: 10px; }
  .detail-lines p small { margin-top: 2px; color: #9aa5ae; font-size: 8px; }
  .detail-lines b { font-size: 10px; white-space: nowrap; }
  .detail-empty { margin: 0; padding: 12px 0; color: #8f9aa3; font-size: 10px; }
}


/* 0.56.0 · Лист 02: workflow заявки и каталог услуг. */
@media screen and (max-width: 520px) {
  .catalog-modal-backdrop {
    z-index: 120;
    top: 0 !important;
    right: 0;
    bottom: 0 !important;
    left: 0;
    display: block;
    padding: 0;
    background: #070c10;
  }
  .catalog-modal {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 0 0 env(safe-area-inset-bottom);
    border: 0;
    border-radius: 0;
    background: linear-gradient(180deg,#091018 0%,#080d12 100%);
    box-shadow: none;
  }
  .catalog-modal-head {
    min-height: 61px;
    margin: 0;
    padding: 9px 12px;
    border-bottom: 1px solid #1c2832;
    background: rgba(9,15,22,.97);
  }
  .catalog-modal-head h2 {
    margin: 1px 0 0;
    font-size: 17px;
    line-height: 1.1;
  }
  .catalog-modal-head .small {
    color: #97a3ad;
    font-size: 8px;
    letter-spacing: .02em;
  }
  .catalog-close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: #182331;
    font-size: 22px;
  }
  .catalog-search-row {
    margin: 0;
    padding: 9px 12px 7px;
    background: #091018;
  }
  .catalog-search-row .search {
    min-height: 39px;
    padding-left: 39px;
    border-color: #293744;
    border-radius: 11px;
    background: #111a23;
    font-size: 11px;
  }
  .catalog-search-row > .ui-icon {
    left: 25px;
    width: 16px;
    height: 16px;
  }
  .catalog-service-list {
    gap: 8px;
    padding: 2px 12px 10px;
    scrollbar-width: thin;
  }
  .catalog-service-group {
    overflow: hidden;
    border: 1px solid #23303b;
    border-radius: 12px;
    background: #101821;
  }
  .catalog-service-group h3 {
    margin: 0;
    padding: 8px 10px 6px;
    border-bottom: 1px solid #202c36;
    color: #b7c2cb;
    font-size: 9px;
    font-weight: 700;
  }
  .catalog-service-option {
    grid-template-columns: 26px minmax(0,1fr) auto;
    gap: 8px;
    min-height: 45px;
    padding: 6px 9px;
    border-top: 1px solid rgba(42,55,66,.7);
  }
  .catalog-service-option:first-of-type { border-top: 0; }
  .catalog-service-option.selected {
    background: linear-gradient(90deg,rgba(255,107,87,.11),rgba(255,107,87,.025));
  }
  .catalog-check {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    border-color: #43505c;
    background: #19232d;
    font-size: 14px;
  }
  .catalog-service-option.selected .catalog-check {
    border-color: var(--accent);
    background: var(--accent);
    color: #170806;
  }
  .catalog-service-copy strong { font-size: 11px; }
  .catalog-service-copy small {
    margin-top: 2px;
    color: #8f9aa4;
    font-size: 8px;
  }
  .catalog-service-price {
    padding-left: 7px;
    color: #eef2f5;
    font-size: 11px;
    font-weight: 750;
  }
  .catalog-fit-summary {
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 0;
    margin: 0 12px;
    padding: 8px 0;
    border: 1px solid #263440;
    border-radius: 11px;
    background: #111a23;
  }
  .catalog-fit-summary > div {
    padding: 0 8px;
    border-left: 1px solid #263440;
  }
  .catalog-fit-summary > div:first-child { border-left: 0; }
  .catalog-fit-summary span {
    display: block;
    color: #8f9aa4;
    font-size: 7px;
  }
  .catalog-fit-summary strong {
    display: block;
    margin-top: 3px;
    font-size: 10px;
    white-space: nowrap;
  }
  .catalog-modal-actions {
    margin: 7px 12px 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }
  .catalog-modal-actions .primary-button {
    min-height: 43px;
    border-radius: 11px;
    font-size: 11px;
  }

  .order-actions-backdrop { z-index: 125; }
  .order-actions-sheet {
    padding: 12px;
    border-radius: 16px;
  }
  .order-actions-grid { gap: 6px; }
  .order-actions-grid button,
  .order-actions-grid a {
    min-height: 45px;
    padding: 8px 10px;
    border-radius: 10px;
  }
  .order-actions-grid b { font-size: 10px; }
  .order-actions-grid .ui-icon { width: 17px; height: 17px; }
}


/* 0.57.0 · Лист 02: ближайшие выезды, состояния списка и меню действий. */
@media screen and (max-width: 520px) {

  .order-actions-sheet {
    padding: 12px;
    border-radius: 17px;
    background: linear-gradient(180deg,#151e27,#0f171e);
  }
  .order-actions-head { margin-bottom: 9px; }
  .order-actions-head strong { font-size: 13px; }
  .order-actions-head small { font-size: 9px; }
  .order-actions-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 6px;
  }
  .order-actions-grid button,
  .order-actions-grid a {
    min-height: 48px;
    padding: 8px 9px;
    border-radius: 11px;
    background: #18232d;
  }
  .order-actions-grid b { font-size: 10px; }
  .order-actions-grid .order-actions-delete {
    grid-column: 1 / -1;
    justify-content: center;
    background: rgba(255,83,83,.08);
    border-color: rgba(255,83,83,.24);
  }
}


/* 0.58.0 · Лист 03: склад, деталь позиции и редактор. */
@media screen and (max-width: 520px) {
  .warehouse-search { margin-bottom: 7px; }
  .warehouse-search .search {
    min-height: 39px;
    border-radius: 11px;
    font-size: 11px;
  }
  .warehouse-filter .field {
    min-height: 39px;
    border-radius: 11px;
    font-size: 10px;
  }
  .warehouse-shortcuts {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 6px;
    margin: 7px 0;
  }
  .warehouse-shortcut {
    min-height: 42px;
    gap: 6px;
    padding: 7px 8px;
    border-radius: 11px;
    font-size: 9px;
  }
  .warehouse-shortcut .ui-icon { width: 16px; height: 16px; }
  .warehouse-group {
    padding: 8px;
    border-radius: 13px;
  }

  .legacy-stock-card {
    padding: 0;
    overflow: hidden;
    border-radius: 11px;
    background: #111a22;
  }
  .stock-copy { min-width: 0; }
  .stock-copy > * {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .stock-name { font-size: 10px; }

  .stock-detail-backdrop {
    z-index: 120;
    top: 0 !important;
    bottom: 0 !important;
    display: block;
    padding: 0;
    background: #070c10;
  }
  .stock-detail-modal {
    width: 100%;
    max-width: none;
    min-height: 100%;
    margin: 0;
    padding: 0 0 calc(68px + env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
    background: linear-gradient(180deg,#091018,#080d12);
    box-shadow: none;
  }
  .stock-detail-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: 34px minmax(0,1fr) 34px;
    gap: 8px;
    align-items: center;
    min-height: 61px;
    padding: 9px 12px;
    border-bottom: 1px solid #1c2832;
    background: rgba(9,15,22,.97);
  }
  .stock-detail-head button {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: #182331;
    color: #dce4ea;
  }
  .stock-detail-back { font-size: 30px; line-height: 1; }
  .stock-detail-edit .ui-icon { width: 17px; height: 17px; }
  .stock-detail-head strong { display: block; font-size: 13px; }
  .stock-detail-head small { display: block; margin-top: 2px; color: #8e99a3; font-size: 7px; }
  .stock-detail-content { padding: 11px 12px 0; }
  .stock-detail-hero {
    display: grid;
    grid-template-columns: 48px minmax(0,1fr) auto;
    gap: 9px;
    align-items: center;
    padding: 10px;
    border: 1px solid #283641;
    border-radius: 12px;
    background: #121c25;
  }
  .stock-detail-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 11px;
    background: #23313e;
  }
  .stock-detail-icon .ui-icon { width: 25px; height: 25px; }
  .stock-detail-hero h2 { margin: 0; font-size: 13px; }
  .stock-detail-hero p {
    overflow: hidden;
    margin: 3px 0 0;
    color: #929da6;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .stock-detail-status {
    padding: 5px 7px;
    border-radius: 8px;
    background: rgba(82,212,135,.1);
    color: #52d487;
    font-size: 7px;
    font-weight: 800;
  }
  .stock-detail-status.low { background: rgba(255,196,92,.1); color: #ffc45c; }
  .stock-detail-kpis {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 6px;
    margin-top: 8px;
  }
  .stock-detail-kpis > div {
    padding: 9px;
    border: 1px solid #26333e;
    border-radius: 10px;
    background: #101820;
  }
  .stock-detail-kpis span { display: block; color: #8f9aa4; font-size: 7px; }
  .stock-detail-kpis strong { display: block; margin-top: 3px; font-size: 12px; }
  .stock-detail-actions {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 6px;
    margin-top: 8px;
  }
  .stock-detail-actions button {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    min-height: 52px;
    padding: 5px 2px;
    border: 1px solid #2b3945;
    border-radius: 10px;
    background: #18232d;
    color: #e4e9ed;
  }
  .stock-detail-actions button > span { color: #52d487; font-size: 20px; line-height: 1; }
  .stock-detail-actions button:nth-child(2) > span { color: #ffbf55; }
  .stock-detail-actions .ui-icon { width: 17px; height: 17px; color: #8ca5bb; }
  .stock-detail-actions b { font-size: 8px; }
  .stock-detail-history { margin-top: 13px; }
  .stock-detail-history h3 { margin: 0 0 6px; font-size: 10px; }
  .stock-detail-movement {
    display: grid;
    grid-template-columns: 58px minmax(0,1fr);
    gap: 8px;
    align-items: center;
    min-height: 42px;
    border-top: 1px solid #202c35;
  }
  .stock-detail-movement > span { font-size: 10px; font-weight: 800; }
  .stock-detail-movement p { margin: 0; }
  .stock-detail-movement strong { display: block; font-size: 9px; }
  .stock-detail-movement small { display: block; margin-top: 2px; color: #89949d; font-size: 7px; }

  .stock-editor-backdrop {
    z-index: 125;
    top: 0 !important;
    bottom: 0 !important;
    align-items: stretch;
    padding: 0;
    background: #070c10;
  }
  .stock-editor-modal {
    width: 100%;
    max-width: none;
    min-height: 100%;
    margin: 0;
    padding: 0 12px calc(18px + env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
    background: linear-gradient(180deg,#091018,#080d12);
  }
  .stock-editor-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 61px;
    margin: 0 -12px 10px;
    padding: 9px 12px;
    border-bottom: 1px solid #1c2832;
    background: rgba(9,15,22,.97);
  }
  .stock-editor-head small { display: block; color: #8d98a1; font-size: 7px; }
  .stock-editor-head h2 { margin: 2px 0 0; font-size: 15px; }
  .stock-editor-close {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: #182331;
    color: #dbe3e9;
    font-size: 22px;
  }
  .stock-editor-modal .form-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 7px;
  }
  .stock-editor-modal .form-group.full { grid-column: 1 / -1; }
  .stock-editor-modal .form-group label { font-size: 8px; }
  .stock-editor-modal .field {
    min-height: 41px;
    border-radius: 10px;
    font-size: 10px;
  }
  .stock-editor-modal .modal-actions {
    position: sticky;
    bottom: 0;
    margin: 12px -12px -18px;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid #1f2b34;
    background: rgba(8,13,18,.96);
  }
  .stock-editor-modal .modal-actions button {
    min-height: 42px;
    border-radius: 10px;
    font-size: 10px;
  }
}


/* 0.59.0 · Лист 03: финальная плотность, фильтры и редактор склада. */
@media screen and (max-width: 520px) {

  .stock-editor-section-title {
    margin: 10px 0 6px;
    color: #8d99a3;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
  .stock-editor-compat {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 5px;
  }
  .stock-editor-compat label,
  .stock-editor-toggle {
    display: grid;
    grid-template-columns: 22px minmax(0,1fr);
    gap: 7px;
    align-items: center;
    min-height: 39px;
    padding: 6px 8px;
    border: 1px solid #26333e;
    border-radius: 10px;
    background: #101820;
  }
  .stock-editor-compat input,
  .stock-editor-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }
  .stock-editor-compat b,
  .stock-editor-toggle b {
    font-size: 8px;
    font-weight: 650;
  }
  .stock-editor-compat input:checked + .warehouse-check,
  .stock-editor-toggle input:checked + .warehouse-check {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: inset 0 0 0 4px #101820;
  }
  .stock-editor-custom-compat { margin-top: 7px; }
  .stock-editor-toggle {
    margin-top: 7px;
    grid-template-columns: 22px minmax(0,1fr);
  }
  .stock-editor-toggle span:last-child { min-width: 0; }
  .stock-editor-toggle small {
    display: block;
    margin-top: 2px;
    color: #7f8a93;
    font-size: 7px;
    line-height: 1.25;
  }
  .stock-editor-modal input[readonly] {
    color: #8f9aa3;
    background: #0d141a;
  }
}


/* 0.60.0 · Лист 04: история движения и список покупок. */
@media screen and (max-width: 520px) {
  .warehouse-support-content,
  .shopping-content {
    padding-top: 0;
  }
  .support-page-head {
    display: grid;
    grid-template-columns: 34px minmax(0,1fr);
    gap: 9px;
    align-items: center;
    min-height: 58px;
    margin: 0 -10px 9px;
    padding: 7px 12px;
    border-bottom: 1px solid #1c2832;
    background: #091018;
  }
  .support-page-head h1 {
    margin: 0;
    font-size: 15px;
    line-height: 1.1;
  }
  .support-page-head p {
    margin: 2px 0 0;
    color: #8f9ba4;
    font-size: 7px;
  }
  .support-back {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: #182331;
    color: #dce4ea;
    font-size: 30px;
    line-height: 1;
  }

  .movement-filter-chips {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 5px;
    margin-bottom: 8px;
  }
  .movement-filter-chips button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 34px;
    padding: 5px;
    border: 1px solid #293641;
    border-radius: 10px;
    background: #111a22;
    color: #9da8b0;
    font-size: 9px;
    font-weight: 700;
  }
  .movement-filter-chips span {
    display: grid;
    place-items: center;
    min-width: 17px;
    height: 17px;
    border-radius: 6px;
    background: #1d2832;
    font-size: 7px;
  }
  .movement-filter-chips button.active {
    border-color: rgba(82,166,255,.45);
    background: rgba(82,166,255,.09);
    color: #63adff;
  }

  .movement-list { display: grid; gap: 5px; }
  .movement-card {
    display: grid;
    grid-template-columns: 34px minmax(0,1fr) auto;
    gap: 8px;
    align-items: center;
    min-height: 58px;
    padding: 8px 9px;
    border: 1px solid #26333e;
    border-radius: 11px;
    background: #111a22;
  }
  .movement-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    font-size: 19px;
    font-weight: 500;
  }
  .movement-icon.incoming { background: rgba(82,212,135,.11); color: #52d487; }
  .movement-icon.outgoing { background: rgba(255,105,92,.1); color: #ff6b5b; }
  .movement-copy { min-width: 0; }
  .movement-copy strong,
  .movement-copy small,
  .movement-copy time {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .movement-copy strong { font-size: 10px; }
  .movement-copy small { margin-top: 2px; color: #98a3ac; font-size: 7px; }
  .movement-copy time { margin-top: 2px; color: #6f7c86; font-size: 7px; }
  .movement-card > b { font-size: 10px; white-space: nowrap; }
  .warehouse-support-empty { margin-top: 8px; }

  .shopping-page-actions {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 6px;
    margin-bottom: 8px;
  }
  .shopping-page-actions button {
    min-height: 40px;
    gap: 6px;
    border-radius: 10px;
    font-size: 9px;
  }
  .shopping-page-actions .ui-icon { width: 15px; height: 15px; }
  .shopping-content .client-list {
    display: grid;
    gap: 5px;
  }
  .shopping-content .legacy-shopping-card {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    gap: 8px;
    align-items: center;
    min-height: 58px;
    padding: 8px 10px;
    border-radius: 11px;
  }
  .shopping-content .stock-name { font-size: 10px; }
  .shopping-content .legacy-shopping-card .small {
    margin-top: 2px;
    font-size: 7px;
  }
  .shopping-need { text-align: right; }
  .shopping-need span { display: block; color: #87939c; font-size: 7px; }
  .shopping-need strong { display: block; margin-top: 3px; color: #ffc45c; font-size: 10px; white-space: nowrap; }
}


/* 0.61.0 · Лист 05: аналитический центр. */
@media screen and (max-width: 520px) {
  .analytics-content {
    padding-top: 9px;
  }
  .analytics-content .page-head {
    margin-bottom: 7px;
  }
  .analytics-content .page-head h1 {
    font-size: 17px;
    line-height: 1.08;
  }
  .analytics-content .lead {
    margin-top: 2px;
    font-size: 8px;
  }

  .analytics-period-grid {
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 5px;
    margin-bottom: 7px;
  }
  .analytics-period-grid .chip {
    min-height: 32px;
    padding: 4px 3px;
    border-radius: 9px;
    font-size: 9px;
  }
  .analytics-range-nav {
    min-height: 44px;
    margin-bottom: 7px;
    padding: 5px 7px;
    border-radius: 11px;
  }
  .analytics-range-nav > div strong {
    font-size: 10px;
  }
  .analytics-range-nav > div small {
    margin-top: 2px;
    font-size: 7px;
  }
  .analytics-arrow {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    font-size: 21px;
  }

  .analytics-content .panel {
    padding: 9px !important;
    margin-bottom: 6px !important;
    border-radius: 12px;
  }
  .analytics-content .panel-title {
    min-height: 25px;
    margin-bottom: 6px;
    font-size: 10px;
  }
  .analytics-content .panel-title small {
    margin-left: 4px;
    color: #7d8992;
    font-size: 6px;
  }
  .analytics-content .badge-icon {
    width: 25px;
    height: 25px;
    border-radius: 8px;
  }
  .analytics-content .badge-icon .ui-icon {
    width: 14px;
    height: 14px;
  }

  .analytics-kpis {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 5px !important;
  }
  .analytics-kpi {
    min-height: 62px !important;
    padding: 7px 8px !important;
    border-radius: 10px;
  }
  .analytics-kpi > span {
    font-size: 6.8px !important;
    line-height: 1.15;
  }
  .analytics-kpi > strong {
    margin-top: 4px !important;
    font-size: 15px !important;
    line-height: 1;
  }
  .analytics-kpi > small {
    margin-top: 4px !important;
    color: #7f8b94;
    font-size: 6.5px !important;
    line-height: 1.15;
  }


  .analytics-work-grid {
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 5px;
  }
  .analytics-work-grid .metric {
    min-height: 47px;
    padding: 6px 5px !important;
    border-radius: 9px;
  }
  .analytics-work-grid .metric-label {
    font-size: 6.5px;
    line-height: 1.15;
  }
  .analytics-work-grid .metric-value {
    margin-top: 4px;
    font-size: 13px !important;
    line-height: 1;
  }

  .analytics-ranking-list {
    display: grid;
    gap: 0;
  }
  .analytics-ranking-row {
    grid-template-columns: 24px minmax(0,1fr) auto;
    gap: 7px;
    min-height: 42px;
    padding: 6px 0;
  }
  .ranking-place {
    width: 23px;
    height: 23px;
    border-radius: 7px;
    font-size: 8px;
  }
  .analytics-ranking-row strong {
    font-size: 9px;
  }
  .analytics-ranking-row small {
    margin-top: 2px;
    font-size: 6.5px;
  }
  .analytics-ranking-row > b {
    font-size: 9px;
  }

  .analytics-content .bars {
    height: 116px;
    gap: 4px;
    padding: 6px 2px 0;
  }
  .analytics-content .bar-wrap {
    min-width: 0;
    gap: 3px;
  }
  .analytics-content .bar-wrap > span {
    overflow: hidden;
    max-width: 100%;
    font-size: 6px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .analytics-content .bar {
    max-height: 82px;
    border-radius: 5px 5px 2px 2px;
  }

  .analytics-content .goods-list {
    display: grid;
    gap: 0;
  }
  .analytics-content .goods-sheet {
    min-height: 42px;
    padding: 6px 0;
    border-radius: 0;
    border-width: 1px 0 0;
    background: transparent;
  }
  .analytics-content .goods-sheet:first-child {
    border-top: 0;
  }
  .analytics-content .goods-sheet strong {
    font-size: 9px;
  }
  .analytics-content .goods-sheet small {
    margin-top: 2px;
    font-size: 6.5px;
  }
  .analytics-content .goods-sheet > b {
    font-size: 9px;
  }
}


/* 0.62.0 · Лист 06: финансы и клиенты. */
@media screen and (max-width: 520px) {
  .legacy-finance-actions {
    gap: 5px !important;
    margin-bottom: 7px !important;
  }
  .legacy-finance-actions button {
    min-height: 38px !important;
    border-radius: 10px;
    font-size: 9px !important;
  }
  .legacy-finance-row {
    grid-template-columns: 28px minmax(0,1fr) auto 26px;
    gap: 6px;
    min-height: 44px !important;
    padding: 6px 0 !important;
  }
  .legacy-finance-row > div:nth-child(2) strong { font-size: 9px; }
  .legacy-finance-row .small { font-size: 7px; }
  .legacy-finance-row .remove-line {
    width: 25px;
    height: 25px;
  }

  .finance-entry-backdrop {
    z-index: 125;
    top: 0 !important;
    bottom: 0 !important;
    align-items: stretch;
    padding: 0;
    background: #070c10;
  }
  .finance-entry-modal {
    width: 100%;
    max-width: none;
    min-height: 100%;
    margin: 0;
    padding: 0 12px calc(18px + env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
    background: linear-gradient(180deg,#091018,#080d12);
  }
  .finance-entry-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 61px;
    margin: 0 -12px 10px;
    padding: 9px 12px;
    border-bottom: 1px solid #1c2832;
  }
  .finance-entry-head small { color: #8d99a2; font-size: 7px; }
  .finance-entry-head h2 { margin: 2px 0 0; font-size: 15px; }
  .finance-entry-close {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: #182331;
    color: #dce4ea;
    font-size: 22px;
  }
  .finance-entry-type {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 43px;
    margin-bottom: 9px;
    padding: 8px 10px;
    border: 1px solid #293641;
    border-radius: 10px;
    background: #111a22;
    color: #a6b0b8;
    font-size: 8px;
  }
  .finance-entry-type .ui-icon { width: 18px; height: 18px; }
  .finance-entry-type.income .ui-icon { color: #52d487; }
  .finance-entry-type.expense .ui-icon { color: #ff6b5b; }
  .finance-entry-modal .form-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 7px;
  }
  .finance-entry-modal .form-group.full { grid-column: 1 / -1; }
  .finance-entry-modal .form-group label { font-size: 8px; }
  .finance-entry-modal .field {
    min-height: 42px;
    border-radius: 10px;
    font-size: 10px;
  }
  .finance-entry-modal .modal-actions {
    position: sticky;
    bottom: 0;
    margin: 12px -12px -18px;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid #1f2b34;
    background: rgba(8,13,18,.96);
  }
  .finance-entry-modal .modal-actions button {
    min-height: 42px;
    border-radius: 10px;
    font-size: 10px;
  }
  .client-list { gap: 5px; }
  .legacy-client-card {
    padding: 8px 9px;
    border-radius: 11px;
  }
  .client-avatar {
    width: 31px;
    height: 31px;
    border-radius: 9px;
  }
  .client-avatar .ui-icon { width: 16px; height: 16px; }
  .client-meta {
    gap: 6px;
    margin-top: 6px;
    padding-top: 5px;
    font-size: 7px;
  }
  .client-actions {
    gap: 5px;
    margin-top: 6px;
  }
  .client-actions .primary-button,
  .client-actions .secondary-button {
    min-height: 32px;
    padding: 5px 7px;
    border-radius: 9px;
    font-size: 8px;
  }

  .client-profile-backdrop {
    z-index: 125;
    top: 0 !important;
    bottom: 0 !important;
    display: block;
    padding: 0;
    background: #070c10;
  }
  .client-profile-modal {
    width: 100%;
    max-width: none;
    min-height: 100%;
    margin: 0;
    padding: 0 0 calc(68px + env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
    background: linear-gradient(180deg,#091018,#080d12);
    box-shadow: none;
  }
  .client-profile-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: 34px minmax(0,1fr) 34px;
    gap: 8px;
    align-items: center;
    min-height: 61px;
    padding: 9px 12px;
    border-bottom: 1px solid #1c2832;
    background: rgba(9,15,22,.97);
  }
  .client-profile-head > button,
  .client-profile-head > a {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: #182331;
    color: #dce4ea;
    text-decoration: none;
  }
  .client-profile-back { font-size: 30px; line-height: 1; }
  .client-profile-head > a .ui-icon { width: 16px; height: 16px; color: #52d487; }
  .client-profile-head strong { display: block; font-size: 13px; }
  .client-profile-head small { display: block; margin-top: 2px; color: #8d99a2; font-size: 7px; }
  .client-profile-content { padding: 11px 12px 0; }
  .client-profile-hero {
    display: grid;
    grid-template-columns: 46px minmax(0,1fr);
    gap: 9px;
    align-items: center;
  }
  .client-profile-avatar {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #1d2a35;
    color: #cdd7df;
  }
  .client-profile-avatar .ui-icon { width: 23px; height: 23px; }
  .client-profile-hero h2 { margin: 0; font-size: 15px; }
  .client-profile-hero p { margin: 3px 0 0; color: #95a0a9; font-size: 9px; }
  .client-profile-address {
    display: grid;
    grid-template-columns: 28px minmax(0,1fr);
    gap: 7px;
    align-items: center;
    min-height: 43px;
    margin-top: 8px;
    padding: 7px 9px;
    border: 1px solid #26333e;
    border-radius: 10px;
    background: #101820;
  }
  .client-profile-address > .ui-icon { width: 17px; height: 17px; }
  .client-profile-address small,
  .client-profile-address strong { display: block; }
  .client-profile-address small { color: #85919a; font-size: 7px; }
  .client-profile-address strong {
    overflow: hidden;
    margin-top: 2px;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .client-profile-kpis {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 5px;
    margin-top: 8px;
  }
  .client-profile-kpis > div {
    min-width: 0;
    min-height: 48px;
    padding: 7px 4px;
    border: 1px solid #26333e;
    border-radius: 9px;
    background: #101820;
  }
  .client-profile-kpis span { display: block; color: #87939c; font-size: 6px; }
  .client-profile-kpis strong {
    display: block;
    overflow: hidden;
    margin-top: 4px;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .client-profile-history { margin-top: 13px; }
  .client-profile-history h3 { margin: 0 0 5px; font-size: 10px; }
  .client-profile-orders { display: grid; gap: 5px; }
  .client-profile-orders > button {
    display: grid;
    grid-template-columns: 34px minmax(0,1fr) auto;
    gap: 8px;
    align-items: center;
    width: 100%;
    min-height: 56px;
    padding: 7px 8px;
    border: 1px solid #26333e;
    border-radius: 10px;
    background: #111a22;
    color: #edf1f4;
    text-align: left;
  }
  .client-order-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: #1d2a35;
  }
  .client-order-icon .ui-icon { width: 18px; height: 18px; }
  .client-order-copy { min-width: 0; }
  .client-order-copy strong,
  .client-order-copy small,
  .client-order-copy em {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .client-order-copy strong { font-size: 9px; }
  .client-order-copy small { margin-top: 2px; color: #929da6; font-size: 7px; }
  .client-order-copy em { margin-top: 2px; color: #707d86; font-size: 6.5px; font-style: normal; }
  .client-order-side {
    display: grid;
    justify-items: end;
    gap: 3px;
  }
  .client-order-side b { font-size: 9px; white-space: nowrap; }
  .client-order-side i { font-size: 6.5px; font-style: normal; white-space: nowrap; }
}


/* 0.63.0 · Лист 07: прайс, свои услуги и товарник. */
@media screen and (max-width: 520px) {
.goods-content { padding-top: 9px; }

  .price-head {
    margin-bottom: 7px;
  }
  .price-head h1 { font-size: 17px; }
  .price-head .lead { font-size: 8px; }
  .price-tech-filter { margin-bottom: 8px; }
  .price-tech-filter .field {
    min-height: 37px;
    border-radius: 10px;
    font-size: 9px;
  }

  .price-editor-backdrop {
    z-index: 125;
    top: 0 !important;
    bottom: 0 !important;
    align-items: stretch;
    padding: 0;
    background: #070c10;
  }

  .goods-content .page-head { margin-bottom: 7px; }
  .goods-content .page-head h1 { font-size: 17px; }
  .goods-content .lead { font-size: 8px; }

  .goods-editor-backdrop {
    z-index: 130;
    top: 0 !important;
    bottom: 0 !important;
    align-items: stretch;
    padding: 0;
    background: #070c10;
  }
  .goods-editor-modal {
    width: 100%;
    max-width: none;
    min-height: 100%;
    margin: 0;
    padding: 0 12px calc(18px + env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
    background: linear-gradient(180deg,#091018,#080d12);
  }
  .goods-editor-modal > .form-group label { font-size: 8px; }
  .goods-editor-modal > .form-group .field {
    min-height: 41px;
    border-radius: 10px;
    font-size: 10px;
  }
  .goods-editor-list {
    display: grid;
    gap: 6px;
    margin-top: 7px;
  }
  .goods-editor-modal .modal-actions {
    position: sticky;
    bottom: 0;
    margin: 12px -12px -18px;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid #1f2b34;
    background: rgba(8,13,18,.96);
  }
  .goods-editor-modal .modal-actions button {
    min-height: 42px;
    border-radius: 10px;
    font-size: 9px;
  }
}

@media screen and (max-width: 370px) {
}


/* 0.64.0 · Лист 08: документы, акт и квитанции. */
@media screen and (max-width: 520px) {
  .act-control-actions {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 5px;
    margin-top: 7px;
  }
  .act-control-actions button {
    min-height: 39px;
    gap: 6px;
    border-radius: 10px;
    font-size: 8px;
  }
  .act-control-actions .ui-icon {
    width: 15px;
    height: 15px;
  }

  .receipt-editor-backdrop {
    z-index: 130;
    top: 0 !important;
    bottom: 0 !important;
    align-items: stretch;
    padding: 0;
    background: #070c10;
  }
  .receipt-editor-modal {
    width: 100%;
    max-width: none;
    min-height: 100%;
    margin: 0;
    padding: 0 12px calc(18px + env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
    background: linear-gradient(180deg,#091018,#080d12);
  }
  .receipt-editor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 61px;
    margin: 0 -12px 10px;
    padding: 9px 12px;
    border-bottom: 1px solid #1c2832;
  }
  .receipt-editor-head small { color: #8c98a1; font-size: 7px; }
  .receipt-editor-head h2 { margin: 2px 0 0; font-size: 15px; }
  .receipt-editor-close {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: #182331;
    color: #dce4ea;
    font-size: 22px;
  }
  .receipt-editor-type {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    margin-bottom: 9px;
    padding: 7px 9px;
    border: 1px solid #27343f;
    border-radius: 10px;
    background: #101820;
    color: #929da6;
    font-size: 8px;
  }
  .receipt-editor-type .ui-icon {
    width: 18px;
    height: 18px;
    color: #63adff;
  }
  .receipt-editor-modal .form-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 7px;
  }
  .receipt-editor-modal .form-group.full { grid-column: 1 / -1; }
  .receipt-editor-modal .form-group label { font-size: 8px; }
  .receipt-editor-modal .field {
    min-height: 41px;
    border-radius: 10px;
    font-size: 10px;
  }
  .receipt-editor-modal .textarea {
    min-height: 72px;
    padding-top: 9px;
  }
  .receipt-editor-amount {
    font-size: 13px !important;
    font-weight: 800;
  }
  .receipt-editor-modal .modal-actions {
    position: sticky;
    bottom: 0;
    margin: 12px -12px -18px;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid #1f2b34;
    background: rgba(8,13,18,.96);
  }
  .receipt-editor-modal .modal-actions button {
    min-height: 42px;
    border-radius: 10px;
    font-size: 9px;
  }
}


/* 0.65.0 · Лист 09: Ещё и рабочие инструменты. */
@media screen and (max-width: 520px) {
  .more-content {
    padding-top: 9px;
  }
  .more-content .page-head {
    margin-bottom: 7px;
  }
  .more-content .page-head h1 { font-size: 17px; }
  .more-content .lead { font-size: 8px; }
  .legacy-more-list {
    gap: 4px;
  }
  .legacy-more-list .menu-item {
    min-height: 50px;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 11px;
  }
  .legacy-more-list .menu-icon {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    border-radius: 10px;
  }
  .legacy-more-list .menu-icon .ui-icon {
    width: 18px;
    height: 18px;
  }
  .legacy-more-list .menu-name {
    font-size: 10px;
  }
  .legacy-more-list .menu-description {
    margin-top: 2px;
    font-size: 7px;
  }
  .legacy-more-list .chevron .ui-icon {
    width: 13px;
    height: 13px;
  }

  .tool-editor-backdrop {
    z-index: 130;
    top: 0 !important;
    bottom: 0 !important;
    align-items: stretch;
    padding: 0;
    background: #070c10;
  }
  .tool-editor-modal {
    width: 100%;
    max-width: none;
    min-height: 100%;
    margin: 0;
    padding: 0 12px calc(18px + env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
    background: linear-gradient(180deg,#091018,#080d12);
  }
  .tool-editor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 61px;
    margin: 0 -12px 10px;
    padding: 9px 12px;
    border-bottom: 1px solid #1c2832;
  }
  .tool-editor-head small { color: #8c98a1; font-size: 7px; }
  .tool-editor-head h2 { margin: 2px 0 0; font-size: 15px; }
  .tool-editor-close {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: #182331;
    color: #dce4ea;
    font-size: 22px;
  }
  .tool-editor-hero {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 50px;
    margin-bottom: 9px;
    padding: 8px 9px;
    border: 1px solid #27343f;
    border-radius: 10px;
    background: #101820;
  }
  .tool-editor-hero > .ui-icon {
    width: 22px;
    height: 22px;
    color: #63adff;
  }
  .tool-editor-hero strong,
  .tool-editor-hero small {
    display: block;
  }
  .tool-editor-hero strong { font-size: 9px; }
  .tool-editor-hero small {
    margin-top: 2px;
    color: #828e97;
    font-size: 7px;
  }
  .tool-editor-modal .form-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 7px;
  }
  .tool-editor-modal .form-group.full { grid-column: 1 / -1; }
  .tool-editor-modal .form-group label { font-size: 8px; }
  .tool-editor-modal .field {
    min-height: 41px;
    border-radius: 10px;
    font-size: 10px;
  }
  .tool-editor-modal .textarea {
    min-height: 72px;
    padding-top: 9px;
  }
  .tool-editor-price {
    font-size: 13px !important;
    font-weight: 800;
  }
  .tool-editor-modal .modal-actions {
    position: sticky;
    bottom: 0;
    margin: 12px -12px -18px;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid #1f2b34;
    background: rgba(8,13,18,.96);
  }
  .tool-editor-modal .modal-actions button {
    min-height: 42px;
    border-radius: 10px;
    font-size: 9px;
  }
}


/* 0.66.0 · Лист 10: настройки и бэкапы. */
@media screen and (max-width: 520px) {
  .settings-checkbox {
    width: 17px;
    height: 17px;
  }
  .settings-save {
    min-height: 38px;
    margin-top: 7px;
    border-radius: 10px;
    font-size: 9px;
  }
  .settings-link-icon {
    width: 29px !important;
    height: 29px !important;
    border-radius: 8px !important;
  }
  .settings-link-icon .ui-icon {
    width: 15px !important;
    height: 15px !important;
  }
  .backup-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 5px;
  }
  .backup-grid button {
    min-height: 34px;
    padding: 5px;
    border-radius: 9px;
    font-size: 7px;
  }
}


/* 0.69.0 · Полная пересборка мобильной главной по архивным скриншотам. */
@media screen and (max-width: 520px) {
  :root {
    --legacy-bg: #080d11;
    --legacy-orange: #ff7255;
    --legacy-muted: #8c9298;
  }
  
  
  

  .legacy-mobile-header {
    position: relative;
    top: auto;
    min-height: 96px;
    gap: 10px;
    padding: 18px 13px 15px;
    border-bottom: 1px solid #171d22;
    background: #080d11;
    backdrop-filter: none;
  }
  .legacy-mobile-header .logo {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 13px;
    border-color: rgba(255,114,85,.35);
    box-shadow: 0 0 18px rgba(255,114,85,.06);
  }
  
  
  .legacy-mobile-header .brand-title span { color: var(--legacy-orange); }
  

  .legacy-orders-page {
    padding: 11px 9px 18px;
  }
  .legacy-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 1px 12px;
  }
  
  
  .legacy-page-add {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: var(--legacy-orange);
    color: white;
    box-shadow: 0 7px 20px rgba(255,92,63,.24);
    font-size: 31px;
    font-weight: 300;
    line-height: 1;
  }

  .legacy-nearest-visit {
    display: block;
    width: 100%;
    margin: 0 0 9px;
    padding: 11px 12px;
    border: 1px solid #265184;
    border-radius: 12px;
    background: #0c1721;
    color: #edf3f8;
    text-align: left;
  }
  .legacy-nearest-title {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #5ca9ff;
    font-size: 11px;
  }
  .legacy-nearest-title .ui-icon { width: 18px; height: 18px; }
  
  .legacy-nearest-line > strong { font-size: 9px; white-space: nowrap; }
  .legacy-nearest-line > span {
    overflow: hidden;
    color: #c5ccd2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .legacy-nearest-line > em {
    color: #7e8993;
    font-size: 8px;
    font-style: normal;
  }

  .legacy-order-search {
    margin: 0 0 9px;
  }
  .legacy-order-search .search {
    min-height: 47px;
    padding: 0 12px 0 45px;
    border: 1px solid #2b343c;
    border-radius: 13px;
    background: #171e25;
    color: #e7ebee;
    font-size: 12px;
  }
  .legacy-order-search > .ui-icon {
    left: 16px;
    width: 21px;
    height: 21px;
    color: #9aa3ab;
  }
  .legacy-order-search .search::placeholder { color: #596169; }

  
  .legacy-order-filters button {
    min-width: 0;
    min-height: 34px;
    padding: 5px 15px;
    border: 1px solid #2b343c;
    border-radius: 18px;
    background: #11171d;
    color: #91989e;
    font-size: 10px;
  }
  .legacy-order-filters button.active {
    border-color: var(--legacy-orange);
    background: rgba(255,114,85,.13);
    color: #f0ecea;
  }

  .legacy-visit-filter {
    position: relative;
    margin-bottom: 10px;
  }
  .legacy-visit-filter .field {
    width: 100%;
    min-height: 45px;
    padding: 0 38px 0 13px;
    appearance: none;
    border: 1px solid #2d363e;
    border-radius: 11px;
    background: #171e25;
    color: #e8ebee;
    font-size: 11px;
  }
  .legacy-visit-filter > span {
    position: absolute;
    top: 50%;
    right: 12px;
    display: grid;
    transform: translateY(-50%);
    color: #a7afb6;
    pointer-events: none;
  }
  .legacy-visit-filter .ui-icon { width: 13px; height: 13px; }

  .legacy-orders-list { display: grid; gap: 10px; }
  .legacy-order-card {
    position: relative;
    overflow: hidden;
    padding: 14px 13px 12px;
    border: 1px solid #2a333b;
    border-radius: 15px;
    background: linear-gradient(180deg,#11181e,#0f151a);
    color: #edf0f2;
    box-shadow: none;
  }
  .legacy-order-accent {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 3px;
    background: var(--legacy-orange);
  }
  .legacy-order-card.closed .legacy-order-accent { background: #45d17c; }
  .legacy-order-card.declined .legacy-order-accent { background: #ff5c65; }

  .legacy-order-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: flex-start;
  }
  .legacy-order-title {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 7px;
  }
  .legacy-order-title > span {
    color: var(--legacy-orange);
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
  }
  .legacy-order-title > strong {
    overflow: hidden;
    font-size: 15px;
    font-weight: 720;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .legacy-order-head-side {
    display: grid;
    justify-items: end;
    gap: 5px;
    flex: 0 0 auto;
  }
  .legacy-order-head-side time {
    color: #81888e;
    font-size: 8px;
  }
  .legacy-status {
    padding: 5px 9px;
    border: 1px solid #8d4939;
    border-radius: 9px;
    background: rgba(255,114,85,.1);
    color: #ffad98;
    font-size: 9px;
    font-weight: 650;
  }
  .legacy-status.closed {
    border-color: #247749;
    background: rgba(69,209,124,.09);
    color: #6de098;
  }
  .legacy-status.declined {
    border-color: #7d333a;
    background: rgba(255,92,101,.09);
    color: #ff7e86;
  }

  .legacy-order-device {
    display: grid;
    grid-template-columns: 48px minmax(0,1fr);
    gap: 10px;
    align-items: center;
    margin-top: 11px;
  }
  .legacy-device-icon {
    display: grid;
    place-items: center;
    width: 47px;
    height: 47px;
    border: 1px solid rgba(255,114,85,.25);
    border-radius: 12px;
    background: rgba(255,114,85,.06);
    color: #ff8a6f;
  }
  
  .legacy-order-device strong,
  .legacy-order-device small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  
  .legacy-order-device small { margin-top: 3px; color: #858d94; font-size: 9px; }

  .legacy-order-money {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 8px;
    margin-top: 10px;
  }
  .legacy-order-money > div {
    min-width: 0;
    min-height: 61px;
    padding: 10px;
    border: 1px solid #29323a;
    border-radius: 11px;
    background: #171e25;
  }
  .legacy-order-money span {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #90979d;
    font-size: 7px;
    letter-spacing: .08em;
  }
  .legacy-order-money .legacy-net-label { color: #65d78f; font-weight: 800; }
  .legacy-order-money .legacy-net-label .ui-icon { width: 11px; height: 11px; }
  .legacy-order-money strong {
    display: block;
    overflow: hidden;
    margin-top: 6px;
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .legacy-order-money strong.green { color: #62dd8e; }

  .legacy-order-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 11px;
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid #222b32;
    color: #818990;
    font-size: 8px;
  }
  .legacy-order-meta > span {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 4px;
  }
  .legacy-order-meta > span.address { color: #aa8be8; }
  .legacy-order-meta .ui-icon { width: 12px; height: 12px; flex: 0 0 auto; }
  .legacy-next-visit {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    color: #4f9be7;
    font-size: 8px;
  }
  .legacy-next-visit .ui-icon { width: 12px; height: 12px; }

  .legacy-order-photos {
    display: flex;
    gap: 6px;
    margin-top: 10px;
  }
  .legacy-order-photo {
    width: 50px;
    height: 50px;
    overflow: hidden;
    padding: 0;
    border: 1px solid #343c43;
    border-radius: 10px;
    background: #1a2025;
  }
  .legacy-order-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

  .legacy-order-actions {
    display: grid;
    grid-template-columns: repeat(5,minmax(0,1fr));
    gap: 5px;
    margin-top: 11px;
    padding-top: 10px;
    border-top: 1px solid #222b32;
  }
  .legacy-order-actions > button,
  .legacy-order-actions > a {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 4px;
    min-width: 0;
    min-height: 47px;
    padding: 5px 2px;
    border: 1px solid #2b343c;
    border-radius: 10px;
    background: #171e25;
    color: #858e96;
    font-size: 7px;
    text-decoration: none;
  }
  .legacy-order-actions .ui-icon { width: 17px; height: 17px; color: var(--legacy-orange); }
  .legacy-order-actions .action-toggle .ui-icon { color: #4fd584; }
  .legacy-order-actions .action-phone .ui-icon { color: #4aa2ff; }
  .legacy-order-actions > [disabled] { opacity: .42; }

  .legacy-special-filter {
    margin: -2px 0 8px;
  }
  .legacy-special-filter button {
    min-height: 28px;
    padding: 2px 7px;
    border: 0;
    background: transparent;
    color: #8f979d;
    font-size: 8px;
  }

  .bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: 90;
    width: min(100%,760px);
    min-height: calc(68px + env(safe-area-inset-bottom));
    padding: 7px 9px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid #252c32;
    background: rgba(9,13,16,.98);
    transform: translateX(-50%);
    box-shadow: 0 -10px 30px rgba(0,0,0,.12);
  }
  .nav-button {
    min-height: 51px;
    padding: 3px 2px;
    border: 0;
    background: transparent;
    color: #929ba2;
    font-size: 8.5px;
  }
  
  
  
}


/* 0.70.0 · Склад по архивному мобильному экрану. */
@media screen and (max-width: 520px) {
  .legacy-warehouse-page {
    padding: 0 9px 18px;
  }

  .legacy-warehouse-shortcuts {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 7px;
    margin: 7px 0 9px;
  }
  .legacy-warehouse-shortcuts button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 45px;
    padding: 7px;
    border: 1px solid #2c353d;
    border-radius: 12px;
    background: #171e25;
    color: #eef0f2;
    font-size: 10px;
    font-weight: 650;
  }
  .legacy-warehouse-shortcuts .ui-icon {
    width: 16px;
    height: 16px;
  }

  .legacy-warehouse-groups {
    display: grid;
    gap: 9px;
  }
  .legacy-warehouse-group {
    overflow: hidden;
    border: 1px solid #2a333b;
    border-radius: 14px;
    background: #10161b;
  }
  .legacy-warehouse-group > summary {
    display: grid;
    grid-template-columns: 30px minmax(0,1fr) 32px;
    gap: 8px;
    align-items: center;
    min-height: 68px;
    padding: 11px 12px;
    cursor: pointer;
    list-style: none;
  }
  .legacy-warehouse-group > summary::-webkit-details-marker { display: none; }
  .legacy-folder-icon {
    display: grid;
    place-items: center;
    color: #edf0f2;
  }
  .legacy-folder-icon .ui-icon {
    width: 22px;
    height: 22px;
  }
  .legacy-group-copy {
    min-width: 0;
  }
  .legacy-group-copy strong {
    display: block;
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .legacy-group-copy small {
    color: #818990;
    font-size: 8px;
  }
  .legacy-group-chevron {
    display: grid;
    place-items: center;
    width: 31px;
    height: 38px;
    border-radius: 10px;
    background: #171e25;
    color: #8c959c;
    font-size: 14px;
    transition: transform .18s ease;
  }
  .legacy-warehouse-group[open] .legacy-group-chevron {
    transform: rotate(180deg);
  }

  .legacy-stock-list {
    display: grid;
    gap: 7px;
    padding: 0 11px 11px 20px;
  }
  .legacy-stock-card-v2 {
    position: relative;
    overflow: hidden;
    border: 1px solid #2a333b;
    border-radius: 13px;
    background: linear-gradient(180deg,#11181e,#0f151a);
  }
  .legacy-stock-card-v2::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: #49d17c;
  }
  .legacy-stock-card-v2.low::before { background: #f0b84d; }
  .legacy-stock-card-v2.archived::before { background: #65707a; }

  .legacy-stock-main {
    display: grid;
    grid-template-columns: 42px minmax(0,1fr) auto;
    gap: 8px;
    align-items: center;
    width: 100%;
    min-height: 84px;
    padding: 11px 10px 9px 12px;
    border: 0;
    border-bottom: 1px solid #222b32;
    background: transparent;
    color: #edf0f2;
    text-align: left;
  }
  .legacy-stock-icon {
    display: grid;
    place-items: center;
    width: 39px;
    height: 39px;
    border: 1px solid rgba(255,114,85,.25);
    border-radius: 11px;
    background: rgba(255,114,85,.06);
    color: #ff8b70;
  }
  .legacy-stock-icon .ui-icon { width: 22px; height: 22px; }
  
  .legacy-stock-copy strong,
  .legacy-stock-copy small,
  .legacy-stock-copy em {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .legacy-stock-copy small {
    margin-top: 2px;
    color: #7f888f;
    font-size: 7.5px;
  }
  .legacy-stock-copy em {
    margin-top: 4px;
    color: #4ed17e;
    font-size: 8px;
    font-style: normal;
    font-weight: 700;
  }
  .legacy-stock-card-v2.low .legacy-stock-copy em { color: #e5b34a; }
  .legacy-stock-card-v2.archived .legacy-stock-copy em { color: #818a91; }

  .legacy-stock-qty {
    display: grid;
    justify-items: end;
    gap: 3px;
    padding-left: 6px;
  }
  .legacy-stock-qty strong {
    color: #4ed17e;
    font-size: 14px;
    white-space: nowrap;
  }
  .legacy-stock-qty small {
    color: #80888e;
    font-size: 7px;
    letter-spacing: .07em;
  }
  .legacy-stock-card-v2.low .legacy-stock-qty strong { color: #e9b84e; }
  .legacy-stock-card-v2.archived .legacy-stock-qty strong { color: #899299; }

  .legacy-stock-actions-v2 {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 6px;
    padding: 8px 10px 10px 12px;
  }
  .legacy-stock-actions-v2 button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 38px;
    min-width: 0;
    padding: 5px 5px;
    border: 1px solid #2b343c;
    border-radius: 10px;
    background: #171e25;
    color: #e8ebed;
    font-size: 9px;
    font-weight: 650;
  }
  .legacy-stock-actions-v2 button:nth-child(4) {
    grid-column: 1 / 2;
  }
  .legacy-stock-actions-v2 .ui-icon {
    width: 14px;
    height: 14px;
  }
  .legacy-stock-actions-v2 button:nth-child(1) > span { font-size: 17px; font-weight: 300; }
  .legacy-stock-actions-v2 button:nth-child(2) > span { font-size: 17px; font-weight: 300; }
}


/* 0.71.0 · Аналитика и Ещё по архивным мобильным скриншотам. */
@media screen and (max-width: 520px) {
  .analytics-content {
    padding: 16px 9px 20px;
  }
  .analytics-content .page-head {
    display: block;
    margin: 0 2px 12px;
  }
  
  .analytics-content .page-head .lead {
    margin-top: 4px;
    color: #858d94;
    font-size: 10px;
  }

  
  
  

  .analytics-range-nav {
    display: grid;
    grid-template-columns: 42px minmax(0,1fr) 42px;
    gap: 8px;
    align-items: center;
    min-height: 54px;
    margin-bottom: 10px;
    padding: 0;
    border: 0;
    background: transparent;
  }
  .analytics-range-nav > div {
    text-align: center;
  }
  .analytics-range-nav > div strong {
    display: block;
    font-size: 12px;
  }
  .analytics-range-nav > div small {
    display: block;
    margin-top: 2px;
    color: #7e878e;
    font-size: 8px;
  }
  .analytics-arrow {
    width: 40px;
    height: 40px;
    border: 1px solid #2b343c;
    border-radius: 11px;
    background: #171e25;
    color: #eef0f2;
    font-size: 27px;
    font-weight: 300;
  }
  .analytics-arrow:disabled { opacity: .28; }

  
  .analytics-content .panel-title {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 28px;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 700;
  }
  .analytics-content .panel-title small {
    margin-left: 4px;
    color: #818990;
    font-size: 8px;
    font-weight: 400;
  }
  .analytics-content .badge-icon {
    width: 24px;
    height: 24px;
    color: var(--legacy-orange);
  }
  .analytics-content .badge-icon .ui-icon {
    width: 18px;
    height: 18px;
  }

  
  
  .analytics-kpi > span {
    display: block;
    color: #8b9399;
    font-size: 7px !important;
    letter-spacing: .05em;
  }
  .analytics-kpi > strong {
    display: block;
    margin-top: 7px !important;
    font-size: 16px !important;
    line-height: 1;
  }
  .analytics-kpi > small {
    display: block;
    margin-top: 7px !important;
    color: #45c878;
    font-size: 7px !important;
  }


  .analytics-work-grid {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 7px;
  }
  .analytics-work-grid .metric {
    min-height: 62px;
    padding: 9px 7px !important;
    border: 1px solid #2b343c;
    border-radius: 10px;
    background: #171e25;
  }
  .analytics-work-grid .metric-label { font-size: 7px; }
  .analytics-work-grid .metric-value {
    margin-top: 6px;
    font-size: 14px !important;
  }

  .legacy-more-page {
    padding: 18px 9px 20px;
  }
  .legacy-more-head {
    margin: 0 2px 13px;
  }
  
  
  .legacy-more-list {
    display: grid;
    gap: 8px;
  }
  .legacy-more-list .menu-item {
    display: grid;
    grid-template-columns: 48px minmax(0,1fr) 18px;
    gap: 11px;
    align-items: center;
    min-height: 72px;
    padding: 11px 13px;
    border: 1px solid #2a333b;
    border-radius: 15px;
    background: #10161b;
    color: #edf0f2;
    text-align: left;
  }
  .legacy-more-list .menu-icon {
    display: grid;
    place-items: center;
    width: 45px;
    height: 45px;
    border-radius: 13px;
  }
  
  .legacy-more-list .menu-copy {
    min-width: 0;
  }
  .legacy-more-list .menu-name {
    display: block;
    font-size: 13px;
    font-weight: 720;
  }
  .legacy-more-list .menu-description {
    display: block;
    overflow: hidden;
    margin-top: 4px;
    color: #828990;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .legacy-more-list .chevron {
    display: grid;
    place-items: center;
    color: #8c959c;
  }
  
}


/* 0.72.0 · Товарник по архивным мобильным скриншотам. */
@media screen and (max-width: 520px) {
  .legacy-goods-page {
    padding: 12px 8px 22px;
  }
  .legacy-subpage-head {
    display: grid;
    grid-template-columns: 48px minmax(0,1fr);
    gap: 14px;
    align-items: center;
    margin: 1px 3px 18px;
  }
  .legacy-back-button {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid #2d353c;
    border-radius: 14px;
    background: #171e25;
    color: #eef1f3;
    font-size: 38px;
    font-weight: 200;
    line-height: .8;
  }
  
  

  .legacy-goods-panel {
    margin: 0 0 10px;
    padding: 13px 12px;
    border: 1px solid #2a333b;
    border-radius: 15px;
    background: linear-gradient(180deg,#11181e,#0f151a);
  }
  .legacy-section-title,
  .legacy-section-subtitle {
    display: flex;
    align-items: center;
    gap: 9px;
  }
  .legacy-section-title h2,
  .legacy-section-subtitle h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 720;
  }
  .legacy-section-subtitle {
    margin: 16px 0 9px;
  }
  .legacy-section-subtitle h3 { font-size: 14px; }
  .legacy-section-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border: 1px solid rgba(255,114,85,.26);
    border-radius: 11px;
    background: rgba(255,114,85,.08);
    color: #ff765a;
    font-size: 18px;
  }
  .legacy-section-icon.small {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }
  

  .legacy-goods-create-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 7px;
    margin-top: 13px;
  }
  .legacy-purple-button,
  .legacy-dark-button,
  .legacy-orange-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 7px 9px;
    border: 1px solid #313942;
    border-radius: 12px;
    background: #181f26;
    color: #f1f2f3;
    font-size: 11px;
    font-weight: 650;
  }
  .legacy-purple-button {
    border-color: #986af1;
    background: #a578f5;
    color: #17111f;
  }
  .legacy-orange-button {
    border-color: #ff7153;
    background: #ff7153;
    color: #17110f;
  }
  .legacy-purple-button .ui-icon,
  .legacy-dark-button .ui-icon,
  .legacy-orange-button .ui-icon { width: 17px; height: 17px; }

  .legacy-goods-order-source {
    display: block;
    margin-top: 12px;
  }
  .legacy-goods-order-source > span,
  .legacy-editor-title > span,
  .legacy-goods-edit-row label > span,
  .legacy-goods-row-label > span,
  .legacy-goods-row-sum > span,
  .legacy-goods-target label > span {
    display: block;
    margin: 0 0 6px;
    color: #9a9fa4;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .08em;
  }
  
  

  .legacy-goods-position-list {
    display: grid;
    gap: 0;
    margin-top: 2px;
    border: 1px solid #283139;
    border-radius: 11px;
    overflow: hidden;
  }
  .legacy-goods-position {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    gap: 8px;
    align-items: center;
    min-height: 48px;
    padding: 8px 10px;
    border-top: 1px solid #283139;
    background: #151c22;
  }
  
  .legacy-goods-position strong,
  .legacy-goods-position small { display:block; }
  
  .legacy-goods-position small { margin-top:3px; color:#858c92; font-size:8px; }
  .legacy-goods-position b { color:#ff765a; font-size:10px; white-space:nowrap; }
  .legacy-goods-more { padding:8px 10px; color:#858c92; font-size:8px; }
  
  .legacy-goods-empty {
    margin-top:13px;
    padding:16px 12px;
    border:1px dashed #303840;
    border-radius:11px;
    color:#858c92;
    font-size:9px;
    line-height:1.4;
    text-align:center;
  }

  .legacy-preview-table-wrap {
    overflow-x: auto;
    margin-top: 10px;
    border: 1px solid #2b343c;
    border-radius: 10px;
  }
  .legacy-preview-table {
    width: 100%;
    min-width: 420px;
    border-collapse: collapse;
    background:#11171d;
  }
  .legacy-preview-table th,
  .legacy-preview-table td {
    padding: 9px 8px;
    border-right:1px solid #29323a;
    border-bottom:1px solid #29323a;
    text-align:left;
  }
  .legacy-preview-table th {
    color:#8f969c;
    font-size:8px;
    font-weight:700;
  }
  
  .legacy-preview-table th:nth-child(2),
  .legacy-preview-table td:nth-child(2),
  .legacy-preview-table th:nth-child(3),
  .legacy-preview-table td:nth-child(3) { text-align:right; }
  .legacy-preview-total {
    display:flex;
    justify-content:space-between;
    gap:10px;
    padding:11px 8px 2px;
    font-size:13px;
  }
  

  .legacy-product-price summary {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    list-style:none;
    cursor:pointer;
  }
  .legacy-product-price summary::-webkit-details-marker { display:none; }
  .legacy-price-chevron { color:#899199; font-size:24px; }
  .legacy-product-price[open] .legacy-price-chevron { transform:rotate(90deg); }
  .legacy-product-price-list { margin-top:10px; }
  .legacy-product-price-list > div {
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:8px;
    min-height:42px;
    padding:7px 1px;
    border-top:1px solid #283139;
  }
  .legacy-product-price-list strong,
  .legacy-product-price-list small { display:block; }
  
  .legacy-product-price-list small { margin-top:2px; color:#7f878d; font-size:7px; }
  .legacy-product-price-list b { color:#ff765a; font-size:9px; white-space:nowrap; }

  .legacy-goods-editor-backdrop {
    z-index: 140;
    top:0 !important;
    bottom:0 !important;
    padding:0;
    background:#080d11;
    overflow:auto;
  }
  .legacy-goods-editor {
    width:100%;
    max-width:none;
    min-height:100%;
    margin:0;
    padding:12px 8px calc(92px + env(safe-area-inset-bottom));
    border:0;
    border-radius:0;
    background:#080d11;
    box-shadow:none;
  }
  .goods-modal-head { margin-top:0; }
  .legacy-editor-panel { margin-bottom:10px; }
  .legacy-editor-title { display:block; margin-top:13px; }
  .legacy-goods-add-line {
    display:grid;
    grid-template-columns:minmax(0,1fr) 86px;
    gap:6px;
    margin-bottom:8px;
  }
  
  .legacy-manual-add { width:100%; margin-top:7px; }

  .legacy-goods-editor-list {
    display:grid;
    gap:8px;
  }
  
  .legacy-goods-row-label {
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom:8px;
  }
  .legacy-goods-row-label > span { margin:0; color:#ff7153; }
  .legacy-goods-row-label button {
    display:grid;
    place-items:center;
    width:34px;
    height:34px;
    padding:0;
    border:1px solid rgba(255,87,96,.25);
    border-radius:10px;
    background:rgba(255,87,96,.08);
    color:#ff5b65;
  }
  .legacy-goods-row-label .ui-icon { width:17px; height:17px; }
  .legacy-goods-edit-row label { display:block; }
  .legacy-goods-row-grid {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:6px;
    margin-top:8px;
  }
  .legacy-goods-row-sum strong {
    display:grid;
    align-items:center;
    min-height:46px;
    padding:0 10px;
    border:1px solid #303942;
    border-radius:11px;
    background:#10161b;
    color:#ff765a;
    font-size:11px;
  }

  
  
  
  .legacy-goods-editor-actions > button { min-height:48px; }

  

  .legacy-goods-savebar {
    position:sticky;
    bottom:0;
    z-index:4;
    display:grid;
    grid-template-columns:auto minmax(0,1fr);
    gap:7px;
    margin:12px -8px -92px;
    padding:9px 8px calc(9px + env(safe-area-inset-bottom));
    border-top:1px solid #222a31;
    background:rgba(8,13,17,.97);
  }
  .legacy-save-goods,
  .legacy-delete-goods {
    min-height:45px;
    border-radius:11px;
    font-size:10px;
    font-weight:700;
  }
  .legacy-save-goods {
    border:1px solid #ff7153;
    background:#ff7153;
    color:#17110f;
  }
  .legacy-delete-goods {
    padding:0 13px;
    border:1px solid rgba(255,91,101,.32);
    background:rgba(255,91,101,.08);
    color:#ff6b74;
  }
  
  .legacy-goods-savebar:not(:has(.legacy-delete-goods)) {
    grid-template-columns:1fr;
  }
}


/* 0.73.0 · Форма заявки и каталог по архивным мобильным скриншотам. */
@media screen and (max-width: 520px) {
  .order-editor-backdrop {
    z-index: 80;
    top: 96px !important;
    bottom: calc(68px + env(safe-area-inset-bottom)) !important;
    padding: 0;
    background: #080d11;
    overflow: hidden;
  }
  .order-editor-modal {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 0 12px 26px;
    overflow-y: auto;
    border: 0;
    border-radius: 0;
    background: #0b1014;
    box-shadow: none;
  }
  .order-editor-head {
    position: sticky;
    top: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    margin: 0 -12px 12px;
    padding: 8px 12px;
    border-bottom: 1px solid #20272d;
    background: rgba(11,16,20,.98);
  }
  
  .order-editor-close {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #303840;
    border-radius: 11px;
    background: #171e25;
    color: #e9ecee;
    font-size: 22px;
  }

  
  
  
  .order-editor-modal .form-group label {
    margin-bottom: 5px;
    color: #979da2;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
  }
  
  
  

  .legacy-service-catalog-open {
    width: 100%;
    min-height: 54px;
    margin: 0 0 8px;
    border: 1px solid rgba(255,113,83,.6);
    border-radius: 12px;
    background: rgba(255,113,83,.06);
    color: #ff795d;
    font-size: 13px;
    font-weight: 700;
  }
  .legacy-service-catalog-open .ui-icon {
    width: 18px;
    height: 18px;
  }
  .legacy-service-list {
    display: grid;
    gap: 0;
  }
  .legacy-service-row {
    display: grid !important;
    grid-template-columns: 20px minmax(0,1fr) auto !important;
    gap: 4px !important;
    align-items: center;
    min-height: 43px !important;
    padding: 0 !important;
    border: 0 !important;
    border-bottom: 1px solid #293138 !important;
    border-radius: 0 !important;
    background: transparent !important;
  }
  .legacy-service-row .service-check {
    display: grid;
    place-items: center;
    color: #f0f1f2;
  }
  .legacy-service-row .service-check .ui-icon {
    width: 15px;
    height: 15px;
  }
  .legacy-service-row .service-name-field,
  .legacy-service-row .service-price-field input {
    min-height: 40px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  .legacy-service-row .service-name-field {
    font-size: 12px !important;
  }
  .legacy-service-row .service-price-field {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 72px;
  }
  .legacy-service-row .service-price-field input {
    width: 64px;
    text-align: right;
    font-size: 11px !important;
  }
  .legacy-service-row .service-price-field > span {
    margin-left: 2px;
    color: #dfe2e4;
    font-size: 11px;
  }
  .legacy-service-row .service-qty-field,
  .legacy-service-row .service-remove {
    display: none !important;
  }
  .legacy-service-total {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 8px;
    color: #eef0f1;
    font-size: 11px;
  }
  .legacy-service-total strong { font-size: 11px; }
  .legacy-service-total .green { color: #5fd789; }

  .legacy-material-help {
    margin: -1px 0 9px;
    color: #858c92;
    font-size: 9px;
    line-height: 1.4;
  }
  .legacy-stock-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 53px;
    border: 1px solid #343d45;
    border-radius: 12px;
    background: #181f26;
    color: #edf0f2;
    font-size: 13px;
    font-weight: 650;
    list-style: none;
  }
  .legacy-stock-button::-webkit-details-marker { display:none; }
  .legacy-stock-button .ui-icon { width: 18px; height: 18px; }

  #material-lines {
    display: grid;
    gap: 9px;
  }
  .legacy-material-card {
    padding: 10px 9px !important;
    border: 1px solid #2e373f !important;
    border-radius: 12px !important;
    background: #161d23 !important;
  }
  .material-card-head {
    display: grid !important;
    grid-template-columns: minmax(0,1fr) 40px;
    gap: 8px;
    align-items: start;
  }
  .material-card-head .material-name-field {
    min-height: 32px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    font-size: 12px !important;
    font-weight: 650;
  }
  .material-card-head small {
    display: block;
    margin-top: 1px;
    color: #858c92;
    font-size: 8px;
  }
  .material-remove {
    width: 38px !important;
    height: 38px !important;
    border: 1px solid rgba(255,91,101,.28) !important;
    border-radius: 11px !important;
    background: rgba(255,91,101,.07) !important;
    color: #ff5d67 !important;
  }
  .material-remove .ui-icon { width: 18px; height: 18px; }
  .material-card-controls {
    display: grid !important;
    grid-template-columns: repeat(3,minmax(0,1fr)) !important;
    gap: 7px !important;
    margin-top: 9px;
  }
  .material-card-controls label > span {
    display: block;
    margin-bottom: 5px;
    color: #949a9f;
    font-size: 7px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
  }
  .material-card-controls .field {
    min-height: 43px !important;
    padding: 0 8px !important;
    font-size: 10px !important;
  }
  .material-unit {
    display: flex;
    align-items: center;
  }

  
  .manual-material-details summary {
    padding: 10px 11px;
    color: #8f969c;
    font-size: 9px;
    list-style: none;
  }
  .manual-material-details summary::-webkit-details-marker { display:none; }
  .manual-material-details summary::before { content:"▶ "; font-size:8px; }
  .manual-material-details[open] summary::before { content:"▼ "; }
  .manual-material-details button {
    min-height: 40px;
    margin: 0 8px 8px;
    width: calc(100% - 16px);
  }

  .order-calculation-summary {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 6px;
    margin-top: 12px;
    padding: 8px;
    border: 1px solid #2a333b;
    border-radius: 12px;
    background: #12191f;
  }
  
  .order-calculation-summary span {
    display: block;
    color: #8e959a;
    font-size: 6.5px;
  }
  .order-calculation-summary strong {
    display: block;
    overflow: hidden;
    margin-top: 4px;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  

  .legacy-payment-grid {
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    gap: 8px !important;
  }
  .legacy-payment-grid .field {
    min-height: 48px !important;
    font-size: 12px !important;
  }

  .legacy-guarantee-card {
    margin-top: 4px;
    padding: 11px;
    border: 1px solid rgba(255,113,83,.34);
    border-radius: 12px;
    background: rgba(255,113,83,.035);
  }
  .legacy-guarantee-head {
    display: grid;
    grid-template-columns: 28px minmax(0,1fr) auto;
    gap: 7px;
    align-items: center;
    margin-bottom: 9px;
  }
  .legacy-guarantee-head .guarantee-icon {
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    color: #f0f2f3;
  }
  .legacy-guarantee-head .ui-icon { width: 19px; height: 19px; }
  .legacy-guarantee-head strong { font-size: 11px; }
  .legacy-guarantee-head .guarantee-date {
    padding: 4px 7px;
    border: 1px solid #28558b;
    border-radius: 10px;
    color: #67a9ef;
    font-size: 7px;
    white-space: nowrap;
  }
  .legacy-guarantee-card > label {
    display: block;
    margin-bottom: 5px;
    color: #999fa4;
    font-size: 7px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
  }

  .order-extra-details {
    margin-top: 10px;
    border: 1px solid #2a333a;
    border-radius: 11px;
    background: #11171d;
  }
  .order-extra-details > summary {
    padding: 10px 11px;
    color: #a1a7ac;
    font-size: 9px;
    list-style: none;
  }
  

  .order-editor-modal .modal-actions {
    position: sticky;
    bottom: -26px;
    z-index: 5;
    display: grid;
    grid-template-columns: .8fr .8fr 1.2fr;
    gap: 6px;
    margin: 14px -12px -26px;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid #222a31;
    background: rgba(11,16,20,.98);
  }
  .order-editor-modal .modal-actions button {
    min-height: 43px;
    padding: 6px;
    border-radius: 10px;
    font-size: 9px;
  }
  .order-editor-modal .modal-actions .primary-button {
    background: #ff7153;
    border-color: #ff7153;
    color: #17110f;
  }

  /* Каталог услуг поверх формы, как старый мобильный лист. */
  .catalog-modal-backdrop {
    z-index: 130;
    top: 0 !important;
    bottom: calc(68px + env(safe-area-inset-bottom)) !important;
    padding: 52px 0 0;
    background: rgba(0,0,0,.78);
    overflow: hidden;
  }
  .catalog-modal {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 0 12px 10px;
    border: 1px solid #232c33;
    border-radius: 18px 18px 0 0;
    background: #11181e;
    box-shadow: 0 -12px 40px rgba(0,0,0,.35);
  }
  .catalog-modal-head {
    min-height: 66px;
    margin: 0 -12px;
    padding: 12px 14px;
    border-bottom: 0;
    background: transparent;
  }
  .catalog-modal-head .small {
    color: #ff7153;
    font-size: 9px;
  }
  .catalog-modal-head h2 {
    margin-top: 4px;
    color: #ff7153;
    font-size: 17px;
  }
  .catalog-close {
    width: 36px;
    height: 36px;
    border: 1px solid #303942;
    border-radius: 11px;
    background: #181f26;
    color: #e9ecee;
  }
  .catalog-search-row {
    margin: 0 0 10px;
    padding: 0;
  }
  .catalog-search-row .search {
    min-height: 48px;
    padding-left: 43px;
    border: 1px solid #ff7153;
    border-radius: 13px;
    background: #181f26;
    font-size: 11px;
    box-shadow: 0 0 0 2px rgba(255,113,83,.08);
  }
  .catalog-search-row > .ui-icon {
    left: 14px;
    width: 20px;
    height: 20px;
  }
  .catalog-service-list {
    display: block;
    overflow-y: auto;
    padding: 0 0 155px;
  }
  .catalog-service-group {
    margin: 0 0 12px;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  .catalog-service-group h3 {
    margin: 0 0 6px;
    padding: 0 6px;
    border: 0;
    color: #939aa0;
    font-size: 8px;
    font-weight: 750;
    letter-spacing: .06em;
    text-transform: uppercase;
  }
  .catalog-service-option {
    display: grid;
    grid-template-columns: 26px minmax(0,1fr) auto;
    gap: 8px;
    min-height: 54px;
    margin-bottom: 6px;
    padding: 8px 10px;
    border: 1px solid #2d363e;
    border-radius: 11px;
    background: #181f26;
  }
  .catalog-service-option.selected {
    border-color: rgba(255,113,83,.48);
    background: rgba(255,113,83,.055);
  }
  .catalog-check {
    width: 24px;
    height: 24px;
    border-radius: 7px;
  }
  .catalog-service-copy strong { font-size: 10px; }
  .catalog-service-copy small { margin-top: 3px; font-size: 7px; }
  .catalog-service-price {
    align-self: center;
    color: #ff765a;
    font-size: 11px;
    font-weight: 750;
  }
  .catalog-fit-summary {
    position: absolute;
    right: 12px;
    bottom: 58px;
    left: 12px;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 5px;
    padding: 7px;
    border: 1px solid #2b343c;
    border-radius: 11px;
    background: rgba(17,24,30,.98);
  }
  .catalog-fit-summary > div { padding: 5px; }
  .catalog-fit-summary span { font-size: 6px; }
  .catalog-fit-summary strong { margin-top: 3px; font-size: 9px; }
  .catalog-modal-actions {
    position: absolute;
    right: 12px;
    bottom: 8px;
    left: 12px;
    margin: 0;
    padding: 0;
  }
  .catalog-modal-actions .primary-button {
    min-height: 43px;
    border-radius: 11px;
    background: #ff7153;
    border-color: #ff7153;
    color: #17110f;
    font-size: 10px;
  }
}

@media screen and (max-width: 370px) {
  .material-card-controls {
    grid-template-columns: repeat(3,minmax(0,1fr)) !important;
  }
  .order-editor-modal .form-grid,
  .legacy-payment-grid {
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
  }
}


/* 0.74.0 · Прайс-лист по архивному мобильному каталогу. */
@media screen and (max-width: 520px) {
  .legacy-price-page {
    padding: 12px 8px 24px;
  }
  .legacy-price-head {
    grid-template-columns: 46px minmax(0,1fr) 42px;
    gap: 11px;
    margin-bottom: 15px;
  }
  .legacy-price-add {
    display:grid;
    place-items:center;
    width:42px;
    height:42px;
    padding:0;
    border:1px solid #ff7153;
    border-radius:13px;
    background:#ff7153;
    color:#16110f;
    font-size:29px;
    font-weight:300;
  }

  .legacy-price-search {
    margin: 0 0 10px;
  }
  .legacy-price-search .search {
    min-height: 53px;
    padding-left: 47px;
    border: 1px solid #ff7153;
    border-radius: 14px;
    background: #181f26;
    color: #eef0f2;
    font-size: 12px;
    box-shadow: 0 0 0 2px rgba(255,113,83,.08);
  }
  .legacy-price-search > .ui-icon {
    left: 16px;
    width: 22px;
    height: 22px;
    color: #9da5ac;
  }
  .legacy-price-search .search::placeholder { color:#656d74; }

  
  
  

  
  .legacy-price-group > h3,
  .legacy-custom-price-head h3 {
    margin:0 0 7px 7px;
    color:#949ba1;
    font-size:8px;
    font-weight:760;
    letter-spacing:.07em;
    text-transform:uppercase;
  }
  .legacy-price-list {
    display:grid;
    gap:6px;
  }
  
  
  .legacy-price-row strong {
    font-size:12px;
    font-weight:680;
  }
  
  .legacy-price-row b {
    color:#ff7153;
    font-size:12px;
    font-weight:760;
    white-space:nowrap;
  }
  .legacy-price-row.custom {
    border-color:#373145;
  }

  .legacy-custom-price-head {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    margin-bottom:7px;
  }
  .legacy-custom-price-head h3 { margin-bottom:0; }
  
  .legacy-price-empty {
    padding:13px 12px;
    border:1px dashed #303840;
    border-radius:11px;
    color:#858c92;
    font-size:9px;
    text-align:center;
  }
  .legacy-price-empty.standalone { margin-top:14px; }

  .legacy-price-editor-backdrop {
    z-index:140;
    top:0 !important;
    bottom:0 !important;
    padding:0;
    overflow:auto;
    background:#080d11;
  }
  .legacy-price-editor {
    width:100%;
    max-width:none;
    min-height:100%;
    margin:0;
    padding:12px 8px calc(82px + env(safe-area-inset-bottom));
    border:0;
    border-radius:0;
    background:#080d11;
    box-shadow:none;
  }
  .legacy-editor-head {
    margin-top:0;
    margin-bottom:15px;
  }
  
  .legacy-price-editor-grid {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
    margin-top:13px;
  }
  .legacy-price-editor-grid label.full { grid-column:1 / -1; }
  
  .legacy-price-editor-grid .field {
    width:100%;
    min-height:47px;
    padding:0 10px;
    border:1px solid #303840;
    border-radius:11px;
    background:#181f26;
    color:#eef0f2;
    font-size:10px;
  }
  .legacy-price-editor-grid .textarea {
    min-height:84px;
    padding-top:10px;
  }
  .legacy-price-value {
    color:#ff8066 !important;
    font-size:15px !important;
    font-weight:760 !important;
  }
  .legacy-price-editor-actions {
    position:sticky;
    bottom:0;
    z-index:5;
    display:grid;
    grid-template-columns:auto auto minmax(0,1fr);
    gap:7px;
    margin:12px -8px calc(-82px - env(safe-area-inset-bottom));
    padding:9px 8px calc(9px + env(safe-area-inset-bottom));
    border-top:1px solid #222a31;
    background:rgba(8,13,17,.97);
  }
  .legacy-price-editor-actions > button {
    min-height:45px;
    padding:6px 11px;
    border-radius:11px;
    font-size:9px;
    font-weight:700;
  }
  .legacy-editor-save {
    border:1px solid #ff7153;
    background:#ff7153;
    color:#17110f;
  }
  .legacy-editor-delete {
    border:1px solid rgba(255,91,101,.32);
    background:rgba(255,91,101,.08);
    color:#ff6670;
  }
  
}


/* 0.75.0 · Акт и A4-предпросмотр по архивному мобильному экрану. */
@media screen and (max-width: 520px) {
  .legacy-act-page {
    padding:12px 8px 24px;
  }
  .legacy-act-head {
    margin-bottom:14px;
  }
  .legacy-act-control {
    margin-bottom:12px;
    padding:13px 12px;
    border:1px solid #2d363e;
    border-radius:14px;
    background:linear-gradient(180deg,#141b21,#11171d);
  }
  
  
  .legacy-act-control-title .ui-icon { width:21px; height:21px; }
  .legacy-act-control-title h2 {
    margin:0;
    font-size:14px;
    font-weight:720;
  }
  .legacy-act-control > label {
    display:block;
  }
  .legacy-act-control > label > span {
    display:block;
    margin:0 0 6px;
    color:#92999f;
    font-size:8px;
    font-weight:730;
    letter-spacing:.07em;
  }
  .legacy-act-control .field {
    width:100%;
    min-height:51px;
    padding:0 12px;
    border:1px solid #ff7153;
    border-radius:12px;
    background:#181f26;
    color:#e9edef;
    font-size:11px;
    box-shadow:0 0 0 1px rgba(255,113,83,.07);
  }
  .legacy-act-control-actions {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:7px;
    margin-top:10px;
  }
  
  .legacy-act-control-actions .ui-icon { width:16px; height:16px; }

  .legacy-act-preview {
    overflow-x:auto;
    padding:0 0 3px;
    border-radius:2px;
    background:#11171d;
  }
  .legacy-act-preview .act-sheet {
    box-sizing:border-box;
    width:100%;
    min-width:0;
    margin:0;
    padding:24px 20px 30px;
    border:0;
    border-radius:0;
    background:#fff;
    color:#000;
    font-family:"Times New Roman", Times, serif;
    font-size:10px;
    line-height:1.18;
    box-shadow:none;
  }
  .legacy-act-preview .act-sheet h2 {
    margin:0 0 8px;
    text-align:center;
    font-size:18px;
    line-height:1.05;
  }
  .legacy-act-preview .act-contract-line {
    margin:0 0 15px;
    text-align:right;
    font-size:10px;
  }
  .legacy-act-preview .act-main-fields {
    display:grid;
    gap:4px;
    margin-bottom:11px;
  }
  .legacy-act-preview .act-main-fields > div {
    display:grid;
    grid-template-columns:43% minmax(0,1fr);
    gap:7px;
    align-items:end;
  }
  .legacy-act-preview .act-main-fields b {
    font-size:10px;
    line-height:1.1;
  }
  .legacy-act-preview .act-main-fields span {
    min-height:19px;
    padding:0 3px 2px;
    border-bottom:1px solid #000;
    font-size:10px;
  }

  .legacy-act-preview .act-work-table {
    width:100%;
    min-width:0;
    border-collapse:collapse;
    table-layout:fixed;
    font-size:8.5px;
    line-height:1.08;
  }
  .legacy-act-preview .act-work-table th,
  .legacy-act-preview .act-work-table td {
    padding:5px 3px;
    border:1px solid #000;
    text-align:center;
    vertical-align:middle;
    overflow-wrap:anywhere;
  }
  .legacy-act-preview .act-work-table th:nth-child(1),
  .legacy-act-preview .act-work-table td:nth-child(1) { width:6%; }
  .legacy-act-preview .act-work-table th:nth-child(2),
  .legacy-act-preview .act-work-table td:nth-child(2) { width:34%; }
  .legacy-act-preview .act-work-table th:nth-child(3),
  .legacy-act-preview .act-work-table td:nth-child(3) { width:17%; }
  .legacy-act-preview .act-work-table th:nth-child(4),
  .legacy-act-preview .act-work-table td:nth-child(4) { width:11%; }
  .legacy-act-preview .act-work-table th:nth-child(5),
  .legacy-act-preview .act-work-table td:nth-child(5) { width:16%; }
  .legacy-act-preview .act-work-table th:nth-child(6),
  .legacy-act-preview .act-work-table td:nth-child(6) { width:16%; }

  .legacy-act-preview .act-totals {
    display:grid;
    gap:4px;
    margin-top:10px;
    font-size:9px;
  }
  .legacy-act-preview .act-totals > div {
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:8px;
  }
  .legacy-act-preview .act-total-words {
    grid-template-columns:auto minmax(0,1fr);
  }
  .legacy-act-preview .act-acceptance {
    margin-top:20px;
    padding:0;
    border:0;
  }
  .legacy-act-preview .act-acceptance h3 {
    margin:0 0 8px;
    text-align:center;
    font-size:12px;
  }
  .legacy-act-preview .act-acceptance-date {
    margin-bottom:8px;
    text-align:right;
    font-size:8px;
  }
  .legacy-act-preview .act-acceptance p {
    margin:0;
    font-size:8px;
    line-height:1.25;
    text-align:justify;
  }
  .legacy-act-preview .act-signatures {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:18px;
    margin-top:18px;
    font-size:8px;
    line-height:1.4;
  }
}


/* 0.76.0 · Клиенты и финансы в старом мобильном визуальном языке. */
@media screen and (max-width: 520px) {
  .legacy-clients-page,
  .legacy-finance-page {
    padding: 12px 8px 24px;
  }
  .legacy-clients-head,
  .legacy-finance-head {
    margin-bottom: 14px;
  }

  .legacy-client-search {
    margin: 0 0 10px;
  }
  .legacy-client-search .search {
    min-height: 49px;
    padding-left: 45px;
    border: 1px solid #2f383f;
    border-radius: 13px;
    background: #181f26;
    color: #edf0f2;
    font-size: 11px;
  }
  .legacy-client-search > .ui-icon {
    left: 15px;
    width: 20px;
    height: 20px;
    color: #9ba3aa;
  }

  
  .legacy-clients-stats > div {
    min-width: 0;
    padding: 9px 8px;
    border: 1px solid #2c353d;
    border-radius: 11px;
    background: #161d23;
  }
  .legacy-clients-stats span,
  .legacy-finance-summary span {
    display: block;
    color: #8c9399;
    font-size: 7px;
    font-weight: 720;
    letter-spacing: .07em;
  }
  .legacy-clients-stats strong {
    display: block;
    margin-top: 5px;
    font-size: 16px;
  }

  .legacy-client-list {
    display: grid;
    gap: 8px;
  }
  .legacy-client-card {
    overflow: hidden;
    border: 1px solid #2b343c;
    border-radius: 14px;
    background: linear-gradient(180deg,#141b21,#11171d);
  }
  .legacy-client-main {
    display: grid;
    grid-template-columns: 42px minmax(0,1fr) auto;
    gap: 9px;
    align-items: center;
    width: 100%;
    min-height: 78px;
    padding: 10px 11px 8px;
    border: 0;
    background: transparent;
    color: #edf0f2;
    text-align: left;
  }
  .legacy-client-avatar {
    display: grid;
    place-items: center;
    width: 41px;
    height: 41px;
    border: 1px solid rgba(255,113,83,.3);
    border-radius: 12px;
    background: rgba(255,113,83,.08);
    color: #ff7b61;
  }
  .legacy-client-avatar .ui-icon { width: 22px; height: 22px; }
  .legacy-client-copy,
  .legacy-client-side { min-width: 0; }
  .legacy-client-copy strong,
  .legacy-client-copy small,
  .legacy-client-copy em,
  .legacy-client-side b,
  .legacy-client-side small {
    display: block;
  }
  
  .legacy-client-copy small {
    margin-top: 3px;
    color: #9aa1a7;
    font-size: 8px;
  }
  .legacy-client-copy em {
    display: flex;
    align-items: center;
    gap: 3px;
    overflow: hidden;
    margin-top: 3px;
    color: #aa8be8;
    font-size: 7px;
    font-style: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .legacy-client-copy em .ui-icon { width: 10px; height: 10px; }
  .legacy-client-side {
    display: grid;
    justify-items: end;
    gap: 4px;
  }
  .legacy-client-side b {
    color: #ff7b61;
    font-size: 12px;
    white-space: nowrap;
  }
  .legacy-client-side small {
    color: #7e868d;
    font-size: 7px;
  }
  .legacy-client-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 11px;
    padding: 8px 11px;
    border-top: 1px solid #252e35;
    color: #8f969c;
    font-size: 7px;
  }
  .legacy-client-meta b { color: #dfe3e6; }
  .legacy-client-actions {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 6px;
    padding: 0 11px 10px;
  }
  .legacy-client-actions a,
  .legacy-client-actions button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 39px;
    border: 1px solid #303941;
    border-radius: 10px;
    background: #181f26;
    color: #cbd1d5;
    font-size: 8px;
    text-decoration: none;
  }
  .legacy-client-actions .ui-icon { width: 15px; height: 15px; }
  .legacy-client-actions a .ui-icon { color: #4fa7ff; }
  .legacy-client-actions button .ui-icon { color: #ff7b61; }
  .legacy-client-empty,
  .legacy-finance-empty {
    padding: 16px 12px;
    border: 1px dashed #303840;
    border-radius: 11px;
    color: #858c92;
    font-size: 9px;
    text-align: center;
  }

  
  
  .legacy-finance-periods button.active {
    border-color: #ff7153;
    background: rgba(255,113,83,.11);
    color: #f0ecea;
  }

  
  
  .legacy-finance-summary .result {
    grid-column: 1 / -1;
    min-height: 66px;
  }
  
  .legacy-finance-summary .income strong { color: #58d889; }
  .legacy-finance-summary .expense strong { color: #ff636d; }

  .legacy-finance-actions {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 7px;
    margin-bottom: 10px;
  }
  

  .legacy-finance-history {
    padding: 11px 10px;
    border: 1px solid #2b343c;
    border-radius: 14px;
    background: linear-gradient(180deg,#141b21,#11171d);
  }
  .legacy-finance-history-head {
    display: grid;
    grid-template-columns: 33px minmax(0,1fr) auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 7px;
  }
  .legacy-finance-history-head h2 {
    margin: 0;
    font-size: 13px;
  }
  .legacy-finance-history-head > b {
    display: grid;
    place-items: center;
    min-width: 24px;
    height: 22px;
    padding: 0 6px;
    border-radius: 7px;
    background: #1a2229;
    color: #9fa6ac;
    font-size: 8px;
  }
  .legacy-finance-list {
    display: grid;
  }
  .legacy-finance-row {
    display: grid;
    grid-template-columns: 34px minmax(0,1fr) auto 28px;
    gap: 8px;
    align-items: center;
    min-height: 58px;
    padding: 7px 0;
    border-top: 1px solid #283139;
  }
  .legacy-finance-row:first-child { border-top: 0; }
  .legacy-finance-kind {
    display: grid;
    place-items: center;
    width: 33px;
    height: 33px;
    border-radius: 9px;
    background: #1a2229;
  }
  .legacy-finance-row.income .legacy-finance-kind { color: #58d889; }
  .legacy-finance-row.expense .legacy-finance-kind { color: #ff636d; }
  .legacy-finance-kind .ui-icon { width: 17px; height: 17px; }
  .legacy-finance-copy strong,
  .legacy-finance-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .legacy-finance-copy small {
    margin-top: 3px;
    color: #858c92;
    font-size: 7px;
  }
  .legacy-finance-row > b {
    font-size: 9px;
    white-space: nowrap;
  }
  .legacy-finance-row > button {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: rgba(255,91,101,.06);
    color: #ff6670;
  }
  .legacy-finance-row > button .ui-icon { width: 14px; height: 14px; }

  .legacy-client-profile-backdrop,
  .legacy-finance-entry-backdrop {
    z-index: 140;
    top: 0 !important;
    bottom: 0 !important;
    padding: 0;
    background: #080d11;
  }
  .legacy-client-profile-backdrop .client-profile-modal,
  .legacy-finance-entry-backdrop .finance-entry-modal {
    width: 100%;
    max-width: none;
    min-height: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: #080d11;
    box-shadow: none;
  }
  
  
  .legacy-client-profile-backdrop .client-profile-hero,
  .legacy-client-profile-backdrop .client-profile-address,
  .legacy-client-profile-backdrop .client-profile-kpis,
  .legacy-client-profile-backdrop .client-profile-history {
    border-color: #2b343c;
    background: #141b21;
    box-shadow: none;
  }
  .legacy-client-profile-backdrop .client-profile-avatar {
    border-color: rgba(255,113,83,.3);
    background: rgba(255,113,83,.08);
    color: #ff7b61;
  }

  
  
  
  
  
  
  
  .legacy-finance-entry-backdrop .modal-actions {
    position: sticky;
    bottom: 0;
    margin: 14px -12px -22px;
    padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
    border-top: 1px solid #222a31;
    background: rgba(8,13,17,.97);
  }
  .legacy-finance-entry-backdrop .modal-actions button {
    min-height: 43px;
    border-radius: 10px;
    font-size: 9px;
  }
}


/* 0.77.0 · Настройки и служебные разделы в едином старом мобильном стиле. */
@media screen and (max-width:520px) {
  .legacy-settings-page,
  .legacy-service-page {
    padding:12px 8px 24px;
  }
  .legacy-settings-card {
    margin-bottom:10px;
    padding:13px 12px;
    border:1px solid #2b343c;
    border-radius:14px;
    background:linear-gradient(180deg,#141b21,#11171d);
  }
  .legacy-settings-grid {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
    margin-top:12px;
  }
  .legacy-settings-grid label.full { grid-column:1/-1; }
  .legacy-settings-grid label > span {
    display:block;
    margin:0 0 5px;
    color:#939a9f;
    font-size:7px;
    font-weight:720;
    letter-spacing:.07em;
  }
  .legacy-settings-grid .field {
    min-height:46px;
    border:1px solid #303940;
    border-radius:11px;
    background:#181f26;
    color:#eef0f2;
    font-size:10px;
  }
  .legacy-settings-toggle-row {
    display:grid;
    grid-template-columns:25px minmax(0,1fr);
    gap:9px;
    align-items:start;
    margin-top:11px;
    padding:10px;
    border:1px solid #2b343c;
    border-radius:11px;
    background:#11171d;
  }
  .legacy-settings-toggle-row input { display:none; }
  .legacy-settings-toggle-row strong,
  .legacy-settings-toggle-row small {
    display:block;
  }
  
  .legacy-settings-toggle-row small { margin-top:3px;color:#858c92;font-size:7px;line-height:1.35; }
  .legacy-settings-save {
    width:100%;
    min-height:43px;
    margin-top:10px;
    border:1px solid #ff7153;
    border-radius:11px;
    background:#ff7153;
    color:#17110f;
    font-size:9px;
    font-weight:720;
  }
  .legacy-settings-list {
    display:grid;
    gap:0;
    margin-top:10px;
  }
  .legacy-settings-row {
    display:grid;
    grid-template-columns:34px minmax(0,1fr) auto;
    gap:8px;
    align-items:center;
    min-height:58px;
    padding:7px 0;
    border-top:1px solid #283139;
  }
  
  .legacy-settings-row.plain { grid-template-columns:minmax(0,1fr) auto; }
  .legacy-settings-row-icon {
    display:grid;
    place-items:center;
    width:33px;
    height:33px;
    border-radius:9px;
    background:#1a2229;
    color:#ff7b61;
  }
  .legacy-settings-row-icon .ui-icon { width:17px;height:17px; }
  .legacy-settings-row strong,
  .legacy-settings-row small {
    display:block;
  }
  
  .legacy-settings-row small { margin-top:3px;color:#858c92;font-size:7px; }
  .legacy-settings-row > button:not(.toggle) {
    min-height:31px;
    padding:4px 8px;
    border:1px solid #303940;
    border-radius:9px;
    background:#181f26;
    color:#cbd1d5;
    font-size:7px;
  }
  .legacy-settings-row select {
    min-height:34px;
    border:1px solid #303940;
    border-radius:9px;
    background:#181f26;
    color:#e9ecee;
    font-size:8px;
  }

  .legacy-settings-links {
    display:grid;
    gap:6px;
    margin-top:10px;
  }
  .legacy-settings-links > button {
    display:grid;
    grid-template-columns:34px minmax(0,1fr) auto 14px;
    gap:8px;
    align-items:center;
    min-height:58px;
    padding:8px 9px;
    border:1px solid #2c353d;
    border-radius:11px;
    background:#171e25;
    color:#edf0f2;
    text-align:left;
  }
  .legacy-settings-links .settings-link-icon {
    display:grid;
    place-items:center;
    width:33px;
    height:33px;
    border-radius:9px;
    background:#1c252c;
    color:#ff7b61;
  }
  .legacy-settings-links .settings-link-icon .ui-icon { width:17px;height:17px; }
  .legacy-settings-links strong,
  .legacy-settings-links small { display:block; }
  
  .legacy-settings-links small { margin-top:2px;color:#858c92;font-size:7px; }
  .legacy-settings-links > button > b { color:#9aa2a8;font-size:8px; }

  .legacy-service-head-with-add {
    grid-template-columns:46px minmax(0,1fr) 42px;
    gap:10px;
  }
  
  .legacy-service-stats {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:7px;
    margin-bottom:10px;
  }
  .legacy-service-stats.two { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .legacy-service-stats.backup { margin-top:10px; }
  .legacy-service-stats > div {
    padding:9px 8px;
    border:1px solid #2c353d;
    border-radius:11px;
    background:#161d23;
  }
  .legacy-service-stats span {
    display:block;
    color:#8c9399;
    font-size:7px;
    font-weight:720;
    letter-spacing:.07em;
  }
  .legacy-service-stats strong {
    display:block;
    overflow:hidden;
    margin-top:5px;
    font-size:14px;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  .legacy-service-list {
    display:grid;
    gap:7px;
  }
  .legacy-document-row {
    display:grid;
    grid-template-columns:36px minmax(0,1fr) auto 14px;
    gap:8px;
    align-items:center;
    min-height:61px;
    padding:9px 10px;
    border:1px solid #2c353d;
    border-radius:12px;
    background:#171e25;
    color:#edf0f2;
    text-align:left;
  }
  .legacy-document-icon {
    display:grid;
    place-items:center;
    width:35px;
    height:35px;
    border-radius:10px;
    background:#1d2933;
    color:#ff7b61;
  }
  .legacy-document-row.tool .legacy-document-icon { color:#63adff; }
  .legacy-document-icon .ui-icon { width:18px;height:18px; }
  .legacy-document-row strong,
  .legacy-document-row small { display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
  
  .legacy-document-row small { margin-top:3px;color:#858c92;font-size:7px; }
  .legacy-document-row > b { color:#ff7b61;font-size:9px;white-space:nowrap; }

  .legacy-draft-card {
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:8px;
    padding:10px;
    border:1px solid #2c353d;
    border-radius:12px;
    background:#171e25;
  }
  .legacy-draft-card strong,
  .legacy-draft-card small { display:block; }
  
  .legacy-draft-card small { margin-top:3px;color:#858c92;font-size:7px; }
  .legacy-draft-card > b { color:#ff7b61;font-size:10px; }
  .legacy-draft-actions {
    grid-column:1/-1;
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:6px;
  }
  .legacy-draft-actions button {
    min-height:37px;
    border:1px solid #303940;
    border-radius:9px;
    background:#181f26;
    color:#dbe0e3;
    font-size:8px;
  }
  .legacy-draft-actions button.danger {
    border-color:rgba(255,91,101,.3);
    color:#ff6670;
    background:rgba(255,91,101,.06);
  }
  .legacy-service-empty {
    padding:16px 12px;
    border:1px dashed #303840;
    border-radius:11px;
    color:#858c92;
    font-size:9px;
    text-align:center;
  }

  .legacy-backup-main-actions {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:7px;
    margin-top:12px;
  }
  
  .legacy-backup-grid {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:6px;
    margin-top:8px;
  }
  
  .legacy-backup-grid button:disabled { opacity:.35; }

  .legacy-service-editor-backdrop {
    z-index:140;
    top:0 !important;
    bottom:0 !important;
    padding:0;
    background:#080d11;
  }
  .legacy-service-editor-backdrop .receipt-editor-modal,
  .legacy-service-editor-backdrop .tool-editor-modal {
    width:100%;
    max-width:none;
    min-height:100%;
    margin:0;
    border:0;
    border-radius:0;
    background:#080d11;
    box-shadow:none;
  }
}


/* 0.78.0 · Просмотр заявки как раскрытая карточка из старой мобильной CRM. */
@media screen and (max-width:520px) {
  .legacy-order-detail-backdrop {
    z-index:145;
    top:0 !important;
    bottom:0 !important;
    display:block;
    padding:0;
    overflow-y:auto;
    background:#080d11;
  }
  .legacy-order-detail-modal {
    width:100%;
    max-width:none;
    min-height:100%;
    margin:0;
    padding:0 0 calc(22px + env(safe-area-inset-bottom));
    border:0;
    border-radius:0;
    background:#080d11;
    box-shadow:none;
  }

  .legacy-order-detail-brand {
    position:sticky;
    top:0;
    z-index:5;
    display:grid;
    grid-template-columns:36px 46px minmax(0,1fr) 36px;
    gap:8px;
    align-items:center;
    min-height:88px;
    padding:13px 12px 12px;
    border-bottom:1px solid #1b2228;
    background:rgba(8,13,17,.98);
  }
  .legacy-detail-back,
  .legacy-detail-more {
    display:grid;
    place-items:center;
    width:36px;
    height:36px;
    padding:0;
    border:1px solid #303840;
    border-radius:11px;
    background:#171e25;
    color:#e8ecef;
  }
  .legacy-detail-back {
    font-size:31px;
    font-weight:200;
    line-height:.8;
  }
  .legacy-detail-more .ui-icon { width:18px;height:18px; }
  .legacy-detail-logo {
    display:grid;
    place-items:center;
    width:45px;
    height:45px;
    border:1px solid rgba(255,113,83,.36);
    border-radius:13px;
    color:#ff7153;
  }
  
  .legacy-detail-brand-copy {
    min-width:0;
  }
  .legacy-detail-brand-copy strong,
  .legacy-detail-brand-copy small {
    display:block;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  .legacy-detail-brand-copy strong {
    font-size:15px;
    font-weight:720;
  }
  .legacy-detail-brand-copy strong b {
    color:#ff7153;
    font-weight:720;
  }
  .legacy-detail-brand-copy small {
    margin-top:4px;
    color:#777e84;
    font-size:7px;
    letter-spacing:.11em;
  }

  
  .legacy-expanded-order-card {
    position:relative;
    overflow:hidden;
    padding:14px 13px 12px 16px;
    border:1px solid #2b343c;
    border-radius:15px;
    background:linear-gradient(180deg,#131a20,#10161b);
  }
  .legacy-expanded-accent {
    position:absolute;
    top:0;
    bottom:0;
    left:0;
    width:4px;
    background:#ff7153;
  }
  .legacy-expanded-order-card.closed .legacy-expanded-accent { background:#53d884; }
  .legacy-expanded-order-card.declined .legacy-expanded-accent { background:#ff5d68; }

  .legacy-expanded-head {
    display:flex;
    justify-content:space-between;
    gap:9px;
    align-items:flex-start;
  }
  .legacy-expanded-title {
    min-width:0;
    display:flex;
    gap:8px;
    align-items:baseline;
  }
  .legacy-expanded-title > b {
    color:#ff7153;
    font-size:15px;
    font-weight:800;
    white-space:nowrap;
  }
  .legacy-expanded-title > strong {
    overflow:hidden;
    font-size:15px;
    font-weight:720;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  .legacy-expanded-head-side {
    display:grid;
    justify-items:end;
    gap:6px;
  }
  .legacy-expanded-head-side time {
    color:#80878d;
    font-size:8px;
    white-space:nowrap;
  }
  .legacy-expanded-status {
    padding:5px 9px;
    border:1px solid #914a3a;
    border-radius:9px;
    background:rgba(255,113,83,.08);
    color:#ffab96;
    font-size:9px;
    white-space:nowrap;
  }
  .legacy-expanded-status.closed {
    border-color:#28784b;
    background:rgba(83,216,132,.08);
    color:#67df94;
  }
  .legacy-expanded-status.declined {
    border-color:#7e343c;
    background:rgba(255,93,104,.08);
    color:#ff828a;
  }

  .legacy-expanded-device {
    display:grid;
    grid-template-columns:54px minmax(0,1fr);
    gap:11px;
    align-items:center;
    margin-top:13px;
  }
  .legacy-expanded-device-icon {
    display:grid;
    place-items:center;
    width:53px;
    height:53px;
    border:1px solid rgba(255,113,83,.28);
    border-radius:13px;
    background:rgba(255,113,83,.06);
    color:#ff8268;
  }
  
  .legacy-expanded-device-copy strong,
  .legacy-expanded-device-copy small {
    display:block;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  
  .legacy-expanded-device-copy small { margin-top:4px;color:#858c92;font-size:9px; }

  .legacy-expanded-money {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
    margin-top:12px;
  }
  .legacy-expanded-money > div {
    min-height:65px;
    padding:10px;
    border:1px solid #2c353d;
    border-radius:11px;
    background:#181f26;
  }
  .legacy-expanded-money span {
    display:flex;
    align-items:center;
    gap:4px;
    color:#91989e;
    font-size:7px;
    font-weight:720;
    letter-spacing:.08em;
  }
  .legacy-expanded-money span.net { color:#62d98c; }
  .legacy-expanded-money span.net .ui-icon { width:11px;height:11px; }
  .legacy-expanded-money strong {
    display:block;
    margin-top:7px;
    font-size:17px;
  }

  .legacy-expanded-meta {
    display:flex;
    flex-wrap:wrap;
    gap:7px 12px;
    margin-top:11px;
    padding-top:10px;
    border-top:1px solid #262f36;
    color:#878e94;
    font-size:8px;
  }
  .legacy-expanded-meta > span {
    display:inline-flex;
    align-items:center;
    gap:5px;
    min-width:0;
  }
  .legacy-expanded-meta b {
    overflow:hidden;
    font-weight:500;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  .legacy-expanded-meta .address { color:#ac8be8; }
  .legacy-expanded-meta .ui-icon { width:12px;height:12px;flex:0 0 auto; }
  .legacy-expanded-visit {
    display:flex;
    align-items:center;
    gap:5px;
    margin-top:7px;
    color:#5aa5ee;
    font-size:8px;
  }
  .legacy-expanded-visit .ui-icon { width:13px;height:13px; }

  .legacy-expanded-photos {
    display:flex;
    gap:7px;
    overflow-x:auto;
    margin-top:11px;
    padding-bottom:2px;
  }
  .legacy-expanded-photo {
    width:58px;
    height:58px;
    flex:0 0 58px;
    overflow:hidden;
    padding:0;
    border:1px solid #394149;
    border-radius:11px;
    background:#181f26;
  }
  .legacy-expanded-photo img {
    display:block;
    width:100%;
    height:100%;
    object-fit:cover;
  }

  
  .legacy-expanded-actions > * {
    display:grid;
    place-items:center;
    align-content:center;
    gap:4px;
    min-height:55px;
    padding:5px 2px;
    border:1px solid #303940;
    border-radius:10px;
    background:#181f26;
    color:#899198;
    font-size:7px;
    text-decoration:none;
  }
  .legacy-expanded-actions .ui-icon { width:18px;height:18px;color:#ff7153; }
  .legacy-expanded-actions .action-toggle .ui-icon { color:#55d686; }
  .legacy-expanded-actions .copy .ui-icon { color:#e0ae45; }
  .legacy-expanded-actions .phone .ui-icon { color:#4fa7ff; }
  .legacy-expanded-actions .telegram .ui-icon { color:#38b9ff; }
  .legacy-expanded-actions .delete {
    grid-column:1;
  }
  .legacy-expanded-actions .delete .ui-icon { color:#ff5f69; }
  .legacy-expanded-actions > [disabled] { opacity:.4; }

  
  .legacy-detail-section-head {
    display:grid;
    grid-template-columns:30px minmax(0,1fr) auto;
    gap:8px;
    align-items:center;
  }
  .legacy-detail-section-head > span {
    display:grid;
    place-items:center;
    width:29px;
    height:29px;
    border-radius:9px;
    background:#1c252c;
    color:#ff795d;
  }
  .legacy-detail-section-head > span .ui-icon { width:16px;height:16px; }
  .legacy-detail-section-head h3 {
    margin:0;
    font-size:12px;
  }
  .legacy-detail-section-head > b {
    color:#ff795d;
    font-size:10px;
    white-space:nowrap;
  }
  .legacy-detail-lines {
    margin-top:7px;
  }
  .legacy-detail-lines > div {
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:8px;
    align-items:center;
    min-height:45px;
    border-top:1px solid #283139;
  }
  .legacy-detail-lines strong,
  .legacy-detail-lines small {
    display:block;
  }
  
  .legacy-detail-lines small { margin-top:2px;color:#858c92;font-size:7px; }
  .legacy-detail-lines > div > b { font-size:9px;white-space:nowrap; }

  .legacy-detail-notes > div:not(.legacy-detail-section-head) {
    margin-top:9px;
    padding-top:8px;
    border-top:1px solid #283139;
  }
  .legacy-detail-notes > div > span {
    color:#8f969c;
    font-size:7px;
    font-weight:720;
    letter-spacing:.07em;
  }
  .legacy-detail-notes p {
    margin:4px 0 0;
    color:#d6dade;
    font-size:9px;
    line-height:1.4;
  }
  .legacy-detail-empty {
    margin:8px 0 0;
    color:#858c92;
    font-size:8px;
  }

  .legacy-detail-total-row {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-top:10px;
    padding:13px 12px;
    border:1px solid #2b343c;
    border-radius:12px;
    background:#171e25;
  }
  .legacy-detail-total-row span {
    color:#979ea4;
    font-size:9px;
  }
  .legacy-detail-total-row strong {
    color:#ff7153;
    font-size:18px;
  }
}

@media screen and (max-width:370px) {
  
  .legacy-expanded-actions .telegram {
    grid-column:auto;
  }
}


/* 0.79.0 · Верх склада и редактор позиции по архивным мобильным скриншотам. */
@media screen and (max-width:520px) {
  .legacy-warehouse-page {
    padding: 15px 9px 20px;
  }
  .legacy-warehouse-head {
    margin: 0 2px 13px;
  }
  
  

  .legacy-warehouse-search {
    margin:0 0 9px;
  }
  .legacy-warehouse-search .search {
    min-height:47px;
    padding-left:45px;
    border:1px solid #2d363e;
    border-radius:13px;
    background:#181f26;
    color:#edf0f2;
    font-size:11px;
  }
  .legacy-warehouse-search > .ui-icon {
    left:15px;
    width:20px;
    height:20px;
    color:#9aa2a9;
  }
  .legacy-warehouse-search .search::placeholder { color:#606970; }

  .legacy-warehouse-filter {
    position:relative;
    margin-bottom:9px;
  }
  .legacy-warehouse-filter .field {
    width:100%;
    min-height:45px;
    padding:0 39px 0 13px;
    appearance:none;
    border:1px solid #2d363e;
    border-radius:11px;
    background:#181f26;
    color:#e9ecee;
    font-size:11px;
  }
  .legacy-warehouse-filter > span {
    position:absolute;
    top:50%;
    right:13px;
    display:grid;
    transform:translateY(-50%);
    color:#a3abb1;
    pointer-events:none;
  }
  .legacy-warehouse-filter .ui-icon { width:14px;height:14px; }

  
  

  .stock-editor-backdrop {
    z-index:95;
    top:96px !important;
    bottom:calc(68px + env(safe-area-inset-bottom)) !important;
    align-items:stretch;
    padding:0 9px 8px;
    overflow:auto;
    background:#080d11;
  }
  .stock-editor-modal {
    width:100%;
    max-width:none;
    min-height:auto;
    margin:0;
    padding:12px 12px 14px;
    border:1px solid #2b343c;
    border-radius:14px;
    background:linear-gradient(180deg,#131a20,#10161b);
    box-shadow:none;
  }
  .stock-editor-head {
    position:static;
    display:grid;
    grid-template-columns:38px minmax(0,1fr) 34px;
    gap:9px;
    align-items:center;
    min-height:48px;
    margin:0 0 6px;
    padding:0;
    border:0;
    background:transparent;
  }
  .stock-editor-title-icon {
    display:grid;
    place-items:center;
    width:37px;
    height:37px;
    border:1px solid rgba(255,113,83,.3);
    border-radius:11px;
    background:rgba(255,113,83,.08);
    color:#ff795e;
  }
  .stock-editor-title-icon .ui-icon { width:20px;height:20px; }
  
  
  
  
  
  
  
  
  
  .stock-editor-compat label,
  .stock-editor-toggle {
    min-height:42px;
    padding:7px 9px;
    border-color:#303940;
    border-radius:10px;
    background:#181f26;
  }
  .stock-editor-compat b,
  .stock-editor-toggle b { font-size:9px; }
  .stock-editor-modal .modal-actions {
    position:sticky;
    bottom:-14px;
    margin:13px -12px -14px;
    padding:8px 12px 9px;
    border-top:1px solid #283139;
    background:rgba(16,22,27,.98);
  }
  .stock-editor-modal .modal-actions button {
    min-height:42px;
    border-radius:10px;
    font-size:9px;
  }
  .stock-editor-modal .modal-actions .primary-button {
    border-color:#ff7153;
    background:#ff7153;
    color:#17110f;
  }
}


/* 0.80.0 · Каталог материалов по архивному экрану "Каталог · Холодильники". */
@media screen and (max-width:520px) {
  .material-catalog-open {
    width:100%;
    margin:0 0 9px;
    appearance:none;
  }
  .material-catalog-backdrop {
    z-index:150;
    top:0 !important;
    bottom:0 !important;
    display:flex;
    align-items:flex-start;
    padding:100px 0 calc(58px + env(safe-area-inset-bottom));
    overflow:hidden;
    background:rgba(0,0,0,.72);
  }
  .material-catalog-modal {
    position:relative;
    display:flex;
    flex-direction:column;
    width:100%;
    max-height:calc(100vh - 122px - env(safe-area-inset-bottom));
    padding:20px 17px 14px;
    border:1px solid #242c32;
    border-radius:22px 22px 0 0;
    background:#12191f;
    box-shadow:0 -18px 50px rgba(0,0,0,.38);
  }
  .material-catalog-head {
    display:flex;
    align-items:center;
    gap:9px;
    min-height:42px;
    margin-bottom:10px;
  }
  
  
  .material-catalog-head strong {
    color:#ff7153;
    font-size:17px;
    font-weight:720;
  }
  
  .material-catalog-search .search {
    min-height:54px;
    padding-left:49px;
    border:1px solid #ff7153;
    border-radius:15px;
    background:#181f26;
    color:#eef0f2;
    font-size:12px;
    box-shadow:0 0 0 2px rgba(255,113,83,.09);
  }
  .material-catalog-search > .ui-icon {
    left:17px;
    width:22px;
    height:22px;
    color:#9ca4aa;
  }
  .material-catalog-list {
    flex:1;
    min-height:0;
    overflow-y:auto;
    padding:0 1px 10px;
  }
  .material-catalog-group {
    margin-bottom:13px;
  }
  
  
  
  
  
  .material-catalog-row strong {
    font-size:12px;
    font-weight:680;
  }
  
  .material-catalog-row b {
    color:#ff7153;
    font-size:11px;
    font-weight:760;
    white-space:nowrap;
  }
  
  .material-catalog-close {
    flex:0 0 auto;
    width:100%;
    min-height:50px;
    margin-top:4px;
    border:1px solid #343c43;
    border-radius:12px;
    background:#181f26;
    color:#eef0f2;
    font-size:11px;
    font-weight:680;
  }
}


/* 0.82.0 · Складские действия, меню заявки и свой период без системных окон. */
@media screen and (max-width:520px) {
  .stock-detail-backdrop {
    z-index:96;
    top:96px !important;
    bottom:calc(68px + env(safe-area-inset-bottom)) !important;
    padding:0 9px 8px;
    overflow:auto;
    background:#080d11;
  }
  .stock-detail-modal {
    min-height:auto;
    padding:12px;
    border:1px solid #2b343c;
    border-radius:14px;
    background:linear-gradient(180deg,#131a20,#10161b);
  }
  .stock-detail-head {
    position:static;
    min-height:46px;
    padding:0 0 8px;
    border-bottom:1px solid #283139;
    background:transparent;
  }
  .stock-detail-head button {
    border:1px solid #303940;
    background:#181f26;
  }
  
  .stock-detail-hero {
    border-color:#2d363e;
    background:#171e25;
  }
  .stock-detail-icon {
    border:1px solid rgba(255,113,83,.26);
    background:rgba(255,113,83,.07);
    color:#ff8066;
  }
  .stock-detail-kpis > div,
  .stock-detail-actions button {
    border-color:#2d363e;
    background:#171e25;
  }
  .stock-detail-actions button:first-child > span { color:#58d889; }
  .stock-detail-actions button:nth-child(2) > span { color:#ffbd58; }
  

  .stock-adjust-backdrop {
    z-index:155;
    top:0 !important;
    bottom:0 !important;
    display:flex;
    align-items:flex-end;
    padding:0;
    background:rgba(0,0,0,.72);
  }
  .stock-adjust-modal {
    width:100%;
    max-width:none;
    margin:0;
    padding:14px 13px calc(14px + env(safe-area-inset-bottom));
    border:1px solid #2b343c;
    border-radius:18px 18px 0 0;
    background:#12191f;
    box-shadow:0 -18px 50px rgba(0,0,0,.38);
  }
  .stock-adjust-head {
    display:grid;
    grid-template-columns:38px minmax(0,1fr) 34px;
    gap:9px;
    align-items:center;
    margin-bottom:12px;
  }
  .stock-adjust-icon {
    display:grid;
    place-items:center;
    width:37px;
    height:37px;
    border-radius:11px;
    font-size:25px;
    font-weight:300;
  }
  .stock-adjust-icon.incoming {
    border:1px solid rgba(88,216,137,.35);
    background:rgba(88,216,137,.09);
    color:#58d889;
  }
  .stock-adjust-icon.outgoing {
    border:1px solid rgba(255,189,88,.35);
    background:rgba(255,189,88,.08);
    color:#ffbd58;
  }
  .stock-adjust-head strong,
  .stock-adjust-head small { display:block; }
  .stock-adjust-head strong { font-size:14px; }
  .stock-adjust-head small { margin-top:3px;color:#858c92;font-size:8px; }
  .stock-adjust-head > button {
    width:34px;
    height:34px;
    padding:0;
    border:1px solid #303940;
    border-radius:10px;
    background:#181f26;
    color:#e9ecee;
    font-size:21px;
  }
  .stock-adjust-balance,
  .stock-adjust-preview {
    display:flex;
    justify-content:space-between;
    gap:10px;
    align-items:center;
    min-height:48px;
    padding:9px 10px;
    border:1px solid #2d363e;
    border-radius:11px;
    background:#171e25;
  }
  .stock-adjust-balance span,
  .stock-adjust-preview span,
  .stock-adjust-field > span {
    color:#8e969c;
    font-size:7px;
    font-weight:720;
    letter-spacing:.07em;
  }
  .stock-adjust-balance strong,
  .stock-adjust-preview strong { font-size:12px; }
  .stock-adjust-field {
    display:block;
    margin:9px 0;
  }
  .stock-adjust-field > span {
    display:block;
    margin:0 0 5px 2px;
  }
  .stock-adjust-field .field {
    min-height:52px;
    border:1px solid #ff7153;
    border-radius:12px;
    background:#181f26;
    color:#eef0f2;
    font-size:17px;
    font-weight:720;
    text-align:center;
  }
  .stock-adjust-actions {
    display:grid;
    grid-template-columns:.8fr 1.2fr;
    gap:7px;
    margin-top:10px;
  }
  .stock-adjust-actions button {
    min-height:45px;
    border-radius:11px;
    font-size:10px;
    font-weight:700;
  }
  .stock-adjust-confirm.incoming {
    border:1px solid #58d889;
    background:#58d889;
    color:#0b1710;
  }
  .stock-adjust-confirm.outgoing {
    border:1px solid #ffbd58;
    background:#ffbd58;
    color:#17120a;
  }

  .legacy-order-actions-backdrop {
    z-index:155;
    top:0 !important;
    bottom:0 !important;
    display:flex;
    align-items:flex-end;
    padding:0;
    background:rgba(0,0,0,.72);
  }
  .legacy-order-actions-backdrop .order-actions-sheet {
    width:100%;
    margin:0;
    padding:14px 13px calc(14px + env(safe-area-inset-bottom));
    border:1px solid #2b343c;
    border-radius:18px 18px 0 0;
    background:#12191f;
  }
  .legacy-order-actions-backdrop .order-actions-head {
    min-height:43px;
    margin-bottom:10px;
  }
  .legacy-order-actions-backdrop .order-actions-head strong {
    color:#ff8066;
    font-size:14px;
  }
  .legacy-order-actions-backdrop .order-actions-head small {
    margin-top:3px;
    color:#858c92;
    font-size:8px;
  }
  .legacy-order-actions-backdrop .order-actions-close {
    width:34px;
    height:34px;
    border:1px solid #303940;
    border-radius:10px;
    background:#181f26;
  }
  .legacy-order-actions-backdrop .order-actions-grid {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:7px;
  }
  .legacy-order-actions-backdrop .order-actions-grid button,
  .legacy-order-actions-backdrop .order-actions-grid a {
    min-height:54px;
    border:1px solid #303940;
    border-radius:11px;
    background:#181f26;
  }
  .legacy-order-actions-backdrop .order-actions-grid .ui-icon {
    color:#ff7153;
  }

  .legacy-analytics-range-backdrop {
    z-index:155;
    top:0 !important;
    bottom:0 !important;
    display:flex;
    align-items:flex-end;
    padding:0;
    background:rgba(0,0,0,.72);
  }
  .legacy-analytics-range-modal {
    width:100%;
    max-width:none;
    margin:0;
    padding:14px 13px calc(14px + env(safe-area-inset-bottom));
    border:1px solid #2b343c;
    border-radius:18px 18px 0 0;
    background:#12191f;
    box-shadow:0 -18px 50px rgba(0,0,0,.38);
  }
  .legacy-range-head {
    display:grid;
    grid-template-columns:38px minmax(0,1fr) 34px;
    gap:9px;
    align-items:center;
    margin-bottom:12px;
  }
  .legacy-range-icon {
    display:grid;
    place-items:center;
    width:37px;
    height:37px;
    border:1px solid rgba(255,113,83,.3);
    border-radius:11px;
    background:rgba(255,113,83,.08);
    color:#ff8066;
  }
  .legacy-range-icon .ui-icon { width:20px;height:20px; }
  .legacy-range-head strong,
  .legacy-range-head small { display:block; }
  .legacy-range-head strong { font-size:14px; }
  .legacy-range-head small { margin-top:3px;color:#858c92;font-size:8px; }
  .legacy-range-head button {
    width:34px;
    height:34px;
    padding:0;
    border:1px solid #303940;
    border-radius:10px;
    background:#181f26;
    color:#e9ecee;
    font-size:21px;
  }
  .legacy-range-grid {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:7px;
  }
  .legacy-range-grid label > span {
    display:block;
    margin:0 0 5px 2px;
    color:#8e969c;
    font-size:7px;
    font-weight:720;
    letter-spacing:.07em;
  }
  .legacy-range-grid .field {
    min-height:49px;
    border:1px solid #303940;
    border-radius:11px;
    background:#181f26;
    color:#eef0f2;
    font-size:10px;
  }
  .legacy-range-actions {
    display:grid;
    grid-template-columns:.8fr 1.2fr;
    gap:7px;
    margin-top:10px;
  }
  .legacy-range-actions button {
    min-height:45px;
    border-radius:11px;
    font-size:10px;
  }
}


/* 0.83.0 · История движения и список покупок в стиле архивного склада. */
@media screen and (max-width:520px) {
  
  .warehouse-support-content .support-page-head,
  .shopping-content .support-page-head {
    display:grid;
    grid-template-columns:46px minmax(0,1fr);
    gap:11px;
    align-items:center;
    min-height:auto;
    margin:0 1px 13px;
    padding:0;
    border:0;
    background:transparent;
  }
  .warehouse-support-content .support-page-head h1,
  .shopping-content .support-page-head h1 {
    margin:0;
    font-size:21px;
    line-height:1.08;
    font-weight:720;
  }
  .warehouse-support-content .support-page-head p,
  .shopping-content .support-page-head p {
    margin:4px 0 0;
    color:#848c92;
    font-size:9px;
  }
  .warehouse-support-content .support-back,
  .shopping-content .support-back {
    width:45px;
    height:45px;
    border:1px solid #303940;
    border-radius:13px;
    background:#181f26;
    color:#eef0f2;
    font-size:34px;
    font-weight:200;
  }

  
  
  .movement-filter-chips button span {
    min-width:19px;
    height:19px;
    margin-left:3px;
    border-radius:6px;
    background:#1d252c;
    color:#c9ced2;
    font-size:7px;
  }
  .movement-filter-chips button.active {
    border-color:#ff7153;
    background:rgba(255,113,83,.1);
    color:#f0ecea;
  }
  .movement-filter-chips button.active span {
    background:rgba(255,113,83,.15);
    color:#ff8a70;
  }

  
  
  
  
  
  
  

  
  
  .shopping-page-actions .secondary-button {
    border:1px solid #303940;
    background:#181f26;
    color:#e9ecee;
  }
  .shopping-page-actions .primary-button {
    border-color:#ff7153;
    background:#ff7153;
    color:#17110f;
  }

  .shopping-content .client-list {
    display:grid;
    gap:7px;
  }
  .shopping-content .legacy-shopping-card {
    position:relative;
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:10px;
    align-items:center;
    min-height:72px;
    margin:0;
    padding:11px 12px 11px 15px;
    overflow:hidden;
    border:1px solid #2b343c;
    border-radius:13px;
    background:linear-gradient(180deg,#151c22,#12181e);
  }
  .shopping-content .legacy-shopping-card::before {
    content:"";
    position:absolute;
    inset:0 auto 0 0;
    width:3px;
    background:#e7b34b;
  }
  .shopping-content .stock-name {
    font-size:11px;
    font-weight:680;
  }
  .shopping-content .legacy-shopping-card .small {
    margin-top:4px;
    color:#858d94;
    font-size:8px;
  }
  
  

  .warehouse-support-empty,
  .shopping-content .empty {
    border:1px dashed #303840;
    border-radius:12px;
    background:#11171d;
  }
}


/* 0.84.0 · Исправление мобильных модалок: один scroll-контейнер, без прокрутки фона. */
html.modal-open,
body.modal-open {
  width: 100%;
  height: 100%;
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

body.modal-open {
  position: fixed !important;
  right: 0;
  left: 0;
}

body.modal-open .bottom-nav {
  visibility: hidden !important;
  pointer-events: none !important;
}

body.modal-open .shell {
  pointer-events: none;
}

body.modal-open > .modal-backdrop {
  pointer-events: auto;
}

@media screen and (max-width: 520px) {
  .order-editor-backdrop,
  .stock-editor-backdrop,
  .legacy-goods-editor-backdrop,
  .legacy-price-editor-backdrop,
  .legacy-finance-entry-backdrop,
  .legacy-service-editor-backdrop,
  .legacy-client-profile-backdrop,
  .legacy-order-detail-backdrop,
  .stock-detail-backdrop {
    position: fixed !important;
    inset: 0 !important;
    z-index: 300 !important;
    display: flex !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    padding: 0 !important;
    overflow: hidden !important;
    overscroll-behavior: none !important;
    background: #080d11 !important;
  }

  .order-editor-modal,
  .stock-editor-modal,
  .legacy-goods-editor,
  .legacy-price-editor,
  .legacy-finance-entry-backdrop .finance-entry-modal,
  .legacy-service-editor-backdrop .receipt-editor-modal,
  .legacy-service-editor-backdrop .tool-editor-modal,
  .legacy-client-profile-backdrop .client-profile-modal,
  .legacy-order-detail-modal,
  .stock-detail-modal {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: none !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    min-height: 0 !important;
    margin: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain !important;
    -webkit-overflow-scrolling: touch;
    border-radius: 0 !important;
    touch-action: pan-y;
  }

  .order-editor-modal,
  .stock-editor-modal {
    padding-bottom: 0 !important;
  }

  .order-editor-head,
  .stock-editor-head,
  .goods-modal-head,
  .legacy-price-editor .legacy-editor-head,
  .legacy-finance-entry-backdrop .finance-entry-head,
  .legacy-service-editor-backdrop .receipt-editor-head,
  .legacy-service-editor-backdrop .tool-editor-head {
    position: sticky !important;
    top: 0 !important;
    z-index: 25 !important;
  }

  .order-editor-modal .modal-actions,
  .stock-editor-modal .modal-actions,
  .legacy-finance-entry-backdrop .modal-actions,
  .legacy-service-editor-backdrop .modal-actions {
    position: sticky !important;
    bottom: 0 !important;
    z-index: 30 !important;
    margin-bottom: 0 !important;
    padding-bottom: calc(10px + env(safe-area-inset-bottom)) !important;
    background: rgba(8,13,17,.985) !important;
    box-shadow: 0 -12px 28px rgba(0,0,0,.28);
  }

  .order-editor-modal .modal-actions {
    margin: 16px -12px 0 !important;
    padding: 9px 12px calc(9px + env(safe-area-inset-bottom)) !important;
  }

  .stock-editor-modal .modal-actions {
    margin: 14px -12px 0 !important;
    padding: 9px 12px calc(9px + env(safe-area-inset-bottom)) !important;
  }

  .legacy-finance-entry-backdrop .modal-actions {
    margin: 14px -12px 0 !important;
  }

  .legacy-goods-savebar,
  .legacy-price-editor-actions {
    position: sticky !important;
    bottom: 0 !important;
    z-index: 30 !important;
    margin-bottom: 0 !important;
    background: rgba(8,13,17,.985) !important;
    box-shadow: 0 -12px 28px rgba(0,0,0,.28);
  }

  .legacy-goods-savebar {
    margin: 12px -8px 0 !important;
    padding: 9px 8px calc(9px + env(safe-area-inset-bottom)) !important;
  }

  .legacy-price-editor-actions {
    margin: 12px -8px 0 !important;
    padding: 9px 8px calc(9px + env(safe-area-inset-bottom)) !important;
  }

  .order-editor-modal .modal-actions > *,
  .stock-editor-modal .modal-actions > *,
  .legacy-goods-savebar > *,
  .legacy-price-editor-actions > *,
  .legacy-finance-entry-backdrop .modal-actions > *,
  .legacy-service-editor-backdrop .modal-actions > * {
    position: relative;
    z-index: 31;
    pointer-events: auto !important;
    min-height: 48px !important;
  }

  .order-editor-modal,
  .stock-editor-modal,
  .legacy-goods-editor,
  .legacy-price-editor {
    scroll-padding-top: 72px;
    scroll-padding-bottom: 88px;
  }

  .order-editor-modal input,
  .order-editor-modal select,
  .order-editor-modal textarea,
  .stock-editor-modal input,
  .stock-editor-modal select,
  .legacy-goods-editor input,
  .legacy-goods-editor select,
  .legacy-price-editor input,
  .legacy-price-editor select,
  .legacy-price-editor textarea {
    scroll-margin-top: 82px !important;
    scroll-margin-bottom: 96px !important;
  }
}


/* 0.84.2 · Мобильные модалки: действия всегда на экране, фон не прокручивается. */
html.modal-open,
body.modal-open {
  overscroll-behavior: none !important;
}

@media screen and (max-width: 520px) {
  body.modal-open > .modal-backdrop {
    inset: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
  }

  .order-editor-modal,
  .stock-editor-modal,
  .legacy-goods-editor,
  .legacy-price-editor,
  .legacy-finance-entry-backdrop .finance-entry-modal,
  .legacy-service-editor-backdrop .receipt-editor-modal,
  .legacy-service-editor-backdrop .tool-editor-modal {
    height: 100dvh !important;
    max-height: 100dvh !important;
    padding-bottom: calc(92px + env(safe-area-inset-bottom)) !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain !important;
    scroll-padding-bottom: 116px !important;
  }

  .order-editor-modal .modal-actions,
  .stock-editor-modal .modal-actions,
  .legacy-finance-entry-backdrop .modal-actions,
  .legacy-service-editor-backdrop .modal-actions,
  .legacy-goods-savebar,
  .legacy-price-editor-actions {
    position: fixed !important;
    z-index: 340 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 520px !important;
    margin: 0 auto !important;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom)) !important;
    border-top: 1px solid #283139 !important;
    background: rgba(8,13,17,.985) !important;
    box-shadow: 0 -10px 26px rgba(0,0,0,.34) !important;
  }

  .order-editor-modal .modal-actions {
    display: grid !important;
    grid-template-columns: .9fr .9fr 1.2fr !important;
    gap: 6px !important;
  }

  .stock-editor-modal .modal-actions {
    display: grid !important;
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    gap: 7px !important;
  }

  .legacy-goods-savebar {
    display: grid !important;
    grid-template-columns: minmax(0,1fr) minmax(0,1.2fr) !important;
    gap: 7px !important;
  }

  

  .legacy-price-editor-actions {
    display: grid !important;
    grid-template-columns: auto minmax(0,1fr) minmax(0,1.2fr) !important;
    gap: 7px !important;
  }

  

  .order-editor-modal .modal-actions > *,
  .stock-editor-modal .modal-actions > *,
  .legacy-finance-entry-backdrop .modal-actions > *,
  .legacy-service-editor-backdrop .modal-actions > *,
  .legacy-goods-savebar > *,
  .legacy-price-editor-actions > * {
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 44px !important;
    padding-right: 7px !important;
    padding-left: 7px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .legacy-goods-cancel {
    border: 1px solid #343d45 !important;
    background: #181f26 !important;
    color: #e9edef !important;
    border-radius: 11px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
  }
}


/* 0.84.3 · Единая мобильная механика каталогов и нижних шторок. */
@media screen and (max-width: 520px) {
  .catalog-modal-backdrop,
  .material-catalog-backdrop {
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    padding: 0 !important;
    overflow: hidden !important;
    align-items: stretch !important;
    background: #080d11 !important;
  }

  .catalog-modal,
  .material-catalog-modal {
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: none !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    padding: 0 12px !important;
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #0b1014 !important;
  }

  .catalog-modal-head,
  .material-catalog-head {
    position: sticky !important;
    top: 0 !important;
    z-index: 5 !important;
    flex: 0 0 auto !important;
    box-sizing: border-box !important;
    min-height: 58px !important;
    margin: 0 -12px 8px !important;
    padding: 10px 12px !important;
    border-bottom: 1px solid #232c33 !important;
    background: rgba(11,16,20,.985) !important;
  }

  .material-catalog-head {
    display: grid !important;
    grid-template-columns: 32px minmax(0,1fr) 36px !important;
  }

  .material-catalog-head-close {
    display: grid !important;
    place-items: center !important;
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    border: 1px solid #303940 !important;
    border-radius: 11px !important;
    background: #181f26 !important;
    color: #e9ecee !important;
    font-size: 22px !important;
  }

  .catalog-search-row,
  .material-catalog-search {
    flex: 0 0 auto !important;
    margin-bottom: 8px !important;
  }

  .catalog-service-list,
  .material-catalog-list {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 12px !important;
  }

  .catalog-fit-summary {
    position: static !important;
    flex: 0 0 auto !important;
    margin: 4px 0 7px !important;
  }

  .catalog-modal-actions {
    position: static !important;
    flex: 0 0 auto !important;
    display: grid !important;
    grid-template-columns: .8fr 1.2fr !important;
    gap: 7px !important;
    margin: 0 -12px !important;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom)) !important;
    border-top: 1px solid #283139 !important;
    background: rgba(8,13,17,.985) !important;
  }

  .catalog-modal-actions button {
    min-height: 45px !important;
    min-width: 0 !important;
    border-radius: 11px !important;
    font-size: 10px !important;
  }

  .material-catalog-close {
    flex: 0 0 auto !important;
    min-height: 48px !important;
    margin: 0 -12px !important;
    padding-bottom: env(safe-area-inset-bottom) !important;
    border-radius: 0 !important;
  }

  .stock-adjust-modal,
  .legacy-analytics-range-modal,
  .legacy-order-actions-backdrop .order-actions-sheet {
    max-height: calc(100dvh - 12px) !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain !important;
  }
}


/* 0.84.4 · Верхняя модалка всегда активна, нижние слои не перехватывают жесты. */
.modal-backdrop.modal-underlay {
  pointer-events: none !important;
}

@media screen and (max-width: 520px) {
  

  .catalog-modal-head,
  .material-catalog-head {
    min-height: calc(58px + env(safe-area-inset-top)) !important;
    padding-top: calc(10px + env(safe-area-inset-top)) !important;
  }

  .stock-adjust-backdrop,
  .legacy-analytics-range-backdrop,
  .legacy-order-actions-backdrop {
    z-index: 410 !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
    overscroll-behavior: none !important;
  }

  .stock-adjust-modal,
  .legacy-analytics-range-modal,
  .legacy-order-actions-backdrop .order-actions-sheet {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 520px !important;
    max-height: calc(100dvh - env(safe-area-inset-top)) !important;
    margin: 0 auto !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain !important;
    -webkit-overflow-scrolling: touch;
  }

  .legacy-order-actions-backdrop .order-actions-grid button,
  .legacy-order-actions-backdrop .order-actions-grid a {
    box-sizing: border-box !important;
    min-width: 0 !important;
    overflow: hidden !important;
    padding: 8px !important;
  }

  .legacy-order-actions-backdrop .order-actions-grid .ui-icon {
    width: 22px !important;
    height: 22px !important;
    flex: 0 0 22px !important;
  }

  .legacy-order-actions-backdrop .order-actions-grid b {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .order-actions-cancel {
    width: 100% !important;
    min-height: 46px !important;
    margin-top: 8px !important;
    border: 1px solid #343d45 !important;
    border-radius: 11px !important;
    background: #181f26 !important;
    color: #e9edef !important;
    font-size: 10px !important;
    font-weight: 700 !important;
  }
}


/* 0.84.5 · Компактные системные окна не обрезаются на мобильном. */
@media screen and (max-width: 520px) {
  body.modal-open > .modal-backdrop > .compact-modal {
    box-sizing: border-box !important;
    width: calc(100% - 20px) !important;
    max-width: 520px !important;
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 20px) !important;
    margin: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom)) !important;
    padding: 16px 14px 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain !important;
    -webkit-overflow-scrolling: touch;
    border-radius: 18px !important;
    background: #11181d !important;
  }

  body.modal-open > .modal-backdrop:has(> .compact-modal) {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    background: rgba(3,7,10,.92) !important;
  }

  .compact-modal .modal-actions {
    position: sticky !important;
    bottom: 0 !important;
    z-index: 20 !important;
    display: grid !important;
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    gap: 7px !important;
    margin: 14px -14px 0 !important;
    padding: 8px 14px calc(8px + env(safe-area-inset-bottom)) !important;
    border-top: 1px solid #283139 !important;
    background: rgba(17,24,29,.985) !important;
    box-shadow: 0 -10px 24px rgba(0,0,0,.3) !important;
  }

  .compact-modal .modal-actions > * {
    min-width: 0 !important;
    min-height: 44px !important;
    padding: 7px 8px !important;
    overflow: hidden !important;
    border-radius: 11px !important;
    font-size: 10px !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .compact-modal .modal-actions > :only-child {
    grid-column: 1 / -1 !important;
  }

  .compact-modal .modal-actions > :nth-child(3):last-child {
    grid-column: 1 / -1 !important;
  }

  .compact-modal .goods-sheet {
    min-width: 0 !important;
  }

  .compact-modal .goods-sheet small {
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    white-space: normal !important;
  }
}


/* 0.84.6 · Закреплённые шапки и safe-area полноэкранных карточек. */
@media screen and (max-width: 520px) {
  .order-editor-head,
  .stock-editor-head,
  .goods-modal-head,
  .legacy-price-editor .legacy-editor-head,
  .legacy-finance-entry-backdrop .finance-entry-head,
  .legacy-service-editor-backdrop .receipt-editor-head,
  .legacy-service-editor-backdrop .tool-editor-head,
  .legacy-client-profile-backdrop .client-profile-head {
    box-sizing: border-box !important;
    padding-top: calc(9px + env(safe-area-inset-top)) !important;
    min-height: calc(61px + env(safe-area-inset-top)) !important;
  }

  .legacy-order-detail-brand {
    box-sizing: border-box !important;
    min-height: calc(88px + env(safe-area-inset-top)) !important;
    padding-top: calc(13px + env(safe-area-inset-top)) !important;
  }

  .stock-detail-head {
    position: sticky !important;
    top: 0 !important;
    z-index: 25 !important;
    box-sizing: border-box !important;
    min-height: calc(58px + env(safe-area-inset-top)) !important;
    margin: -12px -12px 10px !important;
    padding: calc(9px + env(safe-area-inset-top)) 12px 9px !important;
    border-bottom: 1px solid #283139 !important;
    background: rgba(8,13,17,.985) !important;
    box-shadow: 0 8px 20px rgba(0,0,0,.18) !important;
  }

  .stock-detail-content {
    padding-top: 0 !important;
    padding-bottom: calc(16px + env(safe-area-inset-bottom)) !important;
  }

  .legacy-client-profile-backdrop .client-profile-content,
  .legacy-order-detail-content {
    padding-bottom: calc(28px + env(safe-area-inset-bottom)) !important;
  }
}


/* 0.99.1 · A4 печать акта изолирована от мобильной геометрии. */
@media print {
  @page {
    size: A4 portrait;
    margin: 7mm 10mm;
  }

  html,
  body {
    width: 210mm !important;
    min-width: 210mm !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  .legacy-act-preview {
    overflow: visible !important;
    border: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  .legacy-act-preview .act-sheet,
  .act-sheet {
    box-sizing: border-box !important;
    width: 190mm !important;
    min-width: 190mm !important;
    max-width: 190mm !important;
    height: 277mm !important;
    min-height: 277mm !important;
    margin: 0 auto !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
    color: #000 !important;
    zoom: var(--act-print-zoom, 1) !important;
  }

  .act-work-table {
    table-layout: fixed !important;
  }

  .act-work-table thead {
    display: table-header-group;
  }

  .act-work-table tr,
  .act-work-table th,
  .act-work-table td,
  .act-totals > div,
  .act-signatures {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
}


/* 1.0.40 · Акт по утверждённому образцу: 5 колонок, гарантия отдельным блоком. */
.act-work-table th:nth-child(1),
.act-work-table td:nth-child(1) { width: 6%; }
.act-work-table th:nth-child(2),
.act-work-table td:nth-child(2) { width: 51%; }
.act-work-table th:nth-child(3),
.act-work-table td:nth-child(3) { width: 16%; }
.act-work-table th:nth-child(4),
.act-work-table td:nth-child(4) { width: 10%; }
.act-work-table th:nth-child(5),
.act-work-table td:nth-child(5) { width: 17%; }

.act-guarantee {
  display: grid;
  gap: 3px;
  margin-top: 9px;
  padding: 7px 9px;
  border: 1px solid #111;
  font-size: 12px;
  line-height: 1.25;
}
.act-guarantee b { font-size: 12px; }
.act-guarantee span { font-size: 11px; }

.legacy-act-control-actions.single {
  grid-template-columns: minmax(0,1fr);
}
.legacy-act-control-actions.single > button {
  width: 100%;
}

@media (max-width: 520px) {
  .act-guarantee {
    margin-top: 6px;
    padding: 5px 6px;
    font-size: 8.5px;
  }
  .act-guarantee b,
  .act-guarantee span {
    font-size: 8.5px;
  }
}
