:root {
  color-scheme: light;
  --bg: #f5f3ed;
  --paper: #fffdf8;
  --paper-2: #f0eee7;
  --ink: #171717;
  --muted: #706d65;
  --line: #ded8cb;
  --shadow: 0 18px 45px rgba(33, 28, 18, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #fff;
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(23, 23, 23, 0.18);
  outline-offset: 2px;
}

.app-shell {
  display: grid;
  gap: 18px;
  width: min(1820px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.hero-band {
  background: #171717;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  width: min(1820px, 100%);
  margin: 0 auto;
  padding: 14px 22px;
  color: #f5f3ed;
}

.hero-copy {
  width: min(1300px, 100%);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  color: #fff;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.05rem;
  line-height: 1.2;
}

.hero-copy p:last-child {
  max-width: 720px;
  margin-bottom: 0;
  color: rgba(245, 243, 237, 0.72);
  font-size: 0.82rem;
  line-height: 1.45;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, auto));
  align-self: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.hero-meta span {
  display: grid;
  min-height: 48px;
  align-content: center;
  gap: 3px;
  padding: 7px 14px;
  background: transparent;
  color: rgba(245, 243, 237, 0.65);
  font-size: 0.72rem;
  font-weight: 400;
}

.hero-meta span + span {
  border-left: 1px solid rgba(255, 255, 255, 0.18);
}

.hero-meta strong {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.control-band,
.map-panel,
.detail-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.88);
  box-shadow: var(--shadow);
}

.control-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.32fr);
  gap: 16px;
  align-items: end;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 12px;
}

.filter-group {
  display: grid;
  gap: 18px;
  align-items: end;
}

.filter-map-group {
  grid-template-columns: minmax(320px, 1fr) minmax(160px, 190px);
}

.filter-case-group {
  grid-template-columns: minmax(160px, 1fr) auto;
}

.field {
  display: grid;
  gap: 4.8px;
}

.field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.search-field {
  position: relative;
  align-self: end;
}

.control-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.search-icon {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 14px;
  color: #667085;
  transform: translateY(-50%);
  pointer-events: none;
}

input,
select {
  width: 100%;
  min-height: 33.6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

input {
  padding: 0 12px;
}

.search-field input {
  padding-left: 43px;
}

select {
  padding: 0 34px 0 12px;
}

.clear-filters {
  display: inline-flex;
  align-items: center;
  align-self: end;
  gap: 8px;
  min-height: 33.6px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: #4f5661;
  font-weight: 400;
  white-space: nowrap;
}

.view-tools {
  display: grid;
  grid-template-columns: 42px minmax(72px, auto) 42px;
  min-height: 42px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.view-tools[hidden] {
  display: none;
}

.view-tools button {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 900;
}

.view-tools button + button {
  border-left: 1px solid var(--line);
}

.workspace {
  --map-canvas-height: clamp(660px, 74vw, 920px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.32fr);
  gap: 16px;
  align-items: stretch;
}

.map-panel {
  min-width: 0;
  padding: 16px 16px 2px;
  border: 0;
  background: #fff;
}

.detail-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10.2px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #ebe7dc;
  color: #4e4a42;
  font-size: 0.8rem;
  font-weight: 900;
  white-space: nowrap;
}

.graph-frame {
  position: relative;
  height: var(--map-canvas-height);
  overflow: hidden;
  background: #fff;
}

#case-map {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: auto;
}

.edge {
  stroke-linecap: round;
  transition: opacity 160ms ease, stroke-width 160ms ease;
}

.edge.is-muted {
  opacity: 0.14;
}

.node {
  cursor: pointer;
}

.node:focus,
.node:focus-visible {
  outline: none;
}

.node circle {
  filter: drop-shadow(0 6px 11px rgba(30, 25, 17, 0.16));
  transition: stroke-width 160ms ease, transform 160ms ease;
}

.node:not(.company-node):hover circle,
.node:not(.company-node).is-selected circle {
  stroke-width: 4.25;
}

