:root {
  --bg: #10141c;
  --card: #181e29;
  --line: #2a3344;
  --text: #eef2f8;
  --muted: #93a0b5;
  --accent: #005bff;
  --on-accent: #ffffff;
  --accent-2: #4d8fff;
  --danger: #e35d5d;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Segoe UI, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: #0c1017;
}
.brand { display: flex; gap: 12px; align-items: center; }
.brand p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.mark {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-weight: 800;
}
main { max-width: 1180px; margin: 0 auto; padding: 20px; display: grid; gap: 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
}
.card h2 { margin: 0 0 10px; font-size: 18px; }
.shops { display: grid; gap: 16px; }
.shop-card.active { outline: 1px solid var(--accent); }
.shop-head {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 8px;
}
.shop-head label { flex: 1; min-width: 200px; }
.shop-form { max-width: 520px; }
.pace {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.pace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
  margin: 8px 0;
}
.pace .pair {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pace input[type="number"] { min-width: 0; width: 100%; }
.pace-state { margin: 0 0 8px; }
.prod { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.prod-meta { min-width: 0; }
.prod-name-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}
.prod-name {
  font-weight: 650; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-width: 0;
  flex: 1;
}
button.clip-btn {
  min-width: 28px;
  min-height: 28px;
  width: auto;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 400;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
button.clip-btn:hover { color: var(--accent-2); }
button.clip-btn.ok { color: #9ee7b0; }
.prod-article {
  font-size: 12px;
  color: #d5deee;
  line-height: 1.3;
  margin-top: 2px;
}
.thumb {
  width: 48px; height: 48px; border-radius: 8px; object-fit: cover;
  background: #10151e; border: 1px solid var(--line); flex: none;
}
.thumb.empty { background: #10151e; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
input[type="checkbox"] {
  width: 18px; height: 18px; min-width: 18px; accent-color: var(--accent); cursor: pointer;
}
input, select, button, .button {
  font: inherit; border-radius: 10px;
}
input, select {
  background: #10151e; color: var(--text);
  border: 1px solid var(--line); padding: 8px 10px; min-width: 180px;
}
button, .button {
  border: 0; background: var(--accent); color: var(--on-accent);
  padding: 9px 14px; cursor: pointer; font-weight: 650; text-decoration: none;
  display: inline-flex; align-items: center;
}
button.secondary, .ghost { background: #2a3344; color: var(--text); }
.muted { color: var(--muted); font-size: 13px; }
.hint { color: var(--muted); font-size: 12px; }
code {
  display: inline-block; margin-top: 8px; padding: 8px 10px;
  background: #10151e; border-radius: 8px; letter-spacing: .04em;
}
.toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.toolbar h2 { margin: 0; }
.check {
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
  min-width: auto;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}
.table-wrap { overflow: auto; margin-top: 12px; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; }
th { color: var(--muted); font-weight: 600; }
table a { color: var(--accent-2); }
.user-box { display: flex; gap: 10px; align-items: center; }
.toast {
  position: fixed; right: 16px; bottom: 16px; display: none;
  background: #0c1017; border: 1px solid var(--line); padding: 10px 14px; border-radius: 10px;
}
.toast.error { border-color: var(--danger); color: #ffd0d0; }
.stack { display: grid; gap: 10px; max-width: 420px; }
.stack button { justify-content: center; }
.switch { margin: 14px 0 0; color: var(--muted); }
button.link {
  background: none; color: var(--accent); padding: 0; font-weight: 650;
  display: inline; border-radius: 0;
}
.notes {
  background: #10151e; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 14px;
}
.notes p { margin: 0 0 8px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.notes p:last-child { margin: 0; }
.steps {
  margin: 0; padding: 14px 18px 14px 36px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  color: var(--muted); line-height: 1.5;
}
.invite { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.invite-note { margin: 8px 0 0; font-size: 12px; line-height: 1.4; }
.icon-btn {
  min-width: 40px; height: 40px; padding: 0; justify-content: center;
  background: #2a3344; color: var(--text);
}
.ok { color: #9ee7b0; font-size: 13px; }
.howto { color: var(--muted); font-size: 13px; line-height: 1.45; }
.howto ul { margin: 6px 0 0; padding-left: 18px; }
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  display: grid; place-items: center; z-index: 20;
}
.modal[hidden] { display: none; }
.modal-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px; max-width: 460px; width: calc(100% - 32px);
}
.modal-card h3 { margin: 0 0 8px; }
.modal-card p { color: var(--muted); line-height: 1.45; }
.copy-hint {
  color: #9ee7b0;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}
.shop-stat { margin: 12px 0 0; }
.stat-num { font-size: 32px; font-weight: 800; line-height: 1.1; color: var(--text); }
.stat-label { margin-top: 4px; font-size: 15px; color: var(--text); }
.stat-date { margin-top: 6px; font-size: 15px; color: #d5deee; }
.stat-error { margin-top: 6px; color: #ffb4b4; font-size: 13px; }
.filter-seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.filter-seg .seg {
  background: #10151e; color: var(--muted); border-radius: 0; padding: 8px 12px;
}
.filter-seg .seg.on { background: var(--accent); color: var(--on-accent); }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.badge.new { background: #243044; color: #c9d6ea; }
.badge.wait { background: #3a2f14; color: #f3d089; }
.badge.ok { background: #163526; color: #9ee0b8; }
.badge.bad { background: #3a1c1c; color: #ffb4b4; }
.badge.mute { background: #1b2028; color: #8b95a8; }
.select-bar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: end;
  margin-top: 12px;
}
.search-field { min-width: 220px; flex: 1; }
.search-field input { min-width: 0; width: 100%; }
.select-actions { display: flex; flex-direction: column; gap: 4px; }
.select-actions .field-lbl { font-size: 12px; color: var(--muted); }
.select-actions .btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.select-bar .ghost { min-height: 38px; }
button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.toolbar-actions { align-items: center; }
@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .top { flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px 14px; }
  .user-box { width: 100%; justify-content: space-between; }
  main { padding: 12px; gap: 12px; }
  .row { align-items: stretch; }
  .row label, .row input, .row select, .row button, .row .button { min-width: 0; width: 100%; }
  input, select { min-width: 0; width: 100%; }
  .key-row { flex-wrap: wrap; }
  .key-row code { min-width: 0; width: 100%; }
  .copy-hint { white-space: normal; }
  .toolbar { align-items: flex-start; }
  .toolbar-actions { width: 100%; }
  .filter-seg { width: 100%; }
  .filter-seg .seg { flex: 1; }
  .stack { max-width: none; }
  button, .button { min-height: 44px; justify-content: center; }
  button.clip-btn { min-height: 28px; min-width: 28px; width: auto; }
  table, thead, tbody, th, td, tr { display: block; }
  thead { display: none; }
  tbody tr {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px 10px;
    margin-bottom: 10px;
    background: #141a24;
  }
  tbody td {
    border: 0;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 0;
  }
  tbody td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
  }
  tbody td:first-child { justify-content: flex-start; }
}
@media (max-width: 560px) {
  .brand p { font-size: 12px; }
  .stat-num { font-size: 28px; }
  .select-bar { gap: 8px; }
  .icon-btn { min-width: 44px; height: 44px; }
}
