:root {
  --paper: #f3eee3;
  --paper-deep: #ebe4d4;
  --sheet: #f8f5ee;
  --ink: #1d1b17;
  --ink-2: #57524a;
  --ink-3: #8a8374;
  --rule: #cfc6b2;
  --rule-soft: #e0d8c6;
  --accent: #b3261e;
  --serif: "PT Serif", Georgia, serif;
  --sans: "PT Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "PT Mono", "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.11 0 0 0 0 0.1 0 0 0 0 0.09 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.masthead {
  max-width: 1440px;
  margin: 0 auto;
  padding: 40px 40px 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: end;
  border-bottom: 1.5px solid var(--ink);
}

.kicker { font: 12px var(--mono); color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 14px; }
.masthead h1 {
  margin: 0;
  font: 700 56px/1 var(--serif);
  letter-spacing: -0.01em;
}

.masthead .lede {
  margin: 14px 0 0;
  max-width: 60ch;
  font: 19px/1.45 var(--serif);
  color: var(--ink-2);
}

.imprint {
  font: 12px/1.6 var(--mono);
  color: var(--ink-2);
  border-left: 1px solid var(--rule);
  padding-left: 16px;
  min-width: 260px;
}

.imprint div { display: flex; justify-content: space-between; gap: 24px; }
.imprint b { color: var(--ink); font-weight: 400; }

nav.sheets {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  gap: 28px;
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 20;
}

nav.sheets a {
  white-space: nowrap;
  padding: 12px 0 10px;
  text-decoration: none;
  color: var(--ink-2);
  border-bottom: 2px solid transparent;
}

nav.sheets a:hover { color: var(--ink); }
nav.sheets a.on { color: var(--ink); border-color: var(--ink); }
nav.sheets .n { font-family: var(--mono); color: var(--ink-3); margin-right: 6px; }
nav.sheets .progress {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--accent); transform-origin: 0 50%; transform: scaleX(0);
}

section.sheet {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
  scroll-margin-top: 44px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 36px 40px 56px;
  border-bottom: 1px solid var(--rule);
}

.sheet-head {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0 24px;
  margin-bottom: 24px;
}

.sheet-no {
  font: 12px/1.3 var(--mono);
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-top: 8px;
}

.sheet-no b { display: block; font: 700 40px/1 var(--serif); color: var(--ink); letter-spacing: 0; }

.sheet-head h2 { margin: 0; font: 700 32px/1.15 var(--serif); }
.sheet-head p { margin: 8px 0 0; max-width: 72ch; color: var(--ink-2); font-size: 16px; }

.plate {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 28px;
  align-items: start;
}

.mapframe {
  position: relative;
  background: var(--sheet);
  padding: 10px;
  border: 1.5px solid var(--ink);
}

.mapframe svg { display: block; width: 100%; height: auto; }

.mapframe svg path { vector-effect: non-scaling-stroke; }
.mapframe svg { cursor: grab; }
.mapframe svg:active { cursor: grabbing; }
.mo { stroke: var(--sheet); stroke-width: 0.25; cursor: pointer; }
.mo.nodata { cursor: default; }
.mo:hover { stroke: var(--ink); stroke-width: 0.9; }
.region { fill: none; stroke: var(--ink); stroke-width: 0.55; stroke-opacity: 0.55; pointer-events: none; }
.coast { fill: none; stroke: var(--ink); stroke-width: 0.9; pointer-events: none; }
.graticule { fill: none; stroke: var(--rule); stroke-width: 0.5; stroke-dasharray: 2 3; }
.sphere { fill: none; }
.selected-outline { fill: none; stroke: var(--ink); stroke-width: 1.8; pointer-events: none; }
.twin-outline { fill: none; stroke: var(--ink); stroke-width: 1; stroke-dasharray: 2 1.5; pointer-events: none; }
.zoombar { position: absolute; top: 22px; right: 24px; display: flex; flex-direction: column; border: 1px solid var(--ink); background: var(--sheet); }
.zoombar button { font: 12px var(--sans); padding: 5px 9px; border: 0; background: var(--sheet); color: var(--ink); cursor: pointer; text-align: left; }
.zoombar button + button { border-top: 1px solid var(--rule); }
.zoombar button:hover { background: var(--paper-deep); }
.zoomhint { position: absolute; top: 22px; left: 26px; font: 11px var(--sans); color: var(--ink-3); pointer-events: none; }
.twin-arc { fill: none; stroke: var(--ink); stroke-width: 1.1; stroke-linecap: round; pointer-events: none; }
.twin-dot { fill: var(--sheet); stroke: var(--ink); stroke-width: 1.2; }
.dim .mo:not(.lit) { opacity: 0.18; }

