:root{
  --navy:#0F1F3D; --gold:#C4A882; --ink:#15202b; --mut:#6b7785;
  --line:#e3e7ec; --bg:#f5f7fa; --card:#fff; --bad:#c0392b; --ok:#1e8449;
}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--ink);
  font:14px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif}
a{color:inherit}
.shell{display:flex;min-height:100vh}
.side{width:228px;flex:0 0 228px;background:var(--navy);color:#cfd8e3;display:flex;flex-direction:column}
.brand{padding:20px 18px 14px;border-bottom:1px solid rgba(255,255,255,.1)}
.brand b{display:block;color:#fff;letter-spacing:.14em;font-size:14px}
.brand span{display:block;color:var(--gold);font-size:11px;letter-spacing:.1em;text-transform:uppercase;margin-top:3px}
.brand.big{border:0;text-align:center;padding-bottom:22px}
.nav{padding:10px 0;flex:1}
.nav a{display:block;padding:9px 18px;color:#cfd8e3;text-decoration:none;font-size:13px;border-left:3px solid transparent}
.nav a:hover{background:rgba(255,255,255,.06);color:#fff}
.nav a.on{background:rgba(196,168,130,.16);color:#fff;border-left-color:var(--gold)}
.nav-h{padding:16px 18px 5px;font-size:10px;letter-spacing:.11em;text-transform:uppercase;color:#7d8fa6}
.side-foot{padding:14px 18px;border-top:1px solid rgba(255,255,255,.1);font-size:11px;color:#8fa0b4}
.side-foot a{color:var(--gold)}
/* Sidebar refresh. An installed PWA has no address bar, so without this there
   is no way to re-read the server short of closing the app. */
.refresh-box{padding:8px 0 4px;border-bottom:1px solid rgba(255,255,255,.1)}
.refresh{display:flex;align-items:center;gap:10px;width:100%;
  padding:9px 18px;border:0;border-left:3px solid transparent;
  background:rgba(255,255,255,.07);color:#cfd8e3;
  font:inherit;font-size:13px;text-align:left;cursor:pointer}
.refresh:hover{background:rgba(255,255,255,.14);color:#fff}
.refresh:active{background:rgba(255,255,255,.2)}
.refresh .ic{flex:0 0 auto}
.refresh.spin .ic{animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.freshness{padding:5px 18px 2px;font-size:10px;color:#7d8fa6;line-height:1.3}
.freshness.stale{color:var(--gold)}
.main{flex:1;min-width:0;display:flex;flex-direction:column}
.top{display:flex;align-items:center;gap:14px;padding:18px 26px;background:#fff;border-bottom:1px solid var(--line)}
.top h1{margin:0;font-size:20px;font-weight:650}
.sub{color:var(--mut);font-size:12.5px;margin-top:2px}
.spacer{flex:1}
.wrap{padding:22px 26px 56px;max-width:1500px}
.card{background:var(--card);border:1px solid var(--line);border-radius:10px;padding:18px;margin-bottom:16px}
.card h2{margin:0 0 14px;font-size:13px;letter-spacing:.07em;text-transform:uppercase;color:var(--mut)}
.cols{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.f2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.f3{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
label{display:block;font-size:12px;color:var(--mut);margin-bottom:11px}
label.check{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--ink)}
label.check input{width:auto;margin:0}
label.hl{background:#fffdf3;border:1px solid var(--gold);border-radius:8px;padding:10px;margin:-4px}
.hint{display:block;color:var(--mut);font-size:11.5px;margin-top:5px;line-height:1.4}
input,select,textarea{width:100%;margin-top:4px;padding:7px 9px;border:1px solid #cfd6de;border-radius:6px;
  font:inherit;font-size:13px;background:#fff;color:var(--ink)}
input:focus,select:focus,textarea:focus{outline:2px solid rgba(196,168,130,.5);border-color:var(--gold)}
textarea{resize:vertical}
.btn{display:inline-block;padding:7px 14px;border:1px solid #cfd6de;border-radius:6px;background:#fff;
  font:inherit;font-size:13px;cursor:pointer;text-decoration:none;color:var(--ink)}
.btn:hover{border-color:var(--gold)}
.btn.primary{background:var(--navy);border-color:var(--navy);color:#fff}
.btn.primary:hover{background:#172c54}
.btn.tiny{padding:2px 7px;font-size:12px;color:var(--bad)}
.actions-bar{margin:0 0 16px}
.toolbar{display:flex;gap:9px;margin-bottom:14px}
.toolbar input{flex:1;margin:0}.toolbar select{width:auto;margin:0}
.legend{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:14px}
.chips{display:flex;flex-wrap:wrap;gap:6px}
.chip{display:inline-flex;align-items:center;gap:6px;background:#fff;border:1px solid var(--line);
  border-radius:20px;padding:4px 11px;font-size:12px}
.chip i{width:10px;height:10px;border-radius:50%;border:1px solid rgba(0,0,0,.14)}
.grid{width:100%;border-collapse:collapse;background:#fff;border:1px solid var(--line);border-radius:10px;overflow:hidden}
.grid th{text-align:left;padding:9px 11px;font-size:11px;letter-spacing:.05em;text-transform:uppercase;
  color:var(--mut);background:#fafbfc;border-bottom:1px solid var(--line);white-space:nowrap}
.grid td{padding:9px 11px;border-bottom:1px solid #eef1f4;vertical-align:top}
.grid.tight td,.grid.tight th{padding:6px 9px}
.grid tbody tr:last-child td{border-bottom:0}
.r{text-align:right}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12.5px}
.mut{color:var(--mut);font-size:11.5px}
.bad{color:var(--bad);font-weight:600}
.warn{color:#b9770e}
.empty{text-align:center;color:var(--mut);padding:26px}
/* Her colours. A soft tint keeps 50 rows readable; the solid stripe is what
   she actually scans by, and it is the exact hex from her own sheet. */
tr.row{cursor:pointer}
tr.row:hover{background:#fafcff}
tr.row td.stripe{border-left:6px solid var(--c);width:24px;padding-left:6px}
tr.row td:nth-child(2){white-space:nowrap}
tr.row td{background:color-mix(in srgb, var(--c) 13%, #fff)}
tr.row.att td{background:color-mix(in srgb, #E06666 13%, #fff)}
tr.row.att td.stripe{border-left-color:#E06666}
.bang{display:inline-block;width:17px;height:17px;line-height:16px;text-align:center;border-radius:50%;
  background:#E06666;color:#fff;font-weight:700;font-size:12px}
.pill{display:inline-block;padding:2px 9px;border-radius:20px;font-size:11.5px;
  border:1px solid rgba(0,0,0,.14);white-space:nowrap}
.pill.big{font-size:12px;vertical-align:middle;margin-left:8px}
.est{display:inline-block;padding:0 6px;border-radius:10px;background:#f0e6d2;color:#7a5c25;
  font-size:10.5px;margin-left:5px;cursor:help}
.banner{display:flex;gap:11px;align-items:flex-start;padding:12px 14px;border-radius:9px;margin-bottom:16px;font-size:13px}
.banner b:first-child{font-size:16px;line-height:1}
.b-bad{background:#fdecea;border:1px solid #f5c2bd;color:#8c2a1c}
.b-ok{background:#eaf7ef;border:1px solid #bfe3cd;color:#1b5e35}
.b-info{background:#eef4fd;border:1px solid #c6d9f5;color:#1f4a86}
/* Editable line grid: inputs sit in real table cells so they line up with the
   headers, and the computed columns to their right stay read-only. */
/* Explicit widths: a <select> shows its selected option truncated to the cell,
   so «Товар» and «За» were displaying nothing after a choice was made. */
table.lines{min-width:1600px;table-layout:fixed}
table.lines td.short{color:var(--bad);font-weight:600}
col.c-sku{width:270px}
col.c-pack{width:128px}
col.c-unit{width:118px}
col.c-n{width:88px}
col.c-calc{width:98px}
col.c-acts{width:74px}

/* Headers here must wrap. The table-wide `white-space: nowrap` made
   «Факт. кол-во», «Факт. вес, кг» and «Логистика $» overflow their cells and
   run into the next column — the text needed 101px in an 82px cell. Two lines,
   aligned to the bottom so single-line neighbours still line up. */
table.lines thead th{white-space:normal;line-height:1.2;vertical-align:bottom;
  padding-top:8px;hyphens:none}
/* A divider where typing stops and calculation starts. */
table.lines thead th:nth-child(10),
table.lines tbody td:nth-child(10){border-left:2px solid var(--line)}
table.lines tbody td:nth-child(n+10):nth-child(-n+14){background:#fafbfc}
.addbar{display:flex;align-items:center;gap:14px;margin-top:12px;flex-wrap:wrap}
.addbar .mut{flex:1;min-width:280px}
.btn.tiny.del{color:var(--bad)}
table.lines td{vertical-align:middle;padding:4px 5px}
table.lines input,table.lines select{margin:0;padding:5px 6px;font-size:12.5px;width:100%}
table.lines input.n{text-align:right;font-variant-numeric:tabular-nums}
table.lines td.acts{white-space:nowrap;text-align:right}
table.lines tr.addrow td{background:#fbfcfe;border-top:2px solid var(--line)}
.btn.tiny.save{color:var(--ok);font-weight:700}
.btn.tiny{padding:3px 8px}
.lineform input,.lineform select{margin:0}
.totals{margin-top:11px;padding-top:11px;border-top:1px solid var(--line);font-size:13px;font-weight:600}
.login-body{display:flex;align-items:center;justify-content:center;min-height:100vh;background:var(--navy)}
.login-card{background:#fff;padding:30px;border-radius:12px;width:330px;box-shadow:0 18px 44px rgba(0,0,0,.3)}
.login-card .brand b{color:var(--navy)}
.btn:disabled{opacity:.5;cursor:progress}
.login-card .btn{width:100%;margin-top:8px}
ul{margin:0;padding-left:20px}li{margin-bottom:7px}
p{margin:0 0 11px}
@media (max-width:1000px){.cols,.f2,.f3{grid-template-columns:1fr}.side{width:62px;flex-basis:62px}
  .brand span,.nav a span,.nav-h,.side-foot,.refresh span,.freshness{display:none}
  .refresh{justify-content:center;padding:11px 0}.refresh-box{padding:6px 0}}

/* ---------------------------------------------------------------- v2 */
.ic{width:17px;height:17px;flex:0 0 17px}
.nav a{display:flex;align-items:center;gap:10px}
.side-foot b{color:#fff}
h3.mini{margin:16px 0 7px;font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--mut)}
h3.mini:first-child{margin-top:0}
.mt{margin-top:11px}

/* KPI strip */
.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(172px,1fr));gap:12px;margin-bottom:16px}
.kpi{display:flex;flex-direction:column;gap:3px;background:#fff;border:1px solid var(--line);
  border-radius:10px;padding:14px 16px;text-decoration:none;color:inherit;transition:border-color .12s}
a.kpi:hover{border-color:var(--gold)}
.k-lab{font-size:11px;letter-spacing:.05em;text-transform:uppercase;color:var(--mut)}
.k-val{font-size:26px;font-weight:660;line-height:1.15;font-variant-numeric:tabular-nums}
.k-sub{font-size:11.5px;color:var(--mut)}
.kpi.k-bad{border-color:#f0b9b2;background:#fffafa}
.kpi.k-bad .k-val{color:var(--bad)}

/* charts */
.chart{width:100%;height:auto;max-height:230px;display:block}
/* Stacked pipeline bar. Flex widths, native type — see charts.pipeline_bar. */
.pipe{display:flex;width:100%;border-radius:7px;overflow:hidden;border:1px solid var(--line)}
.pipe-seg{display:flex;align-items:center;justify-content:center;min-width:3px;
  font-size:12px;font-weight:650;font-variant-numeric:tabular-nums;
  box-shadow:inset -1px 0 0 rgba(0,0,0,.08)}
.pipe-seg:last-child{box-shadow:none}
.spark{display:inline-block;vertical-align:middle;margin-left:7px;width:96px;height:22px;opacity:.75}
.b-warn{background:#fff8e8;border:1px solid #f0dcae;color:#7a5c11}

/* sortable headers */
a.sorth{color:inherit;text-decoration:none;white-space:nowrap}
a.sorth:hover{color:var(--navy);text-decoration:underline}
a.sorth.on{color:var(--navy);font-weight:700}
a.sorth.on::after{content:" ↓";font-weight:400}

/* chips that are also links/filters */
a.chip{text-decoration:none;transition:border-color .12s,background .12s}
a.chip:hover{border-color:var(--gold)}
a.chip.on{background:var(--navy);color:#fff;border-color:var(--navy)}

/* segmented control */
.seg{display:inline-flex;border:1px solid #cfd6de;border-radius:6px;overflow:hidden}
.seg a{padding:7px 13px;font-size:13px;text-decoration:none;color:var(--ink);background:#fff;white-space:nowrap}
.seg a+a{border-left:1px solid #cfd6de}
.seg a.on{background:var(--navy);color:#fff}

/* coverage grid */
.scroll-x{overflow-x:auto;border-radius:10px;-webkit-overflow-scrolling:touch}
@media (max-width:1000px){.scroll-x .grid{min-width:760px}}
table.cov{min-width:900px}
table.cov th.mon{font-size:10px}
/* Shading every negative month turns the table into a wall of pink and hides
   the one cell that matters. Only the month the balance first goes negative is
   filled; after that the red number carries it. */
table.cov td.neg{color:var(--bad)}
table.cov td.neg.first{background:#fdecea;font-weight:700;box-shadow:inset 2px 0 0 var(--bad)}
table.cov .inc{color:var(--ok);font-size:10.5px;font-weight:600}
th.sticky,td.sticky{position:sticky;left:0;z-index:2;background:#fff;box-shadow:1px 0 0 var(--line)}
thead th.sticky{background:#fafbfc;z-index:3}

/* grouped product blocks */
.grp{padding-bottom:8px}
.grp-head{display:flex;align-items:flex-start;gap:12px;margin-bottom:10px}
.grp-title{font-size:15px;font-weight:650;color:var(--navy);text-decoration:underline;
  text-decoration-color:var(--gold);text-decoration-thickness:2px;text-underline-offset:3px}
.grp-title:hover{text-decoration-color:var(--navy)}
.grp-kg{text-align:right;font-size:15px;font-weight:650;font-variant-numeric:tabular-nums}
.card.ident{padding:14px 18px 16px}
/* Supplier names are long, an incoterm is three letters. */
.card.ident .f3{grid-template-columns:2.2fr 1.4fr .9fr}
@media (max-width:1000px){.card.ident .f3{grid-template-columns:1fr}}
.card.empty{text-align:center;color:var(--mut);padding:30px}

.grid td,.grid th{font-variant-numeric:tabular-nums}
@media (max-width:1000px){
  .kpis{grid-template-columns:repeat(2,1fr)}
  .side{width:56px;flex-basis:56px}
  /* The wordmark has to go too, not just the strapline, or it spills out of the
     56px rail and sits on top of the page content. */
  .nav a span,.brand span,.brand b,.nav-h,.side-foot,.refresh span,.freshness{display:none}
  .brand{padding:16px 0;text-align:center}
  .nav a{justify-content:center;padding:11px 0}
  .wrap{padding:16px 14px 48px}
  .top{padding:14px 16px}
  .toolbar{flex-wrap:wrap}
  .toolbar input{min-width:100%}
  .lineform{grid-template-columns:1fr 1fr}
}

/* ================================================================ phone
   The 56px icon rail was 15% of a 375px screen and its twelve glyphs were
   unlabelled. On a phone the same sidebar markup becomes a drawer, and the
   screens each role actually lives in move to a bottom bar within thumb reach.
   Everything above 720px is untouched. */
.scrim, .burger, .tabbar { display: none; }

@media (max-width: 720px) {
  /* --- drawer ------------------------------------------------------- */
  .side {
    position: fixed; top: 0; bottom: 0; left: 0; width: 276px; flex-basis: auto;
    z-index: 60; transform: translateX(-100%); transition: transform .22s ease;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
  }
  body.nav-open .side { transform: none; box-shadow: 0 0 44px rgba(0,0,0,.45); }
  body.nav-open { overflow: hidden; }
  /* A class selector beats the UA rule for [hidden], so this must only paint
     while the drawer is open or it greys out the whole page. */
  .scrim { position: fixed; inset: 0; z-index: 55; background: rgba(15,31,61,.45); }
  body.nav-open .scrim { display: block; }
  /* the labels the rail had to drop come back inside the drawer */
  .brand b, .brand span, .nav a span, .nav-h, .side-foot,
  .refresh span, .freshness { display: block; }
  .brand { padding: 20px 18px 14px; text-align: left; }
  .nav a { justify-content: flex-start; padding: 13px 18px; font-size: 14px; }
  .nav-h { padding: 18px 18px 5px; }
  .refresh { justify-content: flex-start; padding: 13px 18px; }
  .refresh-box { padding: 8px 0 4px; }
  .side-foot { font-size: 12px; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }

  /* --- bottom bar --------------------------------------------------- */
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: #fff; border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -2px 14px rgba(15,31,61,.06);
  }
  .tabbar a, .tabbar button {
    flex: 1 1 0; min-width: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 3px;
    padding: 9px 2px 8px; min-height: 54px;
    font: inherit; font-size: 10.5px; line-height: 1.1; text-align: center;
    color: var(--mut); text-decoration: none; background: none; border: 0;
    border-top: 2px solid transparent; cursor: pointer;
  }
  .tabbar span { display: block; max-width: 100%; overflow: hidden;
                 text-overflow: ellipsis; white-space: nowrap; }
  .tabbar .ic { width: 21px; height: 21px; flex: 0 0 21px; }
  .tabbar a.on { color: var(--navy); border-top-color: var(--gold); font-weight: 600; }
  .tabbar a:active, .tabbar button:active { background: #f2f5f9; }

  /* --- header ------------------------------------------------------- */
  .top {
    position: sticky; top: 0; z-index: 40; flex-wrap: wrap; gap: 10px;
    padding: 10px 14px 12px; align-items: flex-start;
  }
  .burger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; flex: 0 0 40px; margin: -2px 0 0 -6px;
    border: 0; border-radius: 9px; background: none; color: var(--ink); cursor: pointer;
  }
  .burger:active { background: #eef1f5; }
  .burger .ic { width: 22px; height: 22px; flex: 0 0 22px; }
  .ttl { min-width: 0; flex: 1 1 auto; }
  .top h1 { font-size: 18px; line-height: 1.25; }
  .top .pill.big { display: inline-block; margin: 5px 0 0 0; }
  .sub { font-size: 12px; }
  .acts { flex: 0 0 100%; display: flex; gap: 8px; }
  .acts .btn { flex: 1 1 auto; text-align: center; }

  /* --- body rhythm and touch targets -------------------------------- */
  .wrap { padding: 14px 12px calc(78px + env(safe-area-inset-bottom)); }
  .card { padding: 14px; border-radius: 12px; margin-bottom: 12px; }
  .card h2 { margin-bottom: 11px; }
  /* 16px is the threshold below which iOS zooms the page on focus */
  input, select, textarea { font-size: 16px; padding: 10px 11px; margin-top: 5px; }
  label { font-size: 12.5px; margin-bottom: 14px; }
  .btn { padding: 11px 16px; font-size: 15px; border-radius: 8px; }
  .btn.tiny { padding: 6px 10px; font-size: 13px; }
  .chip { padding: 7px 12px; font-size: 12.5px; }
  .toolbar { gap: 8px; }
  .toolbar select { width: 100%; }
  .seg { width: 100%; }
  .seg a { flex: 1 1 0; text-align: center; padding: 10px 8px; font-size: 14px; }
  .kpis { gap: 10px; }
  .kpi { padding: 12px 13px; }
  .k-val { font-size: 22px; }
  .k-lab { font-size: 10px; }

  /* --- tables ------------------------------------------------------- */
  /* Edge shadows that appear only when there is more table to scroll to. */
  .scroll-x {
    background:
      linear-gradient(90deg, var(--card) 30%, rgba(255,255,255,0)),
      linear-gradient(90deg, rgba(255,255,255,0), var(--card) 70%) 100% 0,
      radial-gradient(farthest-side at 0 50%, rgba(15,31,61,.16), transparent),
      radial-gradient(farthest-side at 100% 50%, rgba(15,31,61,.16), transparent) 100% 0;
    background-repeat: no-repeat;
    background-size: 34px 100%, 34px 100%, 13px 100%, 13px 100%;
    background-attachment: local, local, scroll, scroll;
  }
  .grid td, .grid th { padding: 11px 10px; }
  .grid.tight td, .grid.tight th { padding: 9px 9px; }

  /* Product groups: the inner table has six columns and was running off the
     card, so each shipment becomes one wrapping line instead. */
  .grp .grid.tight, .grp .grid.tight tbody, .grp .grid.tight tr,
  .grp .grid.tight td { display: block; }
  .grp .grid.tight { border: 0; background: none; }
  .grp tr.row {
    position: relative; display: flex; flex-wrap: wrap; align-items: center;
    gap: 5px 12px; padding: 11px 12px 11px 17px; margin-bottom: 7px;
    border: 1px solid var(--line); border-radius: 9px;
    background: color-mix(in srgb, var(--c) 13%, #fff);
  }
  .grp tr.row.att { background: color-mix(in srgb, #E06666 13%, #fff); }
  .grp tr.row td { padding: 0; border: 0; background: none; white-space: normal; }
  .grp tr.row td.stripe {
    position: absolute; left: 0; top: 0; bottom: 0; width: 6px; padding: 0;
    border: 0; border-radius: 9px 0 0 9px; background: var(--c);
  }
  .grp tr.row.att td.stripe { background: #E06666; }
  .grp tr.row td:nth-child(2) { flex: 1 1 100%; font-weight: 600; }
  /* Right-aligned cells become a zigzag once the row is a flex line. */
  .grp tr.row td.r, .grid.cards td.r { text-align: left; }
  .grp-head { display: block; }
  .grp-kg { text-align: left; margin-top: 7px; font-size: 14px; }
  .grp-kg .mut { display: inline; margin-left: 7px; }
  .grp-title { font-size: 15px; }

  /* --- shipment card ------------------------------------------------ */
  /* One save button for a long form: keep it reachable instead of making
     them scroll back down to it. */
  .actions-bar {
    position: sticky; bottom: calc(56px + env(safe-area-inset-bottom)); z-index: 30;
    margin: 0 0 12px; padding: 9px 0;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
  }
  .actions-bar .btn { width: 100%; padding: 13px; font-size: 15px; }
  .actions-bar .mut { display: block; margin-top: 7px; text-align: center; }
  .addbar .btn { width: 100%; }
  .addbar .mut { min-width: 0; }
  .banner { padding: 11px 12px; font-size: 12.5px; }
  .totals { font-size: 14px; }
}

/* Very narrow phones: five tabs will not fit legibly. */
@media (max-width: 370px) {
  .tabbar span { font-size: 9.5px; }
  .tabbar a, .tabbar button { padding: 8px 1px 7px; }
}

@media (max-width: 720px) {
  /* Filter chips: one scrolling strip instead of six stacked rows. */
  .legend.strip {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; margin: 0 -12px 12px; padding: 0 12px 2px;
  }
  .legend.strip::-webkit-scrollbar { display: none; }
  .legend.strip .chip { flex: 0 0 auto; }

  /* A 1100px-wide table dragged through a 350px window is not a list. Each
     row becomes a card, with the column header carried down as a caption. */
  .grid.cards, .grid.cards tbody, .grid.cards tr, .grid.cards td { display: block; }
  /* `.scroll-x .grid{min-width:760px}` from the tablet rules was still
     forcing these 760px wide, so the cards never wrapped. */
  .grid.cards, .scroll-x .grid.cards { border: 0; background: none;
    overflow: visible; min-width: 0; width: 100%; }
  .grid.cards thead { display: none; }
  .scroll-x:has(.grid.cards) { background: none; overflow: visible; }
  .grid.cards tr.row {
    position: relative; display: flex; flex-wrap: wrap; align-items: baseline;
    gap: 7px 14px; margin-bottom: 9px; padding: 12px 13px 12px 18px;
    border: 1px solid var(--line); border-radius: 11px;
    background: color-mix(in srgb, var(--c) 13%, #fff);
  }
  .grid.cards tr.row.att { background: color-mix(in srgb, #E06666 13%, #fff); }
  .grid.cards tr.row td { padding: 0; border: 0; background: none; white-space: normal; }
  .grid.cards td.stripe {
    position: absolute; left: 0; top: 0; bottom: 0; width: 6px; padding: 0;
    border: 0; border-radius: 11px 0 0 11px; background: var(--c);
  }
  .grid.cards tr.row.att td.stripe { background: #E06666; }
  .grid.cards td.stripe .bang { position: absolute; left: 13px; top: 11px; }
  .grid.cards tr.row.att td.c-ship { padding-left: 24px; }
  .grid.cards td[data-l]::before {
    content: attr(data-l); display: block; color: var(--mut);
    font-size: 9.5px; letter-spacing: .05em; text-transform: uppercase;
    margin-bottom: 1px; font-weight: 600;
  }
  .grid.cards td:empty { display: none; }
  /* reading order: what it is, then where it is, then when */
  .grid.cards td.c-ship { order: 1; flex: 1 1 auto; font-size: 14.5px; }
  .grid.cards td.c-st   { order: 2; flex: 0 0 auto; margin-left: auto; }
  .grid.cards td.c-route{ order: 3; flex: 1 1 100%; }
  .grid.cards td.c-cont { order: 4; }
  .grid.cards td.c-line { order: 5; }
  .grid.cards td.c-fr   { order: 6; text-align: left; }
  .grid.cards td.c-etd  { order: 7; }
  .grid.cards td.c-etap { order: 8; }
  .grid.cards td.c-etaw { order: 9; }
  .grid.cards td.c-kg   { order: 4; text-align: left; }
  .grid.cards .empty { display: block; padding: 22px; }
}

@media (max-width: 720px) {
  .top { transition: padding .16s ease; }
  .top .sub, .acts { transition: opacity .14s ease; }
  body.hdr-min .top { padding-top: 7px; padding-bottom: 7px; }
  body.hdr-min .top .sub { display: none; }
  body.hdr-min .acts { display: none; }
  body.hdr-min .top h1 { font-size: 16px; }
  body.hdr-min .top .pill.big { font-size: 11px; margin-top: 3px; }
}

@media (max-width: 720px) {
  /* login */
  .login-card { width: 100%; max-width: 360px; margin: 0 14px; padding: 26px 22px; }
  .login-body { padding: 18px 0; }
  /* the arrivals list view leads with a long product name */
  .grid.cards td.c-ship { line-height: 1.3; }
  /* a tapped card should feel like a button */
  .grid.cards tr.row:active, .grp tr.row:active { filter: brightness(.97); }
  tr.row:hover { background: none; }
}

/* Read-only shipment card for sales */
.view-head { display: grid; grid-template-columns: 2fr 1.3fr 1.3fr; gap: 14px 22px; }
.vf { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.vl { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--mut); }
.vv { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.vv.big { font-size: 21px; color: var(--navy); font-variant-numeric: tabular-nums; }
/* A header with no action buttons should not leave an empty row behind. */
.acts:not(:has(*)) { display: none; }
@media (max-width: 720px) {
  .view-head { grid-template-columns: 1fr 1fr; }
  .view-head .vf:first-child { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  /* Goods on the sales card read in column order: name, then pack, qty,
     weight, cost. The shared card ordering is tuned for shipments instead. */
  .grid.cards.goods td { order: 0; }
  .grid.cards.goods td.c-ship { flex: 1 1 100%; }
}

/* «план»: the imports manager's date, shown until a vessel exists */
.est.plan { background: #e3ecfa; color: #1f4a86; }
.late-plan { margin-top: 3px; font-size: 11px; font-weight: 600; color: var(--bad); }
label.plan-field .ro { display: block; margin-top: 4px; padding: 7px 9px; border: 1px dashed #cfd6de;
  border-radius: 6px; background: #f7f8fa; color: var(--ink); font-size: 13px; min-height: 33px; }
@media (max-width: 720px) { label.plan-field .ro { font-size: 16px; padding: 10px 11px; } }

/* ---------------------------------------------------------- logistics */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.track { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  flex: 0 0 26px; border-radius: 6px; border: 1px solid #cfd6de; background: #fff; color: var(--navy);
  text-decoration: none; cursor: pointer; vertical-align: middle; }
.track:hover { border-color: var(--gold); background: #f6efe2; }
.track svg { width: 14px; height: 14px; }
.track.off { opacity: .35; cursor: help; }
.with-track { display: flex; align-items: center; gap: 6px; }
.with-track input { flex: 1; min-width: 0; }
td .with-track { display: inline-flex; }
.tag-ro { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: #7a5c25;
  background: #f4ecdc; border-radius: 999px; padding: 1px 7px; margin-left: 6px; vertical-align: 2px; }
tr.row.static { cursor: default; }
.app-toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 22px; z-index: 80;
  max-width: min(560px, calc(100% - 32px)); background: var(--navy); color: #fff; padding: 10px 15px;
  border-radius: 9px; font-size: 13px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.5); }
.mobile-note { display: none; }

/* the table */
.sheet-tools { margin-bottom: 8px; }
/* Umed's workbook tabs over the table (admin only), drawn as sheet tabs on the grid. */
.sheet-tabs { display: flex; flex-wrap: wrap; gap: 3px; padding: 0 8px; margin-bottom: -1px; position: relative; z-index: 1; }
.sheet-tabs button { display: inline-flex; align-items: baseline; gap: 6px; padding: 7px 13px 8px; font: inherit; font-size: 13px;
  color: #3f4b5a; background: #e9edf2; border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0; cursor: pointer; }
.sheet-tabs button:hover { background: #f4f6f9; color: var(--ink); }
.sheet-tabs button span { font-size: 11px; color: var(--mut); font-variant-numeric: tabular-nums; }
.sheet-tabs button.on { background: #fff; color: var(--navy); font-weight: 700; box-shadow: inset 0 3px 0 var(--gold); }
.sheet-tabs button.on span { color: var(--navy); }
.sheet-tabs button.zero { color: #9aa5b3; }
.sheet-tabs button.zero span { color: #b3bcc7; }
.sheet-tabs + .sheet-wrap { border-top-left-radius: 0; }
.sheet tr.tabhead td { height: 34px; padding: 0 10px; background: var(--navy); color: #fff; font-size: 13px;
  font-weight: 700; letter-spacing: .02em; border-right: 0; }
/* Goods under each shipment (admin only): rows of the table itself. The name
   sits in the frozen first column, so it scrolls sideways with nothing. */
.sheet tr.gl > td, .sheet tr.ghead > td, .sheet tr.gtot > td, .sheet tr.gadd > td {
  height: 32px; padding: 0; background-color: #fbfaf7; border-right: 0; border-bottom: 1px solid #f0ece2; }
.sheet tr.ghead > td { height: 26px; }
.sheet tr.gadd > td { height: 38px; border-bottom: 1px solid var(--line); }
/* Indented past a thin guide line that ties the products to their shipment.
   Text labels line up with the text inside the product inputs (border + padding). */
.sheet tr.gl > td.gname, .sheet tr.ghead > td.gname, .sheet tr.gtot > td.gname, .sheet tr.gadd > td.gname {
  padding: 0 6px 0 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background-image: linear-gradient(#e3d7bd, #e3d7bd); background-size: 2px 100%;
  background-position: 13px 0; background-repeat: no-repeat; }
.sheet tr.ghead > td.gname, .sheet tr.gtot > td.gname { padding-left: 31px; }
.sheet tr.gadd > td.gname { background-image: none; }
.sheet .gcells { display: flex; align-items: center; height: 100%; width: 100%; }
.sheet .gcell { flex: none; display: block; padding: 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet .gcell.r { text-align: right; }
.sheet .gcell.gc { padding: 0 7px; color: #3f4b5a; }
.sheet .gcell.gx { flex: 0 0 34px; width: 34px; padding: 0 0 0 4px; }
.sheet tr.ghead td.gname, .sheet tr.ghead .gcell { font-size: 11px; font-weight: 600; color: #8a94a1; }
.sheet tr.ghead .gcell { padding: 0 7px; }
.sheet tr.gtot td.gname, .sheet tr.gtot .gcell { font-weight: 700; color: var(--navy); }
.sheet tr.gtot .gcell { padding: 0 5px 0 2px; }
.sheet tr.gtot .gpl { margin-left: 10px; font-weight: 600; color: #3f4b5a; }
.sheet .gnone { margin-left: 10px; color: var(--mut); font-size: 12px; }
.sheet .gi { width: 100%; height: 26px; margin: 0; padding: 0 6px; border: 1px solid transparent; border-radius: 4px;
  background: transparent; font: inherit; font-size: 12.5px; color: var(--ink); text-overflow: ellipsis; }
.sheet select.gi { padding-right: 2px; cursor: pointer; }
.sheet .gi.n { text-align: right; }
/* Sales read the goods (05.11.2026): text where admin has inputs, inset by the
   inputs' border + padding so every column lines up the same. */
.sheet .gv { display: block; padding: 0 7px; font-size: 12.5px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet .gv.n { text-align: right; }
.sheet .gi:hover { border-color: #dfe4ea; background: #fff; }
.sheet .gi:focus { outline: none; border-color: #2f6fd6; background: #fff; box-shadow: 0 0 0 2px rgba(47,111,214,.15); }
.sheet .gi.dirty { background: #fff3cf; }
.sheet .gi.bad, .sheet .gi.conflict { background: #fdecea; border-color: #e6a29a; }
.sheet tr.gl.new .gi:not(:focus):not(.bad) { background: #eef6ea; }
.sheet tr.gl.del .gi, .sheet tr.gl.del .gc { opacity: .45; text-decoration: line-through; }
.sheet .gbtn { border: 1px dashed #cdbf9f; background: transparent; color: var(--navy); border-radius: 6px;
  padding: 3px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.sheet .gbtn:hover { background: #fff; border-style: solid; }
.sheet .gbtn.x { border: 0; padding: 2px 7px; color: #9aa5b3; font-size: 15px; line-height: 1; }
.sheet .gbtn.x:hover { color: var(--bad); background: #fdecea; }
.sheet tr.tabhead td .hf { margin-left: 8px; color: var(--gold); font-weight: 500; font-size: 12px; letter-spacing: 0; }
.sheet-keys { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--mut); margin-bottom: 10px; }
.sheet-keys kbd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; background: #fff;
  border: 1px solid #cfd6de; border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--ink); }
.sheet-wrap { overflow: auto; max-height: calc(100vh - 290px); min-height: 320px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; outline: none; }
.sheet-wrap:focus-visible { box-shadow: 0 0 0 2px rgba(47,111,214,.35); }
table.sheet { border-collapse: separate; border-spacing: 0; table-layout: fixed; width: max-content;
  min-width: 100%; font-variant-numeric: tabular-nums; font-size: 13px; }
.sheet th { position: sticky; top: 0; z-index: 5; background: #f7f9fb; color: var(--mut); font-size: 10.5px;
  letter-spacing: .06em; text-transform: uppercase; text-align: left; padding: 8px 9px; font-weight: 700;
  border-bottom: 1px solid var(--line); white-space: nowrap; }
.sheet th.ro { color: #9aa5b3; }
.sheet td { padding: 0; height: 42px; vertical-align: middle; background: #fff;
  border-bottom: 1px solid #eef1f4; border-right: 1px solid #eef1f4; }
.sheet td:first-child, .sheet th:first-child { position: sticky; left: 0; z-index: 2; }
.sheet th:first-child { z-index: 6; }
.sheet td:first-child { box-shadow: 1px 0 0 var(--line); }
.sheet tr.block td { height: 30px; padding: 0 10px; background: #f1f4f8; color: var(--navy); font-size: 11.5px;
  font-weight: 700; border-right: 0; }
/* Group and supplier headings stay at the top while their rows scroll under
   them, and their label stays in view when the table is scrolled sideways. */
.sheet tr.tabhead > td, .sheet tr.block > td { position: sticky; top: var(--th, 33px); z-index: 4; }
.sheet.has-tabhead tr.block > td { top: calc(var(--th, 33px) + var(--tabh, 34px)); }
.sheet tr.tabhead .hd, .sheet tr.block .hd { position: sticky; left: 10px; }
.sheet td.empty { padding: 24px; text-align: left; color: var(--mut); }
.sheet .cell { position: relative; display: flex; align-items: center; gap: 6px; height: 100%; min-height: 41px;
  padding: 5px 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: cell; }
.sheet .cell.ro { cursor: default; background: #fafbfc; color: #3f4b5a; }
.sheet .cell.sel { box-shadow: inset 0 0 0 2px #2f6fd6; z-index: 1; }
.sheet .cell.editing { box-shadow: inset 0 0 0 2px #2f6fd6; background: #fff; z-index: 2; overflow: visible; }
.sheet .cell.dirty { background: #fff3cf; }
.sheet .cell.dirty::before { content: ""; position: absolute; top: 0; right: 0; border-style: solid;
  border-width: 0 8px 8px 0; border-color: transparent #e3b84a transparent transparent; }
.sheet .cell.bad, .sheet .cell.conflict { background: #fdecea; box-shadow: inset 0 0 0 1px #e6a29a; }
.sheet .cell input, .sheet .cell select { width: 100%; margin: 0; padding: 0; border: 0; outline: none;
  background: transparent; font: inherit; font-size: 13px; color: var(--ink); }
.sheet .cell .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sheet .cell .mono { font-size: 12.5px; }
.sheet .cell .stripe { position: absolute; left: 0; top: 0; bottom: 0; width: 5px; }
.sheet .c-shipcell { padding-left: 14px; }
.sheet .shiplink { display: flex; flex-direction: column; justify-content: center; line-height: 1.25;
  color: inherit; text-decoration: none; min-width: 0; }
.sheet .shiplink b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.sheet .shiplink:hover b { text-decoration: underline; text-decoration-color: var(--gold); }
.sheet .cell.two { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; line-height: 1.25; }
.sheet .cell .sub { font-size: 10.5px; }
.sheet td.wide .cell { white-space: normal; line-height: 1.3; font-size: 12.5px; }
.sheet-save { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; padding: 10px 12px;
  border-radius: 10px; background: #fff; border: 1px solid var(--line); }
.sheet-save.has { border-color: #e3b84a; background: #fffaf0; }
.sheet-save .msg { flex: 1; min-width: 220px; font-size: 13px; }
@media (max-width: 720px) {
  .nav a.desk-only { display: none; }
  .mobile-note { display: flex; }
  .sheet-wrap { max-height: none; }
  .app-toast { bottom: calc(66px + env(safe-area-inset-bottom)); }
}

/* Remarks run to paragraphs; two lines keep the row height even, the rest is on hover. */
.sheet td.wide .cell { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden; padding-top: 6px; padding-bottom: 6px; }
.sheet td.wide .cell.editing { display: flex; -webkit-line-clamp: unset; }

.sheet .cell input[type=date] { min-width: 0; font-variant-numeric: tabular-nums; }

/* Scrolling list for products and ports in the table. */
.picker { position: fixed; z-index: 90; overflow-y: auto; overscroll-behavior: contain; padding: 4px;
  max-width: min(620px, calc(100vw - 16px)); background: #fff; border: 1px solid #cfd6de; border-radius: 9px;
  box-shadow: 0 14px 36px -14px rgba(15,31,61,.38); font-size: 13px; }
.picker .pk-item { display: flex; align-items: baseline; gap: 12px; padding: 6px 9px; border-radius: 6px;
  cursor: pointer; white-space: nowrap; color: var(--ink); }
.picker .pk-item:hover { background: #f3f6fa; }
.picker .pk-item.on { background: #e8f0fd; }
.picker .pk-l b { font-weight: 700; color: var(--navy); }
.picker .pk-sub { margin-left: auto; padding-left: 12px; color: var(--mut); font-size: 11.5px; }
.picker .pk-empty, .picker .pk-more { padding: 7px 10px; color: var(--mut); font-size: 12px; }

/* cancelled shipments (admin table, with «Включая доставленные» on) */
.sheet tr.cx td{color:#8a939d;text-decoration:line-through;background:#f6f7f8}
/* ---- payments (16.10.2026) ---- */
.ok{color:var(--ok);font-weight:600}
.inline{display:inline}
.lead{max-width:820px;font-size:12.5px;margin:0 0 14px}
.card-head{display:flex;align-items:center;gap:12px;margin-bottom:14px}
.card-head h2{margin:0}
.grid tr.ov td{background:#fff6f5}
.grid tr.paidrow td{background:#f6fbf8}
.grid tr.wk td{background:#f6f8fb;font-weight:650;font-size:12.5px;color:var(--ink);border-top:1px solid var(--line)}
.wk-sum{float:right;font-weight:600;color:var(--mut);font-variant-numeric:tabular-nums}
.pay td.pdue,.pform td.pdue{white-space:nowrap}
.pay td.acts,.pform td.acts{text-align:right}
.nowrap{white-space:nowrap}
.paybox{display:inline-block;position:relative}
.paybox summary{list-style:none}
.paybox summary::-webkit-details-marker{display:none}
.paybox[open]{display:block}
.paybox form{margin-top:8px;width:240px;margin-left:auto;background:#fff;
  border:1px solid var(--gold);border-radius:9px;padding:12px;text-align:left}
.paybox form{white-space:normal}
.paybox form label{display:block;margin-bottom:8px}
.paybox form input{width:100%}
.paybox form .mut{display:block}
.paybox form .btn{width:100%;margin-bottom:6px}
.month{border-top:1px solid var(--line);padding:9px 0}
.month summary{cursor:pointer;display:flex;gap:12px;align-items:baseline}
.month summary .mono{margin-left:auto;font-weight:650}
.month[open] summary{margin-bottom:8px}
.needlist{margin-top:6px;line-height:1.9}
.steps{margin:0;padding-left:20px;line-height:1.7}
.dates{display:grid;grid-template-columns:repeat(4,minmax(120px,1fr));gap:12px}
.dates div{display:flex;flex-direction:column;gap:2px}
.pform input,.pform select,.terms input,.terms select{margin:0;padding:5px 7px;font-size:13px}
.pform .w-label{min-width:120px}.pform .w-n,.terms .w-n{width:70px;text-align:right}
.pform .w-amt{width:100px;text-align:right}.pform .w-cur{width:72px}
.pform .w-trig{min-width:170px}.pform .w-date{width:140px}.pform .w-payer{min-width:140px}
.linkbtn{background:none;border:0;padding:0;color:var(--mut);font:inherit;font-size:11.5px;text-decoration:underline;cursor:pointer}
.termbox{display:inline-block}
.termbox[open]{display:block}
.termbox summary{list-style:none}
.termbox summary::-webkit-details-marker{display:none}
.terms tr.editrow td{background:#fafbfc}
.termform{max-width:900px}
.termform label{max-width:360px}
@media (max-width: 760px){.dates{grid-template-columns:1fr 1fr}}
.pay th.pick,.pay td.pick{width:28px;padding-right:0}
.pay td.pick input{width:auto;margin:2px 0 0}
.bulkbar{position:sticky;top:0;z-index:30;display:flex;flex-wrap:wrap;align-items:center;gap:12px;
  background:#fffdf3;border:1px solid var(--gold);border-radius:10px;padding:10px 14px;margin-bottom:16px}
.bulkbar[hidden]{display:none}
.bulkbar label.check{margin:0}
.bulkbar input[type=date]{width:auto;margin:0 0 0 4px;padding:3px 6px}
.plan tr.editrow td{background:#fafbfc;padding:12px 14px}
.editform{display:flex;flex-wrap:wrap;gap:10px 12px;align-items:flex-end}
.editform label{margin:0;flex:1 1 160px;max-width:240px}
.editform label.n{flex:0 1 96px}
.editform label.wide{flex:2 1 260px;max-width:none}
.editform .editacts{display:flex;gap:8px}
/* payments grid: Umed's «План оплат» layout, calendar weeks */
.pgrid-wrap{overflow-x:auto;border:1px solid var(--line);border-radius:8px}
.pgrid{border-collapse:separate;border-spacing:0;font-size:12.5px;font-variant-numeric:tabular-nums;min-width:100%}
.pgrid th,.pgrid td{border-bottom:1px solid #eef1f4;border-right:1px solid #eef1f4;padding:0;white-space:nowrap;background:#fff}
.pgrid thead th{background:#f6f8fb;font-size:11px;color:var(--mut);font-weight:600;text-align:center;padding:6px}
.pgrid thead th.mon{text-transform:uppercase;letter-spacing:.05em;color:var(--ink);border-bottom:1px solid var(--line)}
.pgrid th.wk a,.pgrid th.hc a{color:inherit;text-decoration:none;display:block}
.pgrid th.wk.cur{background:#fdf6e8;color:#7a5c25}
.pgrid th.hc.od,.pgrid th.hc.od a{color:var(--bad)}
.pgrid th.sup{position:sticky;left:0;z-index:2;width:210px;min-width:210px;max-width:210px;text-align:left;padding:6px 10px;white-space:normal;font-weight:600;font-size:12.5px;color:var(--ink)}
.pgrid th.sup a{color:inherit;text-decoration:none}
.pgrid th.sup a:hover{text-decoration:underline}
.pgrid th.sup .mut{font-weight:400;font-size:10.5px}
.pgrid thead th.sup{z-index:3;color:var(--mut);font-size:11px}
.pgrid .tot{position:sticky;left:210px;z-index:2;min-width:80px;text-align:right;font-weight:700;padding:6px 8px;background:#fafbfc;border-right:2px solid var(--line)}
.pgrid thead .tot{z-index:3;text-align:center}
.pgrid .tot a{color:inherit;text-decoration:none}
.pgrid td.c{min-width:64px;text-align:right}
.pgrid td.c.e{padding:7px 8px}
.pgrid td.c a{display:block;padding:7px 8px;text-decoration:none;color:var(--ink)}
.pgrid td.c a:hover{background:#f3efe6}
.pgrid td.c.od a{color:var(--bad);font-weight:600}
.pgrid td.c.ap a{font-style:italic;color:#5b6876}
.pgrid td.c.sel,.pgrid th.wk.sel{outline:2px solid var(--gold);outline-offset:-2px}
.pgrid tr.selrow th.sup,.pgrid tr.selrow td{background:#fffdf3}
.pgrid tfoot th,.pgrid tfoot td{background:#f6f8fb;font-weight:700;border-top:2px solid var(--line)}
.pgrid tfoot td.c a{color:var(--ink)}
.pgrid tfoot td.c.od a{color:var(--bad)}
.pgrid th.hc.nd,.pgrid td.c.nd{border-right:2px solid var(--line)}
.w-payerf{width:auto;margin:0}

/* Shipment card «Сохранить» (13.11.2026, option C): floats bottom-right and appears only
   once something on the page changed; the gold badge is the number of changes. */
.save-fab{position:fixed;right:24px;bottom:calc(24px + env(safe-area-inset-bottom));z-index:60;
  border-radius:999px;padding:13px 20px;font-size:15px;box-shadow:0 12px 30px -8px rgba(15,31,61,.55)}
.save-fab[hidden]{display:none}
.save-fab::after{content:attr(data-n);display:inline-block;min-width:22px;margin-left:8px;padding:1px 6px;
  border-radius:999px;background:var(--gold);color:var(--navy);font-size:12.5px;font-weight:700;text-align:center}
.save-fab[data-n=""]::after{display:none}
@media (max-width:720px){.save-fab{right:16px;bottom:calc(72px + env(safe-area-inset-bottom))}}
