:root {
  color-scheme: light;
  --brand: #2547c8;
  --brand-dark: #18349c;
  --brand-soft: #eef2ff;
  --ink: #182033;
  --muted: #687087;
  --line: #e6e9f0;
  --paper: #ffffff;
  --canvas: #f3f5f8;
  --mint: #1b9a6c;
  --warm: #f4a340;
  --shadow: 0 22px 70px rgba(29, 39, 72, 0.14);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

/* The browser's default [hidden] style can be overridden by component display rules.
   Make every admin-controlled hidden module unambiguously disappear. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

button, textarea { font: inherit; }
button { cursor: pointer; }

.page-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(130deg, rgba(37, 71, 200, 0.08), transparent 42%),
    radial-gradient(circle at 88% 86%, rgba(27, 154, 108, 0.08), transparent 24%);
}

.app-shell {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(900px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--paper);
}

.topbar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  padding: max(12px, env(safe-area-inset-top)) 20px 12px;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 2px 16px rgba(24, 52, 156, 0.18);
}

.topbar-copy { min-width: 0; flex: 1; }
.topbar-copy strong { display: block; font-size: 16px; letter-spacing: 0.02em; }
.topbar-copy > span { display: flex; align-items: center; gap: 7px; margin-top: 3px; color: rgba(255,255,255,.78); font-size: 12px; }
.topbar-copy i, .status-pill i { width: 7px; height: 7px; border-radius: 50%; background: #54d79c; box-shadow: 0 0 0 3px rgba(84, 215, 156, .17); }

.assistant-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 30%;
  color: var(--brand);
  background: #fff;
  box-shadow: 0 6px 18px rgba(24, 52, 156, .13);
}
.assistant-avatar span { font-weight: 900; font-family: Georgia, "Songti SC", serif; }
.assistant-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.assistant-avatar__text { display: block; max-width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.08em; }
.assistant-avatar--small { width: 42px; height: 42px; }
.assistant-avatar--small span { font-size: 21px; }
.assistant-avatar--small .size-2 { font-size: 16px; }
.assistant-avatar--small .size-3, .assistant-avatar--small .size-4 { font-size: 13px; }
.assistant-avatar--hero { width: 102px; height: 102px; border: 7px solid var(--brand-soft); }
.assistant-avatar--hero span { font-size: 46px; }
.assistant-avatar--hero .size-2 { font-size: 33px; }
.assistant-avatar--hero .size-3 { font-size: 26px; }
.assistant-avatar--hero .size-4 { font-size: 21px; }
.assistant-avatar--bubble { width: 34px; height: 34px; margin-top: 2px; border-radius: 12px; border: 1px solid var(--line); }
.assistant-avatar--bubble span { font-size: 17px; }
.assistant-avatar--bubble .size-2 { font-size: 13px; }
.assistant-avatar--bubble .size-3, .assistant-avatar--bubble .size-4 { font-size: 11px; }

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: transparent;
  transition: background .2s, transform .2s;
}
.icon-button:hover { background: rgba(255,255,255,.12); }
.icon-button:active { transform: scale(.93); }
.icon-button svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.back-button, .clear-button { visibility: hidden; }
.app-shell.has-messages .back-button, .app-shell.has-messages .clear-button { visibility: visible; }

.conversation {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  padding: 0 max(18px, calc((100% - 760px) / 2));
}

.welcome { padding: 38px 0 30px; text-align: center; animation: appear .4s ease both; }
.welcome.is-avatar-hidden { padding-top: 26px; }
.welcome-mark { position: relative; display: inline-block; }
.status-pill {
  position: absolute;
  right: -24px;
  bottom: 7px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  padding: 6px 9px;
  border: 1px solid #dce4e1;
  border-radius: 999px;
  color: #3b6859;
  background: rgba(255,255,255,.96);
  box-shadow: 0 4px 14px rgba(37, 63, 54, .1);
  font-size: 11px;
  font-weight: 700;
}
.status-pill i { width: 6px; height: 6px; }
.eyebrow { margin: 18px 0 7px; color: var(--brand); font-size: 13px; font-weight: 800; letter-spacing: .1em; }
.welcome h1 { margin: 0; font-size: clamp(25px, 5vw, 36px); line-height: 1.24; letter-spacing: -.025em; }

.welcome-service-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; text-align: left; }
.welcome-service-grid[data-count="1"] { grid-template-columns: minmax(0, 1fr); }
.checklist-portal, .contact-card { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; min-width: 0; min-height: 76px; gap: 10px; margin: 0; padding: 12px; border: 1px solid #dce4fa; border-radius: 15px; color: #26324e; background: #fbfcff; box-shadow: 0 5px 14px rgba(36, 58, 132, .06); text-align: left; }
.checklist-portal { text-decoration: none; transition: transform .18s, border-color .18s, box-shadow .18s; }
.checklist-portal:hover { border-color: #b9c9f5; box-shadow: 0 8px 18px rgba(36, 58, 132, .1); }
.checklist-portal:active { transform: scale(.985); }
.checklist-portal:focus-visible { outline: 3px solid rgba(45, 58, 240, .24); outline-offset: 2px; }
.checklist-portal__check, .contact-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; line-height: 1; }
.checklist-portal__check { border: 2px solid var(--brand); color: var(--brand); background: #fff; font-size: 18px; font-weight: 900; }
.contact-card { border-color: #dcece5; background: #f6faf8; }
.contact-icon { color: var(--mint); background: #e6f7ef; }
.contact-icon svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.checklist-portal__copy, .contact-card > div:last-child { display: grid; min-width: 0; gap: 3px; }
.checklist-portal__copy small, .contact-card small { color: #7d899e; font-size: 10px; font-weight: 700; }
.checklist-portal__copy strong, .contact-card strong { overflow: hidden; color: #2a3654; font-size: 13px; font-weight: 800; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }

.faq-section { margin-top: 20px; text-align: left; }
.faq-section__heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.faq-section__heading h2 { margin: 0; color: #27334d; font-size: 16px; line-height: 1.25; letter-spacing: -.02em; }
.faq-section__heading span { color: #9199aa; font-size: 11px; white-space: nowrap; }
.faq-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 11px; }
.faq-action { display: flex; align-items: center; min-width: 0; min-height: 58px; gap: 10px; padding: 11px 12px; border: 1px solid #e1e6f0; border-radius: 14px; color: #263149; background: #fff; box-shadow: 0 4px 12px rgba(31, 48, 92, .04); text-align: left; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.faq-action:hover { border-color: #b9c9f5; background: #fbfcff; box-shadow: 0 8px 18px rgba(31, 48, 92, .09); }
.faq-action:active { transform: scale(.985); }
.faq-action:focus-visible { outline: 3px solid rgba(45, 58, 240, .24); outline-offset: 2px; }
.faq-action__icon { display: grid; place-items: center; flex: 0 0 auto; width: 27px; height: 27px; font-size: 20px; line-height: 1; }
.faq-action__label { overflow: hidden; color: #263149; font-size: 13px; font-weight: 800; line-height: 1.35; text-overflow: ellipsis; }

.social-card { margin-top: 12px; padding: 15px; border: 1px solid #e4e8f1; border-radius: 15px; background: #fff; text-align: left; }
.social-card__heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.social-card__heading span, .social-card__heading small { display: block; }
.social-card__heading span { color: #2c3955; font-size: 13px; font-weight: 800; }
.social-card__heading small { margin-top: 3px; color: #8a93a5; font-size: 10px; }
.social-card__heading em { padding: 5px 8px; border-radius: 999px; color: #4b629d; background: #f0f4ff; font-size: 10px; font-style: normal; font-weight: 800; white-space: nowrap; }
.social-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.social-grid[data-count="1"] { grid-template-columns: minmax(0, 220px); }
.social-grid[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 220px)); }
.social-account { display: grid; gap: 10px; min-width: 0; padding: 10px; border: 1px solid #e8ebf2; border-radius: 12px; background: #fbfcfe; }
.social-account__meta { display: flex; align-items: center; gap: 7px; min-width: 0; }
.social-account__mark { display: grid; place-items: center; width: 25px; height: 25px; flex: 0 0 auto; border-radius: 8px; color: var(--brand); background: var(--brand-soft); font-size: 12px; font-weight: 900; }
.social-account__meta div { min-width: 0; }
.social-account__meta strong, .social-account__meta small { display: block; }
.social-account__meta strong { color: #34405a; font-size: 11px; }
.social-account__meta small { overflow: hidden; margin-top: 2px; color: #8a93a5; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.social-account__qr { display: grid; place-items: center; width: 100%; aspect-ratio: 1; overflow: hidden; border: 1px dashed #d6ddeb; border-radius: 9px; color: #9aa3b3; background: #fff; text-align: center; font-size: 10px; line-height: 1.45; }
.social-account__qr img { width: 100%; height: 100%; object-fit: cover; }

.contribute-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  margin-top: 16px;
  padding: 17px;
  border: 1px solid var(--brand);
  border-radius: 18px;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 14px 28px rgba(37, 71, 200, .22);
  text-align: left;
}
.contribute-card__icon { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.3); border-radius: 13px; color: #fff; background: rgba(255,255,255,.15); }
.contribute-card__icon svg { width: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.contribute-card__copy { min-width: 0; }
.contribute-card__eyebrow { display: block; margin-bottom: 5px; color: rgba(255,255,255,.78); font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.submission-modal__eyebrow { display: block; margin-bottom: 4px; color: var(--brand); font-size: 10px; font-weight: 800; letter-spacing: .11em; }
.contribute-card strong { display: block; font-size: 16px; line-height: 1.35; letter-spacing: -.01em; }
.contribute-card p { margin: 5px 0 0; color: rgba(255,255,255,.8); font-size: 12px; line-height: 1.55; }
.contribute-button, .submit-submission-button, .outline-submission-button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 800;
  transition: transform .18s, background .18s, border-color .18s;
}
.contribute-button { display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(255,255,255,.88); color: var(--brand-dark); background: #fff; box-shadow: 0 6px 15px rgba(20, 34, 112, .2); white-space: nowrap; }
.contribute-button:hover { background: #edf1ff; }
.contribute-button__plus { display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; color: #fff; background: var(--brand); font-size: 16px; line-height: 1; }
.submit-submission-button { border: 0; color: #fff; background: var(--brand); box-shadow: 0 5px 14px rgba(37, 71, 200, .17); }
.submit-submission-button:hover { background: var(--brand-dark); }
.contribute-button:active, .submit-submission-button:active { transform: scale(.97); }
.outline-submission-button { border: 1px solid #d9deea; color: #59647c; background: #fff; }
.outline-submission-button:hover { border-color: #b4c0e6; background: #f8faff; }

.submission-overlay {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 18px;
  background: rgba(17, 28, 57, .46);
  backdrop-filter: blur(4px);
}
.submission-overlay[hidden] { display: none; }
.submission-modal {
  width: min(560px, 100%);
  max-height: min(800px, calc(100dvh - 36px));
  overflow: auto;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(12, 24, 58, .28);
  animation: modal-in .2s ease both;
}
.submission-modal__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 23px 24px 18px; border-bottom: 1px solid var(--line); }
.submission-modal__header h2 { margin: 0; font-size: 21px; letter-spacing: -.02em; }
.submission-modal__header p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.modal-close { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 auto; padding: 0; border: 0; border-radius: 10px; color: #65708a; background: #f3f5f9; font-size: 23px; line-height: 1; }
.modal-close:hover { color: #263653; background: #e9edf6; }
.submission-form { padding: 20px 24px 23px; }
.submission-form label { display: grid; gap: 7px; margin-bottom: 15px; color: #2d3953; font-size: 12px; font-weight: 800; }
.submission-form input, .submission-form textarea {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid #dfe4ee;
  border-radius: 10px;
  outline: 0;
  color: var(--ink);
  background: #fbfcfe;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.55;
  resize: vertical;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.submission-form input:focus, .submission-form textarea:focus { border-color: #8296d9; background: #fff; box-shadow: 0 0 0 3px rgba(37, 71, 200, .1); }
.submission-form__grid { display: grid; grid-template-columns: 1fr 1.35fr; gap: 12px; }
.submission-privacy { margin: -2px 0 17px; padding: 10px 11px; border-radius: 9px; color: #65708a; background: #f6f8fc; font-size: 11px; line-height: 1.55; }
.submission-form__actions { display: flex; justify-content: flex-end; gap: 9px; }

.promotion-overlay {
  position: fixed;
  z-index: 35;
  inset: 0;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 18px;
  background: rgba(17, 28, 57, .52);
  backdrop-filter: blur(5px);
}
.promotion-overlay[hidden] { display: none; }
.promotion-modal {
  position: relative;
  width: min(400px, 100%);
  max-height: min(760px, calc(100dvh - 36px));
  overflow-y: auto;
  padding: 27px 24px 23px;
  border: 1px solid rgba(255,255,255,.85);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(12, 24, 58, .3);
  text-align: center;
  animation: modal-in .2s ease both;
}
.promotion-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: #69748c;
  background: #f2f4f8;
  font-size: 22px;
  line-height: 1;
}
.promotion-close:hover { color: #2c3854; background: #e7ebf4; }
.promotion-modal__copy { padding: 3px 28px 0; }
.promotion-modal__copy > span { display: block; margin-bottom: 6px; color: var(--brand); font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.promotion-modal__copy h2 { margin: 0; color: #26324d; font-size: 22px; line-height: 1.32; letter-spacing: -.025em; }
.promotion-modal__copy p { margin: 8px 0 0; color: #7b8497; font-size: 12px; line-height: 1.6; }
.promotion-modal__image-wrap {
  display: grid;
  place-items: center;
  width: min(240px, 100%);
  margin: 19px auto 17px;
  padding: 8px;
  border: 1px solid #e3e8f3;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(30, 47, 92, .08);
}
.promotion-image-trigger {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 9px;
  background: #f5f7fb;
  cursor: zoom-in;
}
.promotion-image-trigger img { display: block; width: 100%; aspect-ratio: 1; border-radius: 9px; object-fit: contain; background: #f5f7fb; transition: transform .2s ease, filter .2s ease; }
.promotion-image-trigger:hover img { transform: scale(1.025); filter: brightness(.98); }
.promotion-image-trigger:focus-visible { outline: 3px solid rgba(37, 71, 200, .32); outline-offset: 3px; }
.promotion-image-trigger__hint {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: 999px;
  color: #395176;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 3px 10px rgba(20, 37, 79, .1);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}
.promotion-image-trigger.is-required .promotion-image-trigger__hint { color: #214cc0; background: #edf3ff; }
.promotion-confirm {
  width: min(240px, 100%);
  min-height: 42px;
  padding: 9px 14px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 7px 15px rgba(37, 71, 200, .2);
  font-size: 13px;
  font-weight: 800;
  transition: transform .18s, background .18s;
}
.promotion-confirm:hover { background: var(--brand-dark); }
.promotion-confirm:active { transform: scale(.98); }

.promotion-image-overlay {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 18px;
  background: rgba(11, 20, 46, .72);
  backdrop-filter: blur(8px);
}
.promotion-image-overlay[hidden] { display: none; }
.promotion-image-modal {
  position: relative;
  width: min(390px, 100%);
  padding: 24px 22px 22px;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(7, 14, 35, .38);
  text-align: center;
  animation: modal-in .2s ease both;
}
.promotion-image-close {
  position: absolute;
  top: 11px;
  right: 11px;
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: #67738b;
  background: #f2f4f8;
  font-size: 22px;
  line-height: 1;
}
.promotion-image-close:hover { color: #2b3855; background: #e6ebf5; }
.promotion-image-modal__eyebrow { display: block; color: var(--brand); font-size: 10px; font-weight: 900; letter-spacing: .13em; }
.promotion-image-modal h2 { margin: 7px 34px 16px; color: #27324d; font-size: 20px; line-height: 1.3; }
.promotion-image-modal img { display: block; width: min(280px, 100%); aspect-ratio: 1; margin: 0 auto; border: 1px solid #e2e8f4; border-radius: 14px; object-fit: contain; background: #fff; }
.promotion-image-countdown { min-height: 20px; margin: 13px 0 10px; color: #6f7c93; font-size: 12px; font-weight: 700; line-height: 1.5; }
.promotion-image-complete {
  width: min(280px, 100%);
  min-height: 42px;
  padding: 9px 14px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 7px 15px rgba(37, 71, 200, .2);
  font-size: 13px;
  font-weight: 800;
}
.promotion-image-complete:disabled { color: #9da9bd; background: #edf0f5; box-shadow: none; cursor: not-allowed; }
.promotion-image-complete:not(:disabled):hover { background: var(--brand-dark); }

.message-list { padding-top: 24px; }
.message-row { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 18px; animation: slide-up .28s ease both; }
.message-row.user { flex-direction: row-reverse; }
.message-stack { max-width: min(80%, 620px); }
.bubble { padding: 12px 15px; border-radius: 18px; font-size: 14px; line-height: 1.72; white-space: pre-wrap; word-break: break-word; }
.assistant .bubble { border: 1px solid #e8eaf1; border-bottom-left-radius: 6px; background: #f7f8fa; }
.user .bubble { border-bottom-right-radius: 6px; color: #fff; background: var(--brand); }
.message-meta { margin-top: 5px; color: #9aa1b2; font-size: 10px; }
.user .message-meta { text-align: right; }
.message-evidence { display: flex; flex-wrap: wrap; gap: 5px 8px; margin-top: 3px; color: #8b95a9; font-size: 10px; line-height: 1.45; }
.message-evidence.is-stale { color: #a16b24; }
.message-evidence a { color: #4c66b0; font-weight: 800; text-decoration: none; }
.message-evidence a:hover { text-decoration: underline; }
.related { display: flex; flex-wrap: wrap; gap: 7px; margin: 9px 0 0; }
.related button {
  padding: 7px 10px;
  border: 1px solid #dce2f7;
  border-radius: 999px;
  color: #3e559c;
  background: #f7f9ff;
  font-size: 11px;
  transition: background .2s, border-color .2s;
}
.related button:hover { border-color: #aebcea; background: #eef2ff; }
.answer-images { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 8px; }
.answer-images img { width: 100%; max-height: 190px; border: 1px solid #e2e6ee; border-radius: 10px; object-fit: cover; background: #f2f4f8; }

.typing-row { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 18px; }
.typing-row[hidden] { display: none; }
.typing-bubble { display: flex; gap: 5px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 18px 18px 18px 6px; background: #f7f8fa; }
.typing-bubble i { width: 6px; height: 6px; border-radius: 50%; background: #8d95a8; animation: bounce 1s infinite ease-in-out; }
.typing-bubble i:nth-child(2) { animation-delay: .12s; }
.typing-bubble i:nth-child(3) { animation-delay: .24s; }

.composer-wrap {
  position: relative;
  z-index: 3;
  padding: 8px max(18px, calc((100% - 760px) / 2)) max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(14px);
}
.announcement { margin: 0 0 7px; overflow: hidden; color: #8a6b2e; font-size: 11px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.announcement:empty { display: none; }
.composer { display: flex; align-items: flex-end; gap: 9px; padding: 5px 5px 5px 14px; border: 1px solid #dfe3ec; border-radius: 17px; background: #f7f8fa; transition: border-color .2s, box-shadow .2s, background .2s; }
.composer:focus-within { border-color: #9aacdf; background: #fff; box-shadow: 0 0 0 4px rgba(37, 71, 200, .08); }
.composer textarea { min-height: 40px; max-height: 116px; flex: 1; resize: none; padding: 10px 0 8px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 14px; line-height: 1.45; }
.composer textarea::placeholder { color: #9ba2b1; }
.send-button { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto; padding: 0; border: 0; border-radius: 13px; color: #fff; background: var(--brand); transition: transform .2s, opacity .2s, background .2s; }
.send-button:hover { background: var(--brand-dark); }
.send-button:active { transform: scale(.94); }
.send-button:disabled { cursor: default; opacity: .35; }
.send-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.footer-note { margin: 6px 0 0; color: #a0a6b4; font-size: 10px; text-align: center; }
.admin-link, .footer-link { color: #7380a6; text-decoration: none; }
.footer-link { padding: 0; border: 0; background: transparent; font-size: inherit; }
.admin-link:hover, .footer-link:hover { color: var(--brand); text-decoration: underline; }

.toast { position: fixed; z-index: 40; left: 50%; bottom: 98px; transform: translateX(-50%); max-width: calc(100vw - 40px); padding: 10px 14px; border-radius: 12px; color: #fff; background: rgba(24, 32, 51, .9); box-shadow: 0 8px 30px rgba(0,0,0,.2); font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@keyframes appear { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .6; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (min-width: 920px) {
  body { padding: 24px; }
  .app-shell { height: calc(100dvh - 48px); min-height: 620px; border: 1px solid rgba(221,225,235,.9); border-radius: 24px; box-shadow: var(--shadow); }
  .topbar { padding-top: 12px; }
}

/*
 * WeChat's in-app browser can fail to hand touch scrolling to a nested grid
 * scroller. On phones and tablets, let the document own vertical scrolling
 * and keep the composer above the safe-area inset instead.
 */
@media (max-width: 919px) {
  html, body { height: auto; min-height: 100%; }
  body { overflow-y: auto; }

  .app-shell {
    display: block;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    overflow: visible;
  }

  .conversation {
    min-height: calc(100svh - 112px);
    min-height: calc(100dvh - 112px);
    overflow: visible;
    overscroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(142px + env(safe-area-inset-bottom));
  }

  .composer-wrap {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    box-shadow: 0 -8px 22px rgba(24, 32, 51, .06);
  }
}

@media (max-width: 640px) {
  .topbar { min-height: 64px; padding-right: 12px; padding-left: 12px; }
  .conversation, .composer-wrap { padding-right: 14px; padding-left: 14px; }
  .welcome { padding: 20px 0 22px; }
  .welcome.is-avatar-hidden { padding-top: 12px; }
  .assistant-avatar--hero { width: 76px; height: 76px; border-width: 5px; }
  .assistant-avatar--hero span { font-size: 34px; }
  .assistant-avatar--hero .size-2 { font-size: 28px; }
  .assistant-avatar--hero .size-3 { font-size: 22px; }
  .assistant-avatar--hero .size-4 { font-size: 18px; }
  .status-pill { right: -18px; bottom: 4px; gap: 5px; padding: 5px 8px; font-size: 10px; }
  .eyebrow { margin: 14px 0 5px; font-size: 12px; }
  .welcome h1 { font-size: 24px; line-height: 1.28; }
  .welcome-service-grid { gap: 8px; margin-top: 13px; }
  .checklist-portal, .contact-card { grid-template-columns: 30px minmax(0, 1fr); min-height: 66px; gap: 8px; padding: 9px 10px; border-radius: 13px; }
  .checklist-portal__check, .contact-icon { width: 30px; height: 30px; border-radius: 9px; }
  .checklist-portal__check { font-size: 16px; }
  .contact-icon svg { width: 16px; }
  .checklist-portal__copy strong, .contact-card strong { font-size: 12px; }
  .faq-section { margin-top: 15px; }
  .faq-grid { gap: 6px; margin-top: 8px; }
  .faq-action { display: grid; grid-template-columns: 1fr; grid-template-rows: 20px minmax(0, auto); place-items: center; min-height: 58px; gap: 2px; padding: 6px 3px; border-radius: 12px; text-align: center; }
  .faq-action__icon { width: 20px; height: 20px; font-size: 16px; }
  .faq-action__label { display: block; width: 100%; overflow: hidden; font-size: 10px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
  .social-card { padding: 13px; }
  .social-grid { gap: 7px; }
  .social-grid[data-count="1"] { grid-template-columns: minmax(0, 1fr); }
  .social-grid[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .social-account { padding: 8px; }
  .social-account__qr { font-size: 9px; }
  .contribute-card { grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 12px; padding: 15px; }
  .contribute-button { grid-column: 1 / -1; justify-content: center; width: 100%; min-height: 42px; }
  .submission-overlay { align-items: end; padding: 10px; }
  .submission-modal { max-height: calc(100dvh - 20px); border-radius: 18px; }
  .submission-modal__header { padding: 20px 18px 15px; }
  .submission-form { padding: 17px 18px 20px; }
  .submission-form__grid { grid-template-columns: 1fr; gap: 0; }
  .promotion-overlay { align-items: end; padding: 10px; }
  .promotion-modal { max-height: calc(100dvh - 20px); padding: 24px 18px 19px; border-radius: 20px; }
  .promotion-modal__copy { padding-right: 26px; padding-left: 26px; }
  .promotion-modal__copy h2 { font-size: 20px; }
  .promotion-modal__image-wrap { width: min(220px, 100%); margin-top: 16px; margin-bottom: 15px; }
  .message-stack { max-width: 84%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
