:root {
  --bg: #f5f6f8; --card: #ffffff; --card-2: #f7f8fa; --text: #14171f; --muted: #667085; --line: #e4e7ec; --line-2: #d0d5dd;
  --accent: #2563eb; --accent-weak: #e8effd; --accent-text: #ffffff;
  --ok: #12804a; --ok-weak: #e3f5ec; --warn: #a15c00; --warn-weak: #fff1d6; --bad: #c0282d; --bad-weak: #fde7e7;
  --up: #12804a; --down: #c0282d;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 20px rgba(16, 24, 40, .05);
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1015; --card: #151921; --card-2: #1a1f29; --text: #e9ecf3; --muted: #9aa4b5; --line: #262d3a; --line-2: #343d4d;
    --accent: #6397ff; --accent-weak: #1b2a49; --accent-text: #08101f;
    --ok: #4cc38a; --ok-weak: #11301f; --warn: #f0b24a; --warn-weak: #382a10; --bad: #ff7b7b; --bad-weak: #3a1717;
    --up: #4cc38a; --down: #ff7b7b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
  --bg: #0d1015; --card: #151921; --card-2: #1a1f29; --text: #e9ecf3; --muted: #9aa4b5; --line: #262d3a; --line-2: #343d4d;
  --accent: #6397ff; --accent-weak: #1b2a49; --accent-text: #08101f;
  --ok: #4cc38a; --ok-weak: #11301f; --warn: #f0b24a; --warn-weak: #382a10; --bad: #ff7b7b; --bad-weak: #3a1717;
  --up: #4cc38a; --down: #ff7b7b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; }
html { color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 Inter, -apple-system, "Segoe UI", Roboto, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; font-weight: 650; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
svg.i { flex: none; vertical-align: -3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* вход */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 360px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); }
.login-card h1 { font-size: 20px; margin-bottom: 4px; }
.login-card p { margin: 0 0 20px; color: var(--muted); }
.login-card .field { margin-bottom: 12px; }
.login-card .btn { width: 100%; justify-content: center; }

/* шапка */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1320px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; white-space: nowrap; }
.brand img { width: 24px; height: 24px; border-radius: 7px; }
.tabs { display: flex; gap: 2px; margin-left: 14px; }
.tab { border: 0; background: transparent; padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.tab:hover { color: var(--text); background: var(--card); }
.tab[aria-current="page"] { color: var(--accent); background: var(--accent-weak); }
.tab .count { background: var(--bad); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 6px; line-height: 17px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }

/* полоса состояния */
.strip { max-width: 1320px; margin: 0 auto; padding: 0 20px 10px; display: flex; gap: 8px 18px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.health { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--text); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-weak); display: inline-block; }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-weak); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-weak); }
.mode { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }

