:root {
  --bg: #f4efe7;
  --bg-deep: #efe2d2;
  --panel: rgba(255, 250, 243, 0.74);
  --panel-strong: rgba(255, 252, 247, 0.9);
  --line: rgba(61, 73, 92, 0.12);
  --ink: #20303f;
  --ink-soft: #617181;
  --teal: #2f7f84;
  --teal-deep: #1f5f65;
  --coral: #ef7d57;
  --coral-deep: #d76549;
  --sand: #f7c98e;
  --shadow-lg: 0 24px 64px rgba(39, 45, 56, 0.14);
  --shadow-md: 0 14px 32px rgba(39, 45, 56, 0.1);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(47, 127, 132, 0.16), transparent 30%),
    radial-gradient(circle at right 10%, rgba(239, 125, 87, 0.18), transparent 22%),
    linear-gradient(145deg, #f6efe6 0%, #efe5d8 48%, #e8eef0 100%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: progress;
  opacity: 0.75;
}

.app-shell {
  position: relative;
  width: min(1500px, calc(100% - 32px));
  margin: 20px auto 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ambient {
  position: absolute;
  inset: auto;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  filter: blur(28px);
  pointer-events: none;
  z-index: 0;
}

.ambient-left {
  top: -40px;
  left: -70px;
  background: rgba(47, 127, 132, 0.12);
}

.ambient-right {
  top: 120px;
  right: -60px;
  background: rgba(239, 125, 87, 0.12);
}

.hero,
.summary-strip,
.panel {
  position: relative;
  z-index: 1;
}

.hero,
.panel,
.summary-card {
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-lg);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 24px;
  padding: 28px;
  border-radius: var(--radius-xl);
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--teal);
}

.hero h1,
.panel-heading h2,
.active-hop-card h3,
.subheading-row h3 {
  margin: 0;
  font-family: "Fraunces", serif;
  letter-spacing: -0.04em;
}

.hero h1 {
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 0.92;
  max-width: 12ch;
}

.hero-text,
.map-caption span,
.hop-note,
.active-hop-card p,
.muted-label {
  color: var(--ink-soft);
  line-height: 1.6;
}

.hero-card {
  padding: 22px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.94), rgba(250, 242, 232, 0.84));
  border: 1px solid rgba(61, 73, 92, 0.08);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.hero-card-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-soft);
}

.hero-card-row strong {
  color: var(--ink);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.summary-card {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
}

.summary-card span,
.detail-grid span,
.latency-label,
.hop-list-item small {
  display: block;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.summary-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.6rem;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr) 350px;
  gap: 18px;
  align-items: start;
}

.panel {
  border-radius: var(--radius-xl);
  padding: 22px;
}

.panel-heading,
.subheading-row,
.active-hop-top,
.button-row,
.terminal-header,
.map-caption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.panel-heading {
  margin-bottom: 18px;
}

.panel-heading h2 {
  font-size: 2rem;
}

.status-pill,
.asn-pill,
.hop-badge,
.chip {
  border-radius: 999px;
  padding: 8px 12px;
  border: 1px solid rgba(61, 73, 92, 0.08);
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
}

.status-live {
  background: rgba(47, 127, 132, 0.16);
  color: var(--teal-deep);
}

.status-idle {
  color: var(--ink-soft);
}

