:root {
  color-scheme: dark;
  --color-bg:          #121212;
  --color-nav-bg:      #1a1a2e;
  --color-surface:     #1e1e1e;
  --color-surface-alt: #2a2a2a;
  --color-row-hover:   #252525;
  --color-border:      #2a2a2a;
  --color-border-input:#3a3a3a;
  --color-heading:     #ffffff;
  --color-text:        #e0e0e0;
  --color-text-muted:  #cccccc;
  --color-text-subtle: #888888;
}

.light-mode {
  --color-bg:          #f5f5f5;
  --color-nav-bg:      #e8e6f0;
  --color-surface:     #ffffff;
  --color-surface-alt: #f0f0f0;
  --color-row-hover:   #f0f0f0;
  --color-border:      #e0e0e0;
  --color-border-input:#d0d0d0;
  --color-heading:     #111111;
  --color-text:        #1a1a1a;
  --color-text-muted:  #444444;
  --color-text-subtle: #666666;
}

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

body {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  padding-top: 3.5rem;
}

body.light-mode {
  color-scheme: light;
}

:root:has(body.light-mode) {
  color-scheme: light;
}

nav {
  background: var(--color-nav-bg);
  color: #fff;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.burger-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
}

.burger-btn:hover { opacity: 0.8; }

.burger-menu {
  position: fixed;
  top: 3.5rem;
  right: 0;
  background: var(--color-nav-bg);
  border-left: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  min-width: 160px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.burger-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.burger-menu a {
  color: #aaa;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #2a2a4a;
}

.burger-menu a:last-child { border-bottom: none; }

.burger-menu a:hover {
  color: #fff;
  background: #2a2a4a;
}

nav a {
  color: #aaa;
  text-decoration: none;
  font-size: 0.9rem;
}

nav a:hover { color: #fff; }

nav .brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  margin-right: 1rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.brand-icon {
  height: 2rem;
  width: 2rem;
}

nav .brand:hover { opacity: 0.85; }

/* === Project Switcher in Nav === */

.project-switcher {
  width: auto;
  max-width: 200px;
  padding: 0.3rem 0.5rem;
  font-size: 0.85rem;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  cursor: pointer;
  margin-right: auto;
}

.project-switcher:focus {
  outline: none;
  border-color: #4361ee;
}

.project-switcher option {
  background: var(--color-surface);
  color: var(--color-text);
}

.light-mode .project-switcher {
  border-color: rgba(0,0,0,0.15);
  background: rgba(0,0,0,0.06);
  color: #1a1a1a;
}

.light-mode nav { color: #1a1a1a; }
.light-mode nav a { color: #555; }
.light-mode nav a:hover { color: #111; }
.light-mode nav .brand { color: #1a1a1a; }
.light-mode .burger-btn { color: #1a1a1a; }
.light-mode .burger-menu a { color: #555; border-bottom-color: var(--color-border); }
.light-mode .burger-menu a:hover { color: #111; background: var(--color-surface-alt); }

.container {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.card {
  background: var(--color-surface);
  border-radius: 8px;
  border: 1px solid var(--color-border);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

h1 { font-size: 1.5rem; margin-bottom: 1rem; color: var(--color-heading); }
h2 { font-size: 1.2rem; margin-bottom: 0.75rem; color: var(--color-heading); }

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

input, select, textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--color-border-input);
  border-radius: 4px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--color-surface-alt);
  color: var(--color-text);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #4361ee;
}

textarea { resize: vertical; min-height: 300px; font-family: monospace; }

.form-group { margin-bottom: 1rem; }

button, .btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary {
  background: #4361ee;
  color: #fff;
}

.btn-primary:hover { background: #3a56d4; }

.btn-danger {
  background: #e63946;
  color: #fff;
}

.btn-danger:hover { background: #c5303c; }

.btn-secondary {
  background: #4a4a4a;
  color: #e0e0e0;
}

.btn-secondary:hover { background: #5a5a5a; }

.light-mode .btn-secondary { background: #d8d8d8; color: #1a1a1a; }
.light-mode .btn-secondary:hover { background: #c8c8c8; }

.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.8rem; }

.btn-success {
  background: #4caf50;
  color: #fff;
}

button, .btn { transition: background 0.2s; }
button:disabled, .btn:disabled { opacity: 0.4; cursor: not-allowed; }

.filter-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: end;
}

.filter-bar .form-group { margin-bottom: 0; }
.filter-bar .form-group:has(.multiselect) { flex: 1; }

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 550px;
}

.card:has(table) { overflow-x: auto; }

.task-table th:nth-child(1), .task-table td:nth-child(1) { width: 2rem; padding: 0.3rem 0.25rem; }
.task-table th:nth-child(3), .task-table td:nth-child(3) { width: 120px; }
.task-table th:nth-child(4), .task-table td:nth-child(4) { width: 100px; }
.task-table th:nth-child(5), .task-table td:nth-child(5) { width: 160px; }
.task-table th:nth-child(6), .task-table td:nth-child(6) { width: 120px; }
.task-table th:nth-child(7), .task-table td:nth-child(7) { width: 100px; }

@media (orientation: portrait) {
  table { min-width: 460px; }
  .task-table th:nth-child(5), .task-table td:nth-child(5) { display: none; }
  .task-table th:nth-child(7), .task-table td:nth-child(7) { display: none; }
}

.task-table td:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.star-cell {
  text-align: center;
  cursor: pointer;
  user-select: none;
  font-size: 1rem;
  color: transparent;
}

.star-cell.is-starred { color: #f0c040; }

tr:hover .star-cell:not(.is-starred) { color: var(--color-text-subtle); }

#star-btn.starred { color: #f0c040; }

th, td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

th { font-size: 0.85rem; color: var(--color-text-subtle); text-transform: uppercase; }

tr.clickable { cursor: pointer; }
tr.clickable:hover { background: var(--color-row-hover); }

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-todo { background: #333; color: #aaa; }
.badge-in-progress { background: #3d3520; color: #f0c040; }
.badge-review { background: #2a1a3a; color: #ab47bc; }
.badge-done { background: #1a3a2a; color: #4caf50; }
.badge-blocked { background: #3a1a1a; color: #ef5350; }
.badge-admin { background: #1a2a4a; color: #4361ee; }
.badge-user { background: #333; color: #aaa; }

.badge-low { background: #1a3a2a; color: #4caf50; }
.badge-medium { background: #2a2a3d; color: #7986cb; }
.badge-high { background: #3d3520; color: #f0c040; }
.badge-critical { background: #3a1a1a; color: #ef5350; }

.light-mode .badge-todo { background: #e8e8e8; color: #555; }
.light-mode .badge-in-progress { background: #fff8e1; color: #9a6700; }
.light-mode .badge-review { background: #f3e5f5; color: #7b1fa2; }
.light-mode .badge-done { background: #e8f5e9; color: #2e7d32; }
.light-mode .badge-blocked { background: #ffebee; color: #c62828; }
.light-mode .badge-admin { background: #e8eaf6; color: #283593; }
.light-mode .badge-user { background: #e8e8e8; color: #555; }

.light-mode .badge-low { background: #e8f5e9; color: #2e7d32; }
.light-mode .badge-medium { background: #ede7f6; color: #4527a0; }
.light-mode .badge-high { background: #fff8e1; color: #9a6700; }
.light-mode .badge-critical { background: #ffebee; color: #c62828; }

.actions { display: flex; gap: 0.5rem; margin-top: 1rem; }

.hidden { display: none !important; }

/* === Modals === */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
}

.modal {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.5rem;
  width: 100%;
  max-width: 450px;
  margin: 1rem;
}

.key-display {
  background: var(--color-surface-alt);
  padding: 0.75rem;
  border-radius: 4px;
  font-family: monospace;
  word-break: break-all;
  margin: 0.5rem 0;
  color: #4caf50;
}

.warning {
  background: #3d3520;
  border: 1px solid #f0c040;
  color: #f0c040;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}


label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

input[type="checkbox"] {
  width: auto;
  accent-color: #4361ee;
}

.login-container {
  max-width: 400px;
  margin: 4rem auto;
  padding: 0 1rem;
}

/* === Content Tabs === */

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.content-header h2 { margin-bottom: 0; }

.tab-bar { display: flex; gap: 0.25rem; }

.tab-btn {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--color-border-input);
  border-radius: 4px;
  background: transparent;
  color: var(--color-text-subtle);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.tab-btn:hover { color: var(--color-text); background: var(--color-surface-alt); }

.tab-btn.active { background: #4361ee; color: #fff; border-color: #4361ee; }

#download-md-btn { margin-left: 0.5rem; }

/* === Markdown Preview === */

.markdown-body {
  min-height: 300px;
  line-height: 1.6;
  color: var(--color-text);
  word-wrap: break-word;
  padding: 0.5rem 0;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  color: var(--color-heading);
  margin: 1.25em 0 0.5em;
  line-height: 1.3;
}

.markdown-body h1 { font-size: 1.6rem; border-bottom: 1px solid var(--color-border-input); padding-bottom: 0.3em; }
.markdown-body h2 { font-size: 1.35rem; border-bottom: 1px solid var(--color-border-input); padding-bottom: 0.3em; }
.markdown-body h3 { font-size: 1.15rem; }
.markdown-body h4 { font-size: 1.05rem; }

.markdown-body p { margin: 0.75em 0; }

.markdown-body a { color: #4361ee; text-decoration: none; }
.markdown-body a:hover { text-decoration: underline; }

.markdown-body pre {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border-input);
  border-radius: 4px;
  padding: 0.75rem;
  overflow-x: auto;
  margin: 0.75em 0;
}

.markdown-body pre code { background: none; padding: 0; font-size: 0.9rem; }

.markdown-body code {
  background: var(--color-surface-alt);
  padding: 0.15em 0.35em;
  border-radius: 3px;
  font-size: 0.9em;
  font-family: monospace;
}

.markdown-body blockquote {
  border-left: 3px solid #4361ee;
  padding: 0.25em 1em;
  margin: 0.75em 0;
  color: var(--color-text-subtle);
  background: var(--color-nav-bg);
  border-radius: 0 4px 4px 0;
}

.light-mode .markdown-body blockquote { background: #eef0fb; color: #555; }

.markdown-body table { width: 100%; border-collapse: collapse; margin: 0.75em 0; }

.markdown-body th,
.markdown-body td {
  border: 1px solid var(--color-border-input);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.markdown-body th { background: var(--color-surface-alt); color: var(--color-heading); }
.markdown-body tr:nth-child(even) { background: var(--color-surface-alt); }

.markdown-body ul,
.markdown-body ol { padding-left: 1.5em; margin: 0.75em 0; }

.markdown-body li { margin: 0.25em 0; }

.markdown-body img { max-width: 100%; border-radius: 4px; margin: 0.5em 0; }

.markdown-body hr { border: none; border-top: 1px solid var(--color-border-input); margin: 1.5em 0; }

.markdown-body .task-list-item { list-style: none; margin-left: -1.5em; }

.markdown-body .task-list-item input[type="checkbox"] {
  width: auto;
  margin-right: 0.4em;
  accent-color: #4361ee;
  pointer-events: none;
}

/* === Sortable columns === */

th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--color-text); }
th.sort-asc::after  { content: ' ↑'; }
th.sort-desc::after { content: ' ↓'; }

.done-list-heading { margin-top: 1.5rem; margin-bottom: 0.5rem; }

/* === Toasts === */

@keyframes toast-in-out {
  0%   { opacity: 0; transform: translateX(120%); }
  12%  { opacity: 1; transform: translateX(0); }
  80%  { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(120%); }
}

.toast {
  position: fixed;
  top: 4rem;
  right: 1rem;
  background: #2a7a2a;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  z-index: 9999;
  font-size: 0.875rem;
  pointer-events: none;
  animation: toast-in-out 3s ease forwards;
}

.toast.toast-error { background: #c0392b; }
.toast.toast-info  { background: #4361ee; }

/* === Multiselect Widget === */

.multiselect { position: relative; }

.multiselect-btn {
  width: 100%;
  text-align: left;
  background: var(--color-surface-alt);
  color: var(--color-text);
  border: 1px solid var(--color-border-input);
  border-radius: 4px;
  padding: 0.5rem;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.multiselect-btn:hover { border-color: #4361ee; }

.multiselect-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border-input);
  border-radius: 6px;
  padding: 0.4rem 0;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  max-height: 240px;
  overflow-y: auto;
}

.light-mode .multiselect-dropdown { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

.multiselect-dropdown label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 400;
  white-space: nowrap;
  margin-bottom: 0;
}

.multiselect-dropdown label:hover { background: var(--color-row-hover); }
.multiselect-dropdown input[type=checkbox] { margin: 0; }

.multiselect-actions {
  display: flex;
  gap: 0.25rem;
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0.25rem;
}

.multiselect-actions button {
  flex: 1;
  padding: 0.2rem 0.4rem;
  font-size: 0.75rem;
  border: 1px solid var(--color-border-input);
  border-radius: 3px;
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
  cursor: pointer;
}

.multiselect-actions button:hover {
  background: var(--color-row-hover);
  color: var(--color-text);
}

/* === Task Info Tooltip === */

.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.card-header h2 { margin-bottom: 0; }

.info-icon {
  position: relative;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--color-text-subtle);
  line-height: 1;
  user-select: none;
  margin-left: auto;
}

.info-icon:hover { color: var(--color-text); }

.info-tooltip {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border-input);
  border-radius: 6px;
  padding: 0.6rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--color-text-muted);
  white-space: nowrap;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  line-height: 1.6;
}

.light-mode .info-tooltip { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

.info-icon:hover .info-tooltip { display: block; }

.status-history-list { margin-top: 0.3rem; }
.status-history-row { margin-top: 0.25rem; }

/* === Task Stats Strip === */

.task-stats {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  width: fit-content;
  margin: 0 auto;
}

.stats-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.stat-total {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-heading);
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.stat-count {
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

.stat-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.stat-sep {
  display: inline-block;
  width: 1px;
  height: 1rem;
  background: var(--color-border);
}

/* === Page Header (title + search) === */

.page-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.page-header h1 { margin-bottom: 0; }

.search-input {
  max-width: 280px;
  margin-left: auto;
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
}

/* === Tag Badge Overflow === */

.tag-cell {
  display: inline-flex;
  gap: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  max-width: 100%;
}

.badge-more {
  background: var(--color-surface-alt);
  color: var(--color-text-subtle);
  cursor: default;
}

/* === Swatch Grid (tags page) === */

.swatch-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 0.5rem; }
.swatch { width: 28px; height: 28px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: border-color 0.15s; }
.swatch:hover { opacity: 0.85; }
.swatch.selected { border-color: var(--color-heading); }

/* === Multiselect Search === */

.multiselect-search {
  width: 100%;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  border: none;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  outline: none;
}

/* === Tag Delete Modal === */

.modal-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.modal-actions .btn { flex: 1; }

/* === Wide Modal (attachment preview) === */

.modal-wide {
  max-width: 90vw;
  height: 85vh;
  display: flex;
  flex-direction: column;
}

.modal-wide .modal-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-wide textarea {
  flex: 1;
  resize: none;
}

.modal-wide .markdown-body {
  flex: 1;
  overflow-y: auto;
}

/* CodeMirror editor in modal */
.modal-wide .modal-body {
  min-height: 0;
}

.modal-wide .cm-editor {
  height: 100%;
  font-size: 0.9rem;
  border-radius: 4px;
}

.modal-wide .cm-editor .cm-scroller {
  overflow: auto !important;
}

.modal-wide .cm-editor.cm-focused {
  outline: none;
}

/* HTML iframe preview */
.modal-wide #file-modal-iframe {
  width: 100%;
  flex: 1;
  border: none;
  background: #fff;
  border-radius: 4px;
}

/* Image preview */
.modal-wide #file-modal-image-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 1rem;
}

.modal-wide #file-modal-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Audio preview */
.modal-wide #file-modal-audio-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-wide #file-modal-audio {
  width: 80%;
}

/* === Attachment List === */

.attachment-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
}

.attachment-item:last-child {
  border-bottom: none;
}

.attachment-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-name a {
  color: #64b5f6;
  text-decoration: none;
  cursor: pointer;
}

.attachment-name a:hover {
  text-decoration: underline;
}

.light-mode .attachment-name a {
  color: #1976d2;
}

.attachment-size {
  font-size: 0.8rem;
  color: var(--color-text-subtle);
  white-space: nowrap;
}

.attachment-actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

/* === Steps pipeline === */

.steps-pipeline {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  padding: 0.5rem 0;
}

.step-sub-card {
  flex: 0 0 auto;
  min-width: 160px;
  max-width: 220px;
  background: var(--color-surface);
  border: 2px solid var(--color-border-input);
  border-radius: 6px;
  padding: 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s;
}

.step-sub-card:hover {
  border-color: #4361ee;
}

.step-sub-card .step-label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.step-sub-card .step-status {
  font-size: 0.8rem;
}

.step-sub-card .step-notes-preview {
  font-size: 0.75rem;
  color: var(--color-text-subtle);
  margin-top: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.step-arrow {
  flex: 0 0 auto;
  padding: 0 0.35rem;
  color: var(--color-text-subtle);
  font-size: 1.2rem;
}

.step-sub-card[data-status="done"] { border-color: #2ecc71; }
.step-sub-card[data-status="in-progress"] { border-color: #4361ee; }
.step-sub-card[data-status="blocked"] { border-color: #e63946; }
.step-sub-card[data-status="review"] { border-color: #f39c12; }

.steps-define-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.steps-define-row input {
  flex: 1;
}

.steps-define-row .btn-danger {
  flex: 0 0 auto;
}

/* === Chip Dropdown (Status/Priority selectors) === */

.chip-dropdown { position: relative; }

.chip-dropdown-btn {
  width: 100%;
  text-align: left;
  background: var(--color-surface-alt);
  color: var(--color-text);
  border: 1px solid var(--color-border-input);
  border-radius: 4px;
  padding: 0.5rem;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.chip-dropdown-btn:hover { border-color: #4361ee; }

.chip-dropdown-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border-input);
  border-radius: 6px;
  padding: 0.4rem 0;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.light-mode .chip-dropdown-list { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

.chip-option {
  display: flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  white-space: nowrap;
}

.chip-option:hover { background: var(--color-row-hover); }
.chip-option.selected { background: var(--color-surface-alt); }

/* Tag chips inside multiselect button */
.multiselect-btn .badge { pointer-events: none; }
.multiselect-btn .tag-chips { display: inline-flex; gap: 0.25rem; flex-wrap: wrap; }

