/* ===== Base Layout ===== */
body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background:
    radial-gradient(circle at top, rgba(0, 229, 255, 0.12), transparent 28%),
    #111;
  color: #fff;
}

.hidden {
  display: none !important;
}

/* ===== Header ===== */
.app-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(12px);
  z-index: 10;
  padding: 10px;
  border-bottom: 1px solid #222;
}

.app-header-copy {
  min-width: 0;
}

.auth-entry-btn {
  flex-shrink: 0;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(0, 229, 255, 0.28);
  background: rgba(0, 229, 255, 0.14);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.auth-entry-btn.hidden {
  display: none;
}

.account-shell {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.account-shell > .auth-panel,
.account-shell > .hero-card {
  max-width: none;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}

.auth-panel {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 22px 18px 18px;
  border: 1px solid #202830;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(20, 28, 36, 0.98), rgba(10, 14, 18, 0.98));
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.38);
}

.account-panel {
  min-width: 0;
  align-self: start;
}

.auth-panel h2 {
  margin: 0 0 10px;
}

.auth-copy,
.auth-signed-in-copy {
  margin: 0 0 14px;
  color: #d4dde3;
  line-height: 1.5;
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-form label {
  font-weight: 700;
}

.auth-form input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #293641;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.auth-submit-btn,
.auth-signout-btn {
  width: 100%;
  margin-top: 4px;
}

.auth-secondary-btn {
  width: 100%;
  margin-top: 0;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #d4dde3;
  font-weight: 700;
}

.auth-feedback {
  min-height: 20px;
  margin: 12px 0 0;
  color: #8ea3b3;
  line-height: 1.4;
}

.auth-feedback.error {
  color: #ff8c8c;
}

.auth-feedback.success {
  color: #8ff0b3;
}

.account-access-card {
  margin: 0 0 16px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #1f2a31;
  background: rgba(8, 14, 18, 0.82);
}

.account-access-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.account-access-badge.premium {
  background: rgba(0, 229, 255, 0.14);
  border-color: rgba(0, 229, 255, 0.28);
  color: #7ef2ff;
}

.account-access-copy,
.account-access-details {
  margin: 12px 0 0;
  color: #d4dde3;
  line-height: 1.5;
}

.account-access-details {
  color: #8ea3b3;
  font-size: 14px;
}

.account-subscription-card {
  margin: 0 0 16px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(0, 229, 255, 0.18);
  background: linear-gradient(180deg, rgba(12, 22, 30, 0.96), rgba(8, 14, 18, 0.96));
}

.account-subscription-card h3 {
  margin: 0 0 8px;
}

.account-subscription-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.auth-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
  color: #d4dde3;
}

.auth-toggle-btn {
  padding: 0;
  background: transparent;
  color: #00e5ff;
  text-decoration: underline;
}

#page-title {
  margin: 0;
  font-size: clamp(22px, 3vw, 30px);
}

.page {
  display: none;
  padding: 18px 12px 92px;
}

.page.active {
  display: block;
}

.hero-card,
.tool-panel {
  max-width: 980px;
  margin: 0 auto 12px;
  padding: 18px;
  border: 1px solid #202830;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(20, 28, 36, 0.95), rgba(10, 14, 18, 0.95));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.premium-note,
.premium-locked-panel {
  max-width: 980px;
  margin: 0 auto 12px;
  padding: 18px;
  border: 1px solid rgba(0, 229, 255, 0.18);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(12, 22, 30, 0.96), rgba(8, 14, 18, 0.96));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.premium-note {
  color: #d4dde3;
  line-height: 1.5;
}

.premium-note > div {
  margin-bottom: 12px;
}

.premium-note-btn {
  margin-top: 0;
}

.premium-locked-panel h2 {
  margin: 0 0 10px;
}

.premium-locked-panel p {
  margin: 0;
  max-width: 42rem;
  color: #d4dde3;
  line-height: 1.6;
}

#coax-premium-content.hidden,
#coax-locked-panel.hidden {
  display: none !important;
}

