/* Priority 3 is the legacy Normal value. Low uses 6 so old tasks stay unchanged. */
body.theme-material .task-context-priority-section {
  padding: 8px 8px 4px;
}

.task-context-priority-title {
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 18px;
  color: var(--color-text-secondary);
}

.task-context-priority-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

body.theme-material .task-context-priority-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
}

body.theme-material .task-context-priority-choice:hover,
body.theme-material .task-context-priority-choice[aria-checked="true"] {
  background: var(--color-bg-hover);
}

body.theme-material .task-context-priority-choice:focus-visible {
  outline: 2px solid var(--color-priority-low, #3b82f6);
  outline-offset: 1px;
}

body.theme-material .task-context-priority-choice .task-card-priority-flag {
  display: flex;
  width: 18px;
  height: 18px;
}

body.theme-material {
  --color-priority-high: #ef4444;
  --color-priority-medium: #eab308;
  --color-priority-low: #3b82f6;
  --color-filter-priority-medium-border: #fde68a;
  --color-filter-priority-medium-bg: #fffbeb;
  --color-filter-priority-medium-text: #a16207;
  --color-filter-priority-medium-active-border: #eab308;
  --color-filter-priority-medium-active-bg: #fef3c7;
  --color-filter-priority-medium-active-ring: rgba(234, 179, 8, .22);
  --color-filter-priority-high-border: #fecaca;
  --color-filter-priority-high-bg: #fef2f2;
  --color-filter-priority-high-text: #dc2626;
  --color-filter-priority-high-active-border: #ef4444;
  --color-filter-priority-high-active-bg: #fee2e2;
  --color-filter-priority-high-active-ring: rgba(239, 68, 68, .22);
  --color-editor-priority-medium-text: #a16207;
  --color-editor-priority-medium-bg: #fef3c7;
  --color-editor-priority-high-text: #ef4444;
  --color-editor-priority-high-bg: #fee2e2;
  --priority-low-text: #2563eb;
  --priority-low-bg: #eff6ff;
  --priority-low-border: #bfdbfe;
}

body.theme-material.dark-theme,
:root[data-theme="dark"] body.theme-material,
:root[data-theme="graphite"] body.theme-material,
:root[data-theme="midnight"] body.theme-material {
  --color-priority-high: #f87171;
  --color-priority-medium: #facc15;
  --color-priority-low: #60a5fa;
  --color-filter-priority-medium-border: rgba(250, 204, 21, .34);
  --color-filter-priority-medium-bg: rgba(250, 204, 21, .1);
  --color-filter-priority-medium-text: #facc15;
  --color-filter-priority-medium-active-border: #eab308;
  --color-filter-priority-medium-active-bg: rgba(250, 204, 21, .14);
  --color-filter-priority-medium-active-text: #facc15;
  --color-filter-priority-high-text: #f87171;
  --color-filter-priority-high-bg: rgba(239, 68, 68, .1);
  --color-filter-priority-high-border: rgba(239, 68, 68, .34);
  --color-editor-priority-medium-text: #facc15;
  --color-editor-priority-medium-bg: rgba(250, 204, 21, .1);
  --priority-low-text: #60a5fa;
  --priority-low-bg: rgba(59, 130, 246, .1);
  --priority-low-border: rgba(59, 130, 246, .34);
}

body.theme-material .task-context-menu .task-context-priority-low,
body.theme-material .task-card-priority-low,
body.theme-material .filters-accordion-section .custom-select-priority-icon.priority-low,
body.theme-material .task-card.task-card-priority-6 .task-card-done-btn {
  color: var(--color-priority-low);
}

body.theme-material .task-context-menu .task-context-priority-medium,
body.theme-material .filters-accordion-section .custom-select-priority-icon.priority-medium {
  color: var(--color-priority-medium);
}

body.theme-material .right-panel .panel-section-task-summary .task-summary-priority-2 {
  color: var(--color-editor-priority-medium-text);
  background: var(--color-editor-priority-medium-bg);
}

body.theme-material .right-panel .panel-section-task-summary #task-summary-row-priority[data-priority="2"] .task-summary-label,
body.theme-material .right-panel .panel-section-task-summary #task-summary-row-priority[data-priority="2"] .task-summary-icon {
  color: var(--color-editor-priority-medium-text);
}

body.theme-material .right-panel .panel-section-task-summary #task-summary-row-priority[data-priority="6"] .task-summary-label,
body.theme-material .right-panel .panel-section-task-summary #task-summary-row-priority[data-priority="6"] .task-summary-icon {
  color: var(--priority-low-text);
}

body.theme-material .right-panel .panel-section-task-summary #task-summary-row-priority[data-priority="3"] .task-summary-label,
body.theme-material .right-panel .panel-section-task-summary #task-summary-row-priority[data-priority="3"] .task-summary-icon {
  color: var(--color-editor-priority-normal-text);
}

body.theme-material .right-panel .panel-title-priority-badge[data-priority="6"],
body.theme-material .right-panel .panel-section-task-summary .task-summary-priority-6 {
  color: var(--priority-low-text) !important;
  background: var(--priority-low-bg) !important;
  border-color: transparent;
}

body.theme-material .right-panel #panel-priority-section .priority-pill-btn[data-value="6"],
body.theme-material .filters-modal-option[data-value="6"] {
  color: var(--priority-low-text);
  background: var(--priority-low-bg);
  border-color: var(--priority-low-border);
}

body.theme-material .right-panel #panel-priority-section .priority-pill-btn.is-active[data-value="6"],
body.theme-material .filters-modal-option.is-active[data-value="6"] {
  border-color: var(--color-priority-low);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, .22);
}
