.login-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2000 !important;
  width: 100% !important;
  height: 100% !important;
}

/* Flex .main-area + margin:auto on .tab-content shrinks tabs to content width.
   Stretch every direct tab so new pages don't reintroduce the narrow-column bug. */
.main-area > .tab-content {
  width: 100%;
  max-width: 1600px;
  box-sizing: border-box;
  align-self: stretch;
}

/* На desktop сохраняем геометрию legacy: rail 64px и раскрытие до 232px
   поверх контента. Основные правила принадлежат design-2026.css. */

.cal-month-grid > button.cal-month-cell {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  background: transparent;
  cursor: pointer;
}
.cal-month-cell.selected {
  outline: 2px solid var(--accent, #4e5180);
  outline-offset: -2px;
  z-index: 1;
}

.docs-layout.docs-layout--stub {
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  width: 100%;
  max-width: none;
  max-height: none;
  min-height: min(520px, calc(100vh - 140px));
  height: calc(100vh - 140px);
  border: 1px solid var(--border, #e3e7ee);
  border-radius: 12px;
  background: var(--surface, #fff);
  overflow: hidden;
}
.docs-layout--stub .docs-panel {
  height: auto;
  max-height: calc(100vh - 160px);
}
.docs-layout--stub .docs-preview-panel {
  background: var(--fill, #eef1f5);
  padding: 16px !important;
}

.tabs-settings-panel {
  max-width: 520px;
  margin: 0 auto;
  padding: 24px 20px 32px;
  background: var(--surface, #fff);
  border-radius: 12px;
  border: 1px solid var(--border, #e3e7ee);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.tabs-settings-title {
  margin: 0 0 8px;
  font-size: var(--text-lg);
  font-weight: 650;
}
.tabs-settings-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 16px 0;
  padding: var(--space-1);
  list-style: none;
  background: var(--fill, #eef1f5);
  border: 1px solid var(--border, #e3e7ee);
  border-radius: 10px;
}
.tabs-settings-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 10px 14px !important;
  border-radius: 8px !important;
  cursor: pointer;
  background: transparent !important;
  transition: background 0.12s ease !important;
}
.tabs-settings-row:hover {
  background: var(--surface, #fff) !important;
}
.tabs-settings-label {
  flex: 1;
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text, #181b26);
}
.tabs-settings-lock {
  font-size: var(--text-xs);
  color: var(--text-muted, #6a7180);
  padding: 2px 7px;
  background: var(--fill, #eef1f5);
  border-radius: 999px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.tabs-settings-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.cal-side-panel {
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e3e7ee);
  border-radius: 12px;
}

[data-theme='dark'] .docs-layout--stub,
[data-theme='dark'] .tabs-settings-panel,
[data-theme='dark'] .cal-side-panel {
  background: var(--color-surface, #1f2233);
  border-color: var(--color-border, #343852);
  color: var(--color-text, #e8e9f0);
}
[data-theme='dark'] .cal-month-cell.other-month {
  background: rgba(255, 255, 255, 0.03) !important;
}
[data-theme='dark'] .cal-month-cell.weekend-cell {
  background: rgba(255, 255, 255, 0.02) !important;
}
[data-theme='dark'] .cal-month-cell.other-month .cal-day-num {
  color: var(--color-text-muted, #9ca1b4) !important;
}
[data-theme='dark'] .tabs-settings-list {
  background: var(--color-bg-app, #161826);
  border-color: var(--color-border, #343852);
}
[data-theme='dark'] .tabs-settings-row:hover {
  background: var(--surface-hover, #2a2d40) !important;
}
[data-theme='dark'] .tabs-settings-label {
  color: var(--color-text, #e8e9f0);
}

a,
a:hover,
a:visited,
a:active {
  color: inherit;
  text-decoration: none;
}

.login-box .login-link:hover,
.home-mockup .card-more:hover {
  text-decoration: underline;
}

.home-mockup .kpi:hover,
.home-mockup .home-fav-card:hover,
.hc-kpi-tile:hover,
.kb-card:hover,
.kanban-card:hover,
.wf-tile:hover,
.wf-tile:focus-visible,
.notes-header-btn:hover,
.hdr-action-btn:hover,
#themeToggleBtn:hover,
#userAvatar:hover,
.profile-avatar-preview:hover,
.docs-mydocs-card:hover,
#tab-docs .docs-v2-tile:hover,
.tbl-tile:hover,
.cal-add-btn:hover,
.cal-event-pill:hover,
.cal-color-swatch:hover,
.cal-daydot[onclick]:hover,
.cal-year-mini-day:active:not(.other-month),
.task-risk-flag:hover,
.task-shift-chip:hover,
.passport-validation-item:hover,
.plan-card:hover,
.card:hover,
.side-link:hover,
.nav-core-btn:hover,
.btn-primary:hover,
.btn-secondary:hover,
.btn-ghost:hover,
.admin-btn-primary:hover,
.admin-btn-secondary:hover,
.fcp-submit:hover:not(:disabled) {
  transform: none !important;
}

.btn-primary:active,
.btn-secondary:active,
.btn-ghost:active,
.admin-btn-primary:active,
.admin-btn-secondary:active,
.cal-add-btn:active,
.notif-action-btn:active,
.modal-buttons button:active,
.fcp-submit:active:not(:disabled) {
  transform: none !important;
}

.project-chrome-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-bottom: var(--space-3);
}
.project-chrome-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.project-progress {
  width: 120px;
  height: 6px;
  border-radius: 4px;
  background: var(--fill);
  overflow: hidden;
}
.project-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
}
.status-chip {
  display: inline-block;
  font-size: var(--text-xs);
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--fill);
  color: var(--text-muted);
}
.status-chip--progress,
.status-chip--review {
  background: var(--accent-tint);
  color: var(--accent-deep, var(--accent));
}
.status-chip--done {
  background: color-mix(in srgb, var(--status-done) 22%, transparent);
  color: var(--status-done);
}
.status-chip--blocked,
.status-chip--failed {
  background: color-mix(in srgb, var(--status-failed) 22%, transparent);
  color: var(--status-failed);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.workflow-canvas {
  position: relative;
  min-height: 420px;
  background: var(--fill);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.workflow-node {
  position: absolute;
  min-width: 120px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: grab;
  user-select: none;
}
.workflow-node.is-start {
  border-color: var(--status-done);
}
.workflow-node.is-end {
  border-color: var(--status-failed);
}
.cal-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: var(--space-4);
}
.home-mockup button.cal-day {
  appearance: none;
  color: inherit;
  font: inherit;
  text-align: left;
}
@media (max-width: 900px) {
  .cal-layout {
    grid-template-columns: 1fr;
  }
}
.swot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}
.swot-cell {
  padding: var(--space-3);
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  min-height: 120px;
}
.passport-views {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

/* Competitors owns its full-page surface and spacing in competitors.css. */
#tab-competitors .roadmap-sheet.competitors-route-sheet {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.tab-content.active,
.tab-content.active > * {
  animation: none !important;
}
html.theme-is-changing,
html.theme-is-changing *,
html.theme-is-changing *::before,
html.theme-is-changing *::after {
  transition: none !important;
}
.roadmap-actions-wrap {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.roadmap-actions-wrap--task {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
}

.roadmap-actions-wrap--task .rc-menu-btn--task {
  position: static;
  transform: none;
}

.roadmap-actions-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: auto;
  min-width: 180px;
  z-index: 1200;
}

/* React roadmap phase header from the current master markup. */
#tab-plan #planTable .phase-row td {
  padding: 0 !important;
  background: color-mix(in srgb, var(--phase-color, var(--accent)) 4%, var(--color-surface, #fff)) !important;
  border-top: 7px solid var(--color-bg-app, #f7f8fa) !important;
  border-bottom: 1px solid var(--color-border, #e3e7ee) !important;
  box-shadow: inset 3px 0 0 var(--phase-color, var(--accent)) !important;
}

#tab-plan #planTable .phase-row:hover td {
  background: color-mix(in srgb, var(--phase-color, var(--accent)) 6%, var(--color-surface, #fff)) !important;
}

#tab-plan .phase-row-content {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 50px;
  padding: 0 13px 0 11px;
}

#tab-plan .phase-row-content .plan-drag-handle {
  margin: 0 1px 0 0;
  color: var(--color-text-muted, #9aa1ae);
  opacity: 0.38;
  font-size: var(--text-xs);
}

#tab-plan .phase-row:hover .plan-drag-handle { opacity: 0.75; }

#tab-plan .phase-collapse-button,
#tab-plan .phase-title-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  box-shadow: none;
  cursor: pointer;
}

#tab-plan .phase-collapse-button {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 6px;
  color: var(--color-text-muted, #9aa1ae);
}

#tab-plan .phase-collapse-button:hover { background: var(--color-bg-subtle, #eef1f5); color: var(--color-text, #181b26); }
#tab-plan .phase-collapse-button:focus-visible,
#tab-plan .phase-title-button:focus-visible { outline: 2px solid var(--accent, #4e5180); outline-offset: 2px; }
#tab-plan .phase-collapse-button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform 160ms ease; }
#tab-plan .phase-collapse-button.is-collapsed svg { transform: rotate(-90deg); }

#tab-plan .phase-color-marker {
  width: 7px;
  height: 7px;
  margin: 0 3px 0 1px;
  border-radius: 50%;
  background: var(--phase-color, var(--accent));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--phase-color, var(--accent)) 13%, transparent);
  flex: 0 0 auto;
}

#tab-plan .phase-title-button {
  min-width: 0;
  padding: 3px 1px;
  color: var(--color-text, #181b26);
  font-size: var(--text-base);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-align: left;
  text-transform: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#tab-plan .phase-step-count,
#tab-plan .phase-empty-count {
  color: var(--color-text-muted, #9aa1ae);
  font-size: var(--text-xs);
  font-weight: 500;
  white-space: nowrap;
}

#tab-plan .phase-step-count::before { content: '·'; margin-right: var(--space-2); }

#tab-plan .phase-row-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

#tab-plan .phase-row .phase-progress-block {
  float: none;
  margin: 0 6px 0 0;
  gap: var(--space-2);
}

#tab-plan .phase-row .phase-progress-bar { width: 54px; height: 3px; }

#tab-plan .phase-row .btn-inline-add {
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--color-border, #e3e7ee);
  border-radius: 7px;
  background: transparent;
  color: var(--color-text-secondary, #6a7180);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 26px;
}

#tab-plan .phase-row .btn-inline-add:hover {
  border-color: color-mix(in srgb, var(--accent, #4e5180) 35%, var(--color-border, #e3e7ee));
  background: var(--accent-tint, #f4f2fa);
  color: var(--accent, #4e5180);
}

#tab-plan .phase-row .btn-phase-menu {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--color-text-muted, #9aa1ae);
  font-size: var(--text-lg);
}

#tab-plan .phase-row .btn-phase-menu:hover { background: var(--color-bg-subtle, #eef1f5); color: var(--color-text, #181b26); }

/* React task editor uses the original task-drawer visual system. */
.task-drawer--react .task-drawer-head {
  position: relative;
  top: auto;
  z-index: auto;
  min-height: 0;
  background: var(--color-surface);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

.task-drawer-menu--react {
  top: 50px;
  right: 14px;
  left: auto;
}

.task-drawer-owner {
  min-height: 38px;
  padding: 7px 8px;
}

.task-drawer-owner .fio-picker-chips {
  min-height: 22px;
  justify-content: center;
}

.task-drawer-autosave {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.task-drawer-comments-section .drawer-comments {
  margin: 0;
  padding: 0;
  border: 0;
}

.task-drawer--react .task-drawer-section-head {
  position: static;
  z-index: auto;
  min-height: 0;
  padding: 0;
  border-bottom: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

.task-drawer-comments-section .comment-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.task-drawer-comments-section .comment-list li {
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-faint);
}

.task-drawer-comments-section .comment-input {
  box-sizing: border-box;
  width: 100%;
  min-height: 66px;
  resize: vertical;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: var(--text-sm);
}

.task-drawer-comments-section .comment-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-25);
}

.task-drawer-comments-section .btn-ghost {
  margin-top: 8px;
}

.fio-picker-opt:is(button) {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  font-family: inherit;
}

/* React kanban keeps the legacy card/table language while adding complete
   keyboard states and replacing the misleading delete ellipsis. */
#tab-kanban .kb-card:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-color: var(--color-primary-50);
}

#tab-kanban .kb-card-delete {
  width: 24px;
  height: 24px;
  padding: 0;
  justify-content: center;
  border-radius: 6px;
  color: var(--color-text-muted);
  font-size: 19px;
  font-weight: 500;
}

#tab-kanban .kb-card-delete:hover,
#tab-kanban .kb-card-delete:focus-visible {
  color: var(--color-danger);
  background: var(--color-danger-soft);
  outline: none;
}

#tab-kanban .kb-avatars .avatar + .avatar {
  margin-left: -5px;
}

#tab-kanban .kb-avatar-more {
  display: inline-flex;
  align-items: center;
  height: 20px;
  margin-left: 5px;
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: 600;
}

#tab-kanban .kb-list-row:focus-visible td,
#tab-kanban .kb-adv-group:focus-visible td {
  background: var(--color-primary-25);
  outline: none;
}

#tab-kanban .kb-list-row:focus-visible,
#tab-kanban .kb-adv-group:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

/* React still reuses the legacy .modal shell on project, admin and risks
   screens. Normalize native controls because inputs without an explicit
   type do not match the old input[type=text] selector. */
.modal-overlay.active > .modal {
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
}

.modal input:not([type='checkbox']):not([type='radio']):not([type='color']):not([type='file']),
.modal select,
.modal textarea {
  width: 100%;
  min-height: 38px;
  box-sizing: border-box;
  padding: 8px 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  outline: none;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 400;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.modal textarea {
  min-height: 76px;
  resize: vertical;
}

.modal input:not([type='checkbox']):not([type='radio']):not([type='color']):not([type='file']):focus,
.modal select:focus,
.modal textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-25);
}

@media (max-width: 768px) {
  .modal-overlay.active {
    padding: 12px;
  }

  .modal-overlay.active > .modal {
    width: 100%;
    min-width: 0;
    max-height: calc(100dvh - 24px);
    padding: 20px 18px;
    border-radius: 16px;
  }

  /* The React list intentionally has no bulk-selection checkbox, so its
     column indices differ from the legacy table. Keep the same compact card
     reading order using semantic cell classes. */
  #tab-kanban.tab-content .kb-adv-table tr.kb-list-row > td {
    display: none !important;
  }

  #tab-kanban.tab-content .kb-adv-table tr.kb-list-row > td.kb-adv-id {
    display: inline-block !important;
    order: 1;
    flex: 0 0 auto;
    color: var(--ink-muted);
    font-size: 11px;
  }

  #tab-kanban.tab-content .kb-adv-table tr.kb-list-row > td.kb-list-title {
    display: block !important;
    order: 2;
    flex: 1 1 100%;
    font-size: 14px;
    font-weight: 600;
  }

  #tab-kanban.tab-content .kb-adv-table tr.kb-list-row > td:nth-child(3),
  #tab-kanban.tab-content .kb-adv-table tr.kb-list-row > td.kb-list-due,
  #tab-kanban.tab-content .kb-adv-table tr.kb-list-row > td:nth-child(6) {
    display: inline-block !important;
    flex: 0 0 auto;
  }

  #tab-kanban.tab-content .kb-adv-table tr.kb-list-row > td:nth-child(3) {
    order: 3;
  }

  #tab-kanban.tab-content .kb-adv-table tr.kb-list-row > td.kb-list-due {
    order: 4;
  }

  #tab-kanban.tab-content .kb-adv-table tr.kb-list-row > td:nth-child(6) {
    order: 5;
  }

  .task-drawer-owner {
    padding: 4px 8px !important;
  }

  .task-drawer-autosave {
    display: none;
  }
}

/* Shared modal behavior for React-owned specialized dialogs. Their internal
   layouts stay page-specific, while the scrim and entrance remain consistent. */
.tz-modal-overlay,
.darch-modal-overlay,
.passport-lightbox,
.passport-schema-modal {
  background: var(--scrim, rgba(28, 28, 30, 0.4));
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  animation: bpm-modal-overlay-in 180ms ease-out;
}

.tz-modal,
.darch-modal {
  animation: bpm-modal-window-in 220ms ease-out;
}

/* React roadmap dates keep the exact legacy DD.MM.YYYY format and open the
   shared PrimeBPM calendar popup without changing the table/card geometry. */
#tab-plan .plan-date-editor {
  position: relative;
  display: inline-flex;
  flex: 1 1 88px;
  min-width: 0;
}

#tab-plan .plan-date-editor > .task-date-input,
#tab-plan .plan-date-editor > .step-date-input,
#tab-plan .plan-date-editor > .rc-date-input {
  width: 100% !important;
  padding-right: 22px !important;
}

