/* The data pipeline: one record, filled in stage by stage.
   .pipe-visual[data-stage] is set by src/pipeline.js; everything that
   changes between stages is keyed off it here. */
.pipe { border-top: 1px solid var(--line); }

.pipe-visual {
  /* stages 0–1 have nothing to map yet, so the map column is closed and the
     thread / record sit alone; from stage 2 the record slides left and the
     map opens beside it. Breakpoints only change these values. */
  --cols-solo: minmax(0, 1fr) minmax(0, 0fr);
  --cols-mapped: minmax(0, 1fr) minmax(0, 1fr);
  --gap-mapped: 32px;
  width: 100%; height: 100%;
  display: grid; grid-template-columns: var(--cols-solo);
  gap: 0; align-items: center;
  transition: grid-template-columns .8s var(--ease-io), gap .8s var(--ease-io);
}
.pipe-visual:is([data-stage='2'], [data-stage='3'], [data-stage='4']) { grid-template-columns: var(--cols-mapped); gap: var(--gap-mapped); }
.pipe-visual > .thread, .pipe-visual > .portal, .pipe-visual > .rec { grid-row: 1; grid-column: 1; }
/* the three layers share one cell. Where the pinned visual sizes to its
   content (the stacked phone/tablet layout), the hidden ones leave the flow
   so it is only ever as tall as the layer on show; they already sit at the
   top there, so nothing jumps as they fade. */
@media (max-width: 900px) and (min-height: 501px) {
  .pipe-visual { position: relative; }
  .pipe-visual:not([data-stage='0']) > .thread,
  .pipe-visual:not([data-stage='1']) > .portal,
  .pipe-visual:is([data-stage='0'], [data-stage='1']) > .rec { position: absolute; top: 0; left: 0; right: 0; margin: 0 auto; }
  /* src/pipeline.js holds the visual at its tallest stage so the steps
     never move; each layer keeps its own height at the top of that space */
  .pipe-visual > :is(.thread, .portal, .rec) { align-self: start; }
  .pipe-visual.is-measuring, .pipe-visual.is-measuring * { transition: none !important; }
}
.pipe-visual > .pipe-map { grid-row: 1; grid-column: 2; }

/* ── stage 0: the thread on X ─────────────────────────────────────── */
.thread {
  justify-self: center; width: 100%; max-width: 440px;
  display: flex; flex-direction: column;
  transition: opacity .5s var(--ease), transform .6s var(--ease), visibility 0s .6s;
}
.pipe-visual:not([data-stage='0']) .thread { opacity: 0; transform: translateY(-16px); visibility: hidden; }
.pipe-visual[data-stage='0'] .thread { transition-delay: 0s; }
/* one continuous thread, as X draws it: avatars on a rail joined by a line */
.xthread {
  position: relative;
  padding: 18px 20px 20px;
  border: 1px solid var(--x-line); border-radius: var(--r);
  background: var(--x-bg);
}
.xthread-x { position: absolute; top: 14px; right: 16px; color: var(--fg-muted); font-size: 15px; }
.post { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; }
.post-reply { margin-top: 4px; }
.post-rail { display: flex; flex-direction: column; align-items: center; }
.post-line { flex: 1; width: 2px; margin: 4px 0 -4px; background: var(--x-line); }
.post-av { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; }
.post-av-anon { background: linear-gradient(135deg, var(--x-av-1), var(--x-av-2)); }
.post-av-gcc { border-radius: 4px; background: var(--x-fg); color: var(--x-bg); font: 700 11px/1 var(--body); letter-spacing: .02em; }
.post-body { min-width: 0; padding-bottom: 14px; }
.post-reply .post-body { padding-bottom: 0; }
.post-head { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 6px; padding-right: 24px; font-size: 14px; line-height: 1.3; }
.post-head b { color: var(--x-fg); font-weight: 700; }
.post-meta { color: var(--x-meta); }
.post-badge { width: 16px; height: 16px; color: var(--x-badge); }
.post-text { margin: 4px 0 0; color: var(--x-fg); font-size: 15px; line-height: 1.45; }
.post-link { color: var(--x-link); overflow-wrap: anywhere; }
.post-id { font-family: var(--mono); font-size: .92em; color: var(--brand); background: var(--brand-tint); padding: 1px 5px; border-radius: 4px; white-space: nowrap; }
.thread-note { margin: 14px 0 0; font: 400 12px/1.4 var(--mono); letter-spacing: .04em; color: var(--fg-faint); text-align: center; }

