/* D2 · dictation + a working section that folds. Loads after a.css and d.css; only the changes.
   - Mic sits next to send. Recording turns the card's button row into one recording strip
     (cancel · level meter · time · done). Done transcribes into the draft; it never sends by itself.
   - While a run works, only the newest three steps stay open; older ones fold into one line.
     A finished run folds to "Worked for 1m 12s · Read 6 files, made 4 edits…". */

/* ---- card grid: + · · · mic [After this run] send, with a recording row above it ---- */
.composer { grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  grid-template-areas: "banner banner banner banner banner" "attach attach attach attach attach" "queue queue queue queue queue" "input input input input input" "rec rec rec rec rec" "plus . mic later send" "meta meta meta meta meta" "hint hint hint hint hint"; }
.card-bg { grid-area: 1 / 1 / 7 / -1; }

.c-mic { grid-area: mic; align-self: end; width: 44px; height: 44px; margin: 0 2px 6px 0; display: grid; place-items: center; border: 0; background: transparent; color: var(--mid); border-radius: 12px; }
.c-mic:hover:not(:disabled) { background: var(--card-2); color: var(--ink); }
.c-mic:disabled { opacity: .4; }

.c-rec { grid-area: rec; display: none; align-items: center; gap: 8px; padding: 6px 8px 8px; }
.c-rec.on { display: flex; }
.r-cancel { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: 0; background: transparent; color: var(--dim); border-radius: 12px; }
.r-cancel:hover { background: var(--card-2); color: var(--ink); }
.r-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); flex: none; animation: dot 1.1s infinite; }
.wave { flex: 1; min-width: 0; height: 30px; display: flex; align-items: center; justify-content: space-between; gap: 2px; overflow: hidden; }
.wave i { flex: 0 0 3px; height: 100%; border-radius: 2px; background: var(--clay); transform: scaleY(.15); transition: transform .1s linear; }
.r-time { font: 500 13px var(--mono); color: var(--mid); font-variant-numeric: tabular-nums; flex: none; min-width: 36px; text-align: right; }
.r-done { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border: 0; border-radius: 12px; background: var(--clay); color: var(--clay-ink); margin-left: 2px; }
.r-done svg { width: 18px; height: 18px; }
.r-shimmer { flex: 1; min-width: 0; padding-left: 12px; font-size: 14px; color: var(--dim);
  background: linear-gradient(90deg, var(--dim) 0%, var(--ink) 50%, var(--dim) 100%) 0 0 / 200% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* recording: the strip replaces the button row; an empty input steps aside */
.composer.recording .c-plus, .composer.recording .c-mic, .composer.recording .c-later, .composer.recording .c-send { display: none; }
.composer.recording:not(.has-draft) .c-input, .composer.transcribing:not(.has-draft) .c-input { display: none; }
.composer.recording .c-input { color: var(--dim); }
.composer.recording .card-bg { border-color: rgba(255,107,107,.35); }
.composer.transcribing .c-mic { color: var(--clay); }
.composer.fresh .card-bg { animation: fresh 1.6s ease-out; }
@keyframes fresh { 0% { border-color: var(--clay); box-shadow: 0 0 0 4px var(--clay-wash), 0 8px 28px -14px rgba(0,0,0,.6); } }

/* ---- the working section ---- */
.msg.turn { display: flex; flex-direction: column; }
.w-head { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--dim); font: 13px var(--sans); text-align: left; width: 100%; min-width: 0; }
.w-head:hover { color: var(--mid); }
.w-h { flex: none; }
.w-sum, .w-now { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dimmer); }
.w-now { color: var(--mid); }
.w-now .w-a { margin-left: 4px; }
.w-chev { margin-left: auto; color: var(--dimmer); display: grid; transition: transform .2s; flex: none; }
.turn.open .w-chev { transform: rotate(90deg); }
.w-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--clay); flex: none; box-shadow: 0 0 0 0 var(--clay-wash); animation: ping 1.4s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(122,162,255,.45); } 100% { box-shadow: 0 0 0 8px rgba(122,162,255,0); } }

.w-list { list-style: none; margin: 4px 0 0; padding: 0; }
.w-step { display: flex; align-items: center; gap: 10px; min-height: 30px; font-size: 13px; color: var(--dim); min-width: 0; animation: stepin .3s cubic-bezier(.2,.8,.2,1); }
@keyframes stepin { from { opacity: 0; transform: translateY(4px); } }
.w-g { width: 16px; display: grid; place-items: center; color: var(--dimmer); flex: none; }
.w-l { flex: none; }
.w-a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 12px var(--mono); color: var(--dimmer); }
.w-step.live { color: var(--ink); }
.w-step.live .w-g { color: var(--clay); }
.w-step.live .w-a { color: var(--dim); }
.w-earlier { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 32px; padding: 0; border: 0; background: transparent; color: var(--dimmer); font: 12.5px var(--sans); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-earlier::before { content: '⋯'; width: 16px; text-align: center; flex: none; color: var(--dimmer); }
.w-earlier:hover { color: var(--mid); }
.w-answer { margin-top: 12px; }
.turn.done:not(.open) .w-answer { margin-top: 10px; }
