/* web.css (owner: board). 第2話 The evidence web (#web) and the practice thread (#practice-thread, inside #read).
   Every selector is scoped under #web, evidence-web or #practice-thread. Tokens come from base.css (bare :root, light only).
   Resting tilts and offsets use the CSS rotate / translate properties: FX writes element.style.transform on anything it kicks. */

/* ───────── section frame ───────── */
#web { --rail: 26px; --gut: 52px; --rowgap: 84px; --card-r: 12px; }

#web .web-intro { display: grid; gap: 14px; max-width: 780px; }
#web .web-intro__lede { font: 500 1.08em/1.6 var(--font-body); }
#web .web-skip { height: auto; min-height: 40px; padding: 7px 16px; white-space: normal; line-height: 1.25; }

/* ───────── the tool row: progress · lamps · reset ───────── */
#web .web-tools {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "prog" "lamps" "reset";
  gap: 4px 34px; margin-top: 22px; padding: 6px 18px 18px;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow);
}
#web .web-tools::before {   /* the screentone corner of the desk */
  content: ""; position: absolute; top: 0; right: 0; width: 38%; height: 70px; border-top-right-radius: 15px; pointer-events: none;
  background: linear-gradient(110deg, var(--paper) 0 30%, transparent 30.4%), var(--tone-dots);
}
#web .web-tools__prog { grid-area: prog; position: relative; display: grid; justify-items: center; min-width: 0; }
#web .web-tools__prog sakuga-progress { margin-inline: auto; }
#web .web-tools__count {
  margin-top: 12px; padding: 5px 14px 6px; border: 2px solid var(--ink); border-radius: 999px; background: var(--board);
  font: italic 900 15px/1.2 var(--font-head); text-align: center;
}
#web .web-tools__lamps { grid-area: lamps; display: grid; gap: 0 24px; min-width: 0; }
#web .web-lamp { display: flex; align-items: flex-end; gap: 0 2px; min-width: 0; }
#web .web-lamp sakuga-toggle { flex: none; }
#web .web-lamp__text { display: grid; gap: 4px; min-width: 0; padding-bottom: 18px; }
#web .web-lamp__label { justify-self: start; font: italic 900 17px/1.15 var(--font-head); cursor: pointer; text-decoration: underline dotted 1.5px; text-underline-offset: 4px; }
#web .web-lamp__cap { font: 500 13.5px/1.4 var(--font-body); color: var(--muted); }
#web .web-tools__reset { grid-area: reset; display: flex; justify-content: center; padding-top: 6px; }
@media (min-width: 700px) {
  #web .web-tools__lamps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  #web .web-tools { grid-template-columns: minmax(300px, 430px) minmax(0, 1fr); grid-template-areas: "prog lamps" "reset lamps"; align-items: center; padding: 6px 26px 18px; }
  #web .web-tools__lamps { grid-template-columns: minmax(0, 1fr); align-self: center; border-left: 2px dashed var(--soft); padding-left: 18px; }
  #web .web-tools__reset { align-self: start; }
}

/* ───────── the stage: board window + Nib's sticky box ───────── */
#web .web-stage { position: relative; margin-top: 34px; }

/* the manga browser window */
#web .bw { position: relative; border: 3px solid var(--ink); border-radius: 20px; background: var(--paper); box-shadow: 8px 9px 0 var(--soft); }
#web .bw__bar {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px;
  border-bottom: 3px solid var(--ink); border-radius: 17px 17px 0 0; background: var(--tone-dots), var(--wash);
}
#web .bw__dots { display: flex; gap: 7px; flex: none; }
#web .bw__dots i { width: 13px; height: 13px; border: 2.5px solid var(--ink); border-radius: 50%; background: var(--paper); }
#web .bw__dots i:first-child { background: var(--pink); }
#web .bw__url {
  flex: 1 1 200px; min-width: 0; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 10px;
  border: 2.5px solid var(--ink); border-radius: 999px; background: var(--paper);
  font: 700 13px/1 var(--font-mono); white-space: nowrap;
}
#web .bw__url-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 600px) { #web .bw__url { font-size: 14px; } }
#web .bw__lock { flex: none; color: var(--line); font-size: 15px; }
#web .bw__modes { display: flex; flex-wrap: wrap; gap: 6px; }
#web .bw__mode {
  display: none; align-items: center; height: 26px; padding: 0 10px; border: 2px solid var(--ink); border-radius: 6px;
  font: italic 900 12.5px/1 var(--font-head); letter-spacing: 0.04em; text-transform: uppercase; background: var(--paper);
}
#web .bw.is-chain .bw__mode[data-mode="chain"] { display: inline-flex; background: var(--hatch); }
#web .bw.is-uv .bw__mode[data-mode="uv"] { display: inline-flex; background: var(--ink); color: var(--on-ink); }

