:root {
  color-scheme: light;
  --ink: #191b1f;
  --muted: #69707a;
  --line: #dfe3e8;
  --paper: #fcfcfc;
  --panel: #ffffff;
  --field: #ffffff;
  --brand: #1d2b44;
  --accent: #d4af37;
  --good: #126b45;
  --warn: #9b620b;
  --bad: #aa2434;
  --shadow: 0 14px 34px rgba(29, 43, 68, .08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(29, 43, 68, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 43, 68, .035) 1px, transparent 1px),
    var(--paper);
  background-size: 24px 24px;
  font: 14px/1.35 "Montserrat", "Avenir Next", "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px;
}

.login-card {
  width: 340px;
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 0 0 18px;
  color: var(--brand);
  font-size: 22px;
  letter-spacing: 0;
}

.login-card p {
  margin: 0 0 24px;
  color: var(--muted);
}

.field-stack {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--field);
}

input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-content: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  border: 1px solid #c7ccd4;
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
}

input[type="checkbox"]::before {
  content: "";
  width: 8px;
  height: 4px;
  border: solid var(--accent);
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg) scale(0);
  transform-origin: center;
}

input[type="checkbox"]:checked {
  border-color: var(--brand);
  background: var(--brand);
}

input[type="checkbox"]:checked::before {
  transform: rotate(-45deg) scale(1);
}

input[type="checkbox"]:disabled {
  border-color: #cfd5dc;
  background: #edf0f3;
  cursor: not-allowed;
}

input:focus,
select:focus {
  border-color: var(--brand);
  outline: 2px solid rgba(13, 39, 68, .12);
}

input::placeholder {
  color: #a0a7b0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 14px;
  border-radius: 6px;
  background: var(--brand);
  color: white;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.btn.secondary {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--brand);
}

.btn.danger {
  background: var(--bad);
}

.btn:disabled {
  cursor: progress;
  opacity: .55;
}

.btn.is-loading {
  gap: 10px;
  opacity: .82;
}

.btn.is-loading::after {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.error {
  min-height: 20px;
  color: var(--bad);
  font-weight: 500;
}

.boot-snapshot {
  animation: bootFade .12s ease-out;
}

.boot-snapshot input[readonly],
.boot-snapshot select,
.boot-snapshot button {
  pointer-events: none;
}

.boot-skeleton-row td {
  height: 44px;
}

.boot-line,
.boot-pill,
.boot-check {
  display: block;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(223, 227, 232, .72), rgba(238, 241, 245, .95), rgba(223, 227, 232, .72));
  background-size: 180% 100%;
  animation: bootPulse 1.1s ease-in-out infinite;
}

.boot-line {
  width: 78%;
  height: 13px;
}

.boot-line + .boot-line {
  margin-top: 6px;
}

.boot-line-title {
  width: 70%;
}

.boot-line-meta {
  width: 42%;
  height: 10px;
}

.boot-line-input {
  width: 100%;
  height: 30px;
  border-radius: 6px;
}

.boot-pill {
  width: 74px;
  height: 22px;
}

.boot-check {
  width: 18px;
  height: 18px;
  border-radius: 5px;
}

@keyframes bootFade {
  from {
    opacity: .92;
  }
  to {
    opacity: 1;
  }
}

