/* ---------- Design tokens ---------- */
:root {
  --font: "Heebo", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-2: #f1f3ee;
  --text: #17201c;
  --text-2: #4b5650;
  --muted: #7a857f;
  --line: #e4e8e2;
  --line-strong: #cfd6cf;
  --primary: #0f766e;
  --primary-hover: #0b5f59;
  --primary-soft: #e3f3f0;
  --accent: #16a34a;
  --accent-soft: #e6f7ec;
  --warn: #b45309;
  --warn-soft: #fff4e0;
  --danger: #b91c1c;
  --danger-soft: #fdeaea;
  --best: #f59e0b;
  --best-soft: #fff8e6;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(23, 32, 28, .05), 0 1px 3px rgba(23, 32, 28, .06);
  --shadow: 0 4px 14px rgba(23, 32, 28, .08);
  --shadow-lg: 0 18px 40px rgba(23, 32, 28, .16);
  --header-h: 64px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
[hidden] { display: none !important; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); border-radius: 12px; padding: 10px 18px; font-weight: 600; transition: background .15s, border-color .15s, transform .05s, box-shadow .15s; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(15, 118, 110, .25); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--primary-soft); }
.btn-lg { padding: 13px 22px; font-size: 16px; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-text { border: 0; background: none; color: var(--muted); font-size: 13px; padding: 4px 6px; border-radius: 8px; }
.btn-text:hover { background: var(--surface-2); color: var(--text); }
.btn-text.danger:hover { color: var(--danger); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 24px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 20px; }
.logo-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--primary); display: grid; place-items: center; font-size: 18px; box-shadow: var(--shadow-sm); }
.steps-nav { display: flex; gap: 6px; margin-inline-start: auto; margin-inline-end: auto; }
.steps-nav li { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; color: var(--muted); font-size: 14px; font-weight: 500; }
.steps-nav li.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.steps-nav li.is-done { color: var(--accent); }
.step-num { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid currentColor; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.is-active .step-num { background: var(--primary); border-color: var(--primary); color: #fff; }
.is-done .step-num { background: var(--accent); border-color: var(--accent); color: #fff; }
.header-actions { display: flex; align-items: center; gap: 14px; }
.header-link { color: var(--text-2); font-weight: 500; font-size: 14px; }
.cart-toggle { display: none; position: relative; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 6px 10px; }
.cart-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%); border-bottom: 1px solid var(--line); }
.hero-inner { display: grid; grid-template-columns: 1.2fr .8fr; gap: 48px; align-items: center; padding: 56px 20px 48px; }
.hero-kicker { color: var(--primary); font-weight: 700; font-size: 14px; letter-spacing: .2px; margin-bottom: 12px; }
.hero h1 { font-size: 42px; font-weight: 800; letter-spacing: -.5px; }
.hero h1 .accent { color: var(--primary); }
.hero-sub { font-size: 17px; color: var(--text-2); margin: 18px 0 24px; max-width: 560px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-trust { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 22px; color: var(--text-2); font-size: 14px; }
.hero-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow-lg); transform: rotate(-1.5deg); }
.hero-card-title { font-weight: 700; margin-bottom: 8px; color: var(--text-2); font-size: 14px; }
.hero-row { display: flex; align-items: center; gap: 10px; padding: 10px 10px; border-radius: 10px; font-size: 15px; }
.hero-row strong { margin-inline-start: auto; font-size: 17px; }
.hero-row.best { background: var(--best-soft); border: 1px solid #fde4b0; }
.hero-row .tag { background: var(--best); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.hero-card-foot { margin-top: 10px; font-size: 13px; color: var(--accent); font-weight: 600; text-align: center; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }

/* ---------- Workspace ---------- */
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; padding-top: 40px; padding-bottom: 48px; align-items: start; }
.section-head { margin-bottom: 18px; }
.section-head h2 { font-size: 26px; font-weight: 800; }
.section-head.center { text-align: center; }
.section-head p { margin-top: 4px; }

.search-bar { position: relative; display: flex; align-items: center; background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 14px; padding: 0 14px; height: 52px; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
.search-bar:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.search-icon { opacity: .6; }
.search-bar input { flex: 1; border: 0; outline: 0; background: transparent; padding: 0 10px; font-size: 16px; height: 100%; }
.search-bar input::-webkit-search-cancel-button { display: none; }
.search-clear { border: 0; background: var(--surface-2); border-radius: 50%; width: 26px; height: 26px; color: var(--muted); }

.category-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 0 6px; }
.tab { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 14px; font-size: 14px; font-weight: 500; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.tab:hover { border-color: var(--line-strong); }
.tab.is-active { background: var(--text); border-color: var(--text); color: #fff; }
.tab .tab-count { font-size: 12px; opacity: .7; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-top: 12px; }
.product-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s, border-color .15s; }
.product-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.product-card.in-cart { border-color: #b9e2d6; background: linear-gradient(180deg, #fff 0%, #f5fbf9 100%); }
.product-top { display: flex; gap: 12px; align-items: flex-start; }
.product-icon { width: 52px; height: 52px; flex: none; border-radius: 14px; display: grid; place-items: center; font-size: 26px; background: var(--tint, var(--surface-2)); }
.product-name { font-weight: 700; font-size: 15px; line-height: 1.3; }
.product-meta { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.product-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.product-price { font-weight: 800; font-size: 16px; white-space: nowrap; }
.product-price small { font-weight: 500; color: var(--muted); font-size: 12px; margin-inline-start: 4px; }
.product-price .range { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.product-chains { font-size: 11.5px; color: var(--muted); display: block; }
.add-btn { white-space: nowrap; flex: none; border: 1.5px solid var(--primary); background: var(--surface); color: var(--primary); border-radius: 10px; padding: 7px 12px; font-weight: 700; font-size: 14px; transition: background .15s, color .15s; }
.add-btn:hover { background: var(--primary); color: #fff; }

.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--primary); border-radius: 10px; overflow: hidden; background: var(--surface); }
.stepper button { border: 0; background: transparent; width: 32px; height: 32px; color: var(--primary); font-weight: 700; font-size: 16px; }
.stepper button:hover { background: var(--primary-soft); }
.stepper input { width: 40px; border: 0; text-align: center; font-weight: 700; height: 32px; outline: 0; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper .unit { font-size: 11px; color: var(--muted); padding-inline-end: 6px; }
.empty-state { grid-column: 1 / -1; text-align: center; padding: 40px 16px; color: var(--muted); }

/* ---------- Cart panel ---------- */
.cart-panel { position: sticky; top: calc(var(--header-h) + 16px); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; max-height: calc(100vh - var(--header-h) - 32px); }
.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 10px; }
.cart-head h2 { font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.count-pill { background: var(--primary-soft); color: var(--primary); border-radius: 999px; font-size: 12px; padding: 1px 8px; font-weight: 700; }
.cart-head-actions { display: flex; gap: 2px; }
.cart-close { display: none; }
.saved-lists { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 8px; }
.saved-lists:empty { display: none; }
.list-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border-radius: 999px; padding: 4px 6px 4px 10px; font-size: 12.5px; }
.list-chip button { border: 0; background: none; padding: 2px 5px; border-radius: 6px; color: var(--muted); }
.list-chip button.load { color: var(--primary); font-weight: 700; }
.list-chip button:hover { background: #fff; }
.cart-items { overflow: auto; padding: 4px 18px; flex: 1; min-height: 80px; }
.cart-item { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-item:last-child { border-bottom: 0; }
.cart-item-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 20px; background: var(--tint, var(--surface-2)); }
.cart-item-name { font-weight: 600; font-size: 14px; line-height: 1.3; }
.cart-item-meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sub-link { border: 0; background: none; color: var(--primary); font-size: 12px; padding: 0; font-weight: 600; }
.sub-link.has-sub { color: var(--warn); }
.cart-item-actions { display: flex; align-items: center; gap: 4px; }
.remove-btn { border: 0; background: none; color: var(--muted); width: 26px; height: 26px; border-radius: 50%; }
.remove-btn:hover { background: var(--danger-soft); color: var(--danger); }
.sub-picker { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; background: var(--surface-2); border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.sub-picker select { flex: 1; border: 1px solid var(--line-strong); border-radius: 8px; padding: 5px 8px; background: #fff; font-size: 13px; }
.cart-empty { text-align: center; color: var(--muted); padding: 24px 10px; font-size: 14px; }
.cart-empty .big { font-size: 34px; margin-bottom: 6px; }
.cart-address { padding: 12px 18px; border-top: 1px solid var(--line); }
.cart-address label { font-weight: 700; font-size: 14px; display: block; margin-bottom: 8px; }
.address-field { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line-strong); border-radius: 12px; padding: 0 12px; height: 44px; background: var(--surface); }
.address-field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.address-field input { flex: 1; border: 0; outline: 0; background: transparent; height: 100%; font-size: 15px; }
.cart-footer { padding: 12px 18px 18px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 18px 18px; }
.cart-estimate { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; color: var(--text-2); font-size: 14px; }
.cart-estimate strong { font-size: 20px; color: var(--text); direction: ltr; unicode-bidi: isolate; }
.cart-fab { position: fixed; bottom: 18px; inset-inline-start: 50%; transform: translateX(50%); z-index: 25; display: flex; align-items: center; gap: 10px; background: var(--text); color: #fff; border: 0; border-radius: 999px; padding: 12px 20px; font-weight: 700; box-shadow: var(--shadow-lg); }

/* ---------- Comparison ---------- */
.compare-section { padding: 48px 0; background: linear-gradient(180deg, var(--bg), #eef2ec); border-top: 1px solid var(--line); scroll-margin-top: var(--header-h); }
.compare-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.compare-summary { font-size: 16px; color: var(--text-2); margin-top: 6px; }
.compare-summary strong { color: var(--text); }
.compare-meta { font-size: 13px; }
.compare-cards { display: grid; gap: 14px; }
.chain-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; display: grid; grid-template-columns: 1.3fr 1fr 1fr auto; gap: 18px; align-items: center; box-shadow: var(--shadow-sm); position: relative; }
.chain-card.is-best { border: 2px solid var(--best); background: linear-gradient(180deg, #fffdf6, #fff); box-shadow: 0 10px 30px rgba(245, 158, 11, .18); }
.chain-card.is-unavailable { opacity: .65; grid-template-columns: 1.3fr 2fr auto; }
.best-ribbon { position: absolute; top: -12px; inset-inline-start: 20px; background: var(--best); color: #fff; font-weight: 800; font-size: 12px; padding: 4px 12px; border-radius: 999px; box-shadow: var(--shadow-sm); }
.chain-id { display: flex; align-items: center; gap: 12px; }
.chain-logo { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 18px; flex: none; }
.chain-name { font-weight: 800; font-size: 18px; }
.chain-branch { font-size: 13px; color: var(--muted); }
.chain-flags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.flag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.flag.warn { background: var(--warn-soft); color: var(--warn); }
.flag.bad { background: var(--danger-soft); color: var(--danger); }
.flag.ok { background: var(--accent-soft); color: var(--accent); }
.availability { min-width: 0; }
.avail-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.avail-label strong { font-weight: 700; }
.avail-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.avail-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.avail-bar.partial span { background: var(--warn); }
.missing-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.chip { font-size: 11.5px; background: var(--danger-soft); color: var(--danger); padding: 2px 8px; border-radius: 999px; }
.chip.sub { background: var(--warn-soft); color: var(--warn); }
.delivery { font-size: 14px; color: var(--text-2); }
.delivery div + div { margin-top: 4px; }
.delivery .free { color: var(--accent); font-weight: 700; }
.pricing { text-align: left; direction: ltr; }
.pricing .total { font-size: 28px; font-weight: 800; letter-spacing: -.5px; direction: rtl; }
.pricing .breakdown { font-size: 12.5px; color: var(--muted); direction: rtl; }
.pricing .savings { color: var(--accent); font-size: 12.5px; font-weight: 600; direction: rtl; }
.chain-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.chain-actions .btn-primary { min-width: 160px; }
.details-btn { border: 0; background: none; color: var(--primary); font-size: 13px; font-weight: 600; padding: 4px; }
.chain-details { grid-column: 1 / -1; border-top: 1px dashed var(--line); padding-top: 12px; overflow-x: auto; }
.details-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
.details-table th { text-align: right; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.details-table td { padding: 7px 8px; border-bottom: 1px solid var(--surface-2); }
.st-ok { color: var(--accent); font-weight: 600; }
.st-substituted { color: var(--warn); font-weight: 600; }
.st-missing, .st-out_of_stock { color: var(--danger); font-weight: 600; }
.unavailable-msg { color: var(--text-2); font-size: 14px; }

/* ---------- How it works ---------- */
.how-section { padding: 56px 0; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 28px; }
.how-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: var(--shadow-sm); }
.how-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--primary-soft); display: grid; place-items: center; font-size: 24px; margin-bottom: 12px; }
.how-card h3 { font-size: 18px; margin-bottom: 6px; }
.how-card p { color: var(--text-2); font-size: 14.5px; }
.how-note { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin-top: 18px; color: var(--text-2); font-size: 14.5px; }
.how-note-icon { font-size: 22px; }
.chains-strip { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; justify-content: center; }
.chain-pill { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px 6px 8px; font-size: 13.5px; font-weight: 600; }
.chain-pill .status { font-size: 11px; font-weight: 600; color: var(--muted); }
.chain-pill .status.ok { color: var(--accent); }

.site-footer { border-top: 1px solid var(--line); padding: 20px 0; color: var(--muted); font-size: 13px; }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer-inner nav { display: flex; gap: 16px; }
#alerts-link { color: var(--danger); font-weight: 700; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 20, .5); backdrop-filter: blur(3px); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .15s ease; }
.modal { background: var(--surface); border-radius: 20px; width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; box-shadow: var(--shadow-lg); animation: rise .18s ease; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 20px 22px 8px; }
.modal-head h3 { font-size: 20px; font-weight: 800; flex: 1; }
.modal-close { border: 0; background: var(--surface-2); width: 32px; height: 32px; border-radius: 50%; color: var(--muted); }
.modal-body { padding: 8px 22px 22px; display: grid; gap: 14px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-start; padding: 0 22px 22px; flex-wrap: wrap; }
.notice { border-radius: 12px; padding: 12px 14px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.notice.warn { background: var(--warn-soft); color: #7c3d00; }
.notice.info { background: var(--primary-soft); color: #0b4d48; }
.notice.ok { background: var(--accent-soft); color: #14532d; }
.notice.bad { background: var(--danger-soft); color: #7f1d1d; }
.steps-list { display: grid; gap: 10px; }
.step-row { display: flex; gap: 12px; align-items: flex-start; }
.step-icon { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; background: var(--surface-2); color: var(--muted); flex: none; }
.step-row.done .step-icon { background: var(--accent); color: #fff; }
.step-row.active .step-icon { background: var(--primary); color: #fff; }
.step-row.failed .step-icon { background: var(--danger); color: #fff; }
.step-title { font-weight: 700; font-size: 15px; }
.step-desc { font-size: 13.5px; color: var(--text-2); }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.items-summary { font-size: 13.5px; color: var(--text-2); }
.items-summary summary { cursor: pointer; font-weight: 600; color: var(--primary); }
.items-summary ul { columns: 2; margin-top: 8px; }
.items-summary li { padding: 2px 0; }
.items-summary li.skipped { color: var(--danger); }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; direction: ltr; unicode-bidi: embed; }
.install-steps { font-size: 13.5px; color: var(--text-2); display: grid; gap: 4px; padding-inline-start: 18px; list-style: decimal; }

.toast { position: fixed; bottom: 24px; inset-inline-start: 50%; transform: translateX(50%); background: var(--text); color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); z-index: 60; animation: rise .18s ease; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .chain-card { grid-template-columns: 1.2fr 1fr; }
  .chain-card .pricing { text-align: right; }
  .chain-actions { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; }
}
@media (max-width: 900px) {
  .steps-nav { display: none; }
  .hero-inner { grid-template-columns: 1fr; padding: 36px 20px 32px; }
  .hero h1 { font-size: 32px; }
  .hero-card { display: none; }
  .workspace { grid-template-columns: 1fr; }
  .cart-toggle { display: inline-flex; align-items: center; gap: 6px; }
  .cart-close { display: inline-block; }
  .cart-panel { position: fixed; inset: auto 0 0 0; top: auto; max-height: 88vh; border-radius: 20px 20px 0 0; z-index: 40; transform: translateY(105%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
  .cart-panel.is-open { transform: none; }
  .cart-fab[hidden] { display: none; }
  .cart-fab { display: flex; }
  .how-grid { grid-template-columns: 1fr; }
  .chain-card, .chain-card.is-unavailable { grid-template-columns: 1fr; gap: 12px; }
  .chain-card .pricing { text-align: right; }
  .items-summary ul { columns: 1; }
  .toast { bottom: auto; top: calc(var(--header-h) + 12px); max-width: calc(100% - 32px); text-align: center; }
}
@media (min-width: 901px) {
  .cart-fab { display: none !important; }
}

/* bookmarklet drag button inside the handoff dialog */
.btn-small { padding: 6px 12px; font-size: 14px; cursor: grab; }
.btn-small:active { cursor: grabbing; }

/* ---------- Handoff dialog (bookmark onboarding + progress) ---------- */
.ho-title { font-size: 21px; font-weight: 800; line-height: 1.25; }
.ho-sub { color: var(--text-2); font-size: 14.5px; margin-top: 4px; }
.ho-card { border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: grid; gap: 14px; background: var(--surface); }
.ho-drag { display: grid; gap: 10px; justify-items: center; text-align: center; padding: 14px; border-radius: 14px; background: var(--primary-soft); border: 2px dashed var(--primary); }
.ho-drag .btn-bm { font-size: 18px; padding: 14px 26px; border-radius: 14px; background: var(--primary); color: #fff; border: 0; box-shadow: 0 8px 20px rgba(15,118,110,.3); cursor: grab; user-select: none; }
.ho-drag .btn-bm:active { cursor: grabbing; }
.ho-drag .lbl { font-weight: 700; font-size: 15px; color: #0b4d48; }
.ho-drag .lbl small { display: block; font-weight: 500; color: var(--text-2); margin-top: 2px; }
.kbd { display: inline-block; font-family: ui-monospace, Menlo, monospace; font-size: 12px; padding: 1px 7px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; background: var(--surface-2); direction: ltr; unicode-bidi: embed; }
.ho-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ho-steps { display: grid; gap: 0; }
.ho-step { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); align-items: start; }
.ho-step:first-child { border-top: 0; }
.ho-step .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: var(--surface-2); color: var(--muted); }
.ho-step.done .n { background: var(--accent); color: #fff; }
.ho-step.active .n { background: var(--primary); color: #fff; }
.ho-step.failed .n { background: var(--danger); color: #fff; }
.ho-step .t { font-weight: 700; font-size: 15.5px; }
.ho-step .d { color: var(--text-2); font-size: 14px; margin-top: 2px; }
.ho-step.active .t { color: var(--primary); }
.ho-status { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); margin-top: 8px; }
.ho-status .spinner { border-color: rgba(15,118,110,.25); border-top-color: var(--primary); }
.ho-result { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 14px; }
.ho-result.ok { background: var(--accent-soft); color: #14532d; }
.ho-result.warn { background: var(--warn-soft); color: #7c3d00; }
.ho-result.bad { background: var(--danger-soft); color: #7f1d1d; }
.ho-result .big { font-size: 28px; }
.ho-result .t { font-weight: 800; font-size: 16px; }
.ho-result .d { font-size: 13.5px; margin-top: 2px; }
.ho-items { font-size: 13.5px; color: var(--text-2); }
.ho-items summary { cursor: pointer; font-weight: 600; color: var(--primary); }
.ho-items ul { margin-top: 6px; columns: 2; }
.ho-items li.skipped { color: var(--danger); }

/* Mini browser used by the animated instructions */
.mb { position: relative; direction: ltr; height: 200px; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; overflow: hidden; box-shadow: var(--shadow-sm); }
.mb-tabs { height: 26px; background: #dfe3e6; display: flex; align-items: flex-end; padding: 0 10px; gap: 6px; }
.mb-tab { width: 120px; height: 20px; background: #fff; border-radius: 8px 8px 0 0; position: relative; }
.mb-tab::after { content: ""; position: absolute; left: 8px; top: 7px; width: 70px; height: 6px; border-radius: 3px; background: #c9cfd4; }
.mb-addr { height: 30px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border-bottom: 1px solid #e6e9ec; }
.mb-addr i { width: 8px; height: 8px; border-radius: 50%; background: #d0d5da; }
.mb-addr .url { flex: 1; height: 18px; border-radius: 9px; background: #f1f3f4; }
.mb-bar { height: 28px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border-bottom: 1px solid #e6e9ec; position: relative; }
.mb-bar .lab { position: absolute; right: 10px; top: 6px; font-size: 10.5px; color: var(--muted); direction: rtl; }
.mb-bar .bm { height: 16px; width: 44px; border-radius: 4px; background: #eceff1; }
.mb-bar .drop { position: absolute; left: 10px; top: 4px; height: 20px; width: 92px; border: 2px dashed var(--primary); border-radius: 6px; opacity: 0; }
.mb-page { position: absolute; left: 0; right: 0; top: 84px; bottom: 0; background: var(--bg); }
.mb-page .card { position: absolute; left: 16px; top: 14px; width: 150px; height: 84px; border-radius: 10px; background: #fff; border: 1px solid var(--line); }
.mb-page .card::before { content: ""; position: absolute; left: 12px; top: 12px; width: 90px; height: 8px; border-radius: 4px; background: #e2e6e3; }
.mb-page .card::after { content: ""; position: absolute; left: 12px; top: 28px; width: 60px; height: 8px; border-radius: 4px; background: #eceff0; }
.mb-chip { position: absolute; left: 28px; top: 132px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 8px; white-space: nowrap; box-shadow: 0 4px 10px rgba(0,0,0,.15); direction: rtl; }
.mb-cursor { position: absolute; left: 60px; top: 150px; width: 22px; height: 22px; z-index: 3; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.mb-banner { position: absolute; left: 0; right: 0; top: 0; padding: 6px 10px; font-size: 11.5px; font-weight: 700; color: #fff; background: #1d4ed8; direction: rtl; transform: translateY(-110%); }
.mb-cartbadge { position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; font-size: 15px; }
.mb-cartbadge b { position: absolute; right: -6px; top: -6px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; display: grid; place-items: center; padding: 0 4px; }
.mb-ok { position: absolute; left: 12px; top: 4px; width: 92px; height: 20px; border-radius: 6px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; direction: rtl; opacity: 0; }

/* Animation A: drag the button into the bookmarks bar */
.mb.drag .mb-chip { animation: mbDragChip 4.5s ease-in-out infinite; }
.mb.drag .mb-cursor { animation: mbDragCursor 4.5s ease-in-out infinite; }
.mb.drag .drop { animation: mbDropZone 4.5s ease-in-out infinite; }
.mb.drag .mb-ok { animation: mbOk 4.5s ease-in-out infinite; }
@keyframes mbDragChip { 0%, 18% { left: 28px; top: 132px; transform: none; opacity: 1; } 24% { transform: scale(1.06) rotate(-3deg); } 62% { left: 12px; top: 34px; transform: scale(1.06) rotate(0); opacity: 1; } 68%, 100% { left: 12px; top: 34px; transform: scale(1); opacity: 0; } }
@keyframes mbDragCursor { 0%, 18% { left: 62px; top: 148px; } 62% { left: 46px; top: 50px; } 68% { left: 46px; top: 50px; } 100% { left: 62px; top: 148px; } }
@keyframes mbDropZone { 0%, 20% { opacity: 0; } 30%, 62% { opacity: 1; } 70%, 100% { opacity: 0; } }
@keyframes mbOk { 0%, 66% { opacity: 0; } 70%, 100% { opacity: 1; } }

/* Animation B: click the bookmark, the cart fills */
.mb.click .mb-ok { opacity: 1; }
.mb.click .mb-cursor { animation: mbClickCursor 5s ease-in-out infinite; }
.mb.click .mb-ok { animation: mbClickPulse 5s ease-in-out infinite; }
.mb.click .mb-banner { animation: mbBanner 5s ease-in-out infinite; }
.mb.click .mb-cartbadge b { animation: mbBadge 5s steps(1) infinite; }
@keyframes mbClickCursor { 0% { left: 120px; top: 150px; } 28%, 40% { left: 50px; top: 16px; } 100% { left: 120px; top: 150px; } }
@keyframes mbClickPulse { 0%, 28% { transform: none; box-shadow: none; } 32% { transform: scale(.93); box-shadow: 0 0 0 4px rgba(15,118,110,.3); } 36%, 100% { transform: none; box-shadow: none; } }
@keyframes mbBanner { 0%, 34% { transform: translateY(-110%); background: #1d4ed8; } 40%, 68% { transform: none; background: #1d4ed8; } 72%, 92% { transform: none; background: #16a34a; } 100% { transform: translateY(-110%); } }
@keyframes mbBadge { 0%, 44% { content: "0"; } }
.mb.click .mb-cartbadge .c0, .mb.click .mb-cartbadge .c1, .mb.click .mb-cartbadge .c2, .mb.click .mb-cartbadge .c3 { position: absolute; right: -6px; top: -6px; opacity: 0; }
.mb.click .c0 { animation: mbC0 5s steps(1) infinite; } .mb.click .c1 { animation: mbC1 5s steps(1) infinite; } .mb.click .c2 { animation: mbC2 5s steps(1) infinite; } .mb.click .c3 { animation: mbC3 5s steps(1) infinite; }
@keyframes mbC0 { 0%, 44% { opacity: 1; } 45%, 100% { opacity: 0; } }
@keyframes mbC1 { 0%, 45% { opacity: 0; } 46%, 52% { opacity: 1; } 53%, 100% { opacity: 0; } }
@keyframes mbC2 { 0%, 53% { opacity: 0; } 54%, 60% { opacity: 1; } 61%, 100% { opacity: 0; } }
@keyframes mbC3 { 0%, 61% { opacity: 0; } 62%, 100% { opacity: 1; } }
.mb.click .mb-banner .txt-load, .mb.click .mb-banner .txt-done { position: absolute; inset: 0; padding: 6px 10px; }
.mb.click .mb-banner .txt-load { animation: mbTxtLoad 5s steps(1) infinite; }
.mb.click .mb-banner .txt-done { animation: mbTxtDone 5s steps(1) infinite; }
@keyframes mbTxtLoad { 0%, 70% { opacity: 1; } 71%, 100% { opacity: 0; } }
@keyframes mbTxtDone { 0%, 70% { opacity: 0; } 71%, 100% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .mb * { animation: none !important; } .mb .mb-ok { opacity: 1; } }
@media (max-width: 520px) { .ho-items ul { columns: 1; } .mb { height: 180px; } }
.ho-check { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; background: var(--best-soft); border: 1px solid #f3dca3; }
.ho-check .t { font-weight: 700; font-size: 15px; color: #7c3d00; }
.ho-check .d { font-size: 13.5px; color: var(--text-2); margin-top: 2px; }
.ho-check .pulse { flex: none; width: 14px; height: 14px; margin-top: 4px; border-radius: 50%; background: var(--best); box-shadow: 0 0 0 0 rgba(245,158,11,.6); animation: pulse 1.4s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(245,158,11,.6); } 100% { box-shadow: 0 0 0 12px rgba(245,158,11,0); } }
