/* =====================================================
   INDIVIDUAL PROJECT PAGE — page-specific styles
   shared/project.css
===================================================== */

/* ── Project detail layout ── */
.pd-wrap {
  display: flex;
  flex-direction: column;
  min-height: 120%;
}

/* ── Full-width cover image ── */
.pd-cover {
  width: 100%;
  height: 26rem;
  flex-shrink: 0;
  position: relative;
  background: linear-gradient(135deg, #1e1e2e, #2a2a3e);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.pd-cover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.48);
}
/* Hashtag stat pills centered on cover near bottom */
.pd-cover-pills {
  position: absolute;
  bottom: 4.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 1;
  white-space: nowrap;
}
.pd-cover-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.625rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
}

/* ── Project name bar (overlaps bottom of cover) ── */
.pd-name-bar {
  width: 71rem;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  margin-top: -3rem;
  background: var(--bg);
  border-radius: 0.625rem 0.625rem 0 0;
  padding: 1.125rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.pd-name {
  font-family: 'Montagu Slab', serif;
  font-size: 2.625rem;
  font-weight: 400;
  color: #0d0d0d;
  line-height: 1.1;
  letter-spacing: -0.131rem;
}
.pd-meta-pills {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  @media (max-width: 1025px) {
justify-content: flex-start;
  }
}
.pd-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.1875rem 0.625rem;
  border: 1px solid var(--border2);
  border-radius: 0.3125rem;
  font-size: 0.7125rem;
  font-weight: 500;
  color: var(--muted2);
  white-space: nowrap;
}
.pd-meta-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 0.1875rem;
  background: #d9d9d9;
  flex-shrink: 0;
}

/* ── View bar ── */
.pd-view-bar {
  padding: 0.875rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.pd-view-tabs {
  display: flex;
  gap: 0;
  background: white;
  border: 1px solid var(--border2);
  border-radius: 0.3125rem;
  padding: 0.1875rem;
}
.pd-view-tab {
  padding: 0.3125rem 0.625rem;
  border-radius: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: -0.025em;
  text-transform: capitalize;
  color: var(--text);
  cursor: pointer;
  border: none;
  background: none;
  transition: background 0.15s, color 0.15s;
}
.pd-view-tab:hover { background: var(--surface2); }
.pd-view-tab.active { background: #2a2929; color: #fefdfc; }
.pd-view-bar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.pd-new-task-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.625rem;
  background: var( --active-badge-bkg);
  color: var( --active-badge-text);
  border: none;
  border-radius: 0.3125rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: -0.025em;
  cursor: pointer;
  transition: opacity 0.15s;
}
.pd-new-task-btn:hover { opacity: 0.85; }

/* ── Kanban board ── */
.kanban-board {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 1.25rem 1.75rem 2rem;
  align-items: flex-start;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}
.kanban-board::-webkit-scrollbar { height: 6px; }
.kanban-board::-webkit-scrollbar-track { background: transparent; }
.kanban-board::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── Kanban column ── */
.kanban-col {
  flex-shrink: 0;
  width: 22.875rem;
  background: #fefefe;
  border: 1px solid #ecebe9;
  border-radius: 0.4375rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.2s ease;
}
.kanban-col.collapsed {
  width: 3rem;
  cursor: pointer;
}
.kanban-col-header {
  padding: 0.625rem 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}
.kanban-col-header:hover { background: var(--surface2); }
.kanban-col-name {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kanban-col-count {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--muted2);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  padding: 0.0625rem 0.375rem;
  flex-shrink: 0;
}
.kanban-col-toggle {
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 0.2s;
  line-height: 1;
}
.kanban-col-body {
  padding: 0.625rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-height: 3rem;
  flex: 1;
}
.kanban-col.collapsed .kanban-col-header,
.kanban-col.collapsed .kanban-col-body,
.kanban-col.collapsed .kanban-add-task { display: none; }

/* Collapsed vertical strip */
.kanban-col-collapsed-strip {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 0;
  height: 100%;
  min-height: 10rem;
  cursor: pointer;
}
.kanban-col.collapsed .kanban-col-collapsed-strip { display: flex; }
.kanban-collapsed-name {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text);
  white-space: nowrap;
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0.5rem 0;
}
.kanban-collapsed-count {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  padding: 2px 4px;
  margin-bottom: 0.5rem;
}
.kanban-collapsed-expand {
  color: var(--muted);
  flex-shrink: 0;
}

