:root{--navy:#173b5a;--ink:#203d55;--muted:#596f81;--mist:#eaf0f5;--warm:#fcfbf8;--line:#dce4eb;--blue:#dbe7f0;--error:#a53535}
*{box-sizing:border-box}
html,body{height:100%;margin:0}
body{display:flow-root;background:#edf1f4;color:var(--ink);font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft JhengHei",sans-serif;-webkit-font-smoothing:antialiased}
button,textarea{font:inherit}
button{cursor:pointer;min-height:44px;border:1px solid transparent;border-radius:12px;padding:11px 15px;background:var(--mist);color:var(--navy);transition:background-color .18s,border-color .18s}
button:hover:not(:disabled){background:#dce7ef}
button:disabled{cursor:default;opacity:.5}
button[hidden]{display:none}
button:focus-visible,textarea:focus-visible,summary:focus-visible{outline:3px solid #648cb2;outline-offset:3px}
.app-shell{width:min(1160px,calc(100% - 64px));height:calc(100dvh - 64px);min-height:0;margin:32px auto;display:grid;grid-template-columns:270px minmax(0,1fr);border:1px solid var(--line);border-radius:24px;overflow:hidden;box-shadow:0 18px 60px -32px #29465f45}
.brand-rail{background:#e6edf3;padding:30px;display:flex;flex-direction:column;justify-content:space-between;border-right:1px solid #d9e3ec}
.brand-lockup{display:flex;align-items:center;gap:10px;font-size:14px;font-weight:650;letter-spacing:.04em}
.brand-mark{display:grid;place-items:center;background:var(--navy);color:var(--warm);width:38px;height:38px;border-radius:12px 12px 12px 3px;font-size:19px;font-weight:500}
.eyebrow{font-size:12px;font-weight:650;letter-spacing:.12em;color:var(--muted)}
.rail-intro{padding:36px 0}
.rail-intro h2{font-size:32px;line-height:1.5;letter-spacing:-.04em;font-weight:650;margin:16px 0}
.rail-intro>p:last-child,.rail-foot p{font-size:13px;line-height:1.9;color:var(--muted)}
.edition{display:inline-block;border:1px solid #c5d3df;padding:5px 9px;border-radius:6px;font-size:11px;letter-spacing:.08em}
.rail-foot p{margin:13px 0 0}
.conversation{background:var(--warm);min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden}
.chat-header{padding:23px 28px;display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid var(--line);flex-shrink:0}
.heading-line{display:flex;align-items:center;gap:10px}
h1{font-size:21px;line-height:1.4;letter-spacing:.03em;margin:0 0 3px;font-weight:650}
.chat-heading small{font-size:12px;color:var(--muted)}
.mobile-edition{display:none}
.reset-button{background:transparent;border-color:var(--line);font-size:12px;white-space:nowrap}
#chat{flex:1;min-height:0;overflow:auto;padding:25px 32px;scrollbar-width:thin;scrollbar-color:#c4d2df transparent}
.hero{min-height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:8px 0 24px}
.character-frame{margin-bottom:10px}
.hero img{height:156px;width:auto;max-width:100%;object-fit:contain;mix-blend-mode:multiply}
.hero .eyebrow{margin:4px 0 12px}
.hero h2{font-size:clamp(25px,2.5vw,32px);font-weight:650;line-height:1.3;letter-spacing:-.04em;margin:0 0 12px}
.hero-description{font-size:14px;line-height:1.8;color:var(--muted);margin:0 0 25px}
.chips{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;max-width:520px}
.chips button{font-size:12px;border-color:#dbe4ed;padding:11px 13px;background:#eef3f7;border-radius:10px}
.has-messages .hero{display:none}
.msg{overflow-wrap:anywhere;white-space:pre-wrap;line-height:1.9;font-size:15px;border:1px solid #e2e8ed;border-radius:16px 16px 16px 4px;background:#f0f3f6;padding:14px 18px;margin:0 0 20px;max-width:92%}
.user{background:var(--navy);border-color:var(--navy);color:#f6f8fb;margin-left:auto;border-radius:16px 16px 4px 16px;max-width:83%}
.error{color:var(--error)}
.reply-note{font-size:13px;margin-top:8px}
.reply-note:empty{display:none}
.retry{display:block;margin-top:12px;font-size:13px;border-color:#ccd9e4;background:#e4ecf3}
.composer-area{flex-shrink:0;padding:0 25px 10px}
.status{font-size:12px;line-height:1.6;color:var(--muted);margin:0;padding:0 4px 8px}
.status:empty{padding:0}
form{display:flex;align-items:stretch;gap:10px;border:1px solid #cbd8e3;background:#fefdfb;border-radius:16px;padding:8px;box-shadow:0 3px 8px -6px #173b5a44}
form:focus-within{border-color:#6488a5;box-shadow:0 0 0 2px #c4d6e4}
textarea{flex:1;min-width:0;resize:none;border:0;border-radius:9px;padding:9px 10px;color:var(--ink);background:transparent;font-size:16px;line-height:1.6;min-height:62px}
textarea::placeholder{color:#7c8d9c}
textarea:focus-visible{outline:0}
form button{align-self:flex-end;min-width:76px;background:var(--navy);color:#f6f8fb;font-size:13px;border-radius:11px}
form button:hover:not(:disabled){background:#285574}
form:has(#stop:not([hidden])) #send{display:none}
.composer-hint{font-size:10px;color:#708294;text-align:right;margin:7px 5px 0}
footer{flex-shrink:0;font-size:10px;line-height:1.7;color:var(--muted);text-align:center;padding:0 25px 16px;max-height:30%;overflow:auto}
footer>p{margin:0}
.disclosure{margin-top:2px}
.disclosure summary{display:inline-flex;align-items:center;min-height:44px;cursor:pointer;text-decoration:underline;text-underline-offset:3px;padding:4px 8px}
.disclosure p{margin:5px auto 0;max-width:570px;text-align:left}
@media(max-width:900px){.app-shell{grid-template-columns:220px minmax(0,1fr);width:calc(100% - 32px);height:calc(100dvh - 32px);margin:16px auto}.brand-rail{padding:25px}.rail-intro h2{font-size:27px}.chat-header{padding:20px 22px}#chat{padding:24px}.composer-area{padding:0 20px 10px}.chips{max-width:350px}.hero img{height:135px}}
@media(max-width:700px){body{background:var(--warm)}.app-shell{display:flex;flex-direction:column;width:100%;height:100dvh;margin:0;border:0;border-radius:0;box-shadow:none}.brand-rail{display:none}.conversation{height:100%;width:100%}.chat-header{padding:15px 18px}.mobile-edition{display:inline-block;font-size:10px;white-space:nowrap;color:var(--muted);border-left:1px solid #ccd8e1;padding-left:9px}h1{font-size:20px}.chat-heading small{font-size:11px}.reset-button{font-size:11px;padding:10px 12px}#chat{padding:20px 18px}.hero{padding:0 0 15px}.hero img{height:130px}.hero .eyebrow{font-size:10px;margin:1px 0 10px}.hero h2{font-size:25px}.hero-description{font-size:13px;margin-bottom:20px}.chips{max-width:350px;gap:7px}.chips button{font-size:11px;padding:10px 11px}.msg{font-size:14px;max-width:94%;padding:12px 15px;margin-bottom:16px}.user{max-width:85%}.composer-area{padding:0 12px 9px}form{padding:6px;gap:5px;border-radius:14px}textarea{min-height:58px;padding:8px;font-size:16px}form button{min-width:68px;font-size:12px;padding:11px 12px}.composer-hint{display:none}footer{font-size:10px;padding:0 17px max(9px,env(safe-area-inset-bottom))}.status{font-size:11px;padding:0 5px 6px}.disclosure summary{padding:3px 8px}}
@media(max-height:700px) and (max-width:700px){.chat-header{padding-top:10px;padding-bottom:10px}.hero img{height:90px}.hero .eyebrow{display:none}.hero h2{font-size:22px;margin-bottom:8px}.hero-description{font-size:12px;margin-bottom:13px}.hero .character-frame{margin-bottom:6px}.hero{padding-bottom:10px}.chips{gap:6px}#chat{padding-top:12px;padding-bottom:12px}}
@media(prefers-reduced-motion:reduce){button{transition:none}}

.reply-label{display:block;margin-bottom:7px;color:#526c82;font-size:11px;font-weight:550;line-height:1.5;white-space:normal;letter-spacing:.025em}

.search-status,.material-status,.policy-status,.news-status{display:block;margin-top:10px;color:var(--muted);font-size:11px;line-height:1.6;white-space:normal}
.reply-sources{margin:6px 0 0;padding-left:20px;font-size:12px;line-height:1.8;white-space:normal;overflow-wrap:anywhere}
.reply-sources a{color:#285574;text-underline-offset:3px;display:inline-block;min-height:44px;padding:8px 0}

.material-context,.policy-context{margin:6px 0;padding-left:18px;font-size:11px;line-height:1.8;color:var(--muted);white-space:normal}