/* кнопки и поля */
.btn { border: 1px solid var(--line-2); background: var(--card); padding: 8px 14px; border-radius: 9px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; transition: background .12s, border-color .12s, transform .08s; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; transform: none; border-color: var(--line-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.primary:disabled { filter: none; }
.btn.danger { color: var(--bad); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--card); border-color: var(--line); }
.btn.icon { padding: 7px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; }
.field small { color: var(--muted); font-size: 12px; line-height: 1.35; }
input[type=text], input[type=number], input[type=password], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--card); outline: none; transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
input.changed, select.changed { border-color: var(--accent); background: var(--accent-weak); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.err { color: var(--bad); font-size: 13px; }
.err:empty { display: none; }

/* страница */
main { max-width: 1320px; margin: 0 auto; padding: 18px 20px 120px; }
.page-title { font-size: 20px; margin: 4px 0 14px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.page-title small { font-size: 13px; font-weight: 400; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }

/* внимание */
.attention { display: grid; gap: 8px; margin-bottom: 14px; }
.note { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); }
.note > svg { margin-top: 2px; }
.note .t { font-weight: 650; }
.note .d { color: var(--muted); font-size: 13px; }
.note .grow { flex: 1 1 220px; min-width: 0; }
.note.bad { background: var(--bad-weak); border-color: color-mix(in srgb, var(--bad) 30%, var(--line)); }
.note.bad > svg, .note.bad .t { color: var(--bad); }
.note.warn { background: var(--warn-weak); border-color: color-mix(in srgb, var(--warn) 30%, var(--line)); }
.note.warn > svg, .note.warn .t { color: var(--warn); }
.note.ok { background: var(--ok-weak); border-color: color-mix(in srgb, var(--ok) 25%, var(--line)); }
.note.ok > svg, .note.ok .t { color: var(--ok); }
.note .actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
@media (max-width: 600px) { .note .actions { margin-left: 30px; } }

/* панель фильтров */
.toolbar { display: flex; gap: 10px 14px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 2px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 13px; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--accent-weak); color: var(--accent); }
.seg .n { opacity: .7; font-weight: 500; margin-left: 3px; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1 1 280px; min-width: 0; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 1px solid var(--line); background: var(--card); padding: 4px 11px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.searchbox { position: relative; width: 220px; }
.searchbox svg { position: absolute; left: 10px; top: 9px; color: var(--muted); pointer-events: none; }
.searchbox input { padding-left: 32px; }
.searchbox kbd { position: absolute; right: 8px; top: 7px; font: 11px/1 ui-monospace, monospace; color: var(--muted); border: 1px solid var(--line-2); border-radius: 5px; padding: 3px 5px; pointer-events: none; }

/* таблица курсов */
.tablewrap { overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--card-2); }
td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr.pair-row { cursor: pointer; }
tr.pair-row:hover td { background: var(--card-2); }
tr.pair-row.selected td { background: var(--accent-weak); }
td.r, th.r { text-align: right; }
td.chk, th.chk { width: 34px; padding-right: 0; }
tr.group td { background: var(--card-2); border-top: 1px solid var(--line); padding: 8px 10px; }
tr.group:first-child td { border-top: 0; }
.gh { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gh .fold { border: 0; background: transparent; padding: 2px; color: var(--muted); display: inline-flex; transition: transform .12s; }
.gh .fold[aria-expanded="true"] { transform: rotate(90deg); }
.gh b { font-size: 14px; }
.gh .range { color: var(--muted); font-size: 12.5px; }
.gh .spacer { flex: 1; }
.pair { font-weight: 650; line-height: 1.25; }
.pair small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.rate { font-size: 17px; font-weight: 750; white-space: nowrap; line-height: 1.2; }
.flags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; justify-content: flex-end; }
.sub { font-size: 12px; color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--accent-weak); color: var(--accent); white-space: nowrap; line-height: 18px; }
.badge.ok { background: var(--ok-weak); color: var(--ok); }
.badge.warn { background: var(--warn-weak); color: var(--warn); }
.badge.bad { background: var(--bad-weak); color: var(--bad); }
.badge.gray { background: var(--card-2); color: var(--muted); border: 1px solid var(--line); }
.basis small { display: block; color: var(--muted); font-size: 12px; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
td.edit { width: 96px; }
.val { border: 1px dashed transparent; background: transparent; border-radius: 7px; padding: 3px 7px; min-width: 70px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.val:hover { border-color: var(--line-2); background: var(--card); }
.val.inh { color: var(--muted); font-weight: 400; font-style: italic; }
.val.none { color: var(--line-2); font-weight: 400; }
td.edit input { padding: 4px 7px; width: 88px; text-align: right; }
.go { color: var(--muted); }
tr.pair-row:hover .go { color: var(--accent); }

/* пакетная панель */
.bulk { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 30; background: var(--text); color: var(--bg); border-radius: 14px; padding: 8px 8px 8px 16px; display: flex; gap: 8px; align-items: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); transition: transform .16s ease, opacity .16s ease; max-width: calc(100vw - 24px); }
.bulk.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.bulk .btn { background: transparent; border-color: color-mix(in srgb, var(--bg) 35%, transparent); color: var(--bg); }
.bulk .btn.primary { background: var(--bg); color: var(--text); border-color: var(--bg); }
.bulk .btn:hover { border-color: var(--bg); }

/* панель справа */
.overlay { position: fixed; inset: 0; background: rgba(8, 12, 20, .45); z-index: 40; opacity: 0; transition: opacity .16s; }
.overlay.show { opacity: 1; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(580px, 100vw); background: var(--bg); z-index: 41; transform: translateX(28px); opacity: 0; transition: transform .18s ease, opacity .18s ease; display: flex; flex-direction: column; border-left: 1px solid var(--line); box-shadow: -12px 0 40px rgba(0, 0, 0, .12); }
.drawer.show { transform: none; opacity: 1; }
.drawer-head { padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--card); display: flex; align-items: flex-start; gap: 12px; }
.drawer-head h2 { font-size: 18px; line-height: 1.25; }
.drawer-head .x { margin-left: auto; }
.drawer-body { padding: 16px 18px 24px; overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 14px; }
.drawer-foot { padding: 12px 18px; border-top: 1px solid var(--line); background: var(--card); display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.drawer-foot .err { margin-right: auto; }
.box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.box h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 10px; }
.hero { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.hero .big { font-size: 34px; font-weight: 800; line-height: 1; }
.hero .unit { color: var(--muted); padding-bottom: 3px; }
.steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.steps li { position: relative; padding-left: 20px; font-size: 13.5px; }
.steps li::before { content: ""; position: absolute; left: 4px; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); }
.steps li.key::before { background: var(--accent); }
.steps li.warn::before { background: var(--warn); }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.four { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.preview { border-radius: var(--radius); padding: 11px 14px; background: var(--card-2); border: 1px dashed var(--line-2); font-size: 13.5px; }
.preview.has { background: var(--accent-weak); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); }
.preview.bad { background: var(--bad-weak); border: 1px solid color-mix(in srgb, var(--bad) 35%, var(--line)); color: var(--bad); }
.preview .t { font-weight: 650; margin-bottom: 4px; }
.pv-row { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; padding: 2px 0; }
.pv-row .nm { color: var(--muted); }
.pv-row .vals { font-variant-numeric: tabular-nums; font-weight: 650; text-align: right; }
.pv-row .vals small { font-weight: 400; color: var(--muted); margin-left: 6px; }
.up { color: var(--up); } .down { color: var(--down); }
details.more { margin-top: 12px; }
details.more > summary { cursor: pointer; font-weight: 600; color: var(--muted); padding: 4px 0; list-style: none; display: flex; align-items: center; gap: 6px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "▸"; font-size: 11px; transition: transform .12s; }
details.more[open] > summary::before { transform: rotate(90deg); }
details.more[open] > summary { margin-bottom: 10px; }