#tab-plan .plan-date-calendar-icon {
  position: absolute;
  top: 50%;
  right: 5px;
  display: inline-flex;
  color: var(--color-text-muted);
  pointer-events: none;
  transform: translateY(-50%);
}

#tab-plan .plan-date-trigger {
  position: absolute;
  top: 0;
  right: 0;
  width: 24px;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

#tab-plan .plan-date-editor:focus-within .plan-date-calendar-icon {
  color: var(--color-primary);
}

/* Единый React-popover статуса повторяет legacy UI.openPopover, но работает
   через portal: меню не обрезается таблицей, карточкой фазы или task drawer. */
.task-status-trigger {
  min-width: 106px;
  min-height: 26px;
  justify-content: flex-start;
  border: 1px solid transparent !important;
  font-family: inherit;
  white-space: nowrap;
}

.task-status-trigger:hover {
  border-color: var(--color-border-strong) !important;
}

.task-status-trigger:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.task-status-trigger-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-status-trigger-chevron {
  flex: 0 0 auto;
  margin-left: auto;
  opacity: 0.62;
  transition: transform 120ms ease-out;
}

.task-status-trigger[aria-expanded="true"] .task-status-trigger-chevron {
  transform: rotate(180deg);
}

.task-status-trigger--table {
  width: 108px;
}

