/* ==========================================================================
   How We Work (/how-we-work, owner, Nov 22, 2026). Built on the Home system
   (home.css) and the comparison frames (compare.css: .vs-tbl, .vs-big).
   This file adds the approval frame: a fix waits in your dashboard, Approve
   presses once, the status chip flips to Approved and the chain lights step
   by step: Staging, Re-audit, Live, Checked again. Plays once when the frame
   enters view ([data-draw] → .is-in); reduced motion shows the end state.
   ========================================================================== */
.hw-ok { overflow: hidden; }
.hw-ok .frame-bar .muted { color: var(--muted); }
/* Both chips share one cell; the group takes the rest of the bar and sets
   them flush right, so the hidden, wider chip leaves no gap (owner, Nov 22). */
.hw-stat { position: relative; display: inline-grid; justify-items: end; flex: 1 0 auto; }
.hw-stat > * { grid-area: 1 / 1; }
.hw-fix { padding: 20px 22px 18px; }
.hw-fix-t { font-size: 1.0625rem; font-weight: 500; letter-spacing: -.01em; }
.hw-fix-s { margin-top: 4px; font-size: .8125rem; color: var(--muted); }
.hw-ev { margin-top: 16px; border-top: 1px solid var(--rule); }
.hw-ev > div { display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr); gap: 4px 16px; padding: 11px 0; border-bottom: 1px solid var(--rule); font-size: .875rem; line-height: 1.5; }
.hw-ev dt { color: var(--muted); }
.hw-ev dd { color: var(--ink); }
.hw-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.hw-acts .ui-btn { padding: 7px 14px; font-size: .8125rem; }
.hw-chain { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 16px 22px 20px; border-top: 1px solid var(--rule); }
.hw-chain li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: .75rem; color: var(--muted); text-align: center; }
.hw-chain li + li::before { content: ""; position: absolute; top: 5px; right: 50%; width: 100%; height: 1px; background: var(--rule-strong); }
.hw-chain i { position: relative; z-index: 1; width: 11px; height: 11px; border-radius: 50%; background: #0E1418; border: 1px solid var(--rule-strong); }

/* The approval plays once in view. */
[data-draw].hw-ok .hw-yes { transition: transform 160ms var(--ease), box-shadow 160ms var(--ease); }
[data-draw].hw-ok.is-in .hw-yes { animation: hw-press 360ms var(--ease) 700ms both; }
@keyframes hw-press { 40% { transform: scale(.92); box-shadow: 0 0 0 3px rgba(34, 211, 238, .35); } 100% { transform: none; box-shadow: 0 0 0 0 rgba(34, 211, 238, 0); } }
[data-draw].hw-ok .hw-stat .is-after { opacity: 0; }
[data-draw].hw-ok.is-in .hw-stat .is-before { animation: hw-out 240ms var(--ease) 950ms both; }
[data-draw].hw-ok.is-in .hw-stat .is-after { animation: hw-in 240ms var(--ease) 1050ms both; }
@keyframes hw-out { to { opacity: 0; } }
@keyframes hw-in { from { opacity: 0; } to { opacity: 1; } }
[data-draw].hw-ok.is-in .hw-chain li { animation: hw-li 300ms var(--ease) calc(1200ms + var(--i, 0) * 420ms) both; }
[data-draw].hw-ok.is-in .hw-chain i { animation: hw-dot 300ms var(--ease) calc(1200ms + var(--i, 0) * 420ms) both; }
@keyframes hw-li { to { color: var(--ink); } }
@keyframes hw-dot { to { background: var(--signal); border-color: var(--signal); } }
[data-draw].hw-ok.is-in .hw-chain li:last-child i { animation-name: hw-done; }
@keyframes hw-done { to { background: var(--pass); border-color: var(--pass); } }

@media (max-width: 560px) {
  .hw-ev > div { grid-template-columns: minmax(0, 1fr); }
  .hw-chain { padding: 14px 10px 18px; }
  .hw-chain li { font-size: .6875rem; }
}
@media (prefers-reduced-motion: reduce) {
  [data-draw].hw-ok .hw-yes, [data-draw].hw-ok .hw-stat > *, [data-draw].hw-ok .hw-chain li, [data-draw].hw-ok .hw-chain i { animation: none !important; }
  [data-draw].hw-ok .hw-stat .is-before { opacity: 0; }
  [data-draw].hw-ok .hw-stat .is-after { opacity: 1; }
  [data-draw].hw-ok .hw-chain li { color: var(--ink); }
  [data-draw].hw-ok .hw-chain i { background: var(--signal); border-color: var(--signal); }
  [data-draw].hw-ok .hw-chain li:last-child i { background: var(--pass); border-color: var(--pass); }
}