.field-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.field-block label {
  font-size: 0.95rem;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(61, 73, 92, 0.12);
  background: rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  padding: 14px 16px;
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

textarea {
  resize: vertical;
  min-height: 220px;
  line-height: 1.5;
}

.chip-row,
.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.chip {
  padding: 9px 14px;
}

.button-primary,
.button-secondary {
  border: 0;
  padding: 12px 18px;
  border-radius: 999px;
  transition: transform 140ms ease, filter 140ms ease;
}

.button-primary {
  background: linear-gradient(135deg, var(--teal), var(--teal-deep));
  color: white;
  box-shadow: 0 18px 30px rgba(47, 127, 132, 0.22);
}

.button-secondary {
  background: linear-gradient(135deg, var(--sand), var(--coral));
  color: white;
  box-shadow: 0 18px 30px rgba(239, 125, 87, 0.2);
}

.button-primary:hover,
.button-secondary:hover,
.chip:hover,
.latency-row:hover,
.hop-list-item:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.error-card,
.terminal-card,
.inspector-card {
  border-radius: var(--radius-lg);
  background: var(--panel-strong);
  border: 1px solid rgba(61, 73, 92, 0.08);
  box-shadow: var(--shadow-md);
}

.error-card {
  padding: 14px 16px;
  color: #9a402f;
  background: rgba(255, 235, 228, 0.84);
  margin-bottom: 16px;
}

.terminal-card {
  overflow: hidden;
}

.terminal-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.terminal-card pre {
  margin: 0;
  padding: 18px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;
  line-height: 1.7;
  white-space: pre-wrap;
  color: #d8eceb;
  background: linear-gradient(180deg, #19333b, #15272e);
}

.map-panel {
  min-height: 100%;
}

.map-frame {
  border-radius: 26px;
  overflow: hidden;
  background: linear-gradient(180deg, #dce9ea, #cadbdc);
  border: 1px solid rgba(61, 73, 92, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.map-frame svg {
  display: block;
  width: 100%;
  height: auto;
}

.map-ocean {
  fill: url(#oceanGradient);
}

.graticule {
  stroke: rgba(255, 255, 255, 0.28);
  stroke-width: 1;
}

.continents path {
  fill: rgba(66, 122, 114, 0.22);
  stroke: rgba(66, 122, 114, 0.16);
  stroke-width: 2;
}

.route-segment {
  fill: none;
  stroke: url(#routeGradient);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 12 14;
  animation: flow 7s linear infinite;
  filter: drop-shadow(0 0 8px rgba(249, 115, 82, 0.28));
}

.hop-node {
  cursor: pointer;
  outline: none;
}

.hop-node.active .hop-dot,
.hop-node:focus .hop-dot {
  fill: #fff7e9;
  stroke-width: 3;
}

.hop-dot {
  fill: #fff3dd;
  stroke: #ef7d57;
  stroke-width: 2;
}

.hop-index {
  text-anchor: middle;
  font-size: 12px;
  font-weight: 800;
  fill: #294555;
}

.map-caption {
  margin-top: 16px;
}

.map-caption strong {
  font-size: 1.1rem;
}

.inspector-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.inspector-card {
  padding: 18px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.detail-grid strong,
.hop-list-item strong,
.active-hop-card h3 {
  display: block;
  margin-top: 4px;
}

.latency-list,
.hop-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.latency-row,
.hop-list-item {
  width: 100%;
  border: 1px solid rgba(61, 73, 92, 0.08);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 16px;
  padding: 12px 14px;
  display: grid;
  align-items: center;
  gap: 12px;
}

.latency-row {
  grid-template-columns: 68px minmax(0, 1fr) 68px;
}

.hop-list-item {
  grid-template-columns: 34px minmax(0, 1fr) 64px;
  text-align: left;
}

.selected {
  border-color: rgba(47, 127, 132, 0.28);
  background: rgba(235, 247, 246, 0.96);
}

.latency-bar-track {
  position: relative;
  display: block;
  height: 10px;
  border-radius: 999px;
  background: rgba(47, 127, 132, 0.12);
  overflow: hidden;
}

.latency-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--sand), var(--coral));
  border-radius: inherit;
}

.hop-seq {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(47, 127, 132, 0.12);
  color: var(--teal-deep);
  font-weight: 800;
}

@keyframes flow {
  from {
    stroke-dashoffset: 0;
  }

  to {
    stroke-dashoffset: -260;
  }
}

@media (max-width: 1240px) {
  .workspace-grid {
    grid-template-columns: 320px minmax(0, 1fr);
  }

  .inspector-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .hero,
  .workspace-grid,
  .summary-strip {
    grid-template-columns: 1fr;
  }

  .app-shell {
    width: min(100% - 20px, 1500px);
  }

  .panel,
  .hero {
    padding: 18px;
  }
}

@media (max-width: 640px) {
  .hero h1 {
    font-size: 2.4rem;
  }

  .panel-heading h2 {
    font-size: 1.6rem;
  }

  .detail-grid,
  .summary-strip {
    grid-template-columns: 1fr;
  }

  .latency-row {
    grid-template-columns: 54px minmax(0, 1fr) 56px;
  }
}