/* the string key: the window's status bar */
#web .bw__foot { padding: 12px 16px 14px; border-top: 3px solid var(--ink); border-radius: 0 0 17px 17px; background: var(--paper); }
#web .bw__key-h { font: italic 900 13px/1 var(--font-head); letter-spacing: 0.08em; text-transform: uppercase; color: var(--line); margin-bottom: 8px; }
#web .bw__key { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px 22px; }
#web .key__item { display: flex; align-items: flex-start; gap: 10px; margin: 0; font: 500 13px/1.4 var(--font-body); color: var(--ink); }
#web .key__item b { font: italic 900 13px/1.4 var(--font-head); }
#web .key__sw { flex: none; width: 44px; height: 12px; margin-top: 4px; overflow: visible; fill: none; stroke-linecap: round; }
@media (min-width: 760px) { #web .bw__key { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { #web .bw__key { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ───────── string styles (board, key, practice) ───────── */
#web .key__o, evidence-web .s__o { stroke: var(--ink); stroke-width: 4.4; }
#web .key__c, evidence-web .s__c { stroke: var(--soft); stroke-width: 2.4; }
evidence-web .s__o, evidence-web .s__c, evidence-web .s__d { fill: none; stroke-linecap: round; stroke-linejoin: round; }
#web .key__sw--analyst .key__c, evidence-web .s--analyst .s__c { stroke-dasharray: 10 3; stroke-linecap: butt; }
#web .key__sw--same-hand .key__o, #web .key__sw--offchain .key__o, #web .key__sw--checked .key__o { display: none; }
#web .key__sw--same-hand .key__c, evidence-web .s--same-hand .s__d { stroke: var(--line); stroke-width: 2.2; stroke-dasharray: 6 5; stroke-linecap: butt; }
#web .key__sw--offchain .key__c, evidence-web .s--offchain .s__d { stroke: var(--ink); stroke-width: 2.4; stroke-dasharray: 14 6; stroke-linecap: butt; }
#web .key__sw--checked .key__c, evidence-web .s--checked .s__d { stroke: var(--soft); stroke-width: 4.5; stroke-dasharray: 0.1 7; stroke-linecap: round; }
evidence-web .s--checked .s__o { stroke: var(--ink); stroke-width: 7.5; stroke-dasharray: 0.1 7; stroke-linecap: round; }
evidence-web .s.is-traced .s__c { stroke: var(--pink); }
evidence-web .s--checked.is-traced .s__d { stroke: var(--pink); }
evidence-web .s__peg { fill: var(--paper); stroke: var(--ink); stroke-width: 1.6; }
evidence-web .s.is-traced .s__peg { fill: var(--pink); }

/* pins (above the cards): paper heads at rest, pink once traced */
evidence-web .pin { fill: var(--paper); stroke: var(--ink); stroke-width: 2; transform-box: fill-box; transform-origin: center; }
evidence-web .pin.is-traced { fill: var(--pink); }
evidence-web .pin--same { fill: var(--wash); stroke: var(--line); }
evidence-web .pin--off { fill: var(--paper); stroke-dasharray: 2.5 2; }
evidence-web .pin__hi { fill: var(--paper); stroke: none; pointer-events: none; }

/* ───────── the board ───────── */
evidence-web {
  position: relative; display: block; isolation: isolate; padding: 64px 9px 30px;
  background: var(--tone-dots), var(--board); transform-origin: 50% 0;
}
evidence-web .board__bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
evidence-web .board__web {
  --web-size: 2200px; position: absolute; width: var(--web-size); height: var(--web-size);
  left: calc(var(--hub-x, 50%) - var(--web-size) / 2); top: calc(var(--hub-y, 46%) - var(--web-size) / 2);
}
evidence-web .board__web .a-web { width: 100%; height: 100%; }
evidence-web .web-strings, evidence-web .web-pins { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
evidence-web .web-strings { z-index: 1; }
evidence-web .board__grid { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 58px; }
evidence-web .web-pins { z-index: 3; }
evidence-web .web-labels { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
evidence-web .web-label { position: absolute; left: 0; top: 0; translate: -50% -50%; rotate: -4deg; }
evidence-web .web-sprite { position: absolute; right: 18px; top: -4px; z-index: 5; width: 44px; pointer-events: none; transform-origin: 50% 0; }
evidence-web .web-sprite svg { display: block; width: 44px; height: auto; }

/* lanes: dashed zones on the web, a plate on the border */
evidence-web .lane { position: relative; min-width: 0; padding: 0 6px 22px var(--rail); border: 2px dashed var(--soft); border-radius: 22px; }
evidence-web .lane__head { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 0; margin: -17px 0 20px -12px; max-width: calc(100% + 4px); }
evidence-web .lane__n {
  flex: none; padding: 7px 10px 6px; background: var(--ink); color: var(--on-ink); rotate: -4deg;
  font: 400 13px/1 var(--font-display); letter-spacing: 0.05em; text-transform: uppercase; box-shadow: 3px 3px 0 var(--pink);
}
evidence-web .lane__title {
  min-width: 0; margin-left: -3px; padding: 5px 11px 6px; background: var(--paper); border: 2.5px solid var(--ink);
  font: italic 900 15px/1.2 var(--font-head); box-shadow: 3px 4px 0 var(--soft);
}
evidence-web .lane__body { position: relative; }
evidence-web .lane__col { display: flex; flex-direction: column; align-items: stretch; min-width: 0; }
evidence-web .lane__col > * + * { margin-top: 30px; }
evidence-web .lane__col + .lane__col { margin-top: 30px; }

/* node cards: pinned evidence */
evidence-web .node {
  position: relative; min-width: 0; padding: 15px 14px 13px; background: var(--paper);
  border: 2.5px solid var(--ink); border-radius: var(--card-r); box-shadow: 5px 6px 0 var(--soft); rotate: -0.5deg;
}
evidence-web .lane__col > .node:nth-of-type(even) { rotate: 0.45deg; }
evidence-web .node__pin { position: absolute; top: -14px; left: 12px; line-height: 0; }
/* the stamp straddles the card's top edge but stays in flow, so a stamp that wraps never covers the nickname */
evidence-web .node__stamp { position: relative; z-index: 1; display: flex; justify-content: flex-end; margin: -31px -14px 6px 34px; line-height: 0; }
evidence-web .node__stamp .stamp { max-width: 100%; box-shadow: 2px 3px 0 var(--soft); }
evidence-web .node__head { display: flex; align-items: center; gap: 12px; min-width: 0; }
evidence-web .node__icon {
  flex: none; display: grid; place-items: center; width: 64px; height: 64px; border: 2px solid var(--ink); border-radius: 10px;
  background: var(--tone-dots), var(--wash); rotate: -3deg;
}
evidence-web .node__icon svg { display: block; }
evidence-web .node__id { min-width: 0; }
evidence-web .node__nick { font: italic 900 17.5px/1.15 var(--font-head); overflow-wrap: anywhere; }
evidence-web .node__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 8px; margin-top: 5px; }
evidence-web .node__meta .addr { font: 700 13.5px/1.3 var(--font-mono); }
evidence-web .node__chains { display: inline-flex; flex-wrap: wrap; gap: 4px; }
evidence-web .node__facts { list-style: none; margin: 11px 0 0; padding: 0; display: grid; gap: 6px; font: 500 14.5px/1.45 var(--font-body); }
evidence-web .node__facts li { position: relative; margin: 0; padding-left: 15px; }
evidence-web .node__facts li::before { content: ""; position: absolute; left: 1px; top: 0.62em; width: 6px; height: 6px; background: var(--ink); rotate: 45deg; }
evidence-web .node__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
evidence-web .node__foot .proofs { gap: 10px 8px; }
evidence-web .node__foot .proof { min-height: 32px; font-size: 12.5px; }
evidence-web .node__foot .proof__label.mono { font-size: 12.5px; }
evidence-web .web-anchors { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
evidence-web .web-anchor, #web .web-anchor { height: auto; min-height: 34px; padding: 5px 13px; white-space: normal; line-height: 1.2; font-size: 13.5px; }
evidence-web .node__hint { display: flex; margin-top: 12px; height: auto; min-height: 38px; padding: 7px 14px; white-space: normal; line-height: 1.3; font-size: 13.5px; border-style: dashed; }

/* the 18-wallet cluster: mini pins that are the proof links */
evidence-web .node__mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px 8px; width: 100%; margin-top: 6px; }
evidence-web .mini { position: relative; display: flex; min-width: 0; }
evidence-web .mini__pin {
  position: absolute; z-index: 1; top: -6px; left: -4px; width: 12px; height: 12px; border: 2px solid var(--ink); border-radius: 50%;
  background: var(--pink); box-shadow: 1.5px 1.5px 0 var(--ink); pointer-events: none;
}
evidence-web .proof--mini { flex: 1 1 auto; justify-content: space-between; min-height: 32px; padding: 3px 6px 3px 9px; min-width: 0; gap: 3px; font-size: 12px; box-shadow: 2px 2px 0 var(--soft); }
evidence-web .proof--mini .proof__label.mono { font-size: 12px; letter-spacing: -0.02em; overflow-wrap: normal; white-space: nowrap; }
evidence-web .proof--mini .proof__go { font-size: 13px; }

/* kinds */
evidence-web .node--hub {
  padding: 18px 18px 16px; border-width: 3px; rotate: 0deg;
  box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 6.5px var(--ink), 7px 8px 0 var(--soft);
}
evidence-web .node--hub .node__icon { width: 100px; height: 100px; border-width: 2.5px; }
evidence-web .node--hub .node__nick { font-size: 22px; }
evidence-web .node--hub .node__meta .addr { font-size: 15px; }
evidence-web .node--untouched { border-style: dashed; }
evidence-web .node--unknown { border-style: dashed; }
evidence-web .node--analyst::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 11px; border-radius: 9px 0 0 9px; background: var(--hatch); border-right: 2px solid var(--ink);
}
evidence-web .node--analyst { padding-left: 24px; }
evidence-web .node--offchain {
  padding: 16px 18px 14px; border: 2.5px dashed var(--ink); border-radius: 40px 46px 36px 44px / 34px 30px 40px 32px; box-shadow: none; rotate: -1deg;
  background: var(--tone-dots), var(--paper);
}
evidence-web .node--offchain .node__icon { border-style: dashed; background: var(--paper); }

/* UV prints (hidden until the lamp is on) */
evidence-web .node__print { display: none; position: absolute; right: -16px; top: -20px; z-index: 2; line-height: 0; pointer-events: none; rotate: 14deg; }
evidence-web .node__print svg { width: 54px; height: 54px; background: var(--ink); border-radius: 50%; box-shadow: 0 0 0 3px var(--soft); }
evidence-web .node__uvnote { display: none; margin-top: 10px; padding: 7px 10px; border: 2px dashed var(--line); border-radius: 8px; font: 600 13.5px/1.4 var(--font-body); color: var(--ink); background: var(--wash); }

/* printed notes on the board */
evidence-web .web-note { position: relative; z-index: 1; margin: 0; padding: 9px 12px 10px; font: 600 13.5px/1.42 var(--font-body); color: var(--ink); }
evidence-web .web-note--off {
  align-self: center; max-width: 92%; margin-top: 16px !important; padding: 6px 12px; background: var(--paper); border: 2px dashed var(--ink); rotate: 1.2deg;
  font: italic 800 13.5px/1.35 var(--font-head); text-align: center;
}
evidence-web .web-note--off + .node { margin-top: 16px; }
evidence-web .web-note--same { background: var(--paper); border: 2.2px dashed var(--line); border-radius: 10px; rotate: -0.6deg; }
evidence-web .web-note--same .proofs { margin-top: 8px; }
evidence-web .web-note--uv, evidence-web .web-note--chain { display: none; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 4px; box-shadow: 4px 4px 0 var(--ink); rotate: 0.8deg; }
evidence-web .web-note--uv::before, evidence-web .web-note--chain::before {
  content: ""; position: absolute; top: -9px; left: 50%; width: 54px; height: 16px; translate: -50% 0; rotate: -3deg; background: var(--tape); border: 1.5px solid var(--ink);
}

/* thread tags: evidence labels hung on the strings */
evidence-web .thread-tag {
  position: relative; z-index: 2; align-self: center; display: inline-flex; align-items: center; gap: 9px;
  width: auto; max-width: min(100%, 300px); min-height: 58px; margin-inline: auto; padding: 5px 14px 5px 6px;
  border: 2.5px solid var(--ink); border-radius: 15px; background: var(--paper); color: var(--ink); box-shadow: 4px 5px 0 var(--soft);
  font: inherit; text-align: left; cursor: grab; user-select: none; -webkit-user-select: none;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
evidence-web .thread-tag:active { cursor: grabbing; }
evidence-web .thread-tag:hover { box-shadow: 5px 6px 0 var(--soft); translate: 0 -1px; }
evidence-web .thread-tag__tent { flex: none; display: block; width: 46px; margin: -10px 0 -6px -14px; rotate: -6deg; }
evidence-web .thread-tag__tent svg { display: block; width: 46px; height: auto; }
evidence-web .thread-tag__body { display: grid; gap: 4px; min-width: 0; }
evidence-web .thread-tag__title { font: italic 900 16.5px/1.12 var(--font-head); }
evidence-web .thread-tag__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
evidence-web .thread-tag__time { font: 700 12.5px/1.2 var(--font-mono); color: var(--muted); }
evidence-web .thread-tag .badge { height: 20px; font-size: 12px; padding: 0 6px; }
evidence-web .thread-tag__check {
  position: absolute; top: -13px; right: -12px; display: grid; place-items: center; width: 28px; height: 28px;
  border: 2.5px solid var(--ink); border-radius: 50%; background: var(--pink); color: var(--ink); font: 900 15px/1 var(--font-head);
  scale: 0; transition: none;
}
evidence-web .thread-tag.is-traced { box-shadow: 4px 5px 0 var(--pink); }
evidence-web .thread-tag.is-traced .thread-tag__check { scale: 1; }

/* port chips: the phone's stand-ins for long cross-lane strings */
evidence-web .port {
  align-self: flex-start; height: auto; min-height: 38px; max-width: 100%; padding: 7px 14px 7px 12px; white-space: normal;
  line-height: 1.25; font-size: 13.5px; border-style: dashed; background: var(--paper);
}
evidence-web .port.is-traced { border-style: solid; box-shadow: 3px 4px 0 var(--pink); }
evidence-web .port--tag { align-self: center; }
evidence-web .node__ports { display: flex; flex-wrap: wrap; gap: 10px 8px; margin-top: 12px; padding-top: 11px; border-top: 2px dotted var(--soft); }

/* thread cards: open under their tag on the hit */
evidence-web .thread-card {
  position: relative; z-index: 2; min-width: 0; margin-top: 18px !important; padding: 17px 16px 15px;
  background: var(--paper); border: 2.5px solid var(--ink); border-radius: 14px; box-shadow: 5px 6px 0 var(--pink); transform-origin: 50% 0;
}
evidence-web .thread-card::before {   /* the notch that hangs it from its tag */
  content: ""; position: absolute; top: -12px; left: 50%; width: 20px; height: 20px; translate: -50% 0; rotate: 45deg;
  background: var(--paper); border-left: 2.5px solid var(--ink); border-top: 2.5px solid var(--ink);
}

/* ───────── thread body (board cards and transcript share it) ───────── */
#web .tcard__narr { font: 500 15px/1.6 var(--font-body); }
#web .tcard__pd { display: grid; gap: 8px; margin-top: 12px; }
#web .pd { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 8px 11px; border-radius: 8px; font: 500 14.5px/1.45 var(--font-body); }
#web .pd__h { flex: none; font: italic 900 13px/1.3 var(--font-head); letter-spacing: 0.05em; text-transform: uppercase; }
#web .pd__t { flex: 1 1 180px; min-width: 0; }
#web .pd--yes { background: var(--wash); border: 2px solid var(--ink); }
#web .pd--yes .pd__h::before { content: "✓ "; }
#web .pd--no { background: var(--paper); border: 2px dashed var(--ink); }
#web .pd--no .pd__h::before { content: "? "; }
#web .tcard__sub { margin-top: 16px; font: italic 900 12.5px/1 var(--font-head); letter-spacing: 0.08em; text-transform: uppercase; color: var(--line); }
#web .tcard__lines { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; counter-reset: ln; }
#web .ln { position: relative; margin: 0; padding: 9px 11px 10px 30px; border: 2px solid var(--rule); border-radius: 10px; background: var(--paper); counter-increment: ln; }
#web .ln::before {
  content: counter(ln); position: absolute; left: 7px; top: 9px; display: grid; place-items: center; width: 17px; height: 17px;
  border-radius: 50%; background: var(--ink); color: var(--on-ink); font: 700 12px/1 var(--font-mono);
}
#web .ln::after { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3.5px; border-radius: 2px; background: var(--line); }
#web .ln__route { font: 600 13.5px/1.4 var(--font-body); color: var(--muted); overflow-wrap: anywhere; }
#web .ln__arrow { color: var(--line); font-weight: 800; }
#web .ln__amt { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; }
#web .ln__amount { font: 700 14.5px/1.4 var(--font-body); color: var(--ink); }
#web .ln__amt .when { font-size: 13px; }
#web .ln__amt .badge { height: 20px; font-size: 12px; padding: 0 6px; }
#web .ln__note { margin-top: 4px; font: 500 13.5px/1.45 var(--font-body); color: var(--ink); }
#web .ln .proofs, #web .ex .proofs { margin-top: 8px; gap: 8px 6px; }
#web .ln .proof, #web .ex .proof { min-height: 32px; font-size: 12.5px; }
#web .ln--analyst::after, #web .ex--analyst::after { background: var(--hatch); width: 6px; border: 1px solid var(--ink); }
#web .ln--analyst::after { left: -1px; }
#web .tcard__total { margin-top: 10px; padding: 10px 12px; border: 2.5px solid var(--ink); border-radius: 10px; background: var(--tone-dots), var(--wash); }
#web .tcard__total-h { font: italic 900 12.5px/1.2 var(--font-head); letter-spacing: 0.06em; text-transform: uppercase; color: var(--line); }
#web .tcard__total-t { margin-top: 4px; font: 700 15px/1.4 var(--font-body); }
#web .tcard__total-n { margin-top: 4px; font: 500 13.5px/1.45 var(--font-body); }
#web .tcard__total .proofs { margin-top: 8px; }
#web .tcard__exit { margin-top: 10px; padding: 8px 12px; border: 2.5px solid var(--ink); border-radius: 10px; background: var(--wash); font: 700 14.5px/1.4 var(--font-body); }
#web .tcard__extra { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
#web .ex { position: relative; margin: 0; padding: 9px 11px 10px 14px; border-left: 3.5px solid var(--line); background: var(--board); border-radius: 0 10px 10px 0; }
#web .ex--said { border-left: 0; padding-left: 14px; background: var(--paper); box-shadow: inset 0 0 0 2px var(--paper); outline: 2px dashed var(--ink); outline-offset: -2px; }
#web .ex--analyst { border-left: 0; padding-left: 18px; }
#web .ex--analyst::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0; }
#web .ex__text { font: 500 14px/1.5 var(--font-body); }
#web .ex__text .badge { height: 20px; font-size: 12px; padding: 0 6px; margin-right: 4px; vertical-align: 1px; }
#web .tcard__exhibit { margin-top: 12px; text-align: right; }
#web .tcard__exhibit-tag {
  display: inline-block; padding: 4px 10px; border: 2px solid var(--ink); background: var(--tape); rotate: -2deg;
  font: italic 900 12.5px/1.2 var(--font-head); letter-spacing: 0.04em; text-transform: uppercase;
}