/* списки конкурентов */
.list { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.list-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 8px; align-items: center; padding: 7px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.list-row:last-child { border-bottom: 0; }
.list-row.off { color: var(--muted); }
.list-row.off .nm { text-decoration: line-through; text-decoration-color: var(--line-2); }
.list-row.lead { background: var(--ok-weak); }
.list-row small { color: var(--muted); display: block; font-size: 11.5px; }
.list-row .why { color: var(--warn); }
.list-row.me { background: var(--accent-weak); color: var(--accent); font-weight: 650; grid-template-columns: 1fr auto; }
.switch { position: relative; width: 34px; height: 20px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; background: var(--line-2); border-radius: 999px; transition: background .12s; }
.switch i::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .12s; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(14px); }
.switch input:disabled { cursor: default; }
.switch input:disabled + i { opacity: .45; }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.tagbox { max-height: 150px; overflow-y: auto; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; border: 1px solid var(--line-2); border-radius: 10px; padding: 6px; background: var(--card); min-height: 42px; }
.tagbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.tagbox input { border: 0; box-shadow: none !important; flex: 1; min-width: 120px; padding: 4px 6px; background: transparent; }
.tag { display: inline-flex; align-items: center; gap: 2px; background: var(--card-2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 3px 1px 10px; font-size: 13px; }
.tag button { border: 0; background: transparent; color: var(--muted); padding: 0 6px; font-size: 15px; line-height: 20px; border-radius: 999px; }
.tag button:hover { color: var(--bad); }

/* правила */
.cards { display: grid; gap: 14px; }
.cards > * { min-width: 0; }
.section { padding: 18px 20px; }
.section h2 { font-size: 16px; margin-bottom: 2px; }
.section > p { margin: 0 0 14px; color: var(--muted); }
.two-col { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.prof-title { font-weight: 650; margin-bottom: 10px; display: flex; gap: 8px; align-items: center; }
.sticky-save { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line-2); transform: translateY(100%); transition: transform .16s ease; }
.sticky-save.show { transform: none; }
.sticky-in { max-width: 1320px; margin: 0 auto; padding: 10px 20px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sticky-in .msg { flex: 1; min-width: min(200px, 100%); font-size: 13.5px; max-height: 96px; overflow: auto; }
.fiat-table td, .fiat-table th { padding: 8px 12px; }
.fiat-table .dim { color: var(--muted); }

/* журнал */
.day { margin: 18px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; }
.log-item { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; gap: 14px; align-items: flex-start; }
.log-item:last-child { border-bottom: 0; }
.log-item .time { color: var(--muted); font-size: 12.5px; width: 44px; flex: none; padding-top: 1px; }
.log-item .main { flex: 1; min-width: 0; }
.log-item .who { font-weight: 650; }
.log-item ul { margin: 4px 0 0; padding: 0; list-style: none; display: grid; gap: 2px; font-size: 13px; }
.log-item .from { color: var(--muted); }
.log-item.undone .main { opacity: .55; }
.log-item.undone ul { text-decoration: line-through; }

/* окно подтверждения */
.modal-wrap { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(8, 12, 20, .5); }
.modal { width: 100%; max-width: 440px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); }
.modal h2 { font-size: 17px; margin-bottom: 8px; }
.modal p { margin: 0 0 14px; color: var(--muted); }
.modal .btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); background: var(--text); color: var(--bg); padding: 10px 10px 10px 16px; border-radius: 12px; z-index: 60; opacity: 0; transition: opacity .16s, transform .16s; max-width: min(560px, 92vw); display: flex; align-items: center; gap: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); color: #fff; }
.toast button { border: 1px solid color-mix(in srgb, currentColor 40%, transparent); background: transparent; color: inherit; border-radius: 8px; padding: 4px 10px; font-weight: 650; white-space: nowrap; }
.spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation-duration: 1.5s !important; } }

