/* دستیار هوشمند خرازی — طلایی + سبزآبی (رنگ‌های لوگو). Font: Vazirmatn (see scripts/download_font.py). */
@font-face {
  font-family: "Vazirmatn";
  src: local("Vazirmatn"), url("/static/fonts/Vazirmatn-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* ===== پالت برند (از روی لوگو): برای تغییر رنگ‌ها فقط همین بلوک را ویرایش کنید ===== */
  --teal: #2e9a90;          /* سبزآبی اصلی لوگو */
  --teal-deep: #1d6f67;     /* سبزآبی تیره (متن و دکمه‌های جدی) */
  --teal-light: #7ec5c6;    /* سبزآبی روشن */
  --teal-tint: #eaf6f4;     /* پس‌زمینهٔ بسیار روشن */
  --teal-tint-2: #d9eeea;   /* حباب پیام مشتری */
  --gold: #b79c55;          /* طلایی لوگو */
  --gold-bright: #cfb468;
  --gold-light: #ecd9a0;
  --gold-text: #7d6a30;     /* طلایی تیره برای متن روی سفید */
  --on-gold: #2b2200;       /* رنگ نوشته روی دکمهٔ طلایی */
  --ink: #16393a;
  --muted: #587274;
  --line: #d3e6e2;
  --surface: #ffffff;
  --page: #f8fcfb;
  --ok: #0b6e63; --ok-bg: #d7f3ee;
  --bad: #b3213f; --bad-bg: #ffe3ea;
  --warn: #7a5300; --warn-bg: #fff3d1;
  --shadow: 0 10px 34px -14px rgba(22, 57, 58, .35);
  --font: "Vazirmatn", "Vazir", "Segoe UI", Tahoma, "Noto Sans Arabic", system-ui, sans-serif;
  --col: 900px;
  --top: 64px;
  --side: 300px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); line-height: 1.85; overflow: hidden;
  background: radial-gradient(900px 420px at 85% -8%, rgba(126, 197, 198, .28), transparent 62%),
              radial-gradient(700px 360px at 8% 0%, rgba(207, 180, 104, .16), transparent 60%), var(--page);
  display: flex; flex-direction: column; height: 100dvh;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 10px; z-index: 90; }
.skip-link:focus { top: 10px; }

