/* Bilingual AI consultation interface. */
.ai-launcher {
  position: fixed; right: 28px; bottom: 98px; z-index: 950;
  display: flex; align-items: center; gap: 12px; padding: 13px 20px 13px 14px;
  border: 1px solid #d2b56f; border-radius: 18px; background: #102642; color: #fff;
  font: inherit; text-align: left; cursor: pointer;
  box-shadow: 0 8px 32px #0005; transition: transform .2s, background .2s;
}
.ai-launcher:hover { transform: translateY(-3px); background: #183454; }
.ai-launcher-icon, .ai-avatar {
  display: grid; place-items: center; flex: 0 0 auto; width: 39px; height: 39px;
  border: 1px solid #cfb16b55; border-radius: 12px; color: #e5ca87; background: #cfb16b0d;
}
.ai-launcher strong { display: block; font-size: 14px; font-weight: 600; }
.ai-launcher small { display: block; margin-top: 1px; font-size: 10px; color: #c4cdd8; letter-spacing: .05em; }
.ai-launcher svg, .ai-panel svg { display: block; width: 20px; height: 20px; flex: 0 0 auto; }
.ai-open .ai-launcher, .ai-open .floating-call { visibility: hidden; }
.ai-panel {
  position: fixed; inset: auto 24px 24px auto; margin: 0;
  width: 430px; max-width: calc(100vw - 32px); height: 710px;
  max-height: calc(100dvh - 48px); padding: 0; overflow: hidden;
  border: 1px solid #d4be8c66; border-radius: 22px;
  background: #f6f5f1; color: #25374b;
  font-family: 'PingFang SC', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
  box-shadow: 0 24px 90px #0007;
}
.ai-panel[open] { display: flex; flex-direction: column; }
.ai-panel::backdrop { background: #030b184a; }
.ai-panel *, .ai-panel *::before, .ai-panel *::after { box-sizing: border-box; }
.ai-panel button, .ai-panel textarea { font: inherit; }
.ai-panel button { cursor: pointer; }
.ai-panel button:disabled { cursor: default; }
.ai-panel [hidden] { display: none !important; }
.ai-panel :focus-visible { outline: 2px solid #b58e39; outline-offset: 3px; }
.ai-header { flex: 0 0 auto; background: #10243e; color: #fff; padding: 21px 20px 17px; }
.ai-header-top { display: flex; align-items: center; gap: 11px; }
.ai-heading { flex: 1; }
.ai-panel h2 { font-size: 18px; font-weight: 600; letter-spacing: .03em; margin: 0; }
.ai-heading p { font-size: 11px; color: #b9c5d3; margin-top: 4px; }
.ai-close {
  display: grid; place-items: center; width: 36px; height: 36px; border: 0;
  border-radius: 50%; background: #ffffff0d; color: #d5deea;
}
.ai-close:hover { background: #ffffff21; }
.ai-header-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 17px; }
.ai-mode-badge { border: 1px solid #c9aa6555; color: #e5ca87; border-radius: 4px; padding: 1px 7px; font-size: 10px; letter-spacing: .06em; }
.ai-new { border: 0; background: none; color: #cad3de; font-size: 11px !important; display: flex; align-items: center; gap: 5px; min-height: 28px; }
.ai-new svg { width: 13px; height: 13px; }
.ai-steps { display: flex; flex: 0 0 auto; align-items: center; gap: 9px; padding: 14px 20px; background: #eeede7; border-bottom: 1px solid #dedfd9; }
.ai-step { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #7a828b; white-space: nowrap; }
.ai-step b { font-size: 9px; font-weight: 500; display: grid; place-items: center; width: 19px; height: 19px; border: 1px solid #c6cbc9; border-radius: 50%; }
.ai-step.is-current { color: #25374b; font-weight: 600; }
.ai-step.is-current b { background: #193451; color: #fff; border-color: #193451; }
.ai-step.is-done b { background: #e1dccb; border-color: #d1bd8d; color: #786239; }
.ai-step-line { flex: 1; min-width: 6px; height: 1px; background: #d0d3ce; }
.ai-log { padding: 23px 20px 16px; overflow-y: auto; overscroll-behavior: contain; flex: 1; min-height: 0; scrollbar-width: thin; scrollbar-color: #c4c9c7 transparent; }
.ai-log:focus-visible { outline-offset: -3px; }
.ai-welcome-kicker { font-size: 10px; letter-spacing: .17em; color: #947339; margin-bottom: 8px; }
.ai-welcome-title { font-size: 22px; line-height: 1.45; color: #1c324e; font-weight: 600; letter-spacing: .02em; margin-bottom: 14px; }
.ai-message { margin-bottom: 17px; }
.ai-message-label { font-size: 10px; margin: 0 0 5px 2px; letter-spacing: .04em; color: #737e87; }
.ai-bubble { border: 1px solid #e4e5df; background: #fff; border-radius: 3px 14px 14px 14px; padding: 13px 15px; font-size: 13px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-message-user { margin-left: 32px; }
.ai-message-user .ai-message-label { text-align: right; }
.ai-message-user .ai-bubble { border: 0; border-radius: 14px 3px 14px 14px; background: #193451; color: #fff; }
.ai-topics { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 3px 0 16px; }
.ai-topic { display: flex; align-items: center; gap: 9px; min-height: 47px; padding: 10px 11px; border: 1px solid #d9dedb; border-radius: 9px; background: #fbfbf8; color: #35485c; text-align: left; font-size: 12px !important; }
.ai-topic svg { width: 16px; height: 16px; color: #9d7e3e; }
.ai-topic:hover { border-color: #b99b59; background: #f3eedf; }
.ai-small-note { color: #788089; font-size: 11px; line-height: 1.7; }
.ai-controls { flex: 0 0 auto; padding: 0 20px 10px; }
.ai-skip { display: block; border: 0; padding: 4px 0 8px; color: #637380; background: none; font-size: 11px !important; text-decoration: underline; text-underline-offset: 3px; }
.ai-composer { padding: 10px 11px 9px; border: 1px solid #ced5d2; background: #fff; border-radius: 13px; }
.ai-composer:focus-within { border-color: #b19450; box-shadow: 0 0 0 2px #b1945012; }
.ai-input { width: 100%; height: 52px; min-height: 52px; padding: 0; border: 0; background: transparent; resize: none; color: #25374b; font-size: 13px !important; line-height: 1.7; border-radius: 0; }
.ai-input:focus-visible { outline: none; }
.ai-input::placeholder { color: #879098; }
.ai-composer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ai-char-count { color: #849098; font-size: 10px; font-variant-numeric: tabular-nums; }
.ai-send { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 6px 11px; min-height: 32px; border: 0; border-radius: 7px; background: #193451; color: #fff; font-size: 11px !important; }
.ai-send svg { width: 14px; height: 14px; }
.ai-send:disabled { background: #e6e9e5; color: #99a09e; }
.ai-privacy { flex: 0 0 auto; display: flex; justify-content: center; align-items: center; gap: 5px; padding: 0 16px 13px; font-size: 10px; color: #7d858a; text-align: center; }
.ai-privacy svg { width: 11px; height: 11px; }
.ai-summary { border: 1px solid #d8ccb1; border-radius: 12px; background: #fff; overflow: hidden; margin: 6px 0 14px; }
.ai-summary-heading { background: #efe9db; padding: 14px 15px; }
.ai-summary-heading small { display: block; font-size: 9px; letter-spacing: .13em; color: #947644; margin-bottom: 3px; }
.ai-panel .ai-summary h3 { font-size: 16px; color: #213850; margin: 0; }
.ai-summary dl { padding: 2px 15px 13px; }
.ai-summary dt { font-size: 10px; color: #848b8f; margin-top: 12px; }
.ai-summary dd { font-size: 12px; line-height: 1.8; color: #314355; white-space: pre-wrap; overflow-wrap: anywhere; margin: 3px 0 0; }
.ai-summary-actions { display: grid; grid-template-columns: 1fr 1.45fr; gap: 8px; margin: 0 0 11px; }
.ai-result-footer { flex: 0 0 auto; border-top: 1px solid #e2e3dd; padding: 13px 20px 5px; background: #f6f5f1; }
.ai-result-footer .ai-summary-actions { margin-bottom: 2px; }
.ai-result-footer .ai-contact-link { display: block; margin: 0 auto; }
.ai-summary:focus-visible { outline-offset: -3px; }
.ai-action { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 8px; border: 1px solid #cbd2d1; border-radius: 8px; background: transparent; color: #334b5e; font-size: 12px !important; }
.ai-action svg { width: 14px; height: 14px; }
.ai-action-primary { background: #193451; color: #fff; border-color: #193451; }
.ai-action:hover { filter: brightness(.93); }
.ai-result-hint { font-size: 11px; color: #737f87; line-height: 1.7; margin: 4px 0 10px; }
.ai-contact-link { border: 0; background: transparent; color: #79623d; text-decoration: underline; text-underline-offset: 3px; font-size: 12px !important; padding: 7px 0; }
.ai-status { color: #596d7b; font-size: 11px; line-height: 1.7; }
.ai-status:not(:empty) { margin: 7px 0; }
.ai-reset-box { padding: 12px 20px; border-bottom: 1px solid #e1d7c0; background: #f3ecdd; flex: 0 0 auto; font-size: 12px; }
.ai-reset-actions { display: flex; gap: 8px; margin-top: 8px; }
.ai-reset-actions button { padding: 6px 12px; border: 1px solid #c6bba4; border-radius: 5px; background: white; color: #25374b; font-size: 11px; }
.ai-manual-copy { width: 100%; min-height: 140px; padding: 10px; border: 1px solid #cbd2d1; border-radius: 6px; color: #25374b; background: white; font-size: 12px !important; }
.ai-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (min-width: 601px) and (max-height: 760px) {
  .ai-log { padding: 16px 20px 12px; }
  .ai-welcome-kicker { margin-bottom: 5px; }
  .ai-welcome-title { margin-bottom: 10px; }
  .ai-message { margin-bottom: 12px; }
  .ai-topics { margin-bottom: 10px; }
  .ai-small-note { font-size: 10px; line-height: 1.6; }
}
@media (max-width: 600px) {
  .ai-launcher { right: 18px; bottom: calc(76px + env(safe-area-inset-bottom)); padding: 11px 15px 11px 11px; gap: 9px; border-radius: 15px; }
  .ai-launcher-icon { width: 32px; height: 32px; border-radius: 9px; }
  .ai-launcher strong { font-size: 13px; }
  .ai-launcher small { font-size: 9px; }
  .ai-panel { inset: auto 0 0 0; width: 100%; max-width: 100%; height: 91dvh; max-height: calc(100dvh - 12px); border-radius: 22px 22px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); }
  .ai-header { padding: 16px 18px 12px; }
  .ai-header-bottom { margin-top: 10px; }
  .ai-heading p { font-size: 11px; }
  .ai-close { width: 44px; height: 44px; }
  .ai-steps { padding: 12px 18px; gap: 7px; }
  .ai-step { font-size: 10px; }
  .ai-log { padding: 20px 18px 12px; }
  .ai-controls { padding: 0 18px 8px; }
  .ai-input { font-size: 16px !important; height: 58px; }
  .ai-send { min-height: 38px; padding: 7px 13px; }
  .ai-privacy { font-size: 9px; padding-bottom: 10px; }
  .ai-new, .ai-skip, .ai-contact-link { min-height: 34px; }
  .ai-action { min-height: 44px; }
}
@media (max-width: 350px) {
  .ai-step { gap: 4px; font-size: 9px; }
  .ai-steps { padding-inline: 12px; gap: 4px; }
  .ai-step b { width: 17px; height: 17px; }
  .ai-topic { padding: 10px 8px; gap: 6px; font-size: 11px !important; }
}

.ai-chat-actions { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 20px 7px; }
.ai-copy-chat { display: inline-flex; gap: 5px; align-items: center; border: 0; background: none; color: #596d7b; font-size: 11px !important; padding: 6px 0; }
.ai-copy-chat svg { width: 14px; height: 14px; }
.ai-send-actions { display: flex; align-items: center; gap: 10px; }
.ai-stop { border: 0; background: none; color: #7e6440; font-size: 11px !important; }
.ai-privacy { display: block; font-size: 10px; line-height: 1.6; padding: 0 20px 13px; }

/* Shared consultation toolbar: one surface, two equally clear choices. */
.consult-dock {position:fixed;right:24px;bottom:24px;z-index:950;display:flex;align-items:stretch;padding:6px;border:1px solid #bca46c66;border-radius:16px;background:#101b2df2;box-shadow:0 8px 28px #0003;backdrop-filter:blur(16px);}
.consult-dock .ai-launcher,.consult-dock .floating-call {position:static!important;display:flex;align-items:center;justify-content:center;gap:9px;width:auto;height:auto;min-height:54px;margin:0;padding:10px 16px;border:0;border-radius:10px;background:transparent;color:#eee7d7;box-shadow:none;transform:none;animation:none;text-decoration:none;}
.consult-dock .ai-launcher:hover,.consult-dock .floating-call:hover {background:#ffffff0a;transform:none;}
.consult-dock .floating-call {border-left:1px solid #bca46c33;border-radius:0 10px 10px 0;}
.consult-dock .ai-launcher-icon {width:24px;height:24px;border:0;background:none;border-radius:0;color:#cfb878;}
.consult-dock .floating-call svg {width:22px;height:22px;color:#cfb878;}
.consult-dock .call-label {display:block;max-width:none;opacity:1;white-space:nowrap;font-size:14px;font-weight:500;}
.consult-dock .ai-launcher strong {font-size:14px;font-weight:500;}
.consult-dock .ai-launcher small {font-size:12px;letter-spacing:0;color:#aab4c2;}
.ai-open .consult-dock {visibility:hidden;}
.ai-panel .ai-bubble {font-size:15px;}
.ai-panel .ai-message-label,.ai-panel .ai-heading p {font-size:12px;}
.ai-panel .ai-privacy {font-size:12px;}
@media(max-width:600px) {
 .consult-dock {right:12px;left:12px;bottom:calc(12px + env(safe-area-inset-bottom));padding:5px;border-radius:14px;}
 .consult-dock .ai-launcher,.consult-dock .floating-call {flex:1;min-width:0;min-height:52px;padding:8px;gap:8px;}
 .consult-dock .ai-launcher strong,.consult-dock .call-label {font-size:14px;}
 body {padding-bottom:90px;}
}

.ai-handoff {margin:16px 0;padding:16px;border:1px solid #cbb882;border-radius:14px;background:#fff;}
.ai-handoff-title {font-size:16px;font-weight:600;color:#25374b;margin:0 0 8px;}
.ai-handoff-copy,.ai-turn-limit {font-size:14px;line-height:1.7;color:#4d5f70;}
.ai-handoff button {min-height:44px;padding:10px 14px;background:#193451;color:#fff;border:0;border-radius:8px;font-size:14px;}
.ai-handoff button:disabled {opacity:.6;}
.ai-contact-form {margin-top:12px;display:grid;gap:10px;}
.ai-contact-form label {font-size:14px;line-height:1.6;}
.ai-contact-form input:not([type="checkbox"]),.ai-contact-form select {width:100%;min-height:44px;padding:9px 10px;border:1px solid #bdc7cf;background:#fff;color:#25374b;border-radius:6px;font-size:16px;}
.ai-contact-consent {display:flex;gap:8px;align-items:flex-start;}
.ai-contact-consent input {flex:0 0 20px;width:20px;height:20px;margin-top:3px;}
.ai-contact-note,.ai-contact-status {font-size:13px;color:#526575;line-height:1.7;}

/* Keep conversation positioning independent of page scroll and DOM reordering. */
.ai-log {overflow-anchor:none;scroll-behavior:auto;}
