/* ==========================================================================
   /audit-vault — Figma 0:6265 (desktop) / 0:7272 (mobile)
   Loaded after style.css + product.css. Trace, step types and receipt share
   one ruled 1200 column that runs unbroken from the trace box down to the
   receipt. ≥ 1000 px desktop frame, < 1000 px mobile frame.
   ========================================================================== */

.av-col {
  position: relative;
  width: min(1200px, 100% - 48px);
  margin: 0 auto;
  border-inline: 1px solid var(--hairline);
}
/* Figma strokes sit inside the box: the top rule eats 1 px of the head's
   padding and the bottom rule is drawn by the last row */
.av-col--first { border-top: 1px solid var(--hairline); }
.av-col--first .av-head { padding-top: 31px; }
.av-trace { padding-top: 112px; }
.av-receipt { padding-bottom: 80px; }

.av-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 40px;
  padding: 32px 32px 48px;
  box-shadow: inset 0 -1px 0 var(--hairline);
}
.av-head--tall { padding-top: 152px; }
.av-title { font-size: 48px; font-weight: 600; font-variation-settings: "opsz" 31; line-height: 1.1; letter-spacing: -0.01em; }

/* ---- Trace timeline ─ 0:6312 ----
   Each step sits one eighth further along than the last; the trace writes
   itself step by step, then gets signed. */
.tl { --cw: 250px; --rh: 48px; }
.tl-row { position: relative; height: var(--rh); box-shadow: inset 0 -1px 0 var(--hairline); }
.tl-row--sig .tl-sig { bottom: 1px; }
.tl-cell {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc((100% - var(--cw)) * var(--i) / 8);
  width: var(--cw);
  display: flex;
  align-items: center;
  justify-content: center;
  border-inline: 1px solid var(--hairline);
  font-size: 16px;
  font-weight: 500;
  line-height: normal;
  text-transform: uppercase;
  white-space: nowrap;
}
.tl-sig {
  gap: 14px;
  border: 0;
  background: linear-gradient(102.92deg, #d5cdd5 3.38%, #b9c7ba 54.264%, #e2bc90 102.89%);
  color: #0e0e0e;
  overflow: hidden;
}
.tl-sig img { flex: none; width: 24px; height: 24px; }
/* a soft sheen crosses the seal once it lands */
.tl-sig::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgb(255 255 255 / .55) 50%, transparent 70%);
  translate: -110% 0;
}
.tl.is-armed .tl-cell { clip-path: inset(0 100% 0 0); }
.tl.is-armed .tl-sig { clip-path: none; opacity: 0; scale: .96; }
.tl.is-run .tl-cell { animation: tl-write .5s var(--ease-sheet) forwards; animation-delay: calc(var(--i) * 110ms); }
.tl.is-run .tl-sig { animation: tl-seal .55s var(--ease-sheet) forwards; animation-delay: 1000ms; }
.tl.is-run .tl-sig::after { animation: tl-sheen 1.1s ease forwards; animation-delay: 1350ms; }
@keyframes tl-write { to { clip-path: inset(0 0 0 0); } }
@keyframes tl-seal { to { opacity: 1; scale: 1; } }
@keyframes tl-sheen { to { translate: 110% 0; } }

