:root {
  --ink: #24254f;
  --ink-soft: #50527a;
  --muted: #8c8dac;
  --line: #e5e7f5;
  --page: #e9eafe;
  --panel: rgba(255, 255, 255, .92);
  --lavender: #625cf0;
  --lavender-dark: #4d48ce;
  --lavender-soft: #ececff;
  --danger: #b42318;
  --screen-gutter: 16px;
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background: var(--page);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-height: 100vh; margin: 0; background: #e6e7fa; }
button, textarea, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .66; }
button img, .brand-mark img, .quick-question-list img { display: block; width: 100%; height: 100%; }
h1, h2, h3, p, figure { margin: 0; }
h1 { font-size: 20px; line-height: 1.3; font-weight: 700; }
h2 { font-size: 20px; line-height: 1.35; font-weight: 700; }
h3 { font-size: 15px; line-height: 1.45; }

.app-shell { width: min(430px, 100%); max-width: 100%; min-height: 100dvh; margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) var(--screen-gutter) calc(42px + env(safe-area-inset-bottom)); overflow: hidden; background: var(--page); }
.service-header { position: relative; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; }
.brand-lockup { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand-mark { display: block; width: 48px; height: 48px; flex: 0 0 auto; overflow: hidden; border: 0; border-radius: 16px; box-shadow: none; }
.brand-mark img { border-radius: inherit; object-fit: cover; transform: scale(1.16); }
.brand-subtitle, .eyebrow { display: none; }
.header-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.support-button { display: inline-flex; min-height: 44px; align-items: center; gap: 6px; border: 1px solid rgba(255, 255, 255, .92); border-radius: 24px; padding: 0 15px; background: rgba(255, 255, 255, .88); color: #373869; box-shadow: 0 7px 18px rgba(93, 88, 205, .1); font-size: 13px; font-weight: 700; }
.support-button img { width: 18px; height: 18px; filter: invert(28%) sepia(52%) saturate(1052%) hue-rotate(217deg) brightness(95%) contrast(92%); }
.support-button:hover, .support-button:focus-visible { color: var(--lavender-dark); outline: 2px solid #bcb9ff; outline-offset: 2px; }
.icon-button { display: none; }
.new-consultation { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.new-consultation img { width: 18px; height: 18px; }

.welcome-hero { position: relative; z-index: 1; min-height: 274px; margin: -34px calc(-1 * var(--screen-gutter)) -28px; overflow: hidden; background: var(--page); }
.welcome-hero::after { content: ""; position: absolute; z-index: 0; right: -8px; bottom: 0; width: 56%; height: 142px; pointer-events: none; opacity: .3; background: linear-gradient(to top, rgba(146, 137, 239, .2) 0 40%, transparent 40%) 0 100% / 13% 100% no-repeat, linear-gradient(to top, rgba(146, 137, 239, .18) 0 64%, transparent 64%) 17% 100% / 13% 100% no-repeat, linear-gradient(to top, rgba(146, 137, 239, .16) 0 48%, transparent 48%) 34% 100% / 13% 100% no-repeat, linear-gradient(to top, rgba(146, 137, 239, .2) 0 84%, transparent 84%) 51% 100% / 13% 100% no-repeat, linear-gradient(to top, rgba(146, 137, 239, .18) 0 58%, transparent 58%) 68% 100% / 13% 100% no-repeat, linear-gradient(to top, rgba(146, 137, 239, .16) 0 36%, transparent 36%) 85% 100% / 13% 100% no-repeat; }
.welcome-hero-art { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: left bottom; transform: translateX(30px); }
.welcome-copy { position: relative; z-index: 2; width: 54%; margin-left: 46%; padding-top: 116px; color: #2e3078; }
.welcome-kicker { margin-bottom: 9px; color: #5c64eb; font-size: 20px; font-weight: 700; }
.welcome-copy h2 { font-size: 19px; line-height: 1.55; white-space: nowrap; }

.chat-panel { position: relative; z-index: 2; width: 100%; min-width: 0; max-width: 100%; padding: 0; }
.app-shell.is-conversation { display: flex; height: 100dvh; min-height: 0; flex-direction: column; }
.app-shell.is-conversation .welcome-hero,
.app-shell.is-conversation .quick-questions,
.app-shell.is-conversation .service-availability,
.app-shell.is-conversation .boundary { display: none; }
.app-shell.is-conversation #summaryPanel { display: none; }
.app-shell.is-conversation .chat-panel { display: flex; width: 100%; min-width: 0; max-width: 100%; min-height: 0; flex: 1; flex-direction: column; overflow: hidden; padding-top: 16px; }
.app-shell.is-conversation .chat-log { width: 100%; min-width: 0; max-width: 100%; min-height: 0; max-height: none; flex: 1; padding: 0 0 16px; overscroll-behavior: contain; }
.app-shell.is-conversation .composer { width: 100%; min-width: 0; max-width: 100%; flex: 0 0 auto; }
.app-shell.is-conversation .composer-shell { border-radius: 28px; padding: 10px; }
.app-shell.is-conversation .composer-heading { display: none; }
.app-shell.is-conversation .composer-input-wrap { margin-top: 0; }
.app-shell.is-conversation #messageInput { min-height: 58px; padding-top: 15px; }
.app-shell.is-conversation .composer-error { flex: 0 0 auto; margin: 5px 2px 0; }
.app-shell.is-conversation .composer-error:empty { display: none; }
.chat-log { display: flex; width: 100%; min-width: 0; max-width: 100%; min-height: 110px; max-height: 48vh; flex-direction: column; gap: 12px; overflow-y: auto; padding: 10px 0 18px; scroll-behavior: smooth; }
.chat-log.is-intro { display: none; }
.message-row { display: flex; width: 100%; min-width: 0; align-items: flex-start; gap: 11px; max-width: 100%; }
.assistant-avatar { display: block; width: 48px; height: 48px; flex: 0 0 auto; overflow: hidden; border: 2px solid rgba(255, 255, 255, .9); border-radius: 50%; background: #f4f3ff; box-shadow: 0 6px 14px rgba(79, 73, 182, .1); }
.assistant-avatar img { display: block; width: 100%; max-width: none; height: 100%; object-fit: cover; object-position: 50% 50%; }
.message { display: grid; min-width: 0; max-width: 90%; gap: 7px; border: 0; border-radius: 28px; padding: 17px 18px; }
.message-row .message { max-width: calc(100% - 59px); }
.message span { color: var(--lavender-dark); font-size: 12px; font-weight: 700; }
.message p { color: #303362; white-space: pre-line; font-size: 15px; line-height: 1.72; }
.message.assistant { align-self: flex-start; background: rgba(255, 255, 255, .92); }
.message.user { align-self: flex-end; max-width: calc(100% - 40px); background: #5c54f3; }
.message.user span { display: none; }
.message.user p { color: #fff; font-size: 16px; line-height: 1.7; }
.message-handoff { display: grid; gap: 8px; margin-top: 5px; border: 1px solid #d7d4ff; border-radius: 16px; padding: 13px; background: #f6f5ff; }
.resolution-plan-card { display: grid; gap: 8px; margin-top: 12px; border: 1px solid #d7d4ff; border-radius: 16px; padding: 13px; background: #fafaff; }
.resolution-plan-card p { color: #4a4b79; font-size: 13px; line-height: 1.6; }
.resolution-plan-card div { display: flex; flex-wrap: wrap; gap: 8px; }
.resolution-script { border-radius: 10px; padding: 10px; background: #f3f2ff; }
.message-handoff strong { color: #333377; font-size: 14px; line-height: 1.45; }
.message-handoff p { color: #5a5b82; font-size: 13px; line-height: 1.62; }
.message-handoff button { justify-self: start; min-height: 38px; border: 1px solid var(--lavender); border-radius: 10px; padding: 0 13px; background: var(--lavender); color: #fff; font-size: 13px; font-weight: 700; }
.message-handoff button:hover, .message-handoff button:focus-visible { background: var(--lavender-dark); outline: 0; }
#conversationHandoffEntry { gap:12px; }
#conversationHandoffEntry strong, #conversationHandoffEntry p { font-size:16px; line-height:1.7; }
#conversationHandoffEntry .handoff-actions { display:flex; flex-wrap:wrap; gap:8px; }
#conversationHandoffEntry button { min-height:44px; font-size:15px; font-weight:500; }
#conversationHandoffEntry button[data-conversation-handoff=other], #conversationHandoffEntry button[data-conversation-handoff=cancel], #conversationHandoffEntry button[data-conversation-handoff=back] { background:transparent; color:var(--lavender-dark); }

/* New consultation only asks when unsent content cannot be safely restored. */
.new-consultation-dialog { width:min(360px,calc(100% - 32px)); border:1px solid #e2ddfb; border-radius:24px; padding:22px; color:var(--ink); background:#fff; }
.new-consultation-dialog::backdrop { background:rgba(36,31,75,.24); }
.new-consultation-dialog h2 { margin:0 0 12px; font-size:20px; }
.new-consultation-dialog p { margin:0 0 20px; font-size:16px; line-height:1.6; }
.new-consultation-dialog .dialog-actions { display:flex; gap:10px; flex-wrap:wrap; }
.new-consultation-dialog button { min-height:44px; padding:10px 14px; border-radius:12px; font-size:15px; }
.markdown-body { display: grid; gap: 10px; color: #303362; }
.markdown-body > * { margin: 0; }
.markdown-body h2 { padding-bottom: 8px; border-bottom: 1px solid var(--line); color: #2f3174; font-size: 18px; line-height: 1.4; }
.markdown-body h3 { margin-top: 3px; color: var(--lavender-dark); font-size: 14px; }
.markdown-body h2 + h3 { margin-top: 0; }
.markdown-body p { color: #40436f; font-size: 15px; line-height: 1.78; }
.markdown-body .assistant-question { border-left: 3px solid var(--lavender); padding: 9px 11px; background: #f5f4ff; color: #303362; font-weight: 700; line-height: 1.7; }
.markdown-body strong { color: #2f3174; font-weight: 700; }
.markdown-body ol, .markdown-body ul { display: grid; gap: 7px; margin: 0; padding-left: 21px; color: #40436f; }
.markdown-body li { padding-left: 2px; font-size: 15px; line-height: 1.66; }
.markdown-body ol::marker, .markdown-body li::marker { color: var(--lavender); font-weight: 700; }

.composer { width: 100%; min-width: 0; max-width: 100%; margin: 0; }
.composer-shell { border: 1px solid rgba(255, 255, 255, .96); border-radius: 30px; padding: 25px 20px 17px; background: var(--panel); box-shadow: 0 16px 36px rgba(82, 79, 179, .11); }
.composer-heading { display: block; }
.composer-heading label { display: block; color: #2d2f60; font-size: 20px; line-height: 1.38; font-weight: 700; }
.composer-heading p { display: none; }
.voice-button img { width: 100%; height: 100%; filter: invert(37%) sepia(58%) saturate(1225%) hue-rotate(215deg) brightness(96%) contrast(91%); }
.voice-button:hover, .voice-button:focus-visible { border-color: var(--lavender); background: var(--lavender-soft); }
.composer-input-wrap { position: relative; margin-top: 16px; }
textarea { display: block; width: 100%; min-height: 138px; margin: 0; resize: none; border: 1px solid #e7e9f5; border-radius: 22px; outline: 0; padding: 15px 20px 58px 15px; background: #fdfdff; color: var(--ink); font-size: 15px; line-height: 1.68; }
#messageInput { height: 58px; min-height: 58px; max-height: 156px; overflow-y: hidden; padding: 15px 68px 15px 15px; }
textarea::placeholder { color: #a1a2be; opacity: 1; }
textarea:focus { border-color: #a7a3ff; box-shadow: 0 0 0 3px rgba(98, 92, 240, .12); }
.attachment-controls { display: flex; gap: 8px; margin-top: 10px; }
.attachment-button { display: inline-flex; min-height: 44px; align-items: center; gap: 5px; border: 1px solid #e2e1f2; border-radius: 9px; padding: 0 10px; background: #fafaff; color: #50517d; font-size: 12px; font-weight: 700; }
.attachment-button img { width: 15px; height: 15px; filter: invert(37%) sepia(58%) saturate(1225%) hue-rotate(215deg) brightness(96%) contrast(91%); }
.attachment-button:disabled { cursor: not-allowed; opacity: .55; }
.attachment-note { margin: 7px 2px 0; color: #8587a3; font-size: 11px; line-height: 1.45; }
.attachment-list { display: grid; gap: 8px; margin-top: 12px; }
.attachment-chip { display: grid; grid-template-columns: 34px minmax(0, 1fr) 44px; align-items: center; gap: 9px; border: 1px solid #e2e1f2; border-radius: 8px; padding: 7px 9px; background: #fafaff; }
.attachment-chip > img { width: 34px; height: 34px; border-radius: 4px; object-fit: cover; filter: invert(37%) sepia(58%) saturate(1225%) hue-rotate(215deg) brightness(96%) contrast(91%); }
.attachment-chip > img[src^="blob:"] { filter: none; }
.attachment-chip strong { display: block; overflow: hidden; color: var(--ink-soft); font-size: 12px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.attachment-chip p { margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.attachment-chip button { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; }
.send-button { position: absolute; right: 7px; bottom: 7px; display: grid; width: 44px; height: 44px; place-items: center; border: 1px solid rgba(255, 255, 255, .45); border-radius: 50%; padding: 12px; background: var(--lavender); box-shadow: 0 8px 18px rgba(98, 92, 240, .24); }
.send-button img { width: 100%; height: 100%; filter: brightness(0) invert(1); }
.send-button:hover, .send-button:focus-visible { background: var(--lavender-dark); }
.send-button.is-loading img { animation: gentle-turn 1s linear infinite; }
.composer-error, .dialog-error { min-height: 18px; margin: 8px 2px 0; color: var(--danger); font-size: 13px; line-height: 1.45; }

.notice-card.is-demo .consent-control { display: none; }
.service-availability { min-height: 18px; margin: 9px 5px 0; color: #8688a5; font-size: 12px; line-height: 1.5; }

.quick-questions { margin-top: 28px; }
.quick-questions-heading { display: grid; grid-template-columns: minmax(16px, 1fr) auto minmax(16px, 1fr); align-items: center; gap: 9px; }
.quick-questions-rule { height: 1px; background: #d7d8ec; }
.quick-questions-callout { display: inline-flex; min-height: 40px; align-items: center; gap: 8px; border: 1px solid rgba(255, 255, 255, .9); border-radius: 20px; padding: 5px 12px 5px 6px; background: rgba(255, 255, 255, .82); box-shadow: 0 7px 18px rgba(82, 79, 179, .08); }
.quick-questions-badge { display: inline-flex; min-height: 28px; align-items: center; gap: 4px; border-radius: 14px; padding: 0 8px; background: var(--lavender); color: #fff; font-size: 11px; font-weight: 700; white-space: nowrap; }
.quick-questions-badge img { width: 13px; height: 13px; filter: brightness(0) invert(1); }
.quick-questions-heading p { color: #4c4e87; font-size: 14px; line-height: 1.35; font-weight: 700; white-space: nowrap; }
.quick-question-list { display: grid; gap: 10px; margin-top: 13px; }
.quick-question-list button[data-quick-question-id] { display: grid; width: 100%; grid-template-columns: 38px 1fr 20px; align-items: center; gap: 12px; min-height: 66px; border: 1px solid rgba(255, 255, 255, .95); border-radius: 23px; padding: 0 16px; background: rgba(255, 255, 255, .92); box-shadow: 0 9px 22px rgba(82, 79, 179, .07); color: var(--ink); text-align: left; }
.quick-question-list button[data-quick-question-id] > img:first-child { width: 30px; height: 30px; border-radius: 50%; padding: 7px; background: #eef8e8; filter: invert(57%) sepia(28%) saturate(695%) hue-rotate(49deg) brightness(94%) contrast(81%); }
.quick-question-list button[data-quick-question-id]:nth-child(2) > img:first-child { background: #fff7de; filter: invert(71%) sepia(67%) saturate(453%) hue-rotate(357deg) brightness(96%) contrast(87%); }
.quick-question-list button[data-quick-question-id]:nth-child(3) > img:first-child { background: #eeecff; filter: invert(42%) sepia(94%) saturate(1284%) hue-rotate(224deg) brightness(98%) contrast(94%); }
.quick-question-list button[data-quick-question-id] span { font-size: 16px; line-height: 1.4; }
.quick-question-list button[data-quick-question-id] .chevron { width: 18px; height: 18px; filter: invert(67%) sepia(13%) saturate(775%) hue-rotate(204deg) brightness(89%) contrast(87%); }
.quick-question-list button[data-quick-question-id]:hover, .quick-question-list button[data-quick-question-id]:focus-visible { outline: 2px solid #c2c0ff; outline-offset: 2px; }
.quick-questions-more { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 8px; justify-self: center; border: 0; padding: 0 9px; background: transparent; color: #77799d; font-size: 13px; }
.quick-questions-more img { width: 15px; height: 15px; transform: rotate(90deg); filter: invert(46%) sepia(85%) saturate(1261%) hue-rotate(221deg) brightness(98%) contrast(92%); }
.quick-questions-more:hover, .quick-questions-more:focus-visible { color: var(--lavender-dark); text-decoration: underline; }

.summary-panel { margin-top: 24px; border: 1px solid rgba(255, 255, 255, .95); border-radius: 26px; padding: 18px; background: var(--panel); }
.section-heading, .dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.status-tag { border-radius: 8px; padding: 5px 8px; background: #f0f0f6; color: #676983; white-space: nowrap; font-size: 12px; font-weight: 700; }
.status-tag.attention { background: #fff0e9; color: #a14b2a; }
.summary-content { margin-top: 14px; }
.summary-section { border-top: 1px solid var(--line); padding: 14px 0; }
.summary-section:first-child { border-top: 0; padding-top: 0; }
.summary-section p, .summary-section li { font-size: 14px; line-height: 1.65; }
.summary-section ul { margin: 8px 0 0; padding-left: 20px; }
.summary-section li { margin: 5px 0; }
.emphasis { display: grid; gap: 10px; border: 1px solid #d9d7ff; border-radius: 8px; padding: 14px; background: #f7f7ff; }
.emphasis + .summary-section { border-top: 0; }
.primary { min-height: 38px; border: 1px solid var(--lavender); border-radius: 8px; padding: 0 14px; background: var(--lavender); color: #fff; font-weight: 700; }
.primary:hover { background: var(--lavender-dark); }
.secondary { min-height: 38px; border: 1px solid #b6b4ed; border-radius: 8px; padding: 0 14px; background: #fff; color: var(--lavender-dark); font-weight: 700; }
.secondary:hover, .secondary:focus-visible { border-color: var(--lavender); background: var(--lavender-soft); }
.handoff-trigger { justify-self: start; }
.fact-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.fact-list span { border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; background: #f8f8fc; color: #4f506d; font-size: 13px; }
.case-card { display: grid; gap: 5px; border: 1px solid var(--line); border-radius: 8px; margin-top: 9px; padding: 11px; background: #fbfbff; }
.case-card strong { font-size: 14px; }
.case-card p { color: var(--ink-soft); }
.case-card small, .model-note, .empty-copy { color: var(--muted); font-size: 13px; line-height: 1.6; }
.model-note { margin-top: 12px; }
.human-support .primary { margin-top: 10px; }
.human-support-copy, .direct-contact { margin-top: 9px; color: var(--ink-soft); font-size: 13px; line-height: 1.55; }
.direct-contact a { color: var(--lavender-dark); font-weight: 700; text-decoration: none; }
.boundary { padding: 18px 5px 0; color: var(--muted); font-size: 12px; line-height: 1.65; }

.handoff-dialog { width: min(480px, calc(100% - 24px)); border: 0; border-radius: 8px; padding: 0; color: var(--ink); box-shadow: 0 18px 52px rgba(46, 43, 106, .24); }
.handoff-dialog::backdrop { background: rgba(46, 43, 106, .35); }
.handoff-dialog form { display: grid; gap: 14px; padding: 20px; }
.handoff-dialog p { color: var(--ink-soft); font-size: 14px; line-height: 1.65; }
.contact-fields { display: grid; gap: 11px; }
.contact-fields label { display: grid; gap: 6px; font-size: 14px; font-weight: 700; }
.contact-fields input { min-height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; color: var(--ink); }
.handoff-dialog .primary { min-height: 42px; }
.handoff-guidance-dialog { width: min(400px, calc(100% - 32px)); border: 0; border-radius: 20px; padding: 0; color: var(--ink); box-shadow: 0 18px 52px rgba(46, 43, 106, .28); }
.handoff-guidance-dialog::backdrop { background: rgba(32, 31, 75, .48); }
.handoff-guidance-content { display: grid; gap: 14px; padding: 22px; }
.handoff-guidance-content > p { color: var(--ink-soft); font-size: 15px; line-height: 1.65; }
.handoff-guidance-note { border-radius: 12px; padding: 12px; background: #f5f4ff; color: #4a4b79 !important; font-size: 13px !important; }
.handoff-guidance-phone { font-size: 13px !important; }
.handoff-guidance-phone a { color: var(--lavender-dark); font-weight: 700; text-decoration: none; }
.consent-dialog { width: min(400px, calc(100% - 32px)); border: 0; border-radius: 20px; padding: 0; color: var(--ink); box-shadow: 0 18px 52px rgba(46, 43, 106, .28); }
.consent-dialog::backdrop { background: rgba(32, 31, 75, .48); }
.consent-dialog-content { display: grid; gap: 14px; padding: 22px; }
.consent-dialog-content > p { color: var(--ink-soft); font-size: 15px; line-height: 1.65; }
.consent-dialog-note { border-radius: 12px; padding: 12px; background: #f5f4ff; color: #4a4b79 !important; font-size: 13px !important; }
.dialog-close { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid var(--line); border-radius: 50%; padding: 0; background: #fff; color: var(--ink-soft); font-size: 22px; line-height: 1; }
.dialog-close:hover, .dialog-close:focus-visible { border-color: #b9b6ff; background: var(--lavender-soft); color: var(--lavender-dark); outline: 0; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1.25fr; gap: 10px; }
.dialog-actions button { min-height: 44px; }
.handoff-success-dialog { width: min(400px, calc(100% - 32px)); border: 0; border-radius: 20px; padding: 0; color: var(--ink); box-shadow: 0 18px 52px rgba(46, 43, 106, .28); }
.handoff-success-dialog::backdrop { background: rgba(32, 31, 75, .48); }
.handoff-success-content { display: grid; gap: 13px; padding: 24px 22px; }
.handoff-success-content > p { color: var(--ink-soft); font-size: 15px; line-height: 1.65; }
.handoff-success-ticket { border-radius: 12px; padding: 12px; background: #f2f1ff; color: var(--lavender-dark) !important; font-size: 16px !important; font-weight: 700; }
.handoff-success-content .primary { min-height: 44px; }

@keyframes gentle-turn { to { transform: rotate(360deg); } }

@media (min-width: 431px) {
  body { background: #e5e6f8; }
  .app-shell { min-height: calc(100vh - 40px); margin-top: 20px; margin-bottom: 20px; border: 1px solid rgba(255, 255, 255, .9); border-radius: 34px; box-shadow: 0 18px 46px rgba(58, 55, 130, .12); }
  .app-shell.is-conversation { height: calc(100vh - 40px); }
  .welcome-hero { margin-right: -16px; margin-left: -16px; }
}

@media (max-width: 420px) {
  :root { --screen-gutter: 14px; }
  .welcome-hero { min-height: 270px; }
  .welcome-hero-art { transform: translateX(25px); }
  .welcome-copy { width: 54%; margin-left: 47%; padding-top: 104px; }
  .welcome-copy h2 { font-size: 18px; }
  .composer-shell { border-radius: 28px; padding: 23px 16px 16px; }
  .composer-heading label { font-size: 19px; }
  .composer-heading p { font-size: 12px; }
  #messageInput { min-height: 58px; }
  .quick-questions-heading { gap: 6px; }
  .quick-questions-callout { gap: 6px; padding-right: 9px; }
  .quick-questions-heading p { font-size: 13px; }
  .quick-question-list button[data-quick-question-id] { grid-template-columns: 36px 1fr 18px; min-height: 60px; padding: 0 13px; }
  .quick-question-list button[data-quick-question-id] span { font-size: 15px; }
}

@media (max-width: 360px) {
  .brand-mark { width: 38px; height: 38px; }
  h1 { font-size: 18px; }
  .support-button { min-height: 36px; padding: 0 10px; font-size: 12px; }
  .welcome-hero-art { transform: translateX(20px); }
  .welcome-copy { width: 55%; margin-left: 46%; padding-top: 104px; }
  .welcome-copy h2 { font-size: 17px; }
  .quick-questions-badge { min-height: 26px; padding: 0 7px; font-size: 10px; }
  .quick-questions-heading p { font-size: 12px; }
  .voice-controls { gap: 8px; }
  .send-button { width: 45px; height: 45px; }
}

.voice-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; font-size: 13px; }
.voice-button { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 14px; background: white; color: var(--ink); }
.voice-button[data-voice-state="RECORDING"] { color: var(--danger); border-color: currentColor; }

/* One draft and one input bar on both the welcome and conversation screens. */
.composer-shell { position: relative; }
.composer-input-wrap { display: flex; align-items: flex-end; gap: 4px; min-height: 58px; border: 1px solid #deddf1; border-radius: 29px; padding: 5px; background: #fff; }
#messageInput, .app-shell.is-conversation #messageInput { width: 100%; min-width: 0; min-height: 46px; height: 46px; max-height: 156px; flex: 1 1 auto; border: 0; border-radius: 20px; padding: 10px 4px; background: transparent; line-height: 1.55; }
#messageInput:focus { border: 0; box-shadow: none; }
.composer-input-wrap:focus-within { border-color: #a7a3ff; box-shadow: 0 0 0 3px rgba(98, 92, 240, .12); }
.composer-icon { display: grid; width: 44px; min-width: 44px; height: 46px; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--lavender-dark); font-size: 27px; line-height: 1; }
.composer-icon img { width: 23px; height: 23px; filter: invert(37%) sepia(58%) saturate(1225%) hue-rotate(215deg) brightness(96%) contrast(91%); }
.composer-icon:focus-visible, .composer-icon:hover { outline: 2px solid #c1beff; background: #f2f1ff; }
.composer-input-wrap .send-button { position: static; width: 46px; min-width: 46px; height: 46px; flex: 0 0 auto; margin: 0; }
.press-to-talk { min-height: 46px; min-width: 0; flex: 1; border: 1px solid #d7d4ef; border-radius: 19px; background: #f7f6ff; color: #3b3b72; font-weight: 700; touch-action: none; user-select: none; }
.attachment-menu { position: absolute; z-index: 8; right: 8px; bottom: calc(100% - 5px); display: grid; gap: 5px; width: 174px; border: 1px solid #dfdcf4; border-radius: 17px; padding: 8px; background: #fff; box-shadow: 0 12px 26px rgba(55, 51, 138, .18); }
.attachment-menu button { min-height: 43px; border: 0; border-radius: 11px; background: #f7f6ff; color: var(--ink); text-align: left; padding: 0 12px; }
.attachment-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 2px 10px; }
.attachment-chip { position: relative; display: block; width: 68px; height: 68px; padding: 0; border-radius: 13px; overflow: hidden; }
.attachment-chip .attachment-preview { display: block; width: 100%; height: 100%; padding: 0; border-radius: 0; }
.attachment-chip .attachment-preview img { width: 100%; height: 100%; object-fit: cover; }
.attachment-chip > img { width: 100%; height: 100%; object-fit: cover; }
.attachment-chip > div { padding: 6px; background: rgba(20, 18, 54, .68); }
.attachment-chip .attachment-preview + div { display: block; }
.attachment-chip strong { color: #fff; font-size: 9px; }
.attachment-chip p { display: block; margin: 3px 0 0; color: #fff; font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.attachment-chip > button[data-attachment-id] { position: absolute; top: 1px; right: 1px; width: 25px; height: 25px; border-radius: 50%; background: rgba(25, 24, 55, .8); color: #fff; }
.attachment-add { width: 68px; height: 68px; border: 1px dashed #aaa6d9; border-radius: 13px; background: #fff; color: var(--lavender-dark); font-size: 31px; }
.message-images { display: flex; flex-wrap: wrap; gap: 6px; }
.message-images img { width: 82px; height: 82px; border-radius: 11px; object-fit: cover; }
.voice-feedback { position: absolute; z-index: 9; left: 8px; right: 8px; bottom: calc(100% + 10px); display: grid; justify-items: center; gap: 9px; border-radius: 23px; padding: 20px 12px; background: #4d48ce; color: #fff; box-shadow: 0 16px 32px rgba(37, 33, 107, .3); }
.voice-feedback p { color: #fff; }
.camera-dialog { width: min(430px, 100vw); max-height: 100dvh; border: 0; border-radius: 20px; padding: 0; background: #202034; color: #fff; }
.camera-dialog::backdrop { background: rgba(19, 18, 41, .78); }
.camera-dialog section { display: grid; gap: 12px; padding: 16px; }
.camera-dialog p { color: #eee; }
.camera-dialog video, .camera-dialog img { display: block; width: 100%; max-height: 60dvh; border-radius: 12px; object-fit: contain; background: #111; }
.camera-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.camera-actions button { min-height: 44px; flex: 1; }
.camera-page { position: fixed; z-index: 70; inset: 0; width: min(430px, 100%); height: 100dvh; margin: 0 auto; display: flex; flex-direction: column; background: #fff; color: #302b4e; }
.camera-top { height: 62px; flex: 0 0 62px; display: flex; align-items: center; justify-content: space-between; padding: 0 15px; background: #fff; }
.camera-top h2 { font-size: 16px; font-weight: 600; }
.camera-back, .camera-top-spacer { display: grid; width: 34px; height: 42px; flex: 0 0 34px; place-items: center; border: 0; background: transparent; }
.camera-back img { width: 25px; height: 25px; }
.viewfinder { position: relative; flex: 1 1 auto; min-height: 260px; display: grid; place-items: center; overflow: hidden; background: linear-gradient(145deg, #d1ceda, #ebe4de); }
.viewfinder::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(6deg, transparent 0 34px, #7d668306 35px 36px); pointer-events: none; }
.viewfinder video, .viewfinder img { width: 100%; height: 100%; object-fit: contain; }
.finder { position: absolute; inset: 11% 8% 13%; border: 1.5px solid #ffffff80; border-radius: 19px; pointer-events: none; }
.finder::before, .finder::after { content: ""; position: absolute; width: 34px; height: 34px; border: 3px solid white; }
.finder::before { left: -1px; top: -1px; border-right: 0; border-bottom: 0; border-radius: 18px 0 0 0; }
.finder::after { right: -1px; bottom: -1px; border-left: 0; border-top: 0; border-radius: 0 0 18px 0; }
.camera-help { position: absolute; left: 0; right: 0; bottom: 20px; color: white; font-size: 12px; font-weight: 500; text-align: center; text-shadow: 0 1px 5px #2d253a; }
.camera-controls { position: relative; flex: 0 0 220px; margin-top: -12px; border-radius: 27px 27px 0 0; padding: 26px 35px max(18px, env(safe-area-inset-bottom)); background: white; }
.capture-row { display: flex; align-items: center; justify-content: space-between; gap: 17px; }
.shutter { width: 76px; height: 76px; flex: 0 0 76px; border: 5px solid #e2ddff; border-radius: 50%; background: var(--lavender); box-shadow: inset 0 0 0 3px white; }
.camera-option { display: flex; min-width: 46px; flex-direction: column; align-items: center; gap: 7px; border: 0; padding: 6px 0; background: transparent; color: #645984; font-size: 12px; }
.camera-option img { width: 24px; height: 24px; }
.review-row { display: flex; justify-content: center; gap: 14px; margin: 9px 0 0; }
.review-row button { min-width: 105px; min-height: 42px; border-radius: 12px; }
.camera-tip { margin-top: 24px; color: #9990ac; font-size: 11px; line-height: 1.8; text-align: center; }
.camera-controls > #cameraSystemButton { display: block; margin: 12px auto 0; }
@media (max-width: 430px) {
  .app-shell.is-conversation { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .app-shell.is-conversation .composer-shell { padding: 8px; }
  .app-shell.is-conversation .attachment-note { display: none; }
}

/* Approved V2 layout: the same dock serves the welcome and conversation views. */
body { background: #eeedff; }
.app-shell { padding-bottom: calc(130px + env(safe-area-inset-bottom)); background: radial-gradient(ellipse 165px 430px at 18% 0%, #a9b3f757, transparent 85%), radial-gradient(ellipse 130px 340px at 76% 4%, #cacafc50, transparent 75%), linear-gradient(160deg, #eeeefe, #e6e6fc 11%, #eeedff 36%, #efeeff 70%); }
.service-header { min-height: 62px; }
.brand-mark { width: 31px; height: 31px; border-radius: 10px; }
h1 { font-size: 17px; }
.support-button { min-height: 35px; padding: 0 10px; font-size: 11px; background: #ffffff8a; }
.welcome-hero { min-height: 520px; margin: 0 calc(-1 * var(--screen-gutter)); overflow: visible; background: transparent; }
.welcome-hero::after { display: none; }
.hero-stage { height: 119px; position: relative; z-index: 3; }
.center-avatar { position: absolute; top: 0; left: 50%; width: 220px; height: 169px; margin-left: -110px; padding: 0; border: 0; background: transparent; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.hero-halo { position: absolute; left: 20px; top: 26px; width: 180px; height: 118px; border: 9px solid #ffffff8c; border-bottom: 0; border-radius: 52% 52% 12% 12%; transform: rotate(-5deg); opacity: 0; }
.hero-full { position: absolute; width: 181px; height: 210px; left: 20px; top: -1px; transform-origin: 50% 25%; will-change: transform, opacity; mask-image: linear-gradient(#000 0 60%, #000d 68%, transparent 86%); -webkit-mask-image: linear-gradient(#000 0 60%, #000d 68%, transparent 86%); }
.hero-full img { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.hero-rest { position: absolute; left: 67px; top: 73px; width: 86px; height: 92px; opacity: 1; will-change: transform, opacity; }
.hero-rest img { position: absolute; left: 14px; top: 14px; width: 58px; height: 65px; object-fit: cover; object-position: 50% 0; border-radius: 29px; background: #ebebff; mask-image: linear-gradient(#000 80%, transparent); -webkit-mask-image: linear-gradient(#000 80%, transparent); }
.hero-rest .hex-ring { position: absolute; inset: -12px; width: 110px; height: 116px; overflow: visible; }
.greeting-card { position: relative; z-index: 1; min-height: 353px; border: 1px solid #ffffffda; border-bottom-color: transparent; border-radius: 33px 33px 0 0; padding: 31px 24px 26px; background: linear-gradient(180deg, #f4f4ff22 0, #f0efff7d 120px, #efeeff00 100%); }
.greeting-topline { display: flex; align-items: center; justify-content: space-between; height: 31px; margin-bottom: 12px; }
.greeting-hi { font-family: Georgia, serif; font-style: italic; font-weight: 800; font-size: 30px; line-height: 1; color: #363293; letter-spacing: -2px; transform: rotate(-7deg); }
.date-badge { position: absolute; right: 23px; top: 23px; width: 32px; overflow: hidden; border-radius: 10px; background: #fff; text-align: center; box-shadow: 0 3px 10px #726abc08; }
.date-badge span { display: block; background: #6559eb; color: white; font-size: 9px; line-height: 16px; font-weight: 600; }
.date-badge b { font-size: 21px; line-height: 29px; color: #282146; font-weight: 750; }
.greeting-card h2 { margin: 0 0 16px; color: #252477; font-size: 25px; line-height: 1.4; }
.greeting-text { margin: 0 0 20px; color: #34304f; font-size: 15px; line-height: 1.95; }
.photo-entry { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 82px; border: 1px solid #fff; border-radius: 23px; padding: 16px 15px; background: #fff; text-align: left; box-shadow: 0 14px 26px #8d84ba0b; }
.entry-icon { display: grid; width: 44px; height: 44px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: linear-gradient(140deg, #8570f7, #6757e8); }
.entry-icon img { width: 23px; height: 23px; filter: brightness(0) invert(1); }
.entry-copy { flex: 1; min-width: 0; }
.entry-copy b { display: block; color: #322b57; font-size: 15px; line-height: 1.5; }
.entry-copy span { display: block; margin-top: 1px; color: #9890b7; font-size: 11px; line-height: 1.9; }
.entry-cta { flex: 0 0 auto; border-radius: 20px; padding: 8px 12px; background: #f0edff; color: #6657d9; font-size: 12px; }
.home-footnote { margin: 16px 1px 0; color: #aaa2bf; font-size: 10px; text-align: center; }
.quick-questions { display: none; }
.composer { position: fixed; z-index: 20; left: 50%; bottom: var(--keyboard-offset, 0px); width: min(430px, 100%); max-width: 100%; padding: 10px 12px env(safe-area-inset-bottom); transform: translateX(-50%); background: linear-gradient(0deg, #efeeff 78%, #efeeff00); }
.composer-shell, .app-shell.is-conversation .composer-shell { padding: 0; border: 1px solid #fff; border-radius: 28px; background: #f9f8ff; box-shadow: 0 4px 24px #4b419007; }
.composer-input-wrap { min-height: 59px; margin: 0; border: 0; border-radius: 28px; padding: 7px 9px; background: #fff; align-items: center; }
.composer-input-wrap:focus-within { border: 0; box-shadow: none; }
.composer-icon { width: 39px; min-width: 39px; height: 42px; color: #353053; }
.composer-icon img { width: 25px; height: 25px; filter: none; }
.composer-input-wrap .send-button { width: 37px; min-width: 37px; height: 37px; margin-left: 4px; padding: 8px; }
.composer-input-wrap .send-button img { filter: none; }
#messageInput, .app-shell.is-conversation #messageInput { min-height: 42px; height: 42px; max-height: 96px; padding: 10px 3px 9px; font-size: 16px; line-height: 23px; }
.press-to-talk { min-height: 44px; height: 44px; border: 0; border-radius: 15px; background: transparent; color: #302b4e; font-size: 17px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; }
.press-to-talk:active { background: #f2efff; }
.attachment-list { display: flex; gap: 10px; overflow-x: auto; flex-wrap: nowrap; margin: 0; padding: 12px 12px 9px; }
.attachment-chip, .attachment-add { width: 82px; height: 82px; flex: 0 0 82px; border-radius: 15px; }
.attachment-chip { width: 156px; height: auto; flex-basis: 156px; display: flex; flex-direction: column; }
.attachment-chip > .attachment-preview, .attachment-chip > img { width: 100%; height: 82px; flex: 0 0 82px; }
.attachment-chip > button[data-attachment-id] { display: grid; place-items: center; padding: 3px; }
.attachment-chip > button[data-attachment-id] img { width: 16px; height: 16px; filter: brightness(0) invert(1); }
.attachment-add { display: grid; place-items: center; }
.attachment-add img { width: 29px; height: 29px; }
.attachment-add { border: 1.5px dashed #c8c3e4; background: #ffffff99; color: #aaa3cd; }
.attachment-menu { left: 0; right: 0; bottom: calc(100% + 8px); width: auto; display: flex; gap: 12px; border: 0; padding: 12px; background: #efedff; box-shadow: none; }
.attachment-menu button { flex: 1; min-height: 75px; border-radius: 18px; padding: 8px; background: #fff; text-align: center; }
.attachment-menu button img { display: block; width: 24px; height: 24px; margin: 0 auto 5px; }
.attachment-menu.is-image-only { left: 92px; right: auto; width: 180px; display: grid; gap: 0; border: 1px solid #eeeaf9; border-radius: 18px; padding: 3px 13px; background: #fff; box-shadow: 0 12px 34px #342b711e; }
.attachment-menu.is-image-only button { min-height: 49px; text-align: left; }
.privacy-link { border: 0; padding: 0; background: transparent; color: #6550dc; font: inherit; text-decoration: underline; }
.consent-dialog { max-height: calc(100dvh - 32px); overflow-y: auto; }
.consultation-consent-dialog { width: min(360px, calc(100% - 32px)); }
.consultation-consent-dialog .consent-dialog-content { padding: 18px; gap: 12px; }
.consultation-consent-dialog .consent-dialog-content > p { font-size: 14px; }
.consultation-consent-dialog h2 { font-size: 19px; }
.consultation-consent-dialog .dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.consultation-consent-dialog .dialog-actions button { min-height: 44px; }
#consultationConsentFeedback:empty { display: none; }
.boundary, .service-availability { display: none; }
.app-shell.is-service-unavailable .service-availability { display: block; }
.voice-feedback { left: 0; right: 0; bottom: calc(100% + 2px); min-height: 78px; border-radius: 22px 22px 0 0; padding: 13px 8px; background: linear-gradient(0deg, #e1ddff, #f6f3ff); color: #6153d6; box-shadow: none; font-size: 12px; }
.voice-feedback p { color: inherit; }
.voice-feedback.is-cancelled { background: linear-gradient(0deg, #f7dce4, #fff2f5); color: #c44760; }
#voiceFeedback.voice-feedback { pointer-events: none; }
#voiceFeedback.voice-feedback, #voiceFeedback.voice-feedback *, #pressToTalkButton { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.composer-shell:has(#pressToTalkButton[data-voice-state="RECORDING"]),
.composer-shell:has(#pressToTalkButton[data-voice-state="RECORDING"]) .composer-input-wrap { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.composer-shell:has(#pressToTalkButton[data-voice-state="RECORDING"]) { border-color: transparent; background: transparent; box-shadow: none; }
.composer-shell:has(#pressToTalkButton[data-voice-state="RECORDING"]) .composer-input-wrap { opacity: 0; }
.composer-shell:has(#pressToTalkButton[data-voice-state="RECORDING"]) .composer-input-wrap > :not(#pressToTalkButton) { pointer-events: none; }
#voiceFeedback.voice-feedback[data-voice-state="RECORDING"] { position: fixed; z-index: -1; left: 50%; right: auto; bottom: 0; width: min(430px, 100vw); min-height: 300px; transform: translateX(-50%); align-content: end; gap: 9px; border: 0; border-radius: 0; padding: 76px 20px calc(54px + var(--agent-composer-height, 82px)); background: transparent; color: #fff; box-shadow: none; isolation: isolate; }
#voiceFeedback.voice-feedback[data-voice-state="RECORDING"]::before { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(0deg, rgba(80, 69, 218, .98), rgba(96, 97, 235, .96) 55%, rgba(161, 175, 255, .25) 82%, rgba(176, 185, 255, 0)); animation: voiceFeedbackGlow 2.6s ease-in-out infinite alternate; }
#voiceFeedback.voice-feedback[data-voice-state="RECORDING"]::after { content: ""; position: absolute; left: 50%; bottom: calc(23px + var(--agent-composer-height, 82px)); width: min(216px, 80%); height: 12px; transform: translateX(-50%); background: radial-gradient(ellipse 2px 4px at center, #fff 90%, transparent) center / 12px 12px repeat-x; animation: voiceFeedbackDots 1.3s ease-in-out infinite alternate; }
#voiceFeedback.voice-feedback[data-voice-state="RECORDING"] #voiceStatus[role="status"],
#voiceFeedback.voice-feedback[data-voice-state="RECORDING"] #voiceGestureHint { color: inherit; }
#voiceFeedback.voice-feedback[data-voice-state="RECORDING"].is-cancelled { color: #fff; }
#voiceFeedback.voice-feedback[data-voice-state="RECORDING"].is-cancelled::before { background: linear-gradient(0deg, rgba(157, 47, 76, .98), rgba(196, 71, 96, .96) 55%, rgba(247, 220, 228, .2) 82%, rgba(247, 220, 228, 0)); animation: none; }
#voiceFeedback.voice-feedback[data-voice-state="RECORDING"].is-cancelled::after { animation: none; opacity: .6; }
@keyframes voiceFeedbackGlow { from { opacity: .86; } to { opacity: 1; } }
@keyframes voiceFeedbackDots { from { transform: translateX(-50%) scaleY(.55); opacity: .55; } to { transform: translateX(-50%) scaleY(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  #voiceFeedback.voice-feedback[data-voice-state="RECORDING"]::before,
  #voiceFeedback.voice-feedback[data-voice-state="RECORDING"]::after { animation: none; }
}
.composer-error { position: fixed; z-index: 21; left: 50%; bottom: calc(105px + var(--keyboard-offset, 0px) + env(safe-area-inset-bottom)); width: min(390px, calc(100% - 28px)); transform: translateX(-50%); border-radius: 12px; padding: 7px 10px; background: #fff; text-align: center; }
.composer-error:empty { display: none; }
.app-shell.is-conversation { height: 100dvh; padding-bottom: 120px; }
.app-shell.is-conversation .chat-panel { overflow: visible; }
.app-shell.is-conversation .chat-log { padding-bottom: 24px; }
.app-shell.is-conversation .composer { width: min(430px, 100%); }
@media (prefers-reduced-motion: reduce) { .hero-full { opacity: 0; } .hero-rest { opacity: 1; } }

/* Approved V2.1 FAQ: one light entrance above the existing composer. */
.faq-launch { height: 47px; display: flex; align-items: flex-start; justify-content: center; padding-bottom: 7px; }
.faq-launch button { min-height: 40px; display: flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid #ffffffd9; border-radius: 22px; background: #ffffffb3; color: #6257ed; box-shadow: 0 3px 15px #5b4ba706; }
.faq-launch button > svg:first-child { width: 17px; height: 17px; }
.faq-launch strong { font-size: 13px; font-weight: 650; white-space: nowrap; }
.faq-launch .faq-launch-note { font-size: 11px; color: #8d85a6; white-space: nowrap; }
.faq-launch .faq-launch-chevron { width: 14px; height: 14px; color: #998dd0; }
.faq-launch button:hover { background: #fff; }
.faq-launch button:active { transform: translateY(1px); }
.faq-overlay { position: fixed; inset: 0; z-index: 85; display: flex; width: min(430px, 100%); align-items: flex-end; margin: 0 auto; }
.faq-scrim { position: absolute; inset: 0; width: 100%; border: 0; background: #25204739; backdrop-filter: blur(1.5px); -webkit-backdrop-filter: blur(1.5px); cursor: default; }
.faq-sheet { position: relative; display: flex; flex-direction: column; width: 100%; max-height: calc(100% - 28px); padding: 0 0 calc(5px + env(safe-area-inset-bottom)); overflow: hidden; border-radius: 29px 29px 0 0; background: #fff; box-shadow: 0 -10px 50px #28204b0e; animation: faqRise .23s ease-out; }
.faq-grab { height: 25px; flex: none; display: flex; align-items: center; justify-content: center; touch-action: none; user-select: none; -webkit-user-select: none; }
.faq-grab span { width: 33px; height: 4px; border-radius: 6px; background: #dfdbe9; }
.faq-sheet-head { position: relative; flex: none; padding: 1px 22px 14px; }
.faq-sheet-head h2 { font-size: 22px; line-height: 1.5; letter-spacing: .2px; font-weight: 700; color: #25234f; }
.faq-sheet-head p { margin-top: 4px; color: #8e879f; font-size: 12px; line-height: 1.7; }
.faq-close { position: absolute; top: 0; right: 12px; display: grid; width: 42px; height: 42px; place-items: center; border: 0; background: none; color: #a19aaa; }
.faq-close svg { width: 20px; height: 20px; }
.faq-list { min-height: 0; padding: 0 20px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.faq-item { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 59px; padding: 11px 2px; border: 0; border-top: 1px solid #f0edf5; border-radius: 0; background: none; color: #35304f; text-align: left; }
.faq-item:hover { background: #faf8ff; }
.faq-item:active { background: #f1edff; }
.faq-icon { display: grid; width: 33px; height: 33px; flex: none; place-items: center; border-radius: 11px; background: #f2efff; color: #8576d7; }
.faq-icon svg { width: 18px; height: 18px; stroke-width: 1.65; }
.faq-label { flex: 1; font-size: 15px; line-height: 1.55; font-weight: 500; }
.faq-chevron { width: 16px; height: 16px; flex: none; color: #b0a7c7; }
.faq-sheet-foot { flex: none; padding: 13px 20px max(22px, env(safe-area-inset-bottom)); border-top: 1px solid #f1eef6; background: linear-gradient(#fff, #fcfbff); text-align: center; }
.faq-sheet-foot p { color: #aaa2b7; font-size: 10.5px; line-height: 1.8; }
.faq-other { display: inline-flex; min-height: 37px; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; color: #7b6fc0; font-size: 12px; }
.faq-other svg { width: 13px; height: 13px; }
.faq-launch button:focus-visible, .faq-sheet button:focus-visible { outline: 2px solid #8076ef; outline-offset: 2px; }
@keyframes faqRise { from { transform: translateY(30px); opacity: .85; } to { transform: translateY(0); opacity: 1; } }
@media (max-width: 700px) { .faq-launch { height: 46px; } }
@media (prefers-reduced-motion: reduce) { .faq-sheet { animation: none; } }

/* New consultation is explicit and does not clear the previous session. */
.app-shell.is-agent-conversation #resetButton { display: inline-flex; align-items: center; justify-content: center; width: auto; min-height: 35px; padding: 0 8px; font-size: 11px; border: 1px solid var(--line); border-radius: 18px; background: white; }
.app-shell.is-agent-conversation #resetButton img { width: 20px; height: 20px; }
.app-shell.is-agent-conversation .header-actions { max-width: 170px; flex-wrap: wrap; justify-content: flex-end; }
.app-shell.is-agent-conversation .brand-lockup { flex: 1; }
.app-shell.is-agent-conversation #agentNotebookButton { flex-basis: 100%; min-height: 28px; padding: 4px 8px; font-size: 12px; }
.service-availability { overflow-wrap: anywhere; }

.app-shell.is-agent-conversation .send-button.is-agent-action { width: 72px; min-width: 72px; max-width: 72px; height: 40px; flex: 0 0 72px; padding: 0 8px; border-radius: 20px; font-size: 13px; font-weight: 600; color: white; white-space: nowrap; }
.app-shell.is-agent-conversation #serviceAvailability { position: fixed; z-index: 21; left: 50%; bottom: calc(var(--agent-composer-height, 180px) + 12px + var(--keyboard-offset, 0px) + env(safe-area-inset-bottom)); width: min(390px, calc(100% - 28px)); transform: translateX(-50%); padding: 8px 10px; border-radius: 12px; background: white; color: var(--ink-soft); }
.app-shell:has(#attachmentMenu:not([hidden])) #serviceAvailability { visibility: hidden; }
.review-actions { display:flex; gap:8px; flex-wrap:wrap; padding:8px 12px; }
.review-actions[hidden] { display:none; }
.agent-review-card { margin:12px; overflow-wrap:anywhere; }
.agent-review-card p { white-space:pre-wrap; }
.app-shell.is-agent-review.is-conversation { padding-bottom:var(--agent-composer-height,180px); }
.is-agent-review .review-actions { padding:4px 0 8px; }
.is-agent-review .review-actions button { flex:1; padding:7px 5px; min-height:36px; font-size:12px; }
.agent-review-card { flex-shrink:0; }
.agent-review-card summary { color:var(--ink-soft); font-size:13px; cursor:pointer; }

/* Existing H5 review surface, editable without provider calls. */
#v9Editor{width:min(92vw,640px);max-height:85dvh;overflow:auto}#v9Editor label{display:block;margin:12px 0}#v9Editor textarea{width:100%;box-sizing:border-box;resize:vertical}#v9Editor input:not([type=checkbox]){max-width:100%}.v9-narrative{white-space:pre-wrap}#v9Feedback{padding:8px 16px;font-size:13px}#v9Feedback button{margin:4px}#v9MaterialList article{margin:12px 0}

.is-agent-review .review-actions button{flex:1 0 calc(33.333% - 8px);white-space:nowrap;min-height:36px}
#v9Feedback button{border:1px solid var(--line);border-radius:12px;background:white;color:var(--ink);padding:4px 8px}

/* Service receipts live beside the human-help entry, never inside V9 prose. */
.natural-reply { white-space: pre-wrap; overflow-wrap: anywhere; }
.reply-source-ref { color: var(--lavender-dark); font-size: .75em; }
.reply-sources { border-top: 1px solid var(--line); padding-top: 10px; color: #566273; overflow-wrap: anywhere; }
.reply-sources-title { margin-bottom: 5px; font-size: 12px; font-weight: 600; }
.markdown-body .reply-sources ol { gap: 4px; padding-left: 22px; }
.markdown-body .reply-sources li { color: #566273; font-size: 12px; line-height: 1.6; }
.message-source-notice, .message-session-notice { margin: 8px 0; color: #566273; font-size: 12px; }

.service-status { flex-basis: 100%; max-width: 170px; color: #566273; font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; }
.service-status small { display: block; font-size: inherit; }

/* Bound intrinsic SVG size and keep status above the actual multiline composer. */
.app-shell.is-agent-conversation .send-button.is-agent-action img { width: 20px; height: 20px; }
.app-shell.is-agent-conversation .composer-error { bottom: calc(var(--agent-composer-height, 130px) + 8px + var(--keyboard-offset, 0px)); }
.app-shell.is-agent-conversation .header-actions { flex-shrink: 0; }

/* Consultation history overlays the composer; it never reduces the chat width. */
.consultation-menu { flex: 0 0 36px; width:36px; height:40px; padding:6px; border:0; background:transparent; color:var(--ink); border-radius:12px; }
.consultation-menu svg { display:block; width:24px; height:24px; }
.consultation-mount { position:fixed; inset:0; z-index:65; }
.consultation-mount[hidden] { display:none; }
.consultation-scrim { position:absolute; inset:0; background:rgba(32,24,65,.25); }
.consultation-panel { position:absolute; inset:0 auto 0 0; width:min(86vw,360px); display:flex; flex-direction:column; padding:max(20px,env(safe-area-inset-top)) 18px max(18px,env(safe-area-inset-bottom)); background:#fcfbff; box-shadow:12px 0 36px #37257619; animation:consultationEnter .18s ease-out; }
.consultation-heading { display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; }
.consultation-heading h2 { font-size:21px; margin:0; color:var(--ink); }
.consultation-heading button { border:0; background:transparent; width:40px; height:40px; font-size:28px; color:var(--ink-soft); }
#consultationSearch { flex:none; width:100%; min-height:46px; padding:10px 14px; border:1px solid #e0daf4; border-radius:16px; background:white; font-size:16px; color:var(--ink); }
#consultationListStatus { flex:none; margin:12px 0 0; font-size:13px; color:var(--ink-soft); }
#consultationListStatus:empty { display:none; }
.consultation-list { min-height:0; flex:1; overflow-y:auto; overscroll-behavior:contain; padding-top:16px; }
.consultation-list h3 { color:#8a82ac; font-size:13px; font-weight:500; margin:18px 6px 9px; }
.consultation-item { display:flex; width:100%; border:0; background:transparent; border-radius:13px; padding:14px 10px; gap:12px; align-items:center; text-align:left; color:var(--ink); }
.consultation-item[aria-current=true] { background:#ece6ff; color:#5541bb; }
.consultation-item span { flex:1; min-width:0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font-size:15px; }
.consultation-item time { font-size:10px; color:#8a82ac; flex:none; }
#consultationListMore,.consultation-history-more { border:0; background:transparent; color:#7863cc; padding:10px; font-size:13px; }
.consultation-notice { flex:none; margin:8px 0; color:#726685; font-size:12px; line-height:1.65; }
.history-materials { display:flex; flex-wrap:wrap; gap:8px; margin:8px 0; font-size:12px; }
.history-materials a { max-width:100%; overflow-wrap:anywhere; color:#6650bb; }
.message.user .history-materials a { color:white; text-decoration:underline; }
.app-shell.has-consultations .brand-lockup { gap:6px; flex-wrap:nowrap; }
.app-shell.has-consultations .brand-lockup h1 { white-space:nowrap; }
@media(max-width:480px) { .app-shell.has-consultations .service-header { flex-wrap:wrap; row-gap:8px; } .app-shell.has-consultations .brand-lockup { flex:1 0 100%; } .app-shell.has-consultations .header-actions { max-width:none; margin-left:auto; flex-wrap:nowrap; } }
@keyframes consultationEnter { from { transform:translateX(-100%); } to { transform:translateX(0); } }
@media(prefers-reduced-motion:reduce) { .consultation-panel { animation:none; } }

.consultation-footer { flex:none; padding-top:14px; color:#6b647e; }
.consultation-footer p { margin:0; font-size:13px; line-height:1.6; overflow-wrap:anywhere; }
.consultation-footer .privacy-link { min-height:44px; font-size:14px; text-align:left; }