/* ───────── modes: chain-only, UV lamp, the knot's impact frame ───────── */
evidence-web.chain-only .node--analyst, evidence-web.chain-only .node--said {
  background: var(--hatch); box-shadow: 5px 6px 0 var(--rule);
}
evidence-web.chain-only .node--analyst .node__icon, evidence-web.chain-only .node--said .node__icon { background: var(--paper); }
evidence-web.chain-only .s--analyst .s__o, evidence-web.chain-only .s--analyst .s__c,
evidence-web.chain-only .s--offchain .s__d, evidence-web.chain-only .s--said .s__o, evidence-web.chain-only .s--said .s__c { stroke-opacity: 0.4; }
evidence-web.chain-only .port[data-badge="analyst"] { background: var(--hatch); }
evidence-web.chain-only .web-note--chain { display: block; }
evidence-web.chain-only .web-note--off { background: var(--hatch); }
evidence-web.chain-only .ln--analyst, evidence-web.chain-only .ln--said, evidence-web.chain-only .ex--analyst, evidence-web.chain-only .ex--said { background: var(--hatch); }

evidence-web.uv { background: var(--ink); }
evidence-web.uv .board__web .a-web__rings { stroke: var(--muted); }
evidence-web.uv .board__web .a-web__spokes, evidence-web.uv .board__web .a-web__hub { stroke: var(--line); }
evidence-web.uv .lane { border-color: var(--muted); }
evidence-web.uv .lane__title { background: var(--ink); color: var(--on-ink); border-color: var(--on-ink); box-shadow: 3px 4px 0 var(--line); }
evidence-web.uv .lane__n { background: var(--paper); color: var(--ink); }
evidence-web.uv .s__o { stroke: var(--ink); }
evidence-web.uv .s__c { stroke: var(--paper); }
evidence-web.uv .s.is-traced .s__c { stroke: var(--pink); }
evidence-web.uv .s--same-hand .s__d { stroke: var(--soft); stroke-width: 4; stroke-dasharray: 8 5; }
evidence-web.uv .s--checked .s__d { stroke: var(--paper); }
evidence-web.uv .s--offchain .s__d { stroke: var(--paper); }
evidence-web.uv .s__peg { fill: var(--ink); stroke: var(--paper); }
evidence-web.uv .pin { stroke: var(--paper); fill: var(--ink); }
evidence-web.uv .pin.is-traced { fill: var(--pink); }
evidence-web.uv .pin--same { fill: var(--soft); stroke: var(--paper); }
evidence-web.uv .node[data-uv] { box-shadow: 0 0 0 3px var(--soft), 7px 8px 0 var(--line); }
evidence-web.uv .node__print { display: block; }
evidence-web.uv .node__uvnote { display: block; }
evidence-web.uv .web-note--uv { display: block; }
evidence-web.uv .web-note--same { border-color: var(--soft); border-width: 3px; }
evidence-web.uv .thread-tag { box-shadow: 4px 5px 0 var(--line); }
evidence-web.uv .thread-tag.is-traced { box-shadow: 4px 5px 0 var(--pink); }

