/* N&K Lab, demo 02 (aprovação de compras). Uses the tokens and components of /assets/lab.css. */
.cmp-controls { align-items: start; }
.cmp-controls [name="melhoria"]{min-height:44px}
@media(min-width:1024px){.cmp-controls fieldset:nth-child(2) .chips{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}}
#cmp-tobe [data-changed]{background:var(--cyan-soft);box-shadow:inset 3px 0 var(--cyan)}
#cmp-tobe [data-changed]::after{content:"mudou agora";display:block;color:var(--cyan);font-size:12px}
@media(max-width:720px){.cmp-controls .actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.cmp-controls .actions .btn{min-height:48px}}
.cmp-controls .variant { flex: 1 1 20rem; }
#lab-asis-tobe-compras .chip span { flex-direction: column; align-items: flex-start; justify-content: center; }
/* checkbox chips: text marker for the state, same height on and off */
.chip input[type="checkbox"] + span::after { content: "○ desligada"; content: "○ desligada" / ""; margin-top: .15rem; font-family: var(--mono); font-size: .6875rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.chip input[type="checkbox"]:checked + span::after { content: "✓ ligada"; content: "✓ ligada" / ""; color: var(--cyan); }
.chip span small { display: block; font-size: .75rem; color: var(--muted); }
/* status text reserves its longest length (no shift when it changes) */
#cmp-live { min-height: calc(3 * 1.55em); }
.chip input:checked + span small { color: var(--text); }

/* metrics strip: always visible, fixed size, values change in place */
.cmp-metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .5rem; margin-top: .5rem; }
.cmp-metrics div { display: grid; align-content: space-between; gap: .25rem; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
.cmp-metrics dt { font-size: .75rem; line-height: 1.3; color: var(--muted); }
.cmp-metrics dt small { display: block; font-size: .75rem; color: var(--muted); opacity: .9; }
.cmp-metrics dt b { font-weight: 600; color: var(--text); }
.cmp-metrics dd { font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cmp-premise { margin-top: .6rem; font-size: .8125rem; color: var(--muted); }

/* tabs */
.cmp-tabs { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: 1.25rem; border-bottom: 1px solid var(--line); }
.cmp-tabs [role="tab"] { min-height: 2.75rem; padding: .55rem 1rem; border: 1px solid transparent; border-bottom: 0; border-radius: 6px 6px 0 0; background: none; color: var(--muted); font-weight: 600; cursor: pointer; }
.cmp-tabs [role="tab"]:hover { color: var(--text); }
.cmp-tabs [role="tab"][aria-selected="true"] { color: var(--text); background: var(--bg); border-color: var(--line); box-shadow: inset 0 3px 0 var(--cyan); }
.cmp-panel { padding: 1rem; background: var(--bg); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 10px 10px; }
.cmp-panel[hidden] { display: none; }

/* swimlanes: one row per AS-IS step, placed in its lane column (always 9 rows) */
.lanes { display: grid; gap: .4rem; counter-reset: st; }
.lanes > li { grid-template-columns: none; display: grid; gap: .2rem; padding: .4rem .55rem; border: 1px solid var(--line); border-left: 3px solid var(--muted); border-radius: 6px; background: var(--surface); counter-increment: st; }
.lanes > li.lane-4 { border-left-color: var(--cyan); }
.step-lane { font-family: var(--mono); font-size: .6875rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.step-text { font-size: .875rem; font-weight: 600; line-height: 1.3; }
.step-text::before { content: counter(st) ". "; color: var(--muted); }
.step-meta { display: flex; flex-wrap: wrap; gap: .3rem; }
.step-note { font-size: .75rem; line-height: 1.3; color: var(--muted); }
.tag { padding: .05rem .4rem; border: 1px solid var(--line); border-radius: 3px; font-size: .75rem; font-weight: 600; color: var(--muted); }
.tag-warn { border-color: var(--warn); color: var(--warn); }
.tag-automatizada, .tag-alterada { border-color: var(--cyan); color: var(--cyan); }
.tag-removida { border-color: var(--muted); color: var(--text); }
.lanes > li.is-removed { background: transparent; border-style: dashed; }
.lanes > li.is-removed .step-text { color: var(--muted); font-weight: 500; }

@media (min-width: 900px) {
  /* staircase lanes: one wide card per row, offset by lane, lane name inside the card */
  .lanes > li { width: 62%; display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .6rem; }
  .lanes > li.lane-1 { margin-left: 9.5%; } .lanes > li.lane-2 { margin-left: 19%; }
  .lanes > li.lane-3 { margin-left: 28.5%; } .lanes > li.lane-4 { margin-left: 38%; }
  .step-lane { flex: 0 0 6.5rem; }
  .step-text { flex: 1 1 14rem; }
  .step-note { flex-basis: 100%; }
}


/* compare */
.cmp-table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.cmp-table caption { text-align: left; font-weight: 600; margin-bottom: .5rem; }
.cmp-table th, .cmp-table td { padding: .5rem .4rem; border-bottom: 1px solid var(--line); text-align: left; }
.cmp-table thead th { font-family: var(--mono); font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cmp-table td { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.cmp-ctrl { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.cmp-ctrl ul { margin-top: .4rem; display: grid; gap: .3rem; padding-left: 1.1rem; list-style: disc; font-size: .875rem; }
.cmp-def { margin-top: 1rem; font-size: .8125rem; color: var(--muted); }
.cmp-def b { color: var(--text); }

@media (max-width: 960px) { .cmp-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .cmp-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cmp-metrics dd { font-size: 1.0625rem; white-space: normal; }
  #cmp-live { min-height: calc(5 * 1.55em); }
  .cmp-ctrl { grid-template-columns: 1fr; }
  .cmp-panel { padding: .75rem .6rem; }
  .cmp-table { font-size: .8125rem; }
  .cmp-table td { white-space: normal; }
}
@media (prefers-reduced-motion: no-preference) {
  .cmp-tabs [role="tab"], .lanes > li, .cmp-metrics dd { transition: background-color .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease); }
}
.step-lane,.chip input[type="checkbox"]+span::after,.cmp-table thead th{font-size:12px}
