.dense-workspace { display: grid; grid-template-columns: 270px minmax(0, 1fr); flex: 1; min-height: 540px; height: calc(100dvh - 112px); max-height: 1200px; border: 1px solid var(--line); background: #fff; position: relative; }
.dense-workspace[hidden] { display: none; }
.dense-sidebar { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-right: 1px solid var(--line); background: #fafaf9; }
.dense-sidebar-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 18px 10px; }
.dense-sidebar-header h2 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.dense-sidebar-header button { padding: 4px 8px; min-height: 32px; }
.dense-sidebar > .button { margin: 8px 16px; }
.dense-sidebar input[type=search] { min-width: 0; width: calc(100% - 32px); margin: 8px 16px 16px; font-size: 13px; padding: 9px; }
.dense-project-list { padding: 0 8px 24px; margin: 0; overflow-y: auto; list-style: none; flex: 1; min-height: 0; }
.dense-project-button, .dense-conversation-button { display: flex; width: 100%; align-items: center; gap: 9px; border: 0; background: transparent; text-align: left; color: var(--text); cursor: pointer; border-radius: 4px; padding: 11px 10px; font: inherit; font-size: 13px; }
.dense-project-button:hover, .dense-conversation-button:hover { background: #f0f0ed; }
.dense-project-button.selected { font-weight: 650; }
.dense-project-mark { display: inline-flex; align-items: center; justify-content: center; height: 23px; width: 23px; flex: 0 0 auto; border: 1px solid #d4d4ce; font-size: 10px; font-weight: 600; border-radius: 4px; background: #fff; }
.dense-project-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dense-project-button small { color: var(--muted); white-space: nowrap; font-size: 10px; }
.dense-conversations { list-style: none; margin: 0 0 8px 22px; padding: 0 0 0 8px; border-left: 1px solid var(--line); }
.dense-conversation-button { padding: 9px 10px; line-height: 1.5; overflow: hidden; display: block; white-space: nowrap; text-overflow: ellipsis; }
.dense-conversation-button.selected { background: #e9e9e4; font-weight: 550; }
.dense-muted { color: var(--muted); font-size: 12px; }
.dense-no-conversations { padding: 10px; }
.dense-sidebar-footer { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-top: 1px solid var(--line); font-size: 12px; }
.dense-sidebar-footer a { color: var(--text); text-decoration: none; }
.dense-sidebar-footer .dense-account { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dense-main { display: flex; flex-direction: column; position: relative; min-width: 0; min-height: 0; }
.dense-header { padding: 17px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.dense-header-titles { min-width: 0; flex: 1; }
.dense-header h2 { margin: 0; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dense-header p { color: var(--muted); margin: 5px 0 0; font-size: 12px; }
.dense-header-actions { display: flex; align-items: center; gap: 8px; }
.dense-header-actions button { min-height: 34px; padding: 6px 10px; font-size: 12px; }
.dense-status { font-size: 10px; color: var(--muted); margin-left: 10px; font-weight: 400; }
.dense-status.online { color: #427450; }
.dense-connect { width: min(560px, calc(100% - 40px)); margin: 28px auto 16px; padding: 22px; border: 1px solid var(--line); border-radius: 6px; }
.dense-connect h3 { font-size: 19px; margin: 0 0 10px; }
.dense-connect p { font-size: 13px; line-height: 1.7; color: var(--muted); }
.dense-connect form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.dense-connect .field { flex: 1; min-width: 180px; font-size: 12px; }
.dense-connect input { width: 100%; min-width: 0; }
.dense-connect .button { font-size: 12px; }
.dense-error { flex: 0 0 auto; padding: 10px 18px; margin: 0; color: #983f35; background: #fdf4f1; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.dense-runtime-hint { margin: 0; padding: 7px 20px; color: var(--muted); background: #fafaf8; border-bottom: 1px solid var(--line); font-size: 11px; line-height: 1.6; }
.dense-welcome { margin: auto; padding: 40px 28px; text-align: center; max-width: 560px; }
.dense-welcome-mark { display: inline-flex; width: 50px; height: 50px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 12px; font-size: 21px; font-weight: 600; margin-bottom: 20px; }
.dense-welcome h2 { font-size: clamp(23px, 3vw, 31px); letter-spacing: -.04em; margin: 0 0 14px; }
.dense-welcome p { color: var(--muted); line-height: 1.8; font-size: 14px; }
.dense-history { overflow-y: auto; overscroll-behavior: contain; min-height: 0; flex: 1; padding: 24px clamp(20px, 5vw, 80px); }
.dense-messages { list-style: none; padding: 0; margin: 0 auto; max-width: 860px; }
.dense-message { margin: 0 0 28px; min-width: 0; }
.dense-message-label { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 650; margin-bottom: 10px; }
.dense-run-state { font-size: 10px; font-weight: 400; color: var(--muted); }
.dense-user-message .dense-message-text { background: #f4f4f0; padding: 13px 17px; border-radius: 7px; width: fit-content; max-width: 100%; }
.dense-message-text p { margin: 0 0 14px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; font-size: 14px; }
.dense-message-text p:last-child { margin-bottom: 0; }
.dense-message-text h3 { font-size: 20px; margin: 20px 0 12px; }
.dense-message-text h4 { font-size: 16px; margin: 18px 0 10px; }
.dense-message-text ul, .dense-message-text ol { padding-left: 24px; font-size: 14px; line-height: 1.8; }
.dense-message-text :not(pre) > code { padding: 2px 5px; border-radius: 3px; background: #f0f0eb; font-size: .9em; }
.dense-message-text a { color: #315f89; text-underline-offset: 3px; }
.dense-message-text blockquote { border-left: 2px solid #d1d1c9; color: var(--muted); margin: 15px 0; padding-left: 16px; font-size: 14px; line-height: 1.8; }
.dense-table { overflow-x: auto; margin: 16px 0; }
.dense-table table { border-collapse: collapse; width: 100%; font-size: 13px; }
.dense-table th, .dense-table td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.dense-code { border: 1px solid var(--line); border-radius: 5px; overflow: hidden; margin: 14px 0; }
.dense-code-bar { display: flex; align-items: center; justify-content: space-between; background: #f5f5f1; font-size: 11px; padding: 7px 12px; color: var(--muted); }
.dense-code-bar button, .dense-message-actions button { border: 0; background: none; padding: 0; color: inherit; font-size: 11px; cursor: pointer; }
.dense-code pre { overflow-x: auto; padding: 15px; margin: 0; font-size: 12px; line-height: 1.8; }
.dense-working { color: var(--muted); font-size: 13px; line-height: 1.7; }
.dense-run-error { color: #983f35; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.dense-message-actions { display: flex; gap: 16px; color: var(--muted); align-items: center; margin-top: 12px; font-size: 10px; }
.dense-execution { border: 1px solid var(--line); padding: 10px 12px; border-radius: 4px; font-size: 12px; margin: 12px 0; }
.dense-execution summary { cursor: pointer; color: var(--muted); }
.dense-execution pre { max-height: 300px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11px; }
.dense-composer { margin: 0 clamp(16px, 4vw, 60px) 18px; padding: 14px; border: 1px solid #c9c9c1; border-radius: 9px; background: #fff; flex: 0 0 auto; }
.dense-composer:focus-within { border-color: #8d8d83; }
.dense-composer textarea { display: block; width: 100%; min-height: 70px; max-height: 240px; resize: vertical; padding: 2px; border: none; box-shadow: none; outline: none; font: inherit; font-size: 14px; line-height: 1.7; }
.dense-composer-toolbar { display: flex; gap: 10px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.dense-model { display: inline-flex; gap: 6px; align-items: center; min-width: 0; flex: 1; font-size: 11px; color: var(--muted); }
.dense-model select { min-width: 0; max-width: 210px; font-size: 11px; border: none; padding: 6px; background: #f7f7f4; }
.dense-subagents { display: flex; flex: 0 0 auto; gap: 5px; font-size: 11px; align-items: center; color: var(--muted); white-space: nowrap; }
.dense-subagents input { flex: 0 0 auto; width: 14px; height: 14px; margin: 0; }
.dense-composer-toolbar .button { min-height: 34px; font-size: 12px; padding: 6px 13px; }
.dense-attachments { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.dense-file { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; border: 1px solid var(--line); border-radius: 4px; padding: 5px 9px; margin-top: 5px; color: var(--text); font-size: 11px; text-decoration: none; overflow-wrap: anywhere; }
.dense-file button { border: 0; background: transparent; cursor: pointer; padding: 0 3px; }
#denseUploadStatus:empty { display: none; }
.dense-running-dot { display: inline-block; width: 5px; height: 5px; background: #547d59; border-radius: 50%; margin-right: 6px; }
.dense-new-messages { position: absolute; bottom: 170px; right: 30px; border: 1px solid var(--line); padding: 8px 12px; background: #fff; border-radius: 5px; font-size: 12px; cursor: pointer; }
.dense-dialog { width: min(420px, calc(100% - 32px)); padding: 26px; border: 1px solid var(--line); border-radius: 8px; }
.dense-dialog::backdrop { background: rgb(25 25 20 / .3); }
.dense-dialog h2 { font-size: 21px; margin: 0 0 16px; }
.dense-dialog p { color: var(--muted); font-size: 13px; line-height: 1.7; }
.dense-dialog .field { font-size: 13px; margin: 18px 0; }
.dense-dialog input { width: 100%; }
.dense-dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }
#denseProjectsToggle, #denseSidebarClose { display: none; }
@media (max-width: 950px) { .dense-workspace { grid-template-columns: 225px minmax(0, 1fr); } .dense-header { padding: 15px; } .dense-header-actions { flex-wrap: wrap; justify-content: flex-end; gap: 5px; } .dense-header-actions button { font-size: 11px; padding: 5px 8px; } }
@media (max-width: 700px) {
  .dense-workspace { display: flex; min-height: 560px; height: calc(100dvh - 85px); border-left: 0; border-right: 0; }
  .dense-main { flex: 1; width: 100%; }
  .dense-sidebar { display: none; position: absolute; inset: 0 auto 0 0; width: min(290px, 90%); z-index: 6; border-right: 1px solid #b8b8af; }
  .dense-sidebar.open { display: flex; }
  #denseProjectsToggle, #denseSidebarClose { display: inline-flex; }
  .dense-header { gap: 10px; padding: 12px; align-items: flex-start; }
  .dense-header h2 { max-width: 160px; font-size: 14px; }
  .dense-header-actions { max-width: 130px; }
  .dense-header-actions button { min-height: 30px; font-size: 10px; }
  .dense-status { display: block; margin-left: 0; margin-top: 5px; }
  .dense-history { padding: 20px 16px; }
  .dense-composer { margin: 0 10px 10px; padding: 11px; }
  .dense-composer-toolbar { gap: 7px; }
  .dense-composer-toolbar { display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content; }
  #denseAttach { grid-column: 1; grid-row: 1; }
  .dense-model { grid-column: 2 / 4; grid-row: 1; }
  .dense-model > span { flex: 0 0 auto; }
  .dense-model select { width: 100%; max-width: 100%; flex: 1; }
  .dense-subagents { grid-column: 1 / 3; grid-row: 2; justify-self: start; }
  #denseStop { grid-column: 2; grid-row: 2; justify-self: end; }
  #denseSend { grid-column: 3; grid-row: 2; justify-self: end; }
  #denseCancelUpload { grid-column: 1 / 4; grid-row: 3; }
  .dense-subagents { font-size: 10px; }
  .dense-header-titles p { max-width: 130px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dense-connect { margin: 16px auto; padding: 17px; }
  .dense-connect .field { min-width: 100%; }
}
