.chat-main{min-height:75vh;padding:64px 24px}.employee-picker{max-width:1060px;margin:0 auto}.employee-picker h1{font-size:clamp(36px,5vw,64px);letter-spacing:-.035em;line-height:1.2;margin:16px 0 24px}.intro{color:#784157;font-size:14px}.employee-list{display:grid;grid-template-columns:repeat(3,1fr);gap:24px;margin:48px 0}.employee-list button{display:flex;flex-direction:column;gap:16px;text-align:left;padding:26px 4px;border:0;border-top:1px solid #aaa2a8;background:transparent;color:#252629;font:inherit;cursor:pointer}.employee-list strong{font-size:25px}.employee-list b{color:#784157}.phone{--accent:#245d45;--surface:#e4eee5;--mine:#c3e7ad;max-width:460px;height:820px;max-height:90vh;margin:auto;border:9px solid #282d2b;border-radius:40px;overflow:hidden;display:flex;flex-direction:column;background:var(--surface);box-shadow:0 18px 45px #25262926}.phone[data-theme=blue]{--accent:#23577a;--surface:#e1edf4;--mine:#c9e6fa}.chat-head{background:var(--accent);color:white;padding:16px 18px 12px}.chat-top{display:flex;align-items:center;justify-content:space-between;font-size:12px}.chat-top button{background:none;border:0;color:white;padding:6px 0}.chat-head h2{font-size:18px;letter-spacing:0;margin:12px 0 2px}.chat-head p{font-size:13px;margin:0 0 12px}.phone button{font:inherit;cursor:pointer;min-height:38px}.themes{display:flex;gap:8px}.themes button{border:1px solid #ffffffa6;border-radius:20px;padding:4px 12px;color:white;background:transparent;font-size:12px}.themes button[aria-pressed=true]{background:white;color:var(--accent)}.conversation{flex:1;min-height:0;overflow-y:auto;padding:20px 14px;overscroll-behavior:contain}.chat-message{max-width:88%;margin:0 0 16px}.chat-message.user{margin-left:auto}.bubble{border-radius:16px 16px 16px 4px;background:white;padding:12px 14px;white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px;line-height:1.65;margin:0}.user .bubble{background:var(--mine);border-radius:16px 16px 4px 16px}.chat-message time{display:block;font-size:11px;color:#46554d;margin:3px 4px}.user time{text-align:right}.chat-bottom{background:#fff;padding:8px 12px 12px}.quick{display:flex;gap:8px;overflow-x:auto;padding:4px 0 10px}.quick button{flex-shrink:0;border:1px solid var(--accent);color:var(--accent);background:white;border-radius:20px;padding:5px 12px;font-size:12px}.phone form{display:flex;gap:8px;padding:0;border:0;background:transparent}.phone textarea{width:100%;min-width:0;resize:none;border:1px solid #758179;border-radius:12px;padding:10px;font:inherit;font-size:14px;color:#252629;background:#fff}.phone form button,.consent-card button{border:0;background:var(--accent);color:white;border-radius:10px;padding:8px 12px}.chat-tools{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:6px}.chat-tools button,.chat-tools a{font-size:12px;color:var(--accent);background:none;border:0;padding:4px 2px;text-decoration:underline}.demo-note{font-size:11px;margin:4px 0 0;color:#4c5650}#chat-status{font-size:13px;color:#8b2748;margin:0;overflow-wrap:anywhere}#typing{font-size:13px;color:#354d40}.typing-dots{animation:pulse 1s infinite}.consent-card{padding:16px;background:white;border:1px solid #758179;border-radius:12px;font-size:14px}.consent-card button{margin-right:6px}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%)}.phone button:disabled{opacity:.55;cursor:wait}.phone :focus-visible{outline:3px solid #bc547a;outline-offset:2px}body.chat-open .skip{display:none}@keyframes pulse{50%{opacity:.3}}@media(max-width:640px){.chat-main{padding:36px 20px}.employee-list{grid-template-columns:1fr;gap:12px;margin-top:30px}.employee-list button{gap:10px;padding:20px 0}body.chat-open{overflow:hidden}body.chat-open #tb-nav,body.chat-open #tb-footer{display:none}body.chat-open .chat-main{padding:0;min-height:0}.phone{width:100%;max-width:none;height:100dvh;max-height:none;border:0;border-radius:0;box-shadow:none}.chat-bottom{padding-bottom:max(12px,env(safe-area-inset-bottom))}.chat-head{padding-top:max(12px,env(safe-area-inset-top))}}@media(prefers-reduced-motion:reduce){.typing-dots{animation:none}}

#send{white-space:nowrap;flex-shrink:0;writing-mode:horizontal-tb}#chat-title:focus:not(:focus-visible){outline:none;box-shadow:none}#chat-title:focus-visible{outline:3px solid #bc547a;outline-offset:2px}.tool-step{max-width:94%;margin:0 0 12px;padding:9px 12px;border:1px solid #75817966;border-radius:10px;background:#ffffffb8;font-size:12px;color:#354d40}.tool-step summary{cursor:pointer}.tool-step p{margin:8px 0}.tool-step pre{white-space:pre-wrap;overflow-wrap:anywhere;font:inherit;max-height:240px;overflow:auto}

/* Keep the conversation primary, including when the composer grows to four lines. */
body.chat-open .chat-main{padding:5dvh 24px;min-height:0}
body.chat-open #tb-nav,body.chat-open #tb-footer{display:none}
.phone{box-sizing:border-box;width:100%;max-width:480px;height:90dvh;max-height:90dvh;display:grid;grid-template-rows:auto minmax(60%,1fr) auto}
.phone[hidden]{display:none}
.chat-head{padding:6px 10px}
.chat-top{gap:8px;min-width:0}
.chat-head h2{flex:1;min-width:0;margin:0;font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.phone .chat-top button{min-width:32px;min-height:32px;padding:4px}
.demo-label{font-size:11px;white-space:nowrap}
#chat-theme{max-width:72px;border:1px solid #ffffffa6;border-radius:6px;background:var(--accent);color:white;font:inherit;padding:5px 2px}
.conversation{padding:16px 12px}
.chat-bottom{min-height:0;overflow-y:auto;padding:6px 10px}
.quick{padding:0 0 6px;gap:6px;white-space:nowrap}
.phone .quick button{min-height:28px;padding:3px 10px;font-size:11px}
.phone form{align-items:flex-end}
.phone textarea{box-sizing:border-box;height:42px;min-height:42px;max-height:104px;line-height:21px;padding:9px 10px;overflow-y:auto}
.phone form button{min-height:42px}
.chat-tools{flex-wrap:nowrap;gap:8px;margin-top:3px;white-space:nowrap;overflow-x:auto}
.phone .chat-tools button,.chat-tools a{min-height:24px;font-size:10px;padding:2px 0;flex-shrink:0}
.demo-note{font-size:9px;margin:0;flex-shrink:0}
.tool-step div{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.6}
.tool-step table{width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums}
.tool-step th,.tool-step td{text-align:left;vertical-align:top;padding:5px 4px;border-bottom:1px solid #75817933}
.tool-step th{font-weight:600;width:42%}
.tool-step label{display:flex;align-items:baseline;gap:6px;margin:8px 0}
.tool-step input{accent-color:var(--accent)}
@media(max-width:768px){
 body.chat-open{overflow:hidden}
 body.chat-open .chat-main{padding:0;min-height:0}
 .phone{max-width:none;height:100dvh;max-height:100dvh;border:0;border-radius:0;box-shadow:none}
 .chat-head{padding-top:max(6px,env(safe-area-inset-top))}
 .chat-bottom{padding-bottom:max(6px,env(safe-area-inset-bottom))}
}

/* 九部門卡片。 */
.employee-list{grid-auto-rows:1fr;gap:24px;margin-top:32px}
.employee-list button{position:relative;display:grid;grid-template-rows:1fr 1fr;gap:0;padding:0;border:1px solid #c7bdc2;background:#fff;min-width:0}
.employee-list button:hover{border-color:#784157;background:#faf6f8}
.employee-list button:focus-visible{outline:3px solid #784157;outline-offset:4px}
.employee-list .department-name{color:#784157;font-weight:700}
.employee-list strong{font-size:24px}.employee-list b{margin-top:auto;padding-top:8px}
.employee-list button>img{display:block;width:100%;height:100%;min-height:0;max-height:none;aspect-ratio:auto;object-fit:cover;object-position:center}.department-copy{display:flex;flex-direction:column;gap:12px;padding:24px;min-width:0}.demo-notice{font-size:12px;line-height:1.6;color:#62565d}
@media(max-width:640px){.employee-list{grid-template-columns:1fr;gap:24px}.employee-list button{padding:0}}
.tool-step ol{padding-left:22px;margin:8px 0}.tool-step li{padding:5px 0}.artifact-draft{padding:4px 8px;background:#fff}.artifact-calendar p{padding:8px 0;border-bottom:1px solid #75817933}

#quota-remaining{font-size:12px;color:var(--accent);margin:0 0 5px}.experience-cta{background:#fff;border:1px solid var(--accent);border-radius:16px;padding:18px;margin:16px 0;overflow-wrap:anywhere}.experience-cta h3{font-size:18px;margin:0 0 10px}.experience-cta p{font-size:14px;line-height:1.7;margin:0 0 16px}.experience-cta>div{display:flex;flex-wrap:wrap;gap:10px}.experience-cta a{flex:1;min-width:100px;text-align:center;padding:12px 10px;border:1px solid var(--accent);border-radius:10px;color:var(--accent);font-size:14px;text-decoration:none}.experience-cta a:first-child{background:var(--accent);color:#fff}.phone textarea:disabled{background:#f1f3f1}.phone button:disabled{cursor:default}

@media(max-width:768px){
 .employee-list{grid-auto-rows:auto}
 .employee-list button{grid-template-rows:auto 1fr}
 .employee-list button>img{height:auto;aspect-ratio:16/9;object-fit:cover}
}

/* 限制格線與彈性子元素，長內容只能在卡片內捲動。 */
html:has(body.chat-open){overflow-x:hidden}
.chat-main,.phone,.phone *{box-sizing:border-box;min-width:0;max-width:100%;overflow-wrap:anywhere}
.phone{grid-template-columns:minmax(0,1fr)}
.conversation{overflow-x:hidden}
.tool-step{overflow-x:auto}
.tool-step table{table-layout:fixed}
.tool-step input[type=checkbox]{flex-shrink:0}
.phone textarea{flex:1;width:0}
#send{flex:0 0 auto}
.chat-bottom{padding-bottom:calc(6px + env(safe-area-inset-bottom,0px))}
.quick,.chat-tools{min-width:0;overflow-x:auto}
.quick button{white-space:normal}

/* 成品保留換行與條列；純文字表格在氣泡內水平捲動。 */
.assistant .bubble{line-height:1.85;tab-size:2}
.assistant .bubble.has-table{font-family:ui-monospace,SFMono-Regular,Consolas,"Noto Sans Mono",monospace;white-space:pre;overflow-wrap:normal;overflow-x:auto;overscroll-behavior-x:contain}