@keyframes bootPulse {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.layout {
  display: grid;
  gap: 10px;
  padding: 8px 12px 12px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 46px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  background: var(--brand);
  box-shadow: var(--shadow);
}

.topbar > *,
.grid > *,
.side-stack > *,
.panel,
.table-wrap {
  min-width: 0;
}

.topbar-meta {
  align-self: center;
  color: rgba(255, 255, 255, .72);
  font-size: 13px;
  line-height: 1.2;
}

.topbar .btn.secondary {
  border-color: rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.topbar .btn.secondary:hover {
  background: rgba(255, 255, 255, .14);
}

.topbar .btn.danger {
  background: #8f2630;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  color: var(--brand);
  font-size: 21px;
}

h2 {
  font-size: 16px;
}

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

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.city-select {
  width: 180px;
  border-color: rgba(255, 255, 255, .2);
  background: #fff;
}

.grid {
  display: grid;
  grid-template-columns: 220px minmax(540px, 1fr) 260px;
  gap: 12px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.panel-body {
  padding: 12px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 8px;
}

.stat {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .66);
}

.stat strong {
  display: block;
  color: var(--brand);
  font-size: 18px;
  line-height: 1;
}

.stat span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 130px;
  gap: 8px;
  margin-top: 8px;
  width: min(450px, 100%);
}

.catalog-nav {
  position: sticky;
  top: 12px;
  overflow: hidden;
}

.catalog-nav-head {
  display: flex;
  min-height: 54px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.catalog-nav-body {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.catalog-root,
.catalog-item,
.catalog-back {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, .62);
  color: var(--brand);
  font-weight: 500;
}

.catalog-root,
.catalog-item {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
  text-align: left;
  font-size: 13px;
}

.catalog-root.is-active,
.catalog-item:hover,
.catalog-root:hover {
  border-color: rgba(13, 39, 68, .28);
  background: #eef3f8;
}

.catalog-root strong,
.catalog-item strong {
  color: var(--muted);
  font-size: 12px;
}

.nav-icon {
  width: 20px;
  height: 16px;
  border: 2px solid #9badbf;
  border-top-width: 6px;
  border-radius: 4px;
}

.grid-icon {
  display: grid;
  width: 22px;
  height: 22px;
  border-width: 1px;
  border-radius: 7px;
  background:
    linear-gradient(90deg, transparent 47%, #9badbf 47%, #9badbf 53%, transparent 53%),
    linear-gradient(transparent 47%, #9badbf 47%, #9badbf 53%, transparent 53%);
}

.catalog-back {
  height: 36px;
}

.catalog-list {
  display: grid;
  gap: 6px;
  max-height: calc(100vh - 270px);
  overflow: auto;
}

.catalog-empty {
  padding: 10px 2px;
  color: var(--muted);
  font-size: 12px;
}

.search-box {
  position: relative;
}

.search-box input {
  padding-right: 38px;
}

.clear-search {
  display: none;
  position: absolute;
  top: 50%;
  right: 8px;
  width: 26px;
  height: 26px;
  place-items: center;
  transform: translateY(-50%);
  border-radius: 50%;
  background: #e8edf3;
  color: var(--brand);
  font-size: 19px;
  font-weight: 500;
  line-height: 1;
}

.clear-search.is-visible {
  display: grid;
}

.clear-search:hover {
  background: #dbe4ee;
}

.table-wrap {
  max-height: calc(100vh - 325px);
  overflow: auto;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eee9df;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  text-align: left;
  text-transform: uppercase;
}

td {
  background: rgba(255, 253, 250, .84);
}

tr:hover td {
  background: #fff;
}

.product-row {
  cursor: default;
}

.product-open-cell {
  cursor: pointer;
}

.product-open-cell:focus-visible {
  outline: 2px solid rgba(13, 39, 68, .18);
  outline-offset: -2px;
}

tr.is-saving td {
  background: #f8fbff;
}

tr.is-error td {
  background: #fff4f4;
}

.field-stack.is-saving {
  opacity: .75;
}

.autosave-note {
  color: var(--muted);
  font-size: 12px;
}

.sku {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.product-name {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.product-name strong {
  overflow: hidden;
  display: -webkit-box;
  font-weight: 600;
  line-height: 1.18;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-meta {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.18;
}

.price {
  color: var(--brand);
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}

.mini {
  height: 32px;
  padding: 0 7px;
}

.num {
  text-align: right;
}

.status {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.status.ok {
  background: rgba(18, 107, 69, .12);
  color: var(--good);
}

.status.warn {
  background: rgba(155, 98, 11, .12);
  color: var(--warn);
}

.status.bad {
  background: rgba(170, 36, 52, .12);
  color: var(--bad);
}

.side-stack {
  display: grid;
  gap: 12px;
}

.rule-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.export-box {
  display: grid;
  gap: 10px;
}

.api-box {
  display: grid;
  gap: 12px;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.copy-row input {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

.split-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.events {
  display: grid;
  gap: 8px;
  max-height: 210px;
  overflow: auto;
}

.event {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, .6);
}

.event time {
  color: var(--muted);
  font-size: 11px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  text-transform: none;
}

.toggle input {
  width: 18px;
  height: 18px;
}

.pager {
  display: grid;
  grid-template-columns: auto minmax(90px, 130px) auto minmax(90px, 130px) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 250, .88);
}

.pager-size {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
}

.pager-size select {
  width: 70px;
  height: 36px;
}

.pager-btn {
  width: 100%;
}

.empty-row {
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

body.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(13, 20, 28, .42);
}

.product-modal {
  display: grid;
  grid-template-rows: auto 1fr;
  width: min(920px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: hidden;
  border: 1px solid #2d3b4d;
  border-radius: 8px;
  background: #182333;
  color: #eef5ff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .32);
}

.modal-head {
  display: grid;
  grid-template-columns: 1fr 40px;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.modal-head h2 {
  color: #cfe6ff;
  font-size: 21px;
}

.modal-head p {
  margin: 4px 0 0;
  color: #aebdcc;
}

.modal-close {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
  color: #dce9f7;
  font-size: 28px;
  line-height: 1;
}

.modal-body {
  display: grid;
  gap: 14px;
  overflow: auto;
  padding: 16px 18px 20px;
}

.photo-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.photo-strip img {
  width: 100%;
  height: 120px;
  object-fit: contain;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: #f8fafc;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.detail-field {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: rgba(255, 255, 255, .055);
}

.detail-field span {
  color: #94a4b7;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

.detail-field strong {
  overflow-wrap: anywhere;
  color: #edf6ff;
  font-size: 14px;
  font-weight: 600;
}

.modal-section {
  display: grid;
  gap: 8px;
}

.modal-section h3 {
  margin: 0;
  color: #cfe6ff;
  font-size: 15px;
}

.description-box,
.raw-json,
.raw-textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: rgba(255, 255, 255, .055);
  color: #edf6ff;
}

.description-box {
  padding: 12px;
  white-space: pre-wrap;
}

.raw-json {
  max-height: 280px;
  margin: 0;
  overflow: auto;
  padding: 12px;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.raw-textarea {
  min-height: 150px;
  padding: 12px;
  resize: vertical;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.description-frame {
  width: 100%;
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.modal-backdrop {
  background: rgba(20, 20, 20, .34);
}

.product-modal {
  width: min(980px, calc(100vw - 48px));
  border-color: var(--line);
  background: var(--panel);
  color: var(--ink);
}

.modal-head {
  border-bottom-color: var(--line);
  background: #fff;
}

.modal-head h2 {
  color: var(--brand);
}

.modal-head p,
.summary-muted {
  color: var(--muted);
}

.modal-close {
  border-color: var(--line);
  background: #f2f5f8;
  color: var(--brand);
}

.modal-body {
  gap: 12px;
  background: var(--panel);
}

.product-overview {
  display: grid;
  grid-template-columns: minmax(260px, 42%) 1fr;
  gap: 14px;
  align-items: stretch;
}

.photo-card,
.summary-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.photo-card {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.main-photo {
  width: 100%;
  height: 280px;
  object-fit: contain;
  border-radius: 6px;
  background: #f7f8fa;
}

.photo-empty {
  display: grid;
  height: 280px;
  place-items: center;
  color: var(--muted);
  background: #f7f8fa;
}

.photo-card .photo-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.photo-thumb {
  display: grid;
  width: 100%;
  height: 62px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.photo-thumb.is-active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(29, 43, 68, .10);
}

.photo-card .photo-strip img {
  width: 100%;
  height: 62px;
  object-fit: contain;
  border: 0;
  border-radius: 5px;
  background: #f7f8fa;
}

.summary-card {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
}

.summary-price {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.summary-price span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.summary-price strong {
  color: var(--brand);
  font-size: 22px;
  font-weight: 600;
}

.summary-muted {
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.detail-field {
  border-color: var(--line);
  background: #fff;
}

.detail-field span {
  color: var(--muted);
}

.detail-field strong {
  color: var(--ink);
}

.modal-section h3,
.tech-section summary {
  color: var(--brand);
  font-size: 15px;
  font-weight: 600;
}

.tech-section summary {
  cursor: pointer;
}

.tech-toggle {
  width: max-content;
  min-height: 32px;
  padding: 0;
  background: transparent;
  color: var(--brand);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
}

.tech-toggle::before {
  content: "›";
  display: inline-block;
  margin-right: 6px;
  color: var(--accent);
}

.tech-toggle.is-open::before {
  transform: rotate(90deg);
}

.tech-content {
  display: grid;
  gap: 8px;
}

.tech-content[hidden] {
  display: none !important;
}

.description-box,
.raw-json,
.raw-textarea {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.product-modal {
  width: min(820px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
}

.modal-backdrop {
  padding: 20px;
}

.modal-head {
  padding: 12px 16px;
}

.modal-head h2 {
  font-size: 20px;
}

.modal-body {
  gap: 10px;
  padding: 12px 16px 16px;
}

.product-overview {
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 10px;
}

.product-overview.no-photo {
  grid-template-columns: 1fr;
}

.photo-card {
  align-content: start;
  padding: 8px;
}

.main-photo {
  height: 170px;
}

.photo-empty {
  height: 150px;
}

.photo-card .photo-strip {
  gap: 6px;
}

.photo-thumb {
  height: 42px;
}

.photo-card .photo-strip img {
  height: 42px;
}

.summary-card {
  gap: 8px;
  padding: 12px;
}

.summary-price {
  padding-bottom: 8px;
}

.summary-price strong {
  font-size: 20px;
}

.detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.detail-field {
  padding: 9px 10px;
}

.description-box {
  max-height: 170px;
  overflow: auto;
}

.description-frame {
  height: 220px;
  min-height: 220px;
}

.tech-section {
  min-width: 0;
}

.tech-section[open] {
  overflow: hidden;
}

.tech-section summary {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
}

.raw-json {
  max-height: 190px;
}

.raw-textarea {
  height: 150px;
  min-height: 110px;
  max-height: 220px;
}

.accounts-panel {
  margin-top: 2px;
}

.account-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
}

.account-layout-simple {
  max-width: 420px;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.account-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
}

.account-toggle-panel {
  max-width: 520px;
}

.account-card h3 {
  margin: 0 0 4px;
  color: var(--brand);
  font-size: 15px;
}

.account-list {
  display: grid;
  gap: 8px;
}

.account-empty {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, .55);
}

.account-item {
  display: grid;
  gap: 8px;
}

.account-summary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--brand);
  text-align: left;
  cursor: pointer;
}

.account-summary:hover,
.account-summary.is-open {
  border-color: rgba(13, 39, 68, .28);
  background: #f8fbff;
}

.account-summary span {
  display: grid;
  gap: 2px;
}

.account-summary strong {
  font-size: 14px;
  font-weight: 600;
}

.account-summary small {
  color: var(--muted);
  font-size: 12px;
}

.account-summary em {
  max-width: 58%;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  text-align: right;
  overflow-wrap: anywhere;
}

.account-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.account-form-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.city-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.city-check {
  display: inline-flex;
  width: auto;
  min-height: 30px;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--brand);
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
}

.city-check input {
  width: 16px;
  height: 16px;
}

.field-title {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.form-message {
  min-height: 18px;
  color: var(--good);
  font-size: 12px;
  font-weight: 500;
}

.form-message.error {
  color: var(--bad);
}

.accounts-page {
  display: grid;
  gap: 12px;
}

.rollback-box {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.rollback-head,
.rollback-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.rollback-head strong {
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
}

.rollback-list {
  display: grid;
  gap: 6px;
}

.rollback-item {
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.rollback-item span {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1180px) {
  .grid {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  .side-stack {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
  }

  .table-wrap {
    max-height: none;
  }
}

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

  .catalog-nav {
    position: static;
  }

  .catalog-list {
    max-height: 260px;
  }

  .side-stack {
    grid-template-columns: 1fr;
  }

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

  .panel-head {
    align-items: stretch;
  }

  .toolbar {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) 132px;
  }

  .accounts-panel {
    overflow: hidden;
  }

  .table-wrap {
    overflow: visible;
  }

  table {
    display: block;
    width: 100%;
    min-width: 0;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
  }

  tbody tr.product-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 10px;
    padding: 9px 10px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 253, 250, .9);
  }

  tbody tr.product-row:hover {
    background: #fff;
  }

  tbody tr.product-row td {
    display: grid;
    min-width: 0;
    gap: 2px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  tbody tr.product-row td::before {
    color: var(--muted);
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
  }

  tbody tr.product-row td:nth-child(1) {
    grid-column: 1 / -1;
  }

  tbody tr.product-row td:nth-child(2)::before {
    content: "Цена";
  }

  tbody tr.product-row td:nth-child(3)::before {
    content: "С наценкой";
  }

  tbody tr.product-row td:nth-child(4) {
    grid-column: 1 / -1;
  }

  tbody tr.product-row td:nth-child(4)::before {
    content: "Наценка";
  }

  tbody tr.product-row td:nth-child(5)::before {
    content: "Статус";
  }

  tbody tr.product-row td:nth-child(6) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  tbody tr.product-row td:nth-child(6)::before {
    content: "На сайте";
    color: var(--muted);
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
  }

  .mini {
    width: 100%;
  }

  .price {
    font-size: 12.5px;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 13px;
  }

  .layout {
    padding: 6px;
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 8px;
    border-radius: 0;
    margin: -6px -6px 0;
  }

  .top-actions {
    flex-wrap: wrap;
    width: 100%;
  }

  .top-actions .btn {
    flex: 1 1 auto;
  }

  .city-select {
    flex: 1 1 160px;
    width: auto;
  }

  .stat {
    padding: 8px;
  }

  .stat strong {
    font-size: 16px;
  }

  .stat span {
    font-size: 11px;
  }

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

  .table-wrap {
    overflow: visible;
  }

  table {
    display: block;
    width: 100%;
    min-width: 0;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
  }

  tbody tr.product-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 10px;
    padding: 9px 10px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 253, 250, .9);
  }

  tbody tr.product-row:hover {
    background: #fff;
  }

  tbody tr.product-row td {
    display: grid;
    min-width: 0;
    gap: 2px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  tbody tr.product-row td::before {
    color: var(--muted);
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
  }

  tbody tr.product-row td:nth-child(1) {
    grid-column: 1 / -1;
  }

  tbody tr.product-row td:nth-child(2)::before {
    content: "Цена";
  }

  tbody tr.product-row td:nth-child(3)::before {
    content: "С наценкой";
  }

  tbody tr.product-row td:nth-child(4) {
    grid-column: 1 / -1;
  }

  tbody tr.product-row td:nth-child(4)::before {
    content: "Наценка";
  }

  tbody tr.product-row td:nth-child(5)::before {
    content: "Статус";
  }

  tbody tr.product-row td:nth-child(6) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  tbody tr.product-row td:nth-child(6)::before {
    content: "На сайте";
    color: var(--muted);
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
  }

  .mini {
    width: 100%;
  }

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

  .pager-size,
  .pager strong,
  .pager span {
    grid-column: 1 / -1;
  }

  .modal-backdrop {
    align-items: stretch;
    padding: 0;
  }

  .product-modal {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .modal-head {
    padding: 12px;
  }

  .modal-body {
    padding: 10px 12px 14px;
  }

  .product-overview {
    grid-template-columns: 1fr;
  }

  .main-photo,
  .photo-empty {
    height: 220px;
  }

  .detail-grid,
  .account-row,
  .account-form-actions {
    grid-template-columns: 1fr;
  }

  .description-frame {
    height: 260px;
    min-height: 260px;
  }

  .photo-card .photo-strip {
    grid-template-columns: repeat(5, minmax(44px, 1fr));
    overflow-x: auto;
  }
}

@media (max-width: 520px) {
  .layout {
    gap: 8px;
  }

  .panel {
    border-radius: 6px;
    box-shadow: none;
  }

  .panel-head,
  .panel-body {
    padding: 9px;
  }

  .stats {
    gap: 6px;
  }

  .catalog-root,
  .catalog-item {
    min-height: 40px;
  }

  table {
    min-width: 0;
  }

  .price {
    font-size: 12px;
  }

  .product-name strong {
    -webkit-line-clamp: 2;
  }

  .summary-price strong {
    font-size: 18px;
  }

  .login-shell {
    padding: 16px;
  }

  .login-card {
    width: 100%;
  }
}
