/* Shared control metrics, independent of the selected colour theme. */
:root { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.45; }
button, input, textarea, select { font-family: inherit; letter-spacing: normal; }
.btn, .select-trigger { line-height: 1.4; }
.btn { min-height: 40px; }
.icon-btn { width: 36px; height: 36px; padding: 0; }
.btn > .icon, .icon-btn > .icon, .select-chevron { flex-shrink: 0; }
.page-head, .toolbar, .pulse-controls, .modal-footer { flex-wrap: wrap; }
.page-head > div, .chat-top > div, .chat-link > span { min-width: 0; }
.modal-footer { gap: 12px; }
.news-footer, .review-actions { gap: 12px; }
.news-footer .text-btn { min-width: 0; text-align: left; line-height: 1.4; }
.modal-footer .btn { white-space: normal; text-align: center; }
.talent-name, .story-title, .chat-top h2 { line-height: 1.4; overflow-wrap: anywhere; }
.talent-meta { align-items: flex-start; gap: 12px; line-height: 1.5; }
.talent-meta > span { min-width: 0; }
.talent-meta > span:first-child { overflow-wrap: anywhere; }
.talent-meta > span:last-child { flex-shrink: 0; }
.select-value { min-width: 0; }
.select-option > span:not(.select-check) { min-width: 0; }
.deal-summary { flex-wrap: wrap; gap: 16px; }
.deal-summary .stages-settings { margin-left: auto; }
.deal-summary .stages-settings + .view-toggle { margin-left: 0; }
.kanban-column > h3 { line-height: 1.45; overflow-wrap: anywhere; }
.pipeline-name { min-width: 0; overflow-wrap: anywhere; }
.stage-settings-note { font-size: 12px; line-height: 1.6; margin: 12px 0 20px; }
.stage-editor { display: grid; gap: 16px; margin-bottom: 20px; }
.stage-editor-row { display: grid; grid-template-columns: 7px minmax(0,1fr) minmax(0,160px) 36px; gap: 10px; align-items: center; }
.stage-editor-row > .stage-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lane-dot); }
.stage-editor-row input { margin-top: 7px; }
.stage-order { display: flex; flex-direction: column; }
.stage-order .icon-btn:disabled { cursor: default; opacity: .3; }
@media (max-width: 650px) {
  .stage-editor-row { grid-template-columns: 7px minmax(0,1fr) 36px; }
  .stage-editor-row > label:nth-child(2) { grid-column: 2; }
  .stage-editor-row > label:nth-child(3) { grid-column: 2; }
  .stage-editor-row .stage-order { grid-column: 3; grid-row: 1 / 3; }
}

@media (min-width: 651px) {
  .sidebar { width: 192px; padding-left: 12px; padding-right: 12px; }
  .main-shell { margin-left: 192px; width: calc(100% - 192px); }
  .sidebar .wordmark { padding-left: 4px; font-size: 16px; letter-spacing: 1.5px; gap: 8px; }
  .sidebar .wordmark > .icon { width: 26px; height: 26px; }
  .nav-item { padding-left: 10px; padding-right: 10px; gap: 9px; }
  .profile { padding: 4px; gap: 6px; }
  .profile > .avatar { width: 28px; height: 28px; }
  .profile > span:nth-child(2) { min-width: 0; }
  .profile small { font-size: 11px; overflow-wrap: anywhere; }
  .profile > .icon { width: 14px; height: 14px; }
}

/* The composer is one surface: text above, context and send below. */
.chat-page { height: calc(100dvh - 79px); }
.chat-workspace { min-height: 0; }
.chat-top { flex-shrink: 0; }
.chat-top h2 { font-size: 15px; }
.chat-link span { font-size: 13px; line-height: 1.45; }
.chat-link small { font-size: 11px; line-height: 1.45; }
.messages { min-height: 0; }
.message-author { font-size: 13px; line-height: 1.5; }
.message-author time { font-size: 11px; display: inline-block; }
.messages .message-text { font-size: 14px; line-height: 1.65; }
.composer { display: flex; flex-direction: column; gap: 16px; flex-shrink: 0; padding: 18px; margin-top: 16px; }
.composer:focus-within { border-color: #8d94a4; }
.composer textarea, .composer textarea:focus {
  display: block; width: 100%; min-height: 80px; max-height: 180px;
  margin: 0; padding: 4px 2px; border: 0; border-radius: 0;
  outline: none; box-shadow: none; font-size: 14px; line-height: 1.6;
}
.composer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 40px; }
.composer .context-select { min-width: 0; max-width: calc(100% - 56px); gap: 8px; }
.composer .context-select > .icon { width: 16px; height: 16px; flex-shrink: 0; }
.composer .context-select .custom-select { min-width: 0; max-width: calc(100% - 24px); }
.composer .context-select .select-trigger { min-height: 36px; padding: 8px 10px; font-size: 13px; gap: 10px; }
.send-button { width: 40px; height: 40px; padding: 0; border-radius: 12px; margin-left: auto; }
.send-button .icon { width: 20px; height: 20px; }
.composer .form-error:not(:empty) { margin: 0; }

@media (max-width: 950px) {
  .chat-page { height: calc(100dvh - 66px); }
}
@media (max-width: 650px) {
  .chat-page { height: calc(100dvh - 60px); }
  .composer { padding: 14px; gap: 12px; margin-top: 12px; border-radius: 18px; }
  .composer textarea, .composer textarea:focus { min-height: 64px; font-size: 16px; }
  .composer-bottom { gap: 12px; }
  .chat-top h2 { font-size: 14px; }
  .modal-footer .btn { flex: 1 1 auto; }
  .toolbar .search-input { width: 100%; }
}
