/* Work Better v2 — Minimal custom CSS (complements Tailwind) */

* { box-sizing: border-box; }
body { font-family: 'Inter', system-ui, -apple-system, sans-serif; }

/* Scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #C6D1D7; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9FA0B5; }

/* Sidebar mobile — #sidebar + specificity so Tailwind utilities loaded after app.css cannot
   override with .relative (would keep sidebar in flex flow + 272px width while translated off-screen). */
@media (max-width: 1023px) {
  #sidebar.sidebar-panel {
    position: fixed !important;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    z-index: 50;
    box-shadow: none;
  }
  #sidebar.sidebar-panel.open {
    transform: translateX(0);
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  }
}

/* View tabs */
.view-tab { position: relative; }
.view-tab.active {
  color: #2F7EDA;
}
.view-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 2px;
  background: #2F7EDA;
  border-radius: 2px 2px 0 0;
}

/* Nav link active */
.nav-link.active {
  background: #EBF3FC;
  color: #2F7EDA;
  font-weight: 600;
}
.nav-link.active svg { color: #2F7EDA; }

/* Board columns — layout also set via Tailwind on .board-scroll / .board-col in board-view.js */
.board-col { min-width: 280px; width: 280px; }
@media (min-width: 768px) { .board-col { min-width: 300px; width: 300px; } }
.board-scroll {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  scroll-snap-type: x proximity;
}
.board-scroll > .board-col { scroll-snap-align: start; flex-shrink: 0; }

/* Board drag states */
.board-col.drag-over { background: #EBF3FC; }
.task-card.dragging { opacity: 0.5; transform: rotate(2deg); }
.task-card { cursor: grab; transition: box-shadow 0.15s, transform 0.15s; }
.task-card:hover { box-shadow: 0 4px 12px rgb(0 0 0 / 0.08); }
.task-card:active { cursor: grabbing; }

/* Detail panel: slide in from right */
#detailPanel.open:not(.focus-mode) { transform: translateX(0); }

/* Focus mode: full viewport height, centered, wider than sidebar panel; gutter = solid white */
#detailOverlay.detail-overlay-focus {
  background: #ffffff !important;
}

#detailPanel.focus-mode {
  top: 0 !important;
  bottom: 0 !important;
  left: 50% !important;
  right: auto !important;
  height: 100vh !important;
  max-height: 100vh !important;
  width: min(880px, min(96vw, 960px)) !important;
  max-width: 96vw !important;
  border-radius: 0;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.06), 0 25px 50px -12px rgb(0 0 0 / 0.12);
  overflow: hidden;
  flex-direction: column;
}

#detailPanel.focus-mode.open {
  transform: translateX(-50%) !important;
}

#detailPanel.focus-mode #resizeHandle {
  display: none !important;
}

#detailPanel.focus-mode #detailContent {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100vh;
  overflow-y: auto;
}

/* Fade-in animation */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.3s ease-out both; }
.fade-up.delay-1 { animation-delay: 0.05s; }
.fade-up.delay-2 { animation-delay: 0.1s; }
.fade-up.delay-3 { animation-delay: 0.15s; }

/* AI typing dots */
.ai-typing-dots { display: inline-flex; align-items: center; gap: 0.35rem; width: 1.5rem; }
.ai-typing-dots span { width: 0.3rem; height: 0.3rem; border-radius: 9999px; background: #2F7EDA; opacity: 0.25; animation: aidots 1s infinite ease-in-out; }
.ai-typing-dots span:nth-child(2) { animation-delay: 0.12s; }
.ai-typing-dots span:nth-child(3) { animation-delay: 0.24s; }
@keyframes aidots {
  0%, 100% { opacity: 0.25; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-0.35rem); }
  70% { opacity: 0.35; transform: translateY(0); }
}

/* Toast animation */
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateX(20px); } }
.toast-enter { animation: toastIn 0.25s ease-out both; }
.toast-exit { animation: toastOut 0.2s ease-in both; }

