﻿#todos-view { color: var(--text); background: var(--panel); }
.app:has(#todos-view.active) { height: 100dvh; min-height: 0; overflow: hidden; }
#todos-view.active { min-height: 0; overflow: hidden; }
.todo-workspace { display: flex; flex: 1; flex-direction: column; min-height: 0; min-width: 0; width: 100%; padding: 24px 24px calc(88px + env(safe-area-inset-bottom, 0px)); }
.todo-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
#todos-view h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.025em; }
.todo-heading p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
#todos-view button, #todos-view select { min-height: 36px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); font: inherit; font-size: 12px; box-shadow: none; letter-spacing: normal; }
#todos-view button { color: var(--blue); font-weight: 600; cursor: pointer; white-space: nowrap; }
#todos-view button:hover:not(:disabled) { background: var(--blue-soft); border-color: var(--blue); }
#todos-view button:disabled, #todos-view select:disabled { opacity: .45; cursor: default; }
#todos-view :focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
#todos-view #todo-zen[aria-pressed="true"] { background: var(--blue-soft); border-color: var(--blue); }
.todo-heading, .todo-list-heading, .todo-toolbar, #todo-status, #todo-form { flex-shrink: 0; }
.todo-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; font-size: 12px; font-weight: 600; color: var(--muted); }
#todos-view #todo-filter { background: var(--raised); }
.todo-toolbar { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0 16px; }
.todo-toolbar select { max-width: 100%; }
#todo-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 4px 12px 0; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.todo-column { min-width: 0; }
.todo-column h3 { margin: 8px 0 12px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.todo-card { --task-color: var(--muted); --task-tint: var(--raised); min-width: 0; margin-bottom: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: 0 3px 12px rgba(129, 34, 176, .04); }
.todo-card[data-state="queued"], .todo-card[data-state="needs_review"] { --task-color: #886124; --task-tint: var(--yellow-soft); }
.todo-card[data-state="running"], .todo-card[data-state="in_progress"] { --task-color: var(--blue); --task-tint: var(--blue-soft); }
.todo-card[data-state="done"] { --task-color: var(--green); --task-tint: var(--green-soft); }
.todo-card[data-state="paused"] { --task-color: var(--blue); --task-tint: var(--blue-soft); }
.todo-card[data-state="blocked"], .todo-card[data-state="failed"] { --task-color: var(--red); --task-tint: #fbeaea; }
.todo-project-label { margin: 0 0 9px; color: var(--muted); font-size: 11px; font-weight: 600; overflow-wrap: anywhere; }
.todo-content { display: flex; align-items: start; flex-wrap: wrap; gap: 10px; min-width: 0; }
.todo-content > p:first-child { flex: 1; min-width: 120px; margin: 0; font-size: 14px; font-weight: 600; line-height: 1.6; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.todo-content > p:not(:first-child), .todo-content > details { flex-basis: 100%; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.todo-badge { flex-shrink: 0; padding: 4px 9px; border-radius: 999px; background: var(--task-tint); color: var(--task-color); font-size: 10px; font-weight: 600; line-height: 1.5; }
.todo-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.todo-actions select { flex: 0 1 200px; min-width: 0; max-width: 100%; background: var(--raised) !important; }
.todo-actions .todo-backend { flex-basis: 110px; }
#todos-view .todo-delete { color: var(--red); }
#todos-view .todo-delete:hover { background: #fbeaea; border-color: var(--red); }
.todo-response { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 12px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo-details { margin-top: 12px; font-size: 12px; line-height: 1.6; }
.todo-details summary, .todo-content summary { cursor: pointer; color: var(--blue); }
.todo-details p { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); }
.todo-content textarea, .todo-details textarea { width: 100%; min-height: 90px; resize: vertical; padding: 12px; background: var(--raised); color: var(--text); border: 1px solid var(--line); border-radius: 10px; font: inherit; line-height: 1.6; }
.todo-details textarea { min-height: 230px; margin-bottom: 10px; }
.todo-empty { padding: 36px 20px; border: 1px dashed var(--line); border-radius: 16px; background: var(--raised); text-align: center; font-size: 13px; color: var(--muted); }
#todo-status { margin: 0; padding: 8px 0; font-size: 12px; color: var(--muted); }
#todo-status:empty { display: none; }
#todos-view #todo-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--raised); }
#todos-view #todo-form[hidden] { display: none; }
.todo-composer-toggle { flex-shrink: 0; display: flex; justify-content: flex-end; padding-top: 10px; border-top: 1px solid var(--line); }
#todos-view #todo-add-toggle { background: var(--blue-soft); color: var(--blue); }
#todo-message { flex: 1 0 100%; width: 100%; min-width: 0; min-height: 64px; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); font: inherit; font-size: 13px; line-height: 1.5; resize: vertical; max-height: 25dvh; }
#todo-message::placeholder { color: var(--muted); }
#todo-workspace { flex: 1; min-width: 0; max-width: 340px; }
#todo-backend { min-width: 0; max-width: 160px; }
#todos-view #todo-form button { margin-left: auto; min-height: 38px; padding-inline: 18px; color: #fff; border: 2px solid transparent; border-radius: 12px; background: linear-gradient(to top, #a62ce2, #c045fc) padding-box, linear-gradient(to top, #8122b0, #dc98fd) border-box; box-shadow: inset 0 1px 0 rgba(255,255,255,.24), var(--purple-glow); }
#todos-view #todo-form button:hover:not(:disabled) { box-shadow: inset 0 1px 0 rgba(255,255,255,.35), var(--purple-glow-hover); }
#todo-list.todo-board { display: flex; gap: 16px; overflow: auto; align-items: stretch; }
.todo-board .todo-column { flex: 0 0 320px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--raised); overflow-y: auto; }
.todo-board .todo-card { padding: 14px; }
.todo-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body.todo-zen .app > :not(#todos-view), body.todo-zen #voice-controls { display: none !important; }
body.todo-zen .app { display: block; width: 100%; max-width: none; height: 100dvh; margin: 0; padding: 0; }
body.todo-zen #todos-view { height: 100dvh; }
@media (max-width: 600px) {
  .todo-workspace { padding: 18px 14px calc(88px + env(safe-area-inset-bottom, 0px)); }
  .todo-heading { padding-bottom: 16px; }
  .todo-heading p { max-width: 28ch; font-size: 12px; }
  #todos-view button, #todos-view select { min-height: 40px; }
  .todo-toolbar { gap: 6px; }
  .todo-toolbar select { flex: 1 1 100px; min-width: 0; }
  .todo-card { padding: 14px; }
  .todo-actions select { flex: 1 1 130px; }
  .todo-actions .todo-backend { flex: 1 1 110px; }
  #todos-view #todo-form { padding: 12px; gap: 8px; }
  #todo-message { font-size: 16px; min-height: 56px; }
  #todo-workspace { flex: 1 1 100%; max-width: none; }
  .todo-board .todo-column { flex-basis: 85vw; }
}

/* Keep the task list primary; secondary controls open only when needed. */
.todo-heading-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.todo-filters { flex-shrink: 0; padding: 12px 0; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.todo-filters > summary { cursor: pointer; color: var(--muted); font-size: 12px; }
#todo-compose-dialog { width: min(560px, calc(100vw - 24px)); max-height: 85dvh; overflow-y: auto; padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
#todo-compose-dialog::backdrop { background: rgba(35, 20, 46, .4); }
.todo-dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#todos-view #todo-compose-dialog #todo-form { margin-top: 16px; }
