/* Aimer AI web (aimer.ma/ai). Values come from the design file Aimer-AI-Web.html (desktop 1440, mobile 390).
   Layout: ≥1100px sidebar + main (+ the box panel beside the chat); <1100px the mobile website (header, drawer,
   bottom composer, sheets). RTL through logical properties. */

/* ------------------------------------------------------------------ tokens + base */
:root {
  --ink: #1C1B18; --t2: #5F5D56; --t3: #8A887F; --b1: #ECEAE6; --b2: #F5F4F1; --b3: #EFEEEA; --side: #FAFAF8;
  --pink: #E4127A; --pink-soft: #FDEAF3; --pink-line: #F2B8D3; --green: #2E7D5B; --green-soft: #E9F3EE; --red: #D93A3A; --red-soft: #FBE7E7;
  --violet: #7C3AED; --slate: #50657A; --amber: #E8A33D;
  --f: 'Bricolage Grotesque', system-ui, -apple-system, 'Segoe UI', sans-serif; --mono: 'Space Mono', ui-monospace, monospace;
  --ease: cubic-bezier(.2,.8,.2,1);
  --side-w: 268px; --panel-w: 440px;
}
*, *::before, *::after { box-sizing: border-box; -webkit-font-smoothing: antialiased; }
html, body { margin: 0; height: 100%; }
body { background: #fff; color: var(--ink); font-family: var(--f); font-size: 15px; line-height: 1.5; }
body.ai-locked { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: default; }
input, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
mark { color: inherit; background: var(--pink-soft); border-radius: 3px; padding: 0 2px; }
.ic { flex: 0 0 auto; stroke-width: 1.75; display: inline-block; }
.spark { flex: 0 0 auto; display: block; }
.orb { flex: 0 0 auto; display: block; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ai-skip { position: absolute; inset-inline-start: 8px; top: -60px; z-index: 300; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; }
.ai-skip:focus { top: 8px; }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
.mono { font-family: var(--mono); }
[hidden] { display: none !important; }

/* motion (design helmet; all inside no-preference) */
.shimmer { background: linear-gradient(90deg,#8A887F 0%,#8A887F 35%,#1C1B18 50%,#8A887F 65%,#8A887F 100%); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; }
.skel { background: linear-gradient(90deg,#F3F2EF 0%,#F3F2EF 30%,#E9E7E2 50%,#F3F2EF 70%,#F3F2EF 100%); background-size: 250% 100%; }
.caret { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--ink); margin-inline-start: 4px; vertical-align: 1px; opacity: .5; }
@media (prefers-reduced-motion: no-preference) {
  @keyframes shim { 0% { background-position: 100% 0; } 100% { background-position: -150% 0; } }
  .shimmer, .skel { animation: shim 1.6s linear infinite; animation-delay: var(--d, 0s); }
  @keyframes caret { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .25; transform: scale(.7); } }
  .caret { animation: caret 1s ease-in-out infinite; }
  @keyframes tok { from { opacity: 0; filter: blur(3px); } to { opacity: 1; filter: none; } }
  .tok { animation: tok .26s var(--ease); }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  .rise { animation: rise .24s var(--ease) both; }
  @keyframes srcin { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
  .srcin { animation: srcin .3s var(--ease) both; animation-delay: var(--d, 0s); }
  @keyframes pop { 0% { opacity: 0; transform: scale(.96); } 100% { opacity: 1; transform: none; } }
  .pop { animation: pop .2s var(--ease) both; }
  @keyframes sheet { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
  .sheet { animation: sheet .38s cubic-bezier(.2,.9,.25,1.05) both; }
  @keyframes drawer { from { transform: translateX(-40px); opacity: .4; } to { transform: none; opacity: 1; } }
  @keyframes drawer-rtl { from { transform: translateX(40px); opacity: .4; } to { transform: none; opacity: 1; } }
  @keyframes side { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
  .side-in { animation: side .36s var(--ease) both; }
  @keyframes flash { 0% { background: #DDF0E5; } 100% { background: rgba(233,243,238,0); } }
  .flashnew { animation: flash 1.6s ease-out .4s both; }
  @keyframes drop { 0% { transform: scale(1.08); opacity: 0; } 60% { transform: scale(.98); opacity: 1; } 100% { transform: none; } }
  .drop { animation: drop .42s var(--ease) both; }
  @keyframes stepin { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
  .stepin { animation: stepin .26s var(--ease) both; }
  [dir=rtl] .stepin { animation-name: stepin-rtl; }
  @keyframes stepin-rtl { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
  @keyframes trail { from { opacity: 0; transform: translateY(6px) scale(.9); } to { opacity: 1; transform: none; } }
  .trail { animation: trail .3s var(--ease) both; }
  @keyframes slot { 0%,100% { border-color: #DAD7D0; } 50% { border-color: #EDEBE6; } }
  .slot { animation: slot 3s ease-in-out infinite; }
  @keyframes live { 0%,100% { box-shadow: 0 0 0 0 rgba(228,18,122,.45); } 70% { box-shadow: 0 0 0 8px rgba(228,18,122,0); } }
  .livedot { animation: live 1.6s ease-out infinite; }
  .lift { transition: transform .22s var(--ease), box-shadow .22s var(--ease); }
  .lift:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -16px rgba(28,27,24,.3); }
  .press { transition: transform .12s ease, filter .2s ease; } .press:active { transform: scale(.97); } .press:hover { filter: brightness(1.12); }
  .tile { transition: transform .14s ease, border-color .2s ease, box-shadow .2s ease; }
  .tile:hover { border-color: var(--pink-line); box-shadow: 0 8px 18px -12px rgba(228,18,122,.5); } .tile:active { transform: scale(.96); }
  .grow { transform-origin: left; transition: transform .6s var(--ease) .15s; }
  [dir=rtl] .grow { transform-origin: right; }
}

/* ------------------------------------------------------------------ buttons + chips */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 14px; font-size: 15px; font-weight: 600; white-space: nowrap; }
.btn--ink { background: var(--ink); color: #fff; }
.btn--pink { background: var(--pink); color: #fff; box-shadow: 0 14px 30px -14px rgba(228,18,122,.7); }
.btn--line { border: 1px solid var(--b1); background: #fff; color: var(--ink); }
.btn--sm { height: 36px; padding: 0 14px; border-radius: 11px; font-size: 13.5px; }
.btn[disabled] { opacity: .5; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 17px; border: 1px solid var(--b1); font-size: 13px; font-weight: 600; color: var(--ink); background: #fff; white-space: nowrap; }
.pill[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: #fff; }
.iconbtn { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; color: var(--ink); }
.iconbtn:hover { background: var(--b2); }
.iconbtn--round { border-radius: 50%; border: 1px solid var(--b1); background: #fff; }
.seg { display: flex; background: var(--b2); border-radius: 13px; padding: 3px; gap: 2px; }
.seg button { flex: 1; height: 34px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--t3); }
.seg button[aria-pressed=true], .seg button[aria-selected=true] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(28,27,24,.12); }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; background: var(--b2); font-size: 11.5px; font-weight: 600; color: var(--t2); }
.tag--new { background: var(--green-soft); color: var(--green); font-size: 10.5px; letter-spacing: .04em; }
.cite { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin: 0 2px; border-radius: 9px; background: var(--b2); font-size: 10.5px; font-weight: 600; color: var(--t2); vertical-align: 2px; line-height: 1; }
button.cite:hover { background: var(--pink-soft); color: var(--pink); }

/* ------------------------------------------------------------------ layout */
.ai-app { display: flex; min-height: 100vh; min-height: 100dvh; }
.ai-mainwrap { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100vh; height: 100dvh; position: relative; }
.ai-main { flex: 1; min-height: 0; display: flex; flex-direction: column; outline: none; }
.ai-view { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }

/* sidebar (desktop) */
.ai-side { flex: 0 0 var(--side-w); width: var(--side-w); display: flex; flex-direction: column; background: var(--side); border-inline-end: 1px solid var(--b1); padding: 14px 10px; height: 100vh; height: 100dvh; position: sticky; top: 0; }
.ai-side__head { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 14px; }
.logo { display: flex; align-items: baseline; gap: 3px; flex: 0 0 auto; }
.logo b { font-weight: 800; font-size: 22px; color: var(--pink); letter-spacing: -.04em; }
.logo i { width: 5px; height: 5px; border-radius: 50%; background: #b08a4a; margin-bottom: 4px; }
.ai-side__collapse { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; color: var(--t2); }
.ai-side__collapse:hover { background: var(--b3); }
.nav-a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--ink); width: 100%; text-align: start; }
.nav-a > span:first-child { width: 20px; display: flex; justify-content: center; }
.nav-a:hover { background: var(--b3); }
.nav-a--new { background: #fff; border: 1px solid var(--b1); box-shadow: 0 1px 2px rgba(28,27,24,.04); margin-bottom: 2px; }
.nav-a[aria-current=page] { background: var(--b3); }
.ai-side__list { flex: 1; overflow: auto; margin-top: 6px; scrollbar-width: thin; }
.grp { font-size: 12px; font-weight: 600; color: var(--t3); padding: 16px 12px 6px; }
.conv { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; }
.conv:hover { background: var(--b3); }
.conv[aria-current=page] { background: var(--b3); }
.conv span { flex: 1; font-size: 13.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv .ic { color: var(--t3); }
.ai-side__empty { padding: 14px 12px; font-size: 13px; color: var(--t3); line-height: 1.45; }
.ai-side__foot { border-top: 1px solid var(--b1); padding: 10px 8px 0; margin-top: 8px; display: flex; align-items: center; gap: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--b2) center/cover; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--t2); flex: 0 0 auto; }
.ai-side__name { flex: 1; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-side__signin { flex: 1; }
.ai-app.is-collapsed .ai-side { display: none; }

/* top bar (desktop) */
.ai-top { display: flex; align-items: center; gap: 8px; padding: 14px 24px 10px; min-height: 64px; flex: 0 0 auto; position: relative; z-index: 20; background: #fff; }
.ai-top__title { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; color: var(--ink); max-width: 46vw; padding: 6px 8px; margin-inline-start: -8px; border-radius: 10px; }
.ai-top__title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-top__title .ic { color: var(--t3); }
.ai-top__title:hover { background: var(--b2); }
.ai-top__sub { display: none; }
.ai-top__sp { flex: 1; }
.ai-top__bag { position: relative; }
.badge { position: absolute; top: 4px; inset-inline-end: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--pink); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.ai-top__share { height: 38px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--b1); display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; background: #fff; }
.ai-top__menu, .ai-top__new, .ai-top__close { display: none; }
.ai-top__open-side { display: none; }
.ai-app.is-collapsed .ai-top__open-side { display: inline-flex; }

/* scrim + drawer (mobile) */
.ai-scrim { position: fixed; inset: 0; background: rgba(28,27,24,.32); z-index: 90; }

/* ------------------------------------------------------------------ composer */
.composer { border: 1px solid var(--b1); border-radius: 28px; background: #fff; padding: 12px 12px 10px 16px; box-shadow: 0 10px 30px -14px rgba(28,27,24,.22); position: relative; }
[dir=rtl] .composer { padding: 12px 16px 10px 12px; }
.composer:focus-within { border-color: #F6C6DD; box-shadow: 0 0 0 3px rgba(228,18,122,.12), 0 10px 30px -14px rgba(28,27,24,.22); }
.composer textarea { display: block; width: 100%; border: 0; outline: none; resize: none; background: transparent; font-size: 16px; line-height: 1.45; min-height: 24px; max-height: 200px; padding: 0; color: var(--ink); }
.composer textarea::placeholder { color: var(--t3); opacity: 1; }
.composer__row { display: flex; align-items: center; gap: 6px; margin-top: 12px; }
.composer__plus { width: 34px; height: 34px; border-radius: 17px; border: 1px solid var(--b1); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.composer__chips { display: flex; gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.composer__chips::-webkit-scrollbar { display: none; }
.composer__chips .pill.is-on { border-color: var(--pink-line); background: var(--pink-soft); color: var(--pink); }
.composer__sp { flex: 1; }
.composer__mic { color: var(--t2); width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.composer__send { width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; margin-inline-start: 8px; }
.composer__send[disabled] { opacity: .35; }
.composer__thumbs { display: flex; gap: 8px; margin-bottom: 10px; }
.composer__thumb { position: relative; width: 56px; height: 56px; border-radius: 12px; background: var(--b2) center/cover; }
.composer__thumb button { position: absolute; top: -6px; inset-inline-end: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; }
.composer__ctx { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.composer__ctx .pill { height: 28px; font-size: 12.5px; background: var(--b2); border-color: var(--b2); }
.composer-foot { text-align: center; font-size: 12px; color: var(--t3); padding: 8px 0 14px; }
.menu { position: absolute; bottom: calc(100% + 8px); inset-inline-start: 8px; background: #fff; border: 1px solid var(--b1); border-radius: 16px; box-shadow: 0 20px 40px -18px rgba(28,27,24,.35); padding: 6px; min-width: 230px; z-index: 40; }
.menu button, .menu label { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 10px; font-size: 14px; text-align: start; cursor: pointer; }
.menu button:hover, .menu label:hover { background: var(--b2); }
.menu .sw { margin-inline-start: auto; width: 34px; height: 20px; border-radius: 10px; background: #DAD7D0; position: relative; flex: 0 0 auto; }
.menu .sw::after { content: ''; position: absolute; top: 2px; inset-inline-start: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: inset-inline-start .15s; }
.menu [aria-checked=true] .sw { background: var(--pink); }
.menu [aria-checked=true] .sw::after { inset-inline-start: 16px; }

/* ------------------------------------------------------------------ start (new chat) */
.start { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 80px 80px; }
.start__h { font-size: 40px; font-weight: 600; letter-spacing: -.04em; line-height: 1.12; color: var(--ink); margin: 22px 0 30px; text-align: center; }
.start__h span { color: var(--t3); }
.start__composer { width: 100%; max-width: 720px; }
.sugg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; width: 100%; max-width: 720px; margin-top: 18px; }
.sugg a, .sugg button { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--b1); border-radius: 18px; text-align: start; font-size: 14px; line-height: 1.4; color: var(--ink); background: #fff; }
.nudge { display: flex; align-items: center; gap: 12px; margin-top: 22px; padding: 10px 14px; border-radius: 14px; background: var(--b2); font-size: 13.5px; color: var(--ink); }
.nudge__img { width: 30px; height: 30px; border-radius: 9px; background: #E9E7E2 center/cover; display: flex; align-items: center; justify-content: center; color: var(--pink); flex: 0 0 auto; }
.nudge__t b { font-weight: 700; }
.nudge__s { display: none; }
.nudge .ic { color: var(--t2); }
[dir=rtl] .nudge .ic-dir, [dir=rtl] .ic-dir { transform: scaleX(-1); }
.start__chips { display: none; }

/* ------------------------------------------------------------------ states */
.ai-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; padding: 40px 24px; }
.ai-state__h { font-size: 26px; font-weight: 600; letter-spacing: -.03em; }
.ai-state__p { font-size: 15px; color: var(--t2); max-width: 420px; }
.ai-state .ic { color: var(--t3); }
.loading { flex: 1; display: flex; align-items: center; justify-content: center; padding: 60px; }

/* ------------------------------------------------------------------ modal + sheet + toast */
.ai-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; }
.ai-modal__scrim { position: absolute; inset: 0; background: rgba(250,250,248,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.ai-modal__box { position: relative; width: 100%; max-width: 820px; max-height: calc(100vh - 48px); overflow: auto; background: #fff; border-radius: 28px; box-shadow: 0 40px 90px -30px rgba(28,27,24,.45); padding: 26px 26px 26px; }
.ai-modal__x { position: absolute; top: 18px; inset-inline-end: 18px; }
.ai-modal__h { font-size: 24px; font-weight: 600; letter-spacing: -.03em; line-height: 1.2; padding-inline-end: 40px; }
.ai-modal__p { font-size: 14px; color: var(--t3); margin-top: 4px; }
.ai-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 400; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 14px; box-shadow: 0 18px 40px -16px rgba(28,27,24,.5); max-width: calc(100vw - 32px); }

/* ------------------------------------------------------------------ mobile website (<1100px) */
@media (max-width: 1099.98px) {
  .ai-side { position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 100; width: min(340px, 87vw); flex: none; transform: translateX(-105%); transition: transform .3s var(--ease); box-shadow: 0 30px 60px -20px rgba(28,27,24,.35); background: #fff; padding: 14px 12px; visibility: hidden; }
  [dir=rtl] .ai-side { transform: translateX(105%); }
  .ai-app.is-drawer .ai-side { transform: none; visibility: visible; }
  .ai-app.is-collapsed .ai-side { display: flex; }
  .ai-top { position: sticky; top: 0; background: rgba(255,255,255,.86); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); padding: 8px 10px; min-height: 56px; gap: 6px; }
  .ai-top__menu, .ai-top__new { display: inline-flex; }
  .ai-top__open-side, .ai-app.is-collapsed .ai-top__open-side { display: none; }
  .ai-top__share { display: none; }
  .ai-top__title { flex: 1; flex-direction: column; justify-content: center; gap: 0; max-width: none; margin: 0; padding: 2px 0; }
  .ai-top__title .row { display: inline-flex; align-items: center; gap: 6px; font-size: 15.5px; font-weight: 600; max-width: 100%; }
  .ai-top__sub { display: block; font-size: 11.5px; font-weight: 400; color: var(--t3); }
  .ai-top__sp { display: none; }
  .start { justify-content: flex-start; padding: 120px 24px 0; }
  .start__h { font-size: 30px; letter-spacing: -.035em; line-height: 1.15; margin-top: 22px; }
  .start__h span { display: block; }
  .start .sugg { display: none; }
  .start__dock { position: sticky; bottom: 0; margin-top: auto; width: 100%; padding: 0 0 12px; }
  .nudge { margin: 0 6px 12px; padding: 10px 12px; border-radius: 16px; text-align: start; }
  .nudge__img { width: 34px; height: 34px; border-radius: 10px; }
  .nudge__t { flex: 1; }
  .nudge__t b, .nudge__t strong { display: block; font-size: 13.5px; font-weight: 600; }
  .nudge__s { display: block; font-size: 12px; color: var(--t3); }
  .start__chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 6px 12px; scrollbar-width: none; }
  .start__chips::-webkit-scrollbar { display: none; }
  .start__chips button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 15px; border: 1px solid var(--b1); border-radius: 21px; font-size: 14px; background: #fff; }
  .composer { border-radius: 26px; padding: 14px 12px 12px 16px; }
  .composer__plus { width: 34px; height: 34px; }
  .ai-modal { align-items: flex-end; padding: 0; }
  .ai-modal__box { border-radius: 28px 28px 0 0; max-height: 92vh; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); }
  .ai-modal__box::before { content: ''; display: block; width: 40px; height: 5px; border-radius: 3px; background: #DAD7D0; margin: -8px auto 14px; }
  .ai-toast { bottom: 100px; }
}
@media (max-width: 1099.98px) and (min-width: 640px) {
  .start { padding-top: 160px; }
  .start__dock, .start__inner { max-width: 640px; margin-left: auto; margin-right: auto; }
}

/* ------------------------------------------------------------------ helpers by viewport */
.m-only { display: none !important; }
@media (max-width: 1099.98px) { .m-only { display: inline-flex !important; } .d-only { display: none !important; } }

/* ------------------------------------------------------------------ chat */
.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat__scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 48px 24px; scrollbar-width: thin; }
.chat__col { max-width: 760px; margin: 0 auto; width: 100%; }
.has-panel .chat__col { max-width: 640px; }
.chat__dock { flex: 0 0 auto; padding: 0 48px; background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 22px); }
.chat__dock .composer-foot { padding-bottom: 12px; }
.msg { margin: 0 0 22px; }
.msg--user { display: flex; justify-content: flex-end; }
.bubble { max-width: min(520px, 88%); background: var(--b2); border-radius: 22px; padding: 12px 16px; font-size: 15px; line-height: 1.55; color: var(--ink); overflow-wrap: anywhere; }
.bubble__img { width: 180px; max-width: 100%; border-radius: 14px; margin-bottom: 8px; }
.hello { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 18px; font-size: 15.5px; line-height: 1.7; color: var(--ink); }
.hello .orb { margin-top: 4px; }

.think { display: flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--t3); margin: 0 0 10px; }
.think__orb { display: inline-flex; }
details.think { display: block; }
details.think summary { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; color: var(--t3); font-size: 14.5px; padding: 2px 0; }
details.think summary::-webkit-details-marker { display: none; }
details.think[open] summary .ic { transform: rotate(180deg); }
.steps { list-style: none; margin: 6px 0 16px; padding: 0; position: relative; }
.steps__i { display: flex; gap: 12px; align-items: flex-start; padding: 6px 0 6px 8px; position: relative; }
[dir=rtl] .steps__i { padding: 6px 8px 6px 0; }
.steps__i:not(:last-child)::before { content: ''; position: absolute; inset-inline-start: 16px; top: 24px; bottom: -6px; width: 1px; background: var(--b1); }
.steps__ok { width: 17px; height: 17px; border-radius: 50%; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; margin-top: 2px; }
.steps__ok .ic { stroke-width: 3; }
.steps__now { width: 17px; height: 17px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; margin-top: 2px; }
.steps__wait { width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid var(--b1); flex: 0 0 auto; margin: 3px 1px 0; }
.steps__l { display: block; font-size: 13.5px; color: var(--ink); }
.steps__i--active .steps__l, .steps__i--wait .steps__l { color: var(--t3); }
.steps__d { display: block; font-size: 12px; color: var(--t3); margin-top: 1px; }
.steps--lg .steps__l { font-size: 13.5px; }
.skel-lines { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 16px; }
.skel-lines .skel { height: 12px; border-radius: 6px; width: 86%; display: block; }

.picks { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; margin: 4px 0 14px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.pick { flex: 0 0 147px; border: 1px solid var(--b1); border-radius: 14px; padding: 6px; background: #fff; position: relative; scroll-snap-align: start; }
.pick__img { display: block; height: 86px; border-radius: 10px; background: var(--b2) center/cover no-repeat; position: relative; }
.pick__n { position: absolute; top: 6px; inset-inline-start: 6px; width: 18px; height: 18px; border-radius: 50%; background: #fff; color: var(--ink); font-size: 10.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.pick__b { padding: 7px 3px 2px; display: flex; flex-direction: column; gap: 1px; }
.pick__name { font-size: 12.5px; font-weight: 600; line-height: 1.3; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pick__meta { font-size: 11.5px; color: var(--t3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick__why { font-size: 11.5px; color: var(--t2); line-height: 1.35; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pick__add { position: absolute; top: 10px; inset-inline-end: 10px; width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,.94); border: 1px solid var(--b1); display: flex; align-items: center; justify-content: center; }
.pick__add[aria-pressed=true] { background: var(--ink); color: #fff; border-color: var(--ink); }

.prose { font-size: 15.5px; line-height: 1.7; color: var(--ink); overflow-wrap: anywhere; }
.prose p { margin: 0 0 10px; }
.prose p:last-child { margin-bottom: 0; }
.prose b { font-weight: 700; }
.prose__a { color: var(--pink); text-decoration: underline; }
.msg__err { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--t2); background: var(--b2); border-radius: 12px; padding: 10px 12px; margin-top: 8px; }

.boxcard { display: flex; align-items: center; gap: 14px; border: 1px solid var(--b1); border-radius: 18px; padding: 12px 12px 12px 14px; margin: 16px 0 6px; }
.boxcard__ic { width: 44px; height: 44px; border-radius: 12px; background: var(--b2); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.boxcard__t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.boxcard__t b { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.boxcard__t span { font-size: 12.5px; color: var(--t3); }
.boxcard__th { display: flex; }
.boxcard__th span { width: 26px; height: 26px; border-radius: 7px; background: var(--b2) center/cover; border: 1.5px solid #fff; margin-inline-start: -6px; }
.tools { display: flex; align-items: center; gap: 4px; margin: 14px 0 4px; }
.tool { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: var(--t2); }
.tool:hover { background: var(--b2); color: var(--ink); }
.tool[aria-pressed=true] { color: var(--pink); }
.tools__sp { flex: 1; }
.tools__note { font-size: 12px; color: var(--t3); }
.replies { margin-top: 10px; border-top: 1px solid var(--b1); }
.reply { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 2px; border-bottom: 1px solid var(--b1); text-align: start; font-size: 15px; color: var(--ink); }
.reply > span { flex: 1; }
.reply .ic { color: var(--t3); }
.reply:hover { background: var(--side); }

/* checkout cards */
.ccard { border: 1px solid var(--b1); border-radius: 18px; padding: 14px; margin: 12px 0; display: flex; flex-direction: column; gap: 8px; }
.ccard__h { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.ccard__p { font-size: 13px; color: var(--t3); }
.ccard__err { font-size: 13px; color: var(--red); }
.ccard--row { flex-direction: row; align-items: center; }
.ccard--row > span { flex: 1; font-size: 14px; }
.ccard--ok { flex-direction: row; align-items: center; gap: 12px; background: var(--green-soft); border-color: transparent; }
.ccard--ok > div { flex: 1; display: flex; flex-direction: column; }
.ccard--ok span { font-size: 13px; color: var(--t2); }
.ccard__okic { width: 44px; height: 44px; border-radius: 50%; background: #fff; color: var(--green); display: flex; align-items: center; justify-content: center; }
.ccard__new summary { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; font-weight: 600; padding: 8px 2px; list-style: none; }
.ccard__new summary::-webkit-details-marker { display: none; }
.opt { display: flex; align-items: center; gap: 12px; border: 1px solid var(--b1); border-radius: 14px; padding: 11px 13px; text-align: start; width: 100%; cursor: pointer; }
.opt:hover { border-color: var(--pink-line); }
.opt > span { display: flex; flex-direction: column; font-size: 14px; }
.opt > span span { font-size: 12.5px; color: var(--t3); }
.opt input { accent-color: var(--pink); }
.form { display: flex; flex-direction: column; gap: 10px; }
.form__f { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--t2); }
.form__f input, .form__f textarea { border: 1px solid var(--b1); border-radius: 11px; padding: 10px 12px; font-size: 15px; background: #fff; width: 100%; }
.form__f input:focus, .form__f textarea:focus { outline: none; border-color: var(--pink-line); box-shadow: 0 0 0 3px rgba(228,18,122,.12); }
.form .btn { align-self: flex-start; }
.slots { display: flex; flex-direction: column; gap: 10px; }
.slots__day { display: block; font-size: 12.5px; font-weight: 600; color: var(--t3); margin-bottom: 6px; text-transform: capitalize; }
.slots__row { display: flex; flex-wrap: wrap; gap: 6px; }
.pill.is-sug { border-color: var(--pink-line); color: var(--pink); }
.pill:disabled { opacity: .45; }
.rv__items { display: flex; flex-direction: column; gap: 8px; }
.rv__it { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.rv__img { width: 36px; height: 36px; border-radius: 9px; background: var(--b2) center/cover; flex: 0 0 auto; }
.rv__n { flex: 1; }
.rv__p { font-weight: 600; }
.rv__row { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; padding-top: 8px; border-top: 1px solid var(--b1); }
.rv__row .ic { color: var(--t3); margin-top: 3px; }
.rv__k { color: var(--t3); min-width: 96px; }
.rv__v { flex: 1; }
.rv__totals { border-top: 1px solid var(--b1); padding-top: 8px; display: flex; flex-direction: column; gap: 3px; }
.rv__tot { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--t2); }
.rv__tot--t { font-size: 16px; font-weight: 700; color: var(--ink); }

/* ------------------------------------------------------------------ the box panel (beside the chat) */
.ai-panel { flex: 0 0 var(--panel-w); width: var(--panel-w); border-inline-start: 1px solid var(--b1); height: 100vh; height: 100dvh; position: sticky; top: 0; background: #fff; }
.pn { height: 100%; display: flex; flex-direction: column; }
.pn__scrim { display: none; }
.pn__head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--b1); min-height: 64px; }
.pn__h { font-size: 15.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pn__sp { flex: 1; }
.vers { display: inline-flex; align-items: center; gap: 2px; height: 24px; padding: 0 4px; border: 1px solid var(--b1); border-radius: 8px; font-size: 12px; font-weight: 600; flex: 0 0 auto; }
.vers button { width: 16px; height: 20px; display: flex; align-items: center; justify-content: center; color: var(--t3); }
.vers button:disabled { opacity: .35; }
.pn__body { flex: 1; overflow-y: auto; padding: 14px 20px; }
.pn__tabs { margin-bottom: 18px; }
.bud { margin-bottom: 8px; }
.bud__bar { height: 6px; border-radius: 3px; background: var(--b2); overflow: hidden; }
.bud__bar span { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #FF5AA8, #E4127A 55%, #7C3AED); }
@media (prefers-reduced-motion: no-preference) { .bud__bar .grow { transform: scaleX(0); } .bud__bar .grow.in { transform: scaleX(1); } }
.bud__row { display: flex; justify-content: space-between; font-size: 12px; color: var(--t3); margin-top: 6px; }
.bud__ok { color: var(--green); font-weight: 600; }
.bud__over { color: var(--red); font-weight: 600; }
.pitems { list-style: none; margin: 0; padding: 0; }
.pitem { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--b1); border-radius: 4px; }
.pitem__img { width: 64px; height: 72px; border-radius: 13px; background: var(--b2) center/cover; flex: 0 0 auto; }
.pitem__b { flex: 1; min-width: 0; position: relative; }
.pitem__top { display: flex; gap: 10px; align-items: flex-start; }
.pitem__n { flex: 1; font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.pitem__p { font-size: 14.5px; font-weight: 700; }
.pitem__brand { display: block; font-size: 12px; color: var(--t3); margin-top: 1px; }
.pitem__why { display: block; font-size: 12.5px; color: var(--t2); margin-top: 6px; line-height: 1.45; padding-inline-end: 76px; }
.pitem__acts { display: flex; gap: 6px; justify-content: flex-end; margin-top: 6px; }
.iconbtn--sq { width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--b1); color: var(--t2); }
.pn__empty { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 40px 10px; color: var(--t3); font-size: 13.5px; }
.pn__empty b { color: var(--ink); font-size: 15px; }
.pn__note { display: flex; align-items: center; gap: 10px; background: var(--b2); border-radius: 14px; padding: 12px 14px; margin-top: 14px; font-size: 13px; }
.pn__note span { flex: 1; }
.pn__note button { font-weight: 600; font-size: 13px; }
.pn__foot { border-top: 1px solid var(--b1); padding: 14px 20px 16px; display: flex; align-items: center; gap: 12px; }
.pn__foot > div { flex: 1; display: flex; flex-direction: column; }
.pn__fs { font-size: 12px; color: var(--t3); }
.pn__tot { font-size: 18px; font-weight: 700; }
.prow { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--b1); }
.prow > .ic:first-child { color: var(--pink); }
.prow > span { flex: 1; display: flex; flex-direction: column; }
.prow b { font-size: 14px; font-weight: 600; }
.prow > span span { font-size: 12.5px; color: var(--t3); }
.prow > .ic:last-child { color: var(--t3); }
.minicard { background: #FFFDF8; border-radius: 16px; padding: 18px; font-family: 'Brush Script MT', 'Segoe Script', cursive; font-size: 20px; line-height: 1.45; color: #26246A; box-shadow: 0 16px 30px -22px rgba(28,27,24,.45); margin-bottom: 12px; }

/* ------------------------------------------------------------------ bundle steps */
.bnd { border: 1px solid var(--b1); border-radius: 26px; padding: 26px 22px 18px; box-shadow: 0 16px 40px -28px rgba(28,27,24,.3); }
.bnd__h { font-size: 22px; font-weight: 600; letter-spacing: -.03em; }
.bnd__p { font-size: 13px; color: var(--t3); margin-top: 2px; }
.bnd__bar { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 14px; }
.dots { display: inline-flex; gap: 4px; align-items: center; }
.dots i { width: 4px; height: 4px; border-radius: 2px; background: var(--b1); transition: width .3s var(--ease), background .3s; }
.dots i.on { background: var(--pink); }
.dots i.cur { width: 22px; background: var(--pink); }
.bnd__q { font-size: 14px; font-weight: 700; color: var(--pink); }
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.tilebtn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; height: 96px; border: 1px solid var(--b1); border-radius: 16px; background: #fff; font-size: 12.5px; font-weight: 600; color: var(--ink); text-align: center; padding: 6px; }
.tilebtn .ic { color: var(--pink); }
.tilebtn[aria-pressed=true] { background: var(--pink); border-color: var(--pink); color: #fff; box-shadow: 0 12px 24px -12px rgba(228,18,122,.65); }
.tilebtn[aria-pressed=true] .ic { color: #fff; }
.budgets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.budget { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; border: 1px solid var(--b1); border-radius: 16px; padding: 16px 16px 14px; text-align: start; min-height: 96px; }
.budget b { font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.budget span { font-size: 13px; color: var(--t2); }
.budget small { font-size: 11.5px; color: var(--t3); margin-top: 8px; }
.budget[aria-pressed=true] { background: var(--pink); border-color: var(--pink); color: #fff; box-shadow: 0 12px 24px -12px rgba(228,18,122,.65); }
.budget[aria-pressed=true] span, .budget[aria-pressed=true] small { color: rgba(255,255,255,.88); }
.cats { display: flex; flex-wrap: wrap; gap: 8px; }
.cat { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border: 1px solid var(--b1); border-radius: 21px; font-size: 14px; font-weight: 600; background: #fff; }
.cat .ic { color: var(--pink); }
.cat[aria-pressed=true] { background: var(--pink); border-color: var(--pink); color: #fff; }
.cat[aria-pressed=true] .ic { color: #fff; }
.create { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 54px; margin-top: 16px; border-radius: 16px; background: var(--ink); color: #fff; font-size: 15px; font-weight: 600; }
.create__n { color: rgba(255,255,255,.55); font-weight: 500; }
.create[disabled] { opacity: .35; }
.trailrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.trailchip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 15px; background: var(--b2); font-size: 12.5px; font-weight: 600; }
.trailchip .ic { color: var(--pink); }
.bnd__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; font-size: 12.5px; color: var(--t3); }
.bnd__back { display: inline-flex; align-items: center; gap: 4px; color: var(--t3); font-size: 12.5px; }
.bnd__n { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; }
.bnd__n i { font-style: normal; margin: 0 3px; }

/* composing */
.composing { margin-top: 30px; }
.composing__head { display: flex; align-items: center; gap: 18px; margin-bottom: 28px; }
.composing__h { font-size: 22px; font-weight: 600; letter-spacing: -.03em; display: inline-block; }
.composing__head p { font-size: 13.5px; color: var(--t3); }
.skels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.skels .skel { height: 220px; border-radius: 22px; display: block; }

/* ------------------------------------------------------------------ the box screen */
.boxv { flex: 1; min-height: 0; display: flex; }
.boxv__main { flex: 1; min-width: 0; overflow-y: auto; padding: 0 24px 40px; }
.boxv__side { flex: 0 0 340px; display: flex; flex-direction: column; gap: 0; padding: 12px 22px 24px; border-inline-start: 1px solid var(--b1); overflow-y: auto; }
.boxv__sp { flex: 1; min-height: 20px; }
.boxv__side .btn--lg { width: 100%; height: 56px; border-radius: 18px; font-size: 16px; margin-top: 12px; }
.hero { position: relative; height: 300px; border-radius: 28px; overflow: hidden; background: #ECE8F2 center/cover no-repeat; }
.hero__shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(255,255,255,.96) 0%, rgba(255,255,255,.82) 34%, rgba(255,255,255,0) 66%); }
[dir=rtl] .hero__shade { background: linear-gradient(270deg, rgba(255,255,255,.96) 0%, rgba(255,255,255,.82) 34%, rgba(255,255,255,0) 66%); }
.hero__in { position: relative; padding: 72px 40px 30px; max-width: 520px; }
.hero__chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 15px; background: #fff; font-size: 12.5px; font-weight: 600; box-shadow: 0 2px 8px rgba(28,27,24,.08); }
.hero__chip .ic { color: var(--pink); }
.hero__h { font-size: 52px; font-weight: 700; letter-spacing: -.05em; line-height: 1.02; margin: 16px 0 14px; }
.hero__p { display: flex; gap: 8px; font-size: 15px; line-height: 1.55; color: var(--t2); }
.hero__p .spark { margin-top: 4px; }
.hero__back { position: absolute; top: 16px; inset-inline-start: 16px; z-index: 2; }
.alts { display: flex; gap: 6px; overflow-x: auto; padding: 14px 2px 0; scrollbar-width: none; }
.alts .pill[aria-pressed=true] { background: var(--ink); color: #fff; border-color: var(--ink); }
.bitems { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 24px 24px 0; }
.bitem { border: 1px solid var(--b1); border-radius: 22px; padding: 8px; background: #fff; position: relative; }
.bitem__img { height: 230px; border-radius: 16px; background: var(--b2) center/cover no-repeat; position: relative; }
.bitem__swap { position: absolute; top: 10px; inset-inline-end: 10px; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 12px; background: rgba(255,255,255,.95); font-size: 13px; font-weight: 600; box-shadow: 0 2px 10px rgba(28,27,24,.12); }
.bitem__swapm { display: none !important; }
.bitem__b { padding: 14px 8px 10px; display: flex; flex-direction: column; gap: 3px; }
.bitem__brand { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--t3); }
.bitem__n { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.bitem__why { font-size: 13.5px; color: var(--t2); line-height: 1.45; }
.bitem__p { font-size: 18px; font-weight: 700; color: var(--pink); margin-top: 6px; }
.bitem__p small { font-size: 11px; font-weight: 600; color: var(--t3); letter-spacing: .04em; }
.sum { background: var(--ink); color: #fff; border-radius: 26px; padding: 20px 20px 20px; margin-bottom: 14px; }
.sum__k { display: block; font-size: 13px; color: rgba(255,255,255,.6); }
.sum__t { display: flex; align-items: baseline; gap: 6px; margin-top: 2px; }
.sum__t b { font-size: 42px; font-weight: 700; letter-spacing: -.04em; line-height: 1.1; }
.sum__t small { font-size: 12px; color: rgba(255,255,255,.6); font-weight: 600; }
.sum__re { margin-top: 16px; width: 100%; height: 44px; border-radius: 14px; background: rgba(255,255,255,.1); color: #fff; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 14.5px; font-weight: 600; }
.sum__why { gap: 8px; font-size: 14px; line-height: 1.5; color: var(--t2); margin: 14px 2px 0; }
.prow--static { cursor: default; }

/* swap modal */
.swap__tabs { display: flex; gap: 6px; margin: 18px 0 18px; flex-wrap: wrap; }
.swap__tabs .pill { height: 34px; font-weight: 500; }
.swap__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; min-height: 200px; }
.swap__c { display: flex; flex-direction: column; border: 1px solid var(--b1); border-radius: 18px; padding: 8px; text-align: start; background: #fff; }
.swap__c[aria-pressed=true] { border-color: var(--pink); box-shadow: 0 0 0 1px var(--pink); background: #FFF9FC; }
.swap__img { display: block; height: 150px; border-radius: 12px; background: var(--b2) center/cover no-repeat; }
.swap__n { font-size: 14.5px; font-weight: 600; margin: 10px 6px 2px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.swap__pr { display: flex; align-items: baseline; gap: 8px; margin: 0 6px 4px; }
.swap__pr b { font-size: 15px; font-weight: 700; color: var(--pink); }
.swap__pr .up { font-size: 11.5px; font-weight: 700; color: #B0631E; }
.swap__pr .down { font-size: 11.5px; font-weight: 700; color: var(--green); }
.swap__none { grid-column: 1 / -1; font-size: 14px; color: var(--t3); text-align: center; padding: 40px 0; }
.swap__foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.swap__foot .btn { height: 48px; border-radius: 14px; }
.ai-modal--sm .ai-modal__box { max-width: 460px; }

/* ready sheet (phones) */
.ready { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.ready__ok { width: 64px; height: 64px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.ready__th { display: flex; margin: 12px 0; }
.ready__th span { width: 44px; height: 44px; border-radius: 12px; background: var(--b2) center/cover; border: 2px solid #fff; margin-inline-start: -8px; }
.ready__tot { width: 100%; display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--b1); padding: 16px 2px; font-size: 14px; color: var(--t3); }
.ready__tot b { font-size: 22px; color: var(--ink); }
.ready__tot small { font-size: 11px; color: var(--t3); }
.ready__acts { display: flex; gap: 10px; width: 100%; }
.ready__acts .btn { flex: 1; height: 50px; }

/* ------------------------------------------------------------------ the empty box */
.ebox { flex: 1; min-height: 0; display: flex; }
.ebox__l { flex: 0 0 560px; display: flex; flex-direction: column; padding: 12px 32px 22px; border-inline-end: 1px solid var(--b1); overflow-y: auto; }
.ebox__back { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--t3); margin-bottom: 18px; }
.ebox__h { font-size: 34px; font-weight: 600; letter-spacing: -.04em; line-height: 1.1; }
.ebox__p { font-size: 14px; color: var(--t3); margin: 4px 0 20px; }
.eslots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.eslot { position: relative; height: 170px; border-radius: 18px; border: 1.5px dashed #DAD7D0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 13px; color: var(--t2); background: #fff; }
.eslot .ic { color: var(--t3); }
.eslot--full { border: 0; background: var(--b2) center/cover no-repeat; justify-content: flex-end; align-items: stretch; overflow: hidden; }
.eslot__shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,.55)); }
.eslot__t { position: relative; padding: 10px; color: #fff; display: flex; flex-direction: column; font-size: 11.5px; text-align: start; }
.eslot__t b { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eslot__x { position: absolute; top: 8px; inset-inline-end: 8px; width: 24px; height: 24px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; }
.ebox__meter { display: flex; justify-content: space-between; align-items: baseline; margin-top: 30px; font-size: 13px; color: var(--t3); }
.ebox__tot b { font-size: 24px; color: var(--ink); font-weight: 600; }
.ebox__bar { height: 4px; border-radius: 2px; background: var(--b1); margin-top: 8px; overflow: hidden; }
.ebox__bar span { display: block; height: 100%; background: var(--ink); border-radius: 2px; transition: width .4s var(--ease); }
.ebox__dock { margin-top: auto; padding-top: 20px; }
.ebox__r { flex: 1; min-width: 0; overflow-y: auto; padding: 28px 32px; }
.ebox__rh { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.ebox__rh h2 { flex: 1; display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; }
.search { display: flex; align-items: center; gap: 10px; height: 44px; border-radius: 13px; border: 1px solid var(--b1); background: var(--b2); padding: 0 12px; width: 300px; max-width: 100%; color: var(--t3); }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 14px; color: var(--ink); }
.search:focus-within { border-color: var(--pink-line); background: #fff; }
.search kbd { font-family: var(--f); font-size: 11px; color: var(--t3); border: 1px solid var(--b1); border-radius: 5px; padding: 1px 6px; background: #fff; }
.search--lg { width: 100%; height: 52px; border-radius: 16px; background: #fff; padding: 0 16px; margin-bottom: 16px; }
.search--lg input { font-size: 15px; }
.egrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 16px; }
.eprod { display: flex; flex-direction: column; text-align: start; position: relative; border-radius: 16px; }
.eprod__img { display: block; height: 180px; border-radius: 16px; background: var(--b2) center/cover no-repeat; }
.eprod__n { font-size: 14px; font-weight: 600; margin-top: 10px; line-height: 1.3; }
.eprod__m { font-size: 12.5px; color: var(--t3); }
.eprod__plus { position: absolute; top: 10px; inset-inline-end: 10px; width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.95); display: flex; align-items: center; justify-content: center; }

/* ------------------------------------------------------------------ library (history, boxes, cards, memory) */
.lib { width: 100%; max-width: 900px; margin: 0 auto; padding: 18px 24px 80px; overflow-y: auto; flex: 1; }
.lib--narrow { max-width: 680px; }
.lib__h { font-size: 36px; font-weight: 600; letter-spacing: -.04em; margin: 8px 0 20px; }
.lib__p { font-size: 14.5px; color: var(--t2); margin: -10px 0 20px; }
.lib__top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.lib__top .lib__h { margin-bottom: 16px; }
.lib__sp { flex: 1; }
.filters { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.filters .pill { height: 34px; font-weight: 500; }
.grp--lib { padding: 14px 4px 6px; }
.hrow { display: flex; align-items: center; border-bottom: 1px solid var(--b1); position: relative; }
.hrow__a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 16px; padding: 14px 4px; }
.hrow__a:hover { background: var(--side); }
.hrow__th { width: 80px; flex: 0 0 auto; display: flex; }
.hrow__th span { width: 30px; height: 30px; border-radius: 8px; background: var(--b2) center/cover; border: 1.5px solid #fff; margin-inline-start: -6px; }
.hrow__th span:first-child { margin-inline-start: 0; }
.hrow__th--ic { color: var(--t2); padding-inline-start: 4px; }
.hrow__b { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hrow__b b { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hrow__b > span { font-size: 13px; color: var(--t2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hrow__w { width: 90px; text-align: end; font-size: 12.5px; color: var(--t3); flex: 0 0 auto; }
.hrow__x { opacity: 0; color: var(--t3); }
.hrow:hover .hrow__x, .hrow__x:focus-visible { opacity: 1; }
.hist__more { margin: 18px auto 0; display: flex; }
.bgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.bcard { position: relative; border: 1px solid var(--b1); border-radius: 22px; padding: 10px; background: #fff; }
.bcard__a { display: block; }
.bcard__imgs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.bcard__imgs span { height: 110px; border-radius: 12px; background: var(--b2) center/cover; }
.bcard__b { display: flex; justify-content: space-between; gap: 10px; padding: 12px 6px 4px; }
.bcard__b > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.bcard__b b { font-size: 15px; font-weight: 600; }
.bcard__b span span { font-size: 12.5px; color: var(--t3); }
.bcard__r { display: flex; flex-direction: column; align-items: flex-end; }
.bcard__r b { font-size: 16px; }
.bcard__bar { display: block; height: 3px; border-radius: 2px; background: var(--b1); margin: 8px 6px 2px; overflow: hidden; }
.bcard__bar span { display: block; height: 100%; background: var(--ink); }
.bcard__x { position: absolute; top: 14px; inset-inline-end: 14px; background: rgba(255,255,255,.92); opacity: 0; }
.bcard:hover .bcard__x, .bcard__x:focus-visible { opacity: 1; }
.cgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cdraft { position: relative; background: #FFFDF8; border-radius: 18px; padding: 18px; box-shadow: 0 14px 30px -24px rgba(28,27,24,.5); border: 1px solid #F2EFE6; }
.cdraft__t { font-family: 'Brush Script MT', 'Segoe Script', cursive; font-size: 19px; line-height: 1.45; color: #26246A; }
.cdraft__m { display: block; font-size: 12px; color: var(--t3); margin-top: 10px; }
.cdraft__x { position: absolute; top: 8px; inset-inline-end: 8px; }
.memrow { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--b1); }
.memrow__b { flex: 1; display: flex; flex-direction: column; }
.memrow__b b { font-size: 14.5px; font-weight: 600; }
.memrow__b span { font-size: 13px; color: var(--t2); }
.memclear { margin-top: 26px; }
.share { margin-top: 18px; }
.share .search { width: 100%; }

/* ------------------------------------------------------------------ card writer */
.cardw { flex: 1; min-height: 0; display: flex; }
.cardw__chat { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cardw__pane { flex: 0 0 520px; border-inline-start: 1px solid var(--b1); padding: 22px 28px 28px; display: flex; flex-direction: column; overflow-y: auto; }
.cardw__status { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--t3); min-height: 24px; }
.paper { position: relative; margin: 22px 0 22px; min-height: 300px; border-radius: 20px; background: #FFFDF8; box-shadow: 0 30px 60px -30px rgba(28,27,24,.4); padding: 36px 34px 70px; transform: rotate(-1.2deg); }
.paper__logo { position: absolute; top: 18px; inset-inline-end: 22px; font-size: 20px; font-weight: 800; color: var(--pink); letter-spacing: -.04em; }
.paper__t { font-family: 'Brush Script MT', 'Segoe Script', cursive; font-size: 28px; line-height: 1.45; color: #26246A; padding-inline-end: 50px; white-space: pre-wrap; }
.paper--rtl .paper__t { font-family: 'Segoe Script', 'Noto Naskh Arabic', serif; }
.paper__ph { color: #B9B6C8; font-size: 22px; }
.paper__sig { position: absolute; inset-inline-end: 34px; bottom: 24px; font-family: 'Brush Script MT', cursive; font-size: 24px; color: #26246A; }
.cardw__langs { margin-bottom: 12px; }
.cardw__langs button { height: 36px; }
.tones { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tone { height: 38px; border-radius: 12px; border: 1px solid var(--b1); font-size: 13.5px; font-weight: 600; background: #fff; }
.tone[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: #fff; }
.cardw__sp { flex: 1; min-height: 20px; }
.cardw__acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cardw__acts .btn { height: 48px; }

/* ------------------------------------------------------------------ desktop: the panel only beside the chat */
@media (min-width: 1100px) {
  .ai-app:not(.has-panel) .ai-panel { display: none; }
  body:not([data-route=chat]) .ai-panel { display: none; }
}
@media (min-width: 1100px) and (max-width: 1279.98px) {
  :root { --panel-w: 380px; }
  .chat__scroll { padding: 10px 28px 24px; } .chat__dock { padding: 0 28px; }
  .bitems { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cardw__pane { flex-basis: 440px; }
  .ebox__l { flex-basis: 460px; }
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ------------------------------------------------------------------ mobile website (<1100px) */
@media (max-width: 1099.98px) {
  .ai-mainwrap { height: auto; min-height: 100dvh; }
  .ai-main { min-height: calc(100dvh - 56px); }
  .chat__scroll { padding: 6px 16px 16px; overflow: visible; }
  .chat__dock { position: sticky; bottom: 0; padding: 0 10px calc(10px + env(safe-area-inset-bottom)); z-index: 30; }
  .chat__dock .composer-foot { display: none; }
  .bubble { max-width: 86%; }
  .picks { flex-direction: column; overflow: visible; gap: 10px; }
  .pick { flex: none; display: flex; gap: 12px; padding: 10px; border-radius: 18px; }
  .pick__img { width: 64px; height: 64px; flex: 0 0 auto; border-radius: 12px; }
  .pick__b { flex: 1; padding: 0 40px 0 0; }
  [dir=rtl] .pick__b { padding: 0 0 0 40px; }
  .pick__name { font-size: 14.5px; }
  .pick__meta { font-size: 12px; }
  .pick__why { font-size: 13px; -webkit-line-clamp: 3; }
  .pick__add { top: auto; bottom: 10px; width: 32px; height: 32px; }
  .tools__note { display: none; }
  /* the box panel becomes a sheet */
  .ai-panel { position: fixed; inset: 0; z-index: 150; width: auto; height: auto; border: 0; background: transparent; display: flex; flex-direction: column; justify-content: flex-end; }
  .pn__scrim { display: block; position: absolute; inset: 0; background: rgba(28,27,24,.3); }
  .pn { position: relative; height: auto; max-height: 90dvh; background: #fff; border-radius: 28px 28px 0 0; box-shadow: 0 -20px 50px -20px rgba(28,27,24,.35); }
  .pn__head { border: 0; padding: 22px 16px 6px 20px; min-height: 0; }
  .pn__head::before { content: ''; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 40px; height: 5px; border-radius: 3px; background: #DAD7D0; }
  .pn__h { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
  .pn__foot { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .pn__foot .btn { height: 52px; border-radius: 16px; }
  /* bundle steps */
  .bnd { padding: 22px 16px 14px; border-radius: 24px; }
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tilebtn { height: 92px; font-size: 12.5px; }
  .budgets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .budget { min-height: 108px; }
  .skels { grid-template-columns: 1fr; } .skels .skel { height: 90px; } .skels .skel:nth-child(n+2) { display: none; }
  .composing__head { flex-direction: column; text-align: center; gap: 12px; }
  .composing { text-align: start; }
  /* box screen */
  .boxv { flex-direction: column; }
  .boxv__main { padding: 0; overflow: visible; }
  .boxv__side { flex: none; border: 0; padding: 0 16px 120px; overflow: visible; }
  .hero { height: 340px; border-radius: 0; margin-top: -56px; }
  .hero__shade { background: linear-gradient(180deg, rgba(255,255,255,0) 40%, rgba(255,255,255,.9) 82%, #fff 100%); }
  [dir=rtl] .hero__shade { background: linear-gradient(180deg, rgba(255,255,255,0) 40%, rgba(255,255,255,.9) 82%, #fff 100%); }
  .hero__in { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 20px 10px; max-width: none; display: flex; flex-direction: column-reverse; }
  .hero__chip { background: transparent; box-shadow: none; padding: 0; height: auto; font-weight: 500; color: var(--t2); }
  .hero__h { font-size: 34px; margin: 0 0 4px; }
  .hero__p { display: none; }
  .ai-view--box .ai-top { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .ai-view--box ~ * { }
  .bitems { grid-template-columns: 1fr; margin: 12px 16px 0; gap: 12px; }
  .bitem { display: flex; gap: 12px; padding: 10px; border-radius: 20px; align-items: flex-start; }
  .bitem__img { width: 72px; height: 72px; flex: 0 0 auto; border-radius: 13px; }
  .bitem__swap { display: none; }
  .bitem__swapm { display: inline-flex !important; width: 44px; height: 44px; border-radius: 14px; align-self: center; }
  .bitem__b { flex: 1; padding: 0; }
  .bitem__brand { font-family: var(--f); text-transform: none; letter-spacing: 0; font-size: 12.5px; order: 2; }
  .bitem__n { font-size: 15px; order: 1; }
  .bitem__why { order: 3; font-size: 13px; }
  .bitem__p { order: 4; font-size: 16px; margin-top: 4px; }
  .boxv__main > .alts { padding: 12px 16px 0; }
  .sum { display: flex; align-items: center; flex-wrap: wrap; border-radius: 22px; padding: 16px 18px; margin: 16px 0 0; order: -1; }
  .sum__k { width: 100%; font-size: 12.5px; }
  .sum__t { flex: 1; }
  .sum__t b { font-size: 30px; }
  .sum__re { width: auto; margin: 0; padding: 0 16px; height: 44px; }
  .boxv__side .btn--pink { position: fixed; left: 16px; right: 16px; bottom: calc(14px + env(safe-area-inset-bottom)); width: auto; z-index: 40; }
  .boxv__sp { display: none; }
  /* empty box */
  .ebox { flex-direction: column; }
  .ebox__l { flex: none; border: 0; padding: 14px 16px 0; overflow: visible; }
  .ebox__h { font-size: 28px; letter-spacing: -.035em; }
  .eslots { gap: 8px; }
  .eslot { height: 116px; border-radius: 16px; font-size: 12px; }
  .ebox__dock { position: sticky; bottom: 0; padding: 12px 0 calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 18px); z-index: 20; order: 10; }
  .ebox__r { padding: 18px 16px 30px; overflow: visible; }
  .ebox__rh { flex-direction: column; align-items: stretch; gap: 12px; }
  .search { width: 100%; }
  .egrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; }
  .eprod__img { height: 150px; }
  /* library */
  .lib { padding: 10px 14px 60px; overflow: visible; }
  .lib__top { justify-content: flex-end; }
  .search--lg { height: 46px; border-radius: 14px; background: var(--b2); }
  .hrow__th { width: auto; }
  .hrow__th span:nth-child(n+2) { display: none; }
  .hrow__w { width: auto; padding-inline-start: 8px; }
  .hrow .tag { display: none; }
  .hrow__x { opacity: 1; }
  .bgrid, .cgrid { grid-template-columns: 1fr; }
  .bcard__imgs span { height: 84px; }
  .bcard__x { opacity: 1; }
  /* card writer */
  .cardw { flex-direction: column; }
  .cardw__chat { flex: none; }
  .cardw__chat .chat__dock { display: none; }
  .cardw__pane { flex: none; border: 0; padding: 0 16px 24px; order: 2; }
  .paper { transform: none; min-height: 190px; padding: 26px 22px 54px; margin: 12px 0 14px; border: 1px solid #F2EFE6; box-shadow: none; }
  .paper__t { font-size: 23px; padding-inline-end: 40px; }
  .paper__sig { font-size: 20px; bottom: 16px; inset-inline-end: 22px; }
  .tones { grid-template-columns: repeat(4, auto); justify-content: start; }
  .tone { height: 32px; padding: 0 12px; border-radius: 16px; font-size: 13px; }
  .cardw__langs { order: -1; margin: 6px 0 10px; }
  .cardw__status { order: 0; font-size: 13px; }
  .cardw__pane .seg.cardw__langs { order: -2; }
  .cardw__acts { margin-top: 14px; }
  .swap__grid { grid-template-columns: 1fr; min-height: 0; }
  .swap__c { flex-direction: row; align-items: center; gap: 14px; padding: 10px; }
  .swap__img { width: 62px; height: 62px; flex: 0 0 auto; }
  .swap__n { margin: 0; }
  .swap__c > span:not(.swap__img) { display: block; }
  .swap__foot { position: sticky; bottom: 0; background: #fff; padding-top: 10px; }
  .swap__foot .btn { flex: 1; }
}
@media (max-width: 639.98px) {
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
  .tilebtn { height: 86px; border-radius: 15px; font-size: 12px; gap: 6px; }
}
@media (max-width: 1099.98px) and (min-width: 640px) {
  .chat__col, .lib { max-width: 640px; }
  .bitems { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bitem { flex-direction: column; } .bitem__img { width: 100%; height: 180px; }
  .egrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .budgets { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pn { max-width: 640px; margin: 0 auto; width: 100%; }
}

/* fixes after the first visual pass */
@media (min-width: 1100px) {
  #ai-nudge-d { display: flex; justify-content: center; }
  #ai-nudge:empty, #ai-nudge-d:empty { display: none; }
  .chat__dock .chat__col > .composer:last-child { margin-bottom: 22px; }
}
.hrow__xph { width: 40px; flex: 0 0 auto; }
@media (max-width: 1099.98px) {
  .sum--m { margin: 14px 16px 0; }
  .sum__why.m-only { margin: 14px 18px 0; display: flex !important; }
}
@media (max-width: 639.98px) { .composer__chips [data-c=budget] { display: none; } }
.prose ol, .prose ul { margin: 4px 0 12px; padding-inline-start: 22px; }
.prose li { margin: 0 0 6px; padding-inline-start: 2px; }
.prose ol li::marker { font-weight: 600; color: var(--t2); }
.prose ul li::marker { color: var(--pink); }
.prose i { font-style: italic; }
/* the real logo image (stacked pink mark), never the text wordmark */
.logo img { display: block; height: 40px; width: auto; object-fit: contain; }
.paper__logo { height: 34px; width: auto; object-fit: contain; top: 14px; }
@media (max-width: 1099.98px) { .paper__logo { height: 28px; } }
/* the real logo image (stacked pink mark), never the text wordmark */
.logo img { display: block; height: 40px; width: auto; object-fit: contain; }
.paper__logo { height: 34px; width: auto; object-fit: contain; top: 14px; }
@media (max-width: 1099.98px) { .paper__logo { height: 28px; } }
