@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --bg: #0e111a;
  --panel: rgba(255, 255, 255, 0.04);
  --card: rgba(255, 255, 255, 0.06);
  --text: #e8edf7;
  --muted: #9aa5bf;
  --accent: #2dd4bf;
  --accent-2: #f59e0b;
  --line: rgba(255, 255, 255, 0.08);
  --shadow: 0 10px 50px rgba(0, 0, 0, 0.35);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Space Grotesk', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: radial-gradient(120% 120% at 20% 20%, rgba(45, 212, 191, 0.12), transparent),
              radial-gradient(100% 100% at 80% 0%, rgba(245, 158, 11, 0.12), transparent),
              var(--bg);
  color: var(--text);
}

.app-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 28px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.brand .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 6px rgba(45, 212, 191, 0.15);
}

.progress {
  flex: 1;
}

.progress-label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.progress-bar {
  height: 8px;
  background: var(--card);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.35s ease;
}

.status-pill {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.task-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 20px;
  box-shadow: var(--shadow);
}

.task-card {
  min-height: 520px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.task-header h1 {
  margin: 8px 0 6px;
  font-size: 28px;
}

.task-summary {
  margin: 0;
  color: var(--muted);
}

.module-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  color: var(--accent);
}

.module-pill::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.15);
}

.task-area {
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: calc(var(--radius) - 2px);
  padding: 16px;
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

button {
  font-family: inherit;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.2s ease, background 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  border-color: rgba(45, 212, 191, 0.5);
}

button.accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  color: #0c0f17;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(45, 212, 191, 0.2);
}

button.ghost {
  background: transparent;
}

.control-right {
  display: flex;
  gap: 0;
}

.control-left {
  flex: 1;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(45, 212, 191, 0.1);
  border: 1px solid rgba(45, 212, 191, 0.2);
  color: var(--accent);
  font-size: 13px;
}

.card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.stacked {
  display: grid;
  gap: 10px;
}

.layer {
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.layer.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px rgba(45, 212, 191, 0.2);
}

.layer small {
  color: var(--muted);
}

.details {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 12px;
  min-height: 80px;
}

.draggable {
  padding: 10px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px dashed rgba(245, 158, 11, 0.4);
  cursor: grab;
  user-select: none;
}

.dropzone {
  min-height: 80px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.dropzone.hover {
  border-color: var(--accent);
  background: rgba(45, 212, 191, 0.06);
}

.small-title {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sequence {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.step {
  position: relative;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--line);
}

.step.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px rgba(45, 212, 191, 0.15);
}

.flow {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.column {
  display: grid;
  gap: 8px;
}

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

.status {
  padding: 10px;
  border-radius: 10px;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
}

.status.success {
  color: var(--text);
  border-color: rgba(45, 212, 191, 0.6);
  background: rgba(45, 212, 191, 0.08);
}

.status.error {
  color: #ffb4b4;
  border-color: rgba(255, 180, 180, 0.6);
  background: rgba(255, 119, 119, 0.08);
}

.node-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.node {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-width: 90px;
  position: relative;
}

.node.highlight {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.1);
}

.node small {
  color: var(--muted);
}

.arrow {
  flex: 1;
  height: 2px;
  background: var(--line);
  position: relative;
}

.arrow::after {
  content: '';
  position: absolute;
  right: 0;
  top: -4px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--line);
  border-top: 2px solid var(--line);
  transform: rotate(45deg);
}

.moving {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 6px rgba(45, 212, 191, 0.15);
  transition: transform 0.5s ease;
}

.list {
  display: grid;
  gap: 8px;
}

.list-item {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.input-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

input[type="text"] {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: inherit;
}

input[type="text"]:focus {
  outline: 1px solid var(--accent);
}

.legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.legend span::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 6px;
  opacity: 0.8;
}

