:root { --chat-font-size: 14px; }
.approval-panel { flex-shrink: 0; max-height: 48dvh; overflow: auto; margin: 9px 14px 0; padding: 14px; border: 1px solid #e4be70; border-radius: 15px; background: #fff8e7; color: #684d20; }
.approval-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; }
.approval-heading > span { font-size: 10px; }
.approval-card { border-top: 1px solid #ead7b2; margin-top: 11px; padding-top: 12px; }
.approval-card > strong { font-size: 13px; }
.approval-card p, .approval-card summary { font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.approval-command { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 180px; overflow: auto; padding: 11px; background: #fffdf6; border: 1px solid #eadfc8; border-radius: 9px; font-size: 12px; line-height: 1.6; }
.approval-actions { display: flex; gap: 9px; margin-top: 10px; }
.approval-actions > button { flex: 1; min-height: 43px; font-size: 12px; }
.approval-decline { background: #fff; border: 1px solid #d5bea1; border-radius: 10px; color: #805634; }
.approval-status { margin-bottom: 0; }
.sidebar { width: 328px; min-height: 0; padding: 22px 16px 12px; overflow: hidden; }
.side-brand { flex-shrink: 0; padding: 0 4px 18px; }
.side-brand span { letter-spacing: 0; font-size: 11px; }
.nav-search { display: flex; align-items: center; gap: 6px; flex-shrink: 0; background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 0 9px; }
.nav-search > span { font-size: 27px; color: #7c8d82; }
.nav-search input[type=search] { min-width: 0; border: 0; background: transparent; padding: 13px 3px; font-size: 14px; }
.nav-search input::-webkit-search-cancel-button { display: none; }
.nav-tabs { display: flex; flex-shrink: 0; gap: 4px; padding: 4px; background: #e4ebe2; border-radius: 12px; margin: 14px 0 3px; }
.nav-tabs button { flex: 1; border: 0; background: transparent; border-radius: 9px; padding: 11px; font-size: 14px; color: #79877b; }
.nav-tabs button[aria-selected=true] { background: #fff; color: #22593f; font-weight: 600; box-shadow: 0 1px 4px #183b2610; }
.nav-tabs span { font-size: 11px; margin-left: 4px; }
.nav-panel { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.nav-panel .section-label { flex-shrink: 0; padding: 9px 6px; font-size: 12px; letter-spacing: 0; min-height: 43px; }
.nav-panel .section-label > div { display: flex; gap: 4px; }
.section-toggle { display: flex; flex: 1; min-width: 0; gap: 8px; align-items: center; align-self: stretch; min-height: 42px; border: 0; background: transparent; text-align: left; padding: 0 3px; color: inherit; font-size: 12px; }
.section-toggle > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fold-chevron { color: #647f69; font-size: 19px; transition: transform .15s; }
.section-toggle[aria-expanded=false] .fold-chevron { transform: rotate(-90deg); }
.nav-panel.collapsed { flex: 0 0 auto; }
.sidebar[data-page=groups].groups-both-open #projects-panel { flex: 0 1 34%; }
.sidebar[data-page=groups] #threads-panel { border-top: 1px solid var(--line); margin-top: 5px; }
.sidebar[data-page=groups] .current-project { padding: 7px; }
.sidebar[data-page=groups] .nav-panel .section-label { padding-top: 0; padding-bottom: 0; }
.sidebar[data-page=groups] #threads-panel.collapsed { margin-top: 5px; }
.sidebar .projects, .sidebar .threads { flex: 1; min-height: 0; max-height: none; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; }
.project-item, .thread-item { display: flex; align-items: center; gap: 3px; border-radius: 13px; margin-bottom: 4px; }
.project-row { flex: 1; min-width: 0; min-height: 56px; margin: 0; padding: 12px; font-size: 15px; border-radius: 12px; }
.project-title { overflow-wrap: anywhere; line-height: 1.5; }
.pin-project { width: 40px; height: 44px; font-size: 22px; color: #a3ada2; }
.pin-project.pinned { color: #9c7a29; }
.current-project { display: flex; align-items: center; flex-shrink: 0; gap: 10px; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 13px 7px; text-align: left; }
.current-project strong { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 15px; }
.current-project > span:first-child { font-size: 27px; line-height: 1; }
.current-project > span:last-child { color: #7f8e7d; font-size: 11px; flex-shrink: 0; }
.list-group { font-size: 11px; color: #83917f; padding: 13px 10px 7px; }
.thread-row { flex: 1; min-width: 0; min-height: 62px; margin: 0; padding: 12px 11px; border-radius: 12px; }
.thread-row strong { font-size: 14px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.55; overflow-wrap: anywhere; }
.thread-row small { font-size: 10px; margin-top: 4px; }
.thread-menu { width: 42px; height: 46px; font-size: 25px; }
.thread-item > input { width: 19px; height: 19px; margin: 0 4px 0 8px; accent-color: var(--green); flex-shrink: 0; }
.bulk-selected { background: #e0ebde; }
.bulk-toolbar { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 9px 3px; border-bottom: 1px solid var(--line); font-size: 11px; }
.bulk-toolbar span { margin-right: auto; }
.bulk-toolbar button { background: white; border: 1px solid var(--line); border-radius: 8px; padding: 8px 6px; font-size: 11px; }
.sidebar .new-thread { min-height: 46px; flex-shrink: 0; margin-top: 12px; justify-content: center; font-size: 14px; }
.sidebar-bottom { flex-shrink: 0; padding: 12px 4px 0; margin-top: 12px; gap: 8px; }
.sidebar-bottom #preferences-open { margin-left: auto; }
.sidebar-bottom #logout { margin-left: 0; }
.sidebar-bottom .icon-btn { width: 38px; height: 40px; }
.sidebar .text-btn { flex-shrink: 0; margin-bottom: 0; padding: 12px; }
.action-list { display: flex; flex-direction: column; margin-top: 18px; }
.action-list > button { display: flex; justify-content: space-between; border: 0; border-bottom: 1px solid var(--line); padding: 17px 5px; font-size: 14px; background: transparent; text-align: left; }
dialog select { width: 100%; padding: 13px; border: 1px solid var(--line); background: #fff; border-radius: 10px; color: var(--ink); font: inherit; font-size: 15px; margin-bottom: 20px; }
#rename-form label { margin-top: 20px; }
#rename-form .primary, #confirm-archive, #save-model { width: 100%; margin-top: 18px; }
#thread-menu-title { max-width: 85%; overflow-wrap: anywhere; line-height: 1.5; font-size: 17px; }
#archive-list { max-height: 32dvh; overflow: auto; font-size: 13px; }
#archive-list p { padding: 8px 0; margin: 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.model-button { min-width: 0; max-width: 65%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 1px solid #dce6d6; border-radius: 8px; background: #edf3e9; padding: 7px 9px; font-size: 11px; color: #436c50; text-align: left; }
.composer-meta { align-items: center; gap: 7px; }
.knowledge-switch { flex-shrink: 0; }
.message { margin-top: 13px; margin-bottom: 17px; }
.message.assistant { background: #f0f3ee; border: 1px solid #e1e7dc; border-radius: 17px 17px 17px 5px; padding: 15px 17px 12px; margin-right: 20px; }
.message.user { background: #e2eddf; border: 1px solid #d8e5d5; padding: 14px 17px; border-radius: 17px 17px 5px 17px; margin-top: 13px; margin-bottom: 17px; }
.message.assistant .message-text { padding-left: 0; }
.message-text { font-size: var(--chat-font-size); line-height: 1.9; }
.message .copy-message { padding-left: 0; min-height: 33px; }
.message.commentary { opacity: 1; background: #f7f9f4; border-style: dashed; }
.message.commentary .message-text { padding-left: 11px; margin-left: 0; font-size: calc(var(--chat-font-size) - 1px); color: #697c65; }
[data-density=compact] .project-row { min-height: 46px; padding-top: 8px; padding-bottom: 8px; }
[data-density=compact] .thread-row { min-height: 49px; padding-top: 7px; padding-bottom: 7px; }
[data-density=compact] .thread-row small { margin-top: 2px; }
[data-density=compact] .list-group { padding-top: 8px; }
@media (max-width:760px) {
  .sidebar { width: 100%; height: 100dvh; padding: max(16px, env(safe-area-inset-top)) 16px max(12px, env(safe-area-inset-bottom)); box-shadow: none; }
  .sidebar .side-brand { padding-bottom: 14px; }
  .sidebar .projects { max-height: none; }
  .side-brand .icon-btn { width: 42px; height: 42px; }
  .nav-search input[type=search] { font-size: 16px; }
  .topbar { height: 58px; min-height: 58px; }
  .timeline { padding: 11px 13px 18px; }
  .message.assistant { margin-right: 12px; padding: 14px; }
  .message.user { max-width: 91%; }
  .composer-wrap { padding-top: 5px; }
  .model-button { max-width: 65%; font-size: 10px; }
}