evidence-web.is-impact { background: var(--ink); }
evidence-web.is-impact .board__web .a-web__rings, evidence-web.is-impact .board__web .a-web__spokes { stroke: var(--paper); }
evidence-web.is-impact .lane { border-color: var(--paper); }
evidence-web.is-impact .s__o { stroke: var(--paper); }
evidence-web.is-impact .s__c, evidence-web.is-impact .s__d { stroke: var(--ink); }
evidence-web.is-impact .pin { fill: var(--ink); stroke: var(--paper); }

/* ───────── Nib's text box: the sticky visual-novel box ───────── */
#web .case-dialog { position: sticky; bottom: max(12px, env(safe-area-inset-bottom, 0px)); z-index: 40; margin: 30px auto 0; max-width: 1000px; }
#web .cd__frame {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "say" "nav" "tents";
  gap: 6px 16px; padding: 22px 12px 6px; background: var(--paper);
  border: 3px solid var(--ink); border-radius: 16px; box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 5px var(--soft), 6px 7px 0 var(--soft);
  transform-origin: 50% 100%;
}
#web .cd__frame::after {   /* the visual-novel "more" mark */
  content: ""; position: absolute; right: 16px; bottom: 9px; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 9px solid var(--pink);
}
#web .cd__portrait {
  position: absolute; top: -30px; left: 8px; z-index: 1; display: grid; place-items: center; width: 52px; height: 52px;
  border: 3px solid var(--ink); border-radius: 50%; background: var(--paper); box-shadow: 3px 3px 0 var(--pink); line-height: 0;
}
#web .cd__portrait svg { width: 40px; height: auto; }
#web .cd__plate {
  position: absolute; top: -16px; left: 66px; display: inline-flex; align-items: center; height: 28px; padding: 0 13px;
  background: var(--ink); color: var(--on-ink); rotate: -2deg; font: italic 900 13.5px/1 var(--font-head); letter-spacing: 0.08em; text-transform: uppercase;
}
#web .cd__say { grid-area: say; min-width: 0; }
#web .cd__step { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-bottom: 4px; }
#web .cd__of { font: italic 900 13px/1.2 var(--font-head); letter-spacing: 0.06em; text-transform: uppercase; color: var(--line); }
#web .cd__title { font: italic 900 16.5px/1.2 var(--font-head); }
#web .cd__time { font: 700 12.5px/1.2 var(--font-mono); color: var(--muted); }
#web .cd__text { font: 500 15px/1.45 var(--font-body); }
#web .cd__nav { grid-area: nav; display: flex; align-items: center; gap: 12px; }
#web .cd__nav sakuga-button::part(button) { min-height: 44px; padding: 9px 16px; font-size: 16px; }
#web .cd__tents { grid-area: tents; display: grid; grid-template-columns: repeat(6, 44px); justify-content: start; gap: 0 4px; margin-left: -4px; }
#web .cd__tent { position: relative; width: 44px; height: 44px; min-width: 44px; padding: 3px; border-radius: 10px; }
#web .cd__tent .tent__art { min-width: 0; }
#web .cd__tent svg { width: 30px; }
#web .cd__tent[aria-current="step"] { background: var(--wash); box-shadow: inset 0 -4px 0 var(--ink); }
#web .cd__tick {
  position: absolute; top: 0; right: 0; display: grid; place-items: center; width: 18px; height: 18px; border: 2px solid var(--ink);
  border-radius: 50%; background: var(--pink); color: var(--ink); font: 900 12px/1 var(--font-head); scale: 0;
}
#web .cd__tent.is-traced .cd__tick { scale: 1; }
@media (min-width: 560px) {
  #web .cd__tents { grid-template-columns: repeat(12, 44px); }
}
@media (min-width: 1000px) {
  #web .cd__frame { grid-template-columns: 84px minmax(0, 1fr) auto; grid-template-areas: "por say nav" "por tents tents"; padding: 18px 20px 10px 18px; align-items: center; }
  #web .cd__portrait { position: relative; top: auto; left: auto; grid-area: por; align-self: start; width: 78px; height: 78px; margin-top: -2px; }
  #web .cd__portrait svg { width: 66px; }
  #web .cd__plate { left: 108px; }
  #web .cd__nav sakuga-button::part(button) { padding: 11px 20px; font-size: 17px; }
}

