/* STHP v1.1.0 — To Do: variable-height shared whiteboard, D1 only. */
.sidebar .nav-item[data-tool=todo]{position:relative}
.sidebar .todo-attention-dot{position:absolute;right:8px;top:6px;
 width:7px;height:7px;border-radius:50%;background:var(--orange);
 box-shadow:0 0 0 3px color-mix(in srgb,var(--orange) 16%,transparent)}
.todo-stage{height:100%;min-width:0;overflow-y:auto;padding:clamp(12px,2vw,25px);
 background:var(--bg)}
.todo-header{display:flex;justify-content:space-between;align-items:center;
 gap:15px;flex-wrap:wrap;padding:15px 18px;background:var(--card);
 border:1px solid var(--line);border-radius:15px}
.todo-header h2{font-size:23px;margin:0}.todo-header p{color:var(--muted);
 font-size:12px;margin:3px 0 0;max-width:570px}
.todo-heading-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.todo-counter{color:var(--muted);font-size:12px;font-weight:730}
.todo-board{margin:18px 0 20px;columns:3 245px;column-gap:15px}
.todo-note{break-inside:avoid;display:inline-block;vertical-align:top;
 width:100%;min-width:0;margin:0 0 15px;padding:16px 16px 13px;border-radius:3px 15px 12px 12px;
 background:var(--todo-paper);border:1px solid var(--todo-edge);
 color:var(--todo-ink);box-shadow:2px 6px 13px #00000015;
 --todo-paper:#ffe7a7;--todo-edge:#e0c47e;--todo-ink:#423522}
.todo-note:nth-child(5n+2){--todo-paper:#dfedd5;--todo-edge:#adcfaa;--todo-ink:#244331}
.todo-note:nth-child(5n+3){--todo-paper:#ffdce6;--todo-edge:#ecbbc8;--todo-ink:#553044}
.todo-note:nth-child(5n+4){--todo-paper:#dcebf8;--todo-edge:#b3ccdf;--todo-ink:#2b465b}
.todo-note:nth-child(5n){--todo-paper:#eddef9;--todo-edge:#cbb8e2;--todo-ink:#43354f}
.todo-note-heading{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;
 gap:7px;margin-bottom:10px;font-size:13px}
.todo-note-assignee{font-weight:860;overflow-wrap:anywhere}
.todo-urgency{font-size:10px;font-weight:820;letter-spacing:.02em;color:#782e12;
 border:1px solid #d5a179;background:#fff9e4;padding:3px 7px;border-radius:12px}
.todo-note-body{font-size:14px;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.5;
 margin:0 0 14px;min-height:26px}
.todo-note-deadline,.todo-note-resolver{font-size:10px;color:color-mix(in srgb,var(--todo-ink) 78%,transparent);
 font-weight:730}
.todo-note-resolver{margin-top:6px}
.todo-note-actions{display:flex;flex-wrap:wrap;gap:7px;margin-top:13px}
.todo-note-actions .quiet-action,.todo-note-actions .action-primary{font-size:11px;
 padding:6px 10px;background:#ffffff55;border-color:#00000022;color:var(--todo-ink)}
.todo-note-actions .action-primary{background:#224a35;color:white;border-color:#224a35}
.todo-note-actions .todo-danger{color:#89342d}
.todo-empty{color:var(--muted);font-size:13px;break-inside:avoid;display:inline-block;margin:10px}
.todo-archive{border:1px solid var(--line);border-radius:13px;background:var(--card);padding:13px 16px;margin-bottom:16px}
.todo-archive summary{font-weight:770;cursor:pointer}
.todo-archive-list{columns:3 245px;column-gap:15px;margin-top:15px}
.todo-archive-list .todo-note{opacity:.87}
.todo-message{margin:13px 0 0;min-height:22px;font-size:12px;color:var(--muted)}
.todo-dialog{color:var(--ink);background:var(--card);border:1px solid var(--line);
 box-shadow:0 26px 70px #0008;border-radius:17px;padding:25px;width:min(94vw,490px);
 max-height:88dvh;overflow-y:auto}
.todo-dialog::backdrop{background:#0008}
.todo-dialog h3{margin:0 0 14px;font-size:21px}
.todo-dialog label{display:block;font-size:12px;font-weight:800;margin:12px 0 5px}
.todo-dialog input,.todo-dialog select,.todo-dialog textarea{
 display:block;width:100%;border:1px solid var(--line);border-radius:8px;
 padding:9px 11px;color:var(--ink);background:var(--bg);font:inherit}
.todo-dialog textarea{resize:vertical;min-height:95px;white-space:pre-wrap}
.todo-date-row{display:grid;grid-template-columns:1fr 80px 80px;gap:8px}
.todo-date-row>div{min-width:0}
.todo-dialog .todo-date-row label{font-size:10px}
.todo-dialog .todo-date-row select{padding:9px 5px}
.todo-form-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;
 gap:9px;margin-top:21px}
.todo-form-note{font-size:11px;color:var(--muted);margin:9px 0 0}
@media(max-width:550px){.todo-stage{padding:9px}.todo-header{padding:13px}
 .todo-board,.todo-archive-list{columns:1}.todo-dialog{padding:16px}
 .todo-note{padding:14px}.todo-header h2{font-size:20px}}


/* Assigned-to multi-select is entirely local and touch-friendly. */
.todo-filterbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;
 margin:13px 0 0;min-height:34px}
.todo-assignee-filter{position:relative;max-width:100%;z-index:2}
.todo-assignee-filter summary{cursor:pointer;list-style-position:inside;
 padding:8px 12px;background:var(--card);border:1px solid var(--line);
 border-radius:9px;font-size:12px;font-weight:780;color:var(--ink);
 min-width:155px;max-width:100%;overflow-wrap:anywhere}
.todo-assignee-filter[open] summary{border-radius:9px 9px 0 0}
.todo-filter-panel{position:absolute;top:100%;left:0;width:min(310px,calc(100vw - 28px));
 max-height:min(420px,65dvh);overflow-y:auto;background:var(--card);
 border:1px solid var(--line);box-shadow:0 10px 28px #0003;
 padding:11px;border-radius:0 9px 9px 9px}
.todo-filter-panel p{margin:0 0 9px;color:var(--muted);font-size:11px;line-height:1.4}
.todo-filter-choices{display:grid;grid-template-columns:1fr;gap:3px}
.todo-filter-choice{display:flex;align-items:center;gap:11px;cursor:pointer;
 border-radius:8px;padding:7px 9px;min-height:38px;font-size:13px;
 color:var(--ink);overflow-wrap:anywhere}
.todo-filter-choice:hover,.todo-filter-choice:focus-within{
 background:color-mix(in srgb,var(--orange) 11%,transparent)}
.todo-filter-choice input{width:17px;height:17px;flex:0 0 17px;
 accent-color:var(--orange);margin:0}
.todo-filter-panel .quiet-action{margin-top:9px;width:100%;font-size:12px}
.todo-filter-result{font-size:12px;color:var(--muted);font-weight:700}
@media(max-width:550px){.todo-filterbar{margin-top:10px}
 .todo-filter-panel{width:min(310px,calc(100vw - 18px))}}

/* Visible editor-level CAS feedback; preserved multiline inputs are never erased on conflict. */
.todo-form-error{font-size:12px;color:#f29c90;min-height:0;margin:10px 0 0}
:root[data-theme=light] .todo-form-error{color:#a83221}
.todo-form-error:empty{display:none}

/* StenTeam common worksheet/tool chrome: compact header, actions grouped.
 * Responsive notecards are content-width capped, not fixed three giant columns. */
.todo-stage{padding:9px 14px 20px}
.todo-stage .todo-header{display:flex;align-items:center;gap:12px;
 min-height:54px;padding:8px 12px;margin:0;border-radius:11px;flex-wrap:wrap}
.todo-head-identity{display:flex;align-items:baseline;gap:8px;min-width:0;flex:1 1 145px}
.todo-head-identity h2{font-size:20px;white-space:nowrap}
.todo-head-identity .eyebrow{font-size:10px;margin:0;color:var(--muted)}
.todo-heading-actions{gap:7px;margin-left:auto;justify-content:flex-end}
.todo-heading-actions .quiet-action,.todo-heading-actions .action-primary{font-size:11px;padding:7px 10px}
.todo-filterbar{margin:0;min-height:0;gap:6px}
.todo-assignee-filter summary{min-width:0;max-width:230px;padding:7px 10px;
 white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
.todo-assignee-filter summary::before{content:'⌕';margin-right:7px;color:var(--orange);font-weight:900}
.todo-filter-result{font-size:10px}
.todo-board,.todo-archive-list{display:flex;flex-wrap:wrap;align-items:flex-start;
 gap:12px;columns:auto;margin:12px 0 16px}
.todo-note,.todo-archive-list .todo-note{box-sizing:border-box;display:flex;
 flex-direction:column;flex:0 1 auto;width:max-content;min-width:220px;
 max-width:min(410px,100%);margin:0;padding:13px 14px 12px}
.todo-note-body{max-width:100%;min-height:0;margin:0 0 11px}
.todo-note-actions{margin-top:12px}
.todo-archive{margin-top:12px}
.todo-archive:not([open]){display:none}
.todo-archive>summary{position:absolute;width:1px;height:1px;padding:0;
 margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.todo-message{margin:6px 0 0;min-height:0}
.todo-message:empty{display:none}
@media(max-width:700px){
 .todo-stage{padding:7px}
 .todo-stage .todo-header{padding:9px}
 .todo-head-identity{flex-basis:100%}
 .todo-heading-actions{width:100%;justify-content:flex-start;margin:0;gap:6px}
 .todo-board,.todo-archive-list{gap:9px}
 .todo-note{max-width:100%;min-width:min(220px,100%)}
}

/* STAC-inspired StenTeam tool heading; controls are in the same header bar. */
.todo-stage{padding:0 12px 20px}
.todo-stage .todo-header{min-height:88px;padding:12px 12px 11px;
 border:0;border-bottom:1px solid var(--line);border-radius:0;
 background:var(--card)}
.todo-head-identity{display:flex;flex-direction:column;align-items:flex-start;
 flex:1 1 160px;gap:4px}
.todo-head-identity .eyebrow{font-size:10px;font-weight:830;
 letter-spacing:.11em;color:var(--orange,#ff5733)}
.todo-head-identity h2{font-size:22px;line-height:1.05;font-weight:880;margin:0}
.todo-head-identity h2 span{color:var(--muted);font-size:14px;font-weight:650}
@media(max-width:700px){.todo-stage{padding:0 6px 14px}
 .todo-stage .todo-header{padding:10px 7px}}

/* Match one common 76px StenTeam header, no detached left margin. */
.todo-stage{padding:0 0 20px!important}
.todo-stage .todo-header{box-sizing:border-box;min-height:76px;height:76px;
 border:0;border-bottom:1px solid var(--line);border-radius:0;
 margin:0;background:var(--card);padding:9px 22px;gap:9px}
.todo-head-identity{gap:3px}
.todo-head-identity .eyebrow{font-size:10px;letter-spacing:.09em}
.todo-head-identity h2{font-size:20px;line-height:1.15}
.todo-head-identity h2 span{font-size:13px}
@media(max-width:1000px){
 .todo-stage .todo-header{height:auto;min-height:76px}
}
@media(max-width:560px){
 .todo-stage .todo-header{padding:9px 12px}
}


/* Shared StenTeam body gutter: rail-flush title, naturally inset notecards.
 * Preserve the content-width-aware flex packing and no extra data queries. */
.todo-stage > :not(.todo-header):not(dialog){
 margin-left:clamp(16px,1.5vw,26px);
 margin-right:clamp(16px,1.5vw,26px);
}
@media(max-width:560px){
 .todo-stage > :not(.todo-header):not(dialog){
  margin-left:12px;margin-right:12px;
 }
}