/* ---------- top bar ---------- */
.topbar { flex: none; height: var(--top); display: flex; align-items: center; gap: 10px; padding: 0 clamp(12px, 2.4vw, 28px); background: rgba(255, 255, 255, .72); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: relative; z-index: 30; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--gold-text); font-weight: 900; min-width: 0; margin-inline-end: auto; }
.brand-mark { height: 38px; width: auto; object-fit: contain; flex: none; }
.brand-name { font-size: 1.12rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; min-width: 40px; padding: 0 10px; border: 1.5px solid var(--line); background: var(--surface); color: var(--teal-deep); border-radius: 999px; font-weight: 700; font-size: .88rem; }
.icon-button svg { width: 20px; height: 20px; flex: none; }
.icon-button:hover { border-color: var(--gold); }
.icon-button.with-label { padding: 0 14px; }
.badge { background: var(--teal); color: #fff; border-radius: 999px; min-width: 20px; padding: 0 6px; font-size: .76rem; line-height: 20px; text-align: center; }
.badge:empty { display: none; }
.auth-button { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; text-decoration: none; white-space: nowrap; font-weight: 800; font-size: .9rem; color: var(--on-gold); background: linear-gradient(135deg, var(--gold), var(--gold-light)); box-shadow: 0 6px 16px -8px rgba(125, 106, 48, .7); transition: filter .15s, transform .15s; }
.auth-button:hover { filter: brightness(1.05); transform: translateY(-1px); }
.auth-button svg { width: 19px; height: 19px; flex: none; }
.auth-button .sep { width: 1.5px; height: 15px; background: rgba(43, 34, 0, .35); border-radius: 2px; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 6px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; max-width: 210px; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { border-color: var(--gold); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--gold), var(--gold-light)); color: var(--on-gold); font-weight: 900; flex: none; }
.user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: .88rem; color: var(--teal-deep); }
.menu-panel { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); min-width: 210px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; z-index: 40; }
.menu-panel a, .menu-panel button { text-align: start; border: 0; background: transparent; padding: 9px 14px; border-radius: 10px; text-decoration: none; color: var(--ink); font-size: .9rem; }
.menu-panel a:hover, .menu-panel button:hover { background: var(--teal-tint); }
.status-pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px; font-size: .78rem; color: var(--muted); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); }
.status-pill.is-ok .status-dot { background: #1f9d8d; }
.status-pill.is-error .status-dot { background: var(--bad); }
.menu-only { display: none; }

/* ---------- shell: history sidebar + chat ---------- */
.shell { flex: 1; min-height: 0; display: flex; width: 100%; max-width: 1560px; margin: 0 auto; }
.history { flex: none; width: var(--side); display: flex; flex-direction: column; gap: 6px; padding: 14px 14px 12px; overflow-y: auto; border-inline-end: 1px solid var(--line); background: rgba(255, 255, 255, .55); }
.history-head { display: flex; gap: 8px; align-items: center; }
.new-chat-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; border-radius: 14px; border: 1.5px solid var(--gold); background: var(--surface); color: var(--gold-text); font-weight: 800; }
.new-chat-btn svg { width: 19px; height: 19px; }
.new-chat-btn:hover { background: #fbf5e1; }
.history-title { margin: 14px 4px 2px; font-size: .82rem; color: var(--muted); font-weight: 700; }
.history-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.history-list li { position: relative; }
.history-item { width: 100%; padding-inline-end: 38px !important; text-align: start; border: 1.5px solid transparent; background: transparent; padding: 9px 12px; border-radius: 12px; display: flex; flex-direction: column; gap: 0; line-height: 1.5; }
.history-item:hover { background: var(--teal-tint); }
.history-item.active { background: var(--teal-tint-2); border-color: var(--teal-light); }
.history-item .h-title { font-size: .9rem; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.history-item .h-date { font-size: .74rem; color: var(--muted); }
.history-delete { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; opacity: 0; transition: opacity .15s, background .15s, color .15s; }
.history-delete svg { width: 17px; height: 17px; }
.history-list li:hover .history-delete, .history-delete:focus-visible { opacity: 1; }
.history-delete:hover { background: var(--bad-bg); color: var(--bad); }
@media (hover: none) { .history-delete { opacity: .7; } }
.history-empty, .history-note { margin: 8px 6px; font-size: .82rem; color: var(--muted); }
.history-note { background: #fbf5e1; color: var(--gold-text); border-radius: 12px; padding: 8px 12px; margin-top: auto; }
.backdrop { position: fixed; inset: 0; background: rgba(22, 57, 58, .45); z-index: 55; }

/* ---------- chat column ---------- */
.chat { flex: 1; min-width: 0; max-width: var(--col); margin: 0 auto; padding: 0 clamp(10px, 2.4vw, 24px) 12px; display: flex; flex-direction: column; min-height: 0; }
.assistant-title { flex: none; margin: 10px 0 6px; text-align: center; font-weight: 900; line-height: 1.35; display: flex; flex-direction: column; }
.assistant-title .t1 { font-size: clamp(1.15rem, 2.2vw, 1.5rem); color: var(--teal-deep); }
.assistant-title .t2 { font-size: clamp(1.7rem, 4vw, 2.6rem); background: linear-gradient(135deg, var(--gold-text), var(--gold-bright)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.chat.has-messages .assistant-title { flex-direction: row; justify-content: center; gap: 8px; margin: 4px 0 2px; }
.chat.has-messages .assistant-title .t1 { font-size: 1.05rem; }
.chat.has-messages .assistant-title .t2 { font-size: 1.05rem; }
.chat-box { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.conversation { flex: 1; overflow-y: auto; padding: 6px 4px 14px; scroll-behavior: smooth; min-height: 0; overscroll-behavior: contain; }
.conversation:focus-visible { outline-offset: -3px; }

.welcome-panel { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 0 6px; }
.welcome-logo { width: min(250px, 52%); height: auto; filter: drop-shadow(0 10px 18px rgba(46, 154, 144, .22)); }
.welcome-lead { margin: 6px 0 16px; font-size: clamp(1.02rem, 2vw, 1.25rem); color: var(--ink); font-weight: 700; }
.chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: min(640px, 100%); }
.chip { display: flex; flex-direction: column; gap: 2px; text-align: start; padding: 12px 16px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; transition: transform .15s, border-color .15s, box-shadow .15s; }
.chip b { color: var(--teal-deep); } .chip span { color: var(--muted); font-size: .86rem; }
.chip:hover:not(:disabled) { border-color: var(--gold); transform: translateY(-2px); box-shadow: var(--shadow); }

/* ---------- messages ---------- */
.messages { display: flex; flex-direction: column; gap: 22px; }
.message { display: flex; flex-direction: column; gap: 8px; max-width: 100%; }
.message.user { align-items: flex-start; }               /* RTL: flex-start = right edge */
.message.user .message-header { display: none; }
.message.user .message-bubble { background: var(--teal-tint-2); border-radius: 22px 22px 22px 6px; padding: 10px 18px; max-width: min(78%, 620px); }
.message.assistant { display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 12px; align-items: start; }
.message.assistant > * { grid-column: 2; }
.message.assistant .message-header { grid-column: 1; grid-row: 1 / span 20; display: block; }
.message-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--line); object-fit: contain; padding: 3px; display: block; }
.message-name { display: none; }
.message-bubble { min-width: 0; }
.message-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-error { background: var(--bad-bg); color: var(--bad); border-radius: 12px; padding: 8px 12px; font-size: .88rem; }
.message-error p { margin: 0 0 4px; }
.restore-message { border: 0; background: transparent; color: var(--bad); text-decoration: underline; padding: 0; }
.warning-list, .mode-badge, .guide-badge { font-size: .82rem; color: var(--warn); background: var(--warn-bg); border-radius: 10px; padding: 6px 12px; }
.warning-list { margin: 0; padding-inline-start: 28px; }

.typing-indicator { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .9rem; padding: 10px 4px; }
.typing-dots { display: inline-flex; gap: 4px; }
.typing-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); animation: bounce 1s infinite ease-in-out; }
.typing-dots i:nth-child(2) { animation-delay: .15s; } .typing-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(.55); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }

