@font-face { font-family: Vazirmatn; src: url("./fonts/Vazirmatn-Thin.woff2") format("woff2"); font-weight: 100; font-style: normal; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url("./fonts/Vazirmatn-ExtraLight.woff2") format("woff2"); font-weight: 200; font-style: normal; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url("./fonts/Vazirmatn-Light.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url("./fonts/Vazirmatn-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url("./fonts/Vazirmatn-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url("./fonts/Vazirmatn-SemiBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url("./fonts/Vazirmatn-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url("./fonts/Vazirmatn-ExtraBold.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url("./fonts/Vazirmatn-Black.woff2") format("woff2"); font-weight: 900; font-style: normal; font-display: swap; }
:root {
  color-scheme: dark;
  --canvas: #191e2b; --surface: #242c3c; --ink: #eef1f8;
  --muted: #c0c8d9; --quiet: #a5b1c9; --line: #b9cdef24;
  --identity-primary: #06277e; --identity-accent: #b0e5f3; --identity-border: #90bbec55;
  --identity-surface: #283d5e; --identity-glow: #5c9deb28; --identity-focus: #b0e5f3; --identity-message-bg: #274b83;
  font-family: Vazirmatn, Tahoma, sans-serif; font-synthesis: none;
  view-transition-name: none;
}
* { box-sizing: border-box; }
html { min-height: 100%; scrollbar-color: #647592 #252d40; font-size: 16px; }
body { margin: 0; overflow: hidden; background: var(--canvas); color: var(--ink); font-size: .875rem; line-height: 1.8; }
button, textarea { font: inherit; }
button, a, textarea { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
button, a { touch-action: manipulation; }
button:focus-visible, a:focus-visible, textarea:focus-visible, [tabindex="0"]:focus-visible { outline: 2px solid var(--identity-focus); outline-offset: 4px; }
[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.svg-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.atmosphere { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(ellipse at 80% 20%, #3b71b32b, transparent 65%), radial-gradient(ellipse at 15% 65%, #a06a9824, transparent 60%); }
/* The same three shell rows survive every identity/screen change. */
.app-shell { height: var(--viewport-height, 100dvh); max-width: 1200px; margin: auto; padding: 0 32px; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.site-header { min-height: 90px; display: flex; align-items: center; gap: 24px; border-bottom: 1px solid var(--line); padding-block: max(12px, env(safe-area-inset-top)); }
.brand { display: inline-flex; gap: 13px; align-items: center; color: var(--ink); text-decoration: none; flex-shrink: 0; }
.brand-emblem { display: grid; grid-template-columns: repeat(2, 9px); gap: 4px; transform: rotate(-12deg); }
.brand-emblem i { height: 9px; border: 1px solid #dfc9ae; border-radius: 2px; }
.brand-emblem i:nth-child(2), .brand-emblem i:nth-child(3) { background: #dfc9ae; }
.brand-word { font-size: 1.5rem; line-height: 1.1; }
.brand-latin { display: block; font: .5rem/1.8 Arial, sans-serif; letter-spacing: 3px; color: #dfc9ae; margin-top: 6px; }
.service-label { display: flex; align-items: center; gap: 9px; font-size: .75rem; color: var(--muted); margin-inline-start: auto; }
.status-dot { display: inline-block; width: 5px; height: 5px; background: #b1e1c9; border-radius: 50%; box-shadow: 0 0 0 4px #b1e1c912; flex-shrink: 0; }
.chat-heading { display: flex; align-items: center; gap: 13px; min-width: 0; flex: 1; }
.chat-heading h1 { font-size: 1.05rem; font-weight: 500; margin: 0; }
.header-actions { display: flex; align-items: center; gap: 10px; }
body[data-screen="selection"] .chat-heading, body[data-screen="selection"] .header-actions, body[data-screen="selection"] .composer-wrap { display: none; }
body[data-screen="chat"] .service-label, body[data-screen="chat"] .landing-footer { display: none; }
.page-content { min-height: 0; overflow: auto; overscroll-behavior: contain; view-transition-name: content; scrollbar-width: thin; }
body[data-screen="chat"] .page-content { overflow: hidden; }
.site-footer { min-height: 116px; padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--line); display: grid; align-items: center; }
.landing-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: .75rem; color: var(--quiet); }
.footer-signature { font: .6rem Arial, sans-serif; letter-spacing: 1.6px; }
/* Selection: content can scroll only when its readable minimum exceeds the viewport. */
.selection-screen { min-height: 100%; display: flex; }
.selection-content { width: 100%; max-width: 870px; margin: auto; flex-shrink: 0; padding: 22px 6px; }
.welcome-copy { text-align: center; }
.eyebrow { display: flex; justify-content: center; align-items: center; gap: 12px; margin: 0; color: #dfc9ae; font-size: .75rem; }
.eyebrow > span { width: 24px; height: 1px; background: #dfc9ae66; }
.welcome-copy h1 { font-weight: 600; font-size: clamp(1.75rem, 3.1vw, 2.6rem); letter-spacing: -.8px; line-height: 1.6; margin: 9px 0; }
.welcome-copy h1 span { color: #cad9f1; }
.welcome-description { font-size: .875rem; color: var(--muted); margin: 0; }
.mobile-break { display: none; }
.identity-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 28px; }
.identity-card { position: relative; display: flex; flex-direction: column; align-items: stretch; min-width: 0; text-align: right; border: 1px solid var(--card-border); background: var(--card-bg); border-radius: 23px; padding: 20px 28px 0; isolation: isolate; overflow: hidden; box-shadow: 0 16px 32px #050b1c25; }
.identity-card::before { content: ""; position: absolute; z-index: -1; inset: 0; opacity: .65; background: radial-gradient(ellipse at 50% 30%, var(--card-glow), transparent 75%); pointer-events: none; }
.card-topline { display: flex; align-items: center; justify-content: space-between; direction: ltr; color: var(--card-muted); }
.card-category { font: .625rem/1.5 Arial, sans-serif; letter-spacing: 1.7px; }
.card-index { font: .7rem Arial, sans-serif; }
.card-art { display: block; align-self: center; width: 100%; max-width: 300px; height: clamp(85px, 14vh, 140px); margin: 3px 0 8px; }
.card-art svg { width: 100%; height: 100%; overflow: visible; }
.art-orbit { stroke: var(--card-accent); stroke-opacity: .12; stroke-width: .7; stroke-dasharray: 2 6; }
.delivery-route { stroke: #6ca7d4; stroke-width: 1; stroke-dasharray: 4 5; opacity: .7; }
.route-node { fill: #172a41; stroke: #8ed7e8; stroke-width: 1.2; }
.route-end { fill: #10273b; stroke: #8ed7e8; stroke-width: 1.5; }
.box-edge { stroke: #9bbce7; stroke-opacity: .4; stroke-width: 1; }
.box-tape { fill: #a5c0de; fill-opacity: .5; stroke: none; }
.box-label { fill: #c8d7e9; fill-opacity: .65; stroke: none; }
.box-label-line { stroke: #244269; stroke-width: 1.6; }
.art-badge circle { fill: #153d4b; stroke: #7bc5d740; }
.art-badge path { stroke: #a9e2e1; stroke-width: 1.6; }
.art-spark { stroke: var(--card-accent); opacity: .55; stroke-width: 1; }
.scent-trail { stroke: #a9d9b5; stroke-width: 1; opacity: .35; }
.bottle-neck { fill: #9fcfb0; fill-opacity: .35; stroke: #b7e0c1; stroke-opacity: .3; }
.cap-lines { stroke: #446653; stroke-opacity: .35; stroke-width: .7; }
.bottle-outline { stroke: #93caa1; stroke-opacity: .6; stroke-width: 1; }
.bottle-shine { stroke: #e0f5e4; stroke-opacity: .3; stroke-width: 1.7; }
.bottle-label { fill: #d2e3c8; fill-opacity: .88; stroke: none; }
.bottle-brand { fill: #2f4d3a; stroke: none; font: 6px Georgia, serif; letter-spacing: 1px; }
.bottle-label-line { stroke: #5d8066; stroke-width: .6; }

.card-copy { display: flex; flex-direction: column; gap: 3px; }
.card-kicker { font-size: .75rem; color: var(--card-accent); }
.card-copy strong { font-size: 1.6rem; font-weight: 500; letter-spacing: -.5px; }
.card-description { font-size: .8125rem; line-height: 1.9; color: #d1dced; margin: 3px 0 18px; }
.card-bottom { display: flex; justify-content: space-between; align-items: center; min-height: 58px; border-top: 1px solid var(--card-border); color: var(--card-accent); margin-top: auto; }
.card-cta { font-size: .8125rem; }
.card-arrow { width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid var(--card-border); border-radius: 50%; }
.card-arrow svg { width: 15px; height: 15px; }
.identity-card:disabled { opacity: .65; }
.identity-card.selecting { border-color: var(--card-accent); box-shadow: 0 0 0 3px var(--card-glow); }
.identity-card:focus-visible { outline-color: var(--card-accent); }
.unavailable-note { display: block; text-align: center; color: #ffd1c1; font-size: .6875rem; padding-bottom: 6px; }
.selection-reassurance { display: flex; justify-content: center; align-items: center; gap: 7px; color: var(--quiet); font-size: .75rem; margin: 14px 0 0; }
.selection-reassurance svg { width: 15px; height: 15px; }
.landing-feedback { font-size: .75rem; color: #f2ceb9; text-align: center; margin: 0; }
.landing-feedback:not(:empty) { margin-top: 10px; }
/* Shared conversation renderer; the domain-specific colors come from themes.css. */
.chat-screen { height: 100%; min-height: 0; padding: 18px 0; }
.chat-shell { position: relative; width: 100%; max-width: 930px; height: 100%; margin: auto; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; border: 1px solid var(--identity-border); border-radius: 20px; overflow: hidden; background: var(--surface); box-shadow: 0 16px 50px #060c1c20; }
.assistant-avatar, .welcome-avatar, .message-avatar { display: grid; place-items: center; color: var(--identity-accent); background: var(--identity-glow); border: 1px solid var(--identity-border); flex-shrink: 0; }
.assistant-avatar { width: 46px; height: 46px; border-radius: 15px; background: var(--identity-surface); }
.assistant-avatar svg { width: 27px; height: 27px; }
.connection-title { display: flex; gap: 7px; align-items: center; color: var(--muted); font-size: .6875rem; margin: 3px 0 0; }
.connection-title.offline { color: #ffc5b7; }
.connection-title.offline .status-dot { background: #ffb1a1; }
.icon-button, .switch-button { background: none; border: 0; min-height: 44px; border-radius: 10px; display: inline-flex; gap: 8px; align-items: center; justify-content: center; }
.icon-button { width: 44px; color: var(--muted); }
.icon-button svg { width: 19px; height: 19px; }
.switch-button { padding: 0 6px; font-size: .8125rem; color: var(--identity-accent); }
.switch-button svg { width: 18px; height: 18px; }
.action-divider { width: 1px; height: 20px; background: var(--identity-border); }
.mode-notice { grid-row: 1; display: flex; gap: 8px; justify-content: center; align-items: center; background: var(--identity-surface); color: #d2dced; padding: 8px 20px; font-size: .75rem; border-bottom: 1px solid var(--identity-border); line-height: 1.9; }
.notice-symbol { color: var(--identity-accent); font-size: 15px; }
.chat-scroll { grid-row: 2; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-gutter: stable; padding: 24px 36px; min-height: 0; }
.empty-state { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 22px 0; }
.welcome-avatar { width: 78px; height: 78px; border-radius: 25px; box-shadow: 0 10px 40px var(--identity-glow); margin-bottom: 20px; }
.welcome-avatar svg { width: 39px; height: 39px; }
.empty-state .eyebrow { color: var(--identity-accent); font-size: .75rem; }
.empty-state h2 { margin: 9px 0 10px; font-size: clamp(1.3rem, 3vw, 1.75rem); font-weight: 500; letter-spacing: -.5px; }
.greeting-copy { max-width: 430px; font-size: .875rem; color: var(--muted); line-height: 2.1; margin: 0; }
.suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; max-width: 600px; margin-top: 24px; }
.suggestions button { display: inline-flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 44px; border: 1px solid var(--identity-border); background: #ffffff07; border-radius: 12px; color: #dce5f4; font-size: .8125rem; }
.suggestions svg { width: 14px; height: 14px; color: var(--identity-accent); }
.suggestions.message-suggestions { justify-content: flex-end; max-width: 87%; margin: 12px auto 0 0; gap: 8px; }
.suggestions.message-suggestions button { border-radius: 999px; padding: 8px 12px; gap: 8px; font-size: .75rem; }
.messages { display: flex; flex-direction: column; gap: 26px; }
.message { max-width: 87%; align-self: flex-end; min-width: 0; }
.message.user { align-self: flex-start; }
.message-meta { display: flex; flex-direction: row-reverse; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; margin-bottom: 7px; }
.message-avatar { width: 24px; height: 24px; border-radius: 8px; font-size: 10px; }
.message-avatar svg { width: 16px; height: 16px; stroke-width: 1.5; }
.message-author { font-weight: 400; color: #c5cad6; }
.message time { font-size: .6875rem; color: var(--quiet); margin-inline-end: auto; padding-inline-end: 22px; }
.user .message-avatar { background: #313644; color: #c7ccd7; border-color: #ffffff12; }
.user .message-meta { flex-direction: row; }
.user time { margin-inline-start: auto; margin-inline-end: 0; padding-inline-start: 22px; padding-inline-end: 0; }
.message-bubble { padding: 13px 18px; border-radius: 3px 16px 16px 16px; background: #30394b; border: 1px solid #ffffff08; line-height: 2.1; color: #e6eaf2; overflow-wrap: anywhere; font-size: 13px; }
.user .message-bubble { background: var(--identity-message-bg); border-color: var(--identity-border); border-radius: 16px 3px 16px 16px; white-space: pre-wrap; }
.message-bubble > :first-child { margin-top: 0; }
.message-bubble > :last-child { margin-bottom: 0; }
.message-bubble p { margin: 0 0 10px; }
.message-bubble h3, .message-bubble h4, .message-bubble h5, .message-bubble h6 { font-size: 14px; margin: 15px 0 8px; }
.message-bubble ul, .message-bubble ol { padding-inline-start: 22px; margin: 8px 0; }
.message-bubble strong { color: var(--identity-accent); font-weight: 600; }
.message-bubble code { background: #00000025; padding: 2px 5px; border-radius: 4px; font: 12px/1.8 Consolas, monospace; }
.message-bubble pre { direction: ltr; text-align: left; overflow: auto; max-width: 100%; padding: 12px; background: #11141b; border-radius: 8px; }
.message-bubble pre code { padding: 0; background: none; }
.message-bubble blockquote { margin: 10px 0; border-inline-start: 2px solid var(--identity-accent); padding-inline-start: 12px; color: #b7bfce; }
.message-bubble hr { border: 0; border-top: 1px solid var(--identity-border); margin: 15px 0; }
.markdown-table-wrap { max-width: 100%; overflow-x: auto; }
.message-bubble table { border-collapse: collapse; font-size: 11px; min-width: 220px; }
.message-bubble th, .message-bubble td { padding: 8px 12px; border: 1px solid var(--identity-border); text-align: right; }
.typing .message-bubble { display: flex; align-items: center; gap: 5px; width: 65px; height: 42px; }
.typing-dot { width: 4px; height: 4px; background: var(--identity-accent); border-radius: 50%; }
.scroll-controls { position: absolute; z-index: 2; left: 4px; bottom: 18px; display: flex; flex-direction: column; border: 1px solid var(--identity-border); background: #1a202c; border-radius: 20px; box-shadow: 0 4px 15px #0003; }
.scroll-controls button { background: none; border: 0; width: 44px; height: 44px; color: var(--identity-accent); }
.scroll-controls button:disabled { opacity: .3; }

.composer-wrap { width: 100%; max-width: 930px; margin: auto; padding: 12px 0 10px; }
.composer { display: flex; align-items: flex-end; gap: 12px; padding: 7px 10px; border: 1px solid #a9c6ee50; border-radius: 16px; background: #2d374b; }
.composer:focus-within { border-color: var(--identity-accent); box-shadow: 0 0 0 3px var(--identity-glow); }
.composer textarea { flex: 1; width: 0; min-height: 44px; max-height: 130px; resize: none; border: 0; background: none; color: var(--ink); padding: 8px 6px 6px 0; line-height: 1.9; outline: none; font-size: 1rem; scrollbar-width: thin; }
.composer textarea:focus-visible { outline: none; }
.composer textarea::placeholder { color: #c2cfe4; opacity: 1; font-size: .875rem; }
.send-button { width: 44px; height: 44px; flex-shrink: 0; border: 1px solid var(--identity-border); border-radius: 12px; display: grid; place-items: center; background: var(--identity-primary); color: var(--identity-accent); }
.send-button svg { width: 21px; height: 21px; transform: scaleX(-1); }
.send-button:disabled { opacity: .4; }
.composer-footer { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin: 6px 3px 0; font-size: .6875rem; color: var(--quiet); }
.char-count { margin-inline-start: auto; white-space: nowrap; }
.keyboard-hint { display: inline-flex; align-items: center; gap: 5px; font: .625rem Arial, sans-serif; margin-inline-start: 8px; }
.error-banner { grid-row: 3; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 6px 18px; padding: 8px 12px; background: #593c45; border: 1px solid #dfa1a56b; border-radius: 10px; font-size: .8125rem; color: #ffded5; }
.error-banner span { flex: 1; }
.error-banner button { background: none; border: 0; color: #ffe4d5; min-height: 44px; }
#retry-button { text-decoration: underline; text-underline-offset: 5px; }
#dismiss-error { width: 44px; font: 21px Arial, sans-serif; }
.confirm-dialog { width: min(400px, calc(100% - 40px)); padding: 28px; background: #293246; color: var(--ink); border: 1px solid var(--identity-border); border-radius: 22px; box-shadow: 0 30px 100px #0007; }
.confirm-dialog::backdrop { background: #060911cc; }
.dialog-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--identity-surface); color: var(--identity-accent); }
.confirm-dialog h2 { font-size: 19px; font-weight: 500; margin: 18px 0 8px; }
.confirm-dialog p { font-size: 12px; line-height: 2.2; color: var(--muted); }
.dialog-actions { display: flex; gap: 10px; margin-top: 24px; }
.dialog-actions button { min-height: 44px; border-radius: 10px; padding: 8px 16px; font-size: 11px; }
.secondary-button { background: none; border: 1px solid #ffffff25; }
.primary-button { background: var(--identity-message-bg); border: 1px solid var(--identity-border); color: var(--identity-accent); }
.noscript-message { text-align: center; padding: 20px; color: #f3bba9; }


@media (max-width: 800px) {
  .app-shell { padding-inline: 22px; }
  .site-header { gap: 16px; }
  .identity-grid { gap: 18px; }
  .identity-card { padding-inline: 22px; }
}
@media (min-width: 541px) and (max-height: 850px) {
  .selection-content { padding-block: 6px; }
  .welcome-copy h1 { margin-block: 4px; }
  .identity-card { padding-top: 14px; }
  .card-art { height: 90px; margin-block: 2px 3px; }
  .card-description { margin-bottom: 8px; }
  .card-bottom { min-height: 50px; }
  .identity-grid { margin-top: 10px; }
  .selection-reassurance { display: none; }
}
@media (max-width: 540px) {
  .app-shell { padding-inline: 18px; }
  .site-header { min-height: 74px; gap: 12px; }
  .site-footer { min-height: 100px; }
  .brand-word { font-size: 1.35rem; }
  .brand-latin { font-size: .5rem; }
  .service-label { font-size: .6875rem; }
  .selection-content { padding: 16px 5px; }
  .welcome-copy .eyebrow { font-size: .6875rem; }
  .welcome-copy h1 { font-size: 1.7rem; line-height: 1.5; margin-block: 8px; }
  .welcome-description { font-size: .8125rem; max-width: 285px; margin: auto; }
  .identity-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 20px; }
  .identity-card { min-height: clamp(155px, 23svh, 196px); padding: 14px 18px 0; border-radius: 19px; }
  .card-category { font-size: .5625rem; letter-spacing: 1px; }
  .card-index { font-size: .625rem; }
  .card-art { position: absolute; left: -6px; top: 24px; width: 133px; height: 115px; margin: 0; pointer-events: none; }
  .card-copy { padding-top: 9px; position: relative; }
  .card-kicker { display: none; }
  .card-copy strong { font-size: 1.4rem; line-height: 1.5; max-width: calc(100% - 70px); }
  .card-description { font-size: .75rem; max-width: calc(100% - 80px); line-height: 1.75; margin: 2px 0 10px; }
  .card-description br { display: none; }
  .card-bottom { min-height: 42px; }
  .card-cta { font-size: .75rem; }
  .card-arrow { width: 26px; height: 26px; }
  .selection-reassurance, .landing-feedback { font-size: .6875rem; line-height: 1.7; }
  .selection-reassurance { margin-top: 10px; }
  .landing-footer { flex-direction: column; justify-content: center; gap: 7px; font-size: .6875rem; }
  .footer-signature { font-size: .5rem; letter-spacing: 1.3px; }
  body[data-screen="chat"] .brand-word { display: none; }
  .chat-heading { gap: 8px; }
  .chat-heading h1 { font-size: .875rem; white-space: nowrap; }
  .assistant-avatar { width: 36px; height: 36px; border-radius: 12px; }
  .assistant-avatar svg { width: 23px; height: 23px; }
  .connection-title { font-size: .625rem; gap: 5px; }
  .header-actions { gap: 2px; }
  .switch-button { gap: 4px; font-size: .6875rem; padding-inline: 2px; }
  .switch-button svg { width: 16px; height: 16px; }
  .action-divider { display: none; }
  .chat-screen { padding: 10px 0; }
  .chat-shell { border-radius: 16px; }
  .mode-notice { padding: 7px 12px; font-size: .6875rem; text-align: right; }
  .chat-scroll { padding: 20px 12px; scrollbar-gutter: auto; }
  .empty-state { padding: 16px 0; }
  .welcome-avatar { width: 62px; height: 62px; border-radius: 21px; margin-bottom: 16px; }
  .welcome-avatar svg { width: 33px; height: 33px; }
  .empty-state h2 { font-size: 1.4rem; }
  .greeting-copy { font-size: .8125rem; line-height: 2; }
  .suggestions { margin-top: 18px; gap: 8px; }
  .suggestions button { font-size: .75rem; padding: 9px 12px; }
  .message { max-width: 94%; }
  .message-bubble { font-size: .8125rem; padding: 12px 14px; }
  .message-meta { font-size: .6875rem; }
  .composer-wrap { padding-block: 9px; }
  .composer { gap: 7px; padding: 6px 8px; border-radius: 14px; }
  .composer textarea::placeholder { font-size: .8125rem; }
  .composer-footer { font-size: .625rem; gap: 6px; }
  .keyboard-hint { display: none; }
  /* Touch/native keyboard scrolling stays unobstructed on narrow screens. */
  .scroll-controls { display: none; }
  .error-banner { margin-inline: 8px; font-size: .75rem; }
}
@media (max-width: 540px) and (min-height: 701px) and (max-height: 850px) {
  .selection-content { padding-block: 3px; }
  .welcome-copy h1 { margin-block: 5px; }
  .identity-grid { margin-top: 8px; gap: 10px; }
  .selection-reassurance { margin-top: 6px; }
  .landing-feedback:not(:empty) { margin-top: 6px; }
}
@media (max-width: 355px) {
  .app-shell { padding-inline: 12px; }
  .site-header { gap: 8px; }
  .brand-emblem { grid-template-columns: repeat(2, 7px); gap: 3px; }
  .brand-emblem i { height: 7px; }
  .chat-heading h1 { font-size: .8125rem; }
  .assistant-avatar { width: 32px; height: 32px; }
  .switch-button { font-size: .625rem; }
  .switch-button svg { display: none; }
  .card-art { width: 114px; left: -10px; top: 29px; }
  .card-description { max-width: calc(100% - 68px); }
  .welcome-copy h1 { font-size: 1.45rem; }
}
@media (max-width: 540px) and (max-height: 700px) {
  .site-header { min-height: 64px; padding-block: 9px; }
  .site-footer { min-height: 90px; }
  .selection-content { padding-block: 8px; }
  .welcome-copy .eyebrow, .card-topline, .selection-reassurance { display: none; }
  .welcome-copy h1 { font-size: clamp(1.4rem, 6.9vw, 1.6rem); margin: 0 0 6px; }
  .welcome-description { font-size: .75rem; }
  .identity-grid { margin-top: 14px; gap: 10px; }
  .identity-card { min-height: clamp(142px, 23svh, 160px); padding-top: 8px; }
  .card-copy { padding-top: 5px; }
  .card-copy strong { font-size: 1.3rem; }
  .card-description { margin-bottom: 8px; }
  .card-art { top: 4px; height: 100px; }
  .card-bottom { min-height: 40px; }
  .landing-feedback:not(:empty) { margin-top: 8px; }
}
@media (max-height: 500px) {
  .site-header { min-height: 58px; padding-block: 7px; }
  .site-footer { min-height: 82px; }
  .empty-state { min-height: 0; padding-block: 12px; }
  .welcome-avatar { display: none; }
  .composer-wrap { padding-block: 7px; }
}
/* Persisted perfume recommendations and native accessible product dialog. */
.perfume-message { align-self: flex-end; width: min(87%, 720px); }
.perfume-message .message-bubble { width: 100%; padding: 16px 20px 10px; }
.perfume-product { display: grid; grid-template-columns: 116px minmax(0, 1fr); grid-template-areas: "image info" "actions actions"; gap: 10px 18px; align-items: start; min-width: 0; }
.perfume-info { grid-area: info; min-width: 0; }
.perfume-name { unicode-bidi: plaintext; overflow-wrap: anywhere; line-height: 1.6; color: #f4ecff; }
.perfume-info .perfume-name { display: block; margin-bottom: 8px; font-size: .9375rem; }
.perfume-name-link { color: inherit; text-decoration: underline; text-decoration-color: var(--identity-border); text-underline-offset: 4px; }
.perfume-name-link:hover { text-decoration-color: currentColor; }
.perfume-name-link:focus-visible { outline: 2px solid var(--identity-focus); outline-offset: 3px; border-radius: 2px; }
.perfume-image, .perfume-hero-image, .note-image { position: relative; display: grid; place-items: center; overflow: hidden; background: #f8f6fc; color: #726080; border-radius: 14px; flex: none; }
.perfume-image { grid-area: image; width: 100%; aspect-ratio: 11 / 12; }
.perfume-image img, .perfume-hero-image img, .note-image img { width: 100%; height: 100%; object-fit: contain; position: absolute; inset: 0; }
.image-fallback { font-size: 32px; }
.perfume-info .perfume-copy { min-width: 0; white-space: pre-line; line-height: 1.8; margin: 0; font-size: .84375rem; font-weight: 400; }
.perfume-actions { grid-area: actions; display: flex; justify-content: flex-end; border-top: 1px solid #ffffff14; padding-top: 2px; }
.perfume-details-button { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; border: 0; background: none; color: var(--identity-accent); border-radius: 4px; padding: 3px 0; font: inherit; font-size: .6875rem; line-height: 1.7; text-align: left; text-underline-offset: 4px; cursor: pointer; }
.perfume-details-arrow { font: 14px/1 sans-serif; }
.perfume-details-button:hover { text-decoration: underline; }
.perfume-details-button:focus-visible { outline: 2px solid var(--identity-focus); outline-offset: 2px; }
@media (max-width: 767px) {
  .perfume-message .message-bubble { padding: 12px 16px 8px; }
  .perfume-product { grid-template-columns: 66px minmax(0, 1fr); grid-template-areas: "image name" "copy copy" "actions actions"; gap: 8px 14px; align-items: center; }
  .perfume-info { display: contents; }
  .perfume-info .perfume-name { grid-area: name; margin: 0; font-size: .875rem; }
  .perfume-info .perfume-copy { grid-area: copy; font-size: .8125rem; }
}
/* .recommendation-loading .message-bubble { border-color: #b48bc5; } */
.recommendation-loading .message-bubble::after { content: ' ···'; display: inline-block; animation: recommendation-pulse 1.3s ease-in-out infinite; }
@keyframes recommendation-pulse { 50% { opacity: .3; } }
.product-modal-open { overflow: hidden; }
.product-modal { box-sizing: border-box; width: min(700px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 18px 22px 22px; color: #eee8f5; background: linear-gradient(145deg, #2b2339, #211c2d); border: 1px solid #8a6ba3; border-radius: 22px; box-shadow: 0 24px 100px #0009; overflow-y: auto; overflow-x: hidden; font-family: inherit; }
.product-modal::backdrop { background: #0d0c1ac9; backdrop-filter: blur(7px); }
.product-modal-close { position: sticky; top: 0; z-index: 2; width: 38px; height: 38px; border-radius: 50%; background: #493b57; color: white; border: 1px solid #b79dca; font-size: 25px; cursor: pointer; }
.product-modal-hero { text-align: center; padding-bottom: 16px; }
.perfume-hero-image { width: 112px; height: 148px; margin: 0 auto 12px; }
.product-modal-hero p { margin: 6px 0; color: #d2c3de; overflow-wrap: anywhere; }
.product-detail-section { padding: 15px 0; border-top: 1px solid #ffffff18; }
.product-detail-section h3 { margin: 0 0 11px; font-size: .98rem; color: #edcdff; }
.product-detail-section p, .product-detail-section li { line-height: 1.9; overflow-wrap: anywhere; }
.product-detail-section ul { padding-inline-start: 16px; margin: 0; list-style-position: inside; }
.product-source-note { display: block; margin-top: 8px; color: #c5b6cf; font-size: .78rem; line-height: 1.7; }
.accord-list { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; }
.accord-row { display: grid; flex: 0 0 88px; grid-template-columns: 1fr; gap: 6px; margin: 0; }
.accord-label { font-size: .8rem; overflow-wrap: anywhere; }
.accord-track { height: 9px; border-radius: 8px; background: #ffffff15; overflow: hidden; direction: ltr; }
.accord-fill { height: 100%; background: #b496d2; border-radius: inherit; transition: width .3s ease; }
.accord-value { color: #d8c7e4; font-size: .72rem; text-align: left; direction: ltr; }
.note-pyramid { display: flex; justify-content: center; flex-wrap: wrap; gap: 9px; }
.note-item { display: grid; justify-items: center; gap: 4px; width: 72px; text-align: center; font-size: .76rem; overflow-wrap: anywhere; }
.note-image { width: 38px; height: 38px; border-radius: 50%; }
.product-overview-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 18px; }
.product-overview-section { min-width: 0; }
.product-overview-section h3, .product-tag-section h3 { margin-bottom: 9px; }
.product-stat-grid { display: grid; gap: 8px; }
.product-stat-section, .product-tag-section { padding-bottom: 12px; }
.product-stat-section h3, .product-tag-section h3 { margin-bottom: 9px; }
.product-stat-card { display: grid; grid-template-columns: minmax(92px, 1fr) minmax(70px, 1.2fr); align-items: center; gap: 12px; padding: 11px 12px; }
.product-stat-copy { display: grid; gap: 2px; min-width: 0; }
.product-stat-title { color: #cdbbd7; font-size: .76rem; }
.product-stat-value { color: #f5eaff; font-size: 1.02rem; direction: rtl; }
.product-stat-label { color: #bfaecb; font-size: .76rem; }
.product-stat-track { flex: 1; height: 9px; border-radius: 99px; background: #ffffff12; overflow: hidden; direction: ltr; }
.product-stat-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #9c77b6, #e0b5d2); }
.product-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.product-tag { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border: 1px solid #c8a6d955; border-radius: 999px; background: #c8a6d914; color: #f2e6f7; }
.product-tag-name { font-size: .84rem; }
.product-tag-share { color: #c9b5d5; font-size: .72rem; direction: ltr; }
.scent-path-section { padding-bottom: 0; }
.scent-path-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.scent-path-stage { min-width: 0; padding: 10px 8px; border: 1px solid #ffffff14; border-radius: 14px; background: #ffffff06; }
.scent-path-stage h4 { margin: 0 0 9px; color: #d9c5e4; font-size: .82rem; font-weight: 600; text-align: center; }
@media (max-width: 540px) { .perfume-message { width: 94%; } .product-modal { padding: 12px 14px 16px; border-radius: 18px; } .product-overview-grid, .scent-path-grid { grid-template-columns: 1fr; gap: 0; } .product-stat-card { grid-template-columns: minmax(92px, 1fr) minmax(80px, 1.2fr); gap: 10px; padding: 10px; } }
@media (prefers-reduced-motion: reduce) { .recommendation-loading .message-bubble::after { animation: none; } }

/* True dark base: identity accents stay colored, surfaces stay near-black. */
:root {
  --canvas: #070a09;
  --surface: #0f1411;
  --ink: #edf5ef;
  --muted: #aebdb2;
  --quiet: #829589;
  --line: #c5dfcc1c;
}
body { background: var(--canvas); }
.atmosphere {
  background: radial-gradient(ellipse at 80% 20%, #183b2a22, transparent 65%),
              radial-gradient(ellipse at 15% 65%, #102b2020, transparent 60%);
}
.chat-shell { background: #0c110e; box-shadow: 0 16px 50px #00000080; }
.message-bubble { background: #141a16; border-color: #ffffff0d; }
.user .message-bubble { background: var(--identity-message-bg); }
.mode-notice { color: #cbdacf; }
.suggestions button { background: #ffffff04; color: #d5e4d8; }
.scroll-controls { background: #0a100d; }
.composer { background: #101713; border-color: #79b88c40; }
.composer textarea::placeholder { color: #9eb6a4; }
.confirm-dialog { background: #101713; }
.product-modal { background: linear-gradient(145deg, #151d18, #0b100d); border-color: #83a98c55; }
.product-modal-close { background: #19261e; border-color: #8db99a80; }