/* ───────── the transcript ───────── */
#web .transcript { margin-top: clamp(54px, 8vw, 96px); }
#web .transcript:focus { outline: none; }
#web .transcript__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; padding-bottom: 12px; border-bottom: 3px solid var(--ink); }
#web .transcript__h { font: italic 400 clamp(26px, 5.6vw, 38px)/1.05 var(--font-display); }
#web .transcript__sub { font: italic 800 15px/1.3 var(--font-head); color: var(--muted); }
#web .tr-act { margin-top: 34px; }
#web .tr-act__h {
  display: inline-block; padding: 8px 14px 7px; background: var(--ink); color: var(--on-ink); rotate: -1.5deg; box-shadow: 4px 4px 0 var(--pink);
  font: italic 900 15px/1.1 var(--font-head); letter-spacing: 0.06em; text-transform: uppercase;
}
#web .tr-act__grid { display: grid; gap: 22px; margin-top: 18px; }
@media (min-width: 1000px) { #web .tr-act__grid { display: block; columns: 2; column-gap: 26px; } #web .tr-act__grid > .tr { margin-bottom: 26px; } }
#web .tr { position: relative; min-width: 0; padding: 16px 16px 14px; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 14px; box-shadow: 5px 6px 0 var(--soft); break-inside: avoid; }
#web .tr.is-traced { box-shadow: 5px 6px 0 var(--pink); }
#web .tr__head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
#web .tr__tent { flex: none; line-height: 0; margin-top: -4px; rotate: -5deg; }
#web .tr__tent svg { width: 42px; height: auto; }
#web .tr__id { min-width: 0; display: grid; gap: 3px; }
#web .tr__k { font: italic 900 12.5px/1.2 var(--font-head); letter-spacing: 0.08em; text-transform: uppercase; color: var(--line); }
#web .tr__traced { color: var(--pink-ink); }
#web .tr__h { margin: 0; font: italic 900 19px/1.15 var(--font-head); }
#web .tr__time { font: 700 13px/1.2 var(--font-mono); color: var(--muted); }
#web .tr__show { margin-top: 12px; }

/* ───────── ≥ 1000px: the three-column web ───────── */
@media (min-width: 1000px) {
  evidence-web { padding: 74px 18px 34px; }
  evidence-web .board__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: "l1 l2 l3" "l4 l4 l4" "l5 l5 l6";
    column-gap: var(--gut); row-gap: var(--rowgap); align-items: start;
  }
  evidence-web .lane { grid-area: var(--area); }
  evidence-web .lane--wide { display: grid; grid-template-columns: subgrid; grid-template-rows: auto 1fr; }
  evidence-web .lane--wide > .lane__head { grid-column: 1 / -1; justify-self: start; }
  evidence-web .lane--wide > .lane__body { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: start; }
  evidence-web .lane--wide .lane__col { grid-row: 1; }
  evidence-web .lane--wide .lane__col[data-col="1"] { grid-column: 1; }
  evidence-web .lane--wide .lane__col[data-col="2"] { grid-column: 2; }
  evidence-web .lane--wide .lane__col[data-col="3"] { grid-column: 3; }
  evidence-web .lane--wide .lane__col + .lane__col { margin-top: 0; }
  evidence-web .lane__col > * + * { margin-top: 34px; }
  evidence-web .port, evidence-web .node__ports { display: none; }
  #web .lane[data-lane="bridge"] .node--hub { margin-top: 8px; }
}

