:root { --ink:#162018; --green:#67d63f; --green-dark:#267711; --mint:#eff9e9; --line:#dce4da; --muted:#667066; --paper:#f6f7f3; --white:#fff; --red:#bf3b32; }
* { box-sizing:border-box; }
[hidden] { display:none!important; }
html,body { height:100%; }
body { margin:0; color:var(--ink); background:var(--paper); font:14px/1.45 Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
button,input,textarea,select { font:inherit; } button { cursor:pointer; }
.login-screen { position:fixed; z-index:100; inset:0; min-height:100vh; overflow:auto; display:grid; place-items:center; padding:24px; background:radial-gradient(circle at top,#eaf9e4 0,#f6f7f3 48%,#eef1ec 100%); }
.login-card { width:min(420px,100%); background:#fff; border:1px solid var(--line); border-radius:22px; padding:30px; box-shadow:0 24px 70px rgba(25,48,29,.12); }.login-mark { display:grid; place-items:center; width:50px; height:50px; border-radius:15px; background:var(--green); color:#10200a; font-size:28px; font-weight:900; }.login-card h1 { margin:18px 0 6px; font-size:25px; }.login-card>p { color:var(--muted); }.login-card form { display:grid; gap:9px; margin-top:22px; }.login-card label { font-weight:750; }.login-card input { width:100%; border:1px solid #b9c5b6; border-radius:10px; padding:12px; outline:none; }.login-card input:focus { border-color:var(--green-dark); box-shadow:0 0 0 3px #e8f7e1; }.login-card form>button { border:0; border-radius:10px; padding:12px; background:var(--ink); color:#fff; font-weight:800; }.login-card form>button.quiet { background:transparent; color:var(--green-dark); padding:7px; }.phone-input { display:flex; align-items:center; border:1px solid #b9c5b6; border-radius:10px; overflow:hidden; }.phone-input:focus-within { border-color:var(--green-dark); box-shadow:0 0 0 3px #e8f7e1; }.phone-input span { padding:0 0 0 12px; color:var(--muted); }.phone-input input { border:0; box-shadow:none!important; }.login-status { min-height:20px; margin-bottom:0; font-size:12px; }.login-status.error { color:var(--red); }.login-status.success { color:var(--green-dark); }
.app-shell { height:100vh; height:100dvh; display:grid; grid-template-columns:280px minmax(0,1fr); overflow:hidden; }
.sidebar-backdrop { display:none; }
.sidebar { background:#111812; color:#fff; display:flex; flex-direction:column; padding:16px 12px; min-height:0; }
.brand { display:flex; align-items:center; gap:10px; padding:2px 7px 16px; }.brand-mark { display:grid; place-items:center; width:36px; height:36px; border-radius:11px; background:var(--green); color:#10200a; font-weight:900; font-size:21px; }.brand div { display:grid; }.brand small { color:#9ca69e; }.close-sidebar { display:none; margin-left:auto; width:40px; height:40px; border:0; background:transparent; color:#fff; font-size:27px; }
.new-chat { padding:10px 12px; border:1px solid #344137; border-radius:11px; background:#1c271e; color:#fff; text-align:left; font-weight:750; }
.search { margin:12px 0; display:flex; align-items:center; gap:6px; border:1px solid #344137; border-radius:10px; padding:7px 9px; color:#879188; }.search input { width:100%; border:0; outline:0; color:#fff; background:transparent; }
.sessions { flex:1; overflow:auto; display:grid; align-content:start; gap:4px; }.session { display:grid; grid-template-columns:1fr 28px; border-radius:9px; overflow:hidden; }.session.active { background:#28352a; }.session:hover { background:#202b22; }.session button { border:0; background:transparent; color:#fff; }.session-open { min-width:0; padding:8px; display:grid; text-align:left; }.session-open span { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }.session-open small { color:#929c94; font-size:11px; }.session-more { opacity:.55; }.session:hover .session-more { opacity:1; }.empty { color:#879188; padding:10px; }
.account-menu { border-top:1px solid #2a342c; padding:14px 5px 0; display:grid; gap:4px; }.account-menu small { color:#9da59e; }.account-menu button { margin-top:6px; padding:7px; border:1px solid #38463b; border-radius:8px; background:#202b22; color:#fff; text-align:left; }
.workspace { min-width:0; min-height:0; height:100vh; height:100dvh; display:grid; grid-template-rows:auto auto minmax(0,1fr) auto auto; background:var(--white); overflow:hidden; }.topbar { min-height:68px; display:flex; align-items:center; gap:12px; padding:10px 20px; border-bottom:1px solid var(--line); }.topbar>div:not(.top-actions) { min-width:0; }.epc-logo { width:42px; height:42px; flex:0 0 auto; border:1px solid var(--line); border-radius:10px; object-fit:contain; background:#fff; }.topbar h1 { margin:0; font-size:17px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }.topbar p { margin:2px 0 0; color:var(--muted); font-size:12px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }.top-actions { margin-left:auto; display:flex; flex:0 0 auto; gap:7px; }.top-actions button,.mobile-menu { min-height:38px; border:1px solid var(--line); background:#fff; border-radius:9px; padding:7px 10px; }.mobile-menu { display:none; }
.connection-error { margin:14px 18px 0; padding:12px 14px; border:1px solid #e8b8b2; background:#fff3f1; border-radius:10px; }.connection-error span,.connection-error code { display:block; margin-top:4px; }
.chat { min-height:0; overflow:auto; overscroll-behavior:contain; padding:22px max(24px,calc((100% - 850px)/2)); }.welcome { text-align:center; margin:14vh auto; max-width:520px; }.welcome span { display:grid; place-items:center; margin:auto; width:58px; height:58px; border-radius:18px; background:var(--green); font-size:25px; }.welcome h2 { font-size:24px; margin:17px 0 6px; }.welcome p { color:var(--muted); }
.message { display:grid; grid-template-columns:34px minmax(0,1fr); gap:10px; margin:0 0 18px; }.message.user { margin-left:12%; }.message .avatar { width:31px; height:31px; display:grid; place-items:center; border-radius:9px; background:#151d16; color:#fff; font-size:11px; font-weight:800; }.message.user .avatar { background:#e6ebe3; color:#435043; }.message-body { min-width:0; }.message-body>p { margin:4px 0 9px; white-space:pre-wrap; }.loading { opacity:.65; }
.message-actions { display:flex; flex-wrap:wrap; gap:7px; margin-top:10px; }.message-actions button { border:1px solid #b9d7ae; background:var(--mint); color:var(--green-dark); border-radius:999px; padding:6px 10px; font-weight:700; }
.quote-card { border:1px solid var(--line); border-radius:13px; overflow:hidden; max-width:650px; }.quote-title,.quote-total { display:flex; justify-content:space-between; gap:12px; padding:10px 12px; background:var(--mint); }.quote-title span { color:var(--green-dark); font-weight:800; }.quote-card dl { margin:0; padding:4px 12px; }.quote-card dl div { display:flex; justify-content:space-between; gap:15px; padding:6px 0; border-bottom:1px solid #edf0eb; }.quote-card dt { color:var(--muted); }.quote-card dd { margin:0; text-align:right; font-weight:650; }.quote-total strong { font-size:17px; }
.citations { display:grid; gap:2px; border-left:3px solid var(--green); padding-left:9px; margin-top:10px; }.citations small { color:var(--muted); }.citations a { color:var(--green-dark); font-weight:700; }.citations span { color:var(--muted); font-size:11px; }
.suggestions { display:flex; gap:7px; overflow:auto; padding:7px max(24px,calc((100% - 850px)/2)); }.suggestions button { white-space:nowrap; border:1px solid var(--line); background:#fff; border-radius:999px; padding:7px 10px; }
.composer { margin:0 max(20px,calc((100% - 850px)/2)); border:1px solid #cbd4c8; border-radius:16px; display:flex; align-items:end; gap:6px; padding:7px; box-shadow:0 8px 28px rgba(26,42,29,.08); }.composer textarea { flex:1; min-height:38px; max-height:130px; resize:vertical; border:0; outline:0; padding:9px; }.composer select { align-self:center; border:0; color:var(--muted); background:transparent; font-size:12px; }.composer button { border:0; border-radius:10px; padding:9px 11px; }.composer .icon { background:#eef1ed; }.composer .icon.recording { background:#f8dedb; color:var(--red); }.composer .send { background:var(--ink); color:#fff; font-weight:750; }.composer-status { display:flex; justify-content:space-between; color:#788177; font-size:11px; padding:5px max(24px,calc((100% - 850px)/2)) 10px; }
dialog { width:min(620px,95vw); max-height:90vh; max-height:90dvh; overflow:auto; border:0; border-radius:18px; padding:0; box-shadow:0 22px 65px rgba(0,0,0,.25); } dialog::backdrop { background:rgba(8,15,9,.55); }.dialog-head { position:sticky; z-index:2; top:0; display:flex; justify-content:space-between; padding:16px 18px; background:#111812; color:#fff; }.dialog-head div { display:grid; }.dialog-head small { color:#a9b1aa; }.dialog-head button { min-width:40px; min-height:40px; color:#fff; background:transparent; border:0; font-size:20px; }.setup-chat,.setup-form,.setup-media,#setup-preview { padding:12px 18px; }.setup-user { margin-left:18%; background:var(--mint); padding:9px 11px; border-radius:12px; }.setup-form { display:flex; gap:8px; }.setup-form textarea { flex:1; border:1px solid var(--line); border-radius:10px; padding:9px; }.setup-actions { display:grid; gap:7px; align-content:end; }.setup-form button,#save-setup { min-height:40px; border:0; background:var(--green); border-radius:9px; padding:8px 12px; font-weight:800; }.setup-form .setup-mic { background:#eef1ed; }.setup-form .setup-mic.recording { background:#f8dedb; color:var(--red); }.setup-media { border-top:1px solid var(--line); display:grid; gap:7px; }.setup-media label { font-weight:750; }.setup-media label small,#setup-status { color:var(--muted); font-weight:400; margin:0; }.setup-media input { width:100%; }.setup-media img { width:72px; height:72px; border-radius:12px; object-fit:contain; border:1px solid var(--line); background:#fff; }.setup-card { display:grid; gap:7px; border:1px solid var(--line); border-radius:12px; padding:12px; }.setup-card div { display:flex; justify-content:space-between; gap:12px; }.setup-card strong { text-align:right; overflow-wrap:anywhere; }.setup-card span { color:var(--muted); } details pre { overflow:auto; background:#f3f5f1; padding:9px; border-radius:8px; }
.tools-dialog { width:min(780px,96vw); }.tools-status { padding:14px 18px; color:var(--muted); border-bottom:1px solid var(--line); }.tools-grid { padding:16px 18px; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }.tool-card { display:grid; gap:5px; text-align:left; border:1px solid var(--line); border-radius:13px; padding:14px; background:#fff; }.tool-card:hover:not(:disabled) { border-color:#9bcf88; background:var(--mint); }.tool-card span { font-weight:800; font-size:15px; }.tool-card small { color:var(--muted); min-height:38px; }.tool-card b { color:var(--green-dark); }.tool-card:disabled { opacity:.55; cursor:not-allowed; }.tools-result { margin:0 18px 18px; border:1px solid var(--line); border-radius:12px; overflow:hidden; }.tools-result-head { display:flex; justify-content:space-between; padding:10px 12px; background:var(--mint); }.tools-result-head span { display:flex; gap:8px; }.tools-result button { border:0; background:transparent; }.tools-result-head button { color:var(--green-dark); font-weight:750; }.tools-result-list { display:grid; padding:0 12px; }.tools-record { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:11px 0; border-bottom:1px solid var(--line); }.tools-record:last-child { border-bottom:0; }.tools-record span { display:grid; min-width:0; }.tools-record strong { overflow:hidden; text-overflow:ellipsis; }.tools-record small { color:var(--muted); }.tools-record button { color:var(--green-dark); font-weight:800; white-space:nowrap; }.tools-empty { color:var(--muted); padding:16px 0; }.tools-result pre { max-height:320px; overflow:auto; margin:0; padding:12px; font-size:11px; white-space:pre-wrap; border-top:1px solid var(--line); }
.dcr-card { max-width:520px; display:grid; gap:10px; padding:13px; border:1px solid #b9d7ae; border-radius:13px; background:var(--mint); }.dcr-card-head { display:flex; justify-content:space-between; align-items:start; gap:10px; }.dcr-card-head div { display:grid; }.dcr-card-head small,.dcr-card>small { color:var(--muted); }.dcr-card-head button { border:0; background:transparent; color:var(--green-dark); font-weight:750; }.dcr-card img { width:180px; height:50px; border:1px solid var(--line); background:#fff; image-rendering:auto; }.dcr-card label { display:grid; gap:4px; font-weight:700; }.dcr-card input { width:min(280px,100%); border:1px solid #b8c5b4; border-radius:9px; padding:9px; background:#fff; }.dcr-card .dcr-verify { width:max-content; border:0; border-radius:9px; padding:9px 13px; background:var(--ink); color:#fff; font-weight:800; }.dcr-result { max-width:520px; display:grid; gap:5px; padding:11px 13px; border:1px solid var(--line); border-radius:11px; }.dcr-result.dcr,.dcr-result.verified { background:var(--mint); border-color:#9bcf88; }.dcr-result.non_dcr,.dcr-result.not_found,.dcr-result.invalid_captcha { background:#fff3f1; border-color:#e8b8b2; }.dcr-result p { margin:0; }.dcr-result small { color:var(--muted); }
.tool-result-card { max-width:620px; display:grid; gap:7px; padding:12px; border:1px solid var(--line); border-radius:13px; background:#fff; }.tool-result-row { display:flex; justify-content:space-between; gap:10px; padding-top:7px; border-top:1px solid var(--line); }.tool-result-row span { display:grid; font-weight:700; }.tool-result-row small,.tool-result-card p { color:var(--muted); font-weight:400; }.tool-result-row b,.tool-result-row>button { color:var(--green-dark); font-size:12px; font-weight:800; border:0; background:transparent; cursor:pointer; }
.pmsg-form { max-width:720px; display:grid; gap:10px; padding:14px; border:1px solid #b9d7ae; border-radius:13px; background:var(--mint); }.pmsg-form>p,.pmsg-form>small { margin:0; color:var(--muted); }.pmsg-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }.pmsg-fields label { display:grid; gap:3px; font-size:12px; font-weight:700; }.pmsg-fields .wide { grid-column:1/-1; }.pmsg-fields input,.pmsg-fields textarea { width:100%; border:1px solid #b8c5b4; border-radius:8px; padding:8px; background:#fff; }.pmsg-fields textarea { min-height:70px; resize:vertical; }.pmsg-form>button { width:max-content; border:0; border-radius:9px; padding:10px 14px; background:var(--ink); color:#fff; font-weight:800; }.pmsg-result { max-width:620px; display:grid; gap:8px; padding:13px; border:1px solid #9bcf88; border-radius:12px; background:var(--mint); }.pmsg-result>div { display:flex; justify-content:space-between; gap:12px; padding-top:7px; border-top:1px solid #cfe4c7; }.pmsg-result a,.pmsg-result button { color:var(--green-dark); font-weight:750; border:0; background:transparent; cursor:pointer; }.pmsg-result small { color:var(--muted); }
.pmsg-fields select { width:100%; border:1px solid #b8c5b4; border-radius:8px; padding:8px; background:#fff; }
@media (max-width:760px) {
  body.drawer-open { overflow:hidden; }
  .app-shell { grid-template-columns:minmax(0,1fr); }
  .sidebar { position:fixed; z-index:40; inset:0 auto 0 0; width:min(86vw,320px); height:100vh; height:100dvh; padding-top:max(16px,env(safe-area-inset-top)); padding-bottom:max(16px,env(safe-area-inset-bottom)); transform:translateX(-105%); transition:transform .2s ease; box-shadow:12px 0 40px rgba(0,0,0,.28); }
  .sidebar.open { transform:translateX(0); }
  .sidebar-backdrop { display:block; position:fixed; z-index:35; inset:0; width:100%; height:100%; border:0; padding:0; background:rgba(5,12,7,.48); opacity:0; pointer-events:none; transition:opacity .2s ease; }
  .sidebar-backdrop.open { opacity:1; pointer-events:auto; }
  .close-sidebar,.mobile-menu { display:block; }
  .topbar { min-height:62px; gap:8px; padding:8px 10px; padding-top:max(8px,env(safe-area-inset-top)); }
  .mobile-menu { flex:0 0 40px; width:40px; padding:0; }
  .epc-logo { width:36px; height:36px; }
  .topbar h1 { font-size:15px; }
  .topbar p { max-width:38vw; font-size:10px; }
  .top-actions { gap:4px; }
  .top-actions button { min-height:40px; padding:6px 8px; font-size:12px; }
  .connection-error { margin:8px 10px 0; }
  .chat { padding:14px 10px 8px; }
  .welcome { margin:10vh auto; padding:0 14px; }
  .welcome h2 { font-size:21px; }
  .message { grid-template-columns:29px minmax(0,1fr); gap:7px; margin-bottom:15px; }
  .message.user { margin-left:0; }
  .message .avatar { width:28px; height:28px; border-radius:8px; font-size:9px; }
  .message-body { overflow-wrap:anywhere; }
  .message-actions button,.tool-result-row>button,.pmsg-result button { min-height:40px; }
  .quote-card dl div { align-items:start; }
  .quote-card dd { max-width:68%; overflow-wrap:anywhere; }
  .suggestions { margin:0; padding:6px 10px; }
  .suggestions button { min-height:38px; }
  .composer { margin:2px 8px 0; gap:4px; padding:5px; border-radius:14px; }
  .composer textarea { width:0; min-height:42px; max-height:92px; padding:10px 6px; resize:none; font-size:16px; }
  .composer select { display:none; }
  .composer button { flex:0 0 auto; min-width:42px; min-height:42px; padding:8px; }
  .composer .send { min-width:50px; }
  .composer-status { min-height:25px; padding:4px 12px max(7px,env(safe-area-inset-bottom)); }
  .composer-status span { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
  .composer-status span:last-child { display:none; }
  .tools-grid { grid-template-columns:1fr; }
  .tools-record,.tool-result-row,.pmsg-result>div { align-items:flex-start; flex-wrap:wrap; }
  .tools-record>button,.tool-result-row>button,.pmsg-result>div>button { margin-left:auto; }
  .dcr-card img { max-width:100%; height:auto; min-height:50px; }
  .pmsg-fields { grid-template-columns:1fr; }
  .pmsg-fields .wide { grid-column:auto; }
}
@media (max-width:560px) {
  .login-screen { align-items:stretch; padding:0; background:#fff; }
  .login-card { width:100%; min-height:100dvh; border:0; border-radius:0; padding:calc(28px + env(safe-area-inset-top)) 22px calc(24px + env(safe-area-inset-bottom)); box-shadow:none; }
  dialog,.tools-dialog { width:100vw; max-width:none; height:100vh; height:100dvh; max-height:none; margin:0; border-radius:0; }
  .dialog-head { padding:12px 14px; padding-top:max(12px,env(safe-area-inset-top)); }
  .tools-status,.tools-grid,.setup-chat,.setup-form,.setup-media,#setup-preview { padding-left:14px; padding-right:14px; }
  .tools-result { margin:0 14px 14px; }
  .setup-form { display:grid; }
  .setup-form textarea { min-height:92px; font-size:16px; }
  .setup-actions { grid-template-columns:1fr 1fr; }
  .setup-actions button { min-height:44px; }
  .setup-user { margin-left:8%; }
}
@media (max-width:370px) {
  .epc-logo { display:none; }
  .topbar p { max-width:34vw; }
  .top-actions button { padding-inline:6px; font-size:11px; }
  .composer .send { min-width:46px; font-size:12px; }
}

