:root {
  --paper: #eef1f4;
  --surface: #ffffff;
  --sunk: #e4e8ed;
  --ink: #1d2430;
  --ink-2: #4a5464;
  --ink-3: #7b8594;
  --line: #d5dbe2;
  --label: #ffd43b;
  --label-ink: #1d2430;
  --label-edge: #e9b800;
  --amber: #8a6100;
  --amber-soft: #fbefc9;
  --go: #1e6b4f;
  --go-ink: #ffffff;
  --go-soft: #dcefe6;
  --warn: #b5471f;
  --warn-soft: #fbe6dc;
  --run: #2f5bd3;
  --run-soft: #e1e8fb;
  --radius-s: 6px;
  --radius-m: 10px;
  --shadow: 0 1px 0 rgba(29, 36, 48, .06), 0 6px 18px -10px rgba(29, 36, 48, .25);
  --sans: "Onest", system-ui, sans-serif;
  --wide: "Archivo", "Onest", system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14181d;
    --surface: #1c2128;
    --sunk: #232a33;
    --ink: #e8edf3;
    --ink-2: #b4bdc9;
    --ink-3: #828c99;
    --line: #2e3640;
    --label: #f5c933;
    --label-ink: #1b1f24;
    --label-edge: #c99f12;
    --amber: #f2cd62;
    --amber-soft: #3b3115;
    --go: #3fae82;
    --go-ink: #0f1a15;
    --go-soft: #1b3229;
    --warn: #f08a63;
    --warn-soft: #3a2219;
    --run: #8aa8ff;
    --run-soft: #1f2a45;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 8px 22px -12px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #14181d;
  --surface: #1c2128;
  --sunk: #232a33;
  --ink: #e8edf3;
  --ink-2: #b4bdc9;
  --ink-3: #828c99;
  --line: #2e3640;
  --label: #f5c933;
  --label-ink: #1b1f24;
  --label-edge: #c99f12;
  --amber: #f2cd62;
  --amber-soft: #3b3115;
  --go: #3fae82;
  --go-ink: #0f1a15;
  --go-soft: #1b3229;
  --warn: #f08a63;
  --warn-soft: #3a2219;
  --run: #8aa8ff;
  --run-soft: #1f2a45;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

[hidden] { display: none !important; }

a { color: inherit; }

button, input, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--run); outline-offset: 2px; border-radius: 4px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

svg { width: 18px; height: 18px; flex: none; }

/* bar */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  font-family: var(--wide);
  font-weight: 900;
  font-stretch: 125%;
  font-size: 22px;
  letter-spacing: -.02em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.brand::before {
  content: "";
  width: 22px;
  height: 14px;
  background: var(--label);
  clip-path: polygon(0 0, 72% 0, 100% 50%, 72% 100%, 0 100%);
}

.bar-tools { display: flex; align-items: center; gap: 6px; }

.conn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--ink-3);
  margin-right: 6px;
}

.conn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.conn.ok .conn-dot { background: var(--go); }
.conn.bad { color: var(--warn); }
.conn.bad .conn-dot { background: var(--warn); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  background: none;
  color: var(--ink-2);
  cursor: pointer;
}

.icon-btn:hover { background: var(--sunk); }
.icon-btn[aria-pressed="true"] { color: var(--go); background: var(--go-soft); }

.text-btn {
  border: 0;
  white-space: nowrap;
  text-decoration: none;
  background: none;
  padding: 6px 8px;
  color: var(--ink-2);
  cursor: pointer;
  border-radius: var(--radius-s);
  font-size: 14px;
}

.text-btn:hover { color: var(--ink); background: var(--sunk); }
.text-btn.danger:hover { color: var(--warn); background: var(--warn-soft); }

/* buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover { border-color: var(--ink-3); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--go); border-color: var(--go); color: var(--go-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { min-height: 30px; padding: 0 10px; font-size: 13px; }

/* gate */

.gate { flex: 1; display: grid; place-items: center; padding: 24px 16px; }

.gate-form {
  width: min(360px, 100%);
  display: grid;
  gap: 12px;
}