.tag {
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th, .table td {
  padding: 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.table th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.inline {
  display: flex;
  align-items: center;
  gap: 6px;
}

.inline-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
}

.goal-thumb {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--card);
}

.layer-layout {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 12px;
  width: 100%;
}

.visual-panel {
  min-height: 220px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  align-content: center;
  gap: 12px;
}

.visual-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.device {
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  min-width: 90px;
  text-align: center;
}

.router {
  padding: 12px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  min-width: 90px;
  text-align: center;
}

.cable {
  flex: 1;
  min-width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 8px;
  position: relative;
  margin: 0 6px;
}

.cable::after {
  content: '';
  position: absolute;
  right: -6px;
  top: -4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-2);
}

.cable::before {
  content: '';
  position: absolute;
  left: -6px;
  top: -4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
}

.bits {
  font-family: 'Space Grotesk', monospace;
  font-size: 16px;
  letter-spacing: 1px;
  word-break: break-all;
}

.bits .part-frame { background: rgba(45, 212, 191, 0.28); }
.bits .part-ip { background: rgba(59, 130, 246, 0.28); }
.bits .part-tcp { background: rgba(244, 114, 182, 0.28); }
.bits .part-http { background: rgba(34, 197, 94, 0.28); }
.bits .part-data { background: rgba(245, 158, 11, 0.32); }

.bits-bar {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.bit-block {
  padding: 2px 4px;
  border-radius: 6px;
}

.frame-box {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
}

.frame-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.header-box {
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 12px;
  min-width: 70px;
  text-align: center;
  border: 1px solid var(--line);
}

.h-mac { background: rgba(45, 212, 191, 0.15); border-color: rgba(45, 212, 191, 0.45); }
.h-ip { background: rgba(59, 130, 246, 0.15); border-color: rgba(59, 130, 246, 0.45); }
.h-tcp { background: rgba(244, 114, 182, 0.15); border-color: rgba(244, 114, 182, 0.45); }
.h-http { background: rgba(34, 197, 94, 0.15); border-color: rgba(34, 197, 94, 0.45); }
.h-data { background: rgba(245, 158, 11, 0.18); border-color: rgba(245, 158, 11, 0.5); }

.frame-label {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 12px;
}

.packet-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.packet {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(37, 99, 235, 0.5);
  min-width: 54px;
  text-align: center;
  font-weight: 600;
}

.packet.fail {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.6);
}

.enc-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  align-items: center;
}

.enc-box {
  padding: 10px;
  border-radius: 10px;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
}

.arrow-wide {
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}