/* Drop target highlight */
.kanban-col-body.drag-over {
  background: rgba(167,139,250,0.06);
  border-radius: 0.5rem;
}

/* ── Task card ── */
.kanban-card {
  background: white;
  border: 1px solid #e4e4e4;
  border-radius: 0.4375rem;
  padding: 0.75rem 0.875rem 0.625rem;
  cursor: grab;
  transition: border-color 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.kanban-card:hover {
  border-color: var(--border2);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.kanban-card:active { cursor: grabbing; }
.kanban-card.is-dragging {
  opacity: 0.35;
  border-color: var(--accent);
}
.kanban-card.drop-target-above {
  border-top: 2px solid var(--accent);
}
.kanban-card-name {
  font-size: 1rem;
  font-style: normal;
  font-weight: 500;
  line-height: normal;
  margin-bottom: 4.81rem;
}
.kanban-card-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.kanban-card-due {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted2);
  flex: 1;
}
.task-badge {
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.1875rem 0.375rem;
  border-radius: 0.375rem;
  flex-shrink: 0;
}
.task-badge.done          { background: #f6f6f2; color: var(--muted2); }
.task-badge.overdue       { background: rgba(239,68,68,.12); color: #f87171; }
.task-badge.not-completed { background: var(--surface2); color: var(--muted); }
.kanban-done-btn {
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 50%;
  border: 1.5px solid var(--border2);
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.kanban-done-btn:hover { border-color: var(--text); color: var(--text); }
.kanban-done-btn.is-done { background: rgba(0,0,0,0.7); border-color: var(--text); color: #fff; }

/* ── Add task area ── */
.kanban-add-task { padding: 0.375rem 0.625rem 0.625rem; flex-shrink: 0; }
.kanban-add-btn {
  width: 100%;
  padding: 0.5rem 0.625rem;
  background: none;
  border: none;
  font-size: 0.775rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #8e8e8e;
  cursor: pointer;
  text-align: left;
  transition: color 0.15s;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.kanban-add-btn:hover { color: var(--text); }
.kanban-new-form {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.kanban-new-input {
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 0.375rem;
  padding: 0.4375rem 0.625rem;
  font-size: 0.8125rem;
  color: var(--text);
  font-family: inherit;
  outline: none;
  width: 100%;
}
.kanban-new-input:focus { border-color: var(--accent); }
.kanban-new-input::placeholder { color: var(--muted); }
.kanban-new-actions {
  display: flex;
  gap: 0.25rem;
}
.kanban-save-btn {
  flex: 1;
  padding: 0.375rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.kanban-save-btn:hover { opacity: 0.85; }
.kanban-cancel-btn {
  padding: 0.375rem 0.625rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  font-size: 0.6875rem;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.kanban-cancel-btn:hover { color: var(--text); border-color: var(--border2); }

/* ── Placeholder views ── */
.pd-placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.875rem;
  padding: 4rem;
}
.pd-placeholder svg { color: var(--border2); }

/* ── Task detail sidebar (slide-in panel) ── */
.ts-overlay {
  position: fixed;
  inset: 0;
  z-index: 180;
  background: transparent;
  display: none;
}
.ts-overlay.open { display: block; }

.ts-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 30rem;
  max-width: 90vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 301;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
.ts-panel.open { transform: translateX(0); }

.ts-topbar {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.ts-close-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}
.ts-close-btn:hover { color: var(--text); }

.ts-body {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}

.ts-task-hdr {
  padding: 1.75rem 1.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.ts-task-name {
  font-family: 'Lora', serif;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 0.875rem;
}
.ts-task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.ts-meta-chip {
  padding: 3px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--muted2);
  border: 1px solid var(--border2);
  border-radius: 0.5rem;
}
.ts-meta-dot {
  width: 0.375rem; height: 0.375rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.ts-section {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border);
  
}
.ts-section-label {
  font-size: 0.825rem;
  font-weight: 500;
line-height: normal;
letter-spacing: -0.02438rem;
text-transform: capitalize;
  color: var(--muted);
  margin-bottom: 0.75rem;
  opacity: 0.29;
}
.ts-notes {
  width: 100%;
  min-height: 7rem;
  background: none;
  border: none;
  outline: none;
  resize: none;
  font-size: 0.875rem;
  color: var(--text);
  font-family: inherit;
  line-height: 1.65;
  padding: 0;
}
.ts-notes::placeholder { color: var(--muted); }

.ts-comments-wrap {
  padding: 1.25rem 1.75rem 0;
}
.ts-comment {
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}
.ts-comment:last-child { border-bottom: none; margin-bottom: 0; }
.ts-comment-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.ts-comment-date {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}
.ts-comment-edit-btn {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}
.ts-comment-edit-btn:hover { color: var(--text); }
.ts-comment-text {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.6;
}
.ts-comment-edit-area {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--text);
  font-family: inherit;
  line-height: 1.6;
  outline: none;
  resize: none;
}
.ts-comment-edit-area:focus { border-color: var(--accent); }
.ts-comment-edit-actions {
  display: flex; gap: 0.375rem; margin-top: 0.375rem;
}
.ts-save-edit-btn {
  padding: 0.25rem 0.625rem;
  background: var(--accent); color: #fff;
  border: none; border-radius: 0.375rem;
  font-size: 0.6875rem; font-weight: 600; cursor: pointer;
}
.ts-cancel-edit-btn {
  padding: 0.25rem 0.625rem;
  background: none; color: var(--muted);
  border: 1px solid var(--border); border-radius: 0.375rem;
  font-size: 0.6875rem; cursor: pointer;
}

.ts-footer {
  padding: 1rem 1.75rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.ts-comment-bar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  background: #FCFBF9;
  border: 1px solid var(--border2);
  border-radius: 0.3125rem;
  padding: 0.625rem 0.875rem;
  transition: border-color 0.15s;
}
.ts-comment-bar:focus-within { border-color: var(--accent); }
.ts-comment-input {
  flex: 1;
  background: none; border: none; outline: none;
  font-size: 0.875rem; color: var(--text);
  font-family: inherit;
  font-style: italic;
}
.ts-comment-input::placeholder { color: var(--muted); }
.ts-comment-send {
  flex-shrink: 0;
  background: var(--accent); color: #fff;
  border: none; border-radius: 0.375rem;
  padding: 0.3125rem 0.75rem;
  font-size: 0.75rem; font-weight: 600; cursor: pointer;
  transition: opacity 0.15s;
}
.ts-comment-send:hover { opacity: 0.85; }

/* ── New Task Modal ── */
.pd-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}
.pd-modal-overlay.open { display: flex; }
.pd-modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 0.875rem;
  width: 28rem;
  max-width: calc(100vw - 2rem);
  overflow: hidden;
  box-shadow: 0 1.5rem 3rem rgba(0,0,0,0.5);
}
.pd-modal-hdr {
  padding: 1.125rem 1.375rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pd-modal-title { font-size: 0.9375rem; font-weight: 600; }
.pd-modal-close {
  background: none; border: none; color: var(--muted);
  font-size: 1rem; cursor: pointer; line-height: 1;
  transition: color 0.15s;
}
.pd-modal-close:hover { color: var(--text); }
.pd-modal-body { padding: 1.375rem; display: flex; flex-direction: column; gap: 1rem; }
.pd-modal-row { display: flex; flex-direction: column; gap: 0.375rem; }
.pd-modal-label { font-size: 0.75rem; font-weight: 600; color: var(--muted2); }
.pd-modal-input {
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 0.5rem; padding: 0.5625rem 0.75rem;
  font-size: 0.875rem; color: var(--text); font-family: inherit; outline: none;
  transition: border-color 0.15s;
}
.pd-modal-input:focus { border-color: var(--accent); }
.pd-modal-select {
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 0.5rem; padding: 0.5625rem 0.75rem;
  font-size: 0.875rem; color: var(--text); font-family: inherit; outline: none;
  cursor: pointer; appearance: none;
}
.pd-modal-foot {
  padding: 1rem 1.375rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}
.pd-btn-cancel {
  padding: 0.4375rem 1rem; background: none; border: 1px solid var(--border);
  border-radius: 0.5rem; font-size: 0.8125rem; color: var(--muted);
  cursor: pointer; transition: color 0.15s, border-color 0.15s;
}
.pd-btn-cancel:hover { color: var(--text); border-color: var(--border2); }
.pd-btn-save {
  padding: 0.4375rem 1rem; background: var(--accent); border: none;
  border-radius: 0.5rem; font-size: 0.8125rem; font-weight: 600;
  color: #fff; cursor: pointer; transition: opacity 0.15s;
}
.pd-btn-save:hover { opacity: 0.85; }

/* =====================================================
   TASK SIDEBAR — attributes (priority, tags, milestone)
===================================================== */

.ts-attrs-section { display: flex; flex-direction: column; gap: 0; }

.ts-attr-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.625rem 0;
}
.ts-attr-row + .ts-attr-row { border-top: 1px solid var(--border); }
.ts-attr-row .ts-section-label {
  min-width: 4.5rem;
  margin-bottom: 0;
  padding-top: 0.125rem;
  opacity: 0.5;
}

/* Priority chips */
.ts-priority-opts { display: flex; gap: 0.375rem; flex-wrap: wrap; }
.ts-priority-chip {
  padding: 0.25rem 0.625rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--surface2);
  color: var(--muted);
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.ts-priority-chip:hover { border-color: var(--border2); color: var(--text); }
.ts-p-high.ts-priority-active   { background: rgba(239,68,68,0.12);  border-color: rgba(239,68,68,0.35);  color: #ef4444; }
.ts-p-medium.ts-priority-active { background: rgba(251,191,36,0.12); border-color: rgba(251,191,36,0.35); color: #d97706; }
.ts-p-low.ts-priority-active    { background: rgba(74,222,128,0.12); border-color: rgba(74,222,128,0.35); color: #16a34a; }

/* Tags */
.ts-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  align-items: center;
  min-height: 1.75rem;
}
.ts-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1875rem 0.5rem;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 0.3125rem;
  font-size: 0.75rem;
  color: var(--text);
}
.ts-tag-del {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1;
  padding: 0;
  transition: color 0.1s;
}
.ts-tag-del:hover { color: var(--text); }
.ts-tag-adder {
  border: none;
  background: none;
  outline: none;
  font-family: inherit;
  font-size: 0.75rem;
  color: var(--text);
  width: 6rem;
  min-width: 4rem;
}
.ts-tag-adder::placeholder { color: var(--muted); }

/* Milestone */
.ts-milestone-row { align-items: center; }
.ts-milestone-cb {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
  accent-color: var(--accent);
}


/* =====================================================
   PROJECT PAGE REDESIGN — new layout classes
===================================================== */

/* ── Header (replaces cover + name bar) ── */
.pd-header {
  padding: 1.5rem 1.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.pd-header-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.pd-notes-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  background: #d5e693;
  color: #4a5b05;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 1.125rem;
  font-weight: 500;
  border-radius: 0.375rem;
  white-space: nowrap;
}

.pd-stat-tags-group {
display: flex;
justify-content: space-between;
align-content: center;
@media (max-width: 1025px) {
flex-direction: column;
gap: 1em;
}
}



/* ── Stat tags ── */
.pd-stat-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.pd-stat-tag {
  display: inline-flex;
  align-items: center;
  background: #ecfdaa;
  border: 1px solid #dedede;
  border-radius: 0.375rem;
  overflow: hidden;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.7375rem;
  font-weight: 500;
  color: #0d0d0d;
  padding: 0.125rem 0.4375rem;
  gap: 3px;
}

.pd-stat-tag-num.overdue {
  background: #f5f08b;
  color: #706b03;
}
.pd-stat-tag-num.due-today {
  background: #dfecff;
  color: #3d80de;
}

.pd-stat-tag.overdue { background: #fffce0; }
.pd-stat-tag.due-today { background: #edf5ff; }

/* ── Two-column task / milestones area ── */
.pd-task-area {
  display: flex;
  gap: 0;
  padding: 0 1.75rem;
  border-bottom: 1px solid var(--border);
}
.pd-task-col {
  flex: 1.5;
  padding: 1.5rem 0 1.5rem;
  min-width: 0;
}
.pd-col-divider {
  width: 1px;
  background: var(--border);
  margin: 1.5rem 2rem;
  flex-shrink: 0;
}
.pd-milestone-col {
  flex: 1;
  padding: 1.5rem 0 1.5rem;
  min-width: 0;
}

/* ── Section headings (Syne Bold caps) ── */
.pd-section-heading {
  font-family: 'Syne', sans-serif;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.057em;
  color: var(--text);
  margin-bottom: 0.875rem;
}

/* ── Task tabs (This Week / Completed) ── */
.pd-task-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.pd-task-tab {
  padding: 0.375rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
  font-family: inherit;
}
.pd-task-tab:hover { color: var(--text); }
.pd-task-tab.active { color: var(--text); border-bottom-color: var(--text); }

/* ── Task items ── */
.pd-task-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  border-radius: 0.375rem;
  transition: background 0.1s;
  margin: 0 -0.5rem;
}
.pd-task-item:last-child { border-bottom: none; }
.pd-task-item:hover { background: var(--surface2); }
.pd-task-check {
  width: 1.25rem;
  height: 1.25rem;
  border: 1.5px solid var(--border2);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 0.125rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}
.pd-task-check:hover { border-color: var(--text); }
.pd-task-check.is-done {
  background: rgba(0,0,0,0.7);
  border-color: var(--text);
  position: relative;
}
.pd-task-check.is-done::after {
  content: '';
  display: block;
  width: 0.4375rem;
  height: 0.3125rem;
  border-left: 1.5px solid #fff;
  border-bottom: 1.5px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
  position: absolute;
}
.pd-task-info { flex: 1; min-width: 0; }
.pd-task-name {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 1.0625rem;
  font-weight: 600;
  color: #2a2929;
  line-height: 1.3;
  margin-bottom: 0.125rem;
}
.pd-task-name.pd-task-done {
  text-decoration: line-through;
  opacity: 0.5;
}
.pd-task-desc {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.9375rem;
  font-weight: 400;
  color: #8e8e8e;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pd-task-due {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border: 1px solid #e4e4e4;
  border-radius: 0.375rem;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #5e5e5e;
  flex-shrink: 0;
  white-space: nowrap;
  margin-top: 0.1875rem;
}
.pd-task-empty {
  font-size: 0.875rem;
  color: var(--muted);
  padding: 1rem 0;
}
.pd-add-task-link {
  margin-top: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
  font-family: inherit;
}
.pd-add-task-link:hover { color: var(--text); }

/* ── Milestone panel ── */
.pd-milestone-panel {
  background: #f2f7ff;
  border: 1px solid rgba(142,142,142,0.36);
  border-radius: 0.5rem;
  padding: 1rem 1.125rem;
}
.pd-milestone-panel-heading {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted2);
  margin-bottom: 0.875rem;
}
.pd-milestone-empty {
  font-size: 0.8125rem;
  color: var(--muted);
  padding: 0.5rem 0;
}
/* Milestone items inside the panel */
.pd-milestone-panel .pd-task-item {
  background: transparent;
}
.pd-milestone-panel .pd-task-item:hover {
  background: rgba(255,255,255,0.6);
}

/* ── Calendar view ── */
.pd-cal-wrap {
  padding: 1.25rem 1.75rem 2rem;
}
.pd-cal-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.pd-cal-month-title {
  font-family: 'Montagu Slab', serif;
  font-size: 2.1875rem;
  font-weight: 400;
  color: var(--text);
  flex: 1;
  letter-spacing: -0.1rem;
}

/* ── Task item responsive: due date below name on tablet/mobile ── */
@media (max-width: 768px) {
  .pd-task-area {
    flex-direction: column;
  }
  .pd-col-divider {
    width: 100%;
    height: 1px;
    margin: 0.75rem 0;
  }
  .pd-task-item {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .pd-task-info {
    flex: 1 1 0;
    min-width: 0;
  }
  .pd-task-due {
    flex-basis: 100%;
    margin-left: 2rem; /* align with task name, past the checkbox */
    margin-top: 0.25rem;
  }
}

/* ════════════════════════════════════════════════
   PAGE TAB SWITCHER  (Tasks / Notes)
   ════════════════════════════════════════════════ */
.pd-page-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  background: var(--border);
  border-radius: 0.5rem;
  padding: 0.1875rem;
  margin-left: 0.75rem;
  vertical-align: middle;
}
.pd-page-tab {
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  border-radius: 0.375rem;
  padding: 0.25rem 0.625rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.pd-page-tab:hover { color: var(--text); }
.pd-page-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

/* ════════════════════════════════════════════════
   NOTES LIST VIEW
   ════════════════════════════════════════════════ */
.pn-list-wrap {
  padding: 1.25rem 1.75rem 2rem;
}
.pn-list-header {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}
.pn-new-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: 1px solid var(--border2);
  border-radius: 0.375rem;
  padding: 0.3125rem 0.625rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.pn-new-btn:hover { color: var(--text); border-color: var(--muted); }

.pn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.pn-th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  padding: 0.375rem 0.625rem 0.5rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.pn-row {
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.pn-row:hover { background: var(--hover, rgba(0,0,0,0.03)); }
.pn-td {
  padding: 0.6875rem 0.625rem;
  vertical-align: middle;
  color: var(--text);
}
.pn-td-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.pn-row-emoji { font-size: 1rem; line-height: 1; flex-shrink: 0; }
.pn-row-title { font-weight: 500; }
.pn-fav-star { color: #f5a623; font-size: 0.75rem; }
.pn-td-date {
  font-size: 0.8125rem;
  color: var(--muted);
  white-space: nowrap;
  width: 7.5rem;
}
.pn-td-tags {
  width: 12rem;
}
.pn-tag-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--muted2);
  background: var(--border);
  border-radius: 0.25rem;
  padding: 0.125rem 0.375rem;
  margin: 0.125rem 0.125rem 0.125rem 0;
}
.pn-empty {
  font-size: 0.875rem;
  color: var(--muted);
  padding: 1.5rem 0.625rem;
}

/* ════════════════════════════════════════════════
   NOTES PANEL  (slide-in from right)
   ════════════════════════════════════════════════ */
.pn-overlay {
  position: fixed;
  inset: 0;
  z-index: 280;
  background: transparent;
  display: none;
  pointer-events: none;
}
.pn-overlay.is-open {
  display: block;
  pointer-events: auto;
}

.pn-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 34rem;
  max-width: 92vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 301;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
.pn-panel.is-open { transform: translateX(0); }

.pn-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.pn-close-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}
.pn-close-btn:hover { color: var(--text); }
.pn-fav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}
.pn-fav-btn:hover { color: var(--text); }
.pn-fav-btn.is-fav { color: #f5a623; }

/* pn-body: metadata + emoji/title; does NOT scroll — trix below it does */
.pn-body {
  flex-shrink: 0;
  overflow: visible;
}

/* Metadata rows (reuse ts-attr-row look, stand-alone here) */
.pn-note-info {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.pn-meta-date {
  font-size: 0.8125rem;
  color: var(--text);
}

/* Emoji + title editor area */
.pn-editor-wrap {
  padding: 1.25rem 1.5rem 0.75rem;
}
.pn-emoji-row {
  margin-bottom: 0.5rem;
}
.pn-emoji-btn {
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  border-radius: 0.25rem;
  transition: transform 0.15s;
}
.pn-emoji-btn:hover { transform: scale(1.1); }

.pn-emoji-picker {
  position: absolute;
  z-index: 400;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  max-width: 14rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.pn-emoji-option {
  font-size: 1.25rem;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 0.25rem;
  padding: 0.1875rem;
  transition: background 0.12s;
}
.pn-emoji-option:hover { background: var(--border); }

.pn-title-field {
  font-family: 'Lora', serif;
  font-size: 1.625rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  outline: none;
  min-height: 2rem;
  word-break: break-word;
  margin-bottom: 0.75rem;
}
.pn-title-field:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
  pointer-events: none;
}

/* ════════════════════════════════════════════════
   CONTENTEDITABLE EDITOR (static in panel)
   ════════════════════════════════════════════════ */
.pn-editor-outer {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-top: 1px solid var(--border);
}

/* Format toolbar */
.pn-format-bar {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  padding: 0.375rem 0.875rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}
.pn-fmt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 0.75rem;
  color: var(--muted2);
  background: none;
  border: none;
  border-radius: 0.25rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  min-width: 1.75rem;
}
.pn-fmt-btn:hover { background: var(--border); color: var(--text); }

/* The contenteditable writing area */
.pn-editor-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem 2rem;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.7;
  outline: none;
  background: var(--surface);
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
  word-break: break-word;
}
.pn-editor-body:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
  pointer-events: none;
}
.pn-editor-body b, .pn-editor-body strong { font-weight: 600; }
.pn-editor-body i, .pn-editor-body em { font-style: italic; }
.pn-editor-body ul { padding-left: 1.25rem; margin: 0.25rem 0; }
.pn-editor-body ol { padding-left: 1.25rem; margin: 0.25rem 0; }
.pn-editor-body li { margin: 0.125rem 0; }
.pn-editor-body a { color: var(--accent, #5b6af0); text-decoration: underline; }

/* ════════════════════════════════════════════════
   NOTE EDITOR: Headings, blockquote, hr inside body
   ════════════════════════════════════════════════ */
.pn-editor-body h1 {
  font-family: 'Lora', serif;
  font-size: 1.625rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  margin: 1rem 0 0.25rem;
}
.pn-editor-body h2 {
  font-family: 'Lora', serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
  margin: 0.875rem 0 0.25rem;
}
.pn-editor-body h3 {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0.75rem 0 0.125rem;
}
.pn-editor-body blockquote {
  border-left: 3px solid var(--border2);
  padding: 0.25rem 0 0.25rem 1rem;
  margin: 0.5rem 0;
  color: var(--muted2);
  font-style: italic;
}
.pn-editor-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}
.pn-editor-body p { margin: 0; }

/* ════════════════════════════════════════════════
   SLASH COMMAND MENU
   ════════════════════════════════════════════════ */
.pn-slash-menu {
  position: fixed;
  z-index: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  box-shadow: 0 6px 24px rgba(0,0,0,0.12);
  padding: 0.25rem;
  min-width: 13rem;
  max-height: 18rem;
  overflow-y: auto;
  display: none;
}
.pn-slash-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.4375rem 0.625rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background 0.1s;
}
.pn-slash-item:hover,
.pn-slash-item.active {
  background: var(--border);
}
.pn-slash-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.625rem;
  height: 1.625rem;
  background: var(--border);
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}
.pn-slash-info {
  display: flex;
  flex-direction: column;
  gap: 0.0625rem;
  min-width: 0;
}
.pn-slash-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
}
.pn-slash-desc {
  font-size: 0.6875rem;
  color: var(--muted);
}
.pn-slash-empty {
  font-size: 0.8125rem;
  color: var(--muted);
  padding: 0.625rem 0.875rem;
}

/* ── @today date chip ── */
.pn-date-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent);
  background: rgba(74, 91, 5, 0.08);
  border: 1px solid rgba(74, 91, 5, 0.18);
  border-radius: 0.375rem;
  padding: 0.0625rem 0.4375rem;
  white-space: nowrap;
  user-select: text;
  vertical-align: baseline;
}

