/* project-todos.css — styles for the redesigned Project Todos panel.
   Drop-in companion to project-todos.jsx. Load AFTER app.css so it can use the
   design-system tokens (--primary, --ink, --line, --pos, --mono, --surface…).
   Everything is namespaced under `.ptd` / `ptd-` so it never collides with the
   existing `.todo-*` rules in app.css. Reuses app.css primitives where possible
   (.btn, .icon-btn, .segmented, .drawer, .overlay, .field, .inp). */

.ptd { display: grid; gap: 8px; }

/* ---------------- group-by toggle (panel header) ---------------- */
.ptd-groupby { display: inline-flex; align-items: center; gap: 7px; }
.ptd-groupby .ptd-gl { font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 700; }
.ptd-groupby .segmented button { display: inline-flex; align-items: center; white-space: nowrap; }
.ptd-header-actions { flex-wrap: nowrap; }
.ptd-header-actions .btn { white-space: nowrap; }
.ptd-glyph { width: 8px; height: 8px; display: inline-block; flex: none; background: currentColor; border-radius: 2px; }
.ptd-glyph.dia { transform: rotate(45deg); border-radius: 1.5px; }

/* ---------------- group section ---------------- */
.ptd-group { display: grid; gap: 2px; }
.ptd-ghead { display: flex; align-items: center; gap: 10px; padding: 8px 8px 7px; border-radius: 7px; cursor: pointer; user-select: none; }
.ptd-ghead:hover { background: var(--surface-2); }
.ptd-chev { color: var(--faint); transition: transform .15s ease; flex: none; }
.ptd-chev.open { transform: rotate(90deg); }
.ptd-gname { font-size: 12px; font-weight: 700; color: var(--ink); letter-spacing: -.005em; }
.ptd-gname.ghosted { color: var(--muted); font-weight: 600; }
.ptd-gcount { font-family: var(--mono); font-size: 10.5px; font-weight: 600; color: var(--muted); background: var(--surface-3); border-radius: 20px; padding: 1px 7px; }
.ptd-gbar { width: 56px; height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; flex: none; }
.ptd-gbar > span { display: block; height: 100%; background: var(--pos); border-radius: 3px; transition: width .3s; }
.ptd-gspace { flex: 1; }
.ptd-gtools { display: inline-flex; align-items: center; gap: 1px; opacity: 0; transition: opacity .12s; }
.ptd-ghead:hover .ptd-gtools { opacity: 1; }
.ptd-rename { display: inline-flex; align-items: center; }

/* ---------------- the two-line card ---------------- */
.ptd-card { border: 1px solid var(--line); border-radius: 9px; background: var(--surface); padding: 10px 12px; display: grid; gap: 8px; cursor: pointer; transition: border-color .12s, box-shadow .12s, background .12s; }
.ptd-card:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.ptd-card:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.ptd-card.done { background: var(--surface-2); }
.ptd-card-top { display: flex; align-items: flex-start; gap: 12px; }
.ptd-ttl { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.35; letter-spacing: -.01em; }
.ptd-card.done .ptd-ttl { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-2); }
.ptd-card-top .ptd-status { flex: none; margin-top: 1px; }
.ptd-card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; min-height: 20px; overflow: hidden; }
.ptd-vsep { width: 1px; height: 13px; background: var(--line); margin: 0 1px; flex: none; }
.ptd-note { display: inline-flex; align-items: center; gap: 5px; height: 20px; min-width: 0; padding: 0 7px; border-radius: 5px; font-size: 11px; color: var(--muted); background: var(--surface-3); border: 1px solid var(--line); max-width: min(240px, 100%); }
.ptd-note svg { flex: none; opacity: .7; }
.ptd-note span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* add rows / empties */
.ptd-add { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; cursor: pointer; font: inherit; color: var(--faint); font-size: 12px; font-weight: 500; padding: 7px 10px; border-radius: 6px; text-align: left; white-space: nowrap; }
.ptd-add:hover { background: var(--surface-2); color: var(--primary-strong); }
.ptd-add svg { flex: none; }
.ptd-empty { font-size: 12px; color: var(--faint); padding: 4px 10px 8px; }
.ptd-cards { display: grid; gap: 6px; padding: 2px 2px 4px; }

/* ---------------- status pill ---------------- */
.ptd-status { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .005em; white-space: nowrap; border: 1px solid; cursor: pointer; user-select: none; transition: box-shadow .12s, filter .12s; }
.ptd-status:hover { box-shadow: 0 0 0 3px rgba(40,86,196,.10); filter: saturate(1.05); }
.ptd-status .ptd-sdot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.ptd-status .ptd-scar { opacity: .5; margin-left: -1px; }
.ptd-status.sm { height: 20px; font-size: 10.5px; padding: 0 7px; }

/* ---------------- quiet secondary chips ---------------- */
.ptd-qchip { display: inline-flex; align-items: center; gap: 5px; height: 21px; min-width: 0; max-width: min(190px, 100%); padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 500; color: var(--muted); background: transparent; border: 1px solid transparent; cursor: pointer; white-space: nowrap; transition: background .1s, border-color .1s, color .1s; font-family: var(--font); }
.ptd-qchip:hover { background: var(--surface-3); border-color: var(--line); color: var(--ink-2); }
.ptd-qchip svg { flex: none; opacity: .75; }
.ptd-qchip .ptd-qtxt { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ptd-qchip.empty { color: var(--faint); }
.ptd-qg { width: 9px; height: 9px; flex: none; display: inline-block; background: var(--muted); border-radius: 2px; }
.ptd-qg.dia { transform: rotate(45deg); border-radius: 1.5px; background: var(--primary); }
.ptd-qg.dia.empty { background: var(--faint); }

/* ---------------- inline title editor ---------------- */
.ptd-ti { border: 0; background: transparent; font: inherit; color: inherit; width: 100%; padding: 2px 5px; margin: -2px -5px; border-radius: 6px; cursor: text; outline: none; }
.ptd-ti:focus { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--primary), 0 0 0 3px var(--primary-soft); }
.ptd-titext { display: inline-block; border-radius: 6px; padding: 2px 5px; margin: -2px -5px; cursor: text; }
.ptd-titext:hover { background: var(--primary-tint); box-shadow: inset 0 0 0 1px var(--line); }
.ptd-titext .ptd-faint { color: var(--faint); font-weight: 500; }

/* ---------------- popover pickers (portal into <body>) ---------------- */
.ptd-pop { position: fixed; z-index: 90; min-width: 188px; max-height: 320px; overflow: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 9px; box-shadow: var(--shadow-md); padding: 5px; animation: ptd-pop-in .12s ease; }
@keyframes ptd-pop-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.ptd-pl { font-size: 9.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); font-weight: 700; padding: 5px 8px 4px; }
.ptd-pi { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: transparent; cursor: pointer; font: inherit; font-size: 12.5px; color: var(--ink-2); padding: 7px 8px; border-radius: 6px; text-align: left; }
.ptd-pi:hover { background: var(--surface-3); }
.ptd-pi.on { color: var(--ink); font-weight: 600; }
.ptd-pi .ptd-pdot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.ptd-pi .ptd-pg { width: 9px; height: 9px; flex: none; background: var(--faint); border-radius: 2px; }
.ptd-pi .ptd-pg.dia { transform: rotate(45deg); border-radius: 1.5px; }
.ptd-pi .ptd-pcheck { margin-left: auto; color: var(--primary); opacity: 0; flex: none; }
.ptd-pi.on .ptd-pcheck { opacity: 1; }
.ptd-psep { height: 1px; background: var(--line); margin: 4px 2px; }
