/* TapReview v2 — shared styles (RTL, Hebrew).
   One motif drives every motion on the site: the tap. NFC rings, stars that
   light up, a review that pops in. Palette: off-white + ink + one ultramarine.
   Radius rule: interactive = pill · containers = 22px · inputs = 14px. */
:root {
  --bg:      oklch(98.6% 0.003 250);
  --surface: oklch(100% 0 0);
  --fg:      oklch(17% 0.012 255);
  --muted:   oklch(50% 0.013 255);
  --border:  oklch(91% 0.006 255);
  --accent:  oklch(53% 0.2 258);

  --accent-hover: oklch(45% 0.2 258);
  --accent-soft:  color-mix(in oklch, var(--accent) 13%, transparent);
  --fg-soft:      color-mix(in oklch, var(--fg) 5%, transparent);
  --panel:        oklch(96.8% 0.004 255);
  --line-strong:  oklch(84% 0.007 255);

  /* the one dark block (story) */
  --ink:          oklch(15.5% 0.014 258);
  --ink-2:        oklch(21% 0.016 258);
  --on-ink:       oklch(97% 0.004 255);
  --on-ink-muted: oklch(74% 0.012 255);

  /* domain signals, not accents */
  --ok:     oklch(50% 0.13 150);
  --danger: oklch(53% 0.19 25);
  --star:   oklch(81% 0.16 84);
  --wa:     oklch(55% 0.15 150);

  --font-display: 'IBM Plex Sans Hebrew', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-body:    -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', 'Arial Hebrew', system-ui, sans-serif;
  --font-mono:    ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --fs-h1: clamp(34px, 4.7vw, 60px);
  --fs-h2: clamp(30px, 4vw, 50px);
  --fs-h3: 20px;
  --fs-lead: clamp(17px, 1.45vw, 19px);

  --container: 1180px;
  --gutter: clamp(18px, 4vw, 36px);
  --r-box: 22px;
  --r-field: 14px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-spring: var(--ease-out);
  interpolate-size: allow-keywords;
}
@supports (transition-timing-function: linear(0, 1)) {
  :root { --ease-spring: linear(0, 0.06 3%, 0.24 7%, 0.52 12%, 0.8 18%, 0.98 25%, 1.05 31%, 1.06 35%, 1.04 42%, 1.01 52%, 0.995 63%, 1); }
}

/* ─── base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; color: inherit; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; }
::selection { background: var(--accent); color: var(--surface); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.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; }
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; background: var(--fg); color: var(--surface); padding: 10px 16px; border-radius: 999px; }
.skip-link:focus { top: 12px; }
.ic { width: 1.2em; height: 1.2em; flex: none; }

/* ─── page transitions (cross-document View Transitions) ─── */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out 200ms var(--ease-out) both; }
::view-transition-new(root) { animation: vt-in 380ms var(--ease-out) both; }
::view-transition-group(*) { animation-duration: 460ms; animation-timing-function: var(--ease-out); }
@keyframes vt-out { to { opacity: 0; transform: translateY(-10px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px); } }
.topnav { view-transition-name: site-header; }
.fab-wa { view-transition-name: fab-wa; }
.fab-ai { view-transition-name: fab-ai; }

/* ─── layout ───────────────────────────────────────────── */
.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(64px, 9vw, 120px); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 1.6fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
@media (max-width: 920px) { .grid-2, .grid-1-2 { grid-template-columns: 1fr; } }