.gate-form h1 { font-family: var(--wide); font-stretch: 112%; font-weight: 800; font-size: 26px; margin: 0 0 4px; }

.gate-form input, .ask textarea, .note-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface);
  padding: 10px 12px;
}

.gate-form input:focus, .ask textarea:focus, .note-input:focus { outline: none; border-color: var(--go); box-shadow: 0 0 0 3px var(--go-soft); }

.gate-error { color: var(--warn); margin: 0; font-size: 14px; }

/* layout */

.app {
  flex: 1;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  min-height: 0;
}

.side {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: calc(100dvh - 57px);
  position: sticky;
  top: 57px;
}

.main {
  padding: 28px 40px 64px;
  min-width: 0;
  outline: none;
}

.ask { padding: 16px 16px 12px; display: grid; gap: 8px; }

.ask textarea {
  resize: none;
  font-size: 16px;
  line-height: 1.4;
  min-height: 64px;
}

.ask-row { display: flex; align-items: center; gap: 8px; }
.ask-row .ask-hint { margin-right: auto; }
.ask-hint { font-size: 13px; color: var(--ink-3); }

.tabs {
  display: flex;
  gap: 4px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
}

.tab {
  padding: 10px 8px;
  text-decoration: none;
  color: var(--ink-3);
  font-weight: 600;
  font-size: 14px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-color: var(--ink); }
.count { font-weight: 500; color: var(--ink-3); margin-left: 2px; }

.list { overflow-y: auto; flex: 1; padding: 6px 8px 24px; }

.group-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  padding: 14px 10px 4px;
  margin: 0;
  display: flex;
  justify-content: space-between;
}

.row {
  display: block;
  padding: 9px 10px;
  border-radius: var(--radius-s);
  text-decoration: none;
  position: relative;
}

.row:hover { background: var(--sunk); }
.row[aria-current="true"] { background: var(--surface); box-shadow: var(--shadow); }

.row-query {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-3);
  margin-top: 1px;
  min-width: 0;
}

.row-meta > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row-price { margin-left: auto; font-family: var(--wide); font-stretch: 100%; font-weight: 700; color: var(--ink); white-space: nowrap; }

.row.is-running .row-meta { color: var(--run); }
.row.is-error .row-meta { color: var(--warn); }

.row-bar {
  height: 2px;
  background: var(--run-soft);
  border-radius: 2px;
  margin-top: 7px;
  overflow: hidden;
}

.row-bar::after {
  content: "";
  display: block;
  height: 100%;
  width: 30%;
  background: var(--run);
  animation: sweep 1.6s ease-in-out infinite;
}

.row.is-queued .row-bar::after { animation: none; width: 0; }

@keyframes sweep {
  from { transform: translateX(-100%); }
  to { transform: translateX(340%); }
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--sunk);
  color: var(--ink-2);
  white-space: nowrap;
}

.pill.chosen { background: var(--amber-soft); color: var(--amber); }
.pill.picked-pill { background: var(--go); color: var(--go-ink); }
.pill.ordered { background: var(--run-soft); color: var(--run); }
.pill.received { background: var(--go-soft); color: var(--go); }
.pill.running, .pill.queued { background: var(--run-soft); color: var(--run); }
.pill.error { background: var(--warn-soft); color: var(--warn); }

.empty-list { color: var(--ink-3); padding: 24px 10px; font-size: 14px; margin: 0; }

/* detail */

.detail { max-width: 980px; }

.back { display: none; }

.d-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }

.d-title {
  font-family: var(--wide);
  font-stretch: 108%;
  font-weight: 800;
  font-size: clamp(24px, 3.2vw, 34px);
  line-height: 1.12;
  letter-spacing: -.015em;
  margin: 0;
  overflow-wrap: anywhere;
}

.d-sub { color: var(--ink-3); font-size: 14px; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.d-actions { display: flex; gap: 2px; flex: none; }

.context-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  color: var(--ink-2);
  text-decoration: none;
}

.context-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.context-link:hover { color: var(--ink); text-decoration: underline; }
.context-link svg { width: 15px; height: 15px; }

