/* Middle Column: Add Task & Tasks List */
.add-task-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.add-task-row-1 {
  width: 100%;
}

.add-task-row-1 input {
  width: 100%;
  box-sizing: border-box;
}

.add-task-row-type {
  width: 100%;
}

.add-task-row-type select {
  width: 100%;
  box-sizing: border-box;
  font-weight: 600;
  cursor: pointer;
}

.add-task-row-2,
.add-task-metrics-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  align-items: end;
  width: 100%;
  box-sizing: border-box;
}

.add-task-row-2 .input-with-label,
.add-task-metrics-row .input-with-label {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.add-task-row-2 .input-with-label label,
.add-task-metrics-row .input-with-label label {
  font-size: 0.62rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.15;
  white-space: normal;
  word-break: keep-all;
}

.add-task-row-2 input,
.add-task-metrics-row input {
  width: 100%;
  box-sizing: border-box;
  padding: 5px 2px;
  font-size: 0.76rem;
  text-align: center;
}

.add-task-row-3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 2px;
  flex-wrap: wrap;
  width: 100%;
  box-sizing: border-box;
}

.btn-add-task-full {
  width: 100% !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 7px;
  margin-top: 2px;
  box-sizing: border-box;
  cursor: pointer;
}

.task-roi-credit-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-left: auto;
}

.task-credit-roi-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.task-credit-roi-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent-emerald);
  cursor: pointer;
  margin: 0;
}

.task-pool-select {
  width: auto !important;
  max-width: 190px;
  padding: 2px 7px !important;
  font-size: 0.71rem !important;
  font-weight: 600;
  border-radius: 6px !important;
  background: var(--bg-card-elevated) !important;
  color: var(--accent-emerald) !important;
  border: 1px solid rgba(47, 158, 119, 0.32) !important;
  cursor: pointer;
}

.task-pool-select:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  color: var(--text-muted) !important;
  border-color: var(--border-subtle) !important;
}

.input-with-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.input-with-label label {
  font-size: 0.65rem;
  color: var(--text-secondary);
}

