/* Integration page: the pieces the explainer has no use for. Loaded after
   explainer.css and built on its colour and spacing variables, so a skin and
   the dark scheme apply here too. */

.eyebrow { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.eyebrow .draft { display: inline-block; margin-left: var(--s2); padding: 2px 8px; border: 1px solid currentColor; border-radius: 999px; font-size: 11.5px; vertical-align: 1px; }
.intro { padding-top: var(--s7); }
.intro h1 { max-width: 16em; }
.intro .lede { max-width: 42em; }
.intro .tiles { margin: var(--s6) 0 0; }
.tile .v { font-variant-numeric: tabular-nums; }
.tile .s { display: block; }

code { font-family: var(--mono); font-size: 0.88em; overflow-wrap: anywhere; }
pre.code {
  margin: var(--s4) 0; padding: var(--s3) var(--s4); overflow-x: auto;
  background: var(--surface); border-radius: 8px;
  font: 13px/1.75 var(--mono); color: var(--ink);
}
figure > pre.code { margin: 0; }
pre.code .c { color: var(--muted); }

/* Tables of prose: the first column names the row and does not wrap away. */
td:first-child { color: var(--ink); }
.parts td:first-child, #fail-closed td:first-child { white-space: nowrap; padding-right: var(--s4); }
td code { white-space: nowrap; }
main th, main td { padding-right: var(--s4); }
main th:last-child, main td:last-child { padding-right: 0; }

/* The two halves of a bundle, side by side. */
.parts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin: var(--s5) 0; }
.part { border: 1px solid var(--line); border-radius: 8px; padding: var(--s4); }
.part table { font-size: 13.5px; }
.part tr:last-child td { border-bottom: 0; padding-bottom: 0; }
.part td { color: var(--ink-2); }

/* A run of serialized bytes: one cell per field, its size in bytes large. */
.bytes { display: grid; gap: 2px; border-radius: 8px; overflow: hidden; }
.bytes.output { grid-template-columns: minmax(150px, 8fr) minmax(72px, 2fr) minmax(72px, 2fr) minmax(190px, 14fr); }
.bytes.input { grid-template-columns: minmax(150px, 3fr) minmax(72px, 1fr) minmax(190px, 8fr) minmax(72px, 2fr); }
.bytes > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: var(--s3) var(--s4); background: var(--surface); }
.bytes > .hl { background: var(--accent-soft); }
.bytes .k { font-size: 13px; color: var(--muted); }
.bytes .n { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.bytes .n::after { content: " B"; font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--ink-2); }
.bytes .x { font: 12px/1.5 var(--mono); color: var(--ink-2); }

/* Outpoints of one transaction, in index order. */
.coins { display: flex; flex-wrap: wrap; gap: var(--s2); }
.coin { display: flex; flex-direction: column; gap: 2px; padding: var(--s2) var(--s4); border: 1px solid var(--line); border-radius: 8px; }
.coin span { font-size: 12.5px; color: var(--muted); }
.coin.pq { border-color: var(--accent); background: var(--accent-soft); }
.coin.pq span { color: var(--accent); font-weight: 600; }

/* Bytes to actions to a fee, read left to right. */
.convert { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: var(--s3); }
.convert .box { display: flex; flex-direction: column; gap: var(--s1); padding: var(--s4); border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.convert .box.hl { border-color: var(--accent); background: var(--accent-soft); }
.convert .k { font-size: 13px; color: var(--muted); }
.convert .v b { font-size: 28px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.convert .v small { font-size: 14px; color: var(--ink-2); margin-left: 6px; white-space: nowrap; }
.convert .op { font-size: 13px; color: var(--muted); white-space: nowrap; text-align: center; }
.convert .op::after { content: " →"; }

.calc { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s4); margin-bottom: var(--s4); font-size: 14px; }
.calc[hidden] { display: none; }
.calc label { color: var(--ink-2); white-space: nowrap; }
.calc output { display: inline-block; min-width: 2ch; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.calc input[type="range"] { flex: 1; min-width: 140px; max-width: 280px; accent-color: var(--accent); }
.row button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--page); }

@media (max-width: 760px) {
  .parts { grid-template-columns: 1fr; }
  .bytes.output, .bytes.input { grid-template-columns: 1fr 1fr; }
  .convert { grid-template-columns: 1fr; }
  .convert .op { text-align: left; padding-left: var(--s4); }
  .convert .op::after { content: " ↓"; }
  .parts td:first-child, #fail-closed td:first-child { white-space: normal; }
  pre.code { white-space: pre-wrap; overflow-wrap: anywhere; }
}
