/* views-billing.css — Billing & credit (#/billing), the invoice view and the
   owner's Wallets page (economics D). Tokens from styles/tokens.css. */
.billing { display: flex; flex-direction: column; gap: 16px; max-width: 960px; margin: 0 auto; padding: 16px; }
.billing-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.billing-title { font-size: 20px; margin: 0; }
.billing-note { color: var(--text-muted); font-size: 12px; margin: 8px 0 0; }
.billing-warn { color: var(--warn, #d69e2e); font-size: 13px; }
.billing-balance { font-family: 'IBM Plex Mono', monospace; font-size: 32px; font-weight: 600; }
.billing-state { margin: 8px 0; }
.billing-setup { display: flex; flex-direction: column; gap: var(--s3, 12px); }
.billing-setup p { margin: 0; }
.billing-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.billing-amount, .billing-auto input[type="text"] { width: 120px; }
.billing-auto { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 12px; }
.billing-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
/* A checkbox field: inline row (checkbox + text), never stretched to the full
   row width — the default column layout above stretches a bare <input> to
   the label's cross-axis size (align-items: stretch), which for a checkbox
   in a flex-column ancestor (.bw-settings) blows it up to the card's width. */
.billing-field-check { flex-direction: row; align-items: center; gap: 8px; }
.billing-field-check input[type="checkbox"] { flex: 0 0 auto; width: auto; align-self: auto; }
.billing-tier { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.billing-tier-incl { color: var(--text-muted); font-size: 12px; }
.billing-doc-bar { display: flex; justify-content: space-between; align-items: center; }
.billing-paper { background: #fff; color: #111; padding: 32px; border-radius: 4px; }
.billing-paper .dt, .billing-paper .dt th, .billing-paper .dt td { color: #111; }
/* The paper is always a white page (screen or print), regardless of the
   app's theme — but .dt thead (components.css) paints var(--bg-1), which is
   dark in dark theme, under the #111 header text above (dark-on-dark,
   unreadable). Force a light header background here too. */
.billing-paper .dt thead { background: #f3f3f3; }
.billing-parties { display: flex; flex-wrap: wrap; gap: 48px; margin: 24px 0; }
.billing-paper-total { font-weight: 600; margin-top: 16px; }
.billing-paper-note { font-size: 12px; color: #444; }
.billing-paper-test { border: 2px solid #b45309; color: #b45309; font-weight: 700; padding: 8px 12px; margin: 0 0 16px; text-align: center; letter-spacing: 0.02em; }
.billing-test-text { font-size: 13px; color: var(--warn); margin: 4px 0 8px; }
.billing-with-test { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bw-adjust { display: flex; flex-direction: column; gap: 12px; }
.bw-settings { display: flex; flex-direction: column; gap: 12px; }
@media print {
  .nav-shell, .topbar, .tabbar, .no-print { display: none !important; }
  .billing { padding: 0; max-width: none; }
  .billing-paper { padding: 0; }
}

/* ── Economics E: the Billing tab row, the spend-cap editor ── */
.billing-tabs { display: flex; flex-wrap: wrap; gap: 4px; max-width: 960px; margin: 16px auto 0; padding: 0 16px; border-bottom: 1px solid var(--border); box-sizing: border-box; }
/* Inside a page root the row takes the root's width: the planner's tab slot,
   and the .billing roots of E's Live usage / Statements pages (Tasks 17/18
   append the row inside `.billing`; D's Credit page puts it before its root). */
.billing > .billing-tabs, .pp-tabs-slot > .billing-tabs { margin: 0; padding: 0; max-width: none; }
.pp-tabs-slot:empty { display: none; }
.billing-tabs a { padding: 8px 12px; border-radius: 6px 6px 0 0; color: var(--text-muted); text-decoration: none; }
.billing-tabs a:hover { color: var(--text-1, inherit); }
.billing-tabs a.active { color: var(--text-1, inherit); border: 1px solid var(--border); border-bottom-color: transparent; }
.billing-cap-editor .billing-actions { align-items: flex-end; }
.billing-cap-editor input[data-field="cap"] { width: 140px; }

/* ── Economics E: the planner's billing parts (price-planner.js, .pp-*) ── */
.pp-credit .card-body, .pp-cap .card-body, .pp-saved .card-body { display: flex; flex-direction: column; gap: var(--s2, 8px); }
.pp-required { margin: 0; font-size: 14px; color: var(--text-1, inherit); line-height: 1.5; }
.pp-included { color: var(--text-2, inherit); }
.pp-saved-note, .pp-recomputed { margin: 0 0 var(--s2, 8px); font-size: 13px; color: var(--text-2, inherit); }
.pp-saved[hidden] { display: none; }
.pp-result-slot { display: flex; flex-direction: column; gap: var(--s4, 16px); }
.pp-result-slot:empty { display: none; }
@media (max-width: 480px) {
  .billing-cap-editor input[data-field="cap"] { width: 100%; }
  .billing-cap-editor .billing-field { flex: 1 1 100%; }
}

/* ── Economics E: the in-app customer alert banner (Task 19, nav-shell.js) ──
   Sits right under .topbar, full width, in the #app flex column (nav-shell.js
   inserts `.billing-alert-slot` as .topbar's next sibling). Same monochrome
   dim-background/accent-text convention as the platform's other severity
   banners/chips (styles/views-device-health.css .dh-stale-banner,
   styles/views-dect.css .alert-chip, styles/status.css .st-chip) — no new
   colour language. sev-info is a neutral fallback (the feed today only ever
   sends warn/critical). */
.billing-alert-slot:empty { display: none; }
.billing-alert-banner {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--s3, 12px);
  padding: 10px calc(18px + var(--safe-right)) 10px calc(18px + var(--safe-left));
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px; line-height: 1.4;
}
.billing-alert-banner.sev-warn { background: var(--warn-dim); color: var(--warn); }
.billing-alert-banner.sev-critical { background: var(--danger-dim); color: var(--danger); }
.billing-alert-banner.sev-info { background: var(--bg-2); color: var(--text-2); }
.billing-alert-text { flex: 1 1 260px; min-width: 0; word-break: break-word; }
.billing-alert-open {
  flex: none; color: inherit; font-weight: 600; text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 55%, transparent);
}
.billing-alert-open:hover { text-decoration-color: currentColor; }
.billing-alert-dismiss {
  flex: none; margin-left: auto; font-family: var(--font-ui); font-size: 12px; line-height: 1.2;
  color: inherit; background: transparent; border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
  border-radius: var(--r-sm); padding: 4px 10px; cursor: pointer;
}
.billing-alert-dismiss:hover { background: color-mix(in srgb, currentColor 14%, transparent); }
.billing-alert-open:focus-visible, .billing-alert-dismiss:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
@media (max-width: 480px) {
  .billing-alert-banner {
    padding: 8px calc(12px + var(--safe-right)) 8px calc(12px + var(--safe-left));
    font-size: 12.5px;
  }
  .billing-alert-text { flex-basis: 100%; }
  .billing-alert-dismiss { margin-left: 0; }
}

/* ── Economics E: Live usage (billing-live.js) and Statements (billing-statements.js) ──
   Found in the Task 20 real-browser check: without these the alert log ran
   time, title and body together and each statement label ran into its amount. */
.live-body, .statements-body, .statement-body { display: flex; flex-direction: column; gap: var(--s4, 16px); }
.live-show-all, .statement-body > a { align-self: flex-start; font-size: 13px; }
.live-credit, .live-burn, .live-event, .live-alerts {
  display: flex; flex-direction: column; gap: var(--s2, 8px); font-size: 13px; line-height: 1.5;
}
.live-credit p, .live-burn p, .live-event p { margin: 0; }
.live-credit > a { align-self: flex-start; }
.live-balance { font-family: 'IBM Plex Mono', monospace; font-size: 28px; font-weight: 600; }
.live-credit .billing-state { align-self: flex-start; margin: 0; }
.live-at-zero, .live-projection { color: var(--text-2); }
.live-burn-total { font-weight: 600; }
.live-cap { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2, 8px) var(--s3, 12px); }
.live-cap progress { flex: 0 1 160px; max-width: 100%; height: 8px; accent-color: var(--accent); }
.live-cap[data-reached="true"] progress { accent-color: var(--danger); }
.live-cap[data-reached="true"] .live-cap-text { color: var(--danger); }
.live-cap-text { flex: 1 1 220px; min-width: 0; }
.live-alert {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px var(--s3, 12px);
  padding: 6px 0 6px var(--s3, 12px); border-left: 3px solid var(--border-strong);
}
.live-alert[data-severity="warn"] { border-left-color: var(--warn); }
.live-alert[data-severity="critical"] { border-left-color: var(--danger); }
.live-alert-time { grid-column: 1; grid-row: 1; color: var(--text-muted); font-family: 'IBM Plex Mono', monospace; font-size: 12px; white-space: nowrap; }
.live-alert-title, .live-alert-body, .live-alert-note { grid-column: 2; min-width: 0; word-break: break-word; }
.live-alert-body { color: var(--text-2); }
.live-alert-note { color: var(--text-muted); font-size: 12px; }
.live-metered { margin: 0; color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.statement-summary { display: flex; flex-direction: column; gap: var(--s2, 8px); }
.statement-figure {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
  gap: var(--s1, 4px) var(--s4, 16px); padding-bottom: var(--s2, 8px); border-bottom: 1px solid var(--border-subtle);
}
.statement-figure .billing-note { margin: 0; font-size: 13px; }
.statement-figure strong { font-family: 'IBM Plex Mono', monospace; font-size: 15px; }
.statement-figure.st-total strong { font-size: 17px; }
.st-balance-note { margin: 0; }
@media (max-width: 480px) {
  .live-alert { grid-template-columns: minmax(0, 1fr); }
  .live-alert-time, .live-alert-title, .live-alert-body, .live-alert-note { grid-column: 1; grid-row: auto; }
}

/* ── Licence rollout (#/licence-rollout, js/views/licence-rollout.js) ──
   Page root + heading match the admin views (.adm-view / .adm-heading). Under
   640px the two tables restack as cards (cells labelled via data-label) so the
   hostname never breaks at its hyphens and the Grant button is always on screen. */
.licence-rollout { max-width: 1100px; width: 100%; margin: 0 auto; padding: var(--s5) var(--s4) 72px; box-sizing: border-box; }
.lr-title { font-size: 26px; font-weight: 700; color: var(--text-1); margin: 0 0 var(--s3); letter-spacing: -.4px; }
.lr-h2 { font-size: 16px; font-weight: 600; color: var(--text-1); margin: 0 0 var(--s2); }
.lr-panel { margin: var(--s4) 0; }
.lr-count { font-size: 20px; font-weight: 600; margin: var(--s1) 0; }
.lr-muted { color: var(--text-muted); }
.lr-blocking-list { list-style: disc outside; margin: var(--s2) 0; padding-left: var(--s5); }
.lr-blocking-list li { margin: var(--s1) 0; overflow-wrap: anywhere; }
.lr-show-all { margin: var(--s1) 0; }
.lr-table-wrap { overflow-x: auto; margin: var(--s2) 0; }
.lr-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.lr-table th, .lr-table td { padding: var(--s1) var(--s2); border-bottom: 1px solid var(--border); vertical-align: top; text-align: left; }
.lr-table td.lr-host { white-space: nowrap; overflow-wrap: normal; }
@media (max-width: 639px) {
  .lr-table, .lr-table tbody { display: block; width: 100%; }
  .lr-table thead { display: none; }
  .lr-table tr { display: block; padding: var(--s2) var(--s3); margin-bottom: var(--s2); border: 1px solid var(--border); border-radius: var(--r-md); }
  .lr-table td { display: flex; gap: var(--s3); padding: var(--s1) 0; border-bottom: 0; min-width: 0; overflow-wrap: anywhere; }
  .lr-table td[data-label]::before { content: attr(data-label); flex: 0 0 96px; color: var(--text-muted); }
  .lr-table td.lr-host { display: block; font-weight: 600; color: var(--text-1); overflow-x: auto; }
  .lr-table td.lr-tick { float: right; padding: 0 0 0 var(--s2); }
  .lr-table td.lr-action { padding-top: var(--s2); }
  .lr-table td.lr-action .btn { width: 100%; justify-content: center; }
}
/* ── Licences & shop (driver_shop). Layout from shop-design/shop-mockup.html.
   Scoped so the app's .field grid and .btn sizes stay put outside .shop. ── */
.shop { max-width: 1180px; margin: 0 auto; padding: var(--s5) var(--s4) 96px; display: flex; flex-direction: column; gap: var(--s5); }
.shop-back { color: var(--text-muted); text-decoration: none; font-size: 12px; }
.shop-back:hover { color: var(--text-1); }
.shop-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s3); }
.shop-org { font: 500 11px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin: var(--s3) 0 2px; }
.shop-title { font-size: 22px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.shop-head-side { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.shop .seg-btn[aria-selected="true"] { background: var(--bg-raised); color: var(--text-1); }
.shop .card { padding: 0; }
/* One card pattern: cards that hold their own content breathe by --s4. The bare
   .shop .card rule above outranks a plain .shop-context / .shop-bundle / .shop-order
   padding, so these three name the card too. Lists and tables inside a card pad their rows. */
.shop .card.shop-context, .shop .card.shop-bundle, .shop .card.shop-order { padding: var(--s4); }
.shop .field { display: flex; flex-direction: column; gap: 5px; }
.shop .field-label { font: 600 10px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); line-height: 1.4; padding: 0; white-space: normal; }
.shop select { font: 500 13px var(--font-ui); color: var(--text-1); background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 8px 30px 8px 10px; min-height: 36px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%); background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.shop-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s5); align-items: start; }
.shop-main { display: flex; flex-direction: column; gap: var(--s5); min-width: 0; }
.shop-context { padding: var(--s4); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s4); align-items: end; }
.shop-holds { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); border-top: 1px solid var(--border-subtle); padding-top: var(--s3); }
.shop-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: var(--r-pill); border: 1px solid var(--border); color: var(--text-2); font-size: 12px; white-space: nowrap; }
.shop-chip svg { width: 11px; height: 11px; color: var(--ok); }
.shop-chip-grace { border-color: color-mix(in srgb, var(--warn) 35%, transparent); color: var(--warn); }
.shop-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); margin: 0 0 var(--s3); }
.shop-h2 { font-size: 13px; font-weight: 600; margin: 0; }
.shop-h2-note { font-size: 12px; color: var(--text-muted); }
.shop-bundles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.shop-bundle { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3); position: relative; }
.shop-bundle.in-cart { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--bg-card); }
.shop-bundle-title { font-weight: 600; font-size: 14px; margin: 0; }
.shop-bundle-meta { font: 500 11px var(--font-mono); color: var(--text-muted); letter-spacing: .04em; }
.shop-bundle-members { font-size: 12px; color: var(--text-2); line-height: 1.6; margin: 0; flex: 1; }
.shop-bundle-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s2); border-top: 1px solid var(--border-subtle); padding-top: var(--s3); }
.shop-price { font: 600 17px var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.shop-was { font: 400 11px var(--font-mono); color: var(--text-muted); text-decoration: line-through; display: block; }
.shop-save { margin-top: 3px; }
.shop-group + .shop-group { margin-top: var(--s5); }
.shop-list { padding: 0; margin: 0; list-style: none; }
.shop-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 108px 104px; align-items: center; gap: var(--s4); padding: 10px var(--s4); min-height: 56px; }
.shop-row + .shop-row { border-top: 1px solid var(--border-subtle); }
.shop-row.in-cart { background: var(--accent-soft); }
.shop-row-name { font-weight: 500; min-width: 0; }
.shop-row-sub { display: block; font-size: 12px; color: var(--text-muted); font-weight: 400; }
.shop-beta { margin-left: 6px; }
.shop-row-state { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.shop-row-price { font: 500 13px var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.shop-row .btn { width: 100%; }
.shop-row.owned .shop-row-name { color: var(--text-2); }
.shop-order { position: sticky; top: calc(46px + var(--s4)); padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3); }
.shop-order-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); padding-bottom: var(--s1); }
.shop-order-for { font-size: 12px; color: var(--text-muted); }
.shop-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.shop-line { display: grid; grid-template-columns: minmax(0, 1fr) auto 28px; gap: var(--s2); align-items: center; padding: 7px 0; font-size: 13px; }
.shop-line + .shop-line { border-top: 1px solid var(--border-subtle); }
.shop-line-amt { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.shop-x { width: 28px; height: 28px; padding: 0; min-height: 0; color: var(--text-muted); }
.shop-offer { border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); background: var(--accent-soft); border-radius: var(--r-sm); padding: var(--s3); display: flex; flex-direction: column; gap: var(--s2); font-size: 12px; color: var(--text-2); }
.shop-offer strong { color: var(--text-1); font-weight: 600; }
.shop-offer .btn { align-self: flex-start; }
.shop-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--border); padding-top: var(--s3); }
.shop-total-label { font-size: 12px; color: var(--text-muted); }
.shop-total-amt { font: 600 22px var(--font-mono); font-variant-numeric: tabular-nums; }
.shop-buy { width: 100%; min-height: 42px; font-size: 14px; }
.shop-fine { font-size: 11.5px; color: var(--text-muted); margin: 0; line-height: 1.5; }
.shop-empty { font-size: 13px; color: var(--text-muted); padding: var(--s4) 0; text-align: center; border: 1px dashed var(--border); border-radius: var(--r-sm); }
.shop-table-wrap { overflow-x: auto; }
.shop-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.shop-table th { font: 600 10px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); text-align: left; padding: 10px var(--s4); border-bottom: 1px solid var(--border-subtle); white-space: nowrap; }
.shop-table td { padding: 10px var(--s4); border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
.shop-table tr:last-child td { border-bottom: 0; }
.shop-table .num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.shop-host { font-family: var(--font-mono); font-size: 12.5px; white-space: nowrap; }
.shop-act { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.shop-act select { min-height: 33px; width: auto; } /* sized to the longest hostname (select({ size: false })) */
.shop-muted { color: var(--text-muted); font-size: 12px; }
.shop-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
/* Licences tab: expandable node rows. Collapsed shows the pack pills, open shows the licences. */
.shop-nodes { display: flex; flex-direction: column; gap: var(--s3); }
.shop-node-head { display: grid; grid-template-columns: 16px minmax(120px, 230px) minmax(0, 1fr) auto; grid-template-areas: "chev name pills meta"; align-items: center; gap: var(--s3); width: 100%; min-height: 52px; padding: 12px var(--s4); background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.shop-node-head:hover { background: var(--bg-raised); }
.shop-node-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.shop-node-chev { grid-area: chev; color: var(--text-muted); font-size: 18px; line-height: 1; transition: transform .15s; }
.shop-node.open .shop-node-chev { transform: rotate(90deg); }
.shop-node-name { grid-area: name; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; white-space: normal; }
.shop-node-name.shop-host { font-size: 13px; }
.shop-node-pills { grid-area: pills; min-width: 0; }
.shop-node.open .shop-node-pills { display: none; }
.shop-node-meta { grid-area: meta; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12px; color: var(--text-muted); text-align: right; }
.shop-node-hint { color: var(--warn); }
.shop-node-body[hidden] { display: none; }
.shop-lrows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border-subtle); }
.shop-lrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) 420px; align-items: center; gap: var(--s4); padding: 10px var(--s4); min-height: 56px; }
.shop-lrow + .shop-lrow { border-top: 1px solid var(--border-subtle); }
.shop-lrow-note { display: block; min-height: 40px; }
.shop-lrow-name { font-weight: 500; font-size: 14px; min-width: 0; }
.shop-lrow-status { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; }
.shop-lrow-act { display: flex; justify-content: flex-end; min-width: 0; }
.shop-pick { display: inline-flex; align-items: center; gap: 6px; }
.shop-pick-label { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.shop-pick select { max-width: 190px; text-overflow: ellipsis; }
.shop-panel[hidden] { display: none; }
.shop-bar { display: none; }
.shop-bar[hidden] { display: none !important; }
@media (max-width: 1000px) {
  .shop-lrow { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
  .shop-lrow-act { grid-column: 1 / -1; justify-content: flex-start; }
  .shop-lrow-note { display: block; }
  .shop-grid { grid-template-columns: minmax(0, 1fr); }
  .shop-order { position: static; }
  .shop-bundles { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .shop-node-head { grid-template-columns: 16px minmax(0, 1fr) auto; grid-template-areas: "chev name meta" ". pills pills"; row-gap: var(--s2); }
  .shop-lrow { grid-template-columns: minmax(0, 1fr); gap: var(--s2); padding: 12px var(--s4); }
  .shop-lrow-act { grid-column: auto; }
  .shop-lrow-act, .shop-lrow-act .shop-act { width: 100%; justify-content: flex-start; flex-wrap: nowrap; }
  .shop-pick { flex: 1 1 0; min-width: 0; }
  .shop-pick select { flex: 1; min-width: 0; max-width: none; }
  .shop { padding: var(--s4) var(--s4) 140px; gap: var(--s4); }
  .shop-context { grid-template-columns: minmax(0, 1fr) 96px; }
  .shop-bundles { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 calc(-1 * var(--s4)); padding: 0 var(--s4) 4px; scrollbar-width: none; }
  .shop-bundle { flex: 0 0 78%; scroll-snap-align: start; }
  .shop select, .shop .btn { min-height: var(--tap-min); }
  .shop-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name price" "state act"; row-gap: 6px; padding: 12px var(--s4); }
  .shop-row-name { grid-area: name; }
  .shop-row-price { grid-area: price; }
  .shop-row-state { grid-area: state; justify-content: flex-start; }
  .shop-row-act { grid-area: act; width: 104px; }
  .shop-row-state:empty { display: none; }
  .shop-x { width: var(--tap-min); height: var(--tap-min); }
  .shop-line { grid-template-columns: minmax(0, 1fr) auto var(--tap-min); }
  .shop-bar { display: flex; position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h, 51px) + var(--safe-bottom, 0px)); z-index: 5; align-items: center; justify-content: space-between; gap: var(--s3); padding: 10px var(--s4); background: color-mix(in srgb, var(--bg-1) 92%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--border); }
  .shop-bar-sum { display: flex; flex-direction: column; font-size: 11px; color: var(--text-muted); }
  .shop-bar-sum b { font: 600 16px var(--font-mono); color: var(--text-1); }
}
@media (prefers-reduced-motion: no-preference) {
  .shop-row, .shop-bundle { transition: background .15s, border-color .15s; }
}
