/* voice.css: Say tasks v2 (pm-talk.js) and the change summary (pm-proposal.js). Workstream A,
   docs/ux/a.md. Quiet Glass tokens only (quiet-glass.css): ink accent, status hues with words,
   44 px taps, 52 px primary buttons, sheets on phone. Loaded right after quiet-glass.css. */

/* ---- Say it: the sheet ---- */
dialog.panel.pm-talk { width: min(620px, calc(100vw - 32px)); }
.pm-talk-head h2 { font-family: inherit; font-weight: 500; letter-spacing: -0.03em; }
.pm-talk-mic { background: var(--primary); color: var(--on-primary); }
.pm-talk-mic.on { animation: pm-voice-ring 1.6s ease-out infinite; }
@keyframes pm-voice-ring { 0% { box-shadow: 0 0 0 0 var(--ring); } 100% { box-shadow: 0 0 0 22px transparent; } }
.pm-talk-text { min-height: 64px; }
.pm-talk-privacy { margin: 12px 2px 0; color: var(--muted); font-size: 13px; line-height: 1.4; }

/* ---- tiles: one per thing said; forming ones are lighter until the pause settles them ---- */
.pm-talk-list { gap: 8px; max-height: 46vh; }
.pm-talk-list li.pm-talk-tile { display: flex; align-items: flex-start; gap: 10px; padding: 10px 6px 10px 12px; border-radius: var(--r-row); background: var(--raised); box-shadow: inset 0 0 0 1px var(--glass-edge); animation: none; }
.pm-talk-list li.pm-talk-tile.new { animation: pm-voice-in 360ms var(--ease-calm) both; }
@keyframes pm-voice-in { 0% { opacity: 0; transform: translateY(6px) scale(0.98); box-shadow: inset 0 0 0 1px var(--glass-edge), 0 0 0 0 var(--ring); } 60% { opacity: 1; box-shadow: inset 0 0 0 1px var(--glass-edge), 0 0 0 6px var(--ring); } 100% { transform: none; box-shadow: inset 0 0 0 1px var(--glass-edge), 0 0 0 0 transparent; } }
.pm-talk-list li.pm-talk-tile.off { opacity: 0.45; }
.pm-talk-list li.pm-talk-tile.forming { align-items: center; min-height: 44px; background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.pm-talk-forming { font-size: var(--fs-item); line-height: 1.35; }
.pm-talk-n { flex: none; display: grid; place-items: center; width: 24px; height: 24px; margin-top: 10px; border-radius: 50%; background: var(--glass); color: var(--muted); font-size: 12px; font-weight: 600; }
.pm-talk-tile.forming .pm-talk-n { margin-top: 0; }
.pm-talk-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pm-talk-list input.pm-talk-title { width: 100%; height: 44px; padding: 0 8px; border-color: transparent; background: transparent; font-size: var(--fs-item); font-weight: 600; }
.pm-talk-list input.pm-talk-title:hover { border-color: var(--line); }
.pm-talk-list input.pm-talk-title:focus { border-color: var(--primary); background: var(--glass); }
.pm-talk-x { flex: none; width: 44px; height: 44px; }

/* ---- tap-to-fix chips: a set field reads as a quiet pill; an unset one is "+ Due" ---- */
.pm-talk-chips { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 4px; }
.pm-talk-chip, .pm-talk-tag, .pm-talk-opt { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--glass); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
/* 44 px tap area around the 32 px pill */
.pm-talk-chip, .pm-talk-tag { position: relative; }
.pm-talk-chip::after, .pm-talk-tag::after { content: ""; position: absolute; inset: -6px -2px; }
.pm-talk-chip.empty { border-style: dashed; background: transparent; color: var(--muted); font-weight: 500; }
.pm-talk-chip.k-branch:not(.empty)::before, .pm-talk-opt.dot::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--muted)); }
.pm-talk-chip.who { border-style: dashed; border-color: var(--amber); background: var(--amber-soft); color: var(--amber); }
.pm-talk-chip.open, .pm-talk-opt.on { border-color: var(--primary); background: var(--primary); color: var(--on-primary); }
.pm-talk-tag { margin-left: 0; }
.pm-talk-tag.personal { border-color: transparent; background: var(--primary); color: var(--on-primary); }
.pm-talk-chip:focus-visible, .pm-talk-tag:focus-visible, .pm-talk-opt:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---- the picker under a chip ---- */
.pm-talk-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 2px; padding: 10px; border-radius: var(--r-md); background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); }
.pm-talk-opt { min-height: 44px; padding: 0 14px; font-weight: 500; }
.pm-talk-pick input.pm-talk-date, .pm-talk-pick select.pm-talk-branch { height: 44px; padding: 0 10px; font-size: 15px; max-width: 100%; }
.pm-talk-ask { width: 100%; font-weight: 600; }
.pm-talk-none { color: var(--muted); font-size: 14px; }