/* ---- Step types ─ 0:6355 ---- */
.st { font-family: var(--mono); }
.st-row { display: grid; grid-template-columns: 368px minmax(0, 1fr); align-items: center; padding: 20px 24px; box-shadow: inset 0 -1px 0 var(--hairline); line-height: normal; }
.st-row--head { background: #282828; font-size: 12px; color: #b4b4b4; text-transform: uppercase; }
.st-body { outline: 1px solid var(--hairline); outline-offset: -1px; }
.st-body .st-row { font-size: 14px; transition: background-color .25s ease; }
.st-body .st-row > span:first-child { color: var(--accent); }
.st-body .st-row > span:last-child { color: #8a8a8a; transition: color .25s ease; }
.st-body .st-row:hover { background: rgb(255 255 255 / .03); }
.st-body .st-row:hover > span:last-child { color: #c3c3c3; }

/* ---- Decision receipt ─ 0:6396 ---- */
.rc-box { position: relative; }
.rc-json {
  margin: 0;
  padding: 40px;
  background: #161616;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 22.4px;
  color: #b3b3b3;
  white-space: pre;
  overflow-x: auto;
  box-shadow: inset 0 -1px 0 var(--hairline);
}
.rc-json em { font-style: normal; color: #b7b7b7; }
.rc-json b { font-weight: 400; color: #fff; }

.rc-term {
  position: absolute;
  z-index: 2;
  right: 97px;
  bottom: -21px;
  width: 459px;
  height: 471px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  background: #101010;
  box-shadow: 0 30px 60px rgb(0 0 0 / .35);
  /* a layer above the receipt: it drifts a little with the scroll and can be
     picked up and dragged; let go and it springs back (audit.js) */
  transform: translate3d(var(--dx, 0px), calc(var(--dy, 0px) + var(--py, 0px)), 0) scale(var(--ds, 1));
  cursor: grab;
  touch-action: pan-y;          /* vertical swipes still scroll the page on phones */
  -webkit-user-select: none;
  user-select: none;
  will-change: transform;
  transition: box-shadow .35s ease;
}
.rc-term.is-dragging { cursor: grabbing; box-shadow: 0 48px 96px rgb(0 0 0 / .55); }
.rc-term .rt-dl { cursor: pointer; }
.rc-term__bar { position: relative; flex: none; height: 40px; background: #2c2c2c; }
.rc-term__bar img { position: absolute; left: 14px; top: 14px; }
.rc-term__body { position: relative; flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding: 24px; font-family: var(--mono); font-size: 13px; line-height: 1.6; }
.rt-cmd { color: #63c462; }
.rt-rest { color: transparent; }
.rt-out { display: flex; flex-direction: column; color: #fff; white-space: pre-wrap; }
.rt-valid { display: flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 500; line-height: normal; color: #63c462; }
.rt-caret { display: inline-block; width: 7px; height: 11px; background: #63c462; animation: gw-blink 1.06s steps(1) infinite; }
@keyframes gw-blink { 50% { opacity: 0; } }
.rt-dl {
  position: absolute;
  left: 24px;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding-bottom: 4px;
  border-bottom: 1px solid #63c462;
  font-size: 14px;
  font-weight: 500;
  line-height: normal;
  text-transform: uppercase;
  color: #63c462;
  transition: gap .25s var(--ease-sheet), color .2s ease;
}
.rt-dl:hover { gap: 8px; color: #7fd97e; }
.rt-dl img { width: 16px; height: 16px; }
/* the verify run plays once on first sight (verify.js) */
.rc-term.is-armed .rt-line, .rc-term.is-armed .rt-valid { visibility: hidden; }
.rc-term.is-armed .rt-dl { opacity: 0; }
.rt-line.is-in, .rt-valid.is-in { visibility: visible !important; }
.rc-term .rt-dl.is-in { opacity: 1; transition: opacity .5s ease; }

@supports (text-box: trim-both cap alphabetic) {
  .tl-cell { text-box: trim-both cap alphabetic; }
  @media (min-width: 1000px) { .av-title { text-box: trim-both cap alphabetic; } }
}

@media (prefers-reduced-motion: reduce) {
  .tl.is-armed .tl-cell { clip-path: none; }
  .tl.is-armed .tl-sig { opacity: 1; scale: 1; }
  .tl-sig::after, .rt-caret { animation: none !important; }
}

/* 1000–1239: the receipt terminal tucks in with the column */
@media (max-width: 1239px) and (min-width: 1000px) {
  .rc-term { right: 32px; }
}

/* ==========================================================================
   < 1000: mobile frame
   ========================================================================== */
@media (max-width: 999px) {
  .av-col { width: min(560px, 100% - 40px); }
  .av-col--first .av-head { padding-top: 23px; }
  .av-trace { padding-top: 64px; }
  .av-head { gap: 32px; padding: 24px 16px; }
  .av-head--tall { margin-top: 0; padding-top: 24px; }
  .av-steps .av-col, .av-receipt .av-col { padding-top: 64px; }
  .av-col .chip { height: 32px; }
  .av-title { font-size: 28px; line-height: 1.2; letter-spacing: -0.01em; }
  .av-trace .av-title { line-height: 1.1; }

  .tl { --cw: 160px; --rh: 32px; }
  .tl-cell { font-size: 12px; }
  .tl-sig { gap: 4px; }
  .tl-sig img { width: 16px; height: 16px; }

  .st-row { grid-template-columns: 100px minmax(0, 1fr); padding: 14px 12px; }
  .st-row--head { padding: 12px; font-size: 11px; }
  .st-body .st-row { font-size: 12px; }
  .st-body .st-row > span:first-child { width: 80px; word-break: break-all; }

  .av-receipt { padding-bottom: 47px; }
  .rc-json { padding: 16px; font-size: 12px; white-space: pre-wrap; word-break: break-word; }
  .rc-term {
    position: relative;
    right: auto;
    bottom: auto;
    width: 277px;
    height: 326px;
    margin: -23px -10px 0 auto;
    box-shadow: 0 20px 40px rgb(0 0 0 / .35);
  }
  .rc-term.is-dragging { box-shadow: 0 32px 64px rgb(0 0 0 / .55); }
  .rc-term__bar { height: 32px; }
  .rc-term__bar img { left: 12px; top: 11px; width: 45px; height: 10px; }
  .rc-term__body { padding: 16px; font-size: 12px; }
  .rt-valid { font-size: 12px; }
  .rt-dl { left: 16px; bottom: 16px; font-size: 12px; }
}