/* ─── type ─────────────────────────────────────────────── */
h1, .h1 { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-h1); line-height: 1.08; letter-spacing: -0.022em; margin: 0; }
h2, .h2 { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-h2); line-height: 1.1; letter-spacing: -0.02em; margin: 0; }
h3, .h3 { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-h3); line-height: 1.35; margin: 0; }
.lead { font-size: var(--fs-lead); line-height: 1.7; color: var(--muted); max-width: 56ch; margin: 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--fg); margin: 0 0 22px; padding: 6px 14px 6px 6px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.eyebrow .ping { position: relative; width: 22px; height: 22px; border-radius: 50%; background: var(--fg); color: var(--surface); display: grid; place-items: center; }
.eyebrow .ping svg { width: 13px; height: 13px; }
.eyebrow .ping::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid var(--fg); animation: ping 2.4s var(--ease-out) infinite; }
@keyframes ping { 0% { transform: scale(1); opacity: .6; } 70%, 100% { transform: scale(2.1); opacity: 0; } }
.meta { font-size: 13px; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* split headings: each word rises out of its own mask */
.w { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .14em; margin-bottom: -.14em; }
.wi { display: inline-block; transform: translateY(108%); transition: transform 900ms var(--ease-out); transition-delay: calc(var(--wi, 0) * 45ms); }
.is-in .wi, .wi.is-in { transform: none; }

/* ─── chrome ───────────────────────────────────────────── */
.topnav { position: sticky; top: 0; z-index: 30; background: color-mix(in oklch, var(--bg) 82%, transparent); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); border-bottom: 1px solid transparent; transition: border-color .3s ease, background .3s ease; }
.topnav.scrolled { border-bottom-color: var(--border); background: color-mix(in oklch, var(--bg) 92%, transparent); }
.topnav-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 66px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: -0.02em; direction: ltr; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--fg); color: var(--surface); display: grid; place-items: center; transition: transform .5s var(--ease-spring); }
.logo:hover .logo-mark { transform: rotate(-8deg) scale(1.06); }
.logo-mark svg { width: 17px; height: 17px; }
.topnav nav { display: flex; gap: 6px; }
.topnav nav a { font-size: 15px; font-weight: 500; color: var(--muted); padding: 8px 14px; border-radius: 999px; transition: color .2s ease, background .2s ease; }
.topnav nav a:hover { color: var(--fg); background: var(--fg-soft); }
.cart-btn { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 8px 6px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 15px; font-weight: 600; transition: border-color .2s ease, transform 160ms var(--ease-out); }
.cart-btn:hover { border-color: var(--fg); }
.cart-btn:active { transform: scale(.97); }
.cart-btn .ic { width: 20px; height: 20px; }
.cart-count { min-width: 24px; height: 24px; padding-inline: 7px; border-radius: 999px; background: var(--fg); color: var(--surface); font-size: 12.5px; font-weight: 700; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.cart-count[data-empty="true"] { background: var(--panel); color: var(--muted); }
@media (max-width: 760px) { .topnav nav { display: none; } .cart-btn .cart-label { display: none; } .cart-btn { padding-inline: 10px 6px; } }

.pagefoot { padding-block: 72px 36px; color: var(--muted); font-size: 14px; background: var(--panel); border-top: 1px solid var(--border); }
.foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 36px; }
.foot-grid h4 { font-family: var(--font-display); color: var(--fg); font-size: 15px; margin: 0 0 14px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.foot-grid a { color: var(--muted); background-image: linear-gradient(currentColor, currentColor); background-size: 0 1px; background-position: 100% 100%; background-repeat: no-repeat; transition: background-size .35s var(--ease-out), color .2s ease; padding-bottom: 2px; }
.foot-grid a:hover { color: var(--fg); background-size: 100% 1px; }
.foot-legal { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--border); font-size: 13px; line-height: 1.75; max-width: 90ch; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr; } }

/* ─── buttons (pill) ───────────────────────────────────── */
.btn { position: relative; overflow: hidden; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 13px 26px; border-radius: 999px; border: 1px solid transparent; font-size: 16px; font-weight: 600; letter-spacing: -0.005em; white-space: nowrap; transition: transform 160ms var(--ease-out), background-color .2s ease, border-color .2s ease, color .2s ease; }
.btn:active { transform: scale(.97); }
.btn .ic { width: 19px; height: 19px; }
.btn-primary { background: var(--accent); color: var(--surface); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ink { background: var(--fg); color: var(--surface); border-color: var(--fg); }
.btn-ink:hover { background: oklch(29% 0.014 255); border-color: oklch(29% 0.014 255); }
.btn-secondary { background: var(--surface); color: var(--fg); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--fg); }
.btn-ghost { background: transparent; color: var(--fg); padding-inline: 14px; }
.btn-ghost:hover { background: var(--fg-soft); }
.btn-arrow .arrow { transition: transform .35s var(--ease-spring); }
.btn-arrow:hover .arrow { transform: translateX(-4px); }
.btn-block { width: 100%; }
.btn[aria-busy="true"] { pointer-events: none; }
.ripple { position: absolute; z-index: -1; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; border: 2px solid currentColor; opacity: .55; pointer-events: none; animation: ripple-out 700ms var(--ease-out) forwards; }
@keyframes ripple-out { from { transform: scale(.4); opacity: .55; } to { transform: scale(14); opacity: 0; } }

