.system-body {
  min-height: 100vh;
}

.system-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 18px 0 28px;
}

.system-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(215, 217, 225, 0.12);
  padding-bottom: 12px;
}

.system-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--silver);
  text-decoration: none;
  font-family: "Orbitron", sans-serif;
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.system-brand img {
  width: 118px;
  height: auto;
}

.system-feed {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(215, 217, 225, 0.18);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  font-family: "Orbitron", sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
}

.system-feed[data-feed="live"] {
  border-color: rgba(111, 255, 52, 0.35);
  color: #c9ffc0;
}

.system-feed[data-feed="delay"] {
  border-color: rgba(255, 210, 90, 0.38);
  color: #f3d98d;
}

.fence-map {
  border: 1px solid rgba(215, 217, 225, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(12, 16, 22, 0.98), rgba(5, 7, 10, 0.98));
  box-shadow:
    0 22px 50px rgba(0, 0, 0, 0.42),
    inset 0 0 0 1px rgba(255, 255, 255, 0.025);
  overflow: hidden;
  transition: border-color 260ms ease, box-shadow 260ms ease;
}

.fence-map[data-stage="inactive"] {
  border-color: rgba(215, 217, 225, 0.14);
}

.fence-map[data-stage="breakout"] {
  border-color: rgba(255, 210, 90, 0.34);
  box-shadow:
    0 22px 50px rgba(0, 0, 0, 0.42),
    inset 0 0 0 1px rgba(255, 210, 90, 0.05);
}

.fence-map[data-stage="confirmed"][data-location="above"] {
  border-color: rgba(111, 255, 52, 0.42);
  box-shadow:
    0 22px 50px rgba(0, 0, 0, 0.42),
    inset 0 0 0 1px rgba(111, 255, 52, 0.08);
}

.fence-map[data-stage="confirmed"][data-location="below"] {
  border-color: rgba(255, 38, 56, 0.42);
  box-shadow:
    0 22px 50px rgba(0, 0, 0, 0.42),
    inset 0 0 0 1px rgba(255, 38, 56, 0.08);
}

.fence-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(215, 217, 225, 0.1);
}

.module-kicker {
  margin: 0 0 6px;
  color: var(--muted);
  font-family: "Orbitron", sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.fence-header h1 {
  margin: 0;
  color: var(--text);
  font-family: "Orbitron", sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.map-price {
  display: grid;
  gap: 3px;
  text-align: right;
  font-family: "Orbitron", sans-serif;
}

.map-price span {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
}

.map-price strong {
  color: #f7f8ff;
  font-size: 1.65rem;
  line-height: 1;
  text-shadow: 0 0 14px rgba(215, 217, 225, 0.16);
}

.fence-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  min-height: 380px;
}

.chart-wrap {
  position: relative;
  min-height: 380px;
  overflow: hidden;
  border-right: 1px solid rgba(215, 217, 225, 0.1);
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.016) 1px, transparent 1px),
    #05080b;
  background-size: 36px 36px, 72px 72px, auto;
}

.zone {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  font-family: "Orbitron", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  pointer-events: none;
  transition: background 260ms ease, color 260ms ease, opacity 260ms ease;
}

.zone span {
  font-size: 0.72rem;
}

.zone small {
  color: rgba(215, 217, 225, 0.54);
  font-size: 0.62rem;
}

.zone-resistance {
  top: 0;
  height: 26%;
  color: rgba(255, 112, 122, 0.72);
  background: linear-gradient(180deg, rgba(255, 38, 56, 0.11), rgba(255, 38, 56, 0.018));
  border-bottom: 0;
}

.zone-fence {
  top: 26%;
  height: 48%;
  color: rgba(215, 217, 225, 0.42);
  background:
    repeating-linear-gradient(
      135deg,
      rgba(215, 217, 225, 0.018) 0,
      rgba(215, 217, 225, 0.018) 10px,
      rgba(0, 0, 0, 0) 10px,
      rgba(0, 0, 0, 0) 20px
    ),
    rgba(4, 5, 8, 0.74);
  border-bottom: 0;
}

.zone-fence span {
  color: rgba(215, 217, 225, 0.5);
}

.zone-support {
  bottom: 0;
  height: 26%;
  align-items: end;
  padding-bottom: 18px;
  color: rgba(120, 255, 88, 0.7);
  background: linear-gradient(0deg, rgba(111, 255, 52, 0.1), rgba(111, 255, 52, 0.018));
}

.fence-map[data-location="above"] .zone-resistance {
  color: #ff7680;
  background: linear-gradient(180deg, rgba(255, 38, 56, 0.2), rgba(255, 38, 56, 0.04));
}

.fence-map[data-location="below"] .zone-support {
  color: #8cff6e;
  background: linear-gradient(0deg, rgba(111, 255, 52, 0.18), rgba(111, 255, 52, 0.04));
}

