/* ============================================================
   seeit.css · styles for the reusable step-animation engine (seeit.js).
   Token-driven only, WCAG-AA, overflow-safe. Pairs the facsimile pane (left,
   the source being read) with the ledger (right, one row blooming per step).
   Every motion honors prefers-reduced-motion (the engine also lands instantly
   in that mode, so this is belt and braces).
   ============================================================ */

.seeit-stage {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: var(--space);
  min-width: 0;
}
@media (max-width: 820px) {
  .seeit-stage { grid-template-columns: minmax(0, 1fr); }
}

/* left: the facsimile of the source the engine traces */
.seeit-facsimile {
  position: relative;                 /* the scanbox positions against this */
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  overflow: auto;
  min-width: 0;
  max-height: 460px;
}
.seeit-field {
  border-radius: var(--radius-sm);
  padding: 2px 4px;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.seeit-field.is-reading { background: var(--accent-pale); }
.seeit-field.is-read { opacity: 0.6; }
.seeit-field.is-xray-on {
  background: var(--gold-pale);
  box-shadow: inset 0 0 0 1px var(--gold-soft);
  opacity: 1;
}

.seeit-scanbox {
  position: absolute;
  left: 0; top: 0; width: 0; height: 0;
  border: 2px solid var(--accent);
  border-radius: var(--radius-sm);
  opacity: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px var(--accent), 0 0 12px var(--accent-soft);
  transition: opacity 0.2s ease, left 0.15s ease, top 0.15s ease, width 0.15s ease, height 0.15s ease;
}
.seeit-scanbox.is-on { opacity: 1; }

/* right: the extraction ledger */
.seeit-ledger {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 0;
}
.seeit-ledger-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.seeit-ledger-title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--accent);
  min-width: 0;
}
.seeit-counter {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  flex: 0 0 auto;
}

.seeit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-soft);
  min-width: 0;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.seeit-row.is-in { opacity: 1; transform: translateY(0); }
.seeit-row:last-child { border-bottom: none; }
.seeit-row.is-xray { cursor: pointer; }
.seeit-row.is-xray:hover { background: var(--surface-2); }
.seeit-row.is-xray:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent);
}

.seeit-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;                       /* lets the value ellipsis instead of widen */
}
.seeit-row-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-dimmer);
}
.seeit-row-value {
  font-size: 14px;
  color: var(--text);
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}

/* ============================================================
   HIGH-LEVEL MOUNT (TISeeit.mount): the source facsimile, the read ledger
   sub-line + rows, the X-ray hint, and the settled result. All token-driven,
   overflow-safe, WCAG-AA on the dark ground, reduced-motion honored.
   ============================================================ */
.seeit-mount { min-width: 0; }

/* the source facsimile reads as a calm light-paper document against the dark
   product surface, so the eye moves from "the source" to "the read". */
.seeit-source {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  min-width: 0;
}
.seeit-source-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--surface-3);
  border-bottom: 1px solid var(--border);
}
.seeit-source-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  min-width: 0;
}
.seeit-source-ribbon {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-dimmer);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  flex: 0 0 auto;
}
.seeit-source-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
@media (max-width: 520px) {
  .seeit-source-grid { grid-template-columns: minmax(0, 1fr); }
}
.seeit-source-cell {
  padding: 9px 12px 10px;
  border-right: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  min-width: 0;
}
.seeit-source-grid .seeit-source-cell:nth-child(2n) { border-right: none; }
.seeit-source-cell.is-pending { background: var(--warn-wash); }
.seeit-source-cap {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-dimmer);
  margin-bottom: 3px;
}
/* the high-level facsimile uses these field tones (the engine traces them); a
   light box-shadow ring marks the read so it stays AA on the dark ground. */
.seeit-source .seeit-field {
  font-size: 13px;
  color: var(--text);
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}

/* ledger sub-line + the rows container the mounter builds */
.seeit-ledger-sub {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
  padding: 10px 16px 0;
}
.seeit-rows { display: flex; flex-direction: column; }
.seeit-xhint {
  font-size: 11px;
  color: var(--text-dimmer);
  padding: 10px 16px 12px;
}