/* ─── tags / chips ─────────────────────────────────────── */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; font-size: 13px; background: var(--surface); }
.tag .ic { width: 15px; height: 15px; }

/* ─── forms ────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label, .field-label { font-size: 15px; font-weight: 600; color: var(--fg); }
.field .req { color: var(--danger); margin-inline-start: 3px; }
.field .hint { font-size: 13.5px; color: var(--muted); margin: 0; }
.opt-tag { font-weight: 500; color: var(--muted); font-size: 14px; }
.input, .textarea { width: 100%; min-height: 50px; padding: 12px 16px; border: 1px solid var(--line-strong); border-radius: var(--r-field); background: var(--surface); color: var(--fg); font: inherit; font-size: 16px; transition: border-color .2s ease, box-shadow .25s var(--ease-out); }
.input::placeholder { color: oklch(60% 0.01 255); }
.input:hover { border-color: oklch(70% 0.01 255); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input[dir="ltr"] { text-align: right; }
.input-affix { display: flex; align-items: stretch; border: 1px solid var(--line-strong); border-radius: var(--r-field); background: var(--surface); overflow: hidden; transition: border-color .2s ease, box-shadow .25s var(--ease-out); }
.input-affix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input-affix .affix { display: grid; place-items: center; padding-inline: 14px; color: var(--muted); background: var(--panel); border-inline-start: 1px solid var(--border); font-family: var(--font-mono); direction: ltr; }
.input-affix .input { border: 0; box-shadow: none !important; }
.field.has-error .input, .field.has-error .input-affix, .field.has-error .upload { border-color: var(--danger); }
.field-error { display: none; align-items: center; gap: 6px; font-size: 14px; color: var(--danger); font-weight: 500; margin: 0; }
.field-error .ic { width: 17px; height: 17px; }
.field.has-error .field-error { display: flex; animation: err-in 260ms var(--ease-out); }
@keyframes err-in { from { opacity: 0; transform: translateY(-4px); } }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.6; cursor: pointer; }
.check input { width: 21px; height: 21px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }

.choice-row { display: flex; flex-wrap: wrap; gap: 10px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; }
.choice span { display: inline-flex; align-items: center; gap: 9px; min-height: 46px; padding: 9px 18px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font-weight: 600; transition: border-color .2s ease, background-color .25s ease, color .25s ease, transform 160ms var(--ease-out); cursor: pointer; }
.choice span:hover { border-color: var(--fg); }
.choice span:active { transform: scale(.97); }
.choice input:checked + span { border-color: var(--fg); background: var(--fg); color: var(--surface); }
.choice input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 3px; }
.swatch { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line-strong); }
.swatch.black { background: var(--ink); } .swatch.white { background: var(--surface); }
.choice input:checked + span .swatch { border-color: var(--on-ink-muted); }

.upload { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px; border: 1.5px dashed var(--line-strong); border-radius: var(--r-box); background: var(--panel); transition: border-color .2s ease, background-color .2s ease, transform .3s var(--ease-spring); }
.upload:hover, .upload.is-drag { border-color: var(--accent); background: var(--accent-soft); }
.upload.is-drag { transform: scale(1.015); }
.upload input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 1; }
.upload input[type="file"]:focus-visible ~ .upload-icon { outline: 3px solid var(--accent); outline-offset: 3px; }
.upload-icon { width: 52px; height: 52px; flex: none; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; color: var(--fg); overflow: hidden; }
.upload-icon .ic { width: 22px; height: 22px; transition: transform .4s var(--ease-spring); }
.upload:hover .upload-icon .ic { transform: translateY(-3px); }
.upload-icon img { width: 100%; height: 100%; object-fit: cover; animation: pop-in 420ms var(--ease-spring); }
@keyframes pop-in { from { transform: scale(.82); opacity: 0; } }
.upload-text { display: grid; gap: 2px; min-width: 0; }
.upload-text strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-text span { font-size: 13px; color: var(--muted); }
.upload.has-file { border-style: solid; border-color: var(--ok); background: color-mix(in oklch, var(--ok) 6%, var(--surface)); }
.upload-remove { position: relative; z-index: 2; margin-inline-start: auto; min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 14px; }
.upload-remove:hover { border-color: var(--fg); }

.how-to { border: 1px solid var(--border); border-radius: var(--r-field); background: var(--surface); }
.how-to summary { cursor: pointer; padding: 12px 14px; font-size: 14px; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; min-height: 46px; }
.how-to summary::-webkit-details-marker { display: none; }
.how-to summary .ic { width: 16px; height: 16px; margin-inline-start: auto; transition: transform .3s var(--ease-out); }
.how-to[open] summary .ic { transform: rotate(180deg); }
.how-to ol { margin: 0; padding: 0 34px 14px 14px; font-size: 14px; color: var(--muted); display: grid; gap: 6px; }
details::details-content { block-size: 0; overflow: clip; transition: block-size 380ms var(--ease-out), content-visibility 380ms allow-discrete; }
details[open]::details-content { block-size: auto; }

/* ─── reveal on scroll ─────────────────────────────────── */
/* animations (not transitions) so hover transitions on the same element stay instant */
[data-reveal]:not(.is-in) { opacity: 0; }
[data-reveal].is-in { animation: reveal-up 900ms var(--ease-out) backwards; animation-delay: calc(var(--d, 0) * 1ms); }
@keyframes reveal-up { from { opacity: 0; transform: translateY(20px); } }

