/* Панель оператора EuroExchange.com.ua. Те же цвета, что у сайта, но плотнее: рабочий экран
   на компьютере, много данных сразу. Светлая и тёмная тема — по настройке системы. */

:root {
  --green: #9fe870;
  --green-active: #cdffad;
  --forest: #163300;
  --bg: #eef0ec;
  --surface: #ffffff;
  --ink: #0e0f0c;
  --body: #454745;
  --muted: #7a7d78;
  --line: #dfe2db;
  --link: #163300;
  --danger: #c4262c;
  --ok-bg: #e2f6d5;
  --err-bg: #fbe3e3;
  --warn-bg: #fff1cc;
  --warn-ink: #5a4100;
  --soft: #e2f6d5;
  --brand-ex: #37820f; /* «Exchange» в логотипе */
  --r: 12px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0f0c;
    --surface: #1a1c18;
    --ink: #e8ebe6;
    --body: #c4c7c1;
    --muted: #8f928c;
    --line: #2c2f29;
    --link: #9fe870;
    --danger: #f0686d;
    --ok-bg: #1f3312;
    --err-bg: #3a0c0c;
    --warn-bg: #3a2c05;
    --warn-ink: #ffe08a;
    --soft: #23361a;
    --brand-ex: #9fe870;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--link); text-underline-offset: 2px; }
code, .mono, .cardnum { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
h1 { font-size: 24px; margin: 0; letter-spacing: -.02em; }
h2 { font-size: 16px; margin: 0 0 10px; }
h3 { font-size: 14px; margin: 18px 0 8px; }
p { margin: 0 0 8px; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }

/* шапка */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}
/* логотип: значок, справа название, под названием по центру — «оператор» */
.brand { display: flex; align-items: center; gap: 8px; flex-shrink: 0; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand-mark { width: 32px; height: 32px; display: block; flex: none; }
.brand-text { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.brand-name { font-weight: 800; font-size: 15px; line-height: 1.15; letter-spacing: -.015em; }
.brand-name b, .solo-brand b { font-weight: 800; color: var(--brand-ex); }
.brand-role { font-weight: 600; color: var(--forest); background: var(--green); border-radius: 999px; padding: 0 7px; font-size: 11px; line-height: 17px; }
/* вход в панель: логотип над окном */
.solo-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 10vh 0 0;
  font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.solo-brand + .narrow { margin-top: 20px; }
/* меню — в один ряд; если окно узкое, прокручивается вбок, а не переносится */
.nav { display: flex; gap: 0; flex-wrap: nowrap; overflow-x: auto; min-width: 0; flex: 1 1 auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
/* по центру между эмблемой и колокольчиком; если не помещается — с начала, с прокруткой */
.nav a:first-child { margin-left: auto; }
.nav a:last-child { margin-right: auto; }
.nav a { color: var(--body); text-decoration: none; padding: 6px 9px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.nav a:hover { background: var(--soft); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--surface); }
.who { margin-left: auto; display: flex; align-items: center; gap: 10px; white-space: nowrap; flex-shrink: 0; }
.icon-btn { padding: 4px 9px; font-size: 15px; line-height: 1.2; }
@media (max-width: 1180px) { .who .muted { display: none; } }
@media (max-width: 1100px) and (min-width: 761px) { .topbar { gap: 10px; } .nav a { padding: 6px 6px; } .brand-mark { display: none; } }
.who form { margin: 0; }

.main { max-width: 1280px; margin: 0 auto; padding: 20px; }
.main.wide { max-width: 1680px; }
.narrow { max-width: 440px; margin: 10vh auto 0; padding: 20px; }
.foot { text-align: center; padding: 20px; font-size: 12px; }

/* кнопки */
.btn, .btn-small, .ghost {
  font: inherit;
  font-weight: 600;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn { background: var(--green); color: var(--forest); padding: 10px 20px; min-height: 40px; }
.btn:hover, .btn-small:hover { background: var(--green-active); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a01d22; }
.btn-small { background: var(--soft); color: var(--ink); padding: 5px 12px; font-size: 13px; }
.btn-small[disabled] { opacity: .45; cursor: not-allowed; }
.btn-small.danger { background: var(--err-bg); color: var(--danger); }
.ghost { background: transparent; color: var(--body); padding: 5px 10px; border: 1px solid var(--line); }
.ghost:hover { background: var(--soft); }
.copy {
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  background: var(--soft);
  color: var(--ink);
  border: 0;
  border-radius: 999px;
  padding: 3px 10px;
  cursor: pointer;
  white-space: nowrap;
}
.copy.done { background: var(--green); color: var(--forest); }

/* формы */
input:not([type]), input[type="text"], select {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
}
.w-num { width: 130px; }
.w-search { width: 280px; }
.big-input { font-size: 20px; width: 140px; font-weight: 700; }
.code-input { font-size: 28px; letter-spacing: .3em; text-align: center; width: 100%; padding: 10px; }
label { display: block; font-weight: 600; color: var(--body); }
label input, label select { display: block; margin-top: 4px; font-weight: 400; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
label.check input { display: inline; margin: 0; width: 18px; height: 18px; accent-color: var(--forest); }
.stack { display: grid; gap: 12px; }
.inline { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 2px 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; align-items: end; }
.form-grid .span2 { grid-column: span 2; }
.form-grid .span2 input { width: 100%; }
.form-grid .btn { justify-self: start; }

/* сообщения */
.flash { border-radius: var(--r); padding: 10px 14px; margin-bottom: 16px; }
.flash-ok { background: var(--ok-bg); }
.flash-error { background: var(--err-bg); }
.warn-link { color: var(--warn-ink); background: var(--warn-bg); padding: 0 6px; border-radius: 6px; }

/* блоки */
.box, .card { background: var(--surface); border-radius: var(--r); padding: 16px 18px; }
.box h1 { margin-bottom: 8px; }
.box .btn { margin-top: 8px; }
.card + .card, .grid2 + .card, .card + .grid2, .grid2 + .grid2 { margin-top: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.grid2 > .card { margin-top: 0; }
.stack label input:not([type]) { width: 100%; }
.head-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.crumbs { margin-bottom: 6px; color: var(--muted); }
.big-num { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; margin: 12px 0 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
pre { background: var(--bg); border-radius: 8px; padding: 10px 12px; overflow-x: auto; }
.danger-zone { border: 1px solid var(--err-bg); }
.tg-login { margin: 18px 0 8px; min-height: 48px; }

/* статусы и банки */
.status { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--soft); color: var(--ink); white-space: nowrap; }
.st-new { background: var(--warn-bg); color: var(--warn-ink); }
.st-in_work { background: #dbe8ff; color: #0b2f6b; }
.st-partial { background: var(--soft); }
.st-done { background: var(--green); color: var(--forest); }
.st-cancelled { background: var(--line); color: var(--body); }
@media (prefers-color-scheme: dark) { .st-in_work { background: #16284a; color: #b9d0ff; } }
.bank { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--line); color: var(--ink); white-space: nowrap; }
.bank-mono { background: #1b1b1d; color: #fff; }
.bank-privat { background: #1d6b37; color: #fff; }
.bank-pumb { background: #c8102e; color: #fff; }
.bank-abank { background: #3d8b3d; color: #fff; }
.bank-oschad { background: #0f6e4f; color: #fff; }
@media (prefers-color-scheme: dark) { .bank-mono { background: #f2f3f1; color: #111; } }

.bar { appearance: none; -webkit-appearance: none; width: 100%; height: 6px; border: 0; border-radius: 999px; background: var(--soft); overflow: hidden; display: block; margin: 6px 0; }
.bar::-webkit-progress-bar { background: var(--soft); }
.bar::-webkit-progress-value { background: var(--forest); }
.bar::-moz-progress-bar { background: var(--forest); }
@media (prefers-color-scheme: dark) {
  .bar::-webkit-progress-value { background: var(--green); }
  .bar::-moz-progress-bar { background: var(--green); }
}

/* рабочее место */
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface); border-radius: var(--r); padding: 12px 16px; display: grid; }
.tile-label { color: var(--muted); font-size: 12.5px; }
.tile-value { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.tile-sub { color: var(--body); font-size: 12.5px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.col > h2 { margin: 0 0 8px; }
.col .card { margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { font: inherit; font-size: 12.5px; font-weight: 600; background: var(--surface); color: var(--body); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.card-id { font-weight: 800; text-decoration: none; color: var(--ink); }
.age { margin-left: auto; font-size: 12.5px; }
.free { font-size: 15px; margin: 0; }
.free b { font-size: 20px; }
.copy-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; background: var(--bg); border-radius: 8px; margin-top: 6px; }
.copy-row .cardnum { font-size: 16px; font-weight: 600; letter-spacing: .03em; }
.copy-row .holder { font-weight: 600; }
.copy-row.big .cardnum { font-size: 20px; }
.copy-row.big .holder { font-size: 16px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.quick form { margin: 0; }
.qcard[hidden] { display: none; }
.empty { color: var(--muted); padding: 12px 0; }
.events { list-style: none; padding: 0; margin: 0; background: var(--surface); border-radius: var(--r); }
.ev { display: grid; grid-template-columns: 82px 1fr; gap: 8px; padding: 7px 12px; border-top: 1px solid var(--line); font-size: 13px; }
.ev:first-child { border-top: 0; }
.ev a { color: var(--ink); text-decoration: none; }
.ev a:hover { text-decoration: underline; }
.ev-time { color: var(--muted); font-size: 12px; }
.ev-order a, .ev-warn a { font-weight: 700; }
.ev-warn { background: var(--warn-bg); }
.ev-deposit a::before { content: "↓ "; color: var(--muted); }
.ev-paid a::before { content: "✓ "; color: var(--muted); }
.live-note { margin-top: 12px; }
.live-note.stale { color: var(--danger); }
.fresh { animation: fresh 2.5s ease-out; }
@keyframes fresh { from { box-shadow: 0 0 0 3px var(--green); } to { box-shadow: 0 0 0 3px transparent; } }

/* очередь — таблица */
.cols2 { display: grid; grid-template-columns: minmax(0, 2.6fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.queue { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.queue th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12.5px; padding: 0 10px 2px; }
.queue th.r, .queue td.r { text-align: right; }
.queue tbody > tr > td { background: var(--surface); padding: 10px; vertical-align: middle; }
.queue tbody > tr.order-row > td:first-child { border-radius: var(--r) 0 0 var(--r); }
.queue tbody > tr.order-row > td:last-child { border-radius: 0 var(--r) var(--r) 0; }
.queue tbody > tr.order-row:only-child > td:first-child { border-radius: var(--r) 0 0 var(--r); }
.queue tr.order-row + tr.parts-row > td { padding-top: 0; }
.queue tbody:has(.parts-row) tr.order-row > td:first-child { border-bottom-left-radius: 0; }
.queue tbody:has(.parts-row) tr.order-row > td:last-child { border-bottom-right-radius: 0; }
.queue tr.parts-row > td:first-child { border-radius: 0 0 0 var(--r); }
.queue tr.parts-row > td:last-child { border-radius: 0 0 var(--r) 0; }
.queue .qrow[hidden] { display: none; }
.queue .cardnum { font-size: 15px; font-weight: 600; letter-spacing: .03em; }
.queue .holder { font-weight: 600; }
.queue .left { font-size: 18px; }
.queue .copy { padding: 2px 7px; margin-left: 4px; }
.nowrap { white-space: nowrap; }
.btn-amount {
  font: inherit; font-weight: 800; font-size: 15px; min-width: 44px; height: 36px;
  border: 0; border-radius: 10px; background: var(--green); color: var(--forest); cursor: pointer;
}
.btn-amount:hover { background: var(--green-active); }
.btn-amount[disabled] { background: var(--line); color: var(--muted); cursor: not-allowed; }
.queue .quick { display: table-cell; }
.queue .quick form { display: inline-block; margin: 0 2px; }

.part { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 6px 12px; padding: 6px 0; border-top: 1px dashed var(--line); }
.part:first-child { border-top: 0; }
.part-main { padding-top: 4px; }
.part-actions { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; }
.part-actions > form { margin: 0; }
.part-reserved .part-main b { color: var(--ink); }
.ok-text { color: var(--forest); }
@media (prefers-color-scheme: dark) { .ok-text { color: var(--green); } }
.got > summary { list-style: none; cursor: pointer; }
.got > summary::-webkit-details-marker { display: none; }
.got[open] > summary { background: var(--ink); color: var(--surface); }
.got-form { display: grid; gap: 8px; background: var(--bg); border-radius: 10px; padding: 10px 12px; margin-top: 6px; min-width: 320px; }
.got-form label { font-weight: 600; font-size: 13px; }
.got-form input:not([type]) { width: 100%; }
.got-form input[type="file"] { display: block; margin-top: 4px; font: inherit; font-size: 13px; }
.tokens > summary { cursor: pointer; }
.tokens .inline { margin-top: 6px; }

/* сделки Binance */
.deals { margin-bottom: 16px; }
.got-form select { width: 100%; margin-top: 4px; }
.dcard { margin-bottom: 8px; }
.dcard p { margin: 4px 0 0; }
.dcard form { margin-top: 6px; }
.dcard-linked { box-shadow: inset 3px 0 0 var(--green); }
.deal-pick select { max-width: 260px; }
.deal-linked { gap: 4px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; }

/* таблицы и вкладки */
.table { width: 100%; border-collapse: collapse; }
.table.card { padding: 0; overflow: hidden; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table td.num { white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.row-cancelled td { color: var(--muted); }
.neg { color: var(--danger); }
.pos { color: var(--forest); }
@media (prefers-color-scheme: dark) { .pos { color: var(--green); } }
.tabs { display: flex; gap: 4px; }
.tabs a { padding: 5px 12px; border-radius: 999px; text-decoration: none; color: var(--body); font-weight: 600; background: var(--surface); }
.tabs a[aria-current="page"] { background: var(--ink); color: var(--surface); }

/* сборщик */
.stats4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.head-note { margin: 0; }
.table th.r, .table td.r { text-align: right; }
.note { margin: 10px 0 0; }
.warn-card { background: var(--warn-bg); color: var(--warn-ink); }
.warn-card .muted { color: inherit; opacity: .8; }
.warn-line { color: var(--warn-ink); background: var(--warn-bg); border-radius: 8px; padding: 4px 8px; }
.wnet { padding: 8px 0; border-top: 1px solid var(--line); }
.wnet:first-of-type { border-top: 0; padding-top: 0; }
.wnet p { margin: 4px 0 0; }
.wrap { overflow-wrap: anywhere; }
.check-line { padding: 8px 0; border-top: 1px solid var(--line); }
.check-line:first-of-type { border-top: 0; }
.mism { margin-top: 6px; }
.mism li { padding: 4px 8px; border-radius: 8px; }
.mism li.neg { background: var(--err-bg); }
.st-due { background: var(--green); color: var(--forest); }
.st-held { background: var(--err-bg); color: var(--danger); }

/* клиент: адреса для пополнения */
.addrs > li { padding: 6px 0; border-top: 1px solid var(--line); }
.addrs > li:first-child { border-top: 0; }
.addr-line { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.addr-line .copy { flex: none; }
.addr-line a { min-width: 0; }

/* прибыль */
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; margin-bottom: 16px; }
.grid3 > .card { margin-top: 0; }
.pcard .big-num { margin: 4px 0 0; }
.pk { grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; }
.pk dd { text-align: right; }
label.inline input { display: inline-block; margin: 0; }
@media (max-width: 900px) { .grid3 { grid-template-columns: minmax(0, 1fr); } }

@media (max-width: 1100px) {
  .cols2 { grid-template-columns: 1fr; }
  .cols { grid-template-columns: 1fr 1fr; }
  .cols .col:last-child { grid-column: span 2; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* --- телефон (iPhone и т. п.): очередь — карточками, крупные кнопки --- */
@media (max-width: 760px) {
  body { font-size: 15px; }
  .topbar {
    flex-wrap: wrap; gap: 6px 10px;
    padding: calc(8px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) 8px calc(12px + env(safe-area-inset-left));
  }
  .nav { flex-wrap: nowrap; overflow-x: auto; width: 100%; order: 3; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; padding: 8px 12px; }
  .who { margin-left: auto; gap: 8px; }
  .who .muted { display: none; }
  .main, .main.wide { padding: 12px calc(12px + env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left)); }
  .cols, .cols2, .grid2 { grid-template-columns: minmax(0, 1fr); }
  .cols .col:last-child { grid-column: auto; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile { padding: 10px 12px; }
  .tile-value { font-size: 20px; }
  .table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* iOS увеличивает страницу при фокусе на поле со шрифтом меньше 16px */
  input:not([type]), input[type="text"], select, .code-input { font-size: 16px; }

  .queue, .queue tbody, .queue tr, .queue td { display: block; }
  .queue thead { display: none; }
  .queue { border-spacing: 0; }
  .queue tbody.qrow { background: var(--surface); border-radius: var(--r); margin-bottom: 10px; padding: 12px; }
  .queue tbody > tr > td { background: none; padding: 0; border-radius: 0 !important; }
  .queue tr.order-row {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    grid-template-areas: "id bank age left" "card card card card" "name name name name" "quick quick quick quick";
    gap: 8px 10px; align-items: center;
  }
  .queue tr.order-row > td:nth-child(1) { grid-area: id; }
  .queue tr.order-row > td:nth-child(2) { grid-area: age; color: var(--muted); font-size: 13px; }
  .queue tr.order-row > td:nth-child(3) { grid-area: bank; }
  .queue tr.order-row > td:nth-child(4) { grid-area: card; }
  .queue tr.order-row > td:nth-child(5) { grid-area: name; }
  .queue tr.order-row > td:nth-child(6) { grid-area: left; text-align: right; }
  .queue tr.order-row > td:nth-child(7) { grid-area: quick; }
  .queue tr.order-row > td:nth-child(4), .queue tr.order-row > td:nth-child(5) {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--bg); border-radius: 10px !important; padding: 8px 10px;
  }
  .queue .cardnum { font-size: 17px; }
  .queue .copy { padding: 8px 14px; font-size: 14px; }
  .queue .left br { display: none; }
  .queue .quick { display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .queue .quick form { margin: 0; }
  .btn-amount { width: 100%; height: 48px; font-size: 18px; }
  .queue tr.parts-row { margin-top: 10px; }
  .queue tr.parts-row > td:first-child { display: none; }
  .part { flex-direction: column; align-items: stretch; }
  .part-actions { width: 100%; flex-direction: row; flex-wrap: wrap; }
  .part-actions .btn-small, .part-actions summary.btn-small { padding: 10px 14px; font-size: 14px; }
  .got[open] { width: 100%; order: 5; }
  .got-form { min-width: 0; }
  .deal-pick, .deal-linked { width: 100%; flex-wrap: nowrap; }
  .deal-pick select { max-width: none; flex: 1; min-width: 0; }
  .col > p.muted.small { display: none; }
  .ev { grid-template-columns: 52px 1fr; }
  .kv { grid-template-columns: 120px 1fr; }
  .copy-row.big .cardnum { font-size: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span2 { grid-column: auto; }

  /* таблицы сборщика — строки карточками */
  .table.mcards { display: block; overflow: visible; }
  .mcards thead { display: none; }
  .mcards tbody { display: block; }
  .mcards tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .mcards tr:last-child { border-bottom: 0; }
  .mcards td { padding: 0; border: 0; min-width: 0; }
  .mcards td.empty { grid-column: span 2; }
  .m-addr td:nth-child(1) { grid-area: 1 / 1; color: var(--muted); font-size: 13px; }
  .m-addr td:nth-child(4) { grid-area: 1 / 2; text-align: right; }
  .m-addr td:nth-child(2) { grid-area: 2 / 1; }
  .m-addr td:nth-child(3) { grid-area: 2 / 2; align-self: start; }
  .m-hist td:nth-child(2) { grid-area: 1 / 1; font-weight: 600; }
  .m-hist td:nth-child(3) { grid-area: 1 / 2; }
  .m-hist td:nth-child(4) { grid-area: 2 / 1 / 3 / 3; }
  .m-hist td:nth-child(1) { grid-area: 3 / 1; color: var(--muted); font-size: 13px; }
  .m-hist td:nth-child(5) { grid-area: 3 / 2; text-align: right; }
  .m-days td:nth-child(1) { grid-area: 1 / 1; font-weight: 600; }
  .m-days td:nth-child(5) { grid-area: 1 / 2; text-align: right; }
  .m-days td:nth-child(2) { grid-area: 2 / 1 / 3 / 3; text-align: left; }
  .m-days td:nth-child(3), .m-days td:nth-child(4) { display: none; }
  .m-days td:nth-child(2) br { display: none; }
  .m-days td:nth-child(2) .small::before { content: " · "; }
  .pk { grid-template-columns: minmax(0, 1fr) auto; }
}
@media (prefers-reduced-motion: reduce) { .fresh { animation: none; } }