.task-status-trigger--card {
  width: 112px;
}

.task-status-trigger--drawer {
  width: 148px;
  min-height: 32px;
  padding: 6px 10px 6px 9px;
  font-size: 12px;
}

.task-status-popover {
  position: fixed !important;
  z-index: 7000 !important;
  min-width: 190px;
  background: var(--color-surface) !important;
  border-color: var(--color-border-strong);
}

.task-status-popover[data-origin^="bottom"] {
  transform: translateY(4px);
}

.task-status-popover.is-open {
  transform: translateY(0);
}

.task-status-popover .ui-popover-item-dot.is-todo {
  background: var(--ink-muted, #6f655b);
}

.task-status-popover .ui-popover-item-dot.is-progress {
  background: var(--status-progress, #a26b20);
}

.task-status-popover .ui-popover-item-dot.is-review {
  background: var(--accent, #4e5180);
}

.task-status-popover .ui-popover-item-dot.is-done {
  background: var(--status-done, #4e8a6a);
}

.task-status-popover .ui-popover-item-dot.is-blocked {
  background: var(--status-failed, #c0553b);
}

[data-theme="dark"] .task-status-popover {
  background: var(--color-surface) !important;
  border-color: var(--color-border-strong);
  box-shadow: 0 14px 34px rgba(8, 10, 18, 0.38);
}

#tab-plan .task-approval-chips {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  max-width: 220px;
}
#tab-plan .task-approval-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}
#tab-plan .appr-pending-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-tint, #ececf5);
  color: var(--accent-deep, #353659);
  font-size: var(--text-base);
  font-weight: 500;
}
#tab-plan .date-shift-chip {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--fill, #eef1f5);
  border: 1px solid var(--border, #e3e7ee);
  color: var(--text-muted, #6a7180);
  font-size: var(--text-xs);
  white-space: nowrap;
}
#tab-plan .date-shift-chip.is-compact {
  margin-left: var(--space-1);
  padding: 0 5px;
}
#tab-plan .task-approval-chips .btn-sm {
  min-height: 36px;
  padding: 0 12px;
  font-size: var(--text-base);
  font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {
  .task-status-popover,
  .task-status-trigger-chevron {
    transition: none !important;
  }

  .confetti-piece {
    display: none !important;
    animation: none !important;
  }
}

/* Weekly plan React bridge */
.weekly-plan .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.weekly-plan-status-wrap {
  position: relative;
  display: inline-flex;
}
.weekly-plan-status-menu {
  position: absolute;
  z-index: 8;
  top: calc(100% + 4px);
  left: 0;
  display: grid;
  gap: var(--space-1);
  min-width: 148px;
  padding: 6px;
  border: 1px solid var(--color-border, var(--border));
  border-radius: 10px;
  background: var(--color-surface, var(--surface));
  box-shadow: var(--shadow-surface, 0 8px 24px rgba(24, 27, 38, 0.12));
}
.weekly-plan-status-menu .status-pill {
  justify-content: flex-start;
  width: 100%;
  cursor: pointer;
}

/* Assignments MVP create form bridge */
.pa-create-card {
  display: grid;
  gap: var(--space-3);
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.pa-create-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.pa-create-card label {
  display: grid;
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.pa-create-card input,
.pa-create-card select {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}
.pa-primary-btn,
.pa-link-btn,
.pa-row-actions button {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--fill);
  color: var(--text);
  cursor: pointer;
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1;
}
.pa-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
.pa-primary-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent, #fff);
  justify-self: start;
}
.pa-list {
  display: grid;
  gap: 10px;
}
.pa-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.pa-row-meta,
.pa-row-side {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}
.pa-status {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-muted);
}

#tab-assignments .pa-filter-tabs,
.pa-shell .pa-filter-tabs {
  gap: var(--space-2);
}
#tab-assignments .pa-filter-tabs button,
.pa-shell .pa-filter-tabs button {
  min-height: 36px;
  padding: 0 12px;
  font-size: var(--text-base);
  font-weight: 500;
}
#tab-assignments .pa-filter-tabs button.is-active,
.pa-shell .pa-filter-tabs button.is-active {
  font-size: var(--text-base);
  font-weight: 600;
}
.pa-empty {
  padding: var(--space-6);
  color: var(--text-muted);
  text-align: center;
}

/* Quick notes */
.quick-notes {
  position: relative;
}
.hdr-note-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--fill);
  color: var(--text);
  cursor: pointer;
}
.quick-notes-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  display: grid;
  gap: var(--space-2);
  width: min(320px, calc(100vw - 24px));
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(24, 27, 38, 0.14);
}
.quick-notes-panel textarea {
  width: 100%;
  resize: vertical;
  min-height: 120px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}