/* ---------- products + article cards: compact, horizontal scroller ---------- */
.products-section { min-width: 0; }
.products-title { margin: 4px 0 8px; font-size: .95rem; color: var(--teal-deep); }
.row-wrap { position: relative; min-width: 0; }
.products-row { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--gold-light) transparent; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.products-row::-webkit-scrollbar { height: 8px; } .products-row::-webkit-scrollbar-thumb { background: var(--gold-light); border-radius: 8px; }
.row-arrow { position: absolute; top: 50px; width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); color: var(--teal-deep); box-shadow: var(--shadow); font-weight: 900; line-height: 1; z-index: 2; }
.row-arrow:hover { border-color: var(--gold); }
.row-arrow.prev { inset-inline-start: -8px; } .row-arrow.next { inset-inline-end: -8px; }
@media (hover: none) { .row-arrow { display: none; } }

.product-card { flex: 0 0 200px; scroll-snap-align: start; display: flex; flex-direction: column; background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.product-card:hover { border-color: var(--gold); box-shadow: var(--shadow); }
/* the picture can never spill over the text below it: fixed box, image absolutely positioned inside */
.product-visual { position: relative; flex: none; height: 132px; overflow: hidden; background: var(--teal-tint); }
.product-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 6px; transition: opacity .2s; }
.image-fallback { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 4px; color: var(--teal-light); font-size: .72rem; }
.image-fallback svg { width: 34px; height: 34px; }
.product-body { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 12px; flex: 1; font-size: .84rem; line-height: 1.6; position: relative; background: var(--surface); }
.product-name { margin: 0; font-size: .92rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.product-sku, .stock-quantity, .product-attributes, .product-more, .variable-note, .price-note { display: none; }
.product-price { margin: 0; font-weight: 900; font-size: 1.02rem; color: var(--teal-deep); display: flex; gap: 5px; align-items: baseline; }
.currency-code { font-size: .78rem; font-weight: 600; color: var(--gold-text); }
.stock-line { display: flex; align-items: center; gap: 6px; }
.stock-badge { font-size: .72rem; font-weight: 800; padding: 1px 9px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); }
.stock-badge.instock { background: var(--ok-bg); color: var(--ok); } .stock-badge.outofstock { background: var(--bad-bg); color: var(--bad); }
.product-description { margin: 0; color: var(--muted); font-size: .78rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.purchase-note, .product-link-note { margin: 0; color: var(--warn); font-size: .76rem; }
.buy-controls { display: flex; flex-direction: column; gap: 6px; margin-top: auto; }
body:not([data-orders="on"]) .buy-controls { display: none; }
.buy-button, .checkout-button { border: 0; border-radius: 11px; padding: 7px 10px; font-weight: 800; font-size: .84rem; color: var(--on-gold); background: linear-gradient(135deg, var(--gold), var(--gold-light)); transition: filter .15s, transform .15s; }
.buy-button:hover:not(:disabled), .checkout-button:hover:not(:disabled) { filter: brightness(1.05); transform: translateY(-1px); }
.buy-button:disabled, .checkout-button:disabled { opacity: .55; }
.checkout-button { padding: 10px 20px; font-size: .95rem; }
.variation-select { width: 100%; padding: 6px 8px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font-size: .8rem; }
.product-link { display: block; text-align: center; text-decoration: none; background: var(--teal-deep); color: #fff; border-radius: 11px; padding: 6px 8px; font-weight: 700; font-size: .8rem; margin-top: auto; }
.buy-controls + .product-link, .product-body > .product-link:not(:only-child) { margin-top: 0; }
.product-link:hover { background: var(--teal); }
.view-only { display: inline-block; align-self: flex-start; font-size: .74rem; font-weight: 800; color: var(--teal-deep); background: var(--teal-tint-2); border-radius: 999px; padding: 1px 10px; }

/* ---------- composer ---------- */
.composer { flex: none; padding-top: 6px; }
.composer-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.input-frame { display: flex; align-items: flex-end; gap: 8px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 28px; padding: 8px 10px 8px 10px; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.input-frame:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(183, 156, 85, .18), var(--shadow); }
.input-frame textarea { flex: 1; min-width: 0; border: 0; outline: 0; resize: none; background: transparent; padding: 8px 10px; max-height: 160px; line-height: 1.7; }
.input-frame textarea::placeholder { color: #8fb0ad; }
.send-button { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0; display: grid; place-items: center; background: linear-gradient(135deg, var(--gold), var(--gold-light)); color: var(--on-gold); }
.send-button:disabled { opacity: .45; }
.send-button svg { width: 20px; height: 20px; }
.composer-foot { display: flex; justify-content: space-between; gap: 10px; padding: 6px 14px 0; font-size: .74rem; color: var(--muted); }
.composer-foot .near-limit { color: var(--bad); }
.input-error { margin: 6px 14px 0; color: var(--bad); font-size: .86rem; }

/* ---------- cart ---------- */
.cart-panel { margin: 0 0 10px; border: 1.5px dashed var(--gold); border-radius: 18px; background: rgba(255, 255, 255, .8); }
.cart-panel summary { cursor: pointer; padding: 10px 16px; font-weight: 800; color: var(--teal-deep); }
.cart-count { color: var(--gold-text); font-weight: 700; }
.cart-lines { list-style: none; margin: 0; padding: 0 16px; }
.cart-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.cart-info { display: flex; flex-direction: column; font-size: .88rem; line-height: 1.6; }
.cart-variation, .cart-unit { color: var(--muted); font-size: .78rem; }
.qty { display: inline-flex; align-items: center; gap: 8px; }
.qty-button { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; font-weight: 800; }
.qty-button:hover { border-color: var(--gold); color: var(--gold-text); }
.qty-value { min-width: 1.5em; text-align: center; font-weight: 800; }
.cart-discount { margin: 4px 16px 0; padding: 8px 12px; border-radius: 12px; background: #fbf5e1; color: var(--gold-text); font-weight: 700; font-size: .86rem; }
.cart-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px 14px; border-top: 1px solid var(--line); margin-top: 6px; }
.cart-total { font-weight: 800; }
.cart-buttons { display: inline-flex; gap: 12px; align-items: center; }
.text-button { border: 0; background: transparent; color: var(--teal-deep); text-decoration: underline; padding: 6px 4px; }

/* ---------- dialogs ---------- */
.checkout-dialog, .modal { border: 0; border-radius: 22px; padding: 0; width: min(640px, 94vw); max-height: 92vh; box-shadow: var(--shadow); color: var(--ink); background: var(--surface); }
.modal { width: min(440px, 94vw); }
.checkout-dialog::backdrop, .modal::backdrop { background: rgba(22, 57, 58, .5); }
.checkout-dialog form, .modal form { padding: 22px 24px; }
.checkout-dialog h3, .modal h3 { margin: 0 0 8px; font-size: 1.2rem; }
.modal form { text-align: center; }
.modal-logo { margin: 0 auto 4px; display: block; }
.modal-hint { margin: 0 0 14px; color: var(--muted); font-size: .9rem; }
.modal-field { display: flex; flex-direction: column; gap: 4px; text-align: start; font-size: .86rem; color: var(--muted); margin-bottom: 8px; }
.modal-field input, .field-grid input, .field-grid textarea { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; color: var(--ink); }
.modal-field input:focus, .field-grid input:focus, .field-grid textarea:focus { outline: 0; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(183, 156, 85, .2); }
.modal-done p { font-weight: 800; color: var(--ok); }
.site-link { display: inline-block; background: var(--teal-deep); color: #fff; padding: 9px 18px; border-radius: 12px; text-decoration: none; font-weight: 700; }
.checkout-summary { background: var(--teal-tint); border: 1px dashed var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-size: .9rem; }
.checkout-summary p { margin: 0; } .checkout-total { font-weight: 800; } .checkout-discount { color: var(--gold-text); font-weight: 800; }
.checkout-summary .price-note { display: block; color: var(--muted); font-size: .8rem; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.field-grid label { display: flex; flex-direction: column; gap: 2px; font-size: .84rem; color: var(--muted); }
.field-grid .wide { grid-column: 1 / -1; }
.confirm-line { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; font-size: .86rem; }
.confirm-line input { margin-top: 6px; }
.dialog-actions { display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin-top: 14px; }
.modal .dialog-actions { justify-content: center; flex-wrap: wrap; }

/* ---------- invoice ---------- */
.invoice-card { border: 2px dashed var(--gold); border-radius: 18px; background: #fff; padding: 14px 18px; max-width: 72ch; margin-top: 6px; }
.invoice-title { margin: 0; font-size: 1.05rem; }
.invoice-status { color: var(--warn); font-size: .86rem; margin: 2px 0; }
.invoice-lines { margin: 8px 0; padding-inline-start: 18px; font-size: .92rem; }
.invoice-totals { margin: 8px 0; } .invoice-totals div { display: flex; justify-content: space-between; padding: 2px 0; } .invoice-totals dt, .invoice-totals dd { margin: 0; }
.invoice-totals .grand { font-weight: 900; font-size: 1.08rem; border-top: 1.5px solid var(--ink); margin-top: 4px; padding-top: 6px; }
.invoice-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 10px; }
.pay-link { display: inline-block; padding: 9px 20px; background: linear-gradient(135deg, var(--gold), var(--gold-light)); color: var(--on-gold); }
.pay-link:hover { filter: brightness(1.05); background: linear-gradient(135deg, var(--gold), var(--gold-light)); }
.redirect-note { font-size: .86rem; color: var(--muted); margin: 6px 0 0; }

/* ---------- misc ---------- */
.app-notice { position: fixed; inset-inline: 0; bottom: 22px; margin: 0 auto; width: fit-content; max-width: min(92vw, 560px); background: var(--teal-deep); color: #fff; padding: 11px 20px; border-radius: 14px; box-shadow: var(--shadow); z-index: 60; font-size: .92rem; }
.health-panel { margin: 0 0 8px; padding: 10px 14px; border-radius: 14px; background: var(--warn-bg); color: var(--warn); font-size: .86rem; }
.health-panel.is-error { background: var(--bad-bg); color: var(--bad); }
.health-panel p { margin: 4px 0 0; } .health-meta { opacity: .85; }
body:not([data-tech="on"]) :is(.status-pill, .mode-badge, .guide-badge, .warning-list, .tech-only) { display: none !important; }


/* ---------- site-mode checkout: no address form (shipping and payment are chosen on the store site) ---------- */
.checkout-dialog.site-mode .field-grid, .checkout-dialog.site-mode .confirm-line { display: none; }

/* ---------- responsive: desktop >=1024 (sidebar) | tablet 641-1023 (drawer) | mobile <=640 ---------- */
@media (max-width: 1023px) {
  .menu-only { display: inline-flex; }
  .history { position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 60; width: min(86vw, 330px); background: var(--surface); box-shadow: var(--shadow); transform: translateX(105%); visibility: hidden; transition: transform .25s ease, visibility .25s; padding-top: max(14px, env(safe-area-inset-top)); }
  .history.open { transform: translateX(0); visibility: visible; }
  .chat { padding-inline: clamp(12px, 3vw, 26px); }
  .product-card { flex-basis: 208px; }
}
@media (max-width: 640px) {
  :root { --top: 58px; }
  .brand-name { font-size: .98rem; }
  .brand-mark { height: 32px; }
  .icon-button.with-label .label { display: none; }
  .icon-button.with-label { padding: 0 10px; }
  .auth-button { padding: 0 12px; font-size: .84rem; gap: 6px; }
  .auth-button svg { display: none; }
  .user-menu summary .user-name { display: none; }
  .user-menu summary { padding: 0 6px; }
  .welcome-logo { width: min(190px, 52%); }
  .chips { grid-template-columns: 1fr; gap: 8px; }
  .chip { padding: 10px 14px; }
  .chat.has-messages .assistant-title { margin: 2px 0; }
  .composer-foot span:first-child { display: none; }
  .composer-foot { justify-content: flex-end; }
  .message.user .message-bubble { max-width: 92%; }
  .message.assistant { grid-template-columns: 30px minmax(0, 1fr); column-gap: 8px; }
  .message-avatar { width: 30px; height: 30px; }
  .product-card { flex-basis: 178px; }
  .product-visual { height: 112px; }
  .field-grid { grid-template-columns: 1fr; }
}
@media (max-width: 380px) { .brand-name { display: none; } .auth-button { padding: 0 10px; } }
@media (min-width: 1024px) and (max-width: 1279px) { :root { --side: 260px; } }
@media (min-width: 1500px) { :root { --col: 980px; } .product-card { flex-basis: 214px; } }
@media (max-height: 560px) and (orientation: landscape) { .welcome-logo { display: none; } .assistant-title .t2 { font-size: 1.4rem; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
