/* Gol Distribution · Export v1. Use scene: one hand on a phone in a bright fair hall, quick looks between meetings.
   So: light, high contrast, big targets, figures in tabular numerals, one accent (Golach gold) used for actions only. */
:root {
  --ink: #16181b;
  --ink-2: #4a4f57;
  --ink-3: #6b717b;
  --paper: #f6f5f1;
  --card: #ffffff;
  --line: #e3e1da;
  --line-2: #d3d0c6;
  --gold: #c9962e;
  --gold-ink: #16181b;
  --gold-soft: #f5ead2;
  --good: #1d7445;
  --good-soft: #e3f2e8;
  --bad: #a8321f;
  --bad-soft: #f8e4df;
  --warn: #8a5a00;
  --warn-soft: #fbf0d6;
  --r: 12px;
  --shadow: 0 1px 2px rgba(22, 24, 27, .06), 0 6px 18px rgba(22, 24, 27, .07);
  --font: "Schibsted Grotesk", system-ui, sans-serif;
  --nav-h: 68px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 500 16px/1.45 var(--font); font-variant-numeric: tabular-nums; }
::selection { background: var(--gold-soft); color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
a { color: var(--ink); text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance; }
svg.i { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--ink-3); font-weight: 600; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; background: var(--ink); color: #fff; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: baseline; gap: 8px; min-width: 0; overflow: hidden; }
.brand b { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 400px) { .brand { flex-direction: column; gap: 0; line-height: 1.15; } .brand span { font-size: 13px; } }
.brand b { font-weight: 800; font-size: 17px; letter-spacing: -.01em; white-space: nowrap; }
.brand span { color: var(--gold); font-weight: 700; font-size: 15px; }
.top .grow { flex: 1; }
.net { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; min-height: 38px; padding: 0 12px; border-radius: 999px; background: rgba(255,255,255,.1); white-space: nowrap; border: 0; color: #fff; cursor: pointer; }
.net .dot { width: 8px; height: 8px; border-radius: 50%; background: #5fd18a; }
.net.off .dot { background: #f0a43a; }
.net.wait { background: var(--gold); color: var(--ink); }
.net.wait .dot { background: var(--ink); }
.iconbtn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.iconbtn:hover { background: rgba(255,255,255,.08); }
.menu { position: absolute; right: 12px; top: calc(100% + 6px); background: var(--card); color: var(--ink); border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid var(--line); min-width: 220px; padding: 6px; }
.menu button { display: flex; width: 100%; text-align: left; padding: 12px; border: 0; background: none; border-radius: 8px; cursor: pointer; font-weight: 600; }
.menu button:hover { background: var(--paper); }
.menu .who { padding: 10px 12px; color: var(--ink-3); font-size: 14px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }

/* layout */
main { max-width: 1080px; margin: 0 auto; padding: 16px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 0 14px; flex-wrap: wrap; }
.head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.head p { margin: 4px 0 0; color: var(--ink-2); font-size: 15px; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.search { position: relative; flex: 1 1 260px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); width: 20px; height: 20px; }
.search input { width: 100%; height: 48px; padding: 0 14px 0 42px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--card); }
.search input::placeholder { color: #767c86; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.chip { flex: none; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.muted { color: var(--ink-3); }
.small { font-size: 14px; }
.count { color: var(--ink-3); font-size: 14px; font-weight: 600; margin: 0 2px 8px; }

/* lists */
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.row { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line); cursor: pointer; background: none; width: 100%; text-align: left; border-left: 0; border-right: 0; border-bottom: 0; }
.row:first-child { border-top: 0; }
.row:hover { background: #fbfaf7; }
.row .th { width: 56px; height: 56px; border-radius: 8px; background: var(--paper) center/contain no-repeat; flex: none; border: 1px solid var(--line); }
.row .main { flex: 1; min-width: 0; }
.row .t { font-weight: 600; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.row .s { color: var(--ink-3); font-size: 14px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .fig { text-align: right; flex: none; }
.row .fig b { display: block; font-weight: 700; white-space: nowrap; }
.row .fig span { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.more { display: block; width: 100%; padding: 14px; border: 0; border-top: 1px solid var(--line); background: var(--card); font-weight: 700; cursor: pointer; }
.empty { padding: 28px 18px; text-align: center; color: var(--ink-2); }
.empty b { display: block; color: var(--ink); margin-bottom: 4px; }

.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; background: var(--paper); color: var(--ink-2); border: 1px solid var(--line); }
.badge.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.gold { background: var(--gold-soft); color: #6e4f10; border-color: transparent; }
.badge.wait { background: var(--warn-soft); color: var(--warn); border-color: transparent; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--ink); background: var(--ink); color: #fff; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn.line { background: var(--card); color: var(--ink); border-color: var(--line-2); }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:not(:disabled):hover { filter: brightness(1.06); }
.btn.line:not(:disabled):hover { background: #fbfaf7; filter: none; }

/* bottom navigation */
.nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr);
  padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 18px rgba(22,24,27,.05); }
.nav button { height: var(--nav-h); border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); cursor: pointer; }
.nav button.on { color: var(--ink); }
.nav button.on svg { stroke-width: 2.4; }
.nav .add span.plus { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--gold); color: var(--ink); margin-top: -2px; box-shadow: 0 3px 10px rgba(201,150,46,.35); }
.nav .add { color: var(--ink); }
@media (min-width: 900px) {
  .nav { left: 50%; transform: translateX(-50%); bottom: 16px; width: 520px; border-radius: 16px; border: 1px solid var(--line); box-shadow: var(--shadow); padding-bottom: 0; }
}

/* sheet: product, supplier, forms */
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(22,24,27,.42); display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.panel { background: var(--paper); width: 100%; max-width: 720px; max-height: 94vh; overflow: auto; border-radius: 18px 18px 0 0; overscroll-behavior: contain;
  animation: up .28s cubic-bezier(.16, 1, .3, 1); scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
@media (min-width: 760px) { .sheet { align-items: center; } .panel { border-radius: 18px; max-height: 90vh; } }
@keyframes up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .panel { animation: none; } }
.ph { position: sticky; top: 0; z-index: 2; background: var(--paper); display: flex; align-items: center; gap: 8px; padding: 12px 12px 10px 18px; border-bottom: 1px solid var(--line); }
.ph h2 { flex: 1; font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.pb { padding: 16px 18px 24px; }
.pf { position: sticky; bottom: 0; background: var(--paper); border-top: 1px solid var(--line); padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); display: flex; gap: 10px; }
.pf .btn { flex: 1; }
.sec { margin-top: 20px; }
.sec h3 { font-size: 15px; font-weight: 800; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hero { display: flex; gap: 14px; align-items: flex-start; }
.hero .img { width: 104px; height: 104px; border-radius: 12px; background: var(--card) center/contain no-repeat; border: 1px solid var(--line); flex: none; }
.hero h3 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.fact { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.fact span { display: block; font-size: 13px; color: var(--ink-3); font-weight: 600; }
.fact b { display: block; font-size: 17px; font-weight: 700; margin-top: 2px; }
.fact.key { border-color: var(--gold); background: #fffdf8; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 15px; }
.kv dt { color: var(--ink-3); font-weight: 600; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* forms */
.f { display: grid; gap: 14px; }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .f2 { grid-template-columns: 1fr; } .f2.keep { grid-template-columns: 1fr 1fr; } }
label.fl { display: grid; gap: 6px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
label.fl .opt { font-weight: 500; color: var(--ink-3); }
.fl input, .fl select, .fl textarea { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--card); font-weight: 500; color: var(--ink); }
.fl textarea { min-height: 84px; resize: vertical; }
.fl input::placeholder, .fl textarea::placeholder { color: #767c86; }
.fl input.big { font-size: 24px; font-weight: 700; height: 58px; }
.seg { display: flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: var(--card); }
.seg button { flex: 1; min-height: 46px; border: 0; border-left: 1px solid var(--line); background: none; font-weight: 700; font-size: 14px; cursor: pointer; padding: 0 6px; }
.seg button:first-child { border-left: 0; }
.seg button.on { background: var(--ink); color: #fff; }
.pick { position: relative; }
.pick .opts { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); background: var(--card); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow); max-height: 280px; overflow: auto; }
.pick .opts button { display: block; width: 100%; text-align: left; padding: 11px 12px; border: 0; border-top: 1px solid var(--line); background: none; cursor: pointer; }
.pick .opts button:first-child { border-top: 0; }
.pick .opts button:hover { background: var(--paper); }
.pick .opts small { display: block; color: var(--ink-3); font-size: 13px; }
.chosen { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--gold); background: #fffdf8; border-radius: 10px; }
.chosen .main { flex: 1; min-width: 0; }
.chosen b { display: block; font-weight: 700; }
.chosen small { color: var(--ink-3); }
.photo { display: flex; gap: 10px; align-items: center; }
.photo img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.err { color: var(--bad); font-weight: 600; font-size: 14px; }

/* the comparison */
.cmp { border-radius: 12px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); }
.cmp .verdict { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.cmp.good { background: var(--good-soft); border-color: transparent; }
.cmp.good .verdict { color: var(--good); }
.cmp.bad { background: var(--bad-soft); border-color: transparent; }
.cmp.bad .verdict { color: var(--bad); }
.cmp .lines { margin-top: 8px; display: grid; gap: 4px; font-size: 14.5px; }
.cmp .lines div { display: flex; justify-content: space-between; gap: 12px; }
.cmp .lines b { font-weight: 700; white-space: nowrap; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--ink); }
.login form { width: 100%; max-width: 380px; background: var(--paper); border-radius: 18px; padding: 26px 22px; display: grid; gap: 14px; }
.login h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.login h1 span { color: #8a6418; }
.login p { margin: 0; color: var(--ink-2); font-size: 15px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 22px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px); background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px;
  font-weight: 600; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s cubic-bezier(.16, 1, .3, 1); z-index: 60; max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

.tablewrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th { text-align: left; font-size: 12.5px; font-weight: 700; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
td.r, th.r { text-align: right; white-space: nowrap; }
