* { box-sizing: border-box; }
:root { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; color: #214435; background: #f4f8f4; }
body { margin: 0; min-height: 100dvh; }
button, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.consent-screen { min-height: 100dvh; display: grid; place-items: center; padding: max(20px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom)); background: radial-gradient(circle at 50% 0, #fcfbf3, #eaf3ed 65%, #f4f8f4); }
.consent-card { width: min(100%, 440px); padding: 27px 22px 24px; border: 1px solid #d7e5d8; border-radius: 24px; background: #fff; box-shadow: 0 20px 60px rgba(28, 71, 48, .12); }
.portrait { display: block; width: 72px; height: 72px; margin: 0 auto 11px; border: 3px solid #fff; border-radius: 50%; object-fit: cover; object-position: center 28%; box-shadow: 0 0 0 2px #cfb579; }
.consent-card h1 { margin: 0; text-align: center; font-size: 22px; }
.sub { margin: 7px 0 20px; color: #6b8275; text-align: center; font-size: 13px; }
.notice { max-height: min(38dvh, 290px); overflow: auto; padding: 15px; border-radius: 15px; background: #f5f8f4; color: #40584a; font-size: 13px; line-height: 1.7; }
.notice p { margin: 0 0 10px; }
.notice p:last-child { margin: 0; }
.agree { display: flex; align-items: flex-start; gap: 10px; margin: 19px 0 15px; font-size: 14px; line-height: 1.55; }
.agree input { width: 19px; height: 19px; margin: 1px 0 0; flex: none; accent-color: #287052; }
.primary { width: 100%; min-height: 47px; border: 0; border-radius: 13px; background: #287052; color: #fff; font-size: 15px; font-weight: 700; }
.back { display: block; width: fit-content; margin: 15px auto 0; color: #61816e; font-size: 13px; text-decoration: none; }
.chat-screen { display: none; flex-direction: column; height: var(--chat-height, 100dvh); max-width: 740px; margin: 0 auto; background: #f8faf7; box-shadow: 0 0 45px rgba(29, 65, 40, .08); overflow: hidden; }
.chat-screen.open { display: flex; }
.topbar { display: flex; align-items: center; gap: 11px; min-height: 72px; padding: max(9px, env(safe-area-inset-top)) 17px 9px; background: #fff; border-bottom: 1px solid #e3ebe3; }
.topbar img { width: 46px; height: 46px; flex: none; border-radius: 50%; object-fit: cover; object-position: center 28%; }
.topbar h1 { margin: 0; font-size: 17px; }
.status { margin: 2px 0 0; font-size: 12px; color: #718678; }
.status.ready { color: #287052; }
.topbar a { margin-left: auto; color: #5b7966; text-decoration: none; font-size: 13px; white-space: nowrap; }
.messages { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 15px 10px; overscroll-behavior: contain; }
.message { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 16px; }
.message.user { justify-content: flex-end; }
.message img { width: 34px; height: 34px; flex: none; border-radius: 50%; object-fit: cover; object-position: center 28%; }
.bubble { max-width: min(86%, 560px); padding: 11px 13px; border: 1px solid #e4ebe4; border-radius: 4px 15px 15px 15px; background: #fff; color: #283d30; font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; white-space: pre-wrap; }
.user .bubble { border-color: #d4e9d9; border-radius: 15px 4px 15px 15px; background: #dff0e2; }
.voice { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 8px; }
.voice button { padding: 5px 9px; border: 1px solid #cce0d2; border-radius: 8px; background: #f4faf5; color: #226747; font-size: 12px; }
.voice small { color: #768c7a; font-size: 11px; }
.composer { flex: none; padding: 8px 12px 7px; border-top: 1px solid #e2ebe2; background: #fff; }
.composer textarea { display: block; width: 100%; min-height: 48px; max-height: 110px; resize: vertical; padding: 9px 11px; border: 1px solid #ccddd0; border-radius: 12px; outline: 0; color: #233d2d; background: #fbfdfa; font-size: 16px; }
.composer textarea:focus { border-color: #32815d; }
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 5px; }
.composer-actions span { color: #7d8e80; font-size: 11px; line-height: 1.4; }
.composer-actions button { min-width: 67px; padding: 8px 13px; border: 0; border-radius: 9px; background: #287052; color: #fff; font-weight: 600; }
.footnote { flex: none; padding: 0 14px max(6px, env(safe-area-inset-bottom)); border-top: 1px solid #edf0ed; background: #fff; color: #718477; font-size: 11px; line-height: 1.4; }
.footnote summary { width: fit-content; margin: auto; padding: 5px 0; cursor: pointer; }
.footnote p { max-width: 640px; margin: 1px auto 7px; text-align: center; overflow-wrap: anywhere; }
@media (max-width: 480px) { .topbar { min-height: 62px; padding: max(7px, env(safe-area-inset-top)) 13px 7px; } .topbar img { width: 40px; height: 40px; } .messages { padding: 12px 11px 8px; } .bubble { max-width: min(88%, 560px); } }
