/* Success: fixed chat reflows the desktop content and becomes a full-width mobile drawer. */
:root { --page-chat-width: 410px; }
body.page-chat-open { padding-right: var(--page-chat-width); }
.page-chat { position:fixed; inset:0 0 0 auto; width:var(--page-chat-width); z-index:220; display:flex; flex-direction:column; background:#101714; color:#e5ece8; border-left:1px solid #39463f; box-shadow:-12px 0 40px #0003; font-family:inherit; font-size:14px; line-height:1.5; }
.page-chat.hidden { display:none; }
.page-chat * { box-sizing:border-box; }
/* Success: the page label and close control share one compact row, leaving more height for messages. */
.page-chat-context-top {display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:32px;}
.page-chat-context-top strong {min-width:0;overflow-wrap:anywhere;}
.page-chat [data-chat-close] {flex:none;width:32px;height:32px;padding:0;font-size:18px;line-height:1;}
.page-chat-resizer {position:absolute;inset:0 auto 0 -7px;width:14px;z-index:1;cursor:col-resize;touch-action:none;}
.page-chat-resizer::before {content:"";position:absolute;inset:0 auto 0 6px;width:2px;background:#39463f;transition:background 120ms ease;}
.page-chat-resizer:hover::before,.page-chat-resizer:focus-visible::before,body.page-chat-resizing .page-chat-resizer::before {background:#59d7aa;}
.page-chat-resizer:focus-visible {outline:2px solid #92bf95;outline-offset:-2px;}
body.page-chat-resizing,body.page-chat-resizing * {cursor:col-resize!important;user-select:none!important;}
.page-chat button {font:inherit;cursor:pointer;color:inherit;background:#1c2821;border:1px solid #3b4b41;border-radius:8px;padding:7px 11px;}
.page-chat button:hover:not(:disabled) {background:#2b3b31;}
.page-chat button:disabled {opacity:.55;cursor:wait;}
.page-chat button:focus-visible,.page-chat textarea:focus-visible,.page-chat select:focus-visible {outline:2px solid #92bf95;outline-offset:2px;}
.page-chat-context {padding:12px 16px 10px;border-bottom:1px solid #334038;}
.page-chat-context > span {display:block;overflow-wrap:anywhere;}
.page-chat-context > span {font-size:11px;color:#b0beb5;margin:4px 0;}
.page-chat details {font-size:12px;max-height:30vh;overflow:auto;}
.page-chat summary {cursor:pointer;color:#becfc2;}
.page-chat details label {display:grid;gap:4px;margin:8px 0;}
.page-chat select {width:100%;color:inherit;background:#142119;padding:8px;border:1px solid #435448;border-radius:7px;}
.page-chat-messages {flex:1;min-height:60px;overflow-y:auto;overscroll-behavior:contain;padding:16px;}
.page-chat-message {margin-bottom:16px;padding:12px;border-radius:12px;background:#19241d;overflow-wrap:anywhere;}
.page-chat-message.user {background:#293a2f;margin-left:25px;}
.page-chat-message > strong {font-size:11px;color:#b7c6bc;}
.page-chat-content {white-space:pre-wrap;line-height:1.6;margin:6px 0;}
.page-chat-message small {display:block;color:#adbbb2;font-size:10px;margin:7px 0;}
.page-chat-source {font-size:11px!important;margin:3px;}
.page-chat-starters {padding:0 20px 16px;}
.page-chat-starters button {display:block;margin-top:8px;text-align:left;width:100%;}
/* Previous: routine reply status occupied a row above the input after every successful answer. */
.page-chat-status {padding:0 18px;font-size:12px;color:#c6d5cb;margin:8px 0;}
.page-chat-status:empty {display:none;}
/* Success: the message field and send action read as one compact composer at desktop and phone widths. */
.page-chat-composer {padding:12px 16px max(16px,env(safe-area-inset-bottom));border-top:1px solid #334038;background:#101714;}
.page-chat-prompt-label {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;}
.page-chat-composer-surface {border:1px solid #41564a;border-radius:14px;background:#111d16;transition:border-color 140ms ease,box-shadow 140ms ease;}
.page-chat-composer-surface:focus-within {border-color:#70dcb3;box-shadow:0 0 0 3px #70dcb326;}
.page-chat-composer textarea {display:block;width:100%;min-height:64px;max-height:160px;resize:none;border:0;border-radius:14px;background:transparent;color:#eef4ef;padding:12px 13px 2px;font:inherit;line-height:1.45;}
.page-chat-composer textarea::placeholder {color:#9faea4;}
.page-chat-composer textarea:focus-visible {outline:none;}
.page-chat-composer-actions {display:flex;gap:8px;align-items:center;justify-content:flex-end;padding:5px 8px 8px;}
.page-chat-composer-actions span {font-size:10px;margin-right:auto;color:#aabbb0;line-height:1.3;}
.page-chat [data-chat-stop] {background:transparent;border-color:transparent;color:#c4d0c8;}
.page-chat [data-chat-send] {min-height:34px;padding:6px 16px;border:1px solid #55d5a5;border-radius:9px;background:#36c993;color:#08180f;font-weight:700;line-height:1.2;}
.page-chat [data-chat-send]:hover:not(:disabled) {background:#65dfad;border-color:#65dfad;}
.page-chat-tools {display:flex;gap:8px;flex-wrap:wrap;}
.page-chat-action {border:1px solid #799481;border-radius:9px;padding:12px;margin-top:12px;background:#101c14;}
.page-chat-action > strong {font-size:13px;}
.page-chat-action p {font-size:12px;}
.page-chat-action dl {margin:10px 0;}
.page-chat-action dt {font-size:11px;color:#b8cdbf;}
.page-chat-action dd {margin:0 0 8px;font-size:13px;white-space:pre-wrap;}
.page-chat [hidden] {display:none!important;}
@media(min-width:901px){body.page-chat-open .app-shell{width:100%;min-width:0;} body.page-chat-open .project-overview-grid{grid-template-columns:1fr;}}
/* Previous: widening chat clipped Projects filters and row actions; success: the main list reflows inside its smaller pane. */
@media(min-width:901px){
  body.page-chat-open.page-chat-tight #dashboard-screen .dashboard-controls {grid-template-columns:repeat(2,minmax(0,1fr));}
  body.page-chat-open.page-chat-tight #dashboard-screen .project-card {grid-template-columns:minmax(0,1fr);gap:8px;height:auto;min-height:0;overflow:visible;}
  body.page-chat-open.page-chat-tight #dashboard-screen .project-record-main {grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;}
  body.page-chat-open.page-chat-tight #dashboard-screen .project-record-footer {justify-content:flex-start;min-width:0;flex-wrap:wrap;}
}
@media(max-width:900px){body.page-chat-open{padding-right:0;overflow:hidden}.page-chat{width:100%;z-index:250;}.page-chat-resizer{display:none;}.page-chat-composer{padding-bottom:max(16px,env(safe-area-inset-bottom));}}
@media print {.page-chat,#open-chat-button{display:none!important;}body.page-chat-open{padding-right:0;}}

/* Success: compact, bounded source details preserve conversation space on small screens. */
.page-chat-content p {margin:0 0 8px;white-space:normal;}
.page-chat-content ul,.page-chat-content ol {margin:6px 0;padding-left:22px;white-space:normal;}
.page-chat-content code {background:#0b120e;border-radius:4px;padding:1px 4px;}
.page-chat-message.incomplete {border:1px solid #62645a;}
.page-chat-inspector {margin-top:10px;padding:10px;border:1px solid #435448;border-radius:8px;max-height:260px;overflow:auto;font-size:12px;}
.page-chat-inspector > button {display:block;margin:6px 0;}
.page-chat-inspector dl {margin:6px 0;}
.page-chat-inspector dt {color:#b7c6bc;font-size:11px;}
.page-chat-inspector dd {margin:0 0 6px 8px;white-space:pre-wrap;}
@media(max-width:900px){.page-chat details{max-height:22vh;}.page-chat-inspector{max-height:200px;}}