/* ─── drawer / overlay / toast ─────────────────────────── */
.overlay { position: fixed; inset: 0; z-index: 60; background: color-mix(in oklch, var(--ink) 45%, transparent); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .35s ease; }
.overlay.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; z-index: 61; top: 10px; bottom: 10px; left: 10px; width: min(430px, calc(100vw - 20px)); background: var(--surface); border-radius: 26px; display: flex; flex-direction: column; overflow: hidden; transform: translateX(calc(-100% - 24px)); transition: transform 460ms var(--ease-drawer); box-shadow: 0 30px 80px -20px color-mix(in oklch, var(--ink) 40%, transparent); }
.drawer.open { transform: none; }
@media (max-width: 560px) { .drawer { top: 0; bottom: 0; left: 0; width: 100vw; border-radius: 0; } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { font-size: 24px; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 1px solid transparent; background: transparent; transition: background-color .2s ease, transform 160ms var(--ease-out); }
.icon-btn:hover { background: var(--fg-soft); }
.icon-btn:active { transform: scale(.94); }
.icon-btn .ic { width: 20px; height: 20px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 6px 22px; overscroll-behavior: contain; }
.drawer-foot { padding: 16px 22px 22px; border-top: 1px solid var(--border); display: grid; gap: 10px; }
.line-item { display: grid; grid-template-columns: 76px 1fr; gap: 14px; padding-block: 16px; border-bottom: 1px solid var(--border); }
.line-item:last-child { border-bottom: 0; }
.drawer.open .line-item, .co-summary .line-item { animation: item-in 520ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 60ms + 140ms); }
@keyframes item-in { from { opacity: 0; transform: translateX(-18px); } }
.line-thumb { width: 76px; height: 76px; border-radius: 14px; border: 1px solid var(--border); object-fit: contain; background: var(--surface); }
.line-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.line-name { font-weight: 600; font-size: 15px; }
.line-spec { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13px; color: var(--muted); display: grid; gap: 2px; }
.line-spec li { overflow-wrap: anywhere; }
.line-spec b { color: var(--fg); font-weight: 500; }
.line-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; }
.qty button { width: 40px; height: 40px; border: 0; background: transparent; font-size: 18px; border-radius: 50%; transition: background-color .2s ease; }
.qty button:hover { background: var(--fg-soft); }
.qty output { min-width: 28px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.link-btn { border: 0; background: none; padding: 8px 4px; font-size: 14px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; min-height: 40px; }
.link-btn:hover { color: var(--danger); }
.sum-row { display: flex; justify-content: space-between; font-size: 15px; }
.sum-row.total { font-family: var(--font-display); font-size: 21px; font-weight: 700; }
.free { color: var(--ok); font-weight: 600; }
.empty-state { text-align: center; padding: 56px 12px; color: var(--muted); display: grid; gap: 14px; justify-items: center; }
.empty-state .ic { width: 44px; height: 44px; color: var(--line-strong); }

.toast { position: fixed; z-index: 80; left: 50%; top: 78px; display: inline-flex; align-items: center; gap: 10px; background: var(--fg); color: var(--surface); padding: 12px 18px; border-radius: 999px; font-size: 15px; font-weight: 500; opacity: 0; pointer-events: none; transform: translate(-50%, -14px) scale(.96); transition: opacity 180ms ease, transform 180ms var(--ease-out); max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); transition: opacity 260ms ease, transform 420ms var(--ease-spring); }

