/* Page shell: main content beside an always-open assistant sidebar (a docked bottom panel when narrow). */
.app-shell { display: grid; grid-template-columns: minmax(0, 1fr) 24rem; min-height: 100vh; }
.app-main { min-width: 0; }
.assistant-sidebar { position: sticky; top: 0; align-self: start; height: 100vh; display: flex; flex-direction: column; min-height: 0; background: #fff; border-left: 1px solid #ccd9e0; font-size: .93rem; }
.assistant-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; background: #173a50; color: #fff; }
.assistant-title { font-size: 1.05rem; }
.assistant-head .btn { min-height: 32px; padding: 3px 10px; }
.assistant-chats { list-style: none; margin: 0; padding: 6px; flex: 0 1 11rem; min-height: 3.5rem; overflow-y: auto; border-bottom: 1px solid #dce5e9; background: #f5f8fa; }
.assistant-chat { display: flex; gap: 4px; align-items: stretch; border-radius: 6px; }
.assistant-chat.current { background: #e0f2fe; outline: 1px solid #7fb9d6; }
.assistant-chat-select { flex: 1; min-width: 0; text-align: left; background: none; border: 0; border-radius: 6px; padding: 5px 8px; color: inherit; display: flex; flex-direction: column; }
.assistant-chat-select:hover { background: #eaf2f5; }
.assistant-chat-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assistant-chat-delete, .assistant-delete-cancel, .assistant-delete-confirm { align-self: center; border: 1px solid #ccd9e0; background: #fff; border-radius: 5px; padding: 2px 8px; font-size: .8rem; color: #4e6472; }
.assistant-chat-delete:hover { color: #9b2828; border-color: #bc7373; }
.assistant-delete-confirm { color: #fff; background: #9b2828; border-color: #9b2828; }
.assistant-messages { flex: 1 1 0; min-height: 5rem; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.assistant-message { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; padding: .5rem .75rem; border-radius: .5rem; background: #f1f5f9; }
.assistant-message.user { margin-left: 12%; background: #e0f2fe; }
.assistant-message.pending { color: #4e6472; font-style: italic; }
.assistant-note { margin: 0; font-size: .82rem; color: #4e6472; padding: 0 .75rem; overflow-wrap: anywhere; }
.assistant-empty { color: #526c77; margin: 6px 8px; }
.assistant-compaction { margin: 4px 0; border-top: 1px dashed #9ab1bd; padding-top: 4px; }
.assistant-compaction-label { margin: 0; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: #4e6472; text-align: center; }
.assistant-compaction details { border: 0; padding: 0; margin: 4px 0 0; background: none; }
.assistant-compaction details > summary { padding: 4px 0; font-weight: 500; font-size: .85rem; }
.assistant-summary { white-space: pre-wrap; margin: 0; padding: .5rem .75rem; background: #fbf3dc; border-radius: .5rem; font-size: .85rem; }
.assistant-error { color: #a11; margin: 0; padding: 6px 12px; background: #fff0ed; border-top: 1px solid #d99586; overflow-wrap: anywhere; }
.assistant-context { margin: 0; padding: 4px 12px; font-size: .8rem; color: #4e6472; border-top: 1px solid #dce5e9; }
.assistant-context[data-level="medium"] { color: #725517; }
.assistant-context[data-level="high"] { color: #9b2828; font-weight: 600; }
.assistant-form { display: flex; gap: .5rem; align-items: end; padding: 8px 12px 12px; }
.assistant-form textarea { flex: 1; min-width: 0; resize: none; padding: 8px 10px; border: 1px solid #9aaeb8; border-radius: 5px; }
@media (max-width: 899px) {
  .app-shell { display: block; min-height: 0; }
  .app-main { padding-bottom: min(46vh, 25rem); }
  .assistant-sidebar { position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: min(46vh, 25rem); z-index: 30; border-left: 0; border-top: 2px solid #173a50; box-shadow: 0 -4px 14px rgba(23, 58, 80, .18); }
  .assistant-chats { flex-basis: 5.5rem; }
}

.assistant-proposals { flex: 0 1 auto; max-height: 45vh; overflow-y: auto; }
.assistant-proposal { padding: 8px 12px; border-top: 1px solid #ccd9e0; background: #fbf3dc; }
.assistant-proposal p { margin: 4px 0; overflow-wrap: anywhere; }
.assistant-proposal button { margin: 4px 6px 0 0; }

.assistant-heading { font: inherit; font-weight: 600; color: inherit; background: transparent; border: 0; text-align: left; cursor: pointer; padding: 0; min-width: 0; overflow-wrap: anywhere; }
.assistant-heading:disabled { color: inherit; cursor: default; }
.assistant-rename { display: flex; gap: 6px; padding: 8px 12px; border-bottom: 1px solid #ccd9e0; }
.assistant-rename[hidden] { display: none; }
.assistant-rename input { flex: 1; min-width: 0; }