/* узкие экраны */
@media (max-width: 900px) {
  .top { position: static; }
  .strip { gap: 2px 14px; }
  .top-in { padding: 8px 14px; flex-wrap: wrap; }
  .tabs { order: 3; width: 100%; margin-left: 0; }
  .tab { flex: 1; justify-content: center; }
  .strip { padding: 0 14px 8px; }
  .mode { margin-left: 0; }
  .btn .lbl { display: none; }
  main { padding: 14px 14px 120px; }
  .searchbox { width: 100%; }
  .searchbox kbd { display: none; }
  .toolbar .seg { max-width: 100%; overflow-x: auto; }
  table.rows thead { display: none; }
  table.rows, table.rows tbody, table.rows tr, table.rows td { display: block; width: 100%; }
  table.rows tr.pair-row { display: grid; grid-template-columns: 30px 1fr auto; gap: 2px 6px; padding: 12px 12px; border-bottom: 1px solid var(--line); align-items: center; }
  table.rows tr.pair-row td { border: 0; padding: 0; width: auto; background: transparent !important; }
  table.rows tr.pair-row td.chk { grid-row: 1 / span 2; align-self: start; padding-top: 3px; width: auto; }
  table.rows tr.pair-row td.p { grid-column: 2; }
  table.rows tr.pair-row td.rt { grid-column: 3; text-align: right; }
  table.rows tr.pair-row td.basis { grid-column: 2 / span 2; margin-top: 4px; }
  table.rows tr.pair-row td.edit, table.rows tr.pair-row td.goc { display: none; }
  table.rows tr.group td { display: block; }
  .form-grid, .form-grid.two { grid-template-columns: 1fr 1fr; }
  .sticky-in { padding: 10px 14px; }
  .log-item { flex-direction: column; gap: 4px; }
}
@media (max-width: 520px) {
  .form-grid { grid-template-columns: 1fr; }
  .bulk { flex-wrap: wrap; justify-content: center; padding: 10px; bottom: 12px; }
}