.map-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  margin-bottom: 14px;
}

.search { position: relative; }
.search input {
  width: 300px;
  font: 15px var(--sans);
  padding: 8px 10px;
  border: 1px solid var(--ink);
  background: var(--sheet);
  color: var(--ink);
  border-radius: 0;
}
.search input:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.search ul {
  position: absolute;
  z-index: 30;
  top: 100%;
  left: 0;
  right: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--sheet);
  border: 1px solid var(--ink);
  border-top: 0;
  max-height: 320px;
  overflow: auto;
}
.search li { padding: 7px 10px; cursor: pointer; font-size: 14px; border-top: 1px solid var(--rule-soft); }
.search li small { color: var(--ink-3); display: block; font-size: 12px; }
.search li.on, .search li:hover { background: var(--paper-deep); }

.toggle { display: inline-flex; border: 1px solid var(--ink); }
.toggle button {
  font: 13px var(--sans);
  padding: 7px 12px;
  background: var(--sheet);
  color: var(--ink);
  border: 0;
  cursor: pointer;
}
.toggle button + button { border-left: 1px solid var(--ink); }
.toggle button.on { background: var(--ink); color: var(--sheet); }

.timescale { margin-top: 14px; display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: center; }
.timescale button.play {
  width: 44px; height: 30px;
  border: 1px solid var(--ink);
  background: var(--sheet);
  cursor: pointer;
  font: 13px var(--mono);
}
.timescale > svg { width: 100%; height: 46px; display: block; cursor: pointer; touch-action: none; }
.timescale .seg { stroke: var(--ink); stroke-width: 1; }
.timescale .lbl { font: 11px var(--mono); fill: var(--ink-2); }
.timescale .cur { fill: var(--accent); }
.timescale .curlbl { font: 700 12px var(--mono); fill: var(--accent); }

.legend h3, .card h3, .panel h3 {
  font: 700 13px/1.2 var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 10px;
}

.legend { margin-top: 26px; }
.legend ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; }
.legend li {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 7px 0;
  border-top: 1px solid var(--rule-soft);
  cursor: pointer;
}
.legend li:nth-last-child(-n+2) { border-bottom: 1px solid var(--rule-soft); }
.legend li:hover .tname, .legend li.on .tname { text-decoration: underline; text-underline-offset: 3px; }
.legend li.off { opacity: 0.35; }
.legend .tname { font-size: 15px; line-height: 1.25; }
.legend .tcount { font: 13px var(--mono); color: var(--ink-2); }
.legend svg { display: block; }
.legend .note { font-size: 13px; color: var(--ink-3); margin-top: 10px; }

aside .card {
  position: sticky;
  top: 60px;
  max-height: calc(100vh - 76px);
  overflow: auto;
}

.card {
  background: var(--sheet);
  border: 1.5px solid var(--ink);
  padding: 18px 20px 20px;
  position: relative;
}

.card .no {
  position: absolute;
  top: 12px;
  right: 16px;
  font: 12px var(--mono);
  color: var(--ink-3);
}

.card h4 { margin: 2px 0 2px; font: 700 24px/1.15 var(--serif); padding-right: 70px; }
.card .sub { color: var(--ink-2); font-size: 14px; }