/* Loading skeleton */
@keyframes shimmer { from { background-position: -200% 0; } to { background-position: 200% 0; } }
.skeleton {
  background: linear-gradient(90deg, #EDEFF3 25%, #D8DCE2 50%, #EDEFF3 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 0.5rem;
}

/* Datepicker cells (generic) */
.dp-cell { width: 2rem; height: 2rem; display: flex; align-items: center; justify-content: center; border-radius: 0.5rem; font-size: 0.8rem; cursor: pointer; transition: background 0.15s; }
.dp-cell:hover { background: #EBF3FC; }
.dp-cell.today { font-weight: 600; color: #2F7EDA; }
.dp-cell.selected { background: #2F7EDA; color: #fff; font-weight: 600; }
.dp-cell.other-month { color: #9FA0B5; }

/* Task panel: combined due / start / recurrence picker (v1 layout, v2 palette) */
/* #panelDpWrap: dropdown anchor is inner .relative (see task-panel.js) */
#panelDpWrap { min-width: 0; }
.dp-trigger {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  padding: 0 0.625rem;
  box-sizing: border-box;
  border-radius: 0.5rem;
  background: #FCFDFD;
  border: 1px solid #D8DCE2;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.12s ease, box-shadow 0.12s ease;
}
.dp-trigger:hover {
  background: #F5F6F8;
  border-color: #C6D1D7;
}
.dp-trigger.active {
  border-color: #2F7EDA;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(47, 126, 218, 0.12);
}
.dp-trigger .dp-icon {
  width: 14px;
  height: 14px;
  color: #8384A0;
  flex-shrink: 0;
}
.dp-trigger .dp-text {
  font-size: 0.8125rem;
  color: #555663;
  white-space: nowrap;
}
.dp-trigger .dp-arrow {
  font-size: 0.65rem;
  color: #9FA0B5;
  margin: 0 0.1rem;
}
.dp-trigger .dp-placeholder {
  font-size: 0.8125rem;
  color: #9FA0B5;
}
.dp-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 90;
  background: #fff;
  border: 1px solid #D8DCE2;
  border-radius: 0.75rem;
  box-shadow: 0 12px 40px rgba(51, 52, 65, 0.14);
  padding: 0.65rem;
  min-width: 280px;
  margin-top: 4px;
  color-scheme: light;
}
/* Datepicker: native time inputs */
.dp-time-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1.25rem;
  padding: 0.55rem 0.1rem 0.2rem;
  margin-top: 0.35rem;
  border-top: 1px solid #EDEFF3;
}
.dp-time-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 6.75rem;
  flex: 1 1 auto;
  max-width: 11rem;
}
.dp-time-label {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  color: #9FA0B5;
  line-height: 1.2;
  user-select: none;
}
.dp-time-input {
  box-sizing: border-box;
  width: 100%;
  min-height: 2.125rem;
  margin: 0;
  padding: 0.4rem 0.5rem;
  font-size: 0.8125rem;
  font-family: ui-monospace, 'SF Mono', 'Segoe UI Mono', Menlo, Monaco, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  color: #333441;
  background: linear-gradient(180deg, #fff 0%, #fafbfc 100%);
  border: 1px solid #D8DCE2;
  border-radius: 0.5rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.dp-time-input:hover {
  border-color: #C6D1D7;
  background: #fff;
}
.dp-time-input:focus {
  outline: none;
  border-color: #2F7EDA;
  box-shadow: inset 0 1px 0 #fff, 0 0 0 3px rgba(47, 126, 218, 0.2);
}
.dp-time-input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.48;
  padding: 0.2rem;
  margin-left: 0.1rem;
  border-radius: 0.3rem;
  transition: opacity 0.12s ease, background 0.12s ease;
}
.dp-time-input:hover::-webkit-calendar-picker-indicator {
  opacity: 0.88;
  background: rgba(47, 126, 218, 0.12);
}

/* Datepicker: repeat / recurrence */
.dp-rec {
  margin-top: 0.5rem;
  padding-top: 0.55rem;
  border-top: 1px solid #EDEFF3;
}
.dp-rec-master {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
  margin-bottom: 0;
}
.dp-rec-master:has(+ .dp-rec-panel) {
  margin-bottom: 0.45rem;
}
.dp-rec-checkbox {
  width: 1rem;
  height: 1rem;
  margin: 0;
  flex-shrink: 0;
  border-radius: 0.25rem;
  border: 1px solid #D8DCE2;
  accent-color: #2F7EDA;
  cursor: pointer;
}
.dp-rec-master-text {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #444552;
}
.dp-rec-panel {
  padding: 0.55rem 0.5rem 0.6rem;
  border-radius: 0.5rem;
  background: linear-gradient(180deg, #f8f9fb 0%, #f3f5f8 100%);
  border: 1px solid #e4e7ec;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
.dp-rec-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  margin-bottom: 0.55rem;
}
.dp-rec-row:last-child {
  margin-bottom: 0;
}
.dp-rec-row-chips {
  align-items: flex-start;
}
.dp-rec-label {
  flex: 0 0 6.5rem;
  max-width: 100%;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  color: #9FA0B5;
  line-height: 1.3;
  padding-top: 0.35rem;
}
.dp-rec-row-chips .dp-rec-label {
  padding-top: 0.5rem;
}
.dp-rec-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.45rem;
  flex: 1 1 10rem;
  min-width: 0;
}
.dp-rec-muted {
  font-size: 0.7rem;
  color: #9FA0B5;
  white-space: nowrap;
}
.dp-rec-select,
.dp-rec-num,
.dp-rec-date {
  box-sizing: border-box;
  margin: 0;
  font-size: 0.8125rem;
  font-family: inherit;
  color: #333441;
  background: #fff;
  border: 1px solid #D8DCE2;
  border-radius: 0.4rem;
  padding: 0.32rem 0.45rem;
  min-height: 2rem;
  box-shadow: inset 0 1px 1px rgba(51, 52, 65, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.dp-rec-select:hover,
.dp-rec-num:hover,
.dp-rec-date:hover {
  border-color: #C6D1D7;
}
.dp-rec-select:focus,
.dp-rec-num:focus,
.dp-rec-date:focus {
  outline: none;
  border-color: #2F7EDA;
  box-shadow: inset 0 1px 1px rgba(51, 52, 65, 0.04), 0 0 0 2px rgba(47, 126, 218, 0.18);
}
.dp-rec-select {
  cursor: pointer;
  padding-right: 1.75rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238384A0' d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.4rem center;
  appearance: none;
  -webkit-appearance: none;
}
.dp-rec-select-wide {
  flex: 1 1 8rem;
  min-width: 8rem;
  max-width: 100%;
}
.dp-rec-num-interval {
  width: 3.25rem;
  min-width: 3.25rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.dp-rec-num-sm {
  width: 3.5rem;
  min-width: 3.5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.dp-rec-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex: 1 1 10rem;
  min-width: 0;
}
.dp-rec-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.15rem;
  padding: 0.32rem 0.42rem;
  border-radius: 0.4rem;
  border: 1px solid #D8DCE2;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}
.dp-rec-chip:hover {
  border-color: #2F7EDA;
  background: #f0f6fd;
}
.dp-rec-chip-input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0.001;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.dp-rec-chip-lbl {
  font-size: 0.68rem;
  font-weight: 700;
  color: #555663;
  letter-spacing: 0.02em;
  pointer-events: none;
}
.dp-rec-chip:has(.dp-rec-chip-input:checked) {
  background: #2F7EDA;
  border-color: #2567B5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.dp-rec-chip:has(.dp-rec-chip-input:checked) .dp-rec-chip-lbl {
  color: #fff;
}
.dp-rec-chip:focus-within {
  outline: none;
  box-shadow: 0 0 0 2px rgba(47, 126, 218, 0.25);
}
.dp-rec-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, #d8dce2 12%, #d8dce2 88%, transparent);
  margin: 0.35rem 0 0.45rem;
}
.dp-rec-subhead {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8384A0;
  margin-bottom: 0.4rem;
}
.dp-rec-end {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.dp-rec-end-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem 0.5rem;
  font-size: 0.78rem;
  color: #555663;
  cursor: pointer;
  line-height: 1.35;
}
.dp-rec-end-line-split {
  padding-left: 0.1rem;
}
.dp-rec-end-lbl {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  min-width: 4.5rem;
}
.dp-rec-end-line-split .dp-rec-end-lbl {
  margin-right: 0.15rem;
}
.dp-rec-radio {
  width: 0.9rem;
  height: 0.9rem;
  margin: 0;
  flex-shrink: 0;
  accent-color: #2F7EDA;
  cursor: pointer;
}
.dp-rec-date {
  flex: 1 1 8rem;
  min-width: 8rem;
  max-width: 100%;
}

/* Task panel: approval stoplight + blocked completion */
.panel-ap-lights {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.55rem;
  border-radius: 0.5rem;
  border: 1px solid #d8dce2;
  background: linear-gradient(180deg, #fff 0%, #f8f9fb 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.panel-ap-lights--readonly {
  opacity: 0.72;
  pointer-events: none;
}
.panel-ap-light {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 9999px;
  border: none;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.38;
  transition: opacity 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease;
  box-shadow: inset 0 -1px 1px rgba(0, 0, 0, 0.12);
}
.panel-ap-light:hover:not(:disabled) {
  opacity: 0.95;
  transform: scale(1.12);
}
.panel-ap-light:focus-visible {
  outline: none;
  box-shadow: inset 0 -1px 1px rgba(0, 0, 0, 0.12), 0 0 0 2px rgba(47, 126, 218, 0.35);
}
.panel-ap-light--green {
  background: #10b981;
}
.panel-ap-light--red {
  background: #f43f5e;
}
.panel-ap-light--amber {
  background: #fbbf24;
}
.panel-ap-light--active {
  opacity: 1;
  box-shadow:
    inset 0 -1px 1px rgba(0, 0, 0, 0.15),
    0 0 0 2px #fff,
    0 0 0 3px rgba(51, 52, 65, 0.35);
}
.panel-ap-light--green.panel-ap-light--active {
  box-shadow:
    inset 0 -1px 1px rgba(0, 0, 0, 0.12),
    0 0 0 2px #fff,
    0 0 0 3px #059669;
}
.panel-ap-light--red.panel-ap-light--active {
  box-shadow:
    inset 0 -1px 1px rgba(0, 0, 0, 0.12),
    0 0 0 2px #fff,
    0 0 0 3px #e11d48;
}
.panel-ap-light--amber.panel-ap-light--active {
  box-shadow:
    inset 0 -1px 1px rgba(0, 0, 0, 0.12),
    0 0 0 2px #fff,
    0 0 0 3px #d97706;
}

.panel-ap-badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  padding: 0.2rem 0.5rem;
  border-radius: 0.35rem;
  border: 1px solid transparent;
  white-space: nowrap;
}
.panel-ap-badge--accepted {
  color: #047857;
  background: #d1fae5;
  border-color: #6ee7b7;
}
.panel-ap-badge--declined {
  color: #be123c;
  background: #ffe4e6;
  border-color: #fda4af;
}
.panel-ap-badge--changes {
  color: #b45309;
  background: #fef3c7;
  border-color: #fcd34d;
}

/* Read-only approval state (list / board / subtasks): one dot or pending placeholder */
.ap-sl-readonly {
  width: 1.25rem;
  height: 1.25rem;
}
.ap-sl-ro {
  display: block;
  border-radius: 9999px;
  flex-shrink: 0;
  box-sizing: border-box;
}
/* No outcome yet — hollow ring, similar weight to an empty checkbox */
.ap-sl-ro--pending {
  width: 0.625rem;
  height: 0.625rem;
  border: 2px solid #cbd5e1;
  background: #f8fafc;
}
.ap-sl-ro--approved {
  width: 0.625rem;
  height: 0.625rem;
  background: #10b981;
  box-shadow:
    inset 0 -1px 1px rgba(0, 0, 0, 0.12),
    0 0 0 1px #fff,
    0 0 0 2px #059669;
}
.ap-sl-ro--declined {
  width: 0.625rem;
  height: 0.625rem;
  background: #f43f5e;
  box-shadow:
    inset 0 -1px 1px rgba(0, 0, 0, 0.12),
    0 0 0 1px #fff,
    0 0 0 2px #e11d48;
}
.ap-sl-ro--changes {
  width: 0.625rem;
  height: 0.625rem;
  background: #fbbf24;
  box-shadow:
    inset 0 -1px 1px rgba(0, 0, 0, 0.12),
    0 0 0 1px #fff,
    0 0 0 2px #d97706;
}

.panel-completion-waiting {
  flex-shrink: 0;
}

.dp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.dp-header button {
  width: 28px;
  height: 28px;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8384A0;
  border: none;
  background: none;
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
}
.dp-header button:hover {
  background: #EDEFF3;
  color: #444552;
}
.dp-header .dp-month {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #333441;
}
.dp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  text-align: center;
}
.dp-grid .dp-dow {
  font-size: 0.6rem;
  font-weight: 600;
  color: #9FA0B5;
  text-transform: uppercase;
  padding: 0.25rem 0;
  letter-spacing: 0.05em;
}
.dp-grid .dp-day {
  font-size: 0.75rem;
  padding: 0.35rem 0.1rem;
  border-radius: 0.375rem;
  cursor: pointer;
  color: #555663;
  transition: background 0.1s ease, color 0.1s ease;
  position: relative;
  border: none;
  background: transparent;
  font-family: inherit;
}
.dp-grid .dp-day:hover {
  background: #EBF3FC;
  color: #2567B5;
}
.dp-grid .dp-day.other {
  color: #C6D1D7;
}
.dp-grid .dp-day.today {
  font-weight: 700;
  color: #2F7EDA;
}
.dp-grid .dp-day.today::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #2F7EDA;
}
.dp-grid .dp-day.selected {
  background: #2F7EDA;
  color: #fff;
  font-weight: 600;
}
.dp-grid .dp-day.selected::after {
  display: none;
}
.dp-grid .dp-day.in-range {
  background: #D2E5F9;
  color: #1C5090;
  border-radius: 0;
}
.dp-grid .dp-day.range-start {
  background: #2F7EDA;
  color: #fff;
  border-radius: 0.375rem 0 0 0.375rem;
}
.dp-grid .dp-day.range-end {
  background: #2F7EDA;
  color: #fff;
  border-radius: 0 0.375rem 0.375rem 0;
}
.dp-grid .dp-day.range-start.range-end {
  border-radius: 0.375rem;
}
.dp-options {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #EDEFF3;
}
.dp-toggle {
  position: relative;
  width: 32px;
  height: 18px;
  border-radius: 9px;
  background: #D8DCE2;
  cursor: pointer;
  transition: background 0.15s ease;
  flex-shrink: 0;
  border: none;
  padding: 0;
}
.dp-toggle.on {
  background: #2F7EDA;
}
.dp-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.dp-toggle.on::after {
  transform: translateX(14px);
}
.dp-today-btn {
  font-size: 0.7rem;
  color: #2F7EDA;
  font-weight: 600;
  cursor: pointer;
  margin-left: auto;
  padding: 0.15rem 0.5rem;
  border-radius: 0.25rem;
  transition: background 0.1s ease;
  border: none;
  background: none;
  font-family: inherit;
}
.dp-today-btn:hover {
  background: #EBF3FC;
}

/* Stat card accent border */
.stat-card { border-left: 3px solid var(--accent, #2F7EDA); }

/* Timeline bars (outer = positioning; body = fill; handles = resize) */
.tl-bar-outer { position: absolute; top: 50%; transform: translateY(-50%); height: 28px; z-index: 5; touch-action: none; }
.tl-bar-inner { height: 100%; width: 100%; border-radius: 6px; overflow: hidden; }
.tl-bar-body { height: 100%; min-width: 2px; cursor: grab; transition: filter 0.15s; }
.tl-bar-outer:hover .tl-bar-body { filter: brightness(1.08); }
.tl-bar-outer.tl-dragging .tl-bar-body { cursor: grabbing; filter: brightness(1.1); }
.tl-bar-handle { width: 7px; min-width: 7px; flex-shrink: 0; background: rgba(255, 255, 255, 0.28); cursor: ew-resize; }
.tl-bar-handle:hover { background: rgba(255, 255, 255, 0.5); }
.tl-readonly .tl-bar-body { cursor: default; }
.tl-readonly:hover .tl-bar-body { filter: none; }
.tl-readonly { opacity: 0.88; }

.tl-milestone .tl-bar-inner { background: transparent; overflow: visible; border-radius: 0; cursor: grab; }
.tl-milestone.tl-dragging .tl-bar-inner { cursor: grabbing; }
.tl-milestone.tl-readonly { opacity: 0.88; }
.tl-milestone.tl-readonly .tl-bar-inner { cursor: default; }
.tl-bar-label { font-size: 0.5rem; line-height: 1.1; font-weight: 600; color: rgba(255, 255, 255, 0.95); text-shadow: 0 0 2px rgba(0, 0, 0, 0.35); pointer-events: none; padding: 0 3px; }
.tl-bar-av { pointer-events: none; }

/* Floating date range while dragging timeline bars */
.tl-drag-tooltip {
    pointer-events: none;
    max-width: 220px;
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #0f172a;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
    z-index: 200;
}

/* Timeline: task label + track rows share fixed row height */
.tl-task-row { box-sizing: border-box; }

/* Calendar day cell */
.cal-day { min-height: 80px; border-right: 1px solid #C6D1D7; border-bottom: 1px solid #C6D1D7; }
.cal-day:last-child { border-right: none; }
@media (max-width: 767px) { .cal-day { min-height: 50px; } }

/* Hover card */
.hover-card { position: absolute; z-index: 100; }

/* Settings modal body height */
.settings-body { display: flex; flex: 1; min-height: 0; overflow: hidden; }
.settings-nav { width: 140px; flex-shrink: 0; border-right: 1px solid #C6D1D7; padding: 0.75rem 0; display: flex; flex-direction: column; gap: 0.125rem; }
.settings-nav-item { padding: 0.625rem 1rem; text-align: left; font-size: 0.875rem; border-radius: 0 0.5rem 0.5rem 0; color: #9FA0B5; transition: background 0.15s, color 0.15s; }
.settings-nav-item:hover { background: #FCFDFD; color: #555663; }
.settings-nav-item.active { background: #EBF3FC; color: #2F7EDA; font-weight: 600; }
.settings-main { flex: 1; min-height: 0; overflow-y: auto; padding: 1.25rem 1.5rem; }

/* Project color swatches */
.color-swatch { width: 2rem; height: 2rem; border-radius: 0.75rem; cursor: pointer; border: 2px solid transparent; transition: border-color 0.15s, transform 0.1s; }
.color-swatch:hover { transform: scale(1.1); }
.color-swatch.selected { border-color: #333441; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2F7EDA; }

/* Markdown rendered content */
.md-content h1, .md-content h2, .md-content h3 { font-weight: 600; margin-top: 1em; margin-bottom: 0.5em; color: #333441; }
.md-content h1 { font-size: 1.25rem; }
.md-content h2 { font-size: 1.125rem; }
.md-content h3 { font-size: 1rem; }
.md-content p { margin-bottom: 0.75em; }
.md-content ul, .md-content ol { padding-left: 1.5em; margin-bottom: 0.75em; }
.md-content li { margin-bottom: 0.25em; }
.md-content code { background: #EDEFF3; padding: 0.125em 0.375em; border-radius: 0.25rem; font-size: 0.875em; font-family: 'JetBrains Mono', monospace; }
.md-content pre { background: #FCFDFD; border: 1px solid #C6D1D7; border-radius: 0.5rem; padding: 0.75rem 1rem; overflow-x: auto; margin-bottom: 0.75em; }
.md-content pre code { background: none; padding: 0; }
.md-content blockquote { border-left: 3px solid #2F7EDA; padding-left: 1rem; color: #9FA0B5; margin-bottom: 0.75em; }
.md-content a { color: #2F7EDA; text-decoration: underline; }
.md-content img { max-width: 100%; border-radius: 0.5rem; }

/* Mention chip */
.mention-chip { background: #EBF3FC; color: #2F7EDA; padding: 0.125em 0.375em; border-radius: 0.25rem; font-weight: 500; font-size: 0.875em; cursor: pointer; }

/* Description editor */
.desc-editor { min-height: 100px; outline: none; line-height: 1.6; }
.desc-editor:empty::before { content: attr(data-placeholder); color: #9FA0B5; }

/* Search highlight */
.search-highlight { background: #FEF3C7; border-radius: 2px; padding: 0 1px; }

/* Add-collaborator modal: user picker dropdown above dialog footer */
#v2CollabAddModal .wb-user-picker-menu {
  z-index: 200;
}

/* Responsive detail panel */
@media (max-width: 767px) {
  #detailPanel:not(.focus-mode) { width: 100% !important; }
  #detailPanel.focus-mode.open {
    width: 100% !important;
    max-width: 100vw !important;
    left: 0 !important;
    transform: none !important;
  }
}

/* ── Sidebar collapse (desktop) ── */
@media (min-width: 1024px) {
  #sidebar.sidebar-panel.collapsed {
    width: 60px !important;
  }
  #sidebar.sidebar-panel.collapsed .sidebar-label {
    display: none !important;
  }
  #sidebar.sidebar-panel.collapsed #sidebarFavoritesSection,
  #sidebar.sidebar-panel.collapsed #sidebarProjectsBlock {
    display: none !important;
  }
  #sidebar.sidebar-panel.collapsed #orgSwitcherBtn {
    justify-content: center;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }
  #sidebar.sidebar-panel.collapsed .nav-link {
    justify-content: center;
  }
  #sidebar.sidebar-panel.collapsed .nav-link svg {
    margin: 0;
  }
  #sidebar.sidebar-panel.collapsed .relative.px-5.border-b > .flex:first-child {
    justify-content: center;
    padding-right: 0;
  }
  #sidebar.sidebar-panel.collapsed #sidebarFooterRow {
    justify-content: center;
  }
  #sidebar.sidebar-panel.collapsed #sidebarUserBlock {
    flex: 0 0 auto;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }
  #sidebar.sidebar-panel.collapsed .sidebar-collapse-chevron {
    transform: rotate(180deg);
  }
}

/* ── Task description rich editor (shared with public/js/task-description-editor.js) ── */
.task-description-editor-wrap {
  border: none;
  border-radius: 0.75rem;
  background: transparent;
  width: 100%;
  overflow: visible;
  padding: 0;
  box-sizing: border-box;
}

.task-description-editor-wrap:focus-within {
  border-color: transparent;
  background: transparent;
}

.task-description-editor-wrap #taskDescriptionEditorMount {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.task-description-editor-wrap #panelCommentEditorMount,
.task-description-editor-wrap #panelCommentEditMount {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.task-comment-editor-wrap .task-desc-editor-root {
  min-height: 5.75rem;
}

.task-desc-editor-root {
  position: relative;
  background: #FCFDFD;
  border: 1px solid #D8DCE2;
  border-radius: 0.5rem;
  overflow: visible;
}

.task-desc-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  background: #EDEFF3;
  border-top: 1px solid #D8DCE2;
  border-radius: 0 0 0.5rem 0.5rem;
}

.task-desc-toolbar.task-desc-toolbar--idle {
  display: none;
}

.task-desc-statusbar.task-desc-statusbar--idle {
  display: none;
}

.task-desc-tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #555663;
  cursor: pointer;
  font-size: 0.75rem;
  font-family: inherit;
  transition: background 0.12s ease;
}

.task-desc-tb-btn:hover {
  background: #D8DCE2;
}

.task-desc-tb-btn:active {
  transform: scale(0.96);
}

.task-desc-tb-active {
  background: rgba(47, 126, 218, 0.12);
  color: #2567B5;
}

.task-desc-tb-sep {
  display: inline-block;
  width: 1px;
  height: 16px;
  margin: 0 4px;
  background: #C6D1D7;
}

.task-desc-tb-b { font-weight: 600; }
.task-desc-tb-i { font-style: italic; }
.task-desc-tb-s { text-decoration: line-through; }
.task-desc-tb-code { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.65rem; }
.task-desc-tb-bq { font-size: 1rem; line-height: 1; }
.task-desc-tb-pre { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.65rem; }

.task-desc-editor-area {
  min-height: 120px;
  max-height: none;
  padding: 14px 16px;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: #555663;
  outline: none;
  cursor: text;
  overflow: visible;
  border-radius: 0.5rem 0.5rem 0 0;
}

.task-desc-editor-area:empty::before {
  content: attr(data-placeholder);
  color: #9FA0B5;
  pointer-events: none;
}

.task-desc-editor-area h1 { font-size: 1.25rem; font-weight: 600; margin: 0 0 0.5rem; color: #333441; }
.task-desc-editor-area h2 { font-size: 1.05rem; font-weight: 600; margin: 0.75rem 0 0.4rem; color: #333441; }
.task-desc-editor-area h3 { font-size: 0.9rem; font-weight: 600; margin: 0.75rem 0 0.35rem; color: #333441; }
.task-desc-editor-area p { margin: 0 0 0.5rem; }
.task-desc-editor-area ul,
.task-desc-editor-area ol { margin: 0 0 0.5rem; padding-left: 1.35rem; }
.task-desc-editor-area li { margin-bottom: 0.2rem; }
.task-desc-editor-area blockquote {
  margin: 0 0 0.5rem;
  padding: 0.35rem 0.75rem;
  border-left: 3px solid #F59E0B;
  color: #6B6C80;
  font-style: italic;
}
.task-desc-editor-area pre {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.75rem;
  background: #EDEFF3;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  margin: 0 0 0.5rem;
  white-space: pre-wrap;
}
.task-desc-editor-area code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.75rem;
  background: #EDEFF3;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}
.task-desc-editor-area pre code {
  padding: 0;
  background: transparent;
}
.task-desc-editor-area hr { border: none; border-top: 1px solid #D8DCE2; margin: 0.75rem 0; }
.task-desc-editor-area a { color: #2567B5; text-decoration: underline; text-underline-offset: 2px; }

.task-desc-editor-area .mention-chip {
  display: inline;
  background: #EBF3FC;
  color: #2567B5;
  border: 1px solid #A5CBF2;
  border-radius: 4px;
  padding: 1px 6px 1px 4px;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: default;
  user-select: all;
  line-height: 1.5;
  vertical-align: baseline;
}
.task-desc-editor-area .mention-chip::before {
  content: '@';
  opacity: 0.55;
  margin-right: 1px;
}

.task-desc-mention-dropdown {
  display: none;
  position: absolute;
  z-index: 100;
  left: 0;
  top: 0;
  background: #ffffff;
  border: 1px solid #D8DCE2;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  min-width: 260px;
  max-width: 320px;
  padding: 6px;
}

.task-desc-mention-dropdown--visible {
  display: block;
}

.task-desc-mention-hdr {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9FA0B5;
  padding: 4px 8px 6px;
}

.task-desc-mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s ease;
}

.task-desc-mention-item:hover,
.task-desc-mention-item--selected {
  background: #EDEFF3;
}

.task-desc-mention-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.65rem;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}

.task-desc-mention-avatar--photo {
  padding: 0;
  overflow: hidden;
  background: #D8DCE2;
}

.task-desc-mention-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.task-desc-mention-avatar--0 { background: linear-gradient(135deg, #79B1EC 0%, #2F7EDA 100%); }
.task-desc-mention-avatar--1 { background: linear-gradient(135deg, #f59e0b 0%, #ee7a3a 100%); }
.task-desc-mention-avatar--2 { background: linear-gradient(135deg, #f472b6 0%, #ec4899 100%); }
.task-desc-mention-avatar--3 { background: linear-gradient(135deg, #a78bfa 0%, #6366f1 100%); }
.task-desc-mention-avatar--4 { background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%); }
.task-desc-mention-avatar--5 { background: linear-gradient(135deg, #9FA0B5 0%, #555663 100%); }

.task-desc-mention-info {
  flex: 1;
  min-width: 0;
}

.task-desc-mention-name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #333441;
  line-height: 1.3;
}

.task-desc-mention-email {
  font-size: 0.68rem;
  color: #9FA0B5;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-desc-mention-match {
  color: #2F7EDA;
  font-weight: 600;
}

.task-desc-mention-empty {
  padding: 10px 8px;
  font-size: 0.75rem;
  color: #9FA0B5;
  text-align: center;
}

.task-desc-statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  border-top: 1px solid #D8DCE2;
  background: #EDEFF3;
  font-size: 0.65rem;
  color: #9FA0B5;
  border-radius: 0;
}

/* When toolbar + status are hidden, the editor is the only block — round all corners. */
.task-desc-editor-root:has(.task-desc-toolbar.task-desc-toolbar--idle):has(.task-desc-statusbar.task-desc-statusbar--idle) .task-desc-editor-area {
  border-radius: 0.5rem;
}

.task-desc-block-badge {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  border-radius: 99px;
  background: rgba(47, 126, 218, 0.1);
  color: #2567B5;
  font-weight: 600;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* List view — sticky headers, keyboard focus */
.list-view-card {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.list-view-wrap {
  --list-thead-h: 2.75rem;
}
.list-view-col-header {
  position: sticky;
  top: 0;
  z-index: 30;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  /* Match card rounded-xl so header fill/border meet the card corners */
  border-radius: 0.75rem 0.75rem 0 0;
}
.panel-subtasks-wrap {
  --list-thead-h: 2rem;
}
.panel-subtasks-wrap .list-view-col-header {
  border-radius: 0.5rem 0.5rem 0 0;
}
.list-view-wrap:not(.list-view-has-table-header) .list-group-header {
  top: 0;
}
.list-view-wrap.list-view-has-table-header .list-group-header {
  top: var(--list-thead-h);
}
.list-group-header {
  position: sticky;
  z-index: 25;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
}

/* Reserve scrollbar width so sticky headers align with grid rows when a vertical scrollbar is present */
#mainScroll {
  scrollbar-gutter: stable;
}
.list-row:focus {
  outline: none;
}
.list-row:focus-visible {
  outline: 2px solid rgba(47, 126, 218, 0.45);
  outline-offset: -2px;
  border-radius: 4px;
}

/* List view: double-click to rename; single-click opens task after 300ms (see list-view.js) */
.list-editable-task-title {
  cursor: pointer;
  min-width: 0;
  padding: 2px 4px;
  margin: -2px -4px;
  border-radius: 4px;
}
.list-inline-title-input {
  display: block;
  width: 100%;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.35;
  color: inherit;
  padding: 4px 8px;
  box-sizing: border-box;
}

/* Board + list: shared inline title edit chrome */
.list-editable-task-title.inline-editing,
.board-editable-task-title.inline-editing {
  cursor: text;
  padding: 0;
  margin: 0;
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  background: #fff;
  border: 1px solid #2f7eda;
  border-radius: 6px;
  box-shadow: 0 0 0 3px rgba(47, 126, 218, 0.12);
}

.board-editable-task-title {
  cursor: pointer;
  min-width: 0;
  padding: 2px 4px;
  margin: -2px -4px;
  border-radius: 4px;
}

/* Board: horizontal scroll edge hints */
.board-scroll-outer::before,
.board-scroll-outer::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 28px;
  z-index: 3;
  pointer-events: none;
  transition: opacity 0.18s ease;
  opacity: 0;
}
.board-scroll-outer::before {
  left: 0;
  background: linear-gradient(to right, rgba(248, 250, 252, 0.98), transparent);
}
.board-scroll-outer::after {
  right: 0;
  background: linear-gradient(to left, rgba(248, 250, 252, 0.98), transparent);
}
.board-scroll-outer.board-scroll-not-at-left::before {
  opacity: 1;
}
.board-scroll-outer.board-scroll-not-at-right::after {
  opacity: 1;
}

.board-col.drag-over {
  background: rgba(47, 126, 218, 0.06) !important;
  border-color: rgba(47, 126, 218, 0.35) !important;
  border-style: solid !important;
}

.task-card.dragging {
  opacity: 0.55;
}

.task-card-pending-move {
  opacity: 0.65;
  pointer-events: none;
}

.task-card:focus {
  outline: none;
}
.task-card:focus-visible {
  outline: 2px solid rgba(47, 126, 218, 0.45);
  outline-offset: 2px;
  border-radius: 12px;
}

/* Task panel: comment rows */
.panel-comment-card {
  padding: 0.75rem 0.875rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(248, 250, 252, 0.65);
}
.panel-comment-card--pending {
  opacity: 0.88;
}

