: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, .notice-card > 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; }

.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-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: left bottom; transform: translateX(30px); }
.welcome-copy { position: relative; z-index: 1; 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 .notice-card,
.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 textarea { min-height: 88px; padding-top: 13px; }
.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; }
.guidance-card { display: grid; gap: 8px; margin: 0 0 12px; border: 1px solid #d8d6ff; border-left: 4px solid var(--lavender); border-radius: 8px; padding: 12px 14px; background: #fafaff; }
.guidance-question { color: var(--ink); font-size: 15px; line-height: 1.55; font-weight: 700; }
.guidance-reason { color: var(--ink-soft); font-size: 12px; line-height: 1.55; }
.guidance-options { display: flex; flex-wrap: wrap; gap: 8px; }
.guidance-option { min-height: 32px; border: 1px solid #c9c7fb; border-radius: 8px; padding: 5px 10px; background: #fff; color: var(--lavender-dark); font-size: 12px; line-height: 1.35; }
.guidance-option:hover, .guidance-option:focus-visible { border-color: var(--lavender); background: var(--lavender-soft); }
.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: 80px; max-width: none; height: auto; transform: translate(-16px, -5px); }
.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); box-shadow: 0 8px 20px rgba(73, 70, 155, .07); }
.message.user { align-self: flex-end; max-width: calc(100% - 40px); background: #5c54f3; box-shadow: 0 10px 22px rgba(83, 76, 224, .2); }
.message.user span { display: none; }
.message.user p { color: #fff; font-size: 16px; line-height: 1.7; }
.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 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, .voice-button { 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; }
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: none; }
.attachment-list { display: grid; gap: 8px; margin-top: 12px; }
.attachment-chip { display: grid; grid-template-columns: 34px minmax(0, 1fr) 28px; 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: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; }
.message-attachments { display: grid; gap: 3px; margin-top: 8px; padding: 0; list-style: none; }
.message-attachments li { color: var(--ink-soft); font-size: 12px; line-height: 1.35; }
.message.user .message-attachments li { color: rgba(255, 255, 255, .82); }
.input-count { position: absolute; bottom: 15px; left: 15px; color: #a1a2ba; font-size: 13px; white-space: nowrap; }
.send-button { position: absolute; right: 15px; bottom: 12px; display: grid; width: 48px; height: 48px; place-items: center; border: 1px solid rgba(255, 255, 255, .45); border-radius: 50%; padding: 13px; 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 { display: grid; grid-template-columns: 18px 1fr; gap: 9px; margin: 14px 5px 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.notice-card > img { width: 18px; height: 18px; margin-top: 1px; filter: invert(37%) sepia(58%) saturate(1225%) hue-rotate(215deg) brightness(96%) contrast(91%); }
.notice-card strong { color: #62638d; font-size: 12px; }
.notice-card p { margin-top: 2px; }
.consent-control { display: flex; align-items: flex-start; gap: 7px; margin-top: 7px; color: #646680; }
.consent-control input { width: 15px; height: 15px; margin: 2px 0 0; accent-color: var(--lavender); }
.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); }
.staff-review-action p { margin-top: 7px; color: var(--ink-soft); }
.staff-review-trigger { margin-top: 10px; }
.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; }
.staff-summary-panel { border-color: #d5d3ff; }
.staff-summary-note { margin-top: 10px; color: var(--ink-soft); font-size: 13px; line-height: 1.55; }
.staff-summary-editor { display: grid; gap: 12px; margin-top: 15px; }
.staff-editor-field { display: grid; gap: 6px; }
.staff-editor-field > span { color: var(--ink); font-size: 13px; font-weight: 700; }
.staff-editor-field textarea { min-height: 72px; margin: 0; border: 1px solid var(--line); border-radius: 8px; padding: 9px; background: #fff; color: var(--ink); font-size: 13px; line-height: 1.55; }
.staff-summary-panel > .primary { margin-top: 14px; }
.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; }

@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; }
  textarea { min-height: 128px; }
  .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-button { display: none; }
  .send-button { width: 45px; height: 45px; }
}