.price-chart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.boundary {
  stroke-width: 2.4;
  stroke-dasharray: 12 7;
  opacity: 0.96;
  filter: drop-shadow(0 0 8px currentColor);
  transition: stroke-width 260ms ease, opacity 260ms ease, filter 260ms ease;
}

.boundary-top {
  stroke: var(--red);
  color: rgba(255, 38, 56, 0.75);
}

.boundary-bottom {
  stroke: var(--green);
  color: rgba(111, 255, 52, 0.72);
}

.fence-map[data-stage="inactive"] .boundary {
  opacity: 0.72;
  stroke-width: 2;
}

.fence-map[data-stage="breakout"] .boundary {
  stroke-width: 3.1;
}

.fence-map[data-stage="confirmed"] .boundary {
  stroke-width: 3.4;
}

.fence-map[data-location="above"] .boundary-top {
  opacity: 1;
  filter: drop-shadow(0 0 12px rgba(255, 38, 56, 0.7));
}

.fence-map[data-location="below"] .boundary-bottom {
  opacity: 1;
  filter: drop-shadow(0 0 12px rgba(111, 255, 52, 0.7));
}

.price-trail {
  fill: none;
  stroke: rgba(239, 242, 248, 0.9);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 5px rgba(239, 242, 248, 0.36));
  transition: stroke 260ms ease, filter 260ms ease;
}

.fence-map[data-stage="inactive"] .price-trail {
  stroke: rgba(170, 177, 190, 0.58);
  filter: drop-shadow(0 0 3px rgba(170, 177, 190, 0.14));
}

.fence-map[data-stage="breakout"] .price-trail {
  stroke: rgba(245, 216, 145, 0.95);
  filter: drop-shadow(0 0 8px rgba(245, 216, 145, 0.38));
}

.fence-map[data-stage="confirmed"][data-location="above"] .price-trail {
  stroke: rgba(142, 255, 111, 0.96);
  filter: drop-shadow(0 0 9px rgba(111, 255, 52, 0.42));
}

.fence-map[data-stage="confirmed"][data-location="below"] .price-trail {
  stroke: rgba(255, 94, 106, 0.96);
  filter: drop-shadow(0 0 9px rgba(255, 38, 56, 0.42));
}

.current-marker {
  fill: #f4f7ff;
  stroke: #11151b;
  stroke-width: 2;
  filter: drop-shadow(0 0 9px rgba(244, 247, 255, 0.48));
  transition: cy 400ms ease;
}

.break-marker {
  fill: #f1d370;
  stroke: #061008;
  stroke-width: 2.5;
  filter: drop-shadow(0 0 11px rgba(241, 211, 112, 0.72));
  transition: cx 400ms ease, cy 400ms ease, r 220ms ease;
}

.fence-map[data-stage="confirmed"] .break-marker[data-side="above"] {
  fill: var(--green);
  filter: drop-shadow(0 0 11px rgba(111, 255, 52, 0.72));
}

.break-marker[data-side="below"] {
  fill: #f1d370;
  filter: drop-shadow(0 0 11px rgba(241, 211, 112, 0.72));
}

.fence-map[data-stage="confirmed"] .break-marker[data-side="below"] {
  fill: var(--red);
  filter: drop-shadow(0 0 11px rgba(255, 38, 56, 0.72));
}

