/* ============================================================================
   bars-tour.css — the /bars playable product tour
   ============================================================================
   Page-specific layout and the two things that genuinely cannot live in the
   shared system: the paper merchant copy, and the printed table card.

   EVERY value here resolves to a token from vetra.css. There are no raw hex
   colours, no font sizes outside the six-step scale, and no radii outside the
   three. The two exceptions are called out where they appear and are physical
   object colours — paper and ballpoint ink are not part of a UI theme and must
   not invert with it.
   ============================================================================ */

/* ── The six-card grid ────────────────────────────────────────────────────── */

/* Cards sit in a responsive grid; clicking one expands its panel BELOW the
   grid at full width. The expand still lives inside the article (same JS),
   but CSS grid column-span stretches the open card across the row. */
.t-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

/* An expanded card spans the full grid so its panel renders below the row. */
.t-card-grid .v-expand[data-level="2"],
.t-card-grid .v-expand[data-level="3"] {
  grid-column: 1 / -1;
}

/* Collapsed cards inside the grid show a compact form. */
.t-card-grid .v-expand[data-level="1"] .v-expand__head {
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: calc(var(--space) * 1.1) calc(var(--space) * 1.1);
}
.t-card-grid .v-expand[data-level="1"] .v-expand__head > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.t-card-grid .v-expand[data-level="1"] .v-expand__chev {
  display: none;
}
.t-card-grid .v-expand[data-level="1"] .v-expand__title {
  font-size: var(--t-body);
}
.t-card-grid .v-expand[data-level="1"] .v-expand__sub {
  font-size: var(--t-micro);
}

/* ── Layout ───────────────────────────────────────────────────────────────── */

.t-split { display: grid; gap: calc(var(--space) * 1.75); align-items: start; }
@media (min-width: 900px) {
  .t-split { grid-template-columns: 1fr 1fr; gap: calc(var(--space) * 2.5); }
  .t-split--tight { gap: calc(var(--space) * 1.5); }
}

.t-section-head { margin-bottom: calc(var(--space) * 2); }
.t-mt    { margin-top: var(--space); }
.t-mt-s  { margin-top: 8px; }
.t-mt-lg { margin-top: calc(var(--space) * 1.5); }
.t-mb    { margin-bottom: var(--space); }
.t-hint  { margin-bottom: 8px; }
.t-step  { margin-top: 6px; margin-bottom: 4px; }
.t-dim   { color: var(--text-muted); }

.t-ico { width: 16px; height: 16px; }

/* ── The close-out ledger ─────────────────────────────────────────────────── */

/* The status column is minmax(), not 1fr: a fixed 1fr let "Tip unreadable" run
   past the card edge whenever the ledger was narrower than the widest desktop.
   The min keeps room for the longest status; the wrapper below guarantees it
   can never clip at any width. */
.t-ledger-head,
.t-ledger {
  grid-template-columns: 3rem 5rem 4.3rem 3.9rem 4.3rem minmax(7.6rem, 1fr);
  min-width: 30rem;
}

.t-ledger-head {
  display: grid;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-sub);
  font-family: var(--mono);
  font-size: var(--t-micro);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
}
/* A ledger row that is also a button. Reset the button chrome rather than
   restyling it, so it inherits .v-ui-row exactly. */
.t-ledger--btn {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border);
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.t-ledger--btn:hover { filter: brightness(0.985); }
.t-ledger--btn[disabled] { cursor: default; }

.t-ui-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface-sub);
}
.t-foot-link { color: var(--accent); text-decoration: none; white-space: nowrap; }

/* Below the breakpoint the ledger stacks instead of scrolling — a table you
   have to drag sideways on a phone is worse than one that reflows. */
@media (max-width: 620px) {
  .t-ledger-head { display: none; }
  .t-ledger { grid-template-columns: 1fr 1fr; row-gap: 4px; min-width: 0; }
}

/* ── The merchant copy, drawn in HTML ─────────────────────────────────────── */

/* ⚠️ The only raw colours in this file. Paper, ballpoint and the blue of a
   signature are PHYSICAL OBJECT colours — they describe a thing on the bar, not
   a surface in our UI, so they must not invert with the theme or be re-pointed
   at a token. Everything else on this page comes from vetra.css. */
.t-slip {
  --paper:      #faf8f3;
  --paper-ink:  #1a1a1a;
  --paper-fade: #7a6e60;
  --paper-rule: #9b8e7e;
  --pen:        #1c3faa;

  position: relative;
  align-self: start;
  max-width: 260px;
  padding: 16px 15px 18px;
  background: var(--paper);
  color: var(--paper-ink);
  font-family: var(--mono);
  font-size: var(--t-small);
  line-height: 1.6;
  border-radius: 2px;
  transform: rotate(-1.3deg);
  box-shadow: 0 6px 22px rgb(0 0 0 / 0.18);
}
.t-slip__head {
  text-align: center;
  font-weight: var(--w-medium);
  letter-spacing: 0.08em;
  padding-bottom: 7px;
  margin-bottom: 7px;
  border-bottom: 1px dashed var(--paper-rule);
}
.t-slip__sub { font-size: var(--t-micro); color: var(--paper-fade); letter-spacing: 0.12em; }
.t-slip__row { display: flex; justify-content: space-between; gap: var(--space); font-size: var(--t-micro); }
.t-slip__row--big { font-size: var(--t-small); font-weight: var(--w-medium); }
.t-slip__rule { border-top: 1px dashed var(--paper-rule); margin: 7px 0; }

/* The ruled line the tip is written on. */
.t-slip__ruled {
  align-items: flex-end;
  min-height: 26px;
  border-bottom: 1px solid var(--paper-rule);
  margin-top: 6px;
}

