:root {
  --bg: #f4f5f3;
  --surface: #ffffff;
  --surface-alt: #eef2ef;
  --ink: #17201d;
  --muted: #65716c;
  --line: #d8ded9;
  --teal: #00796b;
  --teal-dark: #005e53;
  --amber: #b7791f;
  --red: #b42318;
  --green: #2f7d32;
  --violet: #5b5fc7;
  --shadow: 0 12px 30px rgba(23, 32, 29, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

.toolbar-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin: 12px 0 16px;
}

.toolbar-form input,
.toolbar-form select {
  min-height: 40px;
}

.toolbar-form input {
  min-width: min(360px, 100%);
}

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

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

.stat-card,
.mini-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.stat-card span,
.stat-card small,
.compact-list small {
  display: block;
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin: 6px 0;
  font-size: 1.6rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

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

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

.mini-card p {
  color: var(--muted);
}

.detail-list {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px 14px;
}

.detail-list dt {
  color: var(--muted);
  font-weight: 800;
}

.detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.compact-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.compact-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.bar-list p {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin: 0;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.bar-list span {
  overflow-wrap: anywhere;
}

.bar-list strong {
  color: var(--teal-dark);
}

@media (max-width: 980px) {
  .grid-two,
  .stat-grid,
  .card-grid {
    grid-template-columns: 1fr;
  }
  .detail-list {
    grid-template-columns: 1fr;
  }
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 460px) minmax(0, 1fr);
  align-items: stretch;
  gap: 24px;
  padding: 28px;
  background: #17201d;
}

.login-panel {
  align-self: start;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
  display: grid;
  gap: 20px;
}

.login-brand h1 {
  color: var(--ink);
}

.login-brand p {
  color: var(--muted);
}

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

.login-form label {
  font-weight: 800;
  color: var(--ink);
}

.setup-callout {
  border: 1px solid rgba(0, 121, 107, 0.22);
  background: #eef7f4;
  border-radius: 8px;
  padding: 16px;
}

.setup-callout h2 {
  margin: 4px 0 0;
  font-size: 1.15rem;
}

.setup-callout p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.form-note {
  margin: -2px 0 4px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.captcha-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.captcha-box img {
  display: block;
  width: 210px;
  height: 72px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.captcha-status {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.captcha-warning {
  color: var(--red);
}

.bot-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.alert-box {
  border: 1px solid rgba(180, 35, 24, 0.25);
  background: #fff3f0;
  color: var(--red);
  border-radius: 6px;
  padding: 12px;
}

.small-value {
  font-size: 0.92rem !important;
  word-break: break-word;
}

.compact-summary {
  margin-top: 12px;
}

.public-metrics-panel {
  background: #f8faf8;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 24px;
  overflow: auto;
  box-shadow: var(--shadow);
}

.public-metrics-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

.public-metrics-header h2 {
  margin: 4px 0 0;
  font-size: 1.5rem;
}

.public-metrics-header p {
  margin: 7px 0 0;
  color: var(--muted);
  max-width: 760px;
}

.eyebrow {
  display: inline-block;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.freshness {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.84rem;
  text-align: right;
}

.public-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.public-metric {
  border: 1px solid var(--line);
  box-shadow: none;
}

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

.public-chart-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.public-chart-card header {
  margin-bottom: 8px;
}

.public-chart-card h3 {
  margin: 0;
  font-size: 0.98rem;
}

.public-chart-card canvas {
  width: 100%;
  display: block;
}

.public-relationship-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 18px;
  padding: 16px;
}

.public-relationship-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.public-relationship-header h3 {
  margin: 0;
  font-size: 1.04rem;
}

.public-relationship-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.relationship-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.relationship-summary span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
}

.public-relationship-graph {
  min-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

.public-relationship-graph svg {
  width: 100%;
  min-width: 0;
  min-height: 360px;
  display: block;
}

.public-relationship-graph text {
  fill: #17201d;
  font-size: 12px;
}

.public-cluster-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.public-cluster-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.public-cluster-item strong,
.public-cluster-item span {
  display: block;
}

.public-cluster-item span {
  color: var(--muted);
  font-size: 0.86rem;
  margin-top: 3px;
}

.public-cluster-item dl {
  display: flex;
  gap: 10px;
  margin: 0;
}

.public-cluster-item dt {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.public-cluster-item dd {
  margin: 2px 0 0;
  font-weight: 900;
  text-align: right;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #17201d;
  color: #f8faf8;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #f2c14e;
  color: #17201d;
  font-weight: 800;
}

.brand h1,
.workspace h2,
.panel h3 {
  margin: 0;
}

.brand h1 {
  font-size: 1.08rem;
  line-height: 1.2;
}

.brand p,
.workspace p {
  margin: 4px 0 0;
  color: var(--muted);
}

.brand p {
  color: #bec8c2;
}

.scan-form {
  display: grid;
  gap: 8px;
}

.scan-form label {
  color: #dfe8e2;
  font-size: 0.84rem;
  font-weight: 700;
}

.path-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

input,
select,
textarea {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 6px;
  padding: 10px 11px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0, 121, 107, 0.14);
}

textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.35;
}

.primary-button,
.ghost-button,
.ghost-link,
.tab-button {
  border: 1px solid transparent;
  border-radius: 6px;
  min-height: 40px;
}

.primary-button {
  background: var(--teal);
  color: #ffffff;
  padding: 0 18px;
  font-weight: 800;
  width: 100%;
}

.primary-button:hover {
  background: var(--teal-dark);
}

.status-line {
  min-height: 22px;
  color: #cbd6d0;
  font-size: 0.86rem;
}

.tab-list {
  display: grid;
  gap: 7px;
}

.tab-button {
  text-align: left;
  color: #dfe8e2;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.12);
  padding: 10px 12px;
}

.tab-button.active,
.tab-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
}

.side-actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ghost-button,
.ghost-link {
  color: #f8faf8;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  padding: 10px 12px;
  text-decoration: none;
}

.workspace {
  padding: 24px;
  overflow: auto;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.workspace h2 {
  font-size: 1.45rem;
}

.filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filters input {
  width: min(360px, 48vw);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.91rem;
  white-space: nowrap;
}

.toggle input {
  width: 17px;
  height: 17px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric-grid .empty-state {
  grid-column: 1 / -1;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--shadow);
  min-height: 96px;
}

.metric .label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric .value {
  margin-top: 12px;
  font-size: 1.55rem;
  font-weight: 850;
}

.metric .sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

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

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.panel header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  min-width: 0;
}

.panel header > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

.panel h3 {
  font-size: 1rem;
}

.relation-panel {
  margin-top: 14px;
}

.relation-map {
  min-height: 220px;
  overflow: auto;
}

.relation-map svg {
  width: 100%;
  min-width: 760px;
  height: 280px;
}

.table-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.table-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 0.88rem;
}

.table-wrap {
  overflow: auto;
  max-height: calc(100vh - 220px);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

th,
td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  background: #fbfcfb;
  z-index: 1;
  font-size: 0.78rem;
  text-transform: uppercase;
  color: #4f5c56;
  user-select: none;
}

th.sortable:hover {
  color: var(--teal);
}

td {
  font-size: 0.9rem;
}

.mono {
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.82rem;
}

.tag-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 3px 8px;
  background: #f7f8f7;
  color: #3d4944;
  font-size: 0.78rem;
  white-space: nowrap;
}

.risk {
  display: inline-flex;
  align-items: center;
  min-width: 78px;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 9px;
  color: #fff;
  font-weight: 800;
  font-size: 0.78rem;
}

.risk.Critical {
  background: #7f1d1d;
}

.risk.High {
  background: var(--red);
}

.risk.Medium {
  background: var(--amber);
}

.risk.Low {
  background: var(--violet);
}

.risk.Clean {
  background: var(--green);
}

.dns-detection {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
  border: 1px solid var(--line);
  background: #f7f8f7;
  color: #2f3d37;
}

.dns-detection.High {
  background: #fff1f0;
  color: #9f1d18;
  border-color: #f3b5ae;
}

.dns-detection.Medium {
  background: #fff7e6;
  color: #8a5a00;
  border-color: #f1c879;
}

.dns-detection.Low {
  background: #eef5ff;
  color: #28527a;
  border-color: #b8d0f0;
}

.dns-detection.Info {
  background: #edf7f4;
  color: #0f6b5b;
  border-color: #a8d8cf;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--teal);
  padding: 0;
  text-align: left;
  font-weight: 800;
  text-decoration: none;
}

.link-button:hover {
  text-decoration: underline;
}

.empty-state {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 32px;
  color: var(--muted);
}

dialog {
  width: min(980px, calc(100vw - 40px));
  max-height: calc(100vh - 60px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(23, 32, 29, 0.48);
}

.dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
}

#detailContent {
  padding: 24px;
}