.company-node .company-inner-ring {
  filter: none;
}

.company-node:hover .company-outer-ring,
.company-node.is-selected .company-outer-ring {
  stroke-width: 0.8;
}

.node.is-muted {
  opacity: 0.18;
}

.node-label {
  pointer-events: none;
  fill: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 12px;
  font-weight: 400;
  text-anchor: middle;
}

.node-sublabel {
  pointer-events: none;
  fill: #35322c;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 10px;
  font-weight: 600;
  text-anchor: middle;
}

.company-label {
  font-weight: 700;
}

.cluster-boundary {
  fill: rgba(255, 253, 248, 0.72);
  stroke: #d7d0c2;
  stroke-dasharray: 4 8;
  stroke-width: 1.5;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 4px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 0.756rem;
  font-weight: 400;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border: 1px solid rgba(23, 23, 23, 0.35);
  border-radius: 999px;
}

.detail-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: calc(var(--map-canvas-height) + 42px);
  min-height: 0;
  overflow: hidden;
  padding: 22px;
  background: #fff;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
}

#case-detail {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin-right: -16px;
  padding-right: 18px;
  scrollbar-gutter: stable;
}

#case-detail::-webkit-scrollbar {
  width: 8px;
}

#case-detail::-webkit-scrollbar-thumb {
  border: 2px solid #fff;
  border-radius: 999px;
  background: #c9ced6;
}

.detail-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.detail-toolbar button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #dfe3e8;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
}

.detail-card {
  display: grid;
  gap: 0;
}

.detail-empty {
  display: grid;
  place-items: center;
  min-height: 100%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  text-align: center;
}