.summary {
  font-size: 17px;
  line-height: 1.6;
  max-width: 68ch;
  margin: 24px 0 0;
  color: var(--ink);
}

/* research */

.research { max-width: 68ch; }
.research p { margin: 0 0 12px; line-height: 1.65; color: var(--ink-2); }

.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.product {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.product.is-recommended { border-color: var(--go); box-shadow: 0 0 0 1px var(--go); }
.product .pill { align-self: flex-start; }
.product h3 { font-family: var(--wide); font-stretch: 104%; font-weight: 800; font-size: 17px; line-height: 1.25; margin: 0; }
.product-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; color: var(--ink-3); }
.tier { font-weight: 600; color: var(--ink-2); }
.from { font-family: var(--wide); font-weight: 700; color: var(--ink); }
.product-summary { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink-2); }

.meter { display: inline-flex; gap: 2px; }
.meter i { width: 12px; height: 6px; border-radius: 2px; background: var(--sunk); }
.meter i.on { background: var(--go); }

.procon { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; font-size: 13px; }
.procon ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; align-content: start; }
.procon li { padding-left: 16px; position: relative; line-height: 1.4; }
.pros li::before, .cons li::before { position: absolute; left: 0; top: 0; font-weight: 700; }
.pros li::before { content: "+"; color: var(--go); }
.cons li::before { content: "\2212"; color: var(--warn); }
.best-for { margin: 0; font-size: 13px; color: var(--ink-2); }
.best-for strong { font-weight: 600; color: var(--ink); margin-right: 4px; }

.product-foot { margin-top: auto; padding-top: 6px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; }
.sources { display: flex; flex-wrap: wrap; gap: 2px 10px; min-width: 0; }
.sources a { color: var(--ink-3); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.sources a:hover { color: var(--ink); text-decoration: underline; }
.product-foot .text-btn { font-size: 13px; color: var(--go); font-weight: 600; }

/* best price */

.best {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--label);
  border-radius: var(--radius-s);
  padding: 16px 20px;
  margin-bottom: 14px;
}

.best-label { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.best-shop { font-weight: 700; margin-top: 2px; }
.best-name { margin: 2px 0 0; font-size: 15px; max-width: 56ch; }
.best-note { margin: 6px 0 0; font-size: 13px; color: var(--ink-3); }
.best-side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.best-price { font-family: var(--wide); font-stretch: 112%; font-weight: 800; font-size: 30px; line-height: 1; letter-spacing: -.01em; }
.best-delivery { font-size: 13px; color: var(--ink-3); }
.best-actions { display: flex; gap: 6px; margin-top: 6px; }

.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; }
.filter { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 12px; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.filter[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.offer-missing { color: var(--warn); font-size: 13px; margin-top: 2px; }

/* criteria */

.criteria { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.crit { font-size: 13px; padding: 2px 10px; border-radius: 999px; background: var(--sunk); color: var(--ink-2); }
.crit.is-must { background: var(--go-soft); color: var(--go); font-weight: 600; }
.crit-notes { margin: 8px 0 0; font-size: 14px; color: var(--ink-3); max-width: 68ch; }

/* detailed search form */

.search-form { max-width: 820px; display: grid; gap: 18px; }
.search-form .d-title { margin-bottom: 4px; }
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field > label, .field > .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.search-form textarea, .search-form select, .budget input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface);
  padding: 9px 12px;
  font-size: 15px;
}

.search-form textarea { resize: vertical; line-height: 1.45; }
#f-query { font-size: 17px; }
.search-form textarea:focus, .search-form select:focus, .budget input:focus, .chipbox:focus-within { outline: none; border-color: var(--go); box-shadow: 0 0 0 3px var(--go-soft); }

.chipbox {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 42px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface);
  cursor: text;
}