#detailContent pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #111816;
  color: #eef7f1;
  border-radius: 6px;
  padding: 14px;
  overflow: auto;
}

.profile-page {
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  padding: 24px;
  display: grid;
  gap: 16px;
}

.profile-page > * {
  min-width: 0;
}

.profile-page :where(a, p, h3, h4, small, strong, dt, dd, .panel-count) {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.profile-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  background: #17201d;
  color: #f8faf8;
  border-radius: 8px;
  padding: 22px;
  min-width: 0;
  overflow: hidden;
}

.profile-hero > div {
  min-width: 0;
}

.profile-hero h1 {
  margin: 10px 0 4px;
  font-size: 1.75rem;
  overflow-wrap: anywhere;
}

.profile-hero p {
  margin: 0;
  color: #cbd6d0;
  overflow-wrap: anywhere;
}

.profile-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}

.profile-actions .ghost-link {
  white-space: normal;
}

.profile-back {
  display: inline-flex;
  min-height: auto;
}

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

.profile-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  box-shadow: var(--shadow);
}

.profile-controls input {
  flex: 1 1 280px;
}

.filter-chip {
  border: 1px solid var(--line);
  background: #f7f8f7;
  color: #3d4944;
  border-radius: 999px;
  padding: 8px 11px;
  min-height: 36px;
  font-size: 0.86rem;
  font-weight: 800;
}

