/* Category theme colors. --cat is the readable text tone for the current theme. */
[data-cat-color="blue"]   { --cat: #6cb2ff; }
[data-cat-color="teal"]   { --cat: #4fd1c5; }
[data-cat-color="green"]  { --cat: #6fd08c; }
[data-cat-color="amber"]  { --cat: #f2c14e; }
[data-cat-color="orange"] { --cat: #ff9f5a; }
[data-cat-color="rose"]   { --cat: #ff7a9a; }
[data-cat-color="violet"] { --cat: #b59cff; }
[data-cat-color="slate"]  { --cat: #a3b1c2; }
html[data-theme="light"] [data-cat-color="blue"]   { --cat: #1d64c8; }
html[data-theme="light"] [data-cat-color="teal"]   { --cat: #0f7f78; }
html[data-theme="light"] [data-cat-color="green"]  { --cat: #23803f; }
html[data-theme="light"] [data-cat-color="amber"]  { --cat: #8a6100; }
html[data-theme="light"] [data-cat-color="orange"] { --cat: #b34f0b; }
html[data-theme="light"] [data-cat-color="rose"]   { --cat: #be2952; }
html[data-theme="light"] [data-cat-color="violet"] { --cat: #6a43d1; }
html[data-theme="light"] [data-cat-color="slate"]  { --cat: #4b5a6b; }

/* Category name under a task in mixed lists: a tinted pill with a dot. */
body .task-list-category[data-cat-color] { display: inline-flex; align-items: center; gap: 6px; width: fit-content; max-width: 100%; margin-top: 4px; padding: 2px 9px 2px 7px; border-radius: 999px; background: color-mix(in srgb, var(--cat) 15%, transparent); color: var(--cat); font-size: 12px; font-weight: 600; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body .task-list-category[data-cat-color]::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--cat); }

/* Matching dot before each category in the sidebar. */
body.orbit-v27 #sidebarCategories button[data-cat-color] > span:first-child { display: inline-flex; align-items: center; gap: 10px; }
body.orbit-v27 #sidebarCategories button[data-cat-color] > span:first-child::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--cat); }

/* Swatches in Edit category. */
.category-color-field { margin: 4px 0 0; padding: 0; border: 0; }
.category-color-field legend { margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.category-colors { display: flex; flex-wrap: wrap; gap: 10px; }
.category-swatch { position: relative; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--cat); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.category-swatch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.category-swatch:has(input:checked) { box-shadow: 0 0 0 2px var(--o-bg, #000), 0 0 0 4px var(--cat); }
.category-swatch:has(input:focus-visible) { outline: 2px solid var(--o-accent, #0a84ff); outline-offset: 4px; }