.chipbox input { flex: 1; min-width: 120px; border: 0; background: none; outline: none; padding: 3px 4px; font-size: 15px; }
.chip { display: inline-flex; align-items: center; gap: 2px; background: var(--sunk); border-radius: 999px; padding: 2px 4px 2px 10px; font-size: 14px; }
.chip button { border: 0; background: none; cursor: pointer; color: var(--ink-3); width: 20px; height: 20px; border-radius: 50%; line-height: 1; font-size: 15px; }
.chip button:hover { background: var(--line); color: var(--ink); }

.budget { display: flex; align-items: center; gap: 8px; }
.budget span { color: var(--ink-3); font-size: 14px; }

.toggles { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.toggles button, .depth button {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-s);
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
}

.toggles button[aria-pressed="true"], .depth button[aria-checked="true"] { border-color: var(--go); background: var(--go-soft); color: var(--go); }
.depth { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.depth button { display: grid; gap: 1px; text-align: left; padding: 7px 12px; }
.depth small { font-weight: 500; font-size: 12px; color: var(--ink-3); }

.check { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; cursor: pointer; width: fit-content; }
.check input { width: 18px; height: 18px; accent-color: var(--go); }

.form-actions { display: flex; align-items: center; gap: 12px; padding-top: 4px; }
.form-actions .btn.primary { min-width: 140px; }

/* offers */

.section-title {
  font-family: var(--wide);
  font-stretch: 108%;
  font-size: 17px;
  font-weight: 800;
  margin: 36px 0 10px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.section-title small { font-family: var(--sans); font-weight: 500; font-size: 13px; color: var(--ink-3); }

.offers { width: 100%; border-collapse: collapse; font-size: 14px; }
.offers th { text-align: left; font-weight: 500; color: var(--ink-3); font-size: 13px; padding: 0 10px 8px; border-bottom: 1px solid var(--line); }
.offers td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.offers .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.offers .total { font-family: var(--wide); font-weight: 700; font-size: 15px; }
.offers tr.is-cheapest td:first-child { box-shadow: inset 4px 0 0 var(--label); }
.offers tr.is-chosen { background: var(--go-soft); }
.offer-shop { font-weight: 600; white-space: nowrap; }
.offer-name { color: var(--ink); text-decoration: none; display: block; }
.offer-name:hover { text-decoration: underline; }
.offer-note { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.offer-actions { display: flex; gap: 4px; justify-content: flex-end; }
.stock-no { color: var(--warn); }
.stock-unknown { color: var(--ink-3); }
.m-only { display: none; }

/* decision */

.decision {
  margin-top: 24px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-m);
  padding: 16px 18px;
  display: grid;
  gap: 12px;
}

.decision-top { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.decision-item { font-weight: 600; }
.decision-item small { display: block; font-weight: 400; color: var(--ink-3); font-size: 13px; }

.steps { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; }
.steps button { border: 0; background: none; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--ink-3); cursor: pointer; }
.steps button + button { border-left: 1px solid var(--line); }
.steps button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.decision-bottom { display: flex; gap: 8px; align-items: center; }
.note-input { padding: 7px 10px; font-size: 14px; }

/* progress */

.run {
  margin-top: 28px;
  border-left: 2px solid var(--run-soft);
  padding-left: 20px;
  max-width: 720px;
}

.run-head { display: flex; align-items: baseline; gap: 12px; font-weight: 600; color: var(--run); }
.run-head .clock { font-family: var(--wide); font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink-2); margin-left: auto; }

.trail { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 2px; }

.trail li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  color: var(--ink-2);
  padding: 3px 0;
}

.trail li svg { width: 16px; height: 16px; color: var(--ink-3); }
.trail .t-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trail .t-at { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.trail li.is-current { color: var(--ink); font-weight: 500; }
.trail li.is-current svg { color: var(--run); }
.trail li.is-current .t-text::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--run); margin-left: 8px; vertical-align: middle; animation: blink 1s ease-in-out infinite; }

@keyframes blink { 50% { opacity: .2; } }

.run-empty { color: var(--ink-3); font-size: 14px; margin: 12px 0 0; }

details.log { margin-top: 32px; }
details.log summary { cursor: pointer; color: var(--ink-3); font-size: 14px; width: fit-content; }
details.log summary:hover { color: var(--ink); }
details.log .trail { margin-top: 8px; }