.filter-chip.active,
.filter-chip:hover {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

.profile-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(244, 245, 243, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  backdrop-filter: blur(8px);
}

.profile-nav a {
  color: var(--teal);
  text-decoration: none;
  font-weight: 800;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.86rem;
}

.profile-viz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr));
  gap: 14px;
  min-width: 0;
}

.profile-viz-panel {
  min-width: 0;
}

.profile-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.profile-stat-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 12px;
  display: grid;
  gap: 5px;
}

.profile-stat-card span,
.profile-bar-label span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.profile-stat-card strong {
  font-size: 1.45rem;
  line-height: 1;
  overflow-wrap: anywhere;
}

.profile-stat-card small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.profile-stat-card.high {
  border-color: rgba(180, 35, 24, 0.35);
  background: #fff5f2;
}

.profile-stat-card.medium {
  border-color: rgba(183, 121, 31, 0.38);
  background: #fff8ea;
}

.profile-stat-card.low {
  border-color: rgba(47, 125, 50, 0.28);
  background: #f1f8f2;
}

.profile-bar-list {
  display: grid;
  gap: 10px;
}

.profile-bar-row {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.profile-bar-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.profile-bar-label span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.profile-bar-label strong {
  font-size: 0.9rem;
}

.profile-bar-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #e7ece8;
  overflow: hidden;
}

.profile-bar-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width 0.4s ease;
}

