:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0b0d12;
  color: #f1f4fa;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 10% 0%, rgba(96, 72, 255, 0.18), transparent 34rem),
    radial-gradient(circle at 90% 20%, rgba(19, 214, 160, 0.12), transparent 30rem),
    #0b0d12;
}

main {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 96px;
}

header { margin-bottom: 32px; }

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

h1 {
  max-width: 860px;
  margin-bottom: 14px;
  font-size: clamp(2.2rem, 6vw, 5.2rem);
  line-height: 0.96;
  letter-spacing: -0.055em;
}

h2 { margin-bottom: 0; }

h3 { margin: 0; }

.eyebrow {
  margin-bottom: 10px;
  color: #7df5d2;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.lede {
  max-width: 760px;
  color: #aab3c3;
  font-size: 1.05rem;
  line-height: 1.6;
}

.panel {
  border: 1px solid #252a35;
  border-radius: 18px;
  background: rgba(18, 21, 28, 0.9);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 16px;
}

label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

input, button {
  min-height: 42px;
  border-radius: 11px;
  font: inherit;
}

input {
  width: min(280px, 100%);
  border: 1px solid #343b49;
  padding: 0 13px;
  background: #0e1117;
  color: inherit;
}

button {
  border: 0;
  padding: 0 16px;
  background: #7df5d2;
  color: #07110e;
  font-weight: 750;
  cursor: pointer;
}

button.secondary {
  border: 1px solid #343b49;
  background: transparent;
  color: #d8deea;
}

button:disabled { cursor: wait; opacity: 0.55; }

#status {
  margin-left: auto;
  color: #aab3c3;
  font-size: 0.9rem;
}

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

.metric { min-width: 0; padding: 20px; }

.metric span {
  display: block;
  margin-bottom: 9px;
  color: #8993a5;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  overflow: hidden;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ua-panel { overflow: hidden; }

.status-pill {
  flex: 0 0 auto;
  border: 1px solid #343b49;
  border-radius: 999px;
  padding: 7px 11px;
  color: #aab3c3;
  font-size: 0.72rem;
  font-weight: 750;
}

.status-pill.good {
  border-color: rgba(56, 211, 159, 0.34);
  background: rgba(56, 211, 159, 0.09);
  color: #7df5d2;
}

.status-pill.warning {
  border-color: rgba(255, 178, 77, 0.38);
  background: rgba(255, 178, 77, 0.1);
  color: #ffc979;
}

.ua-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.ua-mark {
  display: grid;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(125, 245, 210, 0.28);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(125, 245, 210, 0.18), rgba(96, 72, 255, 0.2));
  color: #effff9;
  font-weight: 850;
  letter-spacing: -0.04em;
}

.ua-identity { min-width: 0; }

.ua-identity h3 {
  margin-bottom: 8px;
  font-size: 1.12rem;
}

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

.badge {
  border: 1px solid #303745;
  border-radius: 999px;
  padding: 4px 8px;
  background: #11151c;
  color: #bdc6d6;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.68rem;
}

.ua-raw {
  display: block;
  width: 100%;
  border: 1px solid #282e3a;
  border-radius: 12px;
  padding: 13px 14px;
  overflow-wrap: anywhere;
  background: #0c0f15;
  color: #aeb8c9;
  font-size: 0.76rem;
  line-height: 1.6;
  white-space: normal;
}

.ua-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.ua-detail {
  min-width: 0;
  border: 1px solid #282e3a;
  border-radius: 13px;
  padding: 12px;
  background: rgba(12, 15, 21, 0.62);
}

.ua-detail h4 {
  margin: 0 0 9px;
  color: #7df5d2;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ua-detail dl { margin: 0; }

.ua-detail dl div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 5px;
}