.edge-note {
  position: absolute;
  right: 18px;
  font-family: "Orbitron", sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.edge-note-top {
  top: 82px;
  color: rgba(255, 116, 126, 0.88);
}

.edge-note-bottom {
  bottom: 82px;
  color: rgba(120, 255, 88, 0.88);
}

.fence-status {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 18px;
  background: rgba(8, 11, 16, 0.92);
  transition: background 260ms ease, box-shadow 260ms ease;
}

.fence-map[data-stage="inactive"] .fence-status {
  background: rgba(8, 10, 14, 0.94);
}

.fence-map[data-stage="breakout"] .fence-status {
  background:
    linear-gradient(180deg, rgba(255, 210, 90, 0.055), rgba(8, 11, 16, 0.94));
}

.fence-map[data-stage="confirmed"][data-location="above"] .fence-status {
  background:
    linear-gradient(180deg, rgba(111, 255, 52, 0.06), rgba(8, 11, 16, 0.94));
}

.fence-map[data-stage="confirmed"][data-location="below"] .fence-status {
  background:
    linear-gradient(180deg, rgba(255, 38, 56, 0.06), rgba(8, 11, 16, 0.94));
}

.status-row,
.permission-box {
  border-bottom: 1px solid rgba(215, 217, 225, 0.1);
  padding-bottom: 12px;
}

.status-row {
  border-left: 2px solid rgba(215, 217, 225, 0.08);
  padding-left: 12px;
  transition: opacity 260ms ease, border-color 260ms ease, filter 260ms ease;
}

.status-row span,
.permission-box span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-family: "Orbitron", sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.status-row strong,
.permission-box strong {
  color: var(--text);
  font-size: 1.18rem;
  transition: color 260ms ease, text-shadow 260ms ease;
}

.permission-box strong {
  display: block;
  font-family: "Orbitron", sans-serif;
  font-size: 1.75rem;
  letter-spacing: 0.06em;
  line-height: 1.05;
}

.permission-box small {
  display: block;
  margin-top: 8px;
  color: rgba(215, 217, 225, 0.62);
  font-family: "Orbitron", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.fence-map[data-stage="inactive"] .status-row strong,
.fence-map[data-stage="inactive"] .permission-box strong {
  color: rgba(215, 217, 225, 0.62);
}

.fence-map[data-stage="breakout"] .status-row strong,
.fence-map[data-stage="breakout"] .permission-box strong {
  color: #f1d370;
  text-shadow: 0 0 8px rgba(241, 211, 112, 0.22);
}

.fence-map[data-stage="confirmed"][data-location="above"] .status-row strong,
.fence-map[data-stage="confirmed"][data-location="above"] .permission-box strong {
  color: var(--green);
  text-shadow: 0 0 8px rgba(111, 255, 52, 0.28);
}

.fence-map[data-stage="confirmed"][data-location="below"] .status-row strong,
.fence-map[data-stage="confirmed"][data-location="below"] .permission-box strong {
  color: var(--red);
  text-shadow: 0 0 8px rgba(255, 38, 56, 0.28);
}

.permission-box {
  border: 1px solid rgba(215, 217, 225, 0.14);
  border-radius: 8px;
  padding: 16px;
  background: rgba(215, 217, 225, 0.04);
}

.permission-box[data-permission="not_earned"] {
  border-color: rgba(255, 38, 56, 0.3);
  background: rgba(255, 38, 56, 0.055);
}

.permission-box[data-permission="watch_only"],
.permission-box[data-permission="pending_confirmation"],
.permission-box[data-permission="breakout_watch"] {
  border-color: rgba(255, 210, 90, 0.36);
  background: rgba(255, 210, 90, 0.06);
}

.permission-box[data-permission="permission_granted"] {
  border-color: rgba(111, 255, 52, 0.36);
  background: rgba(111, 255, 52, 0.06);
}

.permission-box[data-permission="permission_granted"] strong {
  color: var(--green);
  text-shadow: 0 0 10px rgba(111, 255, 52, 0.3);
}

.permission-box[data-permission="edge_conflict"] {
  border-color: rgba(255, 128, 62, 0.42);
  background: rgba(255, 78, 38, 0.075);
}

.fence-map[data-gate="locked"] .status-row {
  opacity: 0.54;
  border-left-color: rgba(215, 217, 225, 0.08);
  filter: saturate(0.35);
}

.fence-map[data-gate="locked"] .status-row strong {
  color: rgba(215, 217, 225, 0.58);
  text-shadow: none;
}

.fence-map[data-gate="locked"] .price-trail {
  filter: drop-shadow(0 0 2px rgba(170, 177, 190, 0.12));
}

.fence-map[data-gate="locked"] .current-marker,
.fence-map[data-gate="locked"] .break-marker {
  filter: drop-shadow(0 0 5px rgba(241, 211, 112, 0.28));
}

.fence-map[data-gate="unlocked"] .status-row {
  opacity: 1;
  border-left-color: rgba(111, 255, 52, 0.3);
}

.fence-map[data-gate="conflict"] .status-row {
  opacity: 0.68;
  border-left-color: rgba(255, 128, 62, 0.26);
}

.fence-map[data-location="above"] .current-marker {
  fill: #f1d370;
  filter: drop-shadow(0 0 10px rgba(241, 211, 112, 0.72));
}

.fence-map[data-location="below"] .current-marker {
  fill: #f1d370;
  filter: drop-shadow(0 0 10px rgba(241, 211, 112, 0.72));
}

.fence-map[data-stage="confirmed"][data-location="above"] .current-marker {
  fill: var(--green);
  filter: drop-shadow(0 0 10px rgba(111, 255, 52, 0.72));
}

.fence-map[data-stage="confirmed"][data-location="below"] .current-marker {
  fill: var(--red);
  filter: drop-shadow(0 0 10px rgba(255, 38, 56, 0.72));
}

@media (max-width: 820px) {
  .system-shell {
    width: min(100vw - 22px, 720px);
    padding-top: 12px;
  }

  .system-topbar,
  .fence-header {
    align-items: start;
    flex-direction: column;
  }

  .system-brand img {
    width: 96px;
  }

  .fence-grid {
    grid-template-columns: 1fr;
  }

  .chart-wrap {
    min-height: 320px;
    border-right: 0;
    border-bottom: 1px solid rgba(215, 217, 225, 0.1);
  }

  .fence-status {
    grid-template-columns: 1fr;
  }

  .map-price {
    text-align: left;
  }
}