/* fly-to-cart clone */
.fly { position: fixed; z-index: 90; pointer-events: none; border-radius: 18px; object-fit: contain; background: var(--surface); box-shadow: 0 20px 40px -12px color-mix(in oklch, var(--ink) 40%, transparent); }

/* ─── floating: WhatsApp + assistant ───────────────────── */
.fab-wa { position: fixed; z-index: 40; left: 18px; bottom: calc(18px + var(--fab-lift, 0px)); width: 58px; height: 58px; border-radius: 50%; background: var(--wa); color: var(--surface); display: grid; place-items: center; box-shadow: 0 12px 28px -10px color-mix(in oklch, var(--ink) 50%, transparent); transition: transform .4s var(--ease-spring), background-color .2s ease; }
.fab-wa:hover { transform: translateY(-3px) rotate(-6deg); background: oklch(47% 0.14 150); }
.fab-wa:active { transform: scale(.94); }
.fab-wa .ic { width: 30px; height: 30px; }
.fab-ai { position: fixed; z-index: 40; right: 18px; bottom: calc(18px + var(--fab-lift, 0px)); min-height: 54px; display: inline-flex; align-items: center; gap: 10px; padding: 8px 18px 8px 9px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-weight: 600; font-size: 15px; box-shadow: 0 12px 30px -12px color-mix(in oklch, var(--ink) 35%, transparent); transition: transform .4s var(--ease-spring), border-color .2s ease; }
.fab-ai:hover { transform: translateY(-3px); border-color: var(--fg); }
.fab-ai:active { transform: scale(.96); }
.fab-ai .dot { width: 36px; height: 36px; border-radius: 50%; background: var(--fg); color: var(--surface); display: grid; place-items: center; }
.fab-ai .dot .ic { width: 18px; height: 18px; }
.fab-ai:hover .dot .ic { animation: twinkle .9s var(--ease-out); }
@keyframes twinkle { 40% { transform: rotate(18deg) scale(1.15); } }
@media (max-width: 560px) { .fab-ai .fab-label { display: none; } .fab-ai { padding: 8px; } }

.chat { position: fixed; z-index: 70; right: 18px; bottom: 18px; width: min(390px, calc(100vw - 24px)); height: min(620px, calc(100dvh - 36px)); background: var(--surface); border: 1px solid var(--border); border-radius: 26px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 30px 80px -20px color-mix(in oklch, var(--ink) 40%, transparent); transform-origin: bottom right; transform: scale(.94) translateY(10px); opacity: 0; pointer-events: none; transition: transform 200ms var(--ease-out), opacity 160ms ease; }
.chat.open { transform: none; opacity: 1; pointer-events: auto; transition: transform 420ms var(--ease-spring), opacity 220ms ease; }
@media (max-width: 560px) { .chat { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; } }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 8px; border-bottom: 1px solid var(--border); }
.chat-head .dot { width: 40px; height: 40px; border-radius: 50%; background: var(--fg); color: var(--surface); display: grid; place-items: center; flex: none; }
.chat-head .dot .ic { width: 20px; height: 20px; }
.chat-head strong { display: block; font-size: 15px; }
.chat-head span { font-size: 13px; color: var(--muted); }
.chat-head .icon-btn { margin-inline-start: auto; }
.chat-log { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 10px; background: var(--panel); overscroll-behavior: contain; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 18px; font-size: 15px; line-height: 1.55; white-space: pre-line; animation: msg-in 380ms var(--ease-spring) both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px) scale(.97); } }
.msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-start-start-radius: 6px; transform-origin: top right; }
.msg.me { align-self: flex-end; background: var(--fg); color: var(--surface); border-start-end-radius: 6px; transform-origin: bottom left; }
.msg a { text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.quick { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 14px 0; background: var(--surface); }
.quick button { min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; transition: border-color .2s ease, transform 160ms var(--ease-out); }
.quick button:hover { border-color: var(--fg); }
.quick button:active { transform: scale(.96); }
.chat-form { display: flex; gap: 8px; padding: 10px 14px 14px; background: var(--surface); }
.chat-form .input { min-height: 46px; border-radius: 999px; }
.chat-form .btn { min-height: 46px; padding-inline: 18px; }
.chat-note { font-size: 12px; color: var(--muted); padding: 0 14px 10px; background: var(--surface); margin: 0; }

/* ─── reduced motion: keep fades, drop movement ────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; transition-delay: 0ms !important; }
  [data-reveal], .wi { opacity: 1 !important; transform: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