/* ---- the change summary sheet ---- */
dialog.panel.pm-proposal { width: min(520px, calc(100vw - 32px)); padding: 22px 24px 24px; border: 0; border-radius: var(--r-sheet); }
dialog.panel.pm-proposal[open] { display: flex; flex-direction: column; }
.pm-proposal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pm-proposal-head h2 { margin: 0; font-size: 1.8125rem; line-height: 1.17; font-weight: 500; letter-spacing: -0.03em; }
.pm-proposal-x { width: 44px; height: 44px; flex: none; }
.pm-proposal-sum { margin: 6px 0 14px; color: var(--muted); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.pm-proposal-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; max-height: 52vh; overflow-y: auto; }
.pm-proposal-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 12px; border-radius: var(--r-row); background: var(--raised); box-shadow: inset 0 0 0 1px var(--glass-edge); animation: pm-voice-in 320ms var(--ease-calm) both; animation-delay: calc(var(--i, 0) * 40ms); }
.pm-proposal-ic { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--glass); color: var(--text); }
.pm-proposal-ic svg { width: 16px; height: 16px; }
.pm-proposal-row.k-add .pm-proposal-ic { background: var(--primary); color: var(--on-primary); }
.pm-proposal-row.k-remove .pm-proposal-ic { color: var(--danger); }
.pm-proposal-words { display: flex; flex-direction: column; min-width: 0; }
.pm-proposal-words b { font-size: var(--fs-item); font-weight: 600; overflow-wrap: anywhere; }
.pm-proposal-words small { color: var(--muted); font-size: 14px; }
.pm-proposal-err { margin: 10px 0 0; color: var(--danger); font-size: 14px; }
.pm-proposal-err:empty { display: none; }
.pm-proposal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.pm-proposal-foot .btn.primary { min-width: 140px; }
.pm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---- Simple view: no empty Project / Person chips (a "Who?" still shows) ---- */
:root[data-view="simple"] .pm-talk-chip.empty:is(.k-project, .k-who) { display: none; }

/* ---- phone: both are bottom sheets; the buttons fill the width in thumb reach ---- */
@media (max-width: 760px) {
  dialog.panel.pm-talk { width: 100%; }
  .pm-talk-list { max-height: none; }
  dialog.panel.pm-proposal { width: 100%; max-width: none; margin: auto 0 0; padding: 18px 16px calc(24px + env(safe-area-inset-bottom, 0px)); border-radius: var(--r-sheet) var(--r-sheet) 0 0; max-height: 90dvh; }
  .pm-proposal-head::before { content: ""; position: absolute; top: 8px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: var(--line); }
  .pm-proposal-list { max-height: none; flex: 1 1 auto; }
  .pm-proposal-foot { margin-top: auto; padding-top: 16px; }
  .pm-proposal-foot .btn { flex: 1; height: var(--btn-h-lg); }
  .pm-talk-chips { gap: 8px; }
  /* older phone rules make these 40 px: pills stay 32 with a 44 px tap area; icon buttons are 44 */
  .pm-talk-chips :is(.pm-talk-chip, .pm-talk-tag) { height: 32px; min-height: 32px; padding: 0 12px; }
  .pm-talk-chips :is(.pm-talk-chip, .pm-talk-tag)::after { inset: -6px -4px; }
  dialog.panel:is(.pm-talk, .pm-proposal) .icon-btn { width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .pm-talk-list li.pm-talk-tile.new, .pm-proposal-row, .pm-talk-mic.on { animation: none; }
}