.threat-fill {
  background: linear-gradient(90deg, #b42318, #b7791f);
}

.telemetry-fill {
  background: linear-gradient(90deg, #00796b, #5b5fc7);
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 14px;
  min-width: 0;
}

.evidence-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.evidence-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfb;
  min-width: 0;
}

.evidence-item > div {
  min-width: 0;
}

.evidence-score {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #17201d;
  color: #fff;
  font-weight: 850;
}

.evidence-item h4 {
  margin: 4px 0;
  font-size: 1rem;
}

.evidence-item p,
.evidence-item small {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.pivot-groups {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.pivot-group {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.pivot-group h4 {
  margin: 0 0 7px;
  font-size: 0.88rem;
  color: var(--muted);
  text-transform: uppercase;
}

.pivot-tag {
  color: #3d4944;
  text-decoration: none;
}

.profile-page .tag {
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.profile-page .tag-row > * {
  min-width: 0;
}

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

.crawl-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 12px;
  min-width: 0;
}

.crawl-card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
}

.crawl-card strong {
  overflow-wrap: anywhere;
  min-width: 0;
}

.crawl-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 12px 0 0;
}

.crawl-card dt {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.crawl-card dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.88rem;
}

.domain-diff-results {
  margin-top: 0;
}

.panel-count {
  color: var(--muted);
  font-size: 0.84rem;
}

.timeline {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.timeline-item {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(100px, 170px) minmax(0, 1fr);
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
  min-width: 0;
}

.timeline-item > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

.timeline-item time {
  color: var(--muted);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.82rem;
}

.profile-graph {
  min-height: 320px;
  max-width: 100%;
  overflow: auto;
  min-width: 0;
}

.profile-graph svg {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 320px;
  height: auto;
  display: block;
}

.profile-graph text {
  font-size: 12px;
  fill: #17201d;
}

.profile-table-panel {
  scroll-margin-top: 76px;
  min-width: 0;
}

.profile-table-wrap {
  max-height: 560px;
  max-width: 100%;
  overflow: auto;
}

.profile-table {
  min-width: 760px;
  table-layout: fixed;
}

.profile-table th,
.profile-table td {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.profile-table tr[style*="display: none"] {
  display: none;
}

.workbench-page,
.entity-page {
  gap: 14px;
}

.workbench-controls .ghost-button {
  background: #f7f8f7;
  color: var(--ink);
  border-color: var(--line);
  padding: 0 14px;
  font-weight: 800;
}

.workbench-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 14px;
}

.workbench-table .profile-table td,
.workbench-table .profile-table th {
  vertical-align: top;
}

.workbench-table input,
.workbench-table select {
  width: 100%;
  min-height: 34px;
  padding: 7px 8px;
  font-size: 0.86rem;
}

.workbench-table a {
  color: var(--teal);
  font-weight: 800;
  text-decoration: none;
}

.diff-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(130px, 180px);
  gap: 10px;
  align-items: center;
}

.diff-form .primary-button {
  width: 100%;
}

.diff-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.diff-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 12px;
}

.diff-card h4 {
  margin: 0 0 8px;
}

.diff-card p {
  overflow-wrap: anywhere;
}

.admin-page {
  min-height: 100vh;
  padding: 24px;
  display: grid;
  gap: 16px;
}

.admin-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.admin-hero h1 {
  margin: 4px 0 0;
}

.admin-hero p,
.admin-note {
  margin: 7px 0 0;
  color: var(--muted);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-panel {
  overflow: visible;
}

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

.admin-form label,
.audit-filter label {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

.admin-form .inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.admin-form .inline-check input {
  width: auto;
}

.admin-form .primary-button,
.admin-form .ghost-button,
.audit-filter .primary-button {
  width: 100%;
}

.admin-user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.admin-user-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 14px;
}

.admin-user-card header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.admin-user-card h3 {
  margin: 0;
}

.admin-user-card p {
  margin: 4px 0 0;
  color: var(--muted);
}

.compact-admin-form {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.admin-button-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.danger-button {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(180, 35, 24, 0.35);
  border-radius: 6px;
  background: #fff3f0;
  color: var(--red);
  font-weight: 800;
}

.code-block {
  max-width: 100%;
  overflow: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f172a;
  color: #e5e7eb;
  white-space: pre-wrap;
  word-break: break-word;
}

.json-block {
  max-width: min(720px, 72vw);
  max-height: 320px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: #172033;
  white-space: pre-wrap;
  word-break: break-word;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.status-active {
  background: #eaf7ec;
  color: var(--green);
}

.status-disabled {
  background: #f3f4f2;
  color: var(--muted);
}

.status-locked {
  background: #fff3f0;
  color: var(--red);
}

.success-box {
  border-color: rgba(47, 125, 50, 0.25);
  background: #eef8ef;
  color: var(--green);
}

.audit-filter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px 160px;
  gap: 10px;
  align-items: end;
}

.audit-table td {
  vertical-align: top;
  overflow-wrap: anywhere;
}

.audit-page .metric .sub {
  overflow-wrap: anywhere;
}

.audit-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  gap: 14px;
}

.audit-chart-card {
  min-width: 0;
}

.audit-bar-list {
  display: grid;
  gap: 10px;
}

.audit-bar-row {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.audit-bar-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.audit-bar-label span {
  min-width: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.audit-bar-label strong {
  font-size: 0.9rem;
}

.audit-progress {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #e7ece8;
}

.audit-progress::-webkit-progress-bar {
  background: #e7ece8;
  border-radius: 999px;
}

.audit-progress::-webkit-progress-value {
  background: linear-gradient(90deg, #00796b, #5b5fc7);
  border-radius: 999px;
}

.audit-progress::-moz-progress-bar {
  background: linear-gradient(90deg, #00796b, #5b5fc7);
  border-radius: 999px;
}

.audit-user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
  gap: 14px;
}

.audit-user-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 14px;
}

.audit-user-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
}

.audit-user-card h3,
.audit-user-card p,
.audit-user-meta span {
  overflow-wrap: anywhere;
}

.audit-user-card h3 {
  margin: 0;
}

.audit-user-card p {
  margin: 4px 0 0;
  color: var(--muted);
}

.audit-user-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.audit-user-metrics div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 9px;
}

.audit-user-metrics dt {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
}

.audit-user-metrics dd {
  margin: 3px 0 0;
  font-weight: 900;
}

.audit-user-meta {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

.audit-dossier-link {
  justify-self: start;
  color: var(--ink);
  background: #f7f8f7;
  border-color: var(--line);
}

.threat-page {
  min-width: 0;
  overflow-x: hidden;
}

.threat-hero h1,
.threat-hero p,
.threat-page .metric .sub,
.threat-summary-copy p {
  overflow-wrap: anywhere;
}

.threat-controls select {
  min-width: 150px;
}

.threat-toggle {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 11px;
  background: #f7f8f7;
  font-weight: 800;
}

.threat-inbox {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  gap: 14px;
}

.threat-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 14px;
}

.threat-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.threat-card h3 {
  margin: 8px 0 4px;
  font-size: 1.04rem;
  overflow-wrap: anywhere;
}

.threat-card h3 a {
  color: var(--ink);
  text-decoration: none;
}

.threat-card h3 a:hover {
  color: var(--teal);
  text-decoration: underline;
}

.threat-card p,
.threat-detail {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.threat-score {
  flex: 0 0 auto;
  width: 66px;
  min-height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(180, 35, 24, 0.24);
  border-radius: 8px;
  background: #fff5f2;
  color: var(--red);
}

.threat-score span {
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
}

.threat-score small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

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

.threat-facts div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 9px;
  min-width: 0;
}

.threat-facts dt {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.threat-facts dd {
  margin: 3px 0 0;
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

.threat-chart-card,
.threat-graph,
.threat-evidence-table {
  min-width: 0;
}

.threat-progress::-webkit-progress-value {
  background: linear-gradient(90deg, #b42318, #b7791f);
}

.threat-progress::-moz-progress-bar {
  background: linear-gradient(90deg, #b42318, #b7791f);
}

.threat-matrix {
  table-layout: fixed;
}

.matrix-hit {
  display: inline-flex;
  border-radius: 999px;
  background: #fff3f0;
  color: var(--red);
  border: 1px solid rgba(180, 35, 24, 0.22);
  padding: 3px 7px;
  font-size: 0.74rem;
  font-weight: 850;
}

.matrix-empty {
  color: var(--muted);
}

.threat-heatmap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
  gap: 12px;
}

.threat-heatmap article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 12px;
}

.threat-heatmap h4 {
  margin: 0 0 10px;
  overflow-wrap: anywhere;
}

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

.heatmap-source-grid span {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  padding: 6px 8px;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.heatmap-source-grid span.hot {
  background: #fff5f2;
  color: var(--red);
  border-color: rgba(180, 35, 24, 0.24);
  font-weight: 850;
}

.threat-summary-copy {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.threat-summary-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.48;
}

.threat-page .tag {
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.client-threat-status {
  display: grid;
  gap: 18px;
  border-left: 6px solid var(--line);
}

.client-threat-status header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.client-threat-status h2,
.client-threat-status p {
  margin: 0;
}

.client-threat-status h2 {
  overflow-wrap: anywhere;
}

.client-threat-status p {
  color: var(--muted);
  line-height: 1.5;
}

.client-threat-status.critical,
.client-threat-status.high {
  border-left-color: var(--red);
  background: #fffafa;
}

.client-threat-status.medium {
  border-left-color: #b7791f;
  background: #fffdf7;
}

.client-threat-status.clean {
  border-left-color: var(--teal);
  background: #f8fffd;
}

.large-score {
  min-width: 92px;
}

.client-threat-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.client-threat-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  padding: 7px 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.threat-first-grid {
  align-items: start;
}

.compact-threat-inbox {
  grid-template-columns: 1fr;
}

.coverage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
  gap: 10px;
}

.coverage-card {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 12px;
}

.coverage-card span,
.coverage-card small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.coverage-card strong {
  font-size: 1.25rem;
}

.coverage-card.available {
  border-color: rgba(0, 121, 107, 0.24);
  background: #f8fffd;
}

.priority-queue {
  display: grid;
  gap: 10px;
}

.priority-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 12px;
}

.priority-rank {
  width: 46px;
  min-height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #fff3f0;
  color: var(--red);
  font-weight: 900;
}

.priority-item h4,
.priority-item p,
.priority-item small {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.priority-item p,
.priority-item small {
  color: var(--muted);
}

.lifecycle-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: 10px;
}

.lifecycle-column {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 12px;
}

.lifecycle-column h4 {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
}

.lifecycle-column a,
.lifecycle-column small {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.82rem;
}

.graph-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.compact-clusters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 10px;
}

.cluster-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 12px;
}

.cluster-card h4,
.cluster-card p,
.cluster-card small {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
}

.lane-timeline {
  display: grid;
  gap: 10px;
  overflow-x: auto;
}

.lane-row {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(260px, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.lane-title {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.lane-title strong,
.lane-title span,
.lane-empty {
  overflow-wrap: anywhere;
}

.lane-title span,
.lane-empty {
  color: var(--muted);
  font-size: 0.78rem;
}

.lane-points {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.lane-point {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: #f9dfd9;
  color: #9f2418;
  font-size: 0.74rem;
  font-weight: 900;
  text-decoration: none;
}

.lane-point:hover {
  background: #efd1cd;
}

.threat-change-matrix {
  min-width: 760px;
}

.threat-cell {
  display: inline-flex;
  justify-content: center;
  min-width: 66px;
  padding: 5px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  background: #eef2f0;
  color: #52605a;
}

.threat-cell.new,
.threat-cell.changed {
  background: #f9dfd9;
  color: #9f2418;
}

.threat-cell.present {
  background: #fff1cf;
  color: #76530b;
}

.threat-cell.resolved {
  background: #dff1e8;
  color: #176944;
}

.priority-item.overdue {
  border-color: #d92d20;
  box-shadow: inset 4px 0 0 #d92d20;
}

.error-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #17201d;
}

.error-panel {
  width: min(680px, 100%);
  display: grid;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.error-brand h1 {
  color: var(--ink);
}

.error-brand p {
  color: var(--muted);
}

.error-code {
  width: fit-content;
  min-width: 76px;
  min-height: 48px;
  display: grid;
  place-items: center;
  padding: 0 16px;
  border-radius: 8px;
  background: #fff3f0;
  color: var(--red);
  font-size: 1.6rem;
  font-weight: 900;
}

.error-panel h2 {
  margin: 0;
  font-size: 1.7rem;
}

.error-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.audit-reference {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 12px;
}

.audit-reference code {
  color: var(--ink);
  overflow-wrap: anywhere;
}

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

.primary-link,
.light-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 6px;
  padding: 0 16px;
  text-decoration: none;
  font-weight: 800;
}

.primary-link {
  background: var(--teal);
  color: #ffffff;
}

.light-link {
  color: var(--ink);
  border-color: var(--line);
}

@media (max-width: 1100px) {
  .login-page {
    grid-template-columns: 1fr;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .tab-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .metric-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .public-metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .workbench-grid,
  .audit-filter,
  .diff-form {
    grid-template-columns: 1fr;
  }

  .admin-hero {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .workspace {
    padding: 16px;
  }

  .topbar,
  .filters {
    display: grid;
    grid-template-columns: 1fr;
  }

  .filters input {
    width: 100%;
  }

  .path-row {
    grid-template-columns: 1fr;
  }

  .tab-list,
  .metric-grid,
  .viz-grid,
  .profile-summary,
  .public-metric-grid,
  .public-chart-grid,
  .public-cluster-list {
    grid-template-columns: 1fr;
  }

  .login-page {
    padding: 14px;
  }

  .public-metrics-header,
  .public-relationship-header,
  .public-cluster-item {
    display: grid;
  }

  .relationship-summary {
    justify-content: flex-start;
  }

  .profile-page {
    padding: 14px;
  }

  .profile-hero,
  .admin-hero,
  .admin-button-row,
  .audit-user-metrics,
  .threat-card-top,
  .threat-facts,
  .heatmap-source-grid,
  .timeline-item {
    display: grid;
    grid-template-columns: 1fr;
  }
}
