:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --ink: #17202a;
  --muted: #647386;
  --line: #dce2e9;
  --panel: #ffffff;
  --brand: #155eef;
  --brand-dark: #0f3fa8;
  --ok: #13795b;
  --warn: #b54708;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 56px;
}

.hero {
  min-height: 330px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: end;
  gap: 32px;
  padding: 38px;
  color: white;
  background:
    linear-gradient(115deg, rgba(13, 29, 50, .92), rgba(17, 85, 160, .74)),
    url("https://images.unsplash.com/photo-1591799264318-7e6ef8ddb7ea?auto=format&fit=crop&w=1800&q=80");
  background-size: cover;
  background-position: center;
  border-radius: 8px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 800;
}

h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: 760px;
  margin-bottom: 14px;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1;
  letter-spacing: 0;
}

.lead {
  max-width: 700px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, .88);
  font-size: 18px;
  line-height: 1.55;
}

.hero-panel {
  padding: 18px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 8px;
  backdrop-filter: blur(8px);
}

.hero-panel span, .hero-panel strong { display: block; }
.hero-panel strong { margin-top: 8px; word-break: break-word; }
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #37d399;
  display: inline-block;
  margin-right: 8px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 22px 0;
}

button, .primary, .upload, .oem {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.filters {
  display: grid;
  grid-template-columns: auto minmax(180px, 240px) minmax(220px, 1fr);
  gap: 10px;
  margin: 14px 0;
  align-items: center;
}

.segments {
  display: inline-grid;
  grid-auto-flow: column;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: white;
}

.segment {
  min-height: 38px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: white;
}

.segment:last-child {
  border-right: 0;
}

.segment.active {
  color: white;
  background: var(--brand-dark);
}

select, input[type="search"] {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  font: inherit;
}

.primary {
  color: white;
  border-color: var(--brand);
  background: var(--brand);
}

.upload input { display: none; }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.panel, .report {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}

.live-hero {
  min-height: 260px;
}

.live-panel {
  margin-top: 18px;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.progress-head strong {
  font-size: 34px;
  color: var(--brand-dark);
}

.progress-bar {
  height: 12px;
  overflow: hidden;
  background: #e6ebf2;
  border-radius: 999px;
  margin: 14px 0 18px;
}

.progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--brand);
  transition: width .25s ease;
}

.events {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

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

.event span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.event strong {
  display: block;
}

.event p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.steps {
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.65;
}

.small {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

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

.facts div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.facts span, .device small, .device p { color: var(--muted); }
.facts strong { word-break: break-word; }

.report {
  margin-top: 18px;
}

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

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 92px);
  gap: 10px;
}

.metrics div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
}

.metrics strong {
  display: block;
  font-size: 28px;
}

.metrics span {
  color: var(--muted);
  font-size: 12px;
}

.oem {
  margin-bottom: 14px;
  border-color: #b9c7dc;
}

.devices {
  display: grid;
  gap: 12px;
}

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

.device {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--ok);
  border-radius: 8px;
}

.driverpacks {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.report-head.compact {
  align-items: center;
}

.pack {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 8px;
}

.pack input {
  margin-top: 3px;
}

.pack strong, .pack small {
  display: block;
}

.pack small, .pack em {
  color: var(--muted);
  margin-top: 3px;
}

.pack em {
  display: block;
  font-style: normal;
  font-weight: 700;
}

.pack ul {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.pack li {
  padding: 8px;
  background: #f6f8fb;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.pack li b,
.pack li span,
.pack li code {
  display: block;
}

.pack li span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.pack li code {
  margin-top: 4px;
  font-size: 12px;
}

.detected-details {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.detected-details > summary {
  cursor: pointer;
  font-weight: 800;
}

.device.needs { border-left-color: var(--warn); }
.category {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.device h3 { margin-bottom: 6px; font-size: 18px; }
.device p { margin-bottom: 4px; }
.device-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.device-links a {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--brand-dark);
  text-decoration: none;
  font-weight: 700;
}

details { margin-top: 10px; }
code { word-break: break-all; white-space: normal; }
.notice { padding: 12px 14px; border-radius: 8px; margin: 18px 0; }
.notice.error { background: #fff1f0; color: #a61b1b; border: 1px solid #f3c5c0; }

@media (max-width: 820px) {
  .hero, .grid, .device, .report-head {
    grid-template-columns: 1fr;
  }
  .filters {
    grid-template-columns: 1fr;
  }
  .hero { padding: 26px; }
  .metrics { grid-template-columns: repeat(3, 1fr); width: 100%; }
  .facts div { grid-template-columns: 1fr; }
}
