:root {
  color-scheme: dark;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    sans-serif;
  color: #e2e8f0;
  background: #060911;
  font-size: 12px;
  line-height: 1.35;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #060911;
  color: #e2e8f0;
}

code,
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.hud-shell {
  width: 100%;
  max-width: 56rem;
  margin-inline: auto;
  padding: 0.45rem 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* Strip 1: Topbar */
.hud-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding: 0.35rem 0.5rem;
  background: #0b1120;
  border: 1px solid #1e293b;
  border-radius: 0.375rem;
}

.hud-identity {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  flex-wrap: wrap;
}

.brand {
  font-size: 0.75rem;
  font-weight: 700;
  color: #38bdf8;
  white-space: nowrap;
}

.sep {
  color: #475569;
  font-weight: 700;
}

.campaign-title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 16rem;
}

.eyebrow-tag {
  font-size: 0.65rem;
  color: #94a3b8;
  background: #131c31;
  border: 1px solid #1e293b;
  padding: 0.08rem 0.35rem;
  border-radius: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 14rem;
}

.hud-badges {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

.badge-origin,
.badge-mode {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 0.12rem 0.4rem;
  border-radius: 0.25rem;
  white-space: nowrap;
}

.badge-origin {
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.badge-mode {
  background: #131c31;
  color: #94a3b8;
  border: 1px solid #1e293b;
}

/* Strip 2: Monitored DOM DID Bar */
.hud-did-strip {
  background: #0b1324;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 0.375rem;
  padding: 0.35rem 0.55rem;
}

.did-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.did-left {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.cta-label {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

.phone-cta {
  font-size: 0.95rem;
  font-weight: 800;
  color: #34d399;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.phone-cta:hover {
  color: #6ee7b7;
  text-decoration: underline;
}

.did-subtext {
  margin-top: 0.15rem;
  font-size: 0.65rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Strip 3: Action Toolbar */
.hud-toolbar {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 0.9fr;
  gap: 0.3rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.32rem 0.4rem;
  border-radius: 0.3rem;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background 0.12s ease,
    border-color 0.12s ease;
}

.btn-primary {
  background: #0284c7;
  color: #ffffff;
  border: 1px solid #38bdf8;
}

.btn-primary:hover {
  background: #0369a1;
}

.btn-outline {
  background: #0b1120;
  color: #cbd5e1;
  border: 1px solid #1e293b;
}

.btn-outline:hover {
  border-color: #38bdf8;
  color: #ffffff;
  background: #111c33;
}

/* Status Pills */
.status-pill {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.42rem;
  border-radius: 999px;
  white-space: nowrap;
}

.status-pass {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.status-warn {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.status-fail {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.status-neutral {
  background: #131c31;
  color: #94a3b8;
  border: 1px solid #1e293b;
}

/* Alert Banner */
.alert-box {
  padding: 0.35rem 0.5rem;
  border-radius: 0.32rem;
  font-size: 0.68rem;
  line-height: 1.3;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.hidden {
  display: none;
}

/* Strip 4 & 5: Dense Table Cards */
.hud-table-card,
.hud-network-card {
  background: #0b1120;
  border: 1px solid #1e293b;
  border-radius: 0.375rem;
  overflow: hidden;
}

.card-subheader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.28rem 0.55rem;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

.subheader-hint {
  font-size: 0.6rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: #64748b;
}

.diag-table {
  margin: 0;
  display: flex;
  flex-direction: column;
}

.diag-row {
  display: grid;
  grid-template-columns: 7.75rem minmax(0, 1fr);
  align-items: center;
  gap: 0.4rem;
  padding: 0.26rem 0.55rem;
  border-bottom: 1px solid rgba(30, 41, 59, 0.65);
}

.diag-row:last-child {
  border-bottom: none;
}

.diag-row dt {
  font-size: 0.66rem;
  font-weight: 600;
  color: #94a3b8;
  white-space: nowrap;
}

.diag-row dd {
  margin: 0;
  font-size: 0.68rem;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.copyable {
  cursor: pointer;
}

.copyable:hover {
  color: #38bdf8;
}

/* Network List */
.network-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 8.5rem;
  overflow-y: auto;
  font-size: 0.66rem;
}

.network-list li {
  padding: 0.24rem 0.55rem;
  border-bottom: 1px solid rgba(30, 41, 59, 0.55);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.network-list li:last-child {
  border-bottom: none;
}

.net-left {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  color: #cbd5e1;
}

.net-right {
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 600;
}

.network-empty {
  color: #64748b;
}

@media (max-width: 24rem) {
  .hud-toolbar {
    grid-template-columns: repeat(2, 1fr);
  }
}