/* the settled result (the visible outcome the operator + their client see) */
.seeit-result {
  border: 1px solid var(--border-accent);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px 18px;
  margin-top: var(--space);
  min-width: 0;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.seeit-result.is-in { opacity: 1; transform: none; }
.seeit-result-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-dimmer);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  margin-bottom: 10px;
}
.seeit-result-head { font-size: 16px; margin: 0 0 12px; color: var(--text); }
.seeit-result-lines { display: flex; flex-direction: column; gap: 8px; }
.seeit-result-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  min-width: 0;
}
.seeit-result-line-label {
  font-size: 12.5px;
  color: var(--text-dim);
  min-width: 0;
  overflow-wrap: anywhere;
}
.seeit-result-line-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  min-width: 0;
  overflow-wrap: anywhere;
}
.seeit-result-bullets { margin: 12px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.seeit-result-bullet { font-size: 12.5px; color: var(--text-dim); line-height: 1.5; }
.seeit-result-note {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
}

/* ============================================================
   THE UNWIRED-ACTION PREVIEW (TISeeit.preview): the compact "here is what
   will happen" example flow for a control that is not live-wired. A short
   ledger of action beats blooms, then the outcome columns settle. Token-driven,
   overflow-safe, reduced-motion honored.
   ============================================================ */
.seeit-preview {
  border: 1px solid var(--border-accent);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px 16px;
  margin: 12px 0 0;
  min-width: 0;
}
.seeit-preview[hidden] { display: none; }
.seeit-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.seeit-preview-title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--accent);
  min-width: 0;
}
.seeit-preview-ribbon {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-dimmer);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  flex: 0 0 auto;
}
.seeit-preview-note {
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 8px 0 4px;
  min-width: 0;
}
.seeit-preview-ledger {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  margin: 10px 0;
  overflow: hidden;
  min-width: 0;
}
.seeit-preview-ledger:empty { display: none; }
.seeit-preview-ledger .seeit-row { padding: 9px 12px; }
.seeit-preview .sim-preview { margin: 10px 0 0; }
.seeit-preview .seeit-result { margin-top: 12px; }

/* a calm toggle the surface uses to open the example flow on a held control */
.seeit-show-flow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  color: var(--accent);
  background: transparent;
  border: 1px dashed var(--border-accent);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  cursor: pointer;
  min-width: 0;
}
.seeit-show-flow:hover { background: var(--accent-pale); }
.seeit-show-flow:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.seeit-show-flow[aria-expanded="true"] { background: var(--accent-pale); }

@media (prefers-reduced-motion: reduce) {
  .seeit-field,
  .seeit-scanbox,
  .seeit-row,
  .seeit-result { transition: none; }
  .seeit-row,
  .seeit-result { transform: none; }
}

/* ============================================================
   SEE HOW IT WORKS PAGE
   Aero-scoped page shell around the shared scan engine. The engine still
   creates the moving .seeit-scanbox. This layer gives the page a narrated walk,
   a visible scan-bar cue, and result links without changing the engine.
   ============================================================ */
.seeit-page .seeit-head {
  align-items: flex-start;
}

.seeit-intro {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 24px;
}
.seeit-intro-step {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 14px 16px;
  min-width: 0;
}
.seeit-intro-num {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.8px;
  color: var(--accent);
  margin-bottom: 8px;
}
.seeit-intro-step strong {
  display: block;
  color: var(--text);
  margin-bottom: 4px;
}
.seeit-intro-step p {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.45;
}

.seeit-walk {
  display: grid;
  grid-template-columns: minmax(240px, 0.78fr) minmax(0, 1.45fr);
  gap: 20px;
  align-items: start;
  margin-bottom: 24px;
}
.seeit-narration {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px;
  min-width: 0;
}
.seeit-narration h2 {
  margin: 8px 0 10px;
  font-size: 23px;
  line-height: 1.15;
}
.seeit-narration p {
  color: var(--text-dim);
}
.seeit-steps {
  list-style: none;
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
}
.seeit-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 10px;
  opacity: 0.68;
  min-width: 0;
}
.seeit-step.is-active {
  opacity: 1;
  border-color: var(--border-accent);
  background: var(--accent-pale);
}
.seeit-step.is-done {
  opacity: 0.82;
}
.seeit-step-num {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-deep);
}
.seeit-step-copy strong {
  display: block;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 2px;
}
.seeit-step-copy p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-dim);
}
.seeit-mode-note {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dimmer);
}

.seeit-run-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.seeit-scanbar {
  height: 3px;
  width: 92px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent-soft);
  margin: 0 0 12px;
}
.seeit-page .seeit-scanbox {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent), 0 0 18px var(--accent-soft);
}
.seeit-page .seeit-row[data-kind="pending"] {
  background: var(--warn-wash);
}
.seeit-page .seeit-result {
  border-color: var(--border-accent);
}

.seeit-result-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px;
  margin-bottom: 20px;
}
.seeit-result-links h2 {
  margin: 8px 0 0;
  font-size: 22px;
  line-height: 1.2;
  max-width: 720px;
}
.seeit-link-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

body.mode-visual .seeit-walk {
  grid-template-columns: minmax(0, 1fr);
}
body.mode-visual .seeit-narration {
  order: 2;
}
body.mode-detailed .seeit-step {
  opacity: 1;
}

@media (max-width: 900px) {
  .seeit-intro,
  .seeit-walk { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .seeit-run-card,
  .seeit-narration,
  .seeit-result-links { padding: 14px; }
  .seeit-link-row { width: 100%; }
  .seeit-link-row a { width: 100%; justify-content: center; }
}
