:root > * {
  --md-primary-fg-color: #0b2239;
  --md-primary-fg-color--light: #153b5d;
  --md-primary-fg-color--dark: #071827;
  --md-accent-fg-color: #087f78;
  --ink: #0b2239;
  --teal: #087f78;
  --teal-soft: #dff5f1;
  --amber: #d78b22;
  --paper: #f6f8fa;
  --line: #d7e1e8;
}

body { background: #f4f7f9; }
[hidden] { display: none !important; }
.md-main__inner { margin-top: 1.25rem; }
.md-content__inner { max-width: 1180px; }
.md-typeset h1 { color: var(--ink); font-weight: 760; letter-spacing: -.035em; }
.md-typeset h2 { color: var(--ink); font-weight: 700; }
.md-header { box-shadow: 0 1px 0 rgba(255,255,255,.12); }

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(240px, .7fr);
  gap: 2rem;
  padding: clamp(1.5rem, 4vw, 3.2rem);
  border-radius: 20px;
  color: #eef8fb;
  background:
    radial-gradient(circle at 90% 10%, rgba(99,213,199,.23), transparent 28%),
    linear-gradient(135deg, #0b2239 0%, #123a56 62%, #0d625f 145%);
  box-shadow: 0 20px 50px rgba(11,34,57,.17);
}
.hero-panel h2 { color: #fff; margin: .2rem 0 .6rem; font-size: clamp(1.55rem, 4vw, 2.65rem); }
.hero-panel p { color: #dcebf0; max-width: 700px; }
.hero-panel .md-button { color: #fff; border-color: rgba(255,255,255,.55); margin: .35rem .4rem .2rem 0; }
.hero-panel .md-button--primary { background: #63d5c7; border-color: #63d5c7; color: #082a31; }
.eyebrow { color: #f4b860; font-size: .72rem; letter-spacing: .18em; font-weight: 800; }
.hero-metrics { display: grid; gap: .7rem; align-content: center; }
.hero-metrics div { display: flex; align-items: baseline; justify-content: space-between; padding: .85rem 1rem; border: 1px solid rgba(255,255,255,.18); border-radius: 12px; background: rgba(255,255,255,.06); }
.hero-metrics strong { color: #f4b860; font-size: 1.65rem; }
.hero-metrics span { color: #dcebf0; font-size: .76rem; }

.scope-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1rem 0 2rem; }
.scope-grid article { position: relative; padding: 1.2rem; border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; }
.scope-grid h3 { margin: .25rem 0 .35rem; }
.scope-grid p { margin: 0; color: #516473; }
.scope-index { color: var(--teal); font-size: .72rem; font-weight: 800; letter-spacing: .14em; }

.component-browser { margin: 1.5rem 0 3rem; padding: 1rem; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 10px 32px rgba(11,34,57,.07); }
.browser-toolbar { display: flex; gap: .7rem; justify-content: space-between; align-items: end; margin-bottom: 1rem; }
.browser-toolbar label { display: grid; gap: .35rem; flex: 1; color: #4a6070; font-size: .72rem; font-weight: 700; }
.component-search { width: 100%; max-width: 520px; padding: .7rem .85rem; border: 1px solid #b9cbd5; border-radius: 10px; background: #f9fbfc; color: var(--ink); font: inherit; }
.component-search:focus { outline: 3px solid rgba(8,127,120,.18); border-color: var(--teal); }
.source-toggle { padding: .67rem .85rem; border: 1px solid #b9cbd5; border-radius: 9px; background: #fff; color: var(--ink); cursor: pointer; }
.component-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.component-card { display: grid; gap: .28rem; min-height: 142px; padding: 1rem; border: 1px solid #d7e1e8; border-radius: 12px; text-align: left; background: #fbfcfd; color: var(--ink); cursor: pointer; transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease; }
.component-card:hover { transform: translateY(-2px); border-color: #86cfc6; box-shadow: 0 8px 18px rgba(11,34,57,.09); }
.component-card[aria-pressed="true"] { border-color: var(--teal); background: var(--teal-soft); box-shadow: inset 4px 0 0 var(--teal); }
.component-card strong { font-size: .92rem; }
.card-category { color: var(--amber); font-size: .64rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.card-model { color: #30495a; font-size: .75rem; line-height: 1.4; }
.card-interface { align-self: end; color: #6b7c88; font-size: .65rem; line-height: 1.35; }
.component-detail { margin-top: 1rem; padding: 1.15rem; border-radius: 13px; color: #eaf4f7; background: var(--ink); }
.detail-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: start; }
.detail-heading h2 { color: #fff; margin: .1rem 0 1rem; }
.detail-kicker { color: #63d5c7; font-size: .7rem; font-weight: 800; letter-spacing: .12em; }
.status-chip { padding: .28rem .55rem; border: 1px solid rgba(244,184,96,.55); border-radius: 999px; color: #ffd796; font-size: .65rem; white-space: nowrap; }
.component-detail dl { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; margin: 0; }
.component-detail dl div { padding: .75rem; border: 1px solid rgba(255,255,255,.12); border-radius: 9px; background: rgba(255,255,255,.045); }
.component-detail dt { color: #8de0d6; font-size: .66rem; font-weight: 800; }
.component-detail dd { margin: .22rem 0 0; color: #edf5f7; font-size: .76rem; }
.detail-note { margin: .8rem 0 0; color: #c4d3d9; font-size: .7rem; }
.component-source-table { margin-top: -2rem !important; margin-bottom: 3rem !important; background: #fff; }
.empty-result { grid-column: 1 / -1; color: #637784; }

.md-typeset img[src$=".svg"] { padding: .8rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 8px 28px rgba(11,34,57,.07); }
.md-typeset table:not([class]) { border-radius: 10px; overflow: hidden; }

@media (max-width: 900px) {
  .hero-panel { grid-template-columns: 1fr; }
  .scope-grid, .component-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .scope-grid, .component-grid, .component-detail dl { grid-template-columns: 1fr; }
  .browser-toolbar, .detail-heading { align-items: stretch; flex-direction: column; }
  .source-toggle { width: 100%; }
}

/* Product photo browser */
.component-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.component-card {
  display: block;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 15px;
  background: #fff;
}
.component-card[aria-pressed="true"] { background: #fff; box-shadow: 0 0 0 3px rgba(8,127,120,.18); }
.card-photo { position: relative; display: block; height: 190px; padding: .8rem; background: linear-gradient(145deg, #eef3f5, #fff); }
.card-photo img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.card-status {
  position: absolute;
  top: .7rem;
  right: .7rem;
  max-width: calc(100% - 1.4rem);
  padding: .22rem .48rem;
  border-radius: 999px;
  color: #fff;
  background: rgba(11,34,57,.84);
  font-size: .56rem;
  line-height: 1.3;
  backdrop-filter: blur(6px);
}
.card-copy { display: grid; gap: .3rem; padding: .9rem 1rem 1rem; border-top: 1px solid #e2eaee; }
.card-copy strong { color: var(--ink); font-size: .98rem; }
.card-photo-note {
  display: -webkit-box;
  min-height: 2.5em;
  overflow: hidden;
  color: #73838e;
  font-size: .62rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.component-modal-open { overflow: hidden; }
.component-detail {
  position: fixed;
  inset: 0;
  z-index: 1000;
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
}
.detail-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(3,15,25,.74); backdrop-filter: blur(5px); cursor: zoom-out; }
.detail-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  grid-template-columns: minmax(300px, .9fr) minmax(420px, 1.2fr);
  width: min(1120px, calc(100vw - 2rem));
  max-height: min(820px, calc(100vh - 2rem));
  overflow: auto;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 20px;
  background: #0b2239;
  box-shadow: 0 30px 90px rgba(0,0,0,.38);
  transform: translate(-50%, -50%);
}
.detail-close {
  position: absolute;
  z-index: 2;
  top: .7rem;
  right: .8rem;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 50%;
  color: #fff;
  background: rgba(11,34,57,.72);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.detail-photo-wrap { display: grid; grid-template-rows: minmax(330px, 1fr) auto; min-height: 100%; padding: 1rem; background: #edf3f5; }
.detail-photo { width: 100%; height: 100%; max-height: 520px; object-fit: contain; border-radius: 12px; background: #fff; mix-blend-mode: multiply; }
.photo-caption { display: grid; gap: .18rem; padding: .7rem .25rem 0; color: #536874; font-size: .65rem; line-height: 1.45; }
.photo-caption strong { color: var(--ink); }
.photo-source { width: fit-content; color: var(--teal) !important; font-weight: 700; }
.detail-content { padding: 1.6rem; color: #eaf4f7; }
.model-callout { display: grid; gap: .22rem; margin: 0 0 1rem; padding: .85rem 1rem; border-left: 4px solid #f4b860; border-radius: 8px; background: rgba(255,255,255,.07); }
.model-callout span { color: #9bb1bc; font-size: .64rem; font-weight: 700; }
.model-callout strong { color: #fff; font-size: 1rem; }
.component-detail dl { grid-template-columns: 1fr; }
.component-detail dl div { padding: .7rem .8rem; }

@media (max-width: 900px) {
  .component-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-dialog { grid-template-columns: 1fr; }
  .detail-photo-wrap { grid-template-rows: 280px auto; }
}

@media (max-width: 620px) {
  .component-grid { grid-template-columns: 1fr 1fr; gap: .55rem; }
  .card-photo { height: 128px; padding: .45rem; }
  .card-copy { padding: .7rem; }
  .card-copy strong { font-size: .82rem; }
  .card-model { font-size: .66rem; }
  .card-photo-note { display: none; }
  .detail-dialog { width: calc(100vw - .8rem); max-height: calc(100vh - .8rem); border-radius: 14px; }
  .detail-photo-wrap { grid-template-rows: 230px auto; }
  .detail-content { padding: 1.1rem; }
}

/* Interactive physical wiring map */
.connection-workbench {
  margin: 1rem 0 3rem;
  padding: clamp(.8rem, 2vw, 1.25rem);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 38px rgba(11,34,57,.08);
}
.connection-toolbar { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.connection-tabs { display: flex; flex-wrap: wrap; gap: .4rem; }
.connection-tab, .connection-source-toggle {
  padding: .55rem .78rem;
  border: 1px solid #c5d4dc;
  border-radius: 999px;
  color: #3c5261;
  background: #f8fafb;
  font: inherit;
  font-size: .68rem;
  font-weight: 700;
  cursor: pointer;
}
.connection-tab[aria-selected="true"] { border-color: var(--ink); color: #fff; background: var(--ink); }
.connection-source-toggle { flex: 0 0 auto; border-radius: 9px; background: #fff; }
.connection-summary { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin: 1rem 0 .7rem; color: #5c707d; font-size: .66rem; }
.connection-summary strong { margin-right: .3rem; color: var(--ink); font-size: .82rem; }
.connection-summary span { padding: .2rem .45rem; border-radius: 999px; background: #eef3f5; }
.connection-summary .summary-confirmed { color: #066b65; background: #dff5f1; }
.connection-summary .summary-pending { color: #8a5514; background: #fff0d6; }
.connection-list { display: grid; gap: .65rem; }
.connection-route {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(260px, 1.65fr) minmax(170px, 1fr);
  gap: .8rem;
  align-items: center;
  width: 100%;
  padding: .72rem;
  overflow: hidden;
  border: 1px solid #d9e3e8;
  border-radius: 14px;
  color: var(--ink);
  background: #fbfcfd;
  text-align: left;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.connection-route:hover { transform: translateY(-1px); border-color: #8fc9c2; box-shadow: 0 8px 20px rgba(11,34,57,.08); }
.connection-route[aria-pressed="true"] { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(8,127,120,.13); }
.wire-endpoint { display: grid; grid-template-columns: 74px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; gap: .18rem .65rem; min-width: 0; }
.wire-photo { grid-row: 1 / 3; width: 74px; height: 66px; padding: .3rem; border: 1px solid #dce5e9; border-radius: 10px; background: #fff; }
.wire-photo img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.wire-part { align-self: end; overflow: hidden; color: var(--ink); font-size: .72rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.wire-port { align-self: start; color: #607582; font-size: .6rem; line-height: 1.35; }
.wire-span { display: grid; gap: .26rem; min-width: 0; text-align: center; }
.wire-cable { overflow: hidden; color: #314b5b; font-size: .64rem; font-weight: 750; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.wire-protocol { overflow: hidden; color: #71838e; font-size: .57rem; text-overflow: ellipsis; white-space: nowrap; }
.wire-track { position: relative; display: block; height: 14px; }
.wire-track::before { content: ''; position: absolute; top: 6px; left: 0; right: 0; border-top: 3px solid #15978d; }
.wire-track::after { content: ''; position: absolute; top: 2px; right: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 9px solid #15978d; }
.wire-track i { position: absolute; z-index: 1; top: 1px; left: calc(50% - 6px); width: 12px; height: 12px; border: 3px solid #15978d; border-radius: 50%; background: #fff; }
.connection-route.pending .wire-track::before { border-top-color: #d78b22; border-top-style: dashed; }
.connection-route.pending .wire-track::after { border-left-color: #d78b22; }
.connection-route.pending .wire-track i { border-color: #d78b22; }
.connection-route.relationship .wire-track::before { border-top-color: #81919a; border-top-style: dashed; }
.connection-route.relationship .wire-track::after { border-left-color: #81919a; }
.connection-route.relationship .wire-track i { border-color: #81919a; }
.connection-detail { margin-top: .8rem; padding: 1rem; border: 1px solid #bdd8d4; border-radius: 14px; background: #eff9f7; }
.connection-detail.connection-popover { position: fixed; z-index: 1000; width: min(480px, calc(100vw - 24px)); max-height: min(620px, calc(100dvh - 24px)); box-sizing: border-box; overflow: auto; overscroll-behavior: contain; margin: 0; padding: 0 18px 18px; box-shadow: 0 12px 40px rgba(11,34,57,.24); }
.connection-popover-bar { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; margin: 0 -18px 14px; padding: 6px 8px 6px 18px; background: #dcece8; border-bottom: 1px solid #bdd8d4; }
.connection-popover-drag { flex: 1; align-self: stretch; border: 0; background: transparent; color: #345765; font-size: 14px; text-align: left; cursor: grab; touch-action: none; user-select: none; }
.connection-popover-drag.dragging { cursor: grabbing; }
.connection-popover-close { flex: 0 0 32px; width: 32px; height: 32px; border: 0; border-radius: 8px; background: #eff9f7; color: #234257; font-size: 26px; cursor: pointer; }
.connection-popover .connection-detail-heading { flex-wrap: wrap; }
.connection-popover .wire-state { white-space: normal; }
.connection-popover .connection-pinout, .connection-popover dl { min-width: 0; overflow-wrap: anywhere; }
.topology-node { transition: opacity .16s ease, filter .16s ease; }
.topology-nodes.wire-hovering .topology-node:not(.wire-related) { opacity: .16; filter: blur(1.5px) grayscale(.8); }
.connection-detail-heading { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
.connection-detail-heading span:first-child { color: var(--teal); font-size: .6rem; font-weight: 800; letter-spacing: .1em; }
.connection-detail-heading h3 { margin: .12rem 0 .7rem; color: var(--ink); }
.wire-state { padding: .25rem .5rem; border-radius: 999px; color: #066b65; background: #d3eee9; font-size: .6rem; white-space: nowrap; }
.wire-state.pending { color: #81500f; background: #ffe7bd; }
.wire-state.relationship { color: #526570; background: #e0e7ea; }
.connection-pinout { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .8rem; margin-bottom: .7rem; }
.connection-pinout div { display: grid; gap: .12rem; padding: .65rem .75rem; border: 1px solid #d1e2df; border-radius: 9px; background: #fff; }
.connection-pinout small { color: #738690; font-size: .56rem; }
.connection-pinout strong { color: var(--ink); font-size: .7rem; }
.connection-pinout span { color: #3e5968; font-size: .65rem; }
.connection-pinout b { color: var(--teal); }
.connection-detail dl { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; margin: 0; }
.connection-detail dl div { padding: .65rem .75rem; border-radius: 9px; background: rgba(255,255,255,.72); }
.connection-detail dl div:last-child { grid-column: 1 / -1; }
.connection-detail dt { color: #56707c; font-size: .58rem; font-weight: 800; }
.connection-detail dd { margin: .18rem 0 0; color: var(--ink); font-size: .68rem; line-height: 1.5; }
.connection-source-table { margin-top: -2rem !important; margin-bottom: 3rem !important; background: #fff; }

@media (max-width: 820px) {
  .connection-toolbar { align-items: stretch; flex-direction: column; }
  .connection-source-toggle { align-self: start; }
  .connection-route { grid-template-columns: minmax(130px, 1fr) minmax(150px, 1.15fr) minmax(130px, 1fr); gap: .45rem; }
  .wire-endpoint { grid-template-columns: 52px minmax(0, 1fr); gap: .12rem .4rem; }
  .wire-photo { width: 52px; height: 52px; }
}

@media (max-width: 620px) {
  .connection-route { grid-template-columns: 1fr 78px 1fr; padding: .55rem; }
  .wire-endpoint { display: flex; flex-direction: column; align-items: center; text-align: center; }
  .wire-photo { width: 64px; height: 58px; }
  .wire-part { width: 100%; font-size: .64rem; }
  .wire-port { font-size: .55rem; }
  .wire-cable, .wire-protocol { white-space: normal; font-size: .52rem; }
  .connection-detail-heading { flex-direction: column; }
  .connection-pinout { grid-template-columns: 1fr; }
  .connection-pinout b { transform: rotate(90deg); justify-self: center; }
  .connection-detail dl { grid-template-columns: 1fr; }
  .connection-detail dl div:last-child { grid-column: auto; }
}

/* Global interactive topology */
.connection-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.connection-toolbar .connection-tabs { grid-column: 1 / -1; }
.connection-toolbar .connection-source-toggle { grid-column: 2; grid-row: 2; }
.topology-zoom { display: flex; align-items: center; gap: .28rem; margin-left: auto; }
.connection-toolbar .topology-zoom { grid-column: 1; grid-row: 2; justify-self: start; margin-left: 0; }
.topology-zoom button {
  min-width: 2rem;
  height: 2rem;
  padding: 0 .55rem;
  border: 1px solid #c5d4dc;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: .65rem;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
}
.topology-zoom .zoom-level { min-width: 2.8rem; color: #5d727e; font-size: .62rem; text-align: center; }
.connection-list {
  position: relative;
  display: block;
  height: min(720px, 70vh);
  min-height: 560px;
  overflow: auto;
  border: 1px solid #cad8df;
  border-radius: 14px;
  background-color: #f8fafb;
  background-image: radial-gradient(#cbd7dc 1px, transparent 1px);
  background-size: 20px 20px;
  cursor: grab;
  overscroll-behavior: contain;
}
.connection-list.dragging { cursor: grabbing; user-select: none; }
.topology-shell { position: relative; }
.topology-scene { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.topology-zones, .topology-nodes, .topology-wires, .topology-zone-titles { position: absolute; inset: 0; width: 100%; height: 100%; }
.topology-zones { z-index: 0; }
.topology-wires { z-index: 1; }
.topology-nodes { z-index: 2; pointer-events: none; }
.topology-zone-titles { z-index: 3; pointer-events: none; }
.system-zone {
  position: absolute;
  border: 2px dashed #b9cbd5;
  border-radius: 20px;
  background: rgba(232,239,244,.56);
  pointer-events: none;
}
.system-zone-title {
  position: absolute;
  padding: 4px 10px;
  border-radius: 8px;
  color: #27465d;
  background: rgba(232,239,244,.96);
  box-shadow: 0 0 0 6px rgba(232,239,244,.72);
  font-size: 30px;
  letter-spacing: .01em;
}
.system-zone-guide { position: absolute; color: #466477; font-size: 24px; line-height: 1.3; white-space: nowrap; }
.topology-wires { overflow: visible; }
.wire-edge { cursor: pointer; outline: none; }
.wire-edge .edge-line { fill: none; stroke: #197f78; stroke-width: 3; vector-effect: non-scaling-stroke; }
.wire-edge.pending .edge-line { stroke: #d78b22; stroke-dasharray: 9 7; }
.wire-edge.relationship .edge-line { stroke: #7b8c96; stroke-dasharray: 6 6; }
.wire-edge .edge-hit { fill: none; stroke: transparent; stroke-width: 22; vector-effect: non-scaling-stroke; }
.wire-edge .edge-terminal { fill: #fff; stroke: #197f78; stroke-width: 3; vector-effect: non-scaling-stroke; }
.wire-edge.pending .edge-terminal { stroke: #d78b22; }
.wire-edge.relationship .edge-terminal { stroke: #7b8c96; }
.wire-edge.selected .edge-line { stroke-width: 6; filter: drop-shadow(0 2px 3px rgba(8,127,120,.3)); }
.wire-edge:focus .edge-line { stroke-width: 5; }
.topology-wires.wire-hovering .wire-edge:not(.is-active) { opacity: .16; }
.topology-wires.wire-hovering .wire-edge.is-active { opacity: 1; }
.wire-edge:hover .edge-line { stroke-width: 6; filter: drop-shadow(0 2px 3px rgba(8,127,120,.28)); }
.edge-label {
  display: grid;
  align-content: center;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: 4px 6px;
  overflow: hidden;
  border: 1px solid #ccd9df;
  border-radius: 7px;
  color: #234257;
  background: #fff;
  box-shadow: 0 0 0 4px #fff, 0 2px 7px rgba(11,34,57,.12);
  text-align: center;
  pointer-events: none;
}
.edge-label strong { overflow: hidden; font-size: 20px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.edge-label span { display: block; overflow: hidden; color: #687d89; font-size: 16px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.wire-edge.pending .edge-label { border-color: #e4ba77; color: #8a5514; }
.wire-edge.relationship .edge-label { border-color: #bfcacf; color: #5b6e78; }
.edge-label-object.pending .edge-label { border-color: #e4ba77; color: #8a5514; }
.edge-label-object.relationship .edge-label { border-color: #bfcacf; color: #5b6e78; }
.edge-label-object { transition: opacity .16s ease, filter .16s ease; }
.topology-wires.wire-hovering .edge-label-object:not(.is-active) {
  opacity: .14;
  filter: blur(1.2px) grayscale(.7);
}
.topology-wires.wire-hovering .edge-label-object.is-active { opacity: 1; filter: none; }
.topology-node {
  position: absolute;
  z-index: 2;
  display: grid;
  grid-template-columns: 134px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  width: 320px;
  height: 200px;
  min-height: 200px;
  padding: 11px;
  border: 2px solid #35566e;
  border-radius: 13px;
  color: var(--ink);
  background: rgba(255,255,255,.97);
  box-shadow: 0 6px 16px rgba(11,34,57,.12);
  text-align: left;
  cursor: pointer;
  pointer-events: auto;
}
.topology-node:hover { border-color: var(--teal); transform: translateY(-2px); }
.topology-node.selected { border-color: var(--teal); box-shadow: 0 0 0 5px rgba(8,127,120,.2), 0 8px 20px rgba(11,34,57,.16); }
.topology-node img { width: 134px; height: 164px; object-fit: contain; mix-blend-mode: multiply; }
.topology-node span { display: grid; gap: 5px; min-width: 0; }
.topology-node strong { color: #17364c; font-size: 30px; line-height: 1.2; }
.topology-node small { display: -webkit-box; overflow: hidden; color: #5a707d; font-size: 24px; line-height: 1.2; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.wiring-list { display: grid; gap: 8px; }
.wiring-entry { display: grid; gap: 2px; padding: 8px 10px; border-left: 3px solid #197f78; border-radius: 4px; background: #f1f8f7; }
.wiring-entry strong { color: #17364c; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.wiring-entry small { color: #657984; font-size: 11px; line-height: 1.4; }
.topology-part-detail { display: grid; grid-template-columns: 95px 1fr; align-items: center; gap: 1rem; margin-bottom: .8rem; }
.topology-part-detail img { width: 95px; height: 82px; padding: .3rem; border: 1px solid #d5e3e5; border-radius: 10px; object-fit: contain; background: #fff; mix-blend-mode: multiply; }
.topology-part-detail span { color: var(--teal); font-size: .6rem; font-weight: 800; letter-spacing: .1em; }
.topology-part-detail h3 { margin: .12rem 0 .2rem; color: var(--ink); }
.topology-part-detail strong { color: #405d6c; font-size: .7rem; }

@media (max-width: 900px) {
  .connection-toolbar { align-items: stretch; }
  .topology-zoom { margin-left: 0; }
  .connection-list { height: 620px; min-height: 520px; }
}

@media (max-width: 620px) {
  .connection-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .2rem; }
  .connection-tab { flex: 0 0 auto; }
  .topology-zoom { order: 3; }
  .connection-source-toggle { order: 4; }
  .connection-list { height: 520px; min-height: 480px; }
}

/* Wide components page: the topology expands fully and has no inner vertical scroller. */
.components-page .connection-list {
  height: auto;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
}

@media screen and (min-width: 76.25em) {
  .components-page .md-sidebar { display: none; }
  .components-page .md-main__inner { width: 100%; max-width: 1880px; padding: 0 1.5rem; }
  .components-page .md-content { min-width: 0; max-width: none; }
  .components-page .md-content__inner { max-width: none; margin: 0; }
  .components-page .component-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