.tasks-list-container {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.empty-state-box {
  background: var(--bg-card);
  border: 1px dashed var(--border-highlight);
  border-radius: 10px;
  padding: 18px 14px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 8px 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  width: 100%;
  box-sizing: border-box;
}

.task-card:hover {
  border-color: var(--border-highlight, #94a3b8);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.04);
}

/* Move Tasks Header Button & Confirmation Group */
.tasks-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-move-tasks {
  font-size: 0.70rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  cursor: pointer;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all 0.15s ease;
  line-height: 1.3;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-move-tasks:hover:not(:disabled) {
  border-color: var(--accent-emerald, #10b981);
  color: var(--accent-emerald, #10b981);
  background: var(--bg-card-elevated);
}

.btn-move-tasks:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.move-tasks-confirm-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-cancel-move,
.btn-save-move {
  min-width: 24px;
  height: 22px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  border-radius: 5px;
  cursor: pointer;
  line-height: 1;
  transition: all 0.15s ease;
}

.btn-cancel-move {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.btn-cancel-move:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.btn-save-move {
  background: var(--accent-emerald, #10b981);
  color: #fff;
  border: 1px solid var(--accent-emerald, #10b981);
}

.btn-save-move:hover {
  opacity: 0.9;
  box-shadow: 0 1px 4px rgba(16, 185, 129, 0.3);
}

/* Move Mode styling on task cards */
.task-card.in-move-mode {
  cursor: grab !important;
  border: 1px dashed rgba(16, 185, 129, 0.5) !important;
  background: var(--bg-card);
  user-select: none;
}

.task-card.in-move-mode:hover {
  border-color: var(--accent-emerald, #10b981) !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15) !important;
  transform: translateY(-1px);
}

.task-card.in-move-mode:active {
  cursor: grabbing !important;
}

.task-card.is-dragging {
  opacity: 0.38 !important;
  border: 1px dashed var(--accent-emerald, #10b981) !important;
  transform: scale(0.99);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

.task-card.drag-over-top {
  border-top: 2px solid var(--accent-emerald, #10b981) !important;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  transform: translateY(2px);
}

.task-card.drag-over-bottom {
  border-bottom: 2px solid var(--accent-emerald, #10b981) !important;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
  transform: translateY(-2px);
}

.task-card.is-editing {
  cursor: default;
  border-color: var(--accent-emerald, #10b981);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.18);
  background: var(--bg-card);
  padding: 9px 11px;
}

.task-card.is-core {
  background: linear-gradient(135deg, rgba(217, 138, 28, 0.09), rgba(255, 248, 235, 0.6));
  border-color: rgba(217, 138, 28, 0.35);
}

.task-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
}

.task-header-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
}

.task-title-wrap {
  width: 100%;
  box-sizing: border-box;
  padding: 1px 2px 2px 2px;
}

.task-check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex: 1;
}

.task-done-checkbox,
.task-check-label input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--accent-emerald);
  cursor: pointer;
  flex-shrink: 0;
}

.task-title-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  cursor: pointer;
  word-break: break-word;
  white-space: pre-wrap;
  transition: color 0.15s ease;
  display: block;
  width: 100%;
}

.task-title-text:hover:not(.done) {
  color: var(--accent-emerald, #10b981);
}

.task-title-text.done {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Collapsible Sub-Steps & Micro-Actions */
.task-substeps-wrapper {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  box-sizing: border-box;
}

.task-substeps-toggle {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 6px;
  background: var(--bg-card-elevated, #f8fafc);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 5px;
  padding: 2px 7px 2px 5px;
  font-size: 0.72rem;
  cursor: pointer;
  color: var(--text-secondary, #475569);
  transition: all 0.15s ease;
  user-select: none;
  outline: none;
  box-sizing: border-box;
}

.task-substeps-toggle:hover {
  background: #f1f5f9;
  border-color: var(--accent-emerald, #10b981);
  color: var(--text-primary, #1e293b);
}

.task-substeps-toggle.is-expanded {
  background: rgba(47, 158, 119, 0.08);
  border-color: rgba(47, 158, 119, 0.35);
  color: var(--accent-emerald, #10b981);
}

.substep-toggle-arrow {
  font-size: 0.65rem;
  line-height: 1;
  display: inline-block;
  color: var(--text-secondary, #64748b);
  transition: transform 0.18s ease, color 0.15s ease;
}

.substep-toggle-arrow.expanded {
  transform: rotate(90deg);
  color: var(--accent-emerald, #10b981);
}

.substep-badge {
  font-family: var(--font-mono, monospace);
  font-size: 0.70rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.substep-badge.is-all-done {
  color: #059669;
  font-weight: 700;
}

.substep-track {
  width: 32px;
  height: 4px;
  background: rgba(148, 163, 184, 0.25);
  border-radius: 2px;
  overflow: hidden;
  display: inline-block;
  flex-shrink: 0;
}

.substep-fill {
  display: block;
  height: 100%;
  background: var(--accent-emerald, #10b981);
  transition: width 0.2s ease;
}

.task-substeps-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
  padding: 5px 8px;
  background: rgba(241, 245, 249, 0.55);
  border-left: 2.5px solid var(--accent-emerald, #10b981);
  border-radius: 0 5px 5px 0;
  box-sizing: border-box;
}

.task-substep-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  cursor: pointer;
  padding: 2px 2px;
  border-radius: 3px;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.task-substep-row:hover {
  background: rgba(255, 255, 255, 0.7);
}

.task-substep-row.is-done {
  opacity: 0.8;
}

.task-substep-checkbox {
  width: 14px;
  height: 14px;
  margin: 2px 0 0 0;
  accent-color: var(--accent-emerald, #10b981);
  cursor: pointer;
  flex-shrink: 0;
}

.task-substep-title {
  font-size: 0.78rem;
  color: var(--text-primary, #1e293b);
  line-height: 1.35;
  word-break: break-word;
  transition: color 0.15s ease, opacity 0.15s ease;
}

.task-substep-title.done {
  text-decoration: line-through;
  color: var(--text-muted, #94a3b8);
  opacity: 0.75;
}

.task-card-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  margin-top: 1px;
}

.task-card-actions .btn-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  line-height: 1;
  font-size: 1.05rem;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all 0.15s ease;
  padding: 0;
}

.task-card-actions .btn-del:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}

.btn-task-timer {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 1px 4px;
  border-radius: 4px;
  line-height: 1;
  opacity: 0.75;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-task-timer:hover {
  opacity: 1;
  color: var(--accent-emerald, #10b981);
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
}

.btn-task-timer.is-running {
  opacity: 1;
  color: #059669;
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  animation: pulse-timer-btn 1.4s infinite ease-in-out;
}

.btn-task-timer.is-paused {
  opacity: 1;
  color: #d97706;
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
}

@keyframes pulse-timer-btn {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}


.task-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-left: 25px;
  flex-wrap: wrap;
}

.task-badges {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  display: contents;
}

/* Tag chips similar to 3pm and 30m */
.tag-pill {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #4f46e5;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.28);
  white-space: nowrap;
}

.tag-pill.tag-work {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.28);
}

.tag-pill.tag-rv,
.tag-pill.tag-van {
  color: #d97706;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.28);
}

.tag-pill.tag-house,
.tag-pill.tag-family {
  color: #059669;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.28);
}

/* Stopwatch Timer Pill on Task */
.task-timer-pill {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  cursor: pointer;
}

.task-timer-pill.is-running {
  color: #059669;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.task-timer-pill.is-running .timer-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  animation: timer-dot-blink 1s infinite;
  display: inline-block;
}

@keyframes timer-dot-blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.2; transform: scale(0.7); }
}

.task-timer-pill.is-paused {
  color: #d97706;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.task-actual-pill {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  color: #4f46e5;
  background: rgba(99, 102, 241, 0.09);
  border: 1px solid rgba(99, 102, 241, 0.25);
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.task-actual-pill.is-done {
  color: #059669;
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.25);
}

/* Summary Column: Label Aggregations & Estimated vs Actual Time */
.summary-labels-container {
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 10px;
}

.summary-label-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-group-title {
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.summary-chips-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.summary-stat-chip {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--bg-card-elevated, rgba(241, 245, 249, 0.6));
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  white-space: nowrap;
}

.summary-stat-chip.due-time {
  color: #dc2626;
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.22);
}

.summary-stat-chip.due-date {
  color: #d97706;
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.22);
}

.summary-stat-chip.est-bracket {
  color: #4f46e5;
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.22);
}

.time-comparison-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 9px;
}

.tc-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tc-label {
  font-size: 0.64rem;
  color: var(--text-secondary);
}

.tc-val {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 700;
}

.tc-val.text-muted {
  color: var(--text-muted, #9ca3af) !important;
}

/* Hide Credit to ROI checkbox when disabled */
.task-credit-roi-label:has(input:disabled),
.task-credit-roi-label:has(input[disabled]),
.task-credit-roi-checkbox:disabled,
.task-credit-roi-checkbox[disabled] {
  display: none !important;
}

/* Inline Edit Form */
.task-inline-edit-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.task-edit-row-title textarea,
.task-edit-row-title input {
  width: 100%;
  box-sizing: border-box;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--bg-card-elevated, #fff);
  color: var(--text-primary);
  font-family: inherit;
  line-height: 1.35;
  resize: vertical;
  min-height: 48px;
}

.task-edit-grid-fields {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
  box-sizing: border-box;
}

.task-edit-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.task-edit-field:has(textarea),
.task-edit-field.task-edit-field-labels {
  align-items: flex-start;
}

.task-edit-field label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 86px;
  flex-shrink: 0;
  text-align: left;
  line-height: 1.2;
}

.task-edit-field:has(textarea) label,
.task-edit-field.task-edit-field-labels label {
  padding-top: 6px;
}

.task-edit-field input,
.task-edit-field select,
.task-edit-field textarea {
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  padding: 5px 8px;
  font-size: 0.78rem;
  text-align: left;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card-elevated, #fff);
  color: var(--text-primary);
  font-family: inherit;
  line-height: 1.35;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.task-edit-field textarea {
  resize: vertical;
  min-height: 38px;
}

.task-edit-input-orig-planned,
.task-edit-input-planned-date,
.task-edit-input-completed-at {
  min-height: 28px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-card-elevated, #fff);
}

/* Sub-steps input full-width below label (same width as main task input box) */
.task-edit-row-substeps,
.task-edit-field.task-edit-field-substeps {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 4px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.task-edit-row-substeps label,
.task-edit-field.task-edit-field-substeps label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: left;
  line-height: 1.2;
  min-width: unset !important;
  width: 100% !important;
  padding-top: 0 !important;
}

.task-edit-row-substeps textarea,
.task-edit-field-substeps textarea,
.task-edit-input-substeps {
  width: 100% !important;
  box-sizing: border-box !important;
  flex: none !important;
  font-size: 0.82rem;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--bg-card-elevated, #fff);
  color: var(--text-primary);
  font-family: inherit;
  line-height: 1.35;
  resize: vertical;
  min-height: 32px;
}

.task-edit-field input:focus,
.task-edit-field select:focus,
.task-edit-field textarea:focus,
.task-edit-row-title input:focus,
.task-edit-row-title textarea:focus,
.task-edit-row-substeps textarea:focus,
.task-edit-input-substeps:focus {
  outline: none;
  border-color: var(--accent-emerald, #10b981);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

.task-edit-row-roi {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 3px 0;
}

.task-edit-credit-line {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.task-edit-credit-line .task-credit-roi-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}

.task-edit-credit-line .task-pool-select {
  flex: 1 !important;
  min-width: 0 !important;
  max-width: none !important;
  width: 100% !important;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  padding: 4px 7px !important;
  font-size: 0.73rem !important;
}

.task-edit-status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.task-edit-saved-box {
  display: flex;
  align-items: center;
  gap: 4px;
}

.task-edit-row-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 6px;
}

.task-edit-btn-delete {
  background: transparent;
  border: 1px solid rgba(224, 93, 111, 0.4);
  color: var(--accent-rose, #e05d6f);
  font-size: 0.85rem;
  padding: 3px 7px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 26px;
  line-height: 1;
  transition: all 0.15s ease;
}

.task-edit-btn-delete:hover {
  background: rgba(224, 93, 111, 0.12);
  border-color: var(--accent-rose, #e05d6f);
  color: #dc2626;
}

.task-edit-btn-cancel {
  background: transparent;
  border: 1px solid var(--border-subtle, #cbd5e1);
  color: var(--text-secondary, #64748b);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 26px;
  line-height: 1;
  transition: all 0.15s ease;
}

.task-edit-btn-cancel:hover {
  background: var(--bg-hover, rgba(0, 0, 0, 0.05));
  color: var(--text-primary, #1e293b);
  border-color: var(--border-highlight, #94a3b8);
}

.task-edit-btn-save {
  background: var(--accent-emerald, #10b981);
  border: 1px solid var(--accent-emerald, #10b981);
  color: #ffffff;
  font-size: 0.85rem;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 26px;
  line-height: 1;
  transition: all 0.15s ease;
}

.task-edit-btn-save:hover {
  background: #059669;
  border-color: #059669;
}

.task-edit-shortcuts-hint {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.badge-core {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: #c27a12;
  background: rgba(245, 158, 11, 0.15);
  padding: 1px 6px;
  border-radius: 4px;
}

.badge-earned {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  color: #2f9e77;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.28);
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
}

.badge-time-done {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: #3b7dd8;
  background: rgba(59, 130, 246, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
}

/* Right Column: Summary */
.earned-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-emerald-soft);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #2f9e77;
  white-space: nowrap;
}

.summary-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.sum-metric-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 6px 7px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.sm-label {
  font-size: 0.66rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sm-val {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 700;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.02em;
}

.summary-block {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.summary-block-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.achievement-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 440px;
  overflow-y: auto;
  padding-right: 2px;
}

.task-card.summary-task-card {
  background: var(--bg-card);
  border: 1px solid rgba(47, 158, 119, 0.28);
  border-radius: 8px;
  padding: 7px 10px;
  cursor: default;
}

.task-card.summary-task-card:hover {
  border-color: var(--accent-emerald, #10b981);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.empty-completed-box {
  background: rgba(47, 158, 119, 0.04);
  border: 1px dashed rgba(47, 158, 119, 0.25);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.4;
}

.empty-state-box.all-done-state {
  background: rgba(47, 158, 119, 0.06);
  border: 1px dashed rgba(47, 158, 119, 0.35);
  border-radius: 9px;
  padding: 16px 14px;
  text-align: center;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.empty-state-box.all-done-state strong {
  font-size: 0.92rem;
  color: #0f766e;
}

.achievement-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  padding: 7px 9px;
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.achievement-item:hover:not(.is-editing) {
  border-color: rgba(108, 122, 224, 0.45);
  background: var(--bg-card-hover, rgba(255, 255, 255, 0.95));
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.achievement-item.is-editing {
  cursor: default;
  border-color: rgba(108, 122, 224, 0.55);
  box-shadow: 0 2px 8px rgba(108, 122, 224, 0.12);
  padding: 8px 10px;
}

.ach-row-main {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
}

.ach-check {
  flex-shrink: 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--text-secondary);
}

.ach-title {
  font-weight: 700;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--text-primary);
  word-break: break-word;
  flex: 1;
}

.ach-row-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-left: 16px;
  width: 100%;
  box-sizing: border-box;
  font-size: 0.68rem;
}

.ach-sub-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.ach-cost-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.65rem;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
}

.ach-cost-badge .ach-badge-label {
  font-weight: 500;
  opacity: 0.85;
}

.ach-cost-badge.ach-time-cost {
  color: #0f766e;
  background: rgba(20, 184, 166, 0.1);
  border: 1px solid rgba(20, 184, 166, 0.25);
}

.ach-cost-badge.ach-dollar-cost {
  color: #047857;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.summary-stat-chip.time-cost {
  color: #0d9488;
  background: rgba(13, 148, 136, 0.08);
  border-color: rgba(13, 148, 136, 0.22);
}

.summary-stat-chip.dollar-cost {
  color: #059669;
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.22);
}

.ach-meta {
  color: var(--text-secondary);
  font-size: 0.68rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ach-time {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: #3b7dd8;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}

.insights-box {
  background: rgba(47, 158, 119, 0.06);
  border: 1px solid rgba(47, 158, 119, 0.22);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.75rem;
  color: #1f5f4a;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Shift to Tomorrow button under tasks in Plan column */
.tasks-actions-block {
  display: flex;
  flex-direction: column;
  margin-top: 12px;
  padding-top: 4px;
}

.btn-shift-tomorrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 9px 14px;
  font-size: 0.80rem;
  font-weight: 600;
  color: #854d0e; /* dark yellow */
  background: #fefce8; /* very light yellow */
  border: 1px dashed #facc15; /* subtle warm yellow/amber border */
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
  letter-spacing: 0.01em;
}

.btn-shift-tomorrow .btn-shift-icon {
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.btn-shift-tomorrow .btn-shift-text {
  font-size: 0.80rem;
  font-weight: 600;
  line-height: 1.2;
}

.btn-shift-tomorrow:hover:not(:disabled) {
  background: #fef9c3; /* slightly richer light yellow on hover */
  border-color: #eab308;
  color: #713f12; /* deeper dark yellow */
  box-shadow: 0 1px 6px rgba(234, 179, 8, 0.16);
  transform: translateY(-0.5px);
}

.btn-shift-tomorrow:active:not(:disabled) {
  transform: translateY(0);
  background: #fef08a;
}

.btn-shift-tomorrow:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  border-style: solid;
  border-color: #fef08a;
  background: #fefce8;
  color: #a16207;
}

.btn-move-unfinished {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #854d0e;
  background: #fefce8;
  border: 1px dashed #facc15;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.btn-move-unfinished:hover:not(:disabled) {
  background: #fef9c3;
  border-color: #eab308;
  color: #713f12;
}

.btn-move-unfinished:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  border-style: solid;
  border-color: #fef08a;
  background: #fefce8;
  color: #a16207;
}

/* Combined Reflection & Insights Header & AI Button */
.reflection-block-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
}

.reflection-block-title-text {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.reflection-header-right {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  white-space: nowrap;
}

.save-hint.reflection-save-status {
  font-size: 0.55rem !important; /* Much smaller font to ensure single-line fit */
  font-family: var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.02em;
  opacity: 0.78;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}

.btn-ai-fill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 19px;
  min-width: 21px;
  padding: 0;
  border-radius: 5px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(47, 158, 119, 0.16) 100%);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: var(--accent-indigo, #6366f1);
  font-size: 0.70rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-ai-fill:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.22) 0%, rgba(47, 158, 119, 0.26) 100%);
  border-color: rgba(99, 102, 241, 0.6);
  transform: translateY(-0.5px);
  box-shadow: 0 1px 4px rgba(99, 102, 241, 0.18);
}

.btn-ai-fill:active {
  transform: translateY(0);
}

.btn-ai-fill:disabled {
  opacity: 0.5;
  cursor: wait;
  pointer-events: none;
}

.btn-ai-fill.is-loading {
  animation: pulseAiFillBtn 1s infinite alternate ease-in-out;
}

@keyframes pulseAiFillBtn {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.1); opacity: 1; border-color: var(--accent-emerald, #10b981); }
}

/* Learning & Writing Top-Level Grid + Lower Grid */
.lower-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 15px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 9px;
}

.panel-index {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  display: block;
}

.panel-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.sub-hint {
  font-size: 0.73rem;
  font-weight: 400;
  color: var(--text-secondary);
}

.panel-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  white-space: nowrap;
}

/* LEARNING Component */
.book-filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.books-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

/* Kanban Mobile Scroll (Brain Dump -> Planned -> Summary stays horizontal) */
@media (max-width: 860px) {
  .planner-workspace-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(280px, 1fr)) !important;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .planner-workspace-grid > .planner-col {
    scroll-snap-align: start;
    min-width: 280px;
  }
}

/* Work Done & Itemized Breakdown in Task Inline Edit */
.task-edit-work-breakdown-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  padding: 9px 11px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

.task-breakdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.task-edit-input-breakdown-text {
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 0.76rem;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-primary);
  resize: vertical;
  line-height: 1.4;
}

.task-breakdown-items-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 4px;
}

.task-breakdown-item-row {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
}

.task-breakdown-desc-input {
  flex: 1 1 auto !important;
  width: 100% !important;
  min-width: 180px !important;
  font-size: 0.82rem !important;
  padding: 7px 11px !important;
  border-radius: 6px !important;
  border: 1px solid var(--border-subtle, #cbd5e1) !important;
  background: var(--bg-surface, #ffffff) !important;
  color: var(--text-primary) !important;
  box-sizing: border-box !important;
}

.task-breakdown-currency-symbol {
  flex: 0 0 auto !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  color: var(--text-muted, #94a3b8) !important;
}

.task-breakdown-cost-input {
  flex: 0 0 95px !important;
  width: 95px !important;
  min-width: 95px !important;
  max-width: 95px !important;
  font-size: 0.82rem !important;
  padding: 7px 10px !important;
  border-radius: 6px !important;
  border: 1px solid var(--border-subtle, #cbd5e1) !important;
  background: var(--bg-surface, #ffffff) !important;
  font-family: var(--font-mono, monospace) !important;
  color: var(--text-primary) !important;
  text-align: right !important;
  box-sizing: border-box !important;
}

.task-breakdown-card-preview {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  background: rgba(16, 185, 129, 0.06);
  border: 1px dashed rgba(16, 185, 129, 0.25);
  padding: 2px 7px;
  border-radius: 5px;
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-breakdown-card-preview .preview-badge {
  color: #059669;
  font-weight: 700;
  flex-shrink: 0;
}

.task-breakdown-card-preview .preview-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Jump to task highlight animation */
@keyframes taskGlowPulse {
  0% { box-shadow: 0 0 0 0 rgba(47, 158, 119, 0.75); border-color: #2f9e77; transform: scale(1.005); }
  50% { box-shadow: 0 0 18px 5px rgba(47, 158, 119, 0.5); border-color: #10b981; transform: scale(1.015); }
  100% { box-shadow: 0 0 0 0 rgba(47, 158, 119, 0); border-color: inherit; transform: scale(1); }
}

.task-jump-highlight {
  animation: taskGlowPulse 1.6s ease-in-out 2 !important;
  border-color: #2f9e77 !important;
  background: rgba(47, 158, 119, 0.1) !important;
  position: relative;
  z-index: 10;
}

/* =========================================================================
   TASK EDITOR POP-UP MODAL (SPANS PLANNER WIDTH)
   ========================================================================= */
#modal-task-editor {
  z-index: 10005;
}

.task-editor-modal-card {
  width: min(94vw, 880px);
  max-width: 880px;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22), 0 4px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  animation: modal-pop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.task-editor-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border-subtle, #e2e8f0);
  background: var(--bg-card-elevated, #f8fafc);
}

.task-editor-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-editor-header-left h3 {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin: 0;
}

.task-editor-modal-body {
  padding: 12px 18px;
  overflow-y: auto;
  max-height: calc(94vh - 52px);
  display: flex;
  flex-direction: column;
  gap: 9px;
}

/* 1. Title & Top Status Row */
.task-edit-top-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
  box-sizing: border-box;
}

.task-edit-title-wrap {
  flex: 1 1 200px;
  min-width: 160px;
}

.task-edit-input-title {
  width: 100%;
  font-size: 1rem;
  font-weight: 600;
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--bg-surface, #ffffff);
  color: var(--text-primary, #0f172a);
  box-sizing: border-box;
  font-family: inherit;
  line-height: 1.4;
  min-height: 36px;
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.task-edit-input-title:focus {
  outline: none;
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.task-edit-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
  margin-left: auto;
  box-sizing: border-box;
  padding-right: 2px;
}

.task-edit-select-type {
  width: 90px !important;
  max-width: 95px !important;
  flex: 0 0 90px;
  padding: 4px 6px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--border-subtle, #cbd5e1);
  background: var(--bg-card-elevated, #f8fafc);
  color: var(--text-primary);
  cursor: pointer;
  box-sizing: border-box;
}

.task-edit-completed-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  background: transparent;
  border: none;
  box-sizing: border-box;
  flex-shrink: 0;
}

.task-edit-completed-box .task-edit-completed-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary, #475569);
  cursor: pointer;
  user-select: none;
  padding: 0;
  border: none;
  background: transparent;
}

.task-edit-completed-box .task-edit-completed-toggle input[type="checkbox"] {
  cursor: pointer;
  width: 15px;
  height: 15px;
  accent-color: #059669;
  margin: 0;
}

.task-edit-completed-box .task-edit-input-completed-at {
  width: 98px !important;
  padding: 2px 4px !important;
  font-size: 0.78rem;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  border-radius: 4px;
  border: 1px solid var(--border-subtle, #cbd5e1);
  background: var(--bg-surface, #ffffff);
  color: var(--text-primary);
  box-sizing: border-box;
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.task-edit-completed-box .task-edit-input-completed-at:focus {
  outline: none;
  border-color: #059669;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.18);
}

.task-edit-spent-group,
.task-edit-completed-box .task-edit-spent-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  user-select: none;
  margin-left: auto;
  flex-shrink: 0;
}

.task-edit-spent-prefix,
.task-edit-completed-box .task-edit-spent-prefix {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary, #475569);
  margin-right: 1px;
}

.task-edit-spent-time-part {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.task-edit-sublabel,
.task-edit-completed-box .task-edit-sublabel {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
}

.task-edit-time-cost-val,
.task-edit-completed-box .task-edit-time-cost-val {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  background: var(--bg-card-elevated, #f1f5f9);
  border: 1px solid var(--border-subtle, #cbd5e1);
  border-radius: 4px;
  padding: 2px 6px;
  min-width: 28px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-sizing: border-box;
}

.task-edit-spent-dollar-part,
.task-edit-spent-dollar-group,
.task-edit-completed-box .task-edit-spent-dollar-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 10px;
  cursor: text;
  margin-top: 0;
  margin-bottom: 0;
  margin-right: 0;
  padding: 0;
}

input[type="number"].task-edit-input-cost {
  width: 32px !important;
  max-width: 34px !important;
  min-width: 30px !important;
  height: 24px !important;
  padding: 1px 3px !important;
  border: 1px solid var(--border-subtle, #cbd5e1) !important;
  background: var(--bg-surface, #ffffff) !important;
  border-radius: 4px !important;
  font-size: 0.78rem !important;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace) !important;
  font-weight: 600 !important;
  color: var(--text-primary) !important;
  text-align: center !important;
  outline: none !important;
  box-sizing: border-box !important;
  -moz-appearance: textfield !important;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="number"].task-edit-input-cost:focus {
  border-color: #059669 !important;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.18) !important;
}

input[type="number"].task-edit-input-cost::-webkit-outer-spin-button,
input[type="number"].task-edit-input-cost::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}

/* 2. Planning & Schedule 4-Row Attribute Box (Text to the left of input box) */
.task-edit-attr-box {
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: var(--bg-surface-elevated, rgba(248, 250, 252, 0.65));
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 10px;
  padding: 9px 12px;
  box-sizing: border-box;
}

.attr-row {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  flex-wrap: wrap;
}

.attr-row-planned,
.attr-row-time {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
}

.attr-row-planned .attr-row-left,
.attr-row-time .attr-row-left {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.attr-row-planned .attr-row-right,
.attr-row-time .attr-row-right {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin-left: auto !important;
}

.attr-group-label {
  display: inline-block;
  width: auto !important;
  min-width: auto !important;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  white-space: nowrap;
  flex: 0 0 auto !important;
}

.attr-inline-group {
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
  margin: 0 !important;
  flex: 0 0 auto !important;
}

.attr-inline-group .attr-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  white-space: nowrap;
  width: auto !important;
  min-width: auto !important;
}

.attr-group-slot,
.attr-group-due {
  gap: 3px !important;
  margin-left: 2px !important;
}

.task-edit-input-orig-planned,
.task-edit-input-planned-date {
  width: 106px !important;
  max-width: 110px !important;
  padding: 3px 4px !important;
  font-size: 0.77rem !important;
  font-family: inherit;
  border-radius: 6px;
  border: 1px solid var(--border-subtle, #cbd5e1);
  background: var(--bg-surface, #ffffff);
  color: var(--text-primary);
  box-sizing: border-box;
}

.task-edit-input-duration,
.task-edit-input-actual {
  width: 44px !important;
  max-width: 48px !important;
  text-align: center;
  font-family: var(--font-mono, monospace);
  font-size: 0.84rem;
  padding: 3px 2px !important;
  border-radius: 6px;
  border: 1px solid var(--border-subtle, #cbd5e1);
  background: var(--bg-surface, #ffffff);
  color: var(--text-primary);
  box-sizing: border-box;
}

.task-edit-input-duration::-webkit-inner-spin-button,
.task-edit-input-duration::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.task-edit-input-duration {
  -moz-appearance: textfield;
}

.task-edit-input-slot {
  width: 48px !important;
  max-width: 52px !important;
  text-align: center;
  font-family: var(--font-mono, monospace);
  font-size: 0.84rem;
  padding: 3px 2px !important;
  border-radius: 6px;
  border: 1px solid var(--border-subtle, #cbd5e1);
  background: var(--bg-surface, #ffffff);
  color: var(--text-primary);
  box-sizing: border-box;
}

.attr-row-time input.task-edit-input-due,
.task-edit-input-due {
  width: 82px !important;
  max-width: 88px !important;
  padding: 3px 5px !important;
  font-size: 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--border-subtle, #cbd5e1);
  background: var(--bg-surface, #ffffff);
  color: var(--text-primary);
  box-sizing: border-box;
}

.attr-item-date {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Row 4: Labels & Tags */
.attr-row-labels {
  width: 100%;
}

.attr-item-full {
  width: 100%;
  display: flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
}

.attr-label-labels {
  width: auto !important;
  min-width: auto !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  color: var(--text-primary, #0f172a) !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.attr-item-full input.task-edit-input-labels {
  flex: 1 1 auto !important;
  width: 100% !important;
  height: 30px !important;
  font-family: inherit !important;
  font-size: 0.82rem !important;
  padding: 4px 8px !important;
  border-radius: 6px !important;
  border: 1px solid var(--border-subtle, #cbd5e1) !important;
  background: var(--bg-surface, #ffffff) !important;
  color: var(--text-primary) !important;
  box-sizing: border-box !important;
}

.task-edit-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.task-edit-field label {
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--text-secondary, #64748b);
  letter-spacing: 0.02em;
}

.task-edit-field input,
.task-edit-field select {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 10px;
  font-size: 0.82rem;
  border-radius: 6px;
  border: 1px solid var(--border-subtle, #cbd5e1);
  background: var(--bg-surface, #ffffff);
  color: var(--text-primary, #0f172a);
  font-family: inherit;
  transition: border-color 0.15s;
}

.task-edit-field input.task-edit-input-duration,
.task-edit-field input.task-edit-input-actual {
  width: 58px !important;
  max-width: 58px !important;
  text-align: center;
  font-family: var(--font-mono, monospace);
  font-size: 0.85rem;
  padding: 6px 4px;
}

.task-edit-field input.task-edit-input-duration::-webkit-inner-spin-button,
.task-edit-field input.task-edit-input-duration::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.task-edit-field input.task-edit-input-duration {
  -moz-appearance: textfield;
}

.task-edit-field input:focus,
.task-edit-field select:focus {
  outline: none;
  border-color: #059669;
}

/* 3. Section Cards (Sub-steps & ROI) */
.task-edit-section-card {
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 10px;
  background: var(--bg-card, #ffffff);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-card-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary, #1e293b);
  margin: 0;
}

.section-card-hint {
  font-size: 0.7rem;
  color: var(--text-muted, #94a3b8);
}

.task-edit-input-substeps {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 10px;
  font-size: 0.82rem;
  line-height: 1.4;
  border-radius: 7px;
  border: 1px solid var(--border-subtle, #cbd5e1);
  background: var(--bg-surface, #ffffff);
  color: var(--text-primary);
  font-family: inherit;
  resize: vertical;
  min-height: 32px !important;
}

/* 4. ROI & Financial Value */
.task-edit-roi-card {
  background: rgba(16, 185, 129, 0.02);
  border-color: rgba(16, 185, 129, 0.25);
}

.roi-card-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(16, 185, 129, 0.22);
}

.roi-header-left {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.roi-header-center {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.roi-header-center .task-btn-add-breakdown-item {
  font-size: 0.80rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle, #cbd5e1);
  background: var(--bg-surface, #ffffff);
  color: var(--text-secondary, #475569);
  cursor: pointer;
  line-height: 1.25;
  transition: all 0.15s ease;
}

.roi-header-center .task-btn-add-breakdown-item:hover {
  border-color: var(--accent-emerald, #10b981);
  color: #059669;
  background: rgba(16, 185, 129, 0.08);
}

.roi-header-right {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.saved-word,
.earnings-word {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-left: 2px;
}

.breakdown-sum-val,
.task-calc-earnings-val {
  font-family: var(--font-mono, monospace);
  font-size: 1.05rem;
  font-weight: 700;
  color: #059669;
}

.task-breakdown-items-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 4px;
}

.task-breakdown-item-row {
  display: flex !important;
  align-items: flex-start !important;
  gap: 8px !important;
  width: 100% !important;
}

.task-breakdown-desc-input {
  flex: 1 1 auto !important;
  width: 100% !important;
  min-width: 200px !important;
  padding: 5px 8px !important;
  font-size: 0.82rem !important;
  font-family: inherit !important;
  line-height: 1.4 !important;
  resize: vertical !important;
  min-height: 32px !important;
  border-radius: 6px !important;
  border: 1px solid var(--border-subtle, #cbd5e1) !important;
  background: var(--bg-surface, #ffffff) !important;
  color: var(--text-primary) !important;
  box-sizing: border-box !important;
  overflow-y: hidden;
}

.task-breakdown-currency-symbol {
  flex: 0 0 auto !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  color: var(--text-muted, #94a3b8) !important;
  padding-top: 6px !important;
}

.task-breakdown-cost-input {
  flex: 0 0 52px !important;
  width: 52px !important;
  min-width: 50px !important;
  max-width: 56px !important;
  padding: 4px 6px !important;
  font-size: 0.82rem !important;
  text-align: right !important;
  border-radius: 6px !important;
  border: 1px solid var(--border-subtle, #cbd5e1) !important;
  background: var(--bg-surface, #ffffff) !important;
  font-family: var(--font-mono, monospace) !important;
  color: var(--text-primary) !important;
  box-sizing: border-box !important;
}

.task-btn-del-breakdown-item {
  flex: 0 0 24px !important;
  width: 24px !important;
  min-width: 24px !important;
  max-width: 24px !important;
  height: 24px !important;
  margin-top: 4px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0.95rem !important;
  line-height: 1 !important;
  cursor: pointer !important;
}

.task-breakdown-actions {
  display: flex;
  align-items: center;
  margin-top: 2px;
}

/* 4. Sweat Equity Money Card (Title Bar + 2 Inside Subcards) */
.task-edit-money-card {
  padding: 8px 10px !important;
  border: 1px solid rgba(16, 185, 129, 0.32);
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.03);
  display: flex;
  flex-direction: column;
  gap: 7px !important;
}

.money-card-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 2px 3px 2px;
  background: transparent;
  border-bottom: none;
}

.money-title-content {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.money-title-badge {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.money-title-badge strong {
  font-family: var(--font-mono, monospace);
  color: #059669;
  font-size: 1.05rem;
}

.money-title-content .task-project-select {
  flex: 1 1 auto;
  max-width: 280px;
  padding: 4px 8px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: var(--bg-surface, #ffffff);
  color: var(--text-primary);
  box-sizing: border-box;
}

/* 2 Inside Components: ROI and Earnings */
.money-subcard {
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 8px;
  box-sizing: border-box;
}

.money-subcard-roi {
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.money-subcard-earnings {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 6px 11px;
  background: var(--bg-surface-elevated, #f8fafc);
}

.earnings-left {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.earnings-right-chunk {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
}

.earnings-line {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.84rem;
  flex-wrap: wrap;
}

.earnings-line .task-calc-earnings-val {
  font-family: var(--font-mono, monospace);
  font-size: 1.05rem;
  font-weight: 700;
  color: #059669;
}

.earnings-word {
  font-weight: 600;
  color: var(--text-primary);
  margin-right: 2px;
}

.calc-paren {
  color: var(--text-muted, #94a3b8);
  font-weight: 600;
  font-size: 0.88rem;
}

.task-roi-text {
  font-size: 0.84rem;
  font-weight: 700;
  color: #059669;
  font-family: var(--font-mono, monospace);
  white-space: nowrap;
}

.settlement-box-label {
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.earnings-right-chunk {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  font-family: var(--font-mono, monospace);
  font-size: 0.84rem;
  font-weight: 700;
}

.earnings-right-chunk .task-act-time-copy {
  font-family: var(--font-mono, monospace);
  font-size: 0.84rem;
  font-weight: 700;
  padding: 1px 6px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  white-space: nowrap;
  color: var(--text-primary);
}

.earnings-right-chunk .calc-sym,
.earnings-right-chunk .calc-unit {
  font-family: var(--font-mono, monospace);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-muted, #94a3b8);
  white-space: nowrap;
}

.earnings-right-chunk .task-edit-input-hourly-rate {
  width: 44px !important;
  min-width: 40px !important;
  max-width: 48px !important;
  padding: 2px 2px !important;
  font-size: 0.84rem !important;
  font-weight: 700 !important;
  border-radius: 6px !important;
  border: 1px solid var(--border-subtle, #cbd5e1) !important;
  font-family: var(--font-mono, monospace) !important;
  text-align: center !important;
  background: var(--bg-surface, #ffffff) !important;
  color: var(--text-primary) !important;
  box-sizing: border-box !important;
}

.task-edit-input-hourly-rate::-webkit-inner-spin-button,
.task-edit-input-hourly-rate::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.task-edit-input-hourly-rate {
  -moz-appearance: textfield;
}

/* 5. Modal Footer */
.task-editor-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  margin-top: 6px;
  border-top: 1px solid var(--border-subtle, #e2e8f0);
}

.task-editor-footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Responsive adjustment for tablets & folds */
@media (max-width: 680px) {
  .money-title-content {
    flex-wrap: wrap;
  }
  .money-area-earnings {
    flex-wrap: wrap;
    gap: 8px;
  }
}


