/* Shared tokens come from control-center.css; chat does not redefine the app shell. */
.product-switch {
  display:flex; gap:4px; margin:3px 12px 12px; padding:4px;
  border:1px solid var(--line); border-radius:var(--radius-pill); background:var(--panel);
}
.product-switch button {
  flex:1; display:flex; justify-content:center; align-items:center; gap:6px;
  border:0; border-radius:var(--radius-pill); padding:10px 6px;
  font-size:13px; color:var(--muted); background:transparent; cursor:pointer;
}
.product-switch button[aria-pressed="true"] { background:var(--sidebar-hover); color:var(--text); box-shadow:inset 0 0 0 1px var(--line); font-weight:600; }
.product-switch button[aria-pressed="true"] span { color:var(--brand); }
.chat-sidebar>.nav-item { margin-bottom:14px; }
.chat-sidebar>.section-title { font-size:13px; }
.chat-sidebar>.section-title>span:last-child { font:12px ui-monospace,monospace; color:var(--muted); }
.chat-projects-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.chat-projects-heading button { border:1px solid var(--brand-border-subtle); border-radius:var(--radius-pill); padding:5px 9px; background:var(--brand-quiet); color:var(--text); font-size:10px; cursor:pointer; }
#chat-chat-projects { display:grid; gap:4px; max-height:28vh; min-height:0; overflow:auto; }
.chat-project-dialog { width:min(440px,calc(100vw - 32px)); padding:0; border:1px solid var(--line); border-radius:var(--radius-lg); background:var(--panel); color:var(--text); box-shadow:0 24px 90px rgba(0,0,0,.48); }
.chat-project-dialog::backdrop { background:rgba(0,0,0,.58); backdrop-filter:blur(8px); }
.chat-project-dialog form { padding:25px; }
.chat-project-dialog h2 { margin:0 0 20px; font-size:22px; }
.chat-project-dialog label { display:block; margin-bottom:8px; color:var(--muted); font-size:12px; }
.chat-project-dialog input { box-sizing:border-box; width:100%; padding:13px 15px; border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--bg); color:var(--text); font:inherit; font-size:13px; }
.chat-project-dialog-note { color:var(--muted); font-size:11px; line-height:1.55; }
.chat-project-dialog-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:20px; }
.chat-project-dialog-actions button { padding:9px 15px; border:1px solid var(--line); border-radius:var(--radius-pill); background:transparent; color:var(--text); font-size:12px; }
.chat-project-dialog-actions button[type=submit] { border-color:transparent; background:var(--brand); color:#1b2106; font-weight:650; }
#chat-chat-projects .empty-small { padding:6px 9px; font-size:11px; }
#chat-history button:not(.sidebar-action-toggle) {
  display:block; width:100%; padding:11px 12px; border:0;
  border-radius:var(--radius-pill); background:transparent; color:var(--muted);
  font-size:13px; text-align:left; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; cursor:pointer;
}
#chat-history button:not(.sidebar-action-toggle):hover,#chat-history button:not(.sidebar-action-toggle)[aria-current="true"] { background:var(--sidebar-hover); color:var(--text); }
#chat-history .muted { padding:8px 12px; font-size:13px; color:var(--muted); }
.desktop[data-product="chat"] .top-project,.desktop[data-product="chat"] .workspace-status { display:none; }
.desktop[data-product="chat"] .main-stage { grid-template-rows:auto minmax(0,1fr); }
.dc-chat-view { min-width:0; overflow:hidden; flex-direction:column; }
.dc-chat-scroll { flex:1; min-height:0; overflow:auto; overscroll-behavior:contain; scrollbar-gutter:stable; padding:16px 30px 30px; }
.dc-chat-welcome { text-align:center; max-width:730px; margin:clamp(24px,8vh,90px) auto 30px; }
.dc-chat-welcome h1 { font-size:32px; font-weight:540; letter-spacing:-.025em; line-height:1.2; margin:0; }
.dc-chat-welcome p { color:var(--muted); font-size:14px; line-height:1.7; margin:14px 0 28px; }
.dc-chat-suggestions { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; text-align:left; }
.dc-chat-suggestions button { display:flex; flex-direction:column; align-items:flex-start; padding:20px; border:1px solid var(--line); border-radius:var(--radius-md); background:var(--panel); cursor:pointer; }
.dc-chat-suggestions button:hover { background:var(--panel2); }
.dc-chat-suggestions span { color:var(--brand); font-size:21px; margin-bottom:20px; }
.dc-chat-suggestions strong { font-size:14px; font-weight:550; }
.dc-chat-suggestions small { font-size:13px; line-height:1.5; color:var(--muted); margin-top:6px; }
.dc-chat-messages { display:flex; flex-direction:column; gap:28px; max-width:800px; margin:auto; }
.dc-chat-messages>.message { white-space:pre-wrap; overflow-wrap:anywhere; font-size:15px; line-height:1.8; }
.dc-chat-messages>.user { max-width:85%; align-self:flex-end; background:var(--brand-quiet); border:1px solid var(--brand-border-subtle); border-radius:var(--radius-md); padding:14px 20px; }
.dc-chat-messages>.assistant { width:100%; padding:0 4px; white-space:normal; }
.dc-chat-messages>.assistant p { margin:0 0 14px; }
.dc-chat-messages>.assistant pre { padding:18px; overflow:auto; white-space:pre; border:1px solid var(--line); border-radius:var(--radius-md); background:var(--bg); font:13px/1.7 ui-monospace,monospace; }
.dc-chat-messages>.assistant code { font-family:ui-monospace,monospace; }
.dc-chat-messages>.assistant::before { content:"✦ Chat"; display:block; color:var(--brand); font-size:13px; font-weight:600; margin-bottom:10px; }
.dc-chat-messages>.pending { color:var(--muted); }
.dc-chat-messages>.error,#chat-notice.error { color:#ff9e9e; }
.dc-chat-composer-wrap { width:min(100%,850px); padding:0 26px 18px; margin:auto; }
.dc-chat-composer-wrap>p:first-child { color:var(--muted); font-size:13px; line-height:1.5; min-height:15px; margin:5px 3px 9px; }
.dc-chat-composer { background:var(--panel); border:1px solid var(--line); border-radius:var(--composer-radius); padding:18px; box-shadow:var(--shadow); }
.dc-chat-composer:focus-within { border-color:#637168; }
#chat-prompt { display:block; width:100%; resize:none; border:0; background:transparent; color:var(--text); font-size:16px; line-height:1.6; max-height:160px; outline:none; }
#chat-prompt::placeholder { color:var(--muted); }
.dc-chat-composer-bottom { display:flex; gap:12px; align-items:center; justify-content:space-between; padding-top:12px; font-size:13px; }
.dc-chat-composer-bottom small { color:var(--muted); font-size:13px; }
.dc-chat-composer-bottom button { border:0; border-radius:50%; background:var(--brand); color:#1a2005; width:40px; height:40px; font-size:21px; cursor:pointer; }
.dc-chat-composer-bottom #chat-stop { width:auto; font-size:13px; padding:0 16px; border-radius:var(--radius-pill); background:var(--panel2); color:var(--text); }
.dc-chat-composer-bottom button:disabled { opacity:.45; cursor:default; }
.dc-chat-disclaimer { color:var(--muted); font-size:12px; text-align:center; line-height:1.5; margin:10px 0 0; }
.dc-sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
[hidden] { display:none!important; }
@media(max-width:760px) {
  .desktop[data-product="chat"] { height:100dvh; min-height:0; display:flex; flex-direction:column; gap:8px; }
  .desktop[data-product="chat"] .sidebar { display:flex; flex-shrink:0; overflow:hidden; }
  .desktop[data-product="chat"] .sidebar-brand,
  .desktop[data-product="chat"] .sidebar-footer,.desktop[data-product="chat"] .sidebar>[data-code-only] { display:none; }
  .desktop[data-product="chat"] .product-switch { max-width:350px; width:calc(100% - 24px); margin:8px 12px; }
  .desktop[data-product="chat"] .chat-sidebar { flex:none; padding:3px 12px 8px; flex-direction:row; align-items:center; gap:8px; overflow:hidden; }
  .desktop[data-product="chat"] .chat-sidebar>.nav-item { width:auto; flex:none; margin:0; padding:0 8px; gap:5px; }
  .desktop[data-product="chat"] .chat-sidebar>.section-title { display:none; }
  .desktop[data-product="chat"] .chat-projects-heading { display:none; }
  .desktop[data-product="chat"] #chat-chat-projects { display:flex; flex:1; gap:4px; max-height:60px; overflow:auto; min-width:0; }
  .desktop[data-product="chat"] #chat-chat-projects .chat-project-folder { min-width:135px; max-width:175px; flex:none; align-self:flex-start; }
  .desktop[data-product="chat"] #chat-chat-projects .project-folder-chats,.desktop[data-product="chat"] #chat-chat-projects .project-folder-actions { display:none; }
  .desktop[data-product="chat"] .chat-sidebar>#chat-create-project { width:auto; flex:none; margin:0; padding:0 8px; }
  .desktop[data-product="chat"] #chat-history { display:flex; flex:1; gap:4px; overflow:auto; min-width:0; }
  .desktop[data-product="chat"] #chat-history button:not(.sidebar-action-toggle) { width:auto; max-width:160px; flex:none; padding:8px; }
  .desktop[data-product="chat"] #chat-history .muted { white-space:nowrap; margin:0; }
  .desktop[data-product="chat"] .main-stage { flex:1; height:auto; min-height:0; overflow:hidden; }
  .desktop[data-product="chat"] .main-stage>.topbar { position:relative; padding:10px 12px; }
  .desktop[data-product="chat"] .context-pill { display:none; }
  .dc-chat-scroll { padding:10px 16px 24px; }
  .dc-chat-welcome { margin:24px auto; }
  .dc-chat-welcome h1 { font-size:25px; }
  .dc-chat-suggestions { grid-template-columns:1fr; gap:8px; }
  .dc-chat-suggestions button { padding:14px 18px; }
  .dc-chat-suggestions span { display:none; }
  .dc-chat-composer-wrap { padding:0 12px 12px; }
  .dc-chat-composer { padding:16px; }
  .dc-chat-composer-bottom small { display:none; }
}
@media(prefers-reduced-motion:reduce) { .dc-chat-view * { scroll-behavior:auto!important; } }

.chat-research{margin:16px 0 4px;padding-top:14px;border-top:1px solid rgba(128,128,128,.2);font-size:13px}
.chat-research-label{font-weight:600;opacity:.85}.chat-research p{font-size:12px;opacity:.65;overflow-wrap:anywhere;margin:6px 0}
.chat-source-cards{display:flex;gap:8px;overflow-x:auto;padding:10px 0;max-width:100%;overscroll-behavior:contain}
.chat-source-card{display:flex;flex-direction:column;gap:6px;min-width:155px;max-width:220px;padding:12px 15px;border-radius:var(--radius-lg);border:1px solid rgba(128,128,128,.25);background:rgba(128,128,128,.07);text-decoration:none;color:inherit;flex-shrink:0}
.chat-source-card strong{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-source-card small{font-size:11px;opacity:.65}.chat-source-card:hover{background:rgba(128,128,128,.15)}.chat-source-card:focus-visible{outline:2px solid var(--brand-focus,var(--accent,#d3e78e));outline-offset:2px}

.chat-citation{color:inherit;text-decoration:underline;text-underline-offset:3px;border-radius:var(--radius-sm);overflow-wrap:anywhere}.chat-citation:hover{color:var(--brand,var(--accent,#d4ff3f))}

.research-active:before{content:"";display:inline-block;width:7px;height:7px;margin-right:8px;border-radius:50%;background:var(--brand,var(--accent,#d4ff3f));animation:chat-research-pulse 1.4s ease-in-out infinite}@keyframes chat-research-pulse{50%{opacity:.3;transform:scale(.75)}}@media(prefers-reduced-motion:reduce){.research-active:before{animation:none}}

.chat-memory-panel{padding:22px;margin:12px 0;border:1px solid rgba(128,128,128,.25);border-radius:var(--radius-lg,24px);background:var(--panel,#222)}.chat-memory-panel p{font-size:13px;line-height:1.6;opacity:.8}.chat-memory-panel label{display:block;margin-top:16px;font-size:13px}.chat-memory-panel textarea{display:block;box-sizing:border-box;width:100%;resize:vertical;min-height:100px;padding:14px;border-radius:var(--radius-lg,20px);border:1px solid rgba(128,128,128,.3);background:transparent;color:inherit;margin-top:8px;font:inherit}.chat-memory-actions{display:flex;gap:8px;margin:8px 0}.chat-memory-panel button{border:1px solid rgba(128,128,128,.25);border-radius:var(--radius-pill,999px);padding:8px 14px;background:transparent;color:inherit;cursor:pointer}

@media(min-width:761px){.desktop[data-product="chat"] .main-stage{grid-template-rows:minmax(0,1fr)}.desktop[data-product="chat"] .topbar{display:none}}