/* error */

.failure {
  margin-top: 28px;
  background: var(--warn-soft);
  color: var(--ink);
  border-radius: var(--radius-m);
  padding: 18px 20px;
  max-width: 720px;
}

.failure h2 { font-size: 16px; margin: 0; color: var(--warn); }
.failure p { margin: 6px 0 0; }
.failure code { font-size: 13px; background: var(--surface); padding: 1px 5px; border-radius: 4px; }
.failure .btn { margin-top: 14px; }

/* empty and orders */

.blank { max-width: 560px; padding-top: 8vh; }
.blank h1 { font-family: var(--wide); font-stretch: 118%; font-weight: 900; font-size: clamp(32px, 4.5vw, 52px); line-height: 1; letter-spacing: -.025em; margin: 0; }
.blank p { color: var(--ink-3); margin: 14px 0 0; }

.orders-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.orders-sum { font-family: var(--wide); font-stretch: 112%; font-weight: 800; font-size: 20px; }
.orders-sum small { font-family: var(--sans); font-weight: 500; font-size: 13px; color: var(--ink-3); margin-right: 8px; }

.order { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 20px; padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.order:hover .order-name { text-decoration: underline; }
.order-name { font-weight: 600; }
.order-meta { color: var(--ink-3); font-size: 13px; grid-column: 1; }
.order-price { font-family: var(--wide); font-weight: 800; font-size: 17px; text-align: right; grid-row: 1 / span 2; grid-column: 2; align-self: center; }

/* toasts */

.toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: grid;
  gap: 8px;
  z-index: 20;
  width: min(380px, calc(100vw - 32px));
}

.toast {
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-m);
  padding: 12px 14px;
  font-size: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .5);
  animation: toast-in .18s ease-out;
}

.toast.is-error { background: var(--warn); color: #fff; }
.toast-text { flex: 1; min-width: 0; }
.toast-text strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast a, .toast button { color: inherit; font-weight: 600; background: none; border: 0; cursor: pointer; padding: 0; text-decoration: underline; }

@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

.skeleton { height: 14px; border-radius: 4px; background: var(--sunk); margin: 10px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* phone */

@media (max-width: 820px) {
  .bar { padding: 10px 16px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; border-right: 0; }
  .list { overflow: visible; padding: 4px 8px 32px; }
  .main { padding: 16px 16px 48px; }
  body.view-list .main { display: none; }
  body.view-detail .side { display: none; }
  .back { display: inline-flex; align-items: center; gap: 2px; margin: 0 0 12px -6px; }
  .d-head { flex-direction: column; gap: 8px; }
  .d-actions { margin-left: -8px; }
  .best { grid-template-columns: minmax(0, 1fr); padding: 14px 16px; }
  .best-side { text-align: left; align-items: flex-start; order: -1; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .procon { grid-template-columns: minmax(0, 1fr); }
  .depth { grid-template-columns: minmax(0, 1fr); }
  .ask-row .text-btn { margin-left: auto; }
  #conn-text { display: none; }
  .offers thead { display: none; }
  .offers, .offers tbody, .offers tr, .offers td { display: block; }
  .offers tr { padding: 12px 0 12px 12px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; }
  .offers tr.is-cheapest { box-shadow: inset 4px 0 0 var(--label); }
  .offers tr.is-cheapest td:first-child { box-shadow: none; }
  .offers td { padding: 0; border: 0; }
  .offers td[data-col="shop"] { grid-column: 1; }
  .offers td[data-col="name"] { grid-column: 1 / -1; }
  .offers td[data-col="price"], .offers td[data-col="delivery"] { display: none; }
  .offers td[data-col="total"] { grid-column: 2; grid-row: 1; }
  .offers td[data-col="stock"] { grid-column: 1; font-size: 13px; }
  .offers td[data-col="actions"] { grid-column: 2; grid-row: 3; }
  .m-only { display: inline; color: var(--ink-3); }
  .toasts { left: 16px; right: 16px; width: auto; }
}