/* Handwriting. A script face, rotated a few degrees, sitting slightly above the
   rule — the way a number written at 2am actually lands. */
.t-ink {
  font-family: "Bradley Hand", "Segoe Script", "Snell Roundhand", cursive;
  font-size: var(--t-lede);
  color: var(--pen);
  line-height: 1;
  padding-bottom: 2px;
}
.t-ink--a { transform: rotate(-4deg) translateY(-2px); }
.t-ink--b { transform: rotate(-2.5deg) translateY(-1px); }

.t-slip__sign {
  font-family: "Snell Roundhand", "Segoe Script", cursive;
  font-size: var(--t-lede);
  color: var(--pen);
  transform: rotate(-3deg);
  margin: 4px 0 6px;
}
.t-slip__foot {
  text-align: center;
  font-size: var(--t-micro);
  color: var(--paper-fade);
  letter-spacing: 0.06em;
  padding-top: 6px;
  border-top: 1px dashed var(--paper-rule);
}

/* ── Tip entry ────────────────────────────────────────────────────────────── */

.t-money { position: relative; display: flex; align-items: center; }
.t-money > span {
  position: absolute; left: 12px;
  color: var(--text-muted); font-family: var(--mono); font-size: var(--t-body);
  pointer-events: none;
}
.t-money .v-input { padding-left: 26px; font-family: var(--mono); }

.t-calc {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  padding: 10px 12px;
  background: var(--surface-sub);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: var(--t-small);
  color: var(--text-secondary);
}

/* One message element, three tones — no separate error/success components. */
.t-msg { min-height: 1.2em; color: var(--text-secondary); }
.t-msg[data-tone="bad"]  { color: var(--bad-fg); }
.t-msg[data-tone="ok"]   { color: var(--ok-fg); }

/* ── Result blocks shared by the search demos ─────────────────────────────── */

.t-result { margin-top: 4px; }
.t-result__none {
  border-left: 3px solid var(--warn-fg);
  background: var(--surface-sub);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: var(--space);
}
.t-kv { display: grid; grid-template-columns: 8.5rem 1fr; gap: 4px 12px; font-size: var(--t-small); }
.t-kv dt { color: var(--text-muted); }
.t-kv dd { margin: 0; color: var(--text-primary); }

.t-packet { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* ── Voice transcript ─────────────────────────────────────────────────────── */

.t-transcript { display: grid; gap: 8px; min-height: 148px; }
.t-line {
  display: grid;
  grid-template-columns: 4.6rem 1fr;
  gap: 10px;
  font-size: var(--t-small);
  animation: t-line-in .28s var(--ease) both;
}
.t-line__who {
  font-family: var(--mono); font-size: var(--t-micro);
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted); padding-top: 2px;
}
.t-line--vetra .t-line__who { color: var(--accent); }
.t-line__what { color: var(--text-secondary); }
.t-line--vetra .t-line__what { color: var(--text-primary); }

/* A line that shows WHERE an answer came from. This is the difference between
   an assistant that knows and one that improvises. */
.t-trace {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 4px; padding: 2px 8px;
  border: 1px dashed var(--border); border-radius: var(--r-sm);
  font-family: var(--mono); font-size: var(--t-micro); color: var(--text-muted);
}

@keyframes t-line-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* ── Held items ───────────────────────────────────────────────────────────── */

.t-held { grid-template-columns: 1fr auto; }
.t-scan { grid-template-columns: 1fr auto; }

/* ── The printed card ─────────────────────────────────────────────────────── */

/* Deliberately inert: nothing in the demo may bind to this. The argument in
   card 05 is made by it NOT changing. */
.t-printed {
  display: flex; align-items: center; gap: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: 0 2px 10px rgb(0 0 0 / 0.06);
}
.t-printed__qr {
  display: grid; place-items: center;
  width: 74px; height: 74px; flex: none;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--text-primary);
}
.t-printed__qr svg { width: 46px; height: 46px; }
.t-printed__text {
  font-size: var(--t-small); font-weight: var(--w-medium);
  letter-spacing: 0.1em; color: var(--text-primary);
}
.t-printed__text span {
  display: block; margin-top: 4px;
  font-weight: var(--w-normal); letter-spacing: 0;
  color: var(--text-secondary);
}

/* ── Campaign count ───────────────────────────────────────────────────────── */

.t-count {
  font-size: var(--t-display);
  font-weight: var(--w-medium);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

/* Selected state for the chip-style buttons in cards 05 and 06. */
.v-btn--secondary.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

/* ── Survey quote band ────────────────────────────────────────────────────── */

.t-quote-stage { margin-top: var(--space); min-height: 108px; display: flex; align-items: center; }
.t-quote { margin: 0; max-width: var(--measure); }
.t-quote__text {
  font-size: var(--t-lede);
  line-height: 1.5;
  color: var(--text-primary);
  transition: opacity .3s var(--ease);
}
.t-quote__text::before { content: '\201C'; }
.t-quote__text::after  { content: '\201D'; }
.t-quote__by { margin-top: 10px; font-size: var(--t-small); color: var(--text-muted); }
.t-quotes.is-swapping .t-quote__text,
.t-quotes.is-swapping .t-quote__by { opacity: 0; }

.t-quote-dots { display: flex; gap: 6px; margin-top: var(--space); }
.t-quote-dots button {
  width: 22px; height: 3px; padding: 0;
  border: 0; border-radius: 2px;
  background: var(--border);
  cursor: pointer;
  transition: background .2s var(--ease);
}
.t-quote-dots button[aria-selected="true"] { background: var(--accent); }
