* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Arial, sans-serif;
  background: #F5F4F0;
  color: #38112A;
  min-height: 100vh;
}

/* ── Header ── */
header {
  background: #1565C0;
  color: #fff;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
header h1 {
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 0.02em;
}
header .subtitle {
  font-size: 13px;
  color: #BBDEFB;
  margin-top: 2px;
}
.header-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── Buttons ── */
.btn {
  font-family: Arial, sans-serif;
  font-size: 13px;
  font-weight: bold;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; }
.btn-primary   { background: #1976D2; color: #fff; }
.btn-secondary { background: #E3F2FD; color: #1565C0; }
.btn-ghost     { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.4); }
.btn-danger    { background: #c0392b; color: #fff; }
.btn-sm        { padding: 5px 11px; font-size: 12px; }

/* ── Toolbar ── */
.toolbar {
  background: #fff;
  border-bottom: 1px solid #DFDDD2;
  padding: 10px 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.toolbar label { font-size: 13px; font-weight: bold; color: #38112A; }
.toolbar select, .toolbar input[type=range] {
  font-family: Arial, sans-serif;
  font-size: 13px;
  border: 1px solid #DFDDD2;
  border-radius: 4px;
  padding: 4px 8px;
  color: #38112A;
  background: #fff;
}
.toolbar .sep { width: 1px; height: 24px; background: #DFDDD2; margin: 0 4px; }
.today-label {
  font-size: 12px;
  background: #000;
  color: #fff;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: bold;
  margin-left: auto;
  transition: background 0.15s;
}
.today-label:hover { background: #333; }

/* ── Main layout ── */
.main { display: flex; height: calc(100vh - 112px); overflow: hidden; }

/* ── Sidebar ── */
.sidebar {
  width: 220px;
  min-width: 160px;
  max-width: 400px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid #DFDDD2;
  overflow-y: auto;
  padding: 12px 0;
  position: relative;
  user-select: none;
}
.sidebar-resize-handle {
  position: absolute;
  top: 0; right: -4px; bottom: 0;
  width: 8px;
  cursor: col-resize;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-resize-handle:hover,
.sidebar-resize-handle.dragging {
  background: rgba(21,101,192,0.15);
}
.sidebar-toggle-btn {
  position: absolute;
  top: 50%;
  right: -12px;
  transform: translateY(-50%);
  width: 16px;
  height: 40px;
  background: #1565C0;
  border: none;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
  z-index: 51;
  opacity: 0;
  transition: opacity 0.15s;
}
.sidebar:hover .sidebar-toggle-btn,
.sidebar.collapsed .sidebar-toggle-btn {
  opacity: 1;
}
.sidebar.collapsed {
  width: 0 !important;
  min-width: 0 !important;
  overflow: visible;
  padding: 0;
}
.sidebar.collapsed .sidebar-toggle-btn {
  right: -16px;
}
.sidebar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 8px 14px;
}
.sidebar-title {
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
  padding: 0;
}
.collapse-all-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 10px;
  color: #aaa;
  padding: 2px 4px;
  border-radius: 3px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}
.collapse-all-btn:hover {
  color: #1565C0;
  background: #E3F2FD;
}
.project-item {
  padding: 8px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  border-left: 3px solid transparent;
  transition: background 0.12s;
  user-select: none;
}
.project-item:hover { background: #F5F4F0; }
.project-item.active { background: #BBDEFB; border-left-color: #1565C0; font-weight: bold; }
.project-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.dot-count {
  font-size: 9px; font-weight: bold; color: #fff; line-height: 1;
  text-shadow: 0 0 2px rgba(0,0,0,0.3);
  pointer-events: none;
}
.project-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-edit-btn {
  opacity: 0; font-size: 11px; color: #888; background: none; border: none;
  cursor: pointer; padding: 2px 4px;
}
.project-item:hover .project-edit-btn { opacity: 1; }
.project-collapse-btn {
  opacity: 0; font-size: 10px; color: #888; background: none; border: none;
  cursor: pointer; padding: 2px 3px; flex-shrink: 0; line-height: 1; transition: transform 0.15s;
}
.project-item:hover .project-collapse-btn { opacity: 1; }
.project-collapse-btn.collapsed { transform: rotate(-90deg); }
.project-quick-add {
  opacity: 0; font-size: 13px; font-weight: bold; color: #1565C0; background: none;
  border: none; cursor: pointer; padding: 1px 4px; flex-shrink: 0; line-height: 1;
}
.project-item:hover .project-quick-add { opacity: 1; }
.project-quick-add:hover { color: #38112A; }
.add-project-btn {
  margin: 8px 14px 0;
  font-size: 12px;
  color: #1565C0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  font-weight: bold;
  text-align: left;
}
.add-project-btn:hover { text-decoration: underline; }
.project-item.personal {
  background: #E3F2FD;
  border-left-color: #90CAF9;
}
.project-item.personal:hover { background: #BBDEFB; }
.project-item.personal.active { background: #BBDEFB; border-left-color: #1565C0; }
.personal-pin {
  font-size: 11px; flex-shrink: 0; opacity: 0.7;
}
.badge-personal {
  font-size: 10px; font-weight: bold; background: #90CAF9; color: #1565C0;
  padding: 2px 8px; border-radius: 10px; letter-spacing: 0.03em;
  display: inline-flex; align-items: center; gap: 4px;
}
.row-label.personal-row { background: #F0F7FF; }
.project-row:hover .row-label.personal-row { background: #E3F2FD; }

/* ── Timeline area ── */
.timeline-area {
  flex: 1;
  overflow-x: scroll;
  overflow-y: auto;
  background: #F5F4F0;
  position: relative;
}

.timeline-wrapper {
  padding: 0;
  display: inline-block;
  min-width: 100%;
}

/* Month header row */
.month-header {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 10;
  background: #1565C0;
}
.month-cell {
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  text-align: center;
  padding: 8px 4px;
  border-right: 1px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
}
/* Day tick sub-row */
.day-header {
  display: flex;
  position: sticky;
  top: 33px;
  z-index: 10;
  background: #1976D2;
  border-bottom: 2px solid #90CAF9;
}
.day-cell {
  font-size: 9px;
  color: rgba(255,255,255,0.5);
  text-align: center;
  padding: 3px 0;
  flex-shrink: 0;
  border-right: 1px solid rgba(255,255,255,0.07);
}
.day-cell.monday { color: rgba(255,255,255,0.8); }

/* Project rows */
.project-row {
  display: flex;
  border-bottom: 1px solid #DFDDD2;
  background: #fff;
  min-height: 48px;
  position: relative;
  transition: background 0.12s;
}
.project-row:hover { background: #fdf9f6; }
.project-row:hover .row-label { background: #fdf9f6; }
.project-row.dimmed { opacity: 0.35; }
.project-row.collapsed-row { min-height: 0 !important; }
.collapsed-row .row-label { height: 24px !important; opacity: 0.7; }
.collapsed-summary {
  font-size: 10px; color: #aaa; font-style: italic;
  position: absolute; top: 50%; left: 170px; transform: translateY(-50%);
  pointer-events: none; white-space: nowrap;
}

/* Sticky project label column inside timeline */
.row-label {
  position: sticky;
  left: 0;
  z-index: 6;
  width: 220px; /* overridden dynamically by JS */
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px 0 14px;
  background: #fff;
  border-right: 2px solid #DFDDD2;
  font-size: 12px;
  font-weight: bold;
}
.row-label-dot {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
}
.row-label-name {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.row-label-edit {
  opacity: 0; font-size: 11px; color: #888; background: none;
  border: none; cursor: pointer; padding: 2px 3px; flex-shrink: 0;
}
.project-row:hover .row-label-edit { opacity: 1; }

/* Sticky header spacer aligns with label column */
.header-spacer {
  position: sticky;
  left: 0;
  flex-shrink: 0;
  width: 220px; /* overridden dynamically by JS */
  border-right: 2px solid rgba(255,255,255,0.2);
  z-index: 11;
}
.header-spacer.month { background: #1565C0; }
.header-spacer.day   { background: #1976D2; }

/* Click-to-add ghost bar */
.row-grid { cursor: crosshair; }
.click-hint {
  position: absolute;
  height: 26px;
  border-radius: 4px;
  border: 2px dashed rgba(56,17,42,0.3);
  background: rgba(255,191,150,0.25);
  pointer-events: none;
  z-index: 1;
  display: none;
  min-width: 4px;
}

/* Grid columns inside row */
.row-grid {
  display: flex;
  flex: 1;
  position: relative;
}
.grid-day-col {
  flex-shrink: 0;
  height: 100%;
  border-right: 1px solid rgba(0,0,0,0.04);
  position: relative;
  pointer-events: none;
}
.grid-day-col.monday { border-right-color: rgba(0,0,0,0.1); }
.grid-day-col.weekend { background: rgba(0,0,0,0.035); }
.grid-day-col.today-col { }

/* Task bars */
.task-bar {
  position: absolute;
  height: 26px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 11px;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: grab;
  transition: filter 0.12s;
  z-index: 2;
  color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.task-bar:hover { filter: brightness(1.1); z-index: 5; }
.task-bar.dragging { opacity: 0.75; cursor: grabbing !important; transition: none; box-shadow: 0 4px 16px rgba(0,0,0,0.25); z-index: 50 !important; }
.milestone-marker.dragging { opacity: 0.75; cursor: grabbing !important; transition: none; z-index: 50 !important; }
.drag-date-badge {
  position: fixed; background: #1565C0; color: #E3F2FD;
  font-size: 11px; font-weight: bold; padding: 3px 8px;
  border-radius: 4px; pointer-events: none; z-index: 9999;
  white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.task-bar.dark-text { color: #38112A; }
.task-bar.due-soon { box-shadow: 0 0 0 2px #FF9E33, 0 1px 3px rgba(0,0,0,0.15); }
.task-bar .recur-icon { font-size: 9px; opacity: 0.75; margin-left: 3px; flex-shrink: 0; pointer-events: none; }
.task-bar span { pointer-events: none; }
.resize-handle {
  position: absolute; top: 0; bottom: 0; width: 7px;
  cursor: ew-resize; z-index: 4; border-radius: 4px;
}
.resize-handle.left  { left: 0;  border-radius: 4px 0 0 4px; }
.resize-handle.right { right: 0; border-radius: 0 4px 4px 0; }
.resize-handle:hover { background: rgba(255,255,255,0.35); }
.task-bar.resizing { cursor: ew-resize !important; transition: none; z-index: 50 !important; opacity: 0.85; }

/* Milestone diamond */
.milestone-marker {
  position: absolute;
  width: 14px; height: 14px;
  transform: rotate(45deg);
  cursor: pointer;
  z-index: 3;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.milestone-marker:hover { filter: brightness(1.2); z-index: 5; }
.milestone-marker.due-soon { box-shadow: 0 0 0 2px #FF9E33, 0 1px 4px rgba(0,0,0,0.2); animation: duepulse 2s infinite; }
@keyframes duepulse { 0%,100% { box-shadow: 0 0 0 2px #FF9E33; } 50% { box-shadow: 0 0 0 4px rgba(255,158,51,0.4); } }

/* ── Task status styles ─────────────────────────────────────────────────────── */
.task-bar.status-in-progress  { border-left: 3px solid rgba(255,255,255,0.7); }
.task-bar.status-done          { opacity: 0.55; }
.milestone-marker.status-done  { opacity: 0.55; }
.task-bar.status-blocked       { box-shadow: 0 0 0 2px #e53935 inset; }
.milestone-marker.status-blocked { box-shadow: 0 0 0 2px #e53935; }
.task-bar.status-overdue,
.milestone-marker.status-overdue { box-shadow: 0 0 0 2px #e65100 inset; }


/* Today line */
.today-line {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: #000;
  z-index: 20;
  pointer-events: none;
}
.today-line-labeled::before {
  content: 'TODAY';
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: bold;
  color: #fff;
  background: #000;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.05em;
  white-space: nowrap;
  z-index: 21;
}

/* Tooltip */
.tooltip {
  position: fixed;
  background: #fff;
  color: #000;
  border: 1px solid #1565C0;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  pointer-events: none;
  z-index: 9999;
  max-width: 300px;
  line-height: 1.5;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  display: none;
}
.tooltip strong { color: #1565C0; }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #888;
  font-size: 14px;
}
.empty-state h3 { color: #38112A; margin-bottom: 8px; font-size: 18px; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(56,17,42,0.5);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff;
  border-radius: 8px;
  width: 520px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(56,17,42,0.25);
}
.modal-header {
  background: #1976D2;
  color: #fff;
  padding: 16px 20px;
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h2 { font-size: 15px; }
.modal-close { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; line-height: 1; }
.modal-body { padding: 20px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: bold; color: #38112A; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.05em; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 8px 10px;
  border: 1px solid #DFDDD2; border-radius: 4px;
  font-family: Arial, sans-serif; font-size: 13px; color: #38112A;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: #38112A;
}
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid #DFDDD2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.color-swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.color-swatch {
  width: 22px; height: 22px; border-radius: 50%;
  cursor: pointer; border: 2px solid transparent;
  transition: transform 0.1s;
}
.color-swatch:hover { transform: scale(1.2); }
.color-swatch.selected { border-color: #38112A; transform: scale(1.15); }

/* ── Import/Export ── */
#file-import { display: none; }

/* ── Member checkbox picker (task modal) ── */
.member-pick-list { display: flex; flex-direction: column; gap: 5px; }
.member-pick-item {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 10px; border: 1px solid #DFDDD2; border-radius: 4px;
  cursor: pointer; font-size: 13px; transition: background 0.1s;
  user-select: none;
}
.member-pick-item:hover { background: #F5F4F0; }
.member-pick-item.checked { background: #BBDEFB; border-color: #1565C0; font-weight: bold; }
.member-pick-item input[type=checkbox] { accent-color: #38112A; width: 14px; height: 14px; flex-shrink: 0; }

/* ── Admin / member table ── */
.member-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.member-table th {
  text-align: left; font-size: 11px; font-weight: bold; text-transform: uppercase;
  letter-spacing: 0.05em; color: #888; padding: 6px 8px;
  border-bottom: 2px solid #DFDDD2;
}
.member-table td { padding: 8px 8px; border-bottom: 1px solid #DFDDD2; vertical-align: middle; }
.member-table tr:last-child td { border-bottom: none; }
.member-table tr:hover td { background: #F5F4F0; }
.badge-admin {
  font-size: 10px; font-weight: bold; background: #38112A; color: #fff;
  padding: 2px 7px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.04em;
}
.badge-you {
  font-size: 10px; font-weight: bold; background: #BBDEFB; color: #1565C0;
  padding: 2px 7px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.04em;
}
.member-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: #BBDEFB;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: bold; color: #38112A; flex-shrink: 0;
}

/* ── AI Agent Panel ── */
.ai-panel {
  width: 320px;
  flex-shrink: 0;
  background: #fff;
  border-left: 1px solid #DFDDD2;
  display: flex;
  flex-direction: column;
  transition: width 0.25s ease;
  overflow: hidden;
}
.ai-panel.collapsed { width: 0; border-left: none; }
.ai-panel-tab {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: #38112A;
  color: #fff;
  writing-mode: vertical-rl;
  padding: 14px 7px;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.06em;
  border-radius: 6px 0 0 6px;
  z-index: 200;
  transition: opacity 0.15s;
  user-select: none;
  box-shadow: -2px 0 8px rgba(0,0,0,0.15);
}
.ai-panel-tab:hover { opacity: 0.85; }
.ai-panel-tab.hidden { display: none; }
.ai-panel-header {
  background: #38112A;
  color: #fff;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.ai-panel-title { font-size: 14px; font-weight: bold; display: flex; align-items: center; gap: 7px; }
.ai-panel-subtitle { font-size: 10px; color: #90CAF9; margin-top: 1px; }
.ai-collapse-btn {
  background: none; border: none; color: rgba(255,255,255,0.7);
  font-size: 18px; cursor: pointer; padding: 2px 6px; border-radius: 4px; line-height: 1;
}
.ai-collapse-btn:hover { color: #fff; background: rgba(255,255,255,0.15); }
.ai-key-setup { padding: 20px 16px; flex: 1; overflow-y: auto; }
.ai-key-setup h4 { font-size: 13px; color: #38112A; margin-bottom: 8px; }
.ai-key-setup p { font-size: 12px; color: #666; line-height: 1.5; margin-bottom: 12px; }
.ai-key-input {
  width: 100%; padding: 8px 10px;
  border: 1px solid #DFDDD2; border-radius: 4px;
  font-size: 11px; font-family: monospace; color: #38112A; margin-bottom: 10px;
}
.ai-chat-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.ai-messages {
  flex: 1; overflow-y: auto; padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 0;
}
.ai-msg {
  max-width: 92%; padding: 8px 11px;
  font-size: 12px; line-height: 1.5;
}
.ai-msg.user {
  background: #38112A; color: #fff;
  align-self: flex-end; border-radius: 10px 10px 2px 10px;
}
.ai-msg.assistant {
  background: #F5F4F0; color: #38112A;
  align-self: flex-start; border-radius: 10px 10px 10px 2px;
}
.ai-msg.ai-error {
  background: #fde8e8; color: #c0392b;
  align-self: stretch; border-radius: 6px;
  font-size: 11px; text-align: center;
}
.ai-thinking {
  display: flex; gap: 4px; padding: 10px 12px;
  background: #F5F4F0; border-radius: 10px 10px 10px 2px;
  align-self: flex-start;
}
.ai-thinking span {
  width: 6px; height: 6px; border-radius: 50%;
  background: #42A5F5; animation: nagidot 1.2s infinite;
}
.ai-thinking span:nth-child(2) { animation-delay: 0.2s; }
.ai-thinking span:nth-child(3) { animation-delay: 0.4s; }
@keyframes nagidot {
  0%, 60%, 100% { opacity: 0.3; transform: scale(1); }
  30% { opacity: 1; transform: scale(1.3); }
}
.ai-suggestions {
  padding: 6px 12px 4px;
  display: flex; flex-wrap: wrap; gap: 5px;
  flex-shrink: 0; border-top: 1px solid #F5F4F0;
}
.ai-suggestion-chip {
  font-size: 10px; padding: 3px 9px;
  background: #BBDEFB; color: #1565C0;
  border-radius: 10px; cursor: pointer; border: none;
  font-family: Arial, sans-serif; font-weight: bold;
  white-space: nowrap; transition: background 0.12s;
}
.ai-suggestion-chip:hover { background: #1565C0; color: #fff; }
.ai-input-area {
  padding: 10px 12px; border-top: 1px solid #DFDDD2;
  display: flex; gap: 8px; align-items: flex-end; flex-shrink: 0;
}
.ai-input {
  flex: 1; padding: 7px 10px;
  border: 1px solid #DFDDD2; border-radius: 6px;
  font-family: Arial, sans-serif; font-size: 12px; color: #38112A;
  resize: none; line-height: 1.4; max-height: 72px; overflow-y: auto;
}
.ai-input:focus { outline: none; border-color: #38112A; }
.ai-send-btn {
  background: #38112A; color: #fff; border: none;
  border-radius: 6px; width: 32px; height: 32px;
  font-size: 16px; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s; line-height: 1;
}
.ai-send-btn:hover { background: #1565C0; }
.ai-send-btn:disabled { background: #DFDDD2; cursor: default; }
.ai-action-tag {
  display: inline-flex; align-items: center; gap: 3px;
  background: #E3F2FD; color: #1565C0;
  padding: 1px 7px; border-radius: 10px;
  font-size: 10px; font-weight: bold; margin-top: 3px;
}

/* ── Export dropdown ── */
.export-dropdown { position: relative; }
.export-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #fff;
  border: 1px solid #DFDDD2;
  border-radius: 6px;
  box-shadow: 0 6px 24px rgba(56,17,42,0.15);
  min-width: 240px;
  z-index: 500;
  overflow: hidden;
}
.export-menu.open { display: block; }
.export-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  cursor: pointer;
  font-size: 13px;
  color: #38112A;
  transition: background 0.1s;
}
.export-menu-item:hover { background: #F5F4F0; }
.export-menu-item + .export-menu-item { border-top: 1px solid #F0EDE8; }
.export-icon { font-size: 16px; flex-shrink: 0; width: 22px; text-align: center; }
.export-sub { font-size: 11px; color: #888; margin-top: 1px; font-weight: normal; }

/* ── Help modal ── */
.help-section {
  border-bottom: 1px solid #F0EDE8;
  padding: 14px 20px;
}
.help-section-title {
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #38112A;
  margin-bottom: 10px;
}
.help-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 4px 0;
  font-size: 13px;
  color: #444;
}
.help-row .help-desc {
  flex: 0 0 220px;
  color: #38112A;
  font-weight: bold;
  font-size: 12px;
}
.help-row .help-val {
  flex: 1;
  color: #555;
  font-size: 12px;
}
.help-row kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  padding: 2px 7px;
  background: #F5F4F0;
  border: 1px solid #DFDDD2;
  border-bottom: 2px solid #c8c5bc;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
  font-weight: bold;
  color: #38112A;
  flex-shrink: 0;
}

/* ── Task vertical reorder ── */
.lane-insert-line {
  position: fixed;
  height: 2px;
  background: #38112A;
  border-radius: 1px;
  pointer-events: none;
  z-index: 9999;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.5);
}

/* ── Sidebar project drag-to-reorder ── */
.proj-drag-handle {
  font-size: 13px; color: #ccc; cursor: grab;
  padding: 0 2px; flex-shrink: 0; line-height: 1;
  opacity: 0; transition: opacity 0.15s;
  user-select: none;
}
.project-item:hover .proj-drag-handle { opacity: 1; }
.proj-drag-handle:active { cursor: grabbing; }
.proj-drag-handle--ghost {
  opacity: 0 !important; cursor: default; pointer-events: none;
}
.proj-eye-btn {
  background: none; border: none; cursor: pointer;
  font-size: 10px; padding: 0 2px; flex-shrink: 0;
  color: #1565C0; line-height: 1; opacity: 0;
  transition: opacity 0.15s;
}
.project-item:hover .proj-eye-btn,
.project-item .proj-eye-btn[title="Show in timeline"] { opacity: 1; }
.proj-dragging { opacity: 0.35; }
.proj-drag-over {
  border-top: 2px solid #38112A;
  margin-top: -2px;
}

/* ── Inactive sidebar section ── */
.sidebar-section-divider {
  margin-top: 6px;
  border-top: 1px solid #DFDDD2;
  padding-top: 6px;
}
.sidebar-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 6px;
  cursor: pointer;
  user-select: none;
}
.sidebar-section-toggle:hover .sidebar-title { color: #38112A; }
.project-item.inactive-item { opacity: 0.55; }
.project-item.inactive-item:hover { opacity: 0.8; }

/* ── Status select ── */
.status-select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 4px;
  border: 1px solid #DFDDD2;
  font-family: Arial, sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

/* ── Settings modal sections ── */
.settings-section {
  padding: 12px 0;
  border-bottom: 1px solid #F0EDE8;
}
.settings-section:last-child { border-bottom: none; }
.settings-section-title {
  font-size: 11px; font-weight: bold;
  text-transform: uppercase; letter-spacing: 0.07em;
  color: #38112A; margin-bottom: 10px;
}
.settings-section-desc {
  font-size: 12px; color: #888; line-height: 1.5; margin-bottom: 10px;
}
.settings-row {
  display: flex; align-items: flex-start; gap: 16px; justify-content: space-between;
}
.settings-row-info { flex: 1; }
.settings-row-label { font-size: 13px; font-weight: bold; color: #38112A; margin-bottom: 3px; }
.settings-row-desc  { font-size: 12px; color: #888; line-height: 1.4; }
.status-select-sm   { width: 100px; flex-shrink: 0; font-size: 12px; padding: 5px 8px; }

/* ── Milestone conflict marker ── */
.milestone-conflict {
  box-shadow: 0 0 0 3px #c0392b, 0 0 0 5px rgba(192,57,43,0.25) !important;
  animation: conflictpulse 2s infinite;
}
@keyframes conflictpulse {
  0%,100% { box-shadow: 0 0 0 3px #c0392b, 0 0 0 5px rgba(192,57,43,0.2); }
  50%      { box-shadow: 0 0 0 3px #c0392b, 0 0 0 8px rgba(192,57,43,0.0); }
}

/* ── Toast notification ── */
#horizon-toast {
  position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%) translateY(12px);
  background: #1565C0; color: #E3F2FD;
  font-size: 12px; font-weight: bold;
  padding: 8px 18px; border-radius: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  z-index: 9998; pointer-events: none;
  opacity: 0; transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
}
#horizon-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Legend ── */
.legend {
  padding: 6px 28px;
  background: #fff;
  border-top: 1px solid #DFDDD2;
  display: flex;
  gap: 20px;
  font-size: 11px;
  color: #666;
  align-items: center;
  flex-wrap: wrap;
}
.legend-item { display: flex; align-items: center; gap: 5px; }
.legend-bar { width: 20px; height: 10px; border-radius: 2px; background: #42A5F5; }
.legend-diamond { width: 10px; height: 10px; background: #38112A; transform: rotate(45deg); border-radius: 1px; }