.ethernet-layout {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.ethernet-panel {
  padding: 18px;
  border: 1px solid #202830;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(20, 28, 36, 0.95), rgba(10, 14, 18, 0.95));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.ethernet-panel h2,
.ethernet-panel h3 {
  margin: 0 0 8px;
}

.ethernet-panel p {
  color: #d4dde3;
  line-height: 1.45;
}

.ethernet-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.ethernet-stat-card {
  padding: 12px;
  border-radius: 14px;
  background: rgba(8, 14, 18, 0.82);
  border: 1px solid #1f2a31;
}

.ethernet-stat-label {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8ea3b3;
}

.ethernet-note {
  margin-top: 10px;
}

.ethernet-diagram {
  display: grid;
  gap: 10px;
}

.coax-diagram {
  display: grid;
  gap: 12px;
}

.coax-stack {
  display: grid;
  gap: 10px;
}

.coax-layer,
.coax-meta-card {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #1f2a31;
  background: rgba(8, 14, 18, 0.82);
}

.coax-layer {
  position: relative;
  overflow: hidden;
}

.coax-layer::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  opacity: 0.95;
}

.coax-jacket::before {
  background: linear-gradient(180deg, #3d444d, #1c2026);
}

.coax-shield::before {
  background: linear-gradient(180deg, #d7dde2, #74808d);
}

.coax-dielectric::before {
  background: linear-gradient(180deg, #f6f1d0, #d8c98a);
}

.coax-center::before {
  background: linear-gradient(180deg, #ffd06a, #d18a1f);
}

.coax-layer-name {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8ea3b3;
}

.coax-layer strong,
.coax-meta-card strong {
  display: block;
  line-height: 1.35;
}

.coax-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ethernet-pinout-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ethernet-pinout-block {
  padding: 12px;
  border-radius: 14px;
  background: rgba(8, 14, 18, 0.82);
  border: 1px solid #1f2a31;
}

.ethernet-pinout-block h4 {
  margin: 0 0 10px;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8ea3b3;
}

.ethernet-pinout {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.ethernet-pin {
  border-radius: 14px;
  padding: 10px 8px;
  min-height: 104px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
}

.ethernet-pin-number {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ethernet-pin-color {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  word-break: break-word;
}

.ethernet-pin-pair {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.76);
}

.ethernet-legacy {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ethernet-legacy-pair {
  border-radius: 14px;
  padding: 12px;
  background: rgba(8, 14, 18, 0.82);
  border: 1px solid #1f2a31;
}

.ethernet-legacy-pair strong {
  display: block;
  margin-bottom: 6px;
}

.bottom-tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(5, 10, 14, 0.96);
  border-top: 1px solid #1c2730;
  backdrop-filter: blur(16px);
  z-index: 20;
}

.tab-btn {
  padding: 10px 8px;
  border-radius: 12px;
  background: transparent;
  color: #8ea3b3;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}

.tab-btn.active {
  background: rgba(0, 229, 255, 0.14);
  color: #ffffff;
  border-color: rgba(0, 229, 255, 0.28);
}

.hero-card h2 {
  margin: 0 0 10px;
  font-size: clamp(28px, 5vw, 44px);
}

.hero-lead {
  font-size: clamp(17px, 2.2vw, 22px);
}

.hero-card p {
  max-width: 48rem;
  color: #d4dde3;
  line-height: 1.5;
}

.hero-eyebrow {
  margin: 0 0 8px;
  color: #00e5ff;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-stats,
.home-grid {
  max-width: 980px;
  margin: 0 auto;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.hero-stat-card,
.home-card {
  border: 1px solid #202830;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(20, 28, 36, 0.95), rgba(10, 14, 18, 0.95));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.hero-stat-card {
  padding: 14px;
}

.hero-stat-value {
  display: block;
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 800;
  color: #ffffff;
}

.hero-stat-label {
  display: block;
  margin-top: 4px;
  color: #8ea3b3;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.home-card {
  padding: 18px;
}

.home-card h3 {
  margin: 0 0 10px;
  font-size: clamp(21px, 3vw, 28px);
}

.home-card p {
  margin: 0;
  color: #d4dde3;
  line-height: 1.5;
}

.home-card-feature {
  grid-column: 1 / -1;
}

.home-list {
  margin: 14px 0 0;
  padding-left: 18px;
  color: #d4dde3;
}

.home-list li + li {
  margin-top: 8px;
}

.home-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(0, 229, 255, 0.28);
  background: rgba(0, 229, 255, 0.14);
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
}

.home-footer-link {
  max-width: 980px;
  margin: 16px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.home-link-btn-secondary {
  margin-top: 0;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

.legal-shell {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  gap: 12px;
}

.legal-card {
  padding: 18px;
  border: 1px solid #202830;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(20, 28, 36, 0.95), rgba(10, 14, 18, 0.95));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.legal-card h2,
.legal-card h3 {
  margin: 0 0 10px;
}

.legal-card p {
  margin: 0;
  color: #d4dde3;
  line-height: 1.6;
}

.legal-effective {
  margin-bottom: 14px !important;
  color: #8ea3b3 !important;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.legal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.tool-panel label {
  display: inline-block;
  margin: 0 8px 0 0;
  font-weight: 600;
}

.tool-panel select {
  margin-right: 14px;
  padding: 6px 8px;
}

/* ===== Controls ===== */
select,
input,
button {
  font-size: 16px;
}

#quick-jump,
#total-jump,
#pair-jump,
#pair-total-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  padding: 8px;
}

#quick-jump input,
#total-jump input,
#pair-jump input,
#pair-total-jump input {
  width: 90px;
  padding: 6px;
  text-align: center;
}

button {
  padding: 6px 12px;
  font-weight: bold;
  background: #00e5ff;
  color: #000;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

/* ===== Tube Container ===== */
.tube {
  padding: 12px;
  border-bottom: 1px solid #333;
  border-left: 6px solid #333;
  background: #161616;
}

/* ===== Tube Title (Accordion Tab) ===== */
.tube-title {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 8px;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.2);
}

.tube-title-label {
  min-width: 0;
}

.tube-title-right {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.tube-ribbon-set {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  width: 148px;
  min-height: 18px;
  align-content: flex-start;
  padding-top: 1px;
}

.tube-ribbon-box,
.tube-ribbon-line {
  position: relative;
  display: block;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.92);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.28),
    0 1px 1px rgba(0, 0, 0, 0.18);
}

.tube-ribbon-box {
  width: 8px;
  height: 12px;
  border-radius: 2px;
}

.tube-ribbon-line {
  width: 2px;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.tube-title-chevron {
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}

.tube.open .tube-title-chevron {
  transform: rotate(45deg);
}

.tube.open {
  background: #1c1c1c;
}

/* ===== Fiber Row ===== */
.fiber-row {
  display: none;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}

.tube.open .fiber-row {
  display: flex;
}

.tube.open .fiber-row:last-child {
  margin-bottom: 0;
}

/* ===== Fiber Dots ===== */
.fiber {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid #444;
  box-sizing: border-box;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 14px;
  font-weight: bold;
  user-select: none;

  /* Raises number so hash marks fit below */
  padding-bottom: 5px;

  color: #000;
}

/* ===== White numbers on DARK fiber colors ===== */
.fiber.color-blue,
.fiber.color-brown,
.fiber.color-slate,
.fiber.color-red,
.fiber.color-black,
.fiber.color-violet {
  color: #fff;
}

/* ===== Active Fiber Highlight ===== */
.fiber.active {
  border-color: #00e5ff;
  box-shadow:
    0 0 0 3px rgba(0, 229, 255, 0.5),
    0 0 10px rgba(0, 229, 255, 0.8);
}

/* ===== Fiber Hash Marks (BELOW numbers, inside circle) ===== */
.fiber.hash-1::after {
  content: "";
  position: absolute;
  width: 60%;
  height: 2px;
  left: 20%;
  bottom: 6px;
}

.fiber.hash-2::after {
  content: "";
  position: absolute;
  width: 60%;
  height: 2px;
  left: 20%;
  bottom: 8px;
}

.fiber.hash-2::before {
  content: "";
  position: absolute;
  width: 60%;
  height: 2px;
  left: 20%;
  bottom: 4px;
}

/* Default hash color */
.fiber.hash-1::after,
.fiber.hash-2::after,
.fiber.hash-2::before {
  background: #000;
}

/* White hash marks on DARK fiber colors */
.fiber.color-blue.hash-1::after,
.fiber.color-blue.hash-2::after,
.fiber.color-blue.hash-2::before,

.fiber.color-brown.hash-1::after,
.fiber.color-brown.hash-2::after,
.fiber.color-brown.hash-2::before,

.fiber.color-slate.hash-1::after,
.fiber.color-slate.hash-2::after,
.fiber.color-slate.hash-2::before,

.fiber.color-red.hash-1::after,
.fiber.color-red.hash-2::after,
.fiber.color-red.hash-2::before,

.fiber.color-black.hash-1::after,
.fiber.color-black.hash-2::after,
.fiber.color-black.hash-2::before,

.fiber.color-violet.hash-1::after,
.fiber.color-violet.hash-2::after,
.fiber.color-violet.hash-2::before {
  background: #fff;
}

.fiber.roman-marker::after {
  content: attr(data-row-marker);
  position: absolute;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%);
  font-size: 7px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.2px;
}

@media (max-width: 980px) {
  .account-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-header {
    padding: 10px 12px;
  }

  .auth-entry-btn {
    padding: 9px 12px;
    font-size: 12px;
  }

  .auth-panel {
    padding: 20px 16px 16px;
  }

  .tool-panel label,
  .tool-panel select {
    display: block;
    width: 100%;
    margin-right: 0;
  }

  .tool-panel label {
    margin: 0 0 6px;
  }

  .tool-panel select {
    margin-bottom: 10px;
    box-sizing: border-box;
  }

  .tool-panel select:last-child {
    margin-bottom: 0;
  }

  .ethernet-layout,
  .ethernet-stats,
  .ethernet-legacy,
  .ethernet-pinout-compare,
  .hero-stats,
  .home-grid,
  .coax-meta-grid {
    grid-template-columns: 1fr;
  }

  .home-card {
    padding: 16px;
  }

  .home-link-btn {
    width: 100%;
  }

  .home-footer-link {
    justify-content: stretch;
  }

  .ethernet-pinout {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .ethernet-pin {
    min-height: 92px;
    padding: 8px 6px;
  }

  .ethernet-pin-color {
    font-size: 10px;
  }

  .ethernet-pin-number,
  .ethernet-pin-pair {
    font-size: 9px;
  }

  .fiber-row {
    gap: 6px;
  }

  .tube-title {
    gap: 8px;
  }

  .tube-title-right {
    gap: 6px;
  }

  .tube-ribbon-set {
    gap: 3px;
    width: 120px;
  }

  .tube-ribbon-box,
  .tube-ribbon-line {
    height: 10px;
  }

  .tube-ribbon-box {
    width: 7px;
  }

  .tube-ribbon-line {
    width: 2px;
  }

  .tube-title-chevron {
    width: 8px;
    height: 8px;
  }

  .fiber {
    width: 24px;
    height: 24px;
    border-width: 2px;
    font-size: 10px;
    padding-bottom: 3px;
  }

  .fiber.hash-1::after {
    height: 1.5px;
    bottom: 4px;
  }

  .fiber.hash-2::after {
    height: 1.5px;
    bottom: 5px;
  }

  .fiber.hash-2::before {
    height: 1.5px;
    bottom: 2px;
  }

  .fiber.roman-marker::after {
    font-size: 5px;
    bottom: 1px;
  }

  .tab-btn {
    font-size: 10px;
    padding: 9px 4px;
  }

  .pair-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .pair-card {
    min-height: 114px;
    border-radius: 12px;
    padding: 8px 4px 8px;
  }

  .pair-number {
    top: 42px;
    font-size: 12px;
  }

  .pair-wire-wrap {
    min-height: 78px;
  }

  .pair-wire {
    width: 16px;
    height: 74px;
    border-width: 1.5px;
  }

  .pair-wire.left {
    margin-right: -5px;
  }

  .pair-wire.right {
    margin-left: -5px;
  }

  .pair-wire::before {
    inset: 5px 4px;
  }

  .pair-wire::after {
    width: 10px;
    height: 10px;
    bottom: -4px;
    border-width: 1.5px;
  }

  .wire-label {
    top: -1px;
    font-size: 7px;
  }

  .pair-meta {
    margin-top: 4px;
    font-size: 7px;
    line-height: 1.25;
  }

  .pair-meta strong {
    font-size: 7px;
    margin-bottom: 1px;
  }
}

/* ===== Info Bar ===== */
#info-bar {
  position: sticky;
  bottom: calc(54px + env(safe-area-inset-bottom, 0px));
  background: #000;
  padding: 14px;
  font-size: 16px;
  font-weight: bold;
  text-align: center;
  border-top: 2px solid #222;
  z-index: 10;
}

#pair-map,
#fiber-map {
  max-width: 980px;
  margin: 0 auto;
}

#pair-info-bar {
  position: sticky;
  bottom: calc(54px + env(safe-area-inset-bottom, 0px));
  max-width: 980px;
  margin: 0 auto;
  background: #000;
  padding: 14px;
  font-size: 16px;
  font-weight: bold;
  text-align: center;
  border-top: 2px solid #222;
  z-index: 10;
}

.binder {
  padding: 12px;
  border-bottom: 1px solid #333;
  border-left: 6px solid #333;
  background: #161616;
}

.binder.open {
  background: #1c1c1c;
}

.binder-title {
  position: relative;
  padding: 10px 12px;
  margin-bottom: 10px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 8px;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.2);
}

.binder-title::after {
  content: "▸";
  float: right;
  transition: transform 0.2s ease;
}

.binder.open .binder-title::after {
  transform: rotate(90deg);
}

.pair-grid {
  display: none;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.binder.open .pair-grid {
  display: grid;
}

.pair-card {
  position: relative;
  min-height: 132px;
  border-radius: 14px;
  padding: 10px 6px 8px;
  border: 1px solid #25313a;
  background: linear-gradient(180deg, rgba(19, 24, 28, 0.96), rgba(10, 14, 18, 0.94));
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.pair-card:hover {
  transform: translateY(-2px);
}

.pair-card.active {
  border-color: #00e5ff;
  box-shadow:
    0 0 0 2px rgba(0, 229, 255, 0.25),
    0 10px 22px rgba(0, 229, 255, 0.14);
}

.pair-number {
  position: absolute;
  left: 50%;
  top: 48px;
  transform: translateX(-50%);
  z-index: 2;
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  text-shadow:
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000;
}

.pair-wire-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 0;
  min-height: 92px;
}

.pair-wire {
  position: relative;
  width: 20px;
  height: 86px;
  border: 2px solid rgba(0, 0, 0, 0.55);
  border-radius: 999px;
  transform-origin: center top;
}

.pair-wire.left {
  margin-right: -6px;
  transform: rotate(24deg);
}

.pair-wire.right {
  margin-left: -6px;
  transform: rotate(-24deg);
}

.pair-wire::before {
  content: "";
  position: absolute;
  inset: 6px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.pair-wire::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  left: 50%;
  bottom: -4px;
  transform: translateX(-50%);
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.6);
  background: #d2a01a;
}

.wire-label {
  position: absolute;
  top: -2px;
  font-size: 8px;
  font-weight: 800;
  color: #fff;
  text-shadow:
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000;
}

.pair-wire.left .wire-label {
  left: -4px;
}

.pair-wire.right .wire-label {
  right: -4px;
}

.pair-meta {
  margin-top: 4px;
  text-align: center;
  font-size: 8px;
  line-height: 1.2;
  color: #d5dde3;
}

.pair-meta strong {
  display: block;
  margin-bottom: 1px;
  font-size: 8px;
  color: #fff;
}