.ip-label {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.route-graph {
  padding: 10px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.route-graph text {
  fill: var(--text);
  font-size: 12px;
  font-family: 'Space Grotesk', sans-serif;
}

.net-map {
  width: 100%;
  max-width: 360px;
  height: auto;
  display: block;
  margin: 10px auto;
}

/* Protocol sort layout */
.proto-wrapper {
  display: grid;
  gap: 12px;
  max-width: 760px;
  margin: 0 auto;
}

.proto-pool {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
  max-width: 420px;
  margin: 0 auto;
}

.proto-pool .draggable {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 320px;
}

.icon-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.layer-rows {
  display: grid;
  gap: 10px;
  max-width: 720px;
  margin: 0 auto;
}

.layer-row {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.layer-info-block {
  display: grid;
  gap: 4px;
}

.layer-name {
  margin: 0;
  font-weight: 700;
}

.layer-desc {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.row-drop {
  min-height: 64px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  max-width: 220px;
  margin-left: auto;
}

.mask-card {
  display: grid;
  gap: 10px;
  grid-column: span 2;
}

.mask-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.mask-ip {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.4px;
  margin: 0;
}

.mask-bits {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-family: 'Space Grotesk', monospace;
}

.mask-bit {
  padding: 4px 6px;
  border-radius: 8px;
  font-size: 14px;
}

.mask-bit.net { background: rgba(45, 212, 191, 0.25); }
.mask-bit.host { background: rgba(244, 114, 182, 0.22); }

.mask-sep {
  padding: 0 4px;
  color: var(--muted);
  opacity: 0.8;
  align-self: center;
}

.mask-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.mask-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mask-legend .net::before,
.mask-legend .host::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.mask-legend .net::before { background: rgba(45, 212, 191, 0.9); }
.mask-legend .host::before { background: rgba(244, 114, 182, 0.9); }

.mask-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mask-slider {
  flex: 1;
  accent-color: var(--accent);
}

.mask-pill {
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(45, 212, 191, 0.12);
  border: 1px solid rgba(45, 212, 191, 0.4);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.mask-bar {
  position: relative;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  overflow: hidden;
}

.mask-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
}

.mask-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.mask-stat {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.mask-stat-value {
  font-weight: 700;
  font-size: 18px;
}

.osi-tcp-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  grid-column: span 2;
}

.osi-tcp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.model-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

.model-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  margin-bottom: 10px;
}

.model-header .sub {
  font-size: 13px;
  color: var(--muted);
}

.layer-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.osi-label {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.osi-divider {
  height: 1px;
  border-top: 1px dashed var(--line);
}

.layer-box {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--layer-color);
  background: rgba(255, 255, 255, 0.03);
  transition: transform 0.2s ease, box-shadow 0.3s ease, border-color 0.2s ease, background 0.2s ease;
  --layer-color: var(--accent);
}

.layer-name {
  font-weight: 700;
}

.layer-note {
  color: var(--muted);
  font-size: 13px;
}

.layer-box.active {
  border-color: var(--layer-color);
  box-shadow: 0 0 0 2px var(--layer-color), 0 12px 40px rgba(0, 0, 0, 0.4);
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-2px);
}

.osi-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.osi-hint {
  color: var(--muted);
  font-size: 13px;
}

.osi-actions button {
  width: fit-content;
  padding-inline: 16px;
}

.ipv4-card {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 14px;
  grid-column: span 2;
}

.ipv4-diagram {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ipv4-row {
  display: flex;
  gap: 0;
}

.ipv4-cell {
  flex: 1;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  border-radius: 0;
}

.ipv4-cell + .ipv4-cell {
  border-left: 0;
}

.ipv4-label {
  font-weight: 700;
  font-size: 14px;
}

.ipv4-bits {
  color: var(--muted);
  font-size: 12px;
}

.ipv4-cell:hover {
  background: rgba(255, 255, 255, 0.06);
}

.ipv4-cell.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  background: rgba(45, 212, 191, 0.12);
}

.ipv4-info {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  padding: 14px;
  border-radius: 0;
  min-height: 160px;
}

.ipv4-info-title {
  font-weight: 700;
  margin-bottom: 8px;
}

.ipv4-info-body {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.subnet-card .mask-slider-row {
  margin-top: 6px;
}

.subnet-viz {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}

.subnet-pie {
  width: 260px;
  height: 260px;
  border: 1px solid var(--line);
  border-radius: 50%;
  margin: 0 auto;
  background: conic-gradient(#22c55e 0deg 360deg);
  box-shadow: var(--shadow);
}

.subnet-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 6px;
}

.subnet-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.subnet-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: inline-block;
  border: 1px solid var(--line);
}

.nat-grid {
  display: grid;
  grid-template-columns: 8fr 2fr;
  gap: 12px;
  align-items: start;
}

.nat-graph {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 320px;
  background: rgba(255, 255, 255, 0.02);
}

.nat-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.nat-edge {
  stroke: var(--line);
  stroke-width: 1.6;
  stroke-linecap: round;
}

.nat-node {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 120px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.nat-node .nat-title {
  font-weight: 700;
}

.nat-node .nat-ip {
  color: var(--muted);
  font-size: 12px;
}

.nat-router {
  background: rgba(14, 165, 233, 0.16);
  border-color: rgba(14, 165, 233, 0.4);
}

.nat-panel {
  min-height: 320px;
}

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

.nat-packet {
  fill: var(--accent);
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 0.3;
  filter: drop-shadow(0 0 8px rgba(45, 212, 191, 0.6));
}

.nat-packet-label {
  position: absolute;
  transform: translate(-50%, -150%);
  background: rgba(14, 17, 26, 0.9);
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 12px;
}

.nat-status {
  max-width: 60%;
}

.dos-grid {
  display: grid;
  grid-template-columns: 7fr 3fr;
  gap: 14px;
  align-items: start;
}

.dos-graph {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 320px;
  background: rgba(255, 255, 255, 0.02);
}

.dos-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.dos-edge {
  stroke: var(--line);
  stroke-width: 1.5;
  stroke-linecap: round;
}

.dos-node {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 120px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.dos-node .dos-title {
  font-weight: 700;
}

.dos-node .dos-ip {
  color: var(--muted);
  font-size: 12px;
}

.dos-fw {
  background: rgba(14, 165, 233, 0.16);
  border-color: rgba(14, 165, 233, 0.4);
}

.dos-server {
  background: rgba(45, 212, 191, 0.12);
  border-color: rgba(45, 212, 191, 0.3);
}

.dos-attacker {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.5);
}

.dos-packet {
  fill: var(--accent);
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 0.3;
  filter: drop-shadow(0 0 8px rgba(45, 212, 191, 0.6));
}

.dos-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
  min-height: 320px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dos-rule {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dos-chart {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  align-items: end;
  gap: 2px;
  height: 140px;
}

.dos-bar {
  display: block;
  width: 100%;
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.7), rgba(248, 113, 113, 0.2));
  border-radius: 2px 2px 0 0;
}

@media (max-width: 860px) {
  .ipv4-card {
    grid-template-columns: 1fr;
  }
  .subnet-viz {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .nat-grid {
    grid-template-columns: 1fr;
  }
  .dos-grid {
    grid-template-columns: 1fr;
  }
}
.ospf-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
  align-items: start;
}

.ospf-graph {
  position: relative;
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
  aspect-ratio: 32 / 14;
}

.ospf-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ospf-node {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid var(--line);
  display: grid;
  place-items: center;
  font-weight: 700;
  transform: translate(-50%, -50%);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  pointer-events: none;
}

.ospf-node.current {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.2);
  transform: translate(-50%, -50%) scale(1.04);
}

.ospf-node.visited {
  border-color: var(--muted);
  opacity: 0.75;
}

.ospf-node.goal {
  border-color: #f97316;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.22);
}

.ospf-edge {
  stroke: var(--line);
  stroke-width: 2;
  stroke-linecap: round;
}

.ospf-edge.active {
  stroke: var(--accent);
  stroke-width: 3;
}

.ospf-edge-label {
  position: absolute;
  font-size: 12px;
  color: var(--muted);
  background: rgba(14, 17, 26, 0.9);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.ospf-dot {
  fill: var(--accent);
  stroke: rgba(255, 255, 255, 0.7);
  stroke-width: 2;
  filter: drop-shadow(0 0 8px rgba(45, 212, 191, 0.5));
}

.ospf-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  min-height: 320px;
}

.ospf-queue {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
}

.ospf-queue-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.ospf-chip {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-weight: 700;
}

.ospf-actions {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 10px;
  align-items: center;
}

.gap-8 {
  width: 1px;
}

@media (max-width: 1020px) {
  .ospf-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .ipv4-card {
    grid-template-columns: 1fr;
  }
  .subnet-viz {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .nat-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .layer-row {
    grid-template-columns: 1fr;
  }
  .row-drop {
    max-width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  .layer-layout {
    grid-template-columns: 1fr;
  }
}

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

@media (max-width: 640px) {
  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .control-right {
    width: 100%;
  }

  button {
    width: 100%;
  }
}
