/* Embedded Vazirmatn fonts. See Vazirmatn-OFL.txt. */
@font-face {
  font-family: Vazirmatn;
  src: url("/assets/vazirmatn-0.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Vazirmatn;
  src: url("/assets/vazirmatn-1.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  font-family: Vazirmatn, Tahoma, sans-serif;
  color: var(--ink);
  background: var(--page);
  color-scheme: light;
  --page: #f3fafb;
  --surface: #ffffff;
  --rail: #e8f5f6;
  --ink: #15333c;
  --muted: #496773;
  --accent: #007681;
  --wash: #d9f2f2;
  --line: #cae3e7;
  --note: #805018;
  --shadow: #09485413;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #101d25;
  --surface: #182a35;
  --rail: #13232d;
  --ink: #eaf8fb;
  --muted: #adc6ce;
  --accent: #68e1e5;
  --wash: #203e49;
  --line: #345362;
  --note: #efb975;
  --shadow: #0004;
}
* { box-sizing: border-box; }
body { margin: 0; height: 100dvh; overflow: hidden; display: grid; grid-template-columns: 242px minmax(0, 1fr); }
body.has-detail { grid-template-columns: 220px minmax(0, 1fr) clamp(320px, 36vw, 580px); }
[hidden] { display: none !important; }
button, textarea { font: inherit; color: inherit; }
button:not(:disabled) { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#rail { background: var(--rail); padding: 24px 15px; border-inline-end: 1px solid var(--line); overflow: auto; }
.rail-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 24px; }
.rail-brand span, .spark { color: var(--accent); background: var(--wash); border-radius: 14px; font-size: 25px; line-height: 1; padding: 8px; }
#new, .suggestions button, .listing-open { border: 1px solid var(--line); background: var(--surface); padding: 9px 14px; border-radius: 12px; text-align: start; }
#new { width: 100%; }
#history { display: grid; gap: 5px; margin-top: 15px; }
#history button { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: start; border: 0; border-radius: 10px; padding: 9px; background: transparent; }
#history button[aria-current="true"], #history button:hover, .listing-open:hover, #new:hover { background: var(--wash); }
main { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
header { display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 10px 22px; border-bottom: 1px solid var(--line); }
header strong { letter-spacing: -.035em; font-size: 19px; }
#theme, #menu { background: var(--surface); border: 1px solid var(--line); width: 40px; height: 40px; border-radius: 12px; font-size: 22px; }
#theme { margin-inline-start: auto; }
#menu, #veil { display: none; }
#timeline { overflow: auto; overscroll-behavior: contain; position: relative; padding: 0 clamp(12px, 3vw, 28px); }
#welcome, #messages, .composer-area { width: min(800px, 100%); margin-inline: auto; }
#welcome { text-align: center; padding-block: clamp(38px, 14vh, 130px) 30px; }
.spark { width: 64px; height: 64px; display: grid; place-items: center; margin: 0 auto 16px; font-size: 38px; border-radius: 22px; }
h1 { margin: 0; font-size: clamp(25px, 4vw, 43px); }
#welcome p, .file-meta, .file small, .detail-metrics small { color: var(--muted); }
.suggestions, .chips { display: flex; flex-wrap: wrap; gap: 7px; }
.suggestions { justify-content: center; margin-top: 22px; }
#messages { display: grid; gap: 24px; padding-block: 22px; }
.message { line-height: 1.85; overflow-wrap: anywhere; min-width: 0; }
.user { justify-self: start; max-width: 85%; background: var(--wash); border-radius: 17px 17px 5px 17px; padding: 9px 15px; white-space: pre-wrap; }
.assistant { display: grid; grid-template-columns: 25px minmax(0, 1fr); gap: 10px; }
.assistant::before { content: "✦"; color: var(--accent); background: var(--wash); border-radius: 8px; text-align: center; height: 27px; }
.thinking { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.thinking-dot { height: 8px; width: 8px; border-radius: 50%; background: var(--accent); }
.files { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(245px, 100%), 1fr)); gap: 12px; margin-block: 13px 18px; align-items: start; }
.file { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); box-shadow: 0 6px 22px var(--shadow); }
.listing-photo { display: block; width: 100%; aspect-ratio: 1.8; object-fit: cover; background: var(--wash); }
.file-body { padding: 12px 14px; display: grid; gap: 7px; }
.file h3, .file p, .advice p, .comparison p { margin: 0; }
.file h3 { line-height: 1.55; font-size: 16px; }
.file-meta, .chips, .file small { font-size: 12px; }
.chips span { padding: 3px 9px; background: var(--wash); border-radius: 8px; }
.file-price { font-weight: 700; color: var(--accent); }
.file .file-difference { color: var(--note); }
.file .listing-open { justify-self: start; }
.advice, .comparison { padding: 12px 15px; margin-block: 12px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.advice h3, .comparison h3 { margin: 0 0 7px; font-size: 15px; color: var(--accent); }
.follow-up { font-weight: 700; }
.advice button { margin-top: 9px; }
.composer-area { padding: 8px 14px max(12px, env(safe-area-inset-bottom)); }
#composer { display: flex; align-items: flex-end; gap: 8px; border: 1px solid var(--line); border-radius: 22px; padding: 8px; background: var(--surface); box-shadow: 0 7px 25px var(--shadow); }
#composer:focus-within { border-color: var(--accent); }
textarea { border: 0; resize: none; flex: 1; min-width: 0; background: transparent; padding: 8px; font-size: 16px; line-height: 1.5; outline: none; }
#send, #voice { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px; padding: 0; border: 0; border-radius: 13px; }
#send, .contact-button { background: var(--accent); color: var(--page); font-weight: 700; }
#send { font-size: 24px; }
#send:disabled, #voice { background: var(--wash); color: var(--muted); }
#voice.recording { background: var(--accent); color: var(--page); }
#voice-status { margin: 5px 10px 0; color: var(--muted); font-size: 13px; }
.listing-panel { min-height: 0; overflow: auto; overscroll-behavior: contain; background: var(--surface); border-inline-start: 1px solid var(--line); }
.panel-header { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.listing-detail { display: grid; gap: 15px; padding: 17px; overflow-wrap: anywhere; }
.listing-detail h2, .listing-detail h3, .listing-detail p { margin: 0; }
.listing-detail section { display: grid; gap: 6px; }
.listing-description { white-space: pre-wrap; line-height: 1.9; }
.listing-gallery { display: flex; gap: 8px; overflow: auto; scroll-snap-type: x mandatory; }
.media-tile { flex: 0 0 75%; aspect-ratio: 1.6; padding: 0; overflow: hidden; border: 0; border-radius: 13px; background: var(--wash); color: var(--accent); scroll-snap-align: start; }
.media-tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.detail-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 7px; }
.detail-metrics div { border-radius: 13px; background: var(--wash); padding: 10px; display: grid; }
.contact-button { display: block; padding: 12px 16px; border: 0; border-radius: 14px; text-align: center; text-decoration: none; }
.contact-button:disabled { opacity: .65; }
.lightbox { width: 100%; max-width: 100%; height: 100%; max-height: 100%; border: 0; background: #0c1922; color: white; }
.lightbox .listing-open { color: var(--ink); }
.media-stage { height: calc(100% - 55px); display: grid; place-items: center; }
.media-stage img, .media-stage video { max-width: 100%; max-height: 100%; }
@media (max-width: 880px) {
  body, body.has-detail { display: block; }
  main { height: 100dvh; }
  #menu, #veil:not([hidden]) { display: block; }
  #veil { position: fixed; inset: 0; z-index: 3; border: 0; background: #081c2a8a; }
  #rail { position: fixed; z-index: 4; inset: 0 0 0 auto; width: min(295px, 84vw); translate: 100% 0; visibility: hidden; }
  #rail.open { translate: 0 0; visibility: visible; }
  .listing-panel { position: fixed; inset: 0; z-index: 5; }
}
@media (prefers-reduced-motion: no-preference) {
  button, .contact-button { transition: background-color .18s ease, transform .18s ease; }
  .contact-button:not(:disabled):active { transform: scale(.97); }
  #rail { transition: translate .26s cubic-bezier(.2,.75,.25,1), visibility .26s; }
  .listing-panel { animation: panel-in .27s cubic-bezier(.2,.75,.25,1); }
  .listing-detail > *, .message:last-child { animation: rise-in .24s ease both; }
  .thinking-dot, #voice.recording { animation: breathe 1.15s ease-in-out infinite; }
}
@keyframes panel-in { from { opacity: .4; transform: translateX(-24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes breathe { 50% { opacity: .45; } }

/* Keep translucent surfaces on controls; reading surfaces use a solid fill. */
:root {
  --page: #edf3f8;
  --surface: #fcfdff;
  --rail: #f4f7fa;
  --ink: #192b3b;
  --muted: #516275;
  --accent: #176697;
  --wash: #e0edf7;
  --line: #d3dfe9;
  --glass: #fafdffc9;
  --glass-edge: #ffffffd9;
  --glass-border: #9bb2c36e;
  --control-ink: #fff;
}
:root[data-theme="dark"] {
  --page: #111b27;
  --surface: #182635;
  --rail: #15212e;
  --ink: #edf4fb;
  --muted: #b2c1d0;
  --accent: #83c6f1;
  --wash: #22394d;
  --line: #304353;
  --glass: #223241ce;
  --glass-edge: #b8d6f02c;
  --glass-border: #b8d6f042;
  --control-ink: #112434;
}
body.has-detail { grid-template-columns: 206px minmax(0, 1fr) clamp(288px, 27vw, 390px); }
#rail, .listing-panel { background: var(--rail); }
.panel-header { background: var(--surface); }
header { border-bottom-color: var(--line); }
.composer-action { display: grid; align-self: center; margin-inline-start: 2px; }
#send, #voice, #theme, #menu { border-radius: 50%; }
#theme, #menu { display: grid; place-items: center; }
#menu { display: none; }
#theme, #menu, #composer, #voice-cancel {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px var(--glass-edge);
}
#theme, #menu, #composer {
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
}
#timeline { padding-bottom: 18px; }
.composer-area {
  position: relative;
  z-index: 1;
  margin-block-start: -18px;
  pointer-events: none;
}
#composer, #voice-status { pointer-events: auto; }
#composer:focus-within { border-color: var(--glass-border); }
.file, .user, .comparison { box-shadow: none; }
#send, .contact-button { background: var(--accent); color: var(--control-ink); }
#send:disabled { background: var(--wash); color: var(--muted); }
#new, .suggestions button, .listing-open, .chips span, .contact-button { border-radius: 999px; }
.file, .comparison, .user, #composer { border-radius: 26px; }
.detail-metrics div, .media-tile { border-radius: 18px; }
.rail-brand span, .spark { border-radius: 50%; }
.answer-continuation { margin: 14px 0 9px; }
textarea:focus-visible { outline: none; }
.thinking { opacity: .86; }
.listing-detail { gap: 12px; }
.listing-detail > * { animation: none; }
@media (max-width: 880px) {
  body.has-detail { display: block; }
  #menu { display: grid; }
  #rail { width: min(244px, 79vw); }
}
@media (prefers-reduced-motion: no-preference) {
  .listing-panel { animation-duration: .16s; }
  #rail { transition-duration: .18s; }
}

#voice-capture { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding-inline: 7px 2px; }
#voice-phase { color: var(--muted); font-size: .84rem; }
#voice-cancel { margin-inline-start: auto; border: 1px solid var(--glass-edge); border-radius: 50%; width: 34px; height: 34px; flex: 0 0 34px; background: var(--glass); font-size: 23px; line-height: 1; }
#composer:has(#voice-capture:not([hidden])) #voice { background: var(--accent); color: var(--page); }
#composer:has(#voice-capture:not([hidden])) #voice:disabled { opacity: .55; }
.voice-wave { display: flex; align-items: center; justify-content: center; gap: 3px; height: 32px; color: var(--accent); }
.voice-wave i { width: 3px; height: var(--bar, 16px); border-radius: 99px; background: currentColor; transform: scaleY(.45); }
.voice-wave i:nth-child(2n) { --bar: 24px; }
.voice-wave i:nth-child(3n) { --bar: 30px; }
@media (prefers-reduced-motion: no-preference) {
  #voice-capture[data-phase="listening"] i { animation: voice-wave .85s ease-in-out infinite alternate; }
  .voice-wave i:nth-child(2n) { animation-delay: -.53s !important; }
  .voice-wave i:nth-child(3n) { animation-delay: -.28s !important; }
  .voice-wave i:nth-child(5) { animation-delay: -.71s !important; }
}
@keyframes voice-wave { to { transform: scaleY(1); } }

#chat-model {
  font: inherit;
  font-size: .82rem;
  color: var(--ink);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 99px;
  padding: 5px 9px;
}
.answer-model { display: block; width: fit-content; color: var(--muted); direction: ltr; font-size: .72rem; }

#theme, #new, .file .listing-open {
  background: var(--accent);
  color: var(--control-ink);
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}
#theme { width: 40px; height: 40px; border-radius: 50%; }
#new { text-align: center; }
#theme:hover, #new:hover, .file .listing-open:hover { background: var(--accent); filter: brightness(.92); }

#voice, #send, #composer:has(#voice-capture:not([hidden])) #voice {
  background: var(--accent);
  color: var(--control-ink);
  border: 0;
  box-shadow: none;
}
#voice:not(:disabled):hover, #send:not(:disabled):hover { filter: brightness(.92); }
#voice:disabled, #send:disabled { opacity: .58; }

.media-toolbar { display: flex; align-items: center; gap: 14px; height: 54px; padding-inline: 8px; }
.media-count { margin-inline-start: auto; font-size: 14px; direction: ltr; }
.media-stage { height: calc(100dvh - 100px); min-height: 0; padding: 10px 58px; overflow: hidden; }
.media-stage img, .media-stage video { display: block; width: auto; height: auto; object-fit: contain; max-width: 100%; max-height: calc(100dvh - 120px); }
.media-navigation { position: fixed; top: 50%; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid #ffffff40; border-radius: 50%; background: #152737b8; color: #fff; font-size: 25px; }
.media-previous { right: 15px; }
.media-next { left: 15px; }
.listing-detail > section { padding-block: 17px; border-bottom: 1px solid var(--line); }
.listing-detail h3 { font-size: 16px; margin-bottom: 8px; }
.amenity-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.amenity-grid span { padding: 10px 12px; background: var(--wash); border-radius: 13px; font-size: 13px; line-height: 1.75; overflow-wrap: anywhere; }
.source-specs { padding-block: 12px; border-bottom: 1px solid var(--line); }
.source-specs summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.detail-notice { color: var(--muted); font-size: 13px; }

/* Prepared property pages: edge-to-edge media, a single floating back control. */
.listing-panel { position: relative; overflow: hidden; }
.listing-detail { display: block; height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 0 0 24px; }
.listing-detail > :not(.listing-gallery):not(.detail-loading) { margin-inline: 18px; }
.listing-detail > .file-meta { margin-top: 18px; }
.listing-detail > h2 { margin-block: 8px 16px; }
.listing-detail > .detail-metrics { margin-bottom: 16px; }
.listing-detail > .contact-button { margin-top: 18px; }
.listing-detail:not(:has(.listing-gallery)):not(:has(.detail-loading)) { padding-top: 60px; }
.listing-gallery { gap: 3px; margin: 0; width: 100%; scrollbar-width: thin; }
.listing-gallery .media-tile { flex-basis: 100%; border-radius: 0; aspect-ratio: 1.3; }
.detail-back { position: absolute; z-index: 5; top: max(12px, env(safe-area-inset-top)); right: 12px; width: 43px; height: 43px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--accent); color: #fff; font-size: 25px; box-shadow: 0 3px 12px #082d4b22; }
.detail-back:active { transform: scale(.94); }
.detail-loading { min-height: 440px; padding: 100px 26px 40px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; color: var(--muted); }
.detail-loading h3 { color: var(--ink); font-size: 17px; }
.detail-loading p { font-size: 13px; line-height: 1.9; max-width: 290px; }
.loading-house { width: 70px; height: 70px; position: relative; margin: 8px auto; }
.loading-house i { position: absolute; width: 28px; height: 28px; background: var(--accent); border-radius: 10px; left: 5px; top: 27px; }
.loading-house i:nth-child(2) { left: 37px; opacity: .58; }
.loading-house i:nth-child(3) { left: 21px; top: 0; opacity: .82; transform: rotate(45deg); }
.detail-skeleton { width: 100%; display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; margin-top: 16px; }
.detail-skeleton span { height: 64px; border-radius: 18px; background: var(--wash); }
#boot { position: fixed; z-index: 99; inset: 0; background: var(--page); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: var(--muted); font-size: 14px; }
#boot .loading-house { margin-inline: 0; }
.results-carousel { min-width: 0; margin-block: 12px 18px; }
.files { grid-template-columns: none; grid-template-rows: repeat(2, auto); grid-auto-flow: column; grid-auto-columns: clamp(280px, 33vw, 330px); align-items: stretch; overflow-x: auto; overflow-y: hidden; max-width: 100%; padding: 4px 2px 14px; gap: 14px; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--accent) transparent; overscroll-behavior-inline: contain; margin: 0; }
.files .file { height: 100%; scroll-snap-align: start; box-shadow: none; display: flex; flex-direction: column; }
.files .file-body { flex: 1; display: flex; flex-direction: column; }
.files .listing-photo { aspect-ratio: auto; height: 158px; flex-shrink: 0; }
.file h3 { min-height: 48px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.file .listing-open { margin-top: auto; align-self: stretch; text-align: center; }
.file-price { min-height: 44px; }
.photo-empty { display: grid; place-items: center; font-size: 44px; color: var(--muted); background: var(--wash); }
.recommended { align-self: flex-start; border-radius: 20px; padding: 2px 10px; color: var(--accent); background: var(--wash); font-size: 11px; font-weight: 700; }
.selection-note { font-size: 12px; color: var(--muted); line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.carousel-tools { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; color: var(--muted); }
.carousel-tools small { margin-inline-end: auto; }
.carousel-tools button { width: 34px; height: 34px; border-radius: 50%; background: var(--wash); color: var(--accent); border: 0; font-size: 19px; }
.search-coverage { display: block; color: var(--muted); font-size: 11px; line-height: 1.8; padding-block: 5px; }
.worker-notice { font-size: 12px; line-height: 1.9; color: var(--muted); }
@media (max-width: 880px) { .listing-panel { position: fixed; } .files { grid-auto-columns: min(310px, 82vw); gap: 12px; } }
@media (prefers-reduced-motion: no-preference) {
  .loading-house i { animation: house-hop 1.45s cubic-bezier(.5,0,.3,1) infinite; }
  .loading-house i:nth-child(2) { animation-delay: .16s; }
  .loading-house i:nth-child(3) { animation-name: roof-hop; animation-delay: .3s; }
  .detail-skeleton span { animation: skeleton-breathe 1.8s ease-in-out infinite alternate; }
  .detail-skeleton span:nth-child(even) { animation-delay: .25s; }
  @keyframes house-hop { 0%,70%,100% { transform: translateY(0) rotate(0); } 35% { transform: translateY(-10px) rotate(-10deg); border-radius: 50%; } }
  @keyframes roof-hop { 0%,70%,100% { transform: translateY(0) rotate(45deg); } 35% { transform: translateY(-10px) rotate(135deg); } }
  @keyframes skeleton-breathe { from { opacity: .45; } to { opacity: 1; } }
}
@media (max-width: 600px) {
  .media-stage { padding-inline: 0; }
  .media-toolbar { gap: 8px; font-size: 12px; }
  .media-navigation { top: auto; bottom: 22px; }
}

.alternative-tag { display:inline-flex; width:fit-content; border-radius:12px; padding:4px 9px; background:var(--chip); color:var(--accent); font-size:11px; }
.alternative-note { font-size:12px; color:var(--muted); line-height:1.8; }
.alternative-tag.price { color:#985910; }

/* Cards use the available conversation width; prose retains a readable measure. */
#messages { width: 100%; max-width: none; }
.assistant { display: block; position: relative; }
.assistant::before { position: absolute; width: 25px; inset-inline-start: max(0px, calc((100% - 800px) / 2)); top: 0; }
.assistant > div { min-width: 0; }
.assistant > div > :not(.results-carousel) { max-width: 800px; margin-inline: auto; }
.assistant .answer-model, .assistant .answer-summary, .assistant .thinking { padding-inline-start: 35px; }
.message.user { margin-inline-start: max(0px, calc((100% - 800px) / 2)); max-width: min(680px, 85%); }
.results-carousel { width: 100%; max-width: none; }
.files { --fade-left: 0px; --fade-right: 0px; padding-inline: 4px; scroll-padding-inline: 4px; }
.files.fade-left { --fade-left: 30px; }
.files.fade-right { --fade-right: 30px; }
.files { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-left), #000 calc(100% - var(--fade-right)), transparent 100%); mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-left), #000 calc(100% - var(--fade-right)), transparent 100%); }
@media (max-width: 880px) { .files.fade-left { --fade-left: 20px; } .files.fade-right { --fade-right: 20px; } }

/* Saraa signature and quiet, transparent controls. */
header { background: color-mix(in srgb, var(--surface) 85%, #68b8df 15%); }
.brand-signature { width:76px;height:42px;position:relative;overflow:hidden;display:block; }
.brand-signature img { position:absolute;width:250px;height:auto;max-width:none;left:-87px;top:-22px; }
.app-mark { width:34px;height:34px;border-radius:11px;object-fit:cover; }
.detail-back { color:#236e97;background:rgba(224,243,255,.68);border:1px solid rgba(255,255,255,.65);backdrop-filter:blur(18px) saturate(130%);-webkit-backdrop-filter:blur(18px) saturate(130%);box-shadow:0 2px 8px #12374a12;outline:none; }
.detail-back svg { display:block; }
.detail-back:focus-visible { outline:2px solid var(--accent);outline-offset:3px; }
.listing-panel.closing { pointer-events:none;animation:drawer-out .22s cubic-bezier(.4,0,1,1) both; }
@keyframes drawer-out { to { opacity:0;transform:translateX(-30px); } }
.detail-partial { color:var(--muted);font-size:14px; }
.thinking, .detail-loading:not(:has(button)) h3 { display:block;width:fit-content;color:var(--muted);background:linear-gradient(100deg,var(--muted) 25%,var(--ink) 45%,var(--muted) 65%);background-size:240% 100%;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation:text-pass 2.2s linear infinite; }
@keyframes text-pass { from { background-position:0% 50%; } to { background-position:240% 50%; } }
[data-theme="dark"] .brand-signature { filter:brightness(1.9) saturate(.7); }
[data-theme="dark"] .detail-back { background:rgba(31,65,86,.7);color:#c5e9ff;border-color:#bce6ff33; }
@media(prefers-reduced-motion:reduce) { .thinking,.detail-loading h3,.listing-panel.closing { animation:none; } }

/* Refined header: asymmetric spacing follows the conversation direction. */
header { padding-inline: 30px 22px; background:color-mix(in srgb,var(--surface) 78%,#9fd6ee 22%); }
.brand-signature { width:100px; height:46px; margin-inline:8px auto; overflow:visible; }
.brand-signature img { position:static; display:block; width:100%; height:100%; max-width:100%; object-fit:contain; }
.rail-brand { gap:12px; }
.app-mark { object-fit:contain; border-radius:0; }
.detail-back { top:18px; right:18px; width:44px; height:44px; padding:0; background:rgba(119,196,242,.3); border-color:rgba(255,255,255,.7); box-shadow:inset 0 1px 0 #ffffff99,0 5px 20px #155b8115; }
.detail-back svg { width:22px;height:22px; margin:0; }
.assistant > div > .answer-summary, .assistant > div > .thinking { max-width:820px; margin-inline:20px auto; padding-inline-start:0; }
.assistant::before { content:none; }
.assistant .answer-model { display:none; }
@media(max-width:600px) { header { padding-inline:18px; } .brand-signature { width:82px; } .assistant > div > .answer-summary,.assistant > div > .thinking { margin-inline:4px; } }
@media(prefers-reduced-motion:no-preference) {
 .listing-panel:not([hidden]):not(.closing) { animation:drawer-in .32s cubic-bezier(.16,1,.3,1) both; }
 .thinking { animation:text-pass 2s linear infinite,thinking-breathe 3s ease-in-out infinite; }
 @keyframes drawer-in { from { opacity:0;transform:translateX(-42px) scale(.985); } to { opacity:1;transform:none; } }
 @keyframes thinking-breathe { 50% { opacity:.65; } }
}

/* Restore the original quiet header in both themes. */
header { background:var(--page); }
header .brand-name { margin-inline:0 auto; font:700 21px/1.5 Vazirmatn,Tahoma,sans-serif; letter-spacing:0; color:var(--ink); }

/* Original Saraa signature, sized to its visible lettering. */
.brand-signature { width:86px;height:50px;position:relative;overflow:hidden;margin-inline:0 auto;flex:none; }
.brand-signature img { position:absolute;display:block;width:278px;height:auto;max-width:none;left:-97px;top:-25px;object-fit:initial; }
@media(max-width:600px) {
 .brand-signature { width:72px;height:42px; }
 .brand-signature img { width:234px;left:-82px;top:-21px; }
}

/* Account control remains at the foot of the right-hand conversation rail. */
#rail { display:flex;flex-direction:column;overflow:hidden; }
#history { flex:1;min-height:0;overflow-y:auto;align-content:start;padding-bottom:16px; }
.account-footer { margin-top:auto;padding-top:14px;border-top:1px solid var(--line);display:grid;gap:9px;flex-shrink:0;text-align:right; }
.account-open { width:100%;padding:12px 15px;text-align:right;border:1px solid var(--line);border-radius:15px;background:var(--wash);font-weight:700; }
.account-footer small { color:var(--muted);font-size:11px;line-height:1.8;padding-inline:4px; }
.account-dialog { width:min(440px,calc(100vw - 28px));max-height:calc(100dvh - 36px);padding:0;overflow-y:auto;border:1px solid var(--line);border-radius:24px;background:var(--surface);color:var(--ink);box-shadow:0 24px 100px #0005; }
.account-dialog::backdrop { background:#07152488;backdrop-filter:blur(7px); }
.account-sheet { padding:28px;position:relative;text-align:right; }
.account-sheet h2 { font-size:23px;margin:8px 0 22px; }
.account-sheet h3 { font-size:16px;margin-top:25px; }
.account-close { position:absolute;left:17px;top:16px;width:32px;height:32px;border:0;border-radius:50%;background:var(--wash);font-size:23px;line-height:1; }
.account-tabs { display:flex;background:var(--wash);padding:4px;border-radius:13px;margin-bottom:22px;gap:4px; }
.account-tabs button { flex:1;border:0;background:transparent;border-radius:10px;padding:9px; }
.account-tabs button[aria-pressed=true] { background:var(--surface);box-shadow:0 2px 8px #0001; }
.account-form { display:grid;gap:10px; }
.account-form label { font-size:13px;font-weight:700; }
.account-form input { width:100%;font:inherit;background:var(--page);color:var(--ink);border:1px solid var(--line);border-radius:12px;padding:12px 14px; }
.account-form small { font-size:11px;color:var(--muted);margin-bottom:8px; }
.account-submit { border:0;border-radius:13px;background:var(--accent);color:var(--surface);font-weight:700;padding:13px;margin-top:8px; }
[data-theme=dark] .account-submit { color:var(--page); }
.account-notice { color:var(--muted);font-size:12px;line-height:1.9; }
.account-status { color:var(--note);font-size:13px;line-height:1.8;margin:10px 0 0; }
.account-secondary { display:block;width:100%;border:1px solid var(--line);border-radius:12px;background:var(--page);padding:11px;margin-top:12px;text-align:right; }
.account-preferences { display:grid;gap:9px;font-size:13px;line-height:1.8; }
.account-preferences > div { display:flex;align-items:center;justify-content:space-between;gap:14px;border:1px solid var(--line);border-radius:11px;padding:9px 12px; }
.account-preferences small { color:var(--muted); }
@media(prefers-reduced-motion:no-preference) { .account-dialog[open] { animation:rise-in .2s ease both; } }