.case-relationship {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  color: #0969da;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}

.case-relationship b {
  font-weight: 400;
}

.detail-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.case-title-row {
  display: grid;
  justify-items: start;
  gap: 10px;
}

.case-title-row h3 {
  margin: 0;
  min-width: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.08;
}

.detail-panel .status-chip {
  flex: 0 0 auto;
  margin-left: 0;
  min-height: 29px;
  border: 1px solid color-mix(in srgb, var(--status-color) 28%, white);
  background: color-mix(in srgb, var(--status-color) 8%, white);
  color: var(--status-color);
  font-size: 12px;
  font-weight: 600;
}

.detail-card p {
  margin: 0;
  color: #30343b;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.58;
}

.detail-content {
  display: grid;
  gap: 23px;
}

.detail-stats {
  display: grid;
  overflow: hidden;
  border: 1px solid #dfe3e8;
  border-radius: 5.95px;
  background: #fff;
}

.detail-stat {
  min-height: 39.95px;
  padding: 8.5px 11.05px;
  background: #fff;
}

.detail-stat + .detail-stat {
  border-top: 1px solid #dfe3e8;
}

.detail-stat-label {
  display: inline-flex;
  align-items: center;
  gap: 7.65px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 400;
}

.detail-stat-label .detail-icon {
  width: 13.6px;
  height: 13.6px;
  flex-basis: 13.6px;
  color: #717987;
}

.detail-stat strong {
  max-width: 64%;
  color: #22262c;
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
  text-align: right;
}

.detail-section {
  display: grid;
  gap: 8px;
}

.detail-section h4 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.source-links {
  display: grid;
  justify-items: start;
  gap: 11px;
}

.source-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  color: #0969da;
  font-size: 14px;
  font-weight: 600;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.source-links a span {
  overflow-wrap: anywhere;
}

.source-links .detail-icon {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
}

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

.timeline-item {
  display: grid;
  gap: 6px;
  padding: 13px;
  border: 1px solid #dfe3e8;
  border-radius: 7px;
  background: #fff;
}

.detail-card p.timeline-empty {
  margin: 0;
  padding: 18px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}

.detail-tabs {
  display: flex;
  gap: 26px;
  margin: 20px 0 18px;
  border-bottom: 1px solid #dfe3e8;
}

.detail-tab {
  min-height: 40px;
  padding: 0 3px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #5f6670;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}

.detail-tab.is-active {
  border-bottom-color: #0969da;
  color: #0969da;
}

.detail-panel .timeline {
  margin-top: 0;
}

.detail-panel .timeline-item {
  padding: 10px;
}

.detail-panel .timeline-item p {
  font-size: 14px;
  font-weight: 400;
}

.timeline-item time {
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.timeline-item strong {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.timeline-item p {
  margin: 0;
  color: #41464e;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
}

.timeline-link {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 5px;
  min-height: 28px;
  padding: 4px 9px;
  border: 0;
  border-radius: 6px;
  color: #0969da;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
}

.timeline-link:hover {
  background: #f4f8ff;
}

.timeline-link .detail-icon {
  width: 12px;
  height: 12px;
  flex-basis: 12px;
}

.site-footer {
  min-height: 75px;
  margin-top: 34px;
  background: #080808;
  color: #fff;
}

.site-footer-inner {
  display: grid;
  align-content: center;
  justify-items: end;
  gap: 2px;
  width: min(1820px, 100%);
  min-height: 75px;
  margin: 0 auto;
  padding: 10px 22px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
}

.feedback-toggle {
  min-height: 26px;
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-weight: 400;
  transform: translateY(-5px);
}

.feedback-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.feedback-toggle:focus-visible {
  outline-color: rgba(255, 255, 255, 0.75);
}

.site-footer-notice {
  text-align: right;
  transform: translateY(-5px);
}

.feedback-dialog {
  width: min(520px, calc(100% - 28px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 20px;
  border: 1px solid #dfe3e8;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
  font-family: "Segoe UI", Arial, sans-serif;
}

.feedback-dialog::backdrop {
  background: rgba(0, 0, 0, 0.46);
}

.feedback-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.feedback-dialog-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.feedback-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #4f5661;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 25px;
  font-weight: 400;
  line-height: 1;
}

.feedback-close:hover {
  background: #f0f2f5;
  color: #171717;
}

.feedback-form {
  display: grid;
  gap: 14px;
}

.feedback-form label {
  display: grid;
  gap: 5px;
  width: 100%;
  font-size: 14px;
  font-weight: 600;
}

.feedback-form input,
.feedback-form textarea {
  width: 100%;
  border: 1px solid #a9adb4;
  border-radius: 6px;
  background: #fff;
  color: #171717;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
}

.feedback-form input {
  min-height: 34px;
  padding: 6px 9px;
}

.feedback-form textarea {
  min-height: 92px;
  padding: 8px 9px;
  resize: vertical;
}

.feedback-form button {
  justify-self: end;
  min-height: 30px;
  padding: 5px 15px;
  border: 0;
  border-radius: 6px;
  background: #171717;
  color: #fff;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
}

.feedback-form button:hover {
  background: #333;
}

.feedback-form button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.feedback-status {
  min-height: 18px;
  margin: 0;
  color: #4f5661;
  font-size: 13px;
  text-align: left;
}

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

  h1 {
    font-size: 41.76px;
  }

  .control-band {
    grid-template-columns: 1fr;
  }

  .clear-filters {
    justify-self: start;
  }

  .hero-meta {
    max-width: 720px;
  }

  .detail-panel {
    min-height: 0;
  }
}

@media (max-width: 680px) {
  .app-shell {
    padding: 14px;
  }

  h1 {
    font-size: 34.56px;
  }

  .hero-meta,
  .control-band {
    grid-template-columns: 1fr;
  }

  .filter-map-group,
  .filter-case-group {
    grid-template-columns: 1fr;
  }

  .hero-meta span {
    min-height: 49.6px;
  }

  .hero-meta span + span {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .workspace {
    --map-canvas-height: 680px;
  }

  .site-footer-inner {
    padding: 10px 14px;
  }

  .feedback-dialog {
    padding: 17px;
  }

}