/* ───────── the practice thread (#practice-thread, inside #read) ───────── */
#practice-thread { margin-top: 16px; }
#practice-thread .practice__board {
  position: relative; isolation: isolate; display: flex; justify-content: space-between; align-items: flex-start;
  min-height: 178px; padding: 26px 16px 18px; border: 3px solid var(--ink); border-radius: 18px;
  background: var(--tone-dots), var(--board); box-shadow: var(--shadow);
}
#practice-thread .practice__pin {
  position: relative; z-index: 2; display: grid; justify-items: center; gap: 6px; min-width: 74px; padding: 12px 12px 10px;
  border: 2.5px dashed var(--ink); border-radius: 12px; background: var(--paper);
}
#practice-thread .practice__pin--from { rotate: -2deg; }
#practice-thread .practice__pin--to { rotate: 2deg; }
#practice-thread .practice__dot { width: 16px; height: 16px; border: 2.5px solid var(--ink); border-radius: 50%; background: var(--paper); box-shadow: 2px 2px 0 var(--ink); }
#practice-thread.is-traced .practice__dot { background: var(--pink); }
#practice-thread .practice__label { font: italic 900 16px/1 var(--font-head); }
#practice-thread .practice__string { position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: 1; overflow: visible; pointer-events: none; fill: none; stroke-linecap: round; }
#practice-thread .ps__o { stroke: var(--ink); stroke-width: 4.4; }
#practice-thread .ps__c { stroke: var(--soft); stroke-width: 2.4; }
#practice-thread.is-traced .ps__c { stroke: var(--pink); }
#practice-thread .practice__tag {
  position: absolute; z-index: 3; left: 50%; top: 92px; translate: -50% 0; display: inline-flex; align-items: center; gap: 9px;
  max-width: calc(100% - 40px); min-height: 52px; padding: 6px 16px 6px 8px; border: 2.5px dashed var(--ink); border-radius: 14px;
  background: var(--paper); color: var(--ink); box-shadow: 4px 5px 0 var(--soft); font: italic 900 15px/1.2 var(--font-head);
  cursor: grab; user-select: none; -webkit-user-select: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; text-align: left;
}
#practice-thread .practice__zero {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; border: 2.5px dashed var(--ink); border-radius: 50%;
  background: var(--tape); font: 400 16px/1 var(--font-display);
}
#practice-thread .practice__check {
  position: absolute; top: -12px; right: -11px; display: grid; place-items: center; width: 26px; height: 26px; border: 2.5px solid var(--ink);
  border-radius: 50%; background: var(--pink); color: var(--ink); font: 900 14px/1 var(--font-head); scale: 0;
}
#practice-thread.is-traced .practice__check { scale: 1; }
#practice-thread.is-traced .practice__tag { box-shadow: 4px 5px 0 var(--pink); }
#practice-thread .practice__caption { min-height: 1.5em; margin-top: 12px; font: italic 800 16px/1.4 var(--font-head); color: var(--ink); }