.card .typebadge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--ink);
  font-size: 14px;
}

.card .row { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--rule); }
.card .kv { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 14px; }
.card .kv span:nth-child(odd) { color: var(--ink-2); }

.card .empty { color: var(--ink-2); font: italic 17px/1.5 var(--serif); padding: 30px 0 10px; }
.card .empty b { font-style: normal; }

.twins { list-style: none; margin: 0; padding: 0; }
.twins li {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: 10px;
  align-items: baseline;
  padding: 6px 0;
  border-top: 1px dotted var(--rule);
  cursor: pointer;
  font-size: 14px;
}
.twins li:hover .nm { text-decoration: underline; }
.twins .sw { width: 12px; height: 12px; align-self: center; }
.twins small { color: var(--ink-3); display: block; font-size: 12px; }
.twins .sim { font: 12px var(--mono); color: var(--ink-2); }

.tooltip {
  position: fixed;
  left: 0;
  top: 0;
  pointer-events: none;
  z-index: 50;
  background: var(--ink);
  color: var(--sheet);
  padding: 9px 11px;
  font-size: 13px;
  line-height: 1.38;
  max-width: 320px;
  opacity: 0;
  transition: opacity 0.12s;
  box-shadow: 0 6px 18px rgba(29, 27, 23, 0.25);
}
.tooltip.on { opacity: 1; }
.tooltip.with-art { display: grid; grid-template-columns: 1fr 64px; gap: 12px; align-items: center; }
.tooltip .tip-art svg { display: block; background: var(--sheet); border-radius: 50%; }
.tooltip b { font-family: var(--serif); font-size: 15px; }
.tooltip .t { color: #d9d1bf; }

.portraits {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1.5px solid var(--ink);
  border-left: 1px solid var(--rule);
}

.portrait {
  padding: 18px 18px 20px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  background: transparent;
}
.portrait:hover { background: var(--sheet); }
.portrait .pno { font: 12px var(--mono); color: var(--ink-3); }
.portrait h4 { margin: 4px 0 2px; font: 700 19px/1.2 var(--serif); min-height: 46px; }
.portrait .desc { margin: 6px 0 0; font-size: 14px; line-height: 1.45; color: var(--ink-2); min-height: 82px; }
.portrait .facts { font-size: 13px; color: var(--ink-2); }
.portrait .facts b { color: var(--ink); font-weight: 400; font-family: var(--mono); }
.portrait .ex { font-size: 13px; color: var(--ink-2); margin-top: 8px; font-style: italic; font-family: var(--serif); }

.drift { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; }
.panel { background: var(--sheet); border: 1px solid var(--ink); padding: 16px 18px; }
.movers { list-style: none; margin: 0; padding: 0; font-size: 14px; max-height: 520px; overflow: auto; }
.movers li { padding: 7px 0; border-top: 1px dotted var(--rule); cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.movers li:hover .nm { text-decoration: underline; }
.movers small { display: block; color: var(--ink-3); font-size: 12px; }
.movers .path { display: flex; align-items: center; gap: 4px; }
.movers .path i { width: 12px; height: 12px; display: inline-block; }

.flow-label { font: 12px var(--sans); fill: var(--ink); }
.flow-count { font: 11px var(--mono); fill: var(--ink-2); }
.flow-col { font: 11px var(--mono); fill: var(--ink-3); text-anchor: middle; }

.axis text { font: 11px var(--mono); fill: var(--ink-2); }
.axis path, .axis line { stroke: var(--rule); }

.method {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1.5px solid var(--ink);
}
.method .step { padding: 16px 18px 20px 0; border-right: 1px solid var(--rule); margin-right: 18px; }
.method .step:last-child { border-right: 0; }
.method .step .sn { font: 700 28px/1 var(--serif); }
.method .step h4 { margin: 8px 0 6px; font: 700 16px/1.25 var(--sans); }
.method .step p { margin: 0; font-size: 14px; color: var(--ink-2); }

footer {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 40px 48px;
  font-size: 13px;
  color: var(--ink-2);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.failed {
  padding: 120px 0;
  text-align: center;
  font: italic 18px var(--serif);
  color: var(--ink-2);
}

@media (max-width: 1100px) {
  .plate, .drift { grid-template-columns: 1fr; }
  aside .card { position: static; max-height: none; }
  .portraits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .method { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  .masthead, nav.sheets, section.sheet, footer { padding-left: 16px; padding-right: 16px; }
  .masthead { grid-template-columns: 1fr; }
  .kicker { font: 12px var(--mono); color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 14px; }
.masthead h1 { font-size: 38px; }
  .sheet-head { grid-template-columns: 1fr; }
  .portraits, .method, footer { grid-template-columns: 1fr; }
  nav.sheets { overflow-x: auto; }
  .search, .search input { width: 100%; }
  .card { padding: 16px 14px 18px; }
  .card .kv { grid-template-columns: 1fr; gap: 0 0; }
  .card .kv span:nth-child(even) { margin-bottom: 6px; }
  .legend ol { grid-template-columns: 1fr; }
  .legend li:nth-last-child(2) { border-bottom: 0; }
  .zoombar, .zoomhint { display: none; }
}

section.sheet.in { opacity: 1; transform: none; }

#loader {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-content: center; justify-items: center; gap: 14px;
  background: var(--paper);
  transition: opacity 0.6s ease, visibility 0.6s;
}
body:not(.loading) #loader { opacity: 0; visibility: hidden; }
#loader svg { overflow: visible; }
#loader rect, #loader path { fill: none; stroke: var(--ink); stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.ld-frame { stroke-width: 2; animation: draw 1.1s ease forwards; }
.ld-inner { stroke-width: 0.8; animation: draw 1.1s 0.25s ease forwards; }
.ld-grat { stroke-width: 0.6; stroke: var(--ink-3) !important; animation: draw 1.4s 0.5s ease forwards; }
.ld-title { font: 700 22px var(--serif); }
.ld-status { font: 12px var(--mono); color: var(--ink-2); }
@keyframes draw { to { stroke-dashoffset: 0; } }

.maplbl { font: 10px var(--mono); fill: var(--ink-2); }
.mapnote { font: 10px var(--sans); fill: var(--ink-3); }
.plate-title .pt-month { font: 700 20px var(--serif); fill: var(--ink); paint-order: stroke; stroke: var(--sheet); stroke-width: 5px; }
.plate-title .pt-note { font: 12px var(--mono); fill: var(--accent); paint-order: stroke; stroke: var(--sheet); stroke-width: 4px; }
.pulse { fill: none; stroke: var(--ink); stroke-width: 2.2; animation: pulse 1.5s ease-out forwards; pointer-events: none; }
@keyframes pulse { 0% { stroke-opacity: 0; } 12% { stroke-opacity: 1; } 100% { stroke-opacity: 0; } }
.peek-outline { fill: rgba(29, 27, 23, 0.12); stroke: var(--ink); stroke-width: 2.2; pointer-events: none; }
.sel-label { font: 700 14px var(--serif); paint-order: stroke; stroke: var(--sheet); stroke-width: 4px; stroke-linejoin: round; }
.sel-label.ink { stroke: none; fill: var(--ink); }
.twin-no { font: 700 9px var(--mono); fill: var(--ink); }
.mo { transition: opacity 0.35s ease; }

.chip {
  position: absolute; left: 24px; bottom: 58px; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  background: var(--ink); color: var(--sheet); padding: 6px 6px 6px 12px; font-size: 13px;
  animation: rise 0.3s ease;
}
.chip[hidden] { display: none; }
.chip button { background: none; border: 1px solid rgba(248, 245, 238, 0.4); color: var(--sheet); cursor: pointer; width: 24px; height: 24px; font-size: 15px; line-height: 1; }
.chip button:hover { background: rgba(248, 245, 238, 0.12); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.zoomhint { top: auto; bottom: 22px; left: auto; right: 26px; }
.search kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font: 11px var(--mono); color: var(--ink-3); border: 1px solid var(--rule); padding: 1px 5px; background: var(--paper);
}
.search input:focus + kbd { display: none; }

button { transition: background-color 0.15s ease, color 0.15s ease; }
.timescale button.play { display: grid; place-items: center; }
.timescale button.play:hover { background: var(--ink); }
.timescale button.play:hover path { fill: var(--sheet); }
.timescale .cur { transition: none; }

.card.enter > * { animation: rise 0.45s ease both; }
.card.enter > *:nth-child(2) { animation-delay: 0.04s; }
.card.enter > *:nth-child(3) { animation-delay: 0.08s; }
.card.enter > *:nth-child(4) { animation-delay: 0.12s; }
.card.enter > *:nth-child(5) { animation-delay: 0.16s; }
.card.enter > *:nth-child(6) { animation-delay: 0.2s; }
.card.enter > *:nth-child(7) { animation-delay: 0.24s; }
.card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.card-actions button {
  font: 12px var(--sans); padding: 5px 9px; border: 1px solid var(--ink); background: var(--sheet); color: var(--ink); cursor: pointer;
}
.card-actions button:hover { background: var(--ink); color: var(--sheet); }
.card > .card-actions button:last-child { margin-left: auto; font-size: 15px; padding: 2px 9px; }
.card .card-title { display: flex; justify-content: space-between; align-items: baseline; }
.card .card-title .no { position: static; font-weight: 400; letter-spacing: 0; text-transform: none; }
.card .vs { margin-top: 10px; font-size: 14px; }
.card .pick-hint { margin-top: 10px; font-size: 13px; background: var(--paper-deep); padding: 6px 10px; border-left: 3px solid var(--accent); }
.card .hint { font-size: 12px; color: var(--ink-3); }
.note-month:empty { display: none; }
.note-month { margin-top: 8px; }
.rosebox { display: flex; justify-content: center; padding: 30px 0 26px; }
.traj-lbl { font: 9.5px var(--mono); fill: var(--ink-3); }
.ln-nat { fill: none; stroke: var(--ink-3); stroke-width: 1.5; stroke-dasharray: 4 3; }
.ln-cmp { fill: none; stroke: var(--accent); stroke-width: 1.8; }
.ln-main { fill: none; stroke: var(--ink); stroke-width: 2; }
.ln-lbl { font: 11px var(--sans); fill: var(--ink-2); }
.ln-main-lbl { font-weight: 700; fill: var(--ink); }
.ln-cmp-lbl { fill: var(--accent); }
.ln-hover { font: 10.5px var(--mono); }
.twins .tn { font-size: 12px; color: var(--ink-3); }
.twins .sim { display: flex; align-items: center; gap: 6px; }
.twins .sim i { display: inline-block; height: 4px; background: var(--ink-2); }
.twins li { transition: background-color 0.15s; }
.twins li:hover { background: var(--paper-deep); }
table.cmp { width: 100%; border-collapse: collapse; font-size: 13px; }
table.cmp th { text-align: left; font-weight: 700; font-size: 12px; padding: 4px 6px; border-bottom: 1px solid var(--ink); }
table.cmp td { padding: 4px 6px; border-bottom: 1px dotted var(--rule); position: relative; }
table.cmp td .num { position: relative; }
table.cmp .cbar { position: absolute; left: 0; top: 4px; bottom: 4px; background: rgba(29, 27, 23, 0.1); }
table.cmp .cbar.alt { background: rgba(179, 38, 30, 0.14); }

.portrait { transition: background-color 0.2s, transform 0.25s ease; }
.portrait:hover { transform: translateY(-3px); }
.portrait .prose { display: flex; justify-content: center; padding: 14px 0 20px; }
.portrait .more { margin-top: 10px; font-size: 13px; color: var(--ink-3); opacity: 0; transition: opacity 0.2s; }
.portrait:hover .more { opacity: 1; color: var(--ink); }
.portrait .ex a { color: inherit; }

.space-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.space-stage { position: relative; background: var(--sheet); border: 1.5px solid var(--ink); }
.space-stage canvas.space { display: block; width: 100%; }
.space-stage svg.space-brush { position: absolute; inset: 0; width: 100%; }
.space-stage .space-mode { position: absolute; top: 14px; left: 14px; z-index: 2; }
.space-brush .selection { fill: rgba(29, 27, 23, 0.06); stroke: var(--ink); stroke-dasharray: 3 3; }
.space-panel { position: sticky; top: 60px; }
.space-panel .space-mini { width: 100%; display: none; margin-top: 14px; border: 1px solid var(--rule); }
.sel-count { font: 18px var(--serif); margin-bottom: 8px; }
.sel-count b { font-size: 28px; font-weight: 400; }
.stackbar { display: flex; height: 12px; gap: 2px; margin: 6px 0 10px; }
.stackbar i { display: block; min-width: 2px; }
.mini-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.mini-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; padding: 3px 0; border-top: 1px dotted var(--rule); }
.mini-list li:not(:has(i)) { grid-template-columns: 1fr auto; }
.mini-list i { width: 10px; height: 10px; display: inline-block; }

.flow { transition: opacity 0.25s ease; cursor: pointer; fill-opacity: 0.75; stroke: var(--ink); stroke-width: 0.3; }
.flow.stay { fill-opacity: 0.28; stroke: none; }
.flow:hover { fill-opacity: 0.95; }
.flow.faded, .flow-node.faded { opacity: 0.12; }
.flow-node { stroke: var(--ink); stroke-width: 0.8; transition: opacity 0.25s ease; cursor: default; }
.flow-label { cursor: default; }
.movers-panel select { width: 100%; font: 14px var(--sans); padding: 6px 8px; margin: 4px 0 8px; border: 1px solid var(--ink); background: var(--sheet); color: var(--ink); border-radius: 0; }
.movers-panel .card-actions { margin: 12px 0 0; }
.movers { max-height: 430px; }

.net-table { overflow-x: auto; margin-bottom: 14px; }
table.rules { width: 100%; border-collapse: collapse; font-size: 13px; }
table.rules th { text-align: left; font: 700 11px var(--sans); text-transform: uppercase; letter-spacing: 0.06em; padding: 8px 10px; border-bottom: 1.5px solid var(--ink); white-space: nowrap; }
table.rules td { padding: 8px 10px; border-bottom: 1px solid var(--rule-soft); position: relative; white-space: nowrap; }
table.rules tbody tr { cursor: pointer; transition: background-color 0.15s; }
table.rules tbody tr:hover { background: var(--sheet); }
table.rules tbody tr.on { background: var(--ink); color: var(--sheet); }
table.rules tbody tr.on .tbar { background: rgba(248, 245, 238, 0.22); }
table.rules .tbar { position: absolute; left: 10px; bottom: 5px; height: 3px; max-width: calc(100% - 20px); background: rgba(29, 27, 23, 0.25); transition: width 0.4s ease; }
.net-desc { max-width: 90ch; color: var(--ink-2); font-size: 15px; min-height: 48px; }
.net-stage { position: relative; padding: 0; }
.net-stage canvas { display: block; width: 100%; }
.net-stage canvas.net-edges, .net-stage canvas.net-hover { position: absolute; left: 0; top: 0; }
.net-stage canvas.net-edges { transition: opacity 0.18s ease; }
.net-stage canvas.net-edges.fade { opacity: 0; }
.net-stage canvas.net-hover { cursor: crosshair; }
#network > .note { font-size: 13px; color: var(--ink-3); max-width: 90ch; }

@media (max-width: 1100px) {
  .space-wrap { grid-template-columns: 1fr; }
  .space-panel { position: static; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  section.sheet { opacity: 1; transform: none; }
}

.mx-tools { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.mx-label { font: 13px var(--sans); color: var(--ink-3); letter-spacing: 0.04em; text-transform: uppercase; }
.mx-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; }
.mx-panel { overflow-x: auto; }
.mx-panel svg { display: block; width: 100%; min-width: 620px; }
.mx-col { font: 12px var(--mono); fill: var(--ink-3); text-anchor: middle; }
.mx-row { font: 14px var(--sans); fill: var(--ink); text-anchor: end; }
.mx-sep { stroke: var(--ink); stroke-width: 1; }
.cell { cursor: pointer; }
.cell text { font: 13px var(--mono); text-anchor: middle; pointer-events: none; }
.cell rect { stroke: var(--sheet); stroke-width: 2; }
.cell.na { cursor: default; }
.cell.win rect { stroke: var(--ink); stroke-width: 1.5; }
.cell.final rect { stroke: var(--accent); stroke-width: 3; }
.cell.picked rect { stroke-dasharray: 3 2; stroke: var(--accent); stroke-width: 2; }
.cell.final.picked rect { stroke-dasharray: none; stroke-width: 4; }
.cell:not(.na):hover rect { stroke: var(--accent); }
.mx-detail h3 { font: 700 22px/1.2 var(--serif); margin: 4px 0 4px; text-transform: none; letter-spacing: 0; }
.mx-detail .kicker { font: 12px var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.mx-sub { margin: 0 0 10px; color: var(--ink-2); font-size: 14px; }
.mx-ranks { display: flex; gap: 14px; font-size: 13px; color: var(--ink-3); margin: 0 0 12px; flex-wrap: wrap; }
.mx-ranks .on { color: var(--ink); }
.mx-strips { display: grid; gap: 8px; }
.mx-strip { display: grid; grid-template-columns: 1fr auto; row-gap: 2px; font-size: 13px; }
.mx-strip small { color: var(--ink-3); }
.mx-strip b { font: 13px var(--mono); }
.mx-strip svg { grid-column: 1 / -1; width: 100%; height: 26px; }
.strip-axis { stroke: var(--rule); }
.strip-peer { stroke: var(--ink-3); stroke-width: 1; opacity: 0.45; }
.strip-me { fill: var(--accent); stroke: var(--sheet); stroke-width: 2; }
.mx-stab { font-size: 14px; margin: 10px 0 0; }
.mx-foot { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 28px; margin-top: 28px; }
.mx-foot svg { width: 100%; display: block; }
.axis text { font: 11px var(--mono); fill: var(--ink-3); }
.axis path, .axis line { stroke: var(--rule); }
.w-line { fill: none; stroke: var(--ink); stroke-width: 2; }
.w-dot { fill: var(--accent); stroke: var(--sheet); stroke-width: 2; }
.why { margin: 0; padding-left: 20px; font-size: 15px; line-height: 1.5; }
.why li + li { margin-top: 8px; }
.null-box { margin: 6px 0 10px; border-top: 1px dotted var(--rule); border-bottom: 1px dotted var(--rule); padding: 8px 0; }
.null-box svg { width: 100%; display: block; }
.null-box .note { margin: 4px 0 0; font-size: 12.5px; }
.null-bar { fill: var(--rule); }
.null-obs { stroke: var(--accent); stroke-width: 2.5; }
.null-lbl { font: 12px var(--sans); fill: var(--accent); }
.fca { margin: 10px 0 6px; font-size: 13px; border-left: 2px solid var(--ink); padding-left: 10px; }
.fca-h { font: 11px var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.fca ul { margin: 4px 0; padding: 0; list-style: none; font-family: var(--mono); font-size: 12px; }
.fca small { color: var(--ink-3); }
@media (max-width: 1100px) {
  .mx-wrap, .mx-foot { grid-template-columns: 1fr; }
}
.card .bd { margin: 8px 0 0; font-size: 13px; border-left: 2px solid var(--accent); padding-left: 8px; }