.ua-detail dt { color: #717c8f; font-size: 0.68rem; }

.ua-detail dd {
  margin: 0;
  overflow: hidden;
  color: #dce3ee;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.7rem;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ua-source-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin: 20px 0 10px;
}

.ua-source-heading h3 { font-size: 0.88rem; }

.ua-source-heading p {
  margin: 0;
  color: #717c8f;
  font-size: 0.72rem;
}

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

.ua-source {
  min-width: 0;
  border: 1px solid #282e3a;
  border-radius: 11px;
  padding: 10px 11px;
  background: rgba(12, 15, 21, 0.52);
}

.ua-source.mismatch {
  border-color: rgba(255, 178, 77, 0.42);
  background: rgba(255, 178, 77, 0.07);
}

.ua-source > span {
  display: block;
  margin-bottom: 5px;
  color: #8993a5;
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.ua-source code {
  display: block;
  overflow: hidden;
  color: #c8d0de;
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.client-mark {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #354052;
  border-radius: 8px;
  background: #141923;
  color: #7df5d2;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.62rem;
  font-weight: 850;
}

.client-copy { min-width: 0; }

.client-copy strong,
.client-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-copy strong { color: #e5ebf4; font-size: 0.72rem; }
.client-copy small { margin-top: 2px; color: #798497; font-size: 0.62rem; }

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

.automation-summary article {
  min-width: 0;
  border: 1px solid #282e3a;
  border-radius: 13px;
  padding: 13px;
  background: rgba(12, 15, 21, 0.62);
}

.automation-summary span,
.automation-summary strong { display: block; }

.automation-summary span {
  margin-bottom: 7px;
  color: #717c8f;
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.automation-summary strong {
  overflow: hidden;
  color: #e5ebf4;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.automation-note {
  margin: 12px 0;
  color: #798497;
  font-size: 0.74rem;
}

.automation-table tr.detected td { background: rgba(255, 178, 77, 0.06); }
.automation-table tr.detected td:nth-child(2) { color: #ffc979; }
.automation-table tr.clear td:nth-child(2) { color: #7df5d2; }

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

.gpu-summary article {
  min-width: 0;
  border: 1px solid #282e3a;
  border-radius: 13px;
  padding: 13px;
  background: rgba(12, 15, 21, 0.62);
}

.gpu-summary span,
.gpu-summary strong { display: block; }

.gpu-summary span {
  margin-bottom: 7px;
  color: #717c8f;
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gpu-summary strong {
  overflow: hidden;
  color: #e5ebf4;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gpu-note {
  margin: 12px 0;
  color: #798497;
  font-size: 0.74rem;
}

.status-pill.running { color: #b9aaff; }

.status-pill.danger {
  border-color: rgba(255, 102, 125, 0.44);
  background: rgba(255, 102, 125, 0.11);
  color: #ff8ca0;
}

section.panel:not(.controls):not(.metric) {
  margin-bottom: 18px;
  padding: 20px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.section-heading > p {
  max-width: 520px;
  margin-bottom: 0;
  color: #8993a5;
  font-size: 0.88rem;
}

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

th, td {
  max-width: 520px;
  border-bottom: 1px solid #252a35;
  padding: 11px 10px;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

th {
  color: #8993a5;
  font-size: 0.68rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

td { font-family: "SFMono-Regular", Consolas, monospace; }

tbody tr:last-child td { border-bottom: 0; }

@media (max-width: 900px) {
  .identity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .controls { align-items: stretch; flex-direction: column; }
  #status { margin-left: 0; }
  .section-heading { align-items: start; flex-direction: column; }
  .ua-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .automation-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gpu-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  main { width: min(100% - 20px, 1440px); padding-top: 32px; }
  .identity-grid { grid-template-columns: 1fr; gap: 10px; }
  .ua-details, .ua-sources { grid-template-columns: 1fr; }
  .automation-summary { grid-template-columns: 1fr; }
  .gpu-summary { grid-template-columns: 1fr; }
  .ua-source-heading { align-items: start; flex-direction: column; gap: 6px; }
}