/* reduced motion: web.js snaps every spring (FX.animate) and draws nothing; base.css already turns off CSS transitions */

/* the backdrop web: quieter spokes so the strings read first */
evidence-web .board__web .a-web__spokes { stroke: var(--soft); }
evidence-web .board__web .a-web__rings { stroke: var(--tone); }
evidence-web .board__web .a-web__hub { stroke: var(--soft); }

/* proof chips in narrow board columns: the short id never breaks mid-hash; a long site name gives way first */
evidence-web .proof__label.mono, #web .tr .proof__label.mono { flex: none; white-space: nowrap; overflow-wrap: normal; }
evidence-web .proof__site { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#practice-thread .practice__board { max-width: 720px; }
/* chips never push past their card: the row is as wide as its box, a chip at most that wide, the site name gives way */
#web .proofs { min-width: 0; max-width: 100%; }
#web .proofs > .proof { max-width: 100%; }
evidence-web .node__foot > .proofs { flex: 1 1 100%; }
#web .tr .proof__site { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* very narrow cards (desktop columns at ~1000px): drop the site name, keep the kind and the short id */
evidence-web .node, evidence-web .web-note--same { container-type: inline-size; }
@container (max-width: 240px) { evidence-web .proof__site { display: none; } }

/* port chips: the lane never breaks away from its dot */
evidence-web .port__lane { white-space: nowrap; }

/* static focus lines (集中線) behind the drop point, at the centre of the web; they never move */
evidence-web .board__focus {
  position: absolute; width: calc(var(--hub-w, 300px) + 300px); height: calc(var(--hub-h, 320px) + 260px);
  left: calc(var(--hub-x, 50%) - (var(--hub-w, 300px) + 300px) / 2); top: calc(var(--hub-y, 46%) - (var(--hub-h, 320px) + 260px) / 2);
}
evidence-web .board__focus .a-focus { width: 100%; height: 100%; }
evidence-web.uv .board__focus .a-f-tone, evidence-web.is-impact .board__focus .a-f-tone { fill: var(--muted); }

@media (max-width: 699px) {
  evidence-web .web-sprite, evidence-web .web-sprite svg { width: 38px; }
}

/* proof chips in board cards: a touch tighter, so most site names fit beside the short id */
evidence-web .node .proof, evidence-web .web-note .proof { gap: 4px; padding-right: 8px; }
evidence-web .node .proof__kind, evidence-web .web-note .proof__kind { padding: 0 5px; letter-spacing: 0.03em; }