.quick-notes-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}
.quick-notes-actions button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--fill);
  color: var(--text);
  cursor: pointer;
}
.quick-notes-actions button:last-child {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent, #fff);
}

/* Projects + feedback (kept here so Docker/Vite pick up edits to existing file) */
#tab-projects.tab-content,
#tab-my-feedback.tab-content,
#tab-feedback.tab-content { width: 100%; box-sizing: border-box; }
.projects-browser { display: grid; gap: var(--space-4); width: 100%; max-width: 1480px; margin: 0 auto; }
.projects-browser-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3); align-items: end; }
.projects-browser-filters { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.projects-browser-filters input,
.projects-browser-filters select { min-height: 40px; min-width: 160px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.projects-browser-grid { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.projects-browser-card { display: grid; gap: var(--space-2); align-content: start; min-height: 120px; padding: var(--space-4); border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.projects-browser-card span,
.projects-browser-empty { color: var(--text-muted); font-size: var(--text-sm); }
.projects-browser-open { justify-self: start; margin-top: auto; color: var(--accent-deep, var(--accent)); font-weight: 600; text-decoration: none; }
.feedback-page { display: grid; gap: var(--space-4); width: 100%; max-width: 960px; margin: 0 auto; }
.feedback-form { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); padding: var(--space-4); border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.feedback-form label { display: grid; gap: 6px; font-size: var(--text-xs); color: var(--text-muted); }
.feedback-form-message { grid-column: 1 / -1; }
.feedback-form textarea,
.feedback-form select { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; }
.feedback-form button,
.feedback-admin-actions button { min-height: 40px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--accent); color: var(--on-accent, #fff); cursor: pointer; justify-self: start; font: inherit; }
.feedback-list { display: grid; gap: 10px; }
.feedback-card { display: grid; gap: var(--space-2); padding: var(--space-4); border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.feedback-card-top,
.feedback-card-meta,
.feedback-admin-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.feedback-card-meta,
.feedback-empty { color: var(--text-muted); font-size: var(--text-sm); }
.feedback-admin-actions button { background: var(--fill); color: var(--text); }

/* First paint before Vite CSS modules: match ordinary/advanced rail geometry. */
@media (min-width: 769px) {
  body.ordinary-shell .app-shell.home-simple-shell-mode:not(.nav-collapsed) .sidebar-nav,
  body.ordinary-shell .app-shell.home-simple-shell-mode:not(.nav-collapsed) .sidebar-nav:hover {
    width: 248px !important;
  }
  body.ordinary-shell .app-shell.home-simple-shell-mode:not(.nav-collapsed) .main-area {
    padding-left: 248px !important;
  }
  body.ordinary-shell .app-shell.home-simple-shell-mode.nav-collapsed .sidebar-nav,
  body.ordinary-shell .app-shell.home-simple-shell-mode.nav-collapsed .sidebar-nav:hover {
    width: 64px !important;
  }
  body.ordinary-shell .app-shell.home-simple-shell-mode.nav-collapsed .main-area {
    padding-left: 64px !important;
  }
  body.advanced-shell .sidebar-nav,
  body.advanced-shell .app-shell:not(.rail-hover-armed) .sidebar-nav,
  body.advanced-shell .app-shell:not(.rail-hover-armed) .sidebar-nav:hover {
    width: 64px !important;
    transition: none !important;
  }
  body.advanced-shell .main-area {
    padding-left: 64px !important;
  }
}
