/* Cloud blue: a clear blue navigation rail, white work surfaces and teal actions;
   one Cyrillic-capable system family and a fixed hierarchy across every page. */
:root {
  --accent: #0c8f83;
  --red: #087f75;
  --red-dark: #066b63;
  --pink: #e4f3ef;
  --ink: #233548;
  --muted: #617388;
  --line: #dce4ec;
  --canvas: #f5f7fa;
  --surface: #fff;
  --nav-bg: #dfe8f3;
  --nav-ink: #334e68;
  --nav-muted: #49637c;
  --nav-hover: #d5e2ef;
  --nav-selected: #ccddeb;
  --nav-line: #bccddd;
  --font: 'Onest', sans-serif;
  --type-caption: 12px;
  --type-control: 14px;
  --type-body: 15px;
  --type-reading: 16px;
  --type-section: 18px;
  --type-title: 20px;
  --type-display: 24px;
}
body { background: var(--canvas); font-size: var(--type-body); font-family: var(--font); -webkit-font-smoothing: antialiased; }
.app-shell { background: var(--canvas); padding: 12px 12px 12px 12px; min-height: 100vh; }
.sidebar { width: 244px; padding: 24px 14px 16px; background: var(--nav-bg); border: 0; box-shadow: inset -1px 0 var(--nav-line); color: var(--nav-ink); }
.main { margin-left: 244px; width: calc(100% - 244px); min-height: calc(100vh - 24px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.brand { padding: 8px 9px 32px; gap: 11px; }
.brand strong { font-size: var(--type-display); font-weight: 650; letter-spacing: -.5px; color: var(--ink); }
.brand small { font-size: var(--type-caption); color: #92938f; }
.brand-mark { width: 39px; height: 39px; border-radius: 12px; background: var(--accent); transform: none; }
.brand-mark svg { transform: none; }
.sidebar nav { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #9cb3c9 transparent; }
.sidebar .mobile-close { color: var(--nav-ink); }
.brand { flex-shrink: 0; }
.nav-group { margin-bottom: 22px; }
.nav-item { color: var(--nav-ink); padding: 9px 12px; font-size: var(--type-body); line-height: 22px; border-radius: 8px; gap: 10px; margin-bottom: 4px; font-weight: 500; }
.nav-item svg { stroke-width: 1.8; width: 18px; height: 18px; }
.nav-item:hover { background: var(--nav-hover); color: var(--ink); }
.nav-item.active, .subnav.current { background: var(--nav-selected); color: var(--ink); font-weight: 600; }
.nav-count, .active .nav-count { background: var(--red); color: white; border-radius: 50%; font-size: var(--type-caption); min-width: 19px; text-align: center; padding: 0 4px; }
.nav-label { color: var(--nav-muted); font-size: var(--type-caption); padding-left: 12px; }
.nav-label button { color: var(--nav-muted); }
.subnav { font-size: var(--type-control); padding-top: 8px; padding-bottom: 8px; margin-bottom: 2px; color: var(--nav-ink); font-weight: 400; }
.project-dot { background: #9cbeb3; width: 7px; height: 7px; border-radius: 50%; }
.project-dot.peach { background: #d2b887; }
.project-dot.sage { background: #9da5d0; }
.channel-hash { color: var(--nav-muted); }
.profile { padding-top: 16px; }
.profile strong { font-weight: 500; font-size: var(--type-control); }
.profile small { color: #8b9aaf; }
.topbar { height: 82px; padding: 0 28px; background: var(--surface); border-bottom: 1px solid #dce6f1; }
.search-trigger { min-width: 0; width: 300px; max-width: 45%; border: 1px solid #d7e2ef; background: #f8faff; color: #a1a29e; padding: 10px 14px; border-radius: 12px; font-size: var(--type-control); height: 41px; }
.search-trigger svg { height: 19px; width: 19px; }
.search-trigger kbd { border: 0; color: #b3b5af; font-size: var(--type-caption); }
.topbar-right { gap: 16px; }
.topbar-create { padding-left: 19px; padding-right: 19px; }
.avatar { font-size: 10px; width: 30px; height: 30px; border-width: 2px; }
.avatar.large { width: 36px; height: 36px; font-size: 10px; }
.avatar-stack .avatar+.avatar { margin-left: -7px; }
.avatar.rose { background: #d8e9e2; color: #44705e; }
.avatar.lavender { background: #e1ddec; color: #77668e; }
.avatar.blue { background: #dce8ed; color: #597887; }
.avatar.peach { background: #eddfce; color: #927454; }
.avatar.sage { background: #e6ead9; color: #798663; }
.btn { border-radius: 10px; font-weight: 500; padding: 9px 16px; min-height: 40px; font-size: var(--type-control); }
.btn.primary { background: var(--red); border-color: var(--red); }
.btn.primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn.secondary { background: #f8faff; border-color: #d7e2ef; color: #303334; }
.btn.secondary:hover { background: #edf3fc; border-color: #b9bdb6; }
.btn.dark { background: var(--red); border: 1px solid var(--red); color: #fff; }
.btn.dark:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn.small { font-size: var(--type-caption); padding: 6px 10px; min-height: 31px; border-radius: 8px; }
.btn.text:hover, .icon-btn:hover { background: #e8f0fb; }
.icon-btn { color: #718299; }
.icon-btn svg { stroke-width: 1.7; }
.page-heading { padding: 23px 28px 0; background: var(--surface); }
.heading-row { gap: 20px; align-items: center; }
.heading-row h1 { font-weight: 600; font-size: var(--type-title); letter-spacing: -.6px; }
.description { font-size: var(--type-control); color: #969993; margin-top: 7px; }
.project-context { margin: 0; font-size: var(--type-caption); color: #92968e; flex-direction: column; gap: 8px; align-items: flex-end; white-space: nowrap; }
.mini-progress { width: 112px; height: 4px; background: #eceeea; }
.mini-progress span { background: var(--accent); }
.tabs-row { margin-top: 22px; margin-left: -28px; margin-right: -28px; padding: 14px 28px; border-top: 1px solid #eaf1fa; border-bottom: 1px solid #dce6f1; min-height: 74px; gap: 14px; }
.tabs { gap: 2px; padding: 4px; height: auto; background: #eef4fc; border-radius: 11px; }
.tab { border: 0; padding: 7px 13px; font-size: var(--type-control); color: var(--ink); min-height: 32px; border-radius: 8px; }
.tab.active { color: var(--nav-ink); background: var(--nav-selected); font-weight: 600; box-shadow: 0 1px 2px #2335480a; }
.tab:hover:not(.active) { background: #e2edf9; }
.heading-actions { padding: 0; gap: 12px; }
.board-toolbar { padding: 17px 28px; background: var(--surface); }
.search-box { border-color: #dce6f1; background: #f5f9ff; border-radius: 8px; min-height: 33px; width: 200px; }
.search-box input { font-size: var(--type-caption); }
.filter-btn { border-color: #dce6f1; background: var(--surface); border-radius: 8px; color: #72849b; }
.filter-btn.selected { background: #dcf1e9; border-color: #abd9c9; color: #33836a; }
.toolbar-note { color: #a1a69c; font-size: var(--type-caption); }
.board { padding: 0 28px 28px; background: var(--surface); grid-template-columns: repeat(4,minmax(230px,1fr)); gap: 18px; align-items: stretch; min-height: calc(100vh - 330px); }
.column { background: #edf4fc; border-radius: 19px; padding: 13px; min-height: 570px; }
.column-heading { background: var(--surface); border-radius: 10px; padding: 10px 12px; min-height: 42px; margin-bottom: 13px; font-size: var(--type-control); font-weight: 600; color: #32738f; }
.column[data-status="doing"] .column-heading { color: #596fba; }
.column[data-status="review"] .column-heading { color: #8759ae; }
.column[data-status="done"] .column-heading { color: #4e815b; }
.column-count { background: #deeff7; color: #32738f; font-size: var(--type-caption); border-radius: 6px; padding: 0 5px; min-width: 20px; height: 20px; text-align: center; }
.column[data-status="doing"] .column-count { background: #e4eafa; color: #596fba; }
.column[data-status="review"] .column-count { background: #eee5f7; color: #8759ae; }
.column[data-status="done"] .column-count { background: #e4f0e0; color: #4e815b; }
.column-heading .icon-btn { color: #2d3331; height: 22px; width: 22px; }
.column-heading .icon-btn svg { width: 18px; height: 18px; }
.column.dragover { background: #e4effd; outline: none; }
.task-card { border: 1px solid transparent; border-radius: 13px; padding: 18px 16px 13px; margin-bottom: 12px; box-shadow: none; }
.task-card:hover { border-color: #c2d6ef; box-shadow: 0 5px 14px #345b8a08; }

.card-title-row { display: flex; align-items: flex-start; gap: 9px; justify-content: space-between; }
.card-title { font-size: var(--type-body); font-weight: 500; letter-spacing: -.1px; line-height: 1.55; margin-bottom: 7px; }
.card-more { color: #b0b3ac; flex-shrink: 0; padding-top: 2px; }
.card-more svg { width: 13px; height: 13px; transform: rotate(90deg); }
.card-category { color: #a6aaa1; font-size: var(--type-caption); margin-bottom: 13px; }
.priority-badge { display: inline-flex; align-items: center; padding: 3px 7px; font-size: var(--type-caption); color: #41443c; line-height: 17px; border-radius: 7px; margin-bottom: 13px; }
.priority-badge.high { background: #fbe1e3; }
.priority-badge.medium { background: #fbead1; }
.priority-badge.low { background: #d5efe5; }
.task-card>.card-date { font-size: var(--type-caption); color: #a6aba0; gap: 5px; margin-bottom: 13px; }
.task-card>.card-date svg { width: 13px; height: 13px; }
.card-checklist { margin-bottom: 13px; color: #a7ada3; font-size: var(--type-caption); }
.card-checklist .bar { background: #f0f2ec; }
.card-checklist .bar span { background: #c2d9ce; }
.card-footer { border-color: #edeee9; padding-top: 10px; gap: 5px; color: #a4aaa0; font-size: var(--type-caption); }
.card-footer .avatar { margin: 0; width: 26px; height: 26px; font-size: 8px; }
.card-owner { margin-right: auto; font-size: var(--type-caption); color: #8e9588; }
.card-comments { margin-left: 5px; font-size: var(--type-caption); }
.card-comments svg { width: 13px; height: 13px; }
.done-card .card-title { color: #414e60; }
.card-add { color: var(--muted); padding-left: 9px; font-size: var(--type-control); }
.card-add:hover { color: var(--red); }
.board-empty { border-color: #d6e3f3; color: #90a3ba; }
.content-pad { background: var(--surface); }
.project-tile { border-color: #dce6f1; background: #f5f9ff; border-radius: 16px; padding: 25px; }
.project-tile:hover { border-color: #b4d2c2; }
.project-emblem { background: #def1e7; color: #40a384; border-radius: 12px; }
.project-tile h2 { font-weight: 600; font-size: var(--type-section); }
.project-tile p { color: var(--muted); }
.tile-progress span { background: var(--accent); }
.task-table th { background: #f1f6fd; color: #8193aa; font-size: var(--type-caption); }
.task-table td { border-color: #e9eff7; padding: 18px; }
.task-table .row-title { font-weight: 500; font-size: var(--type-control); }
.task-table tr[data-action]:hover { background: #f5f9ff; }
.table-wrap { border-radius: 12px; }
.chat-layout { height: calc(100dvh - 108px); min-height: 500px; }
.chat-header { padding: 23px 28px; border-color: #e1e5dc; }
.chat-header h1 { font-weight: 500; font-size: var(--type-title); }
.chat-header p { font-size: var(--type-control); color: #979c92; }
.chat-project-link { background: #f6f9f3; border-color: #e3e9dc; padding: 12px 28px; color: #94a287; }
.chat-project-link button { color: #5d805b; font-weight: 500; }
.message { padding: 17px 28px; }
.message.selected, .message:hover { background: #f1f7ff; }
.message-meta strong { font-weight: 500; font-size: var(--type-control); }
.message-meta time { color: var(--muted); }
.message-text { font-size: var(--type-control); color: #4d5348; }
.reply-link { color: #2e9d80; }
.reaction.active { border-color: #abd6c6; background: #e8f6ec; }
.linked-task { background: #f0f5e9; color: #6c865b; font-size: var(--type-caption); }
.message-tool:hover { color: #16977b; }
.thread-panel { border-color: #dce5d5; width: 380px; }
.thread-root { background: #f4f8ff; }
.thread-panel .message-text { font-size: var(--type-control); }
.composer { border-radius: 12px; border-color: #d5e2f1; background: #fbfdff; }
.composer:focus-within { border-color: #8bbfa9; box-shadow: 0 0 0 2px #f0f8ed; }
.composer textarea { font-size: var(--type-control); min-height: 78px; }
.composer-footer { gap: 12px; }
.composer-hint { flex: 1; min-width: 0; line-height: 1.4; }
.send-btn { background: var(--red); height: 31px; width: 35px; border-radius: 8px; flex-shrink: 0; }
.backdrop { background: #333b3438; backdrop-filter: blur(2px); }
.drawer { left: 50%; top: 50%; right: auto; bottom: auto; transform: translate(-50%,-50%); width: min(680px,calc(100% - 40px)); max-height: 90dvh; border-radius: 17px; box-shadow: 0 14px 55px #23292320; animation: fade-in .15s; overflow: hidden; }
.drawer .panel-header { padding: 20px 30px 5px; min-height: 48px; border: 0; }
.drawer-heading { font-size: var(--type-caption); color: var(--muted); gap: 12px; }
.drawer-heading span { font-size: var(--type-caption); color: var(--muted); }
.drawer .panel-header .icon-btn { color: #2c3329; }
.drawer-content { padding: 6px 30px 22px; }
.task-title-input { font-size: var(--type-display); letter-spacing: -.6px; line-height: 1.4; font-weight: 600; min-height: 66px; padding: 0; margin: 6px 0 24px; color: var(--ink); }
.field-grid { grid-template-columns: 130px 1fr; gap: 19px 15px; margin-bottom: 24px; }
.field-label { font-size: var(--type-control); color: var(--muted); }
.inline-select, .inline-date { background: #f0f5fc; border: 0; border-radius: 9px; padding: 8px 12px; height: 37px; font-size: var(--type-control); width: 206px; color: var(--ink); }
.status-select, .form-field select.status-select { background: var(--nav-selected); color: var(--nav-ink); border: 1px solid var(--nav-line); border-radius: 9px; padding: 9px 12px; width: 165px; }
.assignee-field { display: flex; align-items: center; background: #f0f5fc; border-radius: 9px; width: max-content; padding-left: 6px; }
.assignee-field .inline-select { width: 142px; background: transparent; padding-left: 5px; }
.assignee-field .avatar { border-color: #f0f5fc; }
.priority-select { background: #f9ead6; width: 190px; font-size: var(--type-control); }
.detail-tabs { display: flex; width: max-content; background: #eef4fc; padding: 4px; border-radius: 10px; gap: 3px; margin: 20px 0 14px; }
.detail-tabs button { padding: 7px 13px; border-radius: 8px; color: var(--ink); font-size: var(--type-control); }
.detail-tabs button.active { background: var(--nav-selected); color: var(--nav-ink); font-weight: 600; }
.detail-tabs span { margin-left: 3px; opacity: .6; }
.description-input { background: #f6f9fd; border: 1px solid #d6e1ef; font-size: var(--type-control); color: var(--ink); border-radius: 11px; min-height: 140px; line-height: 1.7; padding: 14px; }
.field-section { margin: 22px 0; }
.field-section h3 { font-size: var(--type-control); font-weight: 500; color: var(--ink); }
.detail-description { margin-top: 0; }
.checklist-row { color: var(--ink); font-size: var(--type-control); }
.checklist-row.checked span { color: #a3a5a1; }
.checklist-add input { border-color: #e1e8d8; border-radius: 8px; font-size: var(--type-control); }
.upload-zone { display: flex; justify-content: center; align-items: center; gap: 9px; width: 100%; min-height: 83px; padding: 16px; background: #daf1e8; border: 1px dashed #26b694; border-radius: 11px; color: #139b7b; font-size: var(--type-control); }
.upload-zone:hover { background: #c9ebdf; }
.upload-zone small { display: block; color: #8eb5a5; font-size: var(--type-caption); margin-top: 5px; }
.drawer-footer { padding: 16px 30px 23px; border: 0; gap: 10px; }
.drawer-footer .btn { font-size: var(--type-control); }
.drawer-footer .autosave-status { color: var(--muted); font-size: var(--type-caption); margin-left: auto; }
.task-discussion { padding-top: 4px; }
.discussion-empty { font-size: var(--type-control); color: #8c9fb6; padding: 15px 0; }
.task-replies { border-color: #e1ecd7; }
.task-discussion .message:hover { background: transparent; }
.task-discussion .message-text, .task-discussion .composer textarea { font-size: var(--type-reading); color: var(--ink); line-height: 1.55; }
.modal { border-radius: 16px; box-shadow: 0 14px 55px #23292320; width: min(550px,calc(100% - 32px)); max-height: 90dvh; }
.modal.create-task-modal { width: min(680px,calc(100% - 40px)); }
.modal .panel-header { border: 0; padding: 26px 30px 11px; }
.modal .panel-header h2 { font-size: var(--type-title); font-weight: 600; letter-spacing: -.5px; }
.modal .panel-header .icon-btn { color: #252e20; }
.modal-body { padding: 19px 30px 28px; }
.form-field { margin-bottom: 22px; }
.form-field>span { font-size: var(--type-control); color: var(--ink); font-weight: 400; margin-bottom: 8px; }
.form-field input, .form-field textarea, .form-field select { background: #f6f9fd; border-color: #d6e1ef; font-size: var(--type-control); min-height: 41px; border-radius: 10px; padding: 10px 12px; color: var(--ink); }
.form-field input::placeholder, .form-field textarea::placeholder { color: #a3a5a1; }
.form-field textarea { min-height: 155px; }
.form-row { gap: 23px; }
.task-name-row { grid-template-columns: minmax(0,1fr) 165px; }
.task-name-row .status-select { width: 100%; }
.form-footer { justify-content: space-between; margin-top: 10px; }
.form-footer .btn { padding: 10px 18px; }
.form-note { background: #eef4f8; color: var(--muted); border-radius: 9px; font-size: var(--type-control); }
.search-modal { top: 15%; transform: translateX(-50%); width: min(630px,calc(100% - 32px)); }
.search-result:hover { background: #edf4fe; }
.search-caption { color: var(--muted); }
.search-result strong, .notification-row strong { font-size: var(--type-body); font-weight: 550; }
.search-result span { color: var(--muted); }
.global-search-field { border-color: #e1e9d7; }
.later-panel { border-radius: 16px; border-color: #dce6f1; background: #f5f9ff; }
.later-panel h2 { font-weight: 500; }
.later-panel p, .later-panel ul { color: var(--muted); }
.later-panel .project-emblem { background: #e3efda; color: #81a163; }
#toast { background: #2c3330; border-radius: 11px; left: calc(50% + 113px); }
button:focus-visible,a:focus-visible,[tabindex]:focus-visible,input:focus,textarea:focus,select:focus { outline-color: #80c6b1; }
.search-box:focus-within { outline-color: #80c6b1; }
@media(min-width:1600px) {
  .sidebar { width: 260px; padding: 30px 24px 24px; }
  .main { margin-left: 260px; width: calc(100% - 260px); }
  .board { gap: 22px; }
  .column { padding: 16px; }
  .task-card { padding: 21px 19px 16px; }
  .card-title { font-size: var(--type-reading); }
  .card-category { font-size: var(--type-control); }
  .priority-badge { font-size: var(--type-caption); }
  .task-card>.card-date, .card-comments { font-size: var(--type-caption); }
}
@media(max-width:1200px) {
  .sidebar { width: 224px; padding-left: 14px; padding-right: 14px; }
  .main { margin-left: 224px; width: calc(100% - 224px); }
  .topbar, .page-heading { padding-left: 23px; padding-right: 23px; }
  .tabs-row { margin-left: -23px; margin-right: -23px; padding-left: 23px; padding-right: 23px; }
  .board { padding-left: 23px; padding-right: 23px; grid-template-columns: repeat(4,minmax(250px,1fr)); }
  .board-toolbar { padding-left: 23px; padding-right: 23px; }
  .tabs-row .avatar-stack { display: none; }
  .tabs-row .heading-actions { gap: 8px; }
  .search-trigger { width: 250px; }
  #toast { left: calc(50% + 102px); }
}
@media(max-width:960px) {
  .sidebar { width: 212px; padding-left: 11px; padding-right: 11px; }
  .main { margin-left: 212px; width: calc(100% - 212px); }
  .brand { gap: 8px; padding-left: 5px; }
  .brand strong { font-size: var(--type-display); }
  .brand small { font-size: var(--type-caption); }
  .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .brand-mark svg { width: 24px; height: 24px; }
  .nav-item { font-size: var(--type-body); padding-left: 9px; gap: 9px; }
  .subnav { font-size: var(--type-control); }
  .topbar { height: 74px; }
  .search-trigger { max-width: 57%; width: 250px; }
  .search-trigger span { display: block; }
  .search-trigger kbd { display: none; }
  .topbar-create { font-size: var(--type-caption); padding: 8px 11px; }
  .topbar-right { gap: 8px; }
  .topbar-right>.icon-btn { display: none; }
  .heading-row h1 { font-size: var(--type-title); }
  .heading-row .project-context { display: none; }
  .tabs-row { gap: 10px; }
  .tabs-row .team-btn { display: none; }
  .tab { padding: 7px 11px; font-size: var(--type-caption); }
  .tabs-row .btn.dark { font-size: var(--type-caption); padding: 8px 11px; }
  .chat-layout { height: calc(100dvh - 100px); }
  .thread-panel { width: auto; }
  #toast { left: calc(50% + 91px); }
}
@media(max-width:700px) {
  .app-shell { padding: 0; }
  .sidebar { width: 264px; padding: 28px 14px 18px; }
  .main { margin: 0; width: 100%; min-height: 100dvh; border: 0; border-radius: 0; }
  .brand strong { font-size: var(--type-display); }
  .brand small { font-size: var(--type-caption); }
  .nav-item { font-size: var(--type-body); }
  .subnav { font-size: var(--type-control); }
  .topbar { height: 66px; padding: 0 14px; gap: 7px; }
  .search-trigger { width: 100%; max-width: none; flex: 1; height: 36px; padding: 6px 9px; font-size: var(--type-control); border-radius: 10px; }
  .search-trigger svg { width: 16px; height: 16px; }
  .search-trigger span { display: block; }
  .topbar-create { font-size: 0; width: 36px; min-height: 36px; height: 36px; padding: 0; gap: 0; }
  .topbar-create svg { width: 18px; height: 18px; }
  .topbar-right { gap: 0; }
  .page-heading { padding: 22px 17px 0; }
  .heading-row h1 { font-size: var(--type-title); }
  .description { font-size: var(--type-caption); line-height: 1.6; }
  .tabs-row { margin: 19px -17px 0; padding: 12px 17px; min-height: 66px; gap: 10px; }
  .tabs { gap: 1px; padding: 3px; border-radius: 9px; }
  .tab { font-size: var(--type-caption); padding: 6px 10px; min-height: 31px; }
  .tabs-row .btn.dark { width: 36px; height: 36px; min-height: 36px; font-size: 0; padding: 0; gap: 0; }
  .tabs-row .btn.dark svg { width: 18px; height: 18px; }
  .board-toolbar { padding: 13px 17px; }
  .search-box { width: 140px; flex: 1; }
  .filter-btn { font-size: var(--type-caption); }
  .filter-btn[data-value="active"] { display: none; }
  .board { padding: 0 17px 24px; grid-template-columns: repeat(4,275px); gap: 16px; }
  .column { padding: 13px; min-height: 530px; }
  .task-card { padding: 18px 16px 13px; }
  .card-title { font-size: var(--type-body); }
  .card-category { font-size: var(--type-caption); }
  .priority-badge { font-size: var(--type-caption); }
  .card-footer { font-size: var(--type-caption); }
  .chat-layout { height: calc(100dvh - 66px); min-height: 400px; }
  .chat-header { padding: 18px; }
  .chat-header h1 { font-size: var(--type-title); }
  .chat-header p { font-size: var(--type-caption); }
  .chat-project-link { padding: 11px 18px; font-size: var(--type-caption); }
  .message { padding: 16px 18px; }
  .message-text { font-size: var(--type-control); }
  .composer textarea { min-height: 65px; }
  .thread-panel .message { padding: 16px 18px; }
  .drawer { width: calc(100% - 20px); max-height: 94dvh; border-radius: 14px; }
  .drawer .panel-header { padding: 15px 20px 2px; }
  .drawer-content { padding: 5px 20px 18px; }
  .task-title-input { font-size: var(--type-display); min-height: 67px; margin-bottom: 18px; }
  .field-grid { grid-template-columns: 112px minmax(0,1fr); gap: 14px 9px; margin-bottom: 18px; }
  .field-label { font-size: var(--type-control); }
  .inline-select, .inline-date { width: 172px; max-width: 100%; font-size: var(--type-control); }
  .status-select { width: 162px; }
  .assignee-field .inline-select { width: 128px; }
  .description-input { font-size: var(--type-control); min-height: 125px; }
  .drawer-footer { padding: 12px 20px 20px; }
  .drawer-footer .btn { font-size: var(--type-caption); padding: 8px 11px; }
  .drawer-footer .autosave-status { display: none; }
  .drawer-footer .btn.primary { margin-left: auto; }
  .modal, .modal.create-task-modal { width: calc(100% - 24px); max-height: 93dvh; }
  .modal .panel-header { padding: 23px 22px 7px; }
  .modal .panel-header h2 { font-size: var(--type-title); }
  .modal-body { padding: 16px 22px 24px; }
  .form-field>span { font-size: var(--type-control); }
  .form-field input, .form-field textarea, .form-field select { font-size: var(--type-control); }
  .form-field textarea { min-height: 140px; }
  .form-row { gap: 12px; }
  .task-name-row { grid-template-columns: 1fr; gap: 0; }
  .task-name-row .status-select { width: 165px; }
  .form-field { margin-bottom: 17px; }
  .form-footer .btn { font-size: var(--type-control); }
  .search-modal { top: 9%; }
  #toast { left: 50%; }
}

.drag-ghost { position: fixed; z-index: 100; pointer-events: none; margin: 0; box-shadow: 0 16px 40px #315e9630; opacity: 1; }
@media(max-width:700px) { .sidebar { visibility: hidden; } .sidebar.open { visibility: visible; } }

/* Compact workspace: one contextual header, one optional tools row. */
.workspace-header.topbar {
  height: 56px;
  padding: 0 22px;
  gap: 12px;
  border-bottom-color: #e0e9f4;
}
.workspace-title { display: flex; align-items: center; min-width: 0; gap: 9px; }
.workspace-title h1 { font-size: var(--type-title); font-weight: 600; letter-spacing: -.35px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.35; }
.workspace-count { color: #9ba294; font-size: var(--type-caption); }
.workspace-title .context-info { width: 24px; height: 26px; flex-shrink: 0; color: #8b9bb0; }
.context-info svg { width: 15px; height: 15px; }
.workspace-header .topbar-right { gap: 8px; flex-shrink: 0; }
.workspace-header .topbar-right>.icon-btn { display: inline-flex; width: 30px; height: 30px; }
.workspace-header .icon-btn svg { width: 17px; height: 17px; }
.workspace-header .workspace-action { padding: 7px 12px; min-height: 33px; border-radius: 8px; font-size: var(--type-control); }
.workspace-header .channel-board-link { min-height: 30px; font-size: var(--type-control); color: var(--muted); padding: 4px 7px; }
.work-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 50px; padding: 9px 22px 10px; background: var(--surface); }
.work-toolbar .tabs { padding: 3px; border-radius: 8px; flex-shrink: 0; }
.work-toolbar .tab { min-height: 28px; padding: 5px 12px; font-size: var(--type-control); border-radius: 6px; }
.work-controls { display: flex; align-items: center; gap: 9px; min-width: 0; }
.work-toolbar .search-box { width: 200px; min-height: 30px; padding: 5px 9px; border-color: #e0e9f4; border-radius: 7px; }
.work-toolbar .search-box input { font-size: var(--type-control); }
.local-search-trigger { display: none; }
.filter-menu { position: relative; }
.filter-menu>summary { list-style: none; cursor: pointer; user-select: none; }
.filter-menu>summary::-webkit-details-marker { display: none; }
.work-toolbar .filter-btn { min-height: 30px; padding: 5px 9px; font-size: var(--type-control); border-radius: 7px; white-space: nowrap; }
.filter-active-dot { display: none; width: 5px; height: 5px; background: var(--red); border-radius: 50%; position: absolute; top: 5px; right: 5px; }
.filter-options { position: absolute; right: 0; top: calc(100% + 6px); min-width: 190px; border: 1px solid #dce6f1; background: var(--surface); border-radius: 10px; padding: 5px; box-shadow: 0 9px 26px #29352112; z-index: 25; }
.filter-options button { display: flex; align-items: center; justify-content: space-between; gap: 18px; width: 100%; text-align: left; padding: 9px 10px; font-size: var(--type-control); border-radius: 6px; white-space: nowrap; }
.filter-options button:hover { background: #eef5ff; }
.filter-options button[aria-pressed="true"] { color: #2f8268; background: #eaf5ec; }
.filter-options svg { width: 14px; height: 14px; }
.task-view-label { font-size: var(--type-caption); color: #8c9db4; }
.board { padding: 2px 22px 22px; min-height: calc(100dvh - 132px); }
.column { min-height: 530px; }
.content-pad.work-content { padding: 2px 22px 22px; }
.content-pad.project-content { padding: 22px; }
.chat-layout { height: calc(100dvh - 82px); min-height: 420px; }
.chat-messages { padding-top: 0; }
.day-divider { margin-top: 15px; margin-bottom: 10px; }
.thread-panel .panel-header { min-height: 48px; padding: 12px 20px; }
.thread-panel .panel-header h2 { font-size: var(--type-control); }
.context-title { font-size: var(--type-section); font-weight: 500; margin-bottom: 12px; }
.context-description { color: var(--muted); font-size: var(--type-control); line-height: 1.7; margin-bottom: 22px; }
.context-facts { margin: 0 0 24px; }
.context-facts>div { display: grid; grid-template-columns: 112px minmax(0,1fr); gap: 10px; margin: 12px 0; font-size: var(--type-control); }
.context-facts dt { color: var(--muted); }
.context-facts dd { margin: 0; color: var(--ink); }
.brand { padding: 0 9px 24px; align-items: center; }
.brand small { display: none; }
.brand-logo { display: block; width: 174px; height: auto; max-width: 100%; }
.nav-count.overdue-count, .active .nav-count.overdue-count { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 20px; background: #bd394e; color: white; line-height: 1; }
.brand strong { font-size: var(--type-display); }
.brand-mark { width: 33px; height: 33px; border-radius: 10px; }
.brand-mark svg { width: 23px; height: 23px; }
.profile { padding-top: 14px; }
@media(max-width:1100px) {
  .workspace-header.topbar { padding: 0 18px; }
  .work-toolbar { padding-left: 18px; padding-right: 18px; gap: 10px; }
  .work-toolbar .search-box { width: 145px; }
  .work-controls { gap: 7px; }
  .board { padding-left: 18px; padding-right: 18px; }
  .content-pad.work-content { padding-left: 18px; padding-right: 18px; }
  .content-pad.project-content { padding: 18px; }
  .chat-layout { height: calc(100dvh - 82px); }
}
@media(max-width:850px) {
  .work-toolbar .search-box { display: none; }
  .work-toolbar .local-search-trigger { display: inline-flex; width: 29px; height: 29px; }
  .work-toolbar .filter-btn span { display: none; }
  .work-toolbar .filter-btn { height: 29px; width: 30px; padding: 6px; justify-content: center;  font-size: var(--type-control); }
  .filter-active-dot { display: block; }
  .work-toolbar.find-open { flex-wrap: wrap; }
  .work-toolbar.find-open .work-controls { flex: 1; }
  .work-toolbar.find-open .search-box { display: flex; width: 160px; flex: 1; }
  .work-toolbar.find-open .local-search-trigger { display: none; }
}
@media(max-width:700px) {
  .workspace-header.topbar { height: 54px; padding: 0 12px; gap: 5px; }
  .workspace-title { gap: 3px; flex: 1; }
  .workspace-title h1 { font-size: var(--type-title); letter-spacing: -.3px; }
  .workspace-title .context-info { width: 20px; flex-shrink: 0; }
  .workspace-header .topbar-right { gap: 3px; margin-left: 0; }
  .workspace-header .topbar-right>[data-action="members"] { display: none; }
  .workspace-header .workspace-action { width: 30px; height: 30px; min-height: 30px; padding: 0; gap: 0; border-radius: 8px; }
  .workspace-action span { display: none; }
  .workspace-header .mobile-menu { width: 27px; flex-shrink: 0; }
  .workspace-header .topbar-right>.icon-btn { width: 27px; }
  .workspace-header .channel-board-link { width: 28px; height: 30px; padding: 5px;  font-size: var(--type-control);  color: var(--muted); }
  .channel-board-link span { display: none; }
  .work-toolbar { min-height: 47px; padding: 8px 14px 9px; gap: 9px; }
  .work-toolbar .tabs { padding: 3px; gap: 1px; }
  .work-toolbar .tab { padding: 5px 10px; font-size: var(--type-control); min-height: 27px; }
  .work-controls { gap: 6px; }
  .work-toolbar.find-open .work-controls { flex-basis: 100%; }
  .work-toolbar.find-open .search-box { display: flex; width: 100%; }
  .work-toolbar.find-open .filter-menu { display: block; }
  .board { padding: 0 14px 20px; min-height: calc(100dvh - 105px); }
  .content-pad.work-content { padding: 0 14px 20px; }
  .content-pad.project-content { padding: 16px 14px; }
  .chat-layout { height: calc(100dvh - 54px); min-height: 380px; }
  .composer-wrap { padding: 10px 14px 14px; }
  .day-divider { margin-top: 12px; }
  .thread-panel .panel-header { min-height: 44px; padding: 10px 16px; }
}

.close-local-search { display: none; }
.local-search-trigger.is-active { color: var(--red); background: #edf6ef; }
@media(max-width:850px) { .work-toolbar.find-open .close-local-search { display: inline-flex; width: 20px; height: 20px; padding: 2px; } }

/* Wider task cards with a single row of operational metadata. */
.board { grid-template-columns: repeat(4,minmax(320px,1fr)); gap: 14px; }
.column { padding: 10px; border-radius: 16px; }
.column-heading { margin-bottom: 10px; padding: 8px 11px; min-height: 36px; }
.task-card { display: flex; flex-direction: column; gap: 8px; padding: 12px 13px 10px; margin-bottom: 9px; border-radius: 11px; }
.task-card .card-title { margin: 0; font-size: var(--type-body); line-height: 1.45; font-weight: 550; overflow-wrap: anywhere; }
.card-labels { display: flex; align-items: center; gap: 8px; min-height: 21px; }
.task-card .card-category { margin: 0; font-size: var(--type-caption); line-height: 1.3; color: var(--muted); }
.task-card .priority-badge { margin: 0; padding: 1px 6px; font-size: var(--type-caption); line-height: 17px; border-radius: 5px; }
.task-card .card-footer { display: flex; align-items: center; gap: 11px; margin: 0; padding-top: 7px; border-top: 1px solid #e9eff7; font-size: var(--type-caption); min-height: 32px; }
.task-card .card-date { font-size: var(--type-caption); gap: 4px; color: var(--muted); }
.task-card .card-date svg { width: 12px; height: 12px; }
.task-card .card-checklist { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-size: var(--type-caption); color: var(--muted); white-space: nowrap; }
.task-card .card-checklist.complete { color: #68a189; }
.task-card .card-checklist svg { width: 13px; height: 13px; }
.task-card .card-comments { margin: 0; gap: 4px; font-size: var(--type-caption); color: var(--muted); }
.task-card .card-footer .avatar { width: 24px; height: 24px; margin-left: auto; font-size: 8px; }
@media(min-width:1600px) {
  .task-card { padding: 13px 15px 11px; }
  .task-card .card-title { font-size: var(--type-body);  font-weight: 550; }
}
@media(max-width:700px) {
  .board { grid-template-columns: repeat(4,320px); gap: 12px; }
  .column { padding: 10px; }
  .task-card .card-title { font-size: var(--type-body);  font-weight: 550; }
}


/* A single movable gap shows the exact drop position. */
.column-cards { position: relative; display: flow-root; }
.board.is-dragging { scroll-snap-type: none; overflow-anchor: none; }
.board-dragging, .board-dragging * { cursor: grabbing !important; user-select: none !important; }
.task-card.drag-source { display: none; }
.is-dragging .board-empty { display: none; }
.drop-placeholder {
  width: 100%; margin-bottom: 9px; border: 1.5px dashed #8aafe0;
  border-radius: 11px; background: #dceafd; box-shadow: inset 0 0 0 3px #e6f0fe;
  pointer-events: none;
}
.drag-ghost { border-color: #bbd1ed; will-change: transform; }

/* The same compact account control on every page. */
.account-menu { flex-shrink: 0; margin-left: 7px; }
.account-menu>summary { display: flex; cursor: pointer; list-style: none; border-radius: 50%; }
.account-menu>summary::-webkit-details-marker { display: none; }
.account-ring { position: relative; display: flex; padding: 2px; border: 1.5px solid #70bdc2; border-radius: 50%; background: var(--surface); }
.account-ring .avatar { width: 29px; height: 29px; border: 0; font-size: 10px; }
.account-ring i { position: absolute; bottom: 0; right: 0; width: 8px; height: 8px; background: var(--accent); border: 2px solid white; border-radius: 50%; }
.account-menu[open] .account-ring { border-color: var(--red); box-shadow: 0 0 0 3px #e2f2ee; }
.account-dropdown { position: fixed; top: 75px; right: 34px; z-index: 35; width: 310px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 91px); overflow-y: auto; background: var(--surface); border: 1px solid #dfe6ed; border-radius: 15px; box-shadow: 0 12px 38px #2946641c,0 2px 5px #29466406; padding-top: 20px; color: #303a46; text-align: left; }
.account-identity { display: flex; align-items: center; gap: 12px; padding: 0 19px 18px; }
.account-identity .avatar { width: 42px; height: 42px; flex-shrink: 0; font-size: 12px; }
.account-identity>div { min-width: 0; }
.account-identity strong { display: block; font-size: var(--type-body); font-weight: 600; overflow-wrap: anywhere; }
.account-identity small { display: block; font-size: var(--type-caption); color: #8794a5; margin-top: 4px; }
.account-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: calc(100% - 36px); margin: 0 18px 9px; padding: 11px 12px; background: #f3f7fc; border: 1px solid #eaf0f7; border-radius: 9px; text-align: left; color: #75859a; font-size: var(--type-control); }
.account-status span { overflow-wrap: anywhere; min-width: 0; }
.account-status svg { width: 17px; height: 17px; flex-shrink: 0; }
.account-group { padding: 7px 9px; border-bottom: 1px solid #edf1f5; }
.account-group button { display: flex; align-items: center; gap: 12px; padding: 11px 12px; width: 100%; border-radius: 8px; text-align: left; font-size: var(--type-control); }
.account-group button svg { width: 18px; height: 18px; color: #8190a2; flex-shrink: 0; }
.account-group button:hover,.account-status:hover { background: #edf4fd; }
.account-caption { padding: 12px 21px; color: #9aa7b7; font-size: var(--type-caption); }
.profile-preview { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; color: #8391a3; font-size: var(--type-control); }
.help-content p { font-size: var(--type-control); line-height: 1.7; color: #718198; margin-bottom: 16px; }
.help-content strong { color: #37465b; }
@media(max-width:1100px) { .account-dropdown { right: 30px; } }
@media(max-width:700px) {
 .account-menu { margin-left: 4px; }
 .account-ring { padding: 2px; }
 .account-ring .avatar { width: 25px; height: 25px; font-size: 9px; }
 .account-dropdown { top: 61px; right: 12px; max-height: calc(100dvh - 73px); }
 .workspace-title { flex: 1; min-width: 0; }
 .workspace-header .topbar-right { gap: 2px; }
 .account-group button { min-height: 44px; }
}

/* Compact, editable task lists grouped by project. */
.work-toolbar .task-scope-tabs .tab { font-size: var(--type-control); }
.list-switch { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0 14px; }
.list-switch>div { display: flex; gap: 19px; }
.list-switch button { display: flex; gap: 7px; align-items: center; padding: 7px 0; color: #64758c; font-size: var(--type-body); border-bottom: 2px solid transparent; }
.list-switch button.selected { color: var(--red); border-color: var(--red); }
.list-switch button span { padding: 1px 5px; border-radius: 5px; background: #eff4fa; font-size: var(--type-control); }
.list-hint { font-size: var(--type-control); color: #6b7c92; }
.task-list-wrap { overflow-x: auto; }
.task-list { width: 100%; border-collapse: collapse; table-layout: fixed; text-align: left; }
.task-list thead th { font-size: var(--type-control); font-weight: 400; color: #64768e; padding: 12px 10px; background: #f5f9ff; border-bottom: 1px solid #dce6f1; }
.task-list th:first-child { width: 35%; }
.task-list th:nth-child(2) { width: 20%; }
.task-list th:nth-child(3) { width: 16%; }
.task-list th:nth-child(4) { width: 15%; }
.task-list th:nth-child(5) { width: 14%; }
.task-list-row td { padding: 6px 9px; border-bottom: 1px solid #e8edf5; height: 52px; }
.task-list-row:hover { background: #f8fbff; }
.task-name-cell { position: relative; padding-left: 42px !important; }
.task-completion { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); appearance: none; width: 20px; height: 20px; border: 1.5px solid #a4b6cb; border-radius: 50%; cursor: pointer; background: var(--surface); }
.task-completion:hover { border-color: var(--red); background: #edf8f5; }
.task-completion:checked { background: var(--red); border-color: var(--red); }
.task-completion:checked:after { content: ''; display: block; width: 8px; height: 5px; border-left: 1.5px solid white; border-bottom: 1.5px solid white; transform: rotate(-45deg); margin: 4px; }
.task-name-button { display: block; width: 100%; text-align: left; font-size: var(--type-body); line-height: 1.4; color: var(--ink); padding: 5px 0; overflow-wrap: anywhere; }
.is-complete .task-name-button { text-decoration: line-through; color: #738197; }
.task-list select,.task-list input[type=date] { width: 100%; min-width: 0; height: 34px; border: 1px solid transparent; background: transparent; color: #596d86; border-radius: 6px; font-size: var(--type-control); padding: 4px; cursor: pointer; }
.task-list select:hover,.task-list input[type=date]:hover { background: #edf4fd; border-color: #dbe6f4; }
.list-assignee { display: flex; align-items: center; gap: 5px; }
.list-assignee .avatar { width: 24px; height: 24px; font-size: 9px; flex-shrink: 0; }
.task-list .list-priority { font-size: var(--type-control); height: 32px; }
.task-list .list-priority.high { color: #9b4758; background: #fce9ed; }
.task-list .list-priority.normal { color: #86652f; background: #fcf0dd; }
.task-list .list-priority.low { color: #2c7561; background: #e1f3ee; }
.task-group-heading th { padding: 14px 10px 7px; font-size: var(--type-body); font-weight: 600; color: #43546c; }
.task-group-heading .project-dot { display: inline-block; margin-right: 9px; }
.task-group-count { font-size: var(--type-control); color: #6b7f98; margin-left: 9px; }
.quick-task-row td { padding: 0 10px 3px; }
.quick-task-row form { display: flex; align-items: center; gap: 10px; max-width: 470px; }
.quick-task-row svg { width: 18px; height: 18px; color: #758ba5; }
.quick-task-row input { border: 1px solid transparent; background: transparent; border-radius: 5px; padding: 8px 5px; flex: 1; min-width: 0; font-size: var(--type-body); }
.quick-task-row input::placeholder { color: #71859e; }
.quick-task-row button { font-size: var(--type-control); color: #238f7a; padding: 7px; border-radius: 5px; visibility: hidden; }
.quick-task-row form:focus-within button { visibility: visible; }
.list-empty { font-size: var(--type-body); color: #6b7f98; padding: 25px 10px; }
@media(min-width:701px) and (max-width:1100px) { .task-list { min-width: 950px; } }
@media(max-width:700px) {
 .work-toolbar .task-scope-tabs { flex: 1; min-width: 0; overflow-x: auto; }
 .work-toolbar .task-scope-tabs .tab { padding: 5px 7px; white-space: nowrap; }
 .list-hint { display: none; }
 .list-switch { padding-bottom: 4px; }
 .task-list,.task-list tbody { display: block; width: 100%; }
 .task-list thead { display: none; }
 .task-list-row { display: grid; grid-template-columns: 1fr 1fr; padding: 5px 0 10px; border-bottom: 1px solid #e6edf6; }
 .task-list-row td { display: block; border: 0; height: auto; padding: 3px 7px; min-width: 0; }
 .task-list-row .task-name-cell { grid-column: 1/-1; min-height: 39px; padding-top: 4px; }
 .task-completion { top: 11px; transform: none; }
 .task-list-row td[data-label]:before { content: attr(data-label); display: block; font-size: var(--type-caption); color: #6b7f98; padding: 0 4px; }
 .task-group-heading,.quick-task-row { display: block; }
 .task-group-heading th,.quick-task-row td { display: block; width: 100% !important; }
 .quick-task-row button { visibility: visible; }
 .task-list .task-group-heading th { padding-top: 19px; }
 .task-list select,.task-list input[type=date] { height: 33px; }
}
@media(max-width:360px) {
 .work-toolbar .task-scope-tabs { display: grid; grid-template-columns: 1fr 1.4fr 1fr; overflow: visible; }
 .work-toolbar .task-scope-tabs .tab { white-space: normal; padding: 5px 4px; line-height: 1.25; }
 .task-list-row { grid-template-columns: 1fr; }
 .task-list-row td[data-label] { display: flex; align-items: center; gap: 6px; }
 .task-list-row td[data-label]:before { flex: 0 0 85px; }
 .task-list-row .list-assignee { flex: 1; min-width: 0; }
}
.task-group-toggle { display: flex; align-items: center; width: 100%; text-align: left; font-size: inherit; font-weight: inherit; color: inherit; padding: 3px 0; gap: 7px; }
.task-group-toggle>svg { width: 16px; height: 16px; color: #71859e; transition: transform .15s; }
.task-group-toggle[aria-expanded=false]>svg { transform: rotate(-90deg); }
.task-group-toggle .project-dot { margin-right: 1px; }
.task-group-toggle:hover { color: var(--red); }
.task-list tbody[hidden] { display: none; }

/* Editable names have visible controls, including on touch screens. */
.task-title-label { display: block; color: var(--muted); font-size: var(--type-control); margin: 6px 0 8px; }
.drawer .task-title-input { display: block; background: #f6f9fd; border: 1px solid #d6e1ef; border-radius: 10px; padding: 10px 12px; margin: 0; font-size: var(--type-title); min-height: 78px; resize: vertical; max-height: 200px; }
.task-title-input:hover { border-color: #9cb3c9; }
.task-title-input[aria-invalid=true] { border-color: #b94b5f; }
.task-title-hint { color: var(--muted); font-size: var(--type-caption); margin: 7px 0 22px; line-height: 1.5; }
.task-title-input[aria-invalid=true]+.task-title-hint { color: #a13b4e; }
.project-card { position: relative; min-width: 0; }
.project-card .project-tile { width: 100%; height: 100%; }
.project-card h2 { overflow-wrap: anywhere; }
.project-rename { position: absolute; top: 17px; right: 17px; color: var(--nav-ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; width: 34px; height: 34px; }
.project-name-action { display: flex; align-items: center; gap: 9px; max-width: 100%; padding: 3px 0; font: inherit; letter-spacing: inherit; color: inherit; text-align: left; }
.project-name-action span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-name-action svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--muted); }
.project-name-action:hover { color: var(--red); }
.project-name-action:hover svg { color: inherit; }

/* Channels live under their navigation item; messages and replies have separate panes. */
.channels-toggle .nav-chevron { margin-left: auto; display: flex; }
.channels-toggle .nav-chevron svg { width: 13px; height: 13px; transition: transform .15s; }
.channels-toggle[aria-expanded=false] .nav-chevron svg { transform: rotate(-90deg); }
.channel-navigation { margin: -2px 0 12px 20px; padding: 2px 0 3px 8px; border-left: 1px solid var(--nav-line); }
.channel-navigation[hidden] { display: none; }
.channel-navigation .channel-link { font-size: var(--type-body); line-height: 22px; padding: 7px 9px; margin-bottom: 2px; gap: 7px; min-height: 36px; align-items: baseline; }
.channel-link>span:last-child { min-width: 0; overflow-wrap: anywhere; white-space: normal; }
.channel-link.current { background: var(--nav-selected); color: var(--nav-ink); font-weight: 600; box-shadow: inset 3px 0 var(--accent); }
.channel-link.current .channel-hash { color: var(--red); }
.channel-create { display: flex; align-items: center; gap: 7px; padding: 9px; font-size: var(--type-control); color: var(--nav-muted); }
.channel-create svg { width: 13px; height: 13px; }
.channel-create:hover { color: var(--red-dark); }
.channel-workspace { height: calc(100dvh - 82px); min-height: 0; overflow: hidden; }
.channel-workspace .chat-main { display: flex; min-width: 0; min-height: 0; background: var(--surface); }
.channel-workspace.has-thread .chat-main { flex: 0 0 44%;  background: #f8fafc; }
.channel-feed-header { height: 48px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid #e4edf8; background: var(--surface); }
.channel-feed-header h2 { display: flex; align-items: center; gap: 8px; font-size: var(--type-body); font-weight: 500; }
.channel-feed-header h2 span { color: #71839b; font-size: var(--type-control); font-weight: 400; }
.channel-feed-header .btn { color: #627c9a; padding: 4px 0; min-height: 25px; font-size: var(--type-control); }
.channel-workspace .chat-messages { padding-bottom: 8px; overscroll-behavior: contain; }
.channel-workspace .day-divider { margin: 12px 22px; font-size: var(--type-control); color: #71839b; }
.channel-message { padding: 18px 21px; gap: 10px; border-bottom: 1px solid #e5edf7; border-left: 3px solid transparent; }
.channel-message>.avatar { width: 30px; height: 30px; font-size: 9px; flex-shrink: 0; }
.channel-message.selected { background: #eaf5f2; border-left-color: #40a992; }
.channel-message:hover { background: #f0f5f8; }
.channel-workspace .message-meta { flex-wrap: wrap; }
.channel-workspace .message-meta strong { font-size: var(--type-body); }
.channel-workspace .message-meta time { font-size: var(--type-control); color: #6e8198; }
.selected-thread-label { margin-left: auto; color: #577b9f; font-size: var(--type-caption); white-space: nowrap; }
.channel-workspace .message-text { display: block; width: 100%; max-width: none; text-align: left; padding: 0; color: var(--ink); font-size: var(--type-reading); line-height: 1.55; }

.channel-message .message-actions { gap: 10px; margin-top: 10px; }
.channel-message .reply-link { color: var(--red); font-size: var(--type-control); }
.reply-avatars { display: inline-flex; align-items: center; margin-right: 2px; }
.reply-avatars .avatar { width: 19px; height: 19px; font-size: 6px; border: 1px solid white; }
.reply-avatars .avatar+.avatar { margin-left: -5px; }
.channel-workspace .linked-task { color: #4f6d8c; background: #e9f0f9; font-size: var(--type-control); margin-top: 8px; padding: 5px 7px; overflow-wrap: anywhere; }
.channel-message.selected .linked-task { background: #dceee8; }
.channel-workspace .reaction { border-color: #d8e5f2; font-size: var(--type-control); }
.channel-workspace .message-tool { font-size: var(--type-control); color: #6e8198; }
.channel-workspace .thread-panel { flex: 1; width: auto; min-width: 0; min-height: 0; border-left: 1px solid #dce6f4; }
.channel-workspace .thread-panel .panel-header { min-height: 48px; height: 48px; flex-shrink: 0; padding: 0 23px; border-bottom: 1px solid #e5ecf5; }
.thread-title { display: flex; align-items: center; gap: 10px; }
.channel-workspace .thread-title h2 { font-size: var(--type-body); font-weight: 500; }
.thread-title>span { font-size: var(--type-body); color: #6e8198; }
.channel-workspace .thread-root { background: var(--surface); border-bottom: 1px solid #e6edf6; padding-bottom: 4px; }
.channel-workspace .root-message { padding: 23px 25px 20px; }
.channel-workspace .thread-panel .message { gap: 11px; }
.channel-workspace .thread-panel .message-text { color: var(--ink); font-size: var(--type-reading); line-height: 1.55; }
.channel-workspace .thread-replies-label { margin: 17px 25px 3px; border-bottom: 0; color: #6e8198; font-size: var(--type-control); padding-bottom: 0; }
.channel-workspace .new-thread-hint { color: #6e8198; font-size: var(--type-body); }
.channel-workspace .thread-scroll { overscroll-behavior: contain; }
.channel-workspace .composer-wrap { flex-shrink: 0; padding: 12px 18px 18px; }
.channel-workspace .composer { background: var(--surface); border-color: #d7e4f2; border-radius: 10px; }
.composer-context { padding: 10px 12px 0; color: #6e8198; font-size: var(--type-control); }
.channel-workspace .composer textarea { min-height: 60px; max-height: 140px; font-size: var(--type-reading); padding: 10px 12px; }
.channel-workspace .composer-hint { font-size: var(--type-caption); color: #71839b; }
@media(max-width:1100px) {
 .channel-workspace.has-thread .chat-main { display: none;  background: #f8fafc; }
 .channel-workspace .thread-panel { border-left: 0; }
 .channel-workspace .thread-panel .panel-header { padding-left: 18px; padding-right: 18px; }
 .channel-workspace .thread-title>span { display: none; }
 .channel-workspace .message-preview { -webkit-line-clamp: unset; }
}
@media(max-width:700px) {
 .channel-workspace { height: calc(100dvh - 54px); min-height: 0; }
 .channel-feed-header { padding: 0 17px; height: 43px; }
 .channel-message { padding: 16px 14px; }
 .channel-workspace .root-message { padding: 18px; }
 .channel-workspace .composer-wrap { padding: 10px 12px 12px; }
 .channel-workspace .thread-panel .panel-header { height: 43px; min-height: 43px; }
 .channel-workspace .thread-title h2:before { content: '↳'; margin-right: 7px; color: #82a2c3; }
}

/* Consistent generated portraits across messages, tasks, projects and profile. */
.avatar { position: relative; overflow: hidden; }
.avatar-photo { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.avatar-initials { line-height: 1; }

/* Author-led channel rhythm: one visual header per short run of messages. */
.channel-workspace .chat-messages { padding-top: 4px; }
.channel-workspace .day-divider { margin-bottom: 18px; font-size: 12px; }
.channel-workspace .message { gap: 12px; padding: 12px 22px; margin-top: 10px; border: 0; border-left: 3px solid transparent; }
.channel-workspace .message>.avatar,
.channel-workspace .message-rail { width: 40px; height: 40px; flex: 0 0 40px; }
.channel-workspace .message>.avatar { border: 0; border-radius: 10px; box-shadow: 0 0 0 1px rgba(35,53,72,.07); }
.channel-workspace .message-meta { gap: 8px; margin-bottom: 4px; min-height: 21px; }
.channel-workspace .message-meta strong { font-size: 16px; font-weight: 650; line-height: 1.3; color: #233548; }
.channel-workspace .message-meta time { font-size: 12px; color: #76869a; }
.message-self-label { padding: 1px 5px; border-radius: 4px; font-size: 11px; line-height: 16px; font-weight: 500; color: #527086; background: #e0ebf5; }
.channel-workspace .own-message { background: #f1f6fc; }
.channel-workspace .channel-message:hover { background: #f7f9fc; }
.channel-workspace .own-message:hover { background: #eaf2fa; }
.channel-workspace .channel-message.selected { background: #eaf5f2; border-left-color: var(--accent); }
.channel-workspace .message-actions { gap: 10px; margin-top: 7px; min-height: 24px; }
.channel-workspace .message-actions button { font-size: 13px; }
.channel-workspace .message-actions .message-tool { color: #708398; }
.channel-workspace .reply-avatars .avatar { width: 22px; height: 22px; }
.channel-workspace .linked-task { margin-top: 8px; font-size: 13px; }
.channel-workspace .thread-root { padding-bottom: 12px; }
.channel-workspace .thread-reply { margin-top: 8px; }
.channel-workspace .message-continuation { margin-top: 0; padding-top: 4px; padding-bottom: 7px; }
.message-continuation .message-meta { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.channel-workspace .message-rail { display: flex; justify-content: center; height: auto; padding-top: 4px; }
.message-followup-time { font-size: 10px; color: #8492a2; font-variant-numeric: tabular-nums; }
.message-edited { display: inline; margin-left: 5px; color: #76869a; font-size: 12px; line-height: 1.4; white-space: nowrap; }
.message-tools { position: absolute; top: -8px; right: 14px; z-index: 3; display: flex; gap: 2px; padding: 3px; border: 1px solid #d5e1ec; border-radius: 8px; background: var(--surface); box-shadow: 0 3px 10px #2335480c; opacity: 0; pointer-events: none; transition: opacity .12s; }
.message:hover>.message-tools,
.message:focus-within>.message-tools,
.message:has(>.message-tools [aria-expanded=true])>.message-tools { opacity: 1; pointer-events: auto; }
.message-tools .message-tool { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 27px; padding: 5px; border-radius: 5px; color: #627b94; }
.message-tools .message-tool:hover,
.message-tools .message-tool:focus-visible,
.message-tools .message-tool[aria-expanded=true] { color: var(--accent); background: #e9f4f3; }
.message-tools .message-delete-button:hover,
.message-tools .message-delete-button:focus-visible { color: #b83f4d; background: #fcebed; }
.message-tools .message-tool svg { width: 17px; height: 17px; }
.message-actions:empty { display: none; }
.message-tombstone { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; min-height: 27px; color: #7b8999; }
.message-tombstone>span { display: inline-flex; align-items: center; gap: 7px; font-size: 15px; font-style: italic; }
.message-tombstone svg { width: 15px; height: 15px; }
.message-tombstone time { font-size: 12px; }
.message.is-deleted>.avatar { opacity: .7; }
.message-delete-confirm { padding: 12px; margin: 5px 0 8px; border: 1px solid #e6c6cc; border-radius: 9px; background: #fffafb; }
.message-delete-confirm strong { font-size: 14px; color: var(--ink); }
.message-delete-confirm p { margin: 5px 0 10px; font-size: 13px; color: #718197; }
.message-delete-confirm>div { display: flex; justify-content: flex-end; gap: 8px; }
.message-delete-confirm .btn { min-height: 30px; padding: 5px 10px; font-size: 13px; }
.message-delete-confirm-button { color: white; background: #b54758; }
.message-delete-confirm-button:hover { background: #973c4a; }
@media(hover:none),(max-width:700px) {
 .message-tools { opacity: 1; pointer-events: auto; top: 5px; right: 10px; box-shadow: none; padding: 1px; gap: 0; }
 .message:has(>.message-tools)>.message-body>.message-meta { padding-right: 38px; }
 .message:has(>.message-tools .message-edit-button)>.message-body>.message-meta { padding-right: 95px; }
 .message:has(>.message-tools [data-action=message-to-task])>.message-body>.message-meta { padding-right: 66px; }
 .message:has(>.message-tools .message-edit-button):has(>.message-tools [data-action=message-to-task])>.message-body>.message-meta { padding-right: 122px; }
 .message-continuation:has(>.message-tools)>.message-body { padding-top: 29px; }
}
.message-actions .reaction-chip { display: inline-flex; gap: 5px; align-items: center; padding: 3px 6px; min-height: 27px; background: #fff; border: 1px solid #d8e4ef; border-radius: 7px; font-size: 12px; color: #536b82; }
.message-actions .reaction-chip.active { border-color: #70b6ad; background: #e7f4f1; color: #15786e; }
.message-actions .reaction-chip:hover { border-color: #7e9fb8; }
.reaction-emoji { font-size: 15px; line-height: 18px; }
.reaction-avatars { display: inline-flex; align-items: center; padding-left: 2px; }
.reaction-avatars .avatar { width: 18px; height: 18px; border: 1px solid #fff; font-size: 6px; }
.reaction-avatars .avatar+.avatar { margin-left: -4px; }
.reaction-overflow { font-size: 10px; }
.reaction-picker-popup { position: fixed; z-index: 250; width: 250px; max-width: calc(100vw - 16px); padding: 12px; background: var(--surface); border: 1px solid #d6e2ee; border-radius: 12px; box-shadow: 0 12px 38px #23354826,0 2px 5px #2335480a; }
.reaction-picker-caption { display: block; margin: 0 3px 8px; font-size: 12px; color: #697e92; }
.reaction-choices { display: flex; justify-content: space-between; gap: 2px; }
.reaction-choices button { width: 42px; height: 42px; display: grid; place-items: center; padding: 0; border-radius: 8px; font-size: 24px; }
.reaction-choices button:hover,
.reaction-choices button:focus-visible { background: #edf3fa; outline: 2px solid #9db8ce; outline-offset: -2px; }
.reaction-choices button[aria-pressed=true] { background: #e4f2ee; box-shadow: inset 0 0 0 1px #79b8ad; }
.message-edit-form { width: 100%; margin: 6px 0 9px; background: var(--surface); border: 1px solid #77afa9; border-radius: 9px; padding: 10px; }
.message-edit-label { display: block; margin-bottom: 6px; color: #5f7b8d; font-size: 12px; }
.message-edit-form textarea { display: block; width: 100%; min-height: 85px; max-height: 250px; resize: vertical; padding: 6px; border: 0; border-radius: 4px; color: var(--ink); font: inherit; font-size: 16px; line-height: 1.55; background: var(--surface); }
.message-edit-form textarea:focus { outline: 2px solid #b6d5e5; outline-offset: 0; }
.message-edit-form textarea[aria-invalid=true] { outline-color: #c8757f; }
.message-edit-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.message-edit-footer small { color: #76869a; font-size: 11px; }
.message-edit-footer>div { display: flex; gap: 7px; margin-left: auto; }
.message-edit-footer .btn { min-height: 31px; padding: 5px 11px; font-size: 13px; }
@media(max-width:700px) {
 .channel-workspace .message { padding-left: 12px; padding-right: 14px; gap: 10px; }
 .channel-workspace .message>.avatar,
 .channel-workspace .message-rail { width: 36px; flex-basis: 36px; }
 .channel-workspace .message>.avatar { height: 36px; border-radius: 9px; }
}

/* Preserve full labels when controls need more room on a phone. */
@media(max-width:700px) {
 .workspace-title h1 { font-size: var(--type-section); }
 .work-toolbar:has(.task-scope-tabs) .task-scope-tabs { display: grid; grid-template-columns: 1fr 1.4fr 1fr; overflow: visible; }
 .work-toolbar .task-scope-tabs .tab { white-space: normal; padding: 5px 4px; line-height: 1.25; }
 .work-toolbar:not(:has(.task-scope-tabs)) .tabs { flex: 1; min-width: 0; }
 .work-toolbar:not(:has(.task-scope-tabs)) .tab { min-width: 0; padding-left: 7px; padding-right: 7px; white-space: normal; line-height: 1.25; }
 .form-row { grid-template-columns: minmax(0,1fr); gap: 0; }
 .field-grid { grid-template-columns: 1fr; gap: 6px; }
 .field-grid .field-label { margin-top: 8px; }
 .field-grid .inline-select, .field-grid .inline-date { width: 100%; min-width: 0; }
 .field-grid .assignee-field { width: 100%; }
}

/* Compact greeting, anchored search and personal profile photo. */
.workspace-title.dashboard-title { flex-wrap: wrap; column-gap: 20px; row-gap: 0; }
.dashboard-title h1 { margin: 0; }
.greeting-wave { display: inline-block; margin-left: 8px; font-size: .94em; }
.workspace-date { color: var(--muted); font-size: 13px; white-space: nowrap; }
.workspace-date::first-letter { text-transform: uppercase; }
.header-search { position: relative; flex: 0 0 32px; width: 32px; height: 36px; }
.header-search-field { position: absolute; right: 0; top: 0; width: 32px; height: 36px; opacity: 0; visibility: hidden; overflow: hidden; border: 1px solid #c8d9e9; border-radius: 9px; background: var(--surface); transition: width .2s ease, opacity .15s ease; }
.header-search.is-open { z-index: 40; }
.header-search.is-open .header-search-field { width: var(--search-width,320px); opacity: 1; visibility: visible; box-shadow: 0 0 0 3px #eaf2fa; }
.header-search-field input { width: 100%; height: 100%; min-width: 0; padding: 0 38px 0 12px; border: 0; outline: none; color: var(--ink); font: inherit; font-size: 14px; background: transparent; appearance: none; }
.header-search-field input::-webkit-search-cancel-button { display: none; }
.header-search-trigger { position: relative; z-index: 1; width: 32px; height: 36px; }
.header-search-results { position: fixed; z-index: 45; overflow-y: auto; overscroll-behavior: contain; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 14px 40px #23354821; }
.header-search-results[hidden] { display: none; }
.header-search-results .search-caption { padding: 8px 10px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.header-search-results .search-result { padding: 10px; border-radius: 7px; gap: 10px; text-align: left; }
.header-search-results .search-result>div { min-width: 0; }
.header-search-results .search-result strong { font-size: 14px; line-height: 1.45; }
.header-search-results .search-result span { font-size: 12px; }
.header-search-results .search-result p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; margin: 0 0 3px; }
.header-search-results .empty-state { padding: 24px 12px; }
.header-search-results .empty-state h2 { font-size: 17px; }
.profile-photo-editor { display: flex; align-items: center; gap: 18px; padding: 6px 0 10px; }
.profile-photo-preview { flex-shrink: 0; }
.profile-photo-preview .avatar.large { width: 88px; height: 88px; font-size: 25px; border-radius: 24px; }
.profile-photo-copy { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.profile-photo-copy strong { font-size: 16px; color: var(--ink); font-weight: 600; }
.profile-photo-copy>span, .profile-photo-copy small { color: var(--muted); font-size: 12px; }
.profile-photo-actions { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0 4px; }
.profile-photo-actions .btn { font-size: 13px; }
.profile-photo-feedback { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 0 0 18px; }
.profile-photo-feedback:empty { display: none; }
.profile-photo-feedback.is-error { color: #b34246; }
@media(max-width: 1000px) {
  .workspace-title.dashboard-title { column-gap: 12px; }
  .workspace-date { font-size: 11px; }
}
@media(max-width: 700px) {
  .workspace-title.dashboard-title { display: block; }
  .dashboard-title h1 { font-size: 17px; }
  .workspace-date { display: block; font-size: 10px; line-height: 1.5; }
  .header-search { flex-basis: 28px; width: 28px; }
  .header-search-trigger { width: 28px; }
  .profile-photo-editor { align-items: flex-start; gap: 12px; }
  .profile-photo-preview .avatar.large { width: 64px; height: 64px; border-radius: 18px; }
}
@media(prefers-reduced-motion: reduce) { .header-search-field { transition: none; } }