/* ── stage 1: the raw record, as GCC's portal shows it ────────────── */
.portal {
  justify-self: center; width: 100%; max-width: 440px;
  border-radius: 6px; overflow: hidden;
  background: #eef0f1; color: #1d2b4f;
  font: 400 12.5px/1.35 Arial, 'Helvetica Neue', sans-serif;
  box-shadow: 0 30px 80px -40px var(--shadow-card);
  transition: opacity .5s var(--ease), transform .6s var(--ease), visibility 0s .6s;
}
.pipe-visual:not([data-stage='1']) .portal { opacity: 0; transform: translateY(16px); visibility: hidden; }
.pipe-visual[data-stage='1'] .portal { transition-delay: .1s, .1s, 0s; }
.portal-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #fff; border-bottom: 3px solid #2d3e63; }
.portal-head b { font: 400 17px/1.1 Georgia, 'Times New Roman', serif; color: #111; }
.portal-crest { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 3px; background: #2d3e63; color: #fff; font: 700 9px/1 Arial, sans-serif; }
.portal-title { margin: 0; padding: 6px 12px; background: #dcdfe2; font-size: 14px; color: #111; }
.portal-rows { margin: 0; }
.portal-rows > div { display: grid; grid-template-columns: 124px minmax(0, 1fr); border-top: 1px solid #cdd2d6; }
.portal-rows dt { padding: 5px 10px; color: #8a2a50; border-right: 1px solid #cdd2d6; }
.portal-rows dd { margin: 0; padding: 5px 10px; overflow-wrap: anywhere; }
.portal-mask { color: #8b95a7; }
.redact { display: inline-block; width: 9ch; height: .95em; vertical-align: -1px; border-radius: 2px; background: #1d2b4f; }
.redact-s { width: 6ch; }
/* the gap this step is about */
.portal-gap dd { background: rgba(232, 161, 60, 0.16); }
.portal-flag { display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 3px; background: #e8a13c; color: #2a1a00; font: 600 10.5px/1.5 var(--body); white-space: nowrap; }
.portal-note { margin: 0; padding: 6px 12px; border-top: 1px solid #cdd2d6; font: 400 11px/1.4 var(--mono); color: #5b6478; }

/* ── the record ───────────────────────────────────────────────────── */
.rec {
  justify-self: center; width: 100%; max-width: 420px;
  transition: opacity .5s var(--ease) .15s, transform .6s var(--ease) .15s;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: linear-gradient(180deg, var(--surface), var(--canvas-2));
  padding: 20px;
  font-size: 14px;
  box-shadow: 0 30px 80px -40px var(--shadow-card);
}
.rec-src { display: flex; align-items: center; gap: 10px; color: var(--fg-muted); font-size: 13px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.rec-src b { color: var(--fg); font-weight: 500; }
.rec-x { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--fg); color: var(--canvas); font-size: 13px; font-weight: 700; }
.rec-id { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 0 6px; }
.rec-k { font: 400 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--fg-faint); }
.rec-idv { font-size: 17px; color: var(--brand); letter-spacing: .02em; }
.rec-mask { color: var(--fg-faint); }

.rec-rows { margin: 0; }
.rec-row { display: grid; grid-template-columns: 108px 1fr; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.rec-row dt { color: var(--fg-faint); font-size: 13px; }
.rec-row dd { margin: 0; color: var(--fg); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }

.rec-ward dd { position: relative; }
.rec-found { color: var(--brand); font-weight: 600; }
.rec-found em { font: 400 11px/1 var(--mono); font-style: normal; color: var(--fg-faint); margin-left: 6px; letter-spacing: .04em; }

/* what enrichment adds: six fields, two to a row, none of them on the portal.
   They are stage 2's whole point, so they give way when mapping starts */
.rec-sig { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.rec-sig dl { margin: 10px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.rec-sig dl > div { padding: 8px 10px; border-radius: 8px; background: var(--canvas-2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rec-sig dt { font: 400 10.5px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--fg-faint); }
.rec-sig dd { margin: 0; color: var(--fg); font-size: 13px; line-height: 1.3; font-weight: 500; overflow-wrap: anywhere; }
.rec-sig dd[lang='ta'] { font-family: 'Anek Tamil', var(--body); }
/* the two this complaint actually trips */
.rec-sig .sig-hit { background: var(--brand-tint); border-color: transparent; }
.rec-sig .sig-hit dd { color: var(--brand); }

.rec-acc { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.rec-acc ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.pipe-visual:is([data-stage='0'], [data-stage='1']) .rec { opacity: 0; transform: translateY(16px); transition-delay: 0s; }
.rec-acc li { display: grid; grid-template-columns: 108px 1fr; gap: 12px; color: var(--fg); }
.rec-acc li span { color: var(--fg-faint); font-size: 13px; }
.rec-acc li b { font-weight: 600; display: flex; flex-direction: column; gap: 2px; }
.rec-acc li small { font-weight: 400; font-size: 12px; color: var(--fg-muted); }

/* stage gating: rows appear when the stage reaches their data-from */
.pipe-visual [data-from] { transition: opacity .5s var(--ease), max-height .6s var(--ease), padding .6s var(--ease), transform .5s var(--ease); }
.pipe-visual .rec-row[data-from],
.pipe-visual .rec-sig,
.pipe-visual .rec-acc { max-height: 0; opacity: 0; overflow: hidden; padding-top: 0; padding-bottom: 0; margin-top: 0; border-color: transparent; }
.pipe-visual .rec-acc { max-height: 0; }
.pipe-visual .pipe-map-label { opacity: 0; transform: translateY(4px); }

.pipe-visual[data-stage='1'] .rec-row[data-from='1'],
.pipe-visual[data-stage='2'] .rec-row[data-from='1'],
.pipe-visual[data-stage='3'] .rec-row[data-from='1'],
.pipe-visual[data-stage='4'] .rec-row[data-from='1'],
.pipe-visual[data-stage='3'] .rec-row[data-from='3'],
.pipe-visual[data-stage='4'] .rec-row[data-from='3'] { max-height: 60px; opacity: 1; padding: 8px 0; border-color: var(--line); }
.pipe-visual[data-stage='2'] .rec-sig { max-height: 400px; opacity: 1; margin-top: 14px; padding-top: 14px; border-color: var(--line-2); }
.pipe-visual[data-stage='4'] .rec-acc { max-height: 280px; opacity: 1; margin-top: 14px; padding-top: 14px; border-color: var(--line-2); }

/* arriving at enrichment, the six fields land one after another */
.pipe-visual[data-stage='2'] .rec-sig dl > div { animation: rec-in .5s var(--ease) both; }
.rec-sig dl > div:nth-child(2) { animation-delay: .08s; }
.rec-sig dl > div:nth-child(3) { animation-delay: .16s; }
.rec-sig dl > div:nth-child(4) { animation-delay: .24s; }
.rec-sig dl > div:nth-child(5) { animation-delay: .32s; }
.rec-sig dl > div:nth-child(6) { animation-delay: .4s; }
.pipe-visual[data-stage='3'] .pipe-map-label,
.pipe-visual[data-stage='4'] .pipe-map-label { opacity: 1; transform: none; }

/* stage 4 is about who answers for it: the raw rows (category, area,
   department, status) give way so the relevant-authorities block fits */
.pipe-visual[data-stage='4'] .rec-row[data-from='1']:not(.rec-ward) { max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; border-color: transparent; }

/* the missing ward is the story of stage 2 */
.pipe-visual[data-stage='2'] .rec-ward,
.pipe-visual[data-stage='3'] .rec-ward,
.pipe-visual[data-stage='4'] .rec-ward { background: linear-gradient(90deg, var(--brand-tint), transparent 70%); }
.pipe-visual[data-stage='2'] .rec-found { animation: rec-in .6s var(--ease); }
@keyframes rec-in { from { opacity: 0; transform: translateX(-6px); } }

/* ── the map ──────────────────────────────────────────────────────── */
.pipe-map { height: 100%; min-height: 420px; overflow: hidden; opacity: 0; transition: opacity .6s var(--ease); }
.pipe-visual:is([data-stage='2'], [data-stage='3'], [data-stage='4']) .pipe-map { opacity: 1; transition-delay: .35s; }
.pipe-map .map { overflow: hidden; }
/* zoomed in, the city runs off every edge: fade it out rather than crop hard */
.pipe-visual[data-stage='3'] .pipe-map .map,
.pipe-visual[data-stage='4'] .pipe-map .map {
  -webkit-mask-image: radial-gradient(ellipse 72% 66% at 50% 48%, #000 55%, transparent 100%);
  mask-image: radial-gradient(ellipse 72% 66% at 50% 48%, #000 55%, transparent 100%);
}
.pipe-map .map-wards path { fill: var(--map-empty); }
.pipe-map .map-wards path.in-zone { fill: var(--map-zone); }
.pipe-map .map-wards path.in-const { fill: var(--map-lo); }
.pipe-map .pipe-ward { fill: var(--brand); stroke: var(--fg); stroke-width: 1.2; vector-effect: non-scaling-stroke; opacity: 0; transition: opacity .5s var(--ease); }
.pipe-map .pipe-zone,
.pipe-map .pipe-const { fill: none; vector-effect: non-scaling-stroke; opacity: 0; transition: opacity .6s var(--ease); stroke-linejoin: round; }
.pipe-map .pipe-zone { stroke: var(--fg-muted); stroke-width: 1; stroke-dasharray: 3 3; }
.pipe-map .pipe-const { stroke: var(--brand); stroke-width: 1.6; }
.pipe-map .pipe-pulse { fill: none; stroke: var(--brand); stroke-width: 1.2; vector-effect: non-scaling-stroke; opacity: 0; transform-box: fill-box; transform-origin: center; }

.pipe-visual[data-stage='2'] .pipe-ward,
.pipe-visual[data-stage='3'] .pipe-ward,
.pipe-visual[data-stage='4'] .pipe-ward { opacity: 1; }
.pipe-visual[data-stage='2'] .pipe-pulse { animation: pipe-pulse 2.2s var(--ease) infinite; }
.pipe-visual[data-stage='3'] .pipe-zone,
.pipe-visual[data-stage='4'] .pipe-zone,
.pipe-visual[data-stage='3'] .pipe-const,
.pipe-visual[data-stage='4'] .pipe-const { opacity: 1; }
@keyframes pipe-pulse {
  0% { opacity: .9; transform: scale(1); }
  100% { opacity: 0; transform: scale(7); }
}
.pipe-map-label {
  position: absolute; left: 0; bottom: 0;
  font: 400 12px/1.4 var(--mono); letter-spacing: .04em; color: var(--fg-muted);
}

/* ── step 4's key: each swatch is drawn exactly as its layer is ───── */
.legend { margin: 8px 0 0; border-top: 1px solid var(--line); max-width: 460px; }
.legend > div {
  padding: 12px 10px 12px 0; border-bottom: 1px solid var(--line);
  cursor: default; transition: background-color .2s, padding .3s var(--ease);
  border-radius: 2px;
}
.legend > div:hover, .legend > div:focus-visible { background: linear-gradient(90deg, var(--brand-tint), transparent 80%); padding-left: 8px; }
.legend dt { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--fg); font-size: 15px; }
.legend dt span { font-weight: 400; color: var(--fg-muted); font-size: 13px; margin-left: auto; text-align: right; }
.legend dd { margin: 4px 0 0 24px; color: var(--fg-muted); font-size: 14px; line-height: 1.5; }
.sw { flex: none; width: 14px; height: 14px; border-radius: 3px; }
.sw-ward { background: var(--brand); box-shadow: inset 0 0 0 1px var(--fg); }
.sw-zone { border: 1.5px dashed var(--fg-muted); background: var(--map-zone); }
.sw-const { border: 1.5px solid var(--brand); background: var(--map-lo); }

/* pointing at a legend row isolates that layer on the map */
.pipe-map .pipe-zone, .pipe-map .pipe-const, .pipe-map .pipe-ward { transition: opacity .3s var(--ease), stroke-width .3s; }
.pipe-visual[data-focus='ward'] .pipe-zone,
.pipe-visual[data-focus='ward'] .pipe-const,
.pipe-visual[data-focus='zone'] .pipe-const,
.pipe-visual[data-focus='const'] .pipe-zone { opacity: .12; }
.pipe-visual[data-focus='zone'] .pipe-ward,
.pipe-visual[data-focus='const'] .pipe-ward { opacity: .35; }
.pipe-visual[data-focus='zone'] .pipe-zone { stroke: var(--fg); stroke-width: 1.8; }
.pipe-visual[data-focus='const'] .pipe-const { stroke-width: 2.6; }
.pipe-visual[data-focus='zone'] .map-wards path.in-zone { fill: var(--map-zone-hi); }
.pipe-visual[data-focus='const'] .map-wards path.in-const { fill: var(--map-const-hi); }

/* ── step 3's dataset counts: the same six fields, across every record ── */
.signals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 4px 0 0; max-width: 460px; border-top: 1px solid var(--line); }
.signals > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 6px; padding: 14px 12px 14px 0; border-bottom: 1px solid var(--line); }
.signals dt { font: 400 11px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--fg-faint); }
.signals dd { margin: 0; font: 600 22px/1 var(--display); letter-spacing: -0.02em; color: var(--fg); font-variant-numeric: tabular-nums; }

/* ── stage 5: links into the app ──────────────────────────────────── */
.views { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--line); max-width: 460px; }
.views a {
  display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 12px;
  padding: 16px 0; border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--fg-muted); font-size: 14px;
  transition: color .2s, padding .3s var(--ease);
}
.views b { color: var(--fg); font: 600 17px/1 var(--display); }
.views i { font-style: normal; color: var(--fg-faint); transition: transform .3s var(--ease), color .2s; }
.views a:hover { color: var(--fg); padding-left: 6px; }
.views a:hover i { color: var(--brand); transform: translateX(4px); }

/* ── tablet & phone ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .pipe-visual { --cols-mapped: minmax(0, 1.25fr) minmax(0, 1fr); --gap-mapped: 16px; align-items: stretch; }
  .thread, .rec { max-width: 520px; }
  .xthread { padding: 14px 14px 16px; }
  .post { grid-template-columns: 32px minmax(0, 1fr); gap: 10px; }
  .post-av { width: 32px; height: 32px; }
  .post-head { font-size: 13px; }
  .post-text { font-size: 13.5px; }
  .rec { padding: 14px; font-size: 12.5px; }
  .rec-src { padding-bottom: 10px; font-size: 12px; }
  .rec-x { width: 22px; height: 22px; font-size: 11px; }
  .rec-id { padding: 10px 0 4px; }
  .rec-idv { font-size: 14px; }
  .rec-row, .rec-acc li { grid-template-columns: 84px 1fr; gap: 8px; }
  .pipe-visual[data-stage] .rec-row[data-from] { padding-top: 0; padding-bottom: 0; }
  .pipe-visual[data-stage='1'] .rec-row[data-from='1'],
  .pipe-visual[data-stage='2'] .rec-row[data-from='1'],
  .pipe-visual[data-stage='3'] .rec-row[data-from='1'],
  .pipe-visual[data-stage='4'] .rec-row[data-from='1'],
  .pipe-visual[data-stage='3'] .rec-row[data-from='3'],
  .pipe-visual[data-stage='4'] .rec-row[data-from='3'] { padding: 6px 0; }
  .rec-row dt, .rec-acc li span { font-size: 11.5px; }
  .pipe-map { min-height: 0; }
  .pipe-map-label { display: none; }
}
@media (max-width: 520px) {
  /* the record needs the width; Chennai is tall and narrow, so the map
     becomes a slim strip beside it */
  .pipe-visual { --cols-solo: minmax(0, 1fr) 0px; --cols-mapped: minmax(0, 1fr) 88px; --gap-mapped: 10px; }
  .thread-note { display: none; }
  .rec-row, .rec-acc li { grid-template-columns: 76px 1fr; }
  .rec-id { flex-wrap: wrap; gap: 4px 12px; }
}
/* phones, and any short screen (a phone held sideways): the pinned record
   must leave room for the step being read. From stage 2 (enrichment) the
   raw rows give way to the ward and the six added fields; at stage 4 the MLA and zonal-officer lines already name
   the constituency and zone, so those rows give way as well. */
@media (max-width: 520px), (max-height: 500px) {
  /* the portal card keeps what the step is about: the number, the
     redacted person, the location without a ward, and the type */
  .portal-rows > .portal-opt, .portal-rows > .portal-dept { display: none; }
  .portal-rows > div { grid-template-columns: 96px minmax(0, 1fr); }
  .portal-head { padding: 6px 10px; border-bottom-width: 2px; }
  .portal-head b { font-size: 15px; }
  .portal-crest { width: 24px; height: 24px; font-size: 8px; }
  .portal-title { padding: 4px 10px; font-size: 13px; }
  .portal-rows dt, .portal-rows dd { padding: 4px 8px; }
  .pipe-visual[data-stage='2'] .rec-row[data-from='1']:not(.rec-ward),
  .pipe-visual[data-stage='3'] .rec-row[data-from='1']:not(.rec-ward) { max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; border-color: transparent; }
  .pipe-visual[data-stage='4'] .rec-row[data-from='3'] { max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; border-color: transparent; }
  /* the six fields keep their headline value only */
  .rec-sig .sig-more { display: none; }
  .rec-sig dl { margin-top: 8px; gap: 4px; }
  .rec-sig dl > div { padding: 6px 8px; gap: 2px; }
  .rec-sig dt { font-size: 9.5px; letter-spacing: .04em; }
  .rec-sig dd { font-size: 12px; }
  .pipe-visual[data-stage='2'] .rec-sig { margin-top: 10px; padding-top: 10px; }
}

@media (max-height: 500px) and (min-width: 521px) {
  /* the record needs the width here too; the map becomes a strip */
  .pipe-visual { --cols-mapped: minmax(0, 1.5fr) minmax(0, 0.5fr); --gap-mapped: 12px; align-items: center; }
  .thread-note { display: none; }
  /* tighter spacing so stage 4 (the tallest) fits in ~290px */
  .rec { padding: 10px 14px; }
  .rec-src { padding-bottom: 6px; }
  .rec-id { padding: 6px 0 2px; }
  .pipe-visual[data-stage='4'] .rec-acc { margin-top: 6px; padding-top: 8px; }
  .rec-acc ul { margin-top: 6px; gap: 4px; }
}

/* short screens (sideways phones): the portal card drops its title bar and
   note so it fits the ~290px the pinned visual has */
@media (max-height: 500px) {
  .portal-title, .portal-note { display: none; }
}
/* very narrow phones (360px and under): scale the pinned visual slightly
   and drop the record's source strip, so the step text keeps its room */
@media (max-width: 360px) and (min-height: 501px) {
  .pipe-visual { zoom: .88; }
  .rec-src { display: none; }
  .rec-id { padding-top: 0; }
}
