/* Today's tasks (day-tasks-ui.js): the status-bar button, the panel (a bottom sheet on a phone), the picker beside
   Start and the question when a Focus phase ends. Glass and tokens come from room-hud.css and the page. */

.todo-pick { min-width: 0; max-width: 170px; min-height: 34px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--ink); font: inherit; font-size: 12.5px; cursor: pointer; text-overflow: ellipsis; }
.todo-pick[hidden] { display: none; }

.todo-dim { position: fixed; z-index: 21; inset: 0; background: #14110d59; }
.todo-dim[hidden], .todo-panel[hidden], .todo-ask[hidden] { display: none; }
.todo-panel { position: fixed; z-index: 22; left: 50%; bottom: calc(var(--bottom-hud, 0px) + 2 * var(--gap)); transform: translateX(-50%); display: flex; flex-direction: column; width: min(400px, calc(100vw - 2 * var(--gap))); max-height: min(560px, calc(100dvh - var(--bar, 50px) - var(--bottom-hud, 0px) - 4 * var(--gap))); overflow: hidden; color: var(--ink); }
.todo-panel .grab { display: none; }
.todo-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 10px 8px 16px; border-bottom: 1px solid var(--hud-line); }
.todo-head b { flex: 1; font-size: 14px; }
.todo-form { flex: none; display: flex; gap: 8px; padding: 10px 12px 4px; }
.todo-input { flex: 1; min-width: 0; min-height: 38px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); font: inherit; font-size: 14px; }
.todo-input:focus-visible, .todo-check input:focus-visible + .todo-mark, .todo-del:focus-visible, .todo-pick:focus-visible { outline: 2px solid var(--tool); outline-offset: 2px; }
.todo-form .btn { min-height: 38px; }
.todo-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 8px 6px; }
.todo-note { margin: 4px 4px 2px; padding: 6px 9px; border-radius: 9px; font-size: 12.5px; color: var(--hud-muted); }
.todo-note:not(:empty):not([hidden]) { background: color-mix(in srgb, var(--p-break) 13%, var(--panel)); color: var(--ink); }
.todo-list { margin: 0; padding: 0; list-style: none; }
.todo-item { display: flex; align-items: center; gap: 6px; padding: 2px 4px 2px 2px; border-radius: 9px; }
.todo-item:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.todo-check { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 10px; min-height: 36px; padding: 7px 6px; cursor: pointer; }
.todo-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.todo-mark { flex: none; display: grid; place-items: center; width: 20px; height: 20px; margin-top: 1px; border: 1.8px solid var(--faint); border-radius: 6px; background: var(--panel); }
.todo-mark svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.todo-check input:checked + .todo-mark { border-color: var(--done); background: var(--done); }
.todo-check input:checked + .todo-mark svg { opacity: 1; }
.todo-text { min-width: 0; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.todo-item.done .todo-text { color: var(--hud-muted); text-decoration: line-through; }
.todo-tag { flex: none; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.todo-tag.old { background: color-mix(in srgb, var(--p-break) 18%, var(--panel)); color: color-mix(in srgb, var(--p-break) 45%, var(--ink)); }
.todo-tag.doing { background: color-mix(in srgb, var(--p-focus) 18%, var(--panel)); color: color-mix(in srgb, var(--p-focus) 50%, var(--ink)); }
.todo-del { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--hud-muted); cursor: pointer; opacity: .55; }
.todo-item:hover .todo-del, .todo-del:focus-visible { opacity: 1; }
.todo-del:hover { background: color-mix(in srgb, var(--ink) 9%, transparent); color: var(--ink); }
.todo-empty { margin: 14px 8px; color: var(--hud-muted); font-size: 13px; }
.todo-empty[hidden] { display: none; }
.todo-private { flex: none; margin: 0; padding: 7px 16px 11px; border-top: 1px solid var(--hud-line); color: var(--hud-muted); font-size: 12px; }

/* The question when a Focus phase ends: above the status bar, or the first thing in the open panel. */
.todo-ask { position: fixed; z-index: 23; left: 50%; bottom: calc(var(--bottom-hud, 0px) + 2 * var(--gap)); transform: translateX(-50%); display: flex; align-items: center; gap: 14px; width: min(440px, calc(100vw - 2 * var(--gap))); padding: 10px 12px 10px 16px; color: var(--ink); background: color-mix(in srgb, var(--accent) 16%, var(--hud)); border-color: color-mix(in srgb, var(--accent) 55%, var(--hud-line)); }
.todo-ask-words { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.todo-ask-q { font-size: 14px; }
.todo-ask-text { font-size: 12.5px; color: var(--hud-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-ask-btns { flex: none; display: flex; gap: 8px; }
.todo-ask .btn { min-height: 36px; padding: 5px 14px; font-size: 13.5px; }
.todo-panel .todo-ask { position: static; z-index: auto; transform: none; width: auto; margin: 10px 12px 2px; border-radius: 12px; box-shadow: none; }
body.todo-asking:not(.todo-open) .notify-prompt { bottom: calc(var(--bottom-hud, 0px) + 2 * var(--gap) + 52px + 70px); }
body.todo-asking:not(.todo-open) .toast { bottom: calc(var(--bottom-hud, 0px) + 2 * var(--gap) + 74px); }

@media (max-width: 760px) {
  .todo-panel { left: 0; right: 0; bottom: 0; transform: none; width: auto; max-height: calc(100dvh - var(--bar, 50px) - 2 * var(--gap)); border-bottom: 0; border-radius: 18px 18px 0 0; }
  .todo-panel .grab { display: block; flex: none; width: 38px; height: 4px; margin: 8px auto 0; border-radius: 4px; background: var(--faint); opacity: .6; }
  .todo-input { font-size: 16px; }
  .todo-private { padding-bottom: calc(11px + env(safe-area-inset-bottom)); }
  .todo-pick { flex: 1 1 120px; max-width: none; }
  .todo-ask { left: var(--gap); right: var(--gap); transform: none; width: auto; }
  .todo-del { opacity: 1; }
}
body.pip .todo-btn, body.pip .todo-panel, body.pip .todo-dim, body.pip .todo-ask,
body.record .todo-btn, body.record .todo-panel, body.record .todo-dim, body.record .todo-ask { display: none !important; }
