/* src/d3-page.css */
:root {
  --type-ink: #111111;
  --type-blue: #0047ff;
  --type-red: #d91f26;
  --type-yellow: #ffd400;
  --line-soft: #d8dee8;
  --paper: #ffffff;
  --field: #f6f7f9;
  color-scheme: light;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: var(--field);
  color: var(--type-ink);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--field);
}
button,
a {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}
.graphShell {
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}
.graphHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--paper);
}
.titleGroup {
  min-width: 0;
}
.graphHeader h1 {
  display: inline;
  margin: 0;
  color: var(--type-blue);
  font-size: 26px;
  line-height: 1.15;
  box-shadow: inset 0 -0.28em 0 var(--type-yellow);
}
.graphHeader p:last-child {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--type-ink);
  font-size: 14px;
  line-height: 1.45;
}
.graphActions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.graphActions button,
.graphActions a {
  min-height: 36px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 8px 11px;
  color: var(--type-blue);
  background: var(--paper);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}
.graphActions button:hover,
.graphActions a:hover {
  border-color: #9aa9bd;
  background: #f8fafc;
}
.graphActions .primary {
  border-color: var(--type-blue);
  background: var(--type-blue);
  color: var(--paper);
}
.graphActions .active {
  border-color: var(--type-blue);
  background: #eef3ff;
  color: var(--type-blue);
}
.aboutModal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(17, 17, 17, 0.48);
}
.aboutModal.hidden {
  display: none;
}
.aboutPanel {
  width: min(620px, 100%);
  border: 1px solid var(--type-ink);
  border-radius: 8px;
  padding: 22px;
  background: var(--paper);
  box-shadow: 0 24px 80px rgba(17, 17, 17, 0.22);
}
.aboutPanel h2 {
  display: inline;
  margin: 0;
  color: var(--type-blue);
  font-size: 30px;
  line-height: 1.08;
  box-shadow: inset 0 -0.28em 0 var(--type-yellow);
}
.aboutPanel p {
  margin: 12px 0 0;
  color: var(--type-ink);
  font-size: 14px;
  line-height: 1.55;
}
.aboutPanel a {
  color: var(--type-red);
  font-weight: 800;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.aboutPanel ul {
  display: grid;
  gap: 7px;
  margin: 16px 0 0;
  padding-left: 19px;
  color: var(--type-ink);
  font-size: 14px;
  line-height: 1.45;
}
.aboutPanel li::marker {
  color: var(--type-red);
}
.aboutPanel strong {
  color: var(--type-red);
}
.aboutPanel code {
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 1px 4px;
  color: var(--type-blue);
  background: #fff9cc;
  font-size: 0.9em;
}
.modalActions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.modalActions a,
.modalActions button {
  min-height: 38px;
  border: 1px solid var(--type-ink);
  border-radius: 8px;
  padding: 9px 12px;
  background: var(--paper);
  color: var(--type-blue);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}
.modalActions button {
  border-color: var(--type-blue);
  background: var(--type-blue);
  color: var(--paper);
}
.graphStage {
  position: relative;
  min-height: 0;
  overflow: hidden;
}
.graphSvg {
  width: 100%;
  height: 100%;
  display: block;
  background:
    linear-gradient(#edf1f7 1px, transparent 1px),
    linear-gradient(
      90deg,
      #edf1f7 1px,
      transparent 1px),
    #f8fafc;
  background-size: 32px 32px;
}
.links line {
  stroke: #aab6c6;
  stroke-opacity: 0.78;
}
.links line.flow {
  stroke: #64748b;
  stroke-dasharray: 7 6;
}
.layerBand rect {
  fill: rgba(255, 255, 255, 0.82);
  stroke: var(--type-ink);
  stroke-width: 1.4;
}
.layerBand.platform rect {
  fill: #fff7ed;
  stroke: #d97706;
  stroke-width: 2;
}
.layerBand text {
  fill: var(--type-ink);
  pointer-events: none;
}
.layerBand .layerBandTitle {
  fill: var(--type-blue);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}
.layerBand .layerBandNote {
  fill: var(--type-red);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}
.annotationLead {
  stroke: #98a2b3;
  stroke-width: 1.2;
  stroke-dasharray: 4 4;
  fill: none;
}
.annotationBox rect {
  fill: #ffffff;
  stroke: #cfd8e3;
  rx: 8;
  filter: drop-shadow(0 10px 18px rgba(15, 23, 42, 0.09));
}
.annotationBox text {
  fill: var(--type-ink);
  font-size: 12px;
  pointer-events: none;
}
.annotationBox .annotationTitle {
  fill: var(--type-red);
  font-size: 13px;
  font-weight: 800;
}
.node {
  cursor: grab;
}
.node:active {
  cursor: grabbing;
}
.node circle,
.node rect {
  filter: drop-shadow(0 5px 10px rgba(15, 23, 42, 0.12));
}
.node text {
  pointer-events: none;
  fill: var(--type-blue);
  font-size: 12px;
  font-weight: 800;
  text-anchor: middle;
}
.node .subLabel {
  fill: var(--type-red);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}
.node.selected circle,
.node.selected rect {
  stroke: var(--type-blue);
  stroke-width: 3;
}
.detailCard {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: min(360px, calc(100vw - 36px));
  border: 1px solid #d8e0eb;
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.13);
}
.detailCard .label {
  margin: 0 0 6px;
  color: var(--type-red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}
.detailCard h2 {
  margin: 0 0 8px;
  color: var(--type-blue);
  font-size: 18px;
  line-height: 1.2;
}
.detailCard p {
  margin: 0;
  color: var(--type-ink);
  font-size: 13px;
  line-height: 1.45;
}
.detailCard dl {
  display: grid;
  gap: 7px;
  margin: 12px 0 0;
}
.detailCard div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
}
.detailCard dt {
  color: var(--type-red);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.detailCard dd {
  min-width: 0;
  margin: 0;
  color: var(--type-ink);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.loadState {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  color: var(--type-blue);
  background: var(--field);
  font-size: 15px;
  font-weight: 800;
}
@media (max-width: 760px) {
  .graphShell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }
  .graphHeader {
    align-items: stretch;
    flex-direction: column;
    padding: 14px;
  }
  .graphActions {
    align-items: stretch;
    flex-direction: column;
  }
  .graphActions button,
  .graphActions a {
    width: 100%;
    text-align: center;
  }
  .aboutModal {
    align-items: end;
    padding: 14px;
  }
  .aboutPanel {
    padding: 18px;
  }
  .aboutPanel h2 {
    font-size: 25px;
  }
  .modalActions a,
  .modalActions button {
    width: 100%;
    text-align: center;
  }
  .graphStage {
    min-height: 720px;
  }
}
