:root {
  --app-bg: #f4f6fa;
  --app-ink: #172033;
  --app-muted: #667085;
  --app-soft: #eef2f7;
  --app-border: #dde4ee;
  --app-panel: #ffffff;
  --app-navy: #172033;
  --app-blue: #2457d6;
  --app-teal: #0d9488;
  --app-amber: #b7791f;
  --app-rose: #c2415d;
  --app-shadow: 0 16px 36px rgba(23, 32, 51, .08);
}

html,
body {
  min-height: 100%;
}

body {
  background: var(--app-bg);
  color: var(--app-ink);
  font-size: .95rem;
}

a {
  color: var(--app-blue);
}

a:hover {
  color: #1d46ac;
}

.app-shell {
  min-height: 100vh;
}

.sidebar-shell {
  background: #ffffff;
  border-right: 1px solid var(--app-border);
  flex-direction: column;
  gap: 1.5rem;
  inset: 0 auto 0 0;
  padding: 1.25rem;
  position: fixed;
  width: 280px;
  z-index: 1030;
}

.brand-lockup {
  align-items: center;
  color: var(--app-ink);
  display: flex;
  gap: .75rem;
  text-decoration: none;
}

.brand-lockup:hover {
  color: var(--app-ink);
}

.brand-mark {
  align-items: center;
  background: linear-gradient(135deg, var(--app-blue), var(--app-teal));
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  flex: 0 0 42px;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  letter-spacing: 0;
}

.brand-name,
.brand-subtitle {
  display: block;
}

.brand-name {
  font-weight: 800;
  line-height: 1.1;
}

.brand-subtitle {
  color: var(--app-muted);
  font-size: .78rem;
}

.sidebar-nav {
  display: grid;
  gap: .35rem;
}

.sidebar-link {
  align-items: center;
  border-radius: 8px;
  color: #465267;
  display: flex;
  gap: .75rem;
  font-weight: 700;
  min-height: 42px;
  padding: .65rem .75rem;
  text-decoration: none;
}

.sidebar-link:hover,
.sidebar-link:focus {
  background: var(--app-soft);
  color: var(--app-blue);
}

.sidebar-link.active {
  background: #e9f0ff;
  color: var(--app-blue);
}

.nav-glyph {
  align-items: center;
  background: #f7f9fc;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  display: inline-flex;
  flex: 0 0 28px;
  font-size: .75rem;
  height: 28px;
  justify-content: center;
}

.sidebar-link.active .nav-glyph {
  background: var(--app-blue);
  border-color: var(--app-blue);
  color: #fff;
}

.sidebar-footer {
  align-items: center;
  background: #f7faf9;
  border: 1px solid #cde9e4;
  border-radius: 8px;
  color: #176b5f;
  display: flex;
  font-size: .83rem;
  gap: .55rem;
  margin-top: auto;
  padding: .75rem;
}

.status-dot {
  background: var(--app-teal);
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(13, 148, 136, .15);
  flex: 0 0 8px;
  height: 8px;
}

.mobile-nav {
  max-width: 320px;
}

.app-main {
  min-height: 100vh;
}

.topbar {
  align-items: center;
  background: rgba(244, 246, 250, .92);
  border-bottom: 1px solid var(--app-border);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  min-height: 74px;
  padding: .85rem 1rem;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.topbar-left,
.account-cluster {
  align-items: center;
  display: flex;
  gap: .85rem;
}

.nav-toggle {
  border: 1px solid var(--app-border);
  border-radius: 8px;
  height: 42px;
  width: 42px;
}

.menu-lines,
.menu-lines::before,
.menu-lines::after {
  background: var(--app-ink);
  border-radius: 999px;
  content: "";
  display: block;
  height: 2px;
  width: 18px;
}

.menu-lines::before {
  transform: translateY(-6px);
}

.menu-lines::after {
  transform: translateY(4px);
}

.crumb-label {
  color: var(--app-muted);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar-title {
  font-size: 1.05rem;
  font-weight: 800;
}

.account-avatar {
  align-items: center;
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  color: var(--app-blue);
  display: flex;
  font-weight: 800;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.account-copy {
  line-height: 1.1;
  max-width: 230px;
}

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

.account-copy small {
  color: var(--app-muted);
  font-size: .75rem;
}

.page-canvas {
  padding: 1rem;
}

.page-header {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.run-header {
  margin-bottom: 1rem;
}

.page-kicker,
.eyebrow {
  color: var(--app-muted);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: .3rem;
  text-transform: uppercase;
}

.page-title,
.dashboard-heading h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.1;
  margin: 0;
}

.page-subtitle {
  color: var(--app-muted);
  margin: .45rem 0 0;
  max-width: 70rem;
  overflow-wrap: anywhere;
}

.run-final-url {
  color: var(--app-muted);
  font-size: .9rem;
  margin: .3rem 0 0;
  overflow-wrap: anywhere;
}

.run-header-meta {
  align-items: center;
  color: var(--app-muted);
  display: flex;
  flex-wrap: wrap;
  gap: .65rem 1rem;
  margin-top: .85rem;
}

.run-header-meta strong {
  color: var(--app-ink);
}

.header-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  justify-content: flex-end;
}

.dashboard-heading {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.status-pill,
.status-badge {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-weight: 800;
  gap: .4rem;
  padding: .42rem .72rem;
}

.status-pill {
  background: #e7f7f4;
  border: 1px solid #bde8df;
  color: #117061;
}

.status-badge {
  background: #eef2f7;
  color: #475467;
}

.status-queued,
.status-pending {
  background: #fff7e8;
  color: #94620d;
}

.status-running {
  background: #e9f0ff;
  color: #244fb8;
}

.status-completed {
  background: #e7f7f4;
  color: #117061;
}

.status-failed {
  background: #fdecef;
  color: #a63248;
}

.status-cancelled {
  background: #eef2f7;
  color: #475467;
}

.metric-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.metric-card,
.content-band,
.login-panel,
.result-panel,
.summary-panel {
  background: var(--app-panel);
  border: 1px solid var(--app-border);
  border-radius: 8px;
  box-shadow: var(--app-shadow);
}

.result-panel {
  height: 100%;
  padding: 1.1rem;
}

.result-panel h3 {
  font-size: 1.25rem;
  margin: .25rem 0;
}

.analysis-list {
  display: grid;
  gap: .75rem;
  margin: 1rem 0 0;
}

.analysis-list div {
  border-top: 1px solid var(--app-border);
  display: grid;
  gap: .25rem;
  padding-top: .75rem;
}

.analysis-list dt {
  color: var(--app-muted);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
}

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

.executive-summary {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
}

.summary-metrics {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.summary-card,
.site-preview-card,
.detail-item {
  background: var(--app-panel);
  border: 1px solid var(--app-border);
  border-radius: 8px;
}

.summary-card {
  display: grid;
  gap: .45rem;
  min-height: 132px;
  padding: 1rem;
}

.summary-card strong {
  font-size: 1.65rem;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.summary-card .metric-text {
  font-size: 1.1rem;
  line-height: 1.2;
}

.score-card {
  border-top: 4px solid var(--app-blue);
}

.site-preview-card {
  display: grid;
  gap: .85rem;
  min-height: 132px;
  padding: .9rem;
}

.site-preview-card__header {
  align-items: flex-start;
  display: flex;
  gap: .75rem;
  justify-content: space-between;
}

.site-preview-card__header h2 {
  font-size: 1rem;
  font-weight: 850;
  margin: 0;
}

.site-preview-card__header p {
  color: var(--app-muted);
  font-size: .84rem;
  margin: .2rem 0 0;
}

.site-preview-card__actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  justify-content: flex-end;
}

.browser-frame {
  background: #f8fafc;
  border: 1px solid #cfd8e5;
  border-radius: 8px;
  box-shadow: 0 12px 26px rgba(23, 32, 51, .10);
  overflow: hidden;
}

.browser-frame__toolbar {
  align-items: center;
  background: #eef2f7;
  border-bottom: 1px solid #d8e1ec;
  display: flex;
  gap: .4rem;
  min-height: 34px;
  padding: .45rem .6rem;
}

.browser-frame__dot {
  background: #94a3b8;
  border-radius: 999px;
  flex: 0 0 8px;
  height: 8px;
  width: 8px;
}

.browser-frame__address {
  background: #fff;
  border: 1px solid #d8e1ec;
  border-radius: 999px;
  color: var(--app-muted);
  display: block;
  font-size: .75rem;
  margin-left: .35rem;
  min-width: 0;
  overflow: hidden;
  padding: .18rem .55rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-frame__viewport {
  background: #fff;
  border: 0;
  display: block;
  height: 250px;
  overflow: hidden;
  padding: 0;
  width: 100%;
}

.browser-frame__viewport:focus-visible {
  box-shadow: inset 0 0 0 .2rem rgba(36, 87, 214, .25);
  outline: none;
}

.browser-frame__image {
  display: block;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  width: 100%;
}

.screenshot-modal-body {
  background: #f7f9fc;
  max-height: 75vh;
  overflow: auto;
  padding: 1rem;
}

.screenshot-modal-image {
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  display: block;
  height: auto;
  margin: 0 auto;
  max-width: 100%;
}

.filter-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.severity-badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: .78rem;
  font-weight: 700;
  padding: .28rem .62rem;
}

.severity-critical,
.severity-high {
  background: #fdecef;
  color: #a63248;
}

.severity-medium {
  background: #fff7e8;
  color: #94620d;
}

.severity-low {
  background: #e9f0ff;
  color: #244fb8;
}

.severity-info {
  background: #e7f7f4;
  color: #117061;
}

.dashboard-bars {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.bar-chart {
  border: 1px solid var(--app-border);
  border-radius: 8px;
  padding: 1rem;
}

.bar-chart h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.bar-row {
  align-items: center;
  display: grid;
  gap: .65rem;
  grid-template-columns: 90px 1fr 32px;
  margin-bottom: .7rem;
}

.bar-row span:first-child {
  color: var(--app-muted);
  font-size: .85rem;
}

.bar-track {
  background: #edf2f7;
  border-radius: 999px;
  height: .55rem;
  overflow: hidden;
}

.bar-fill {
  background: var(--app-blue);
  display: block;
  height: 100%;
}

.raw-json-viewer {
  background: #0f172a;
  border-radius: 8px;
  color: #e5eefb;
  max-height: 520px;
  overflow: auto;
  padding: 1rem;
  white-space: pre-wrap;
}

.score-summary {
  align-items: center;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(140px, 190px) minmax(0, 1fr);
}

.score-ring {
  align-items: center;
  aspect-ratio: 1;
  background: #f7f9fc;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  display: grid;
  justify-items: center;
  padding: 1rem;
  text-align: center;
}

.score-ring strong {
  font-size: 2rem;
  line-height: 1;
}

.score-ring span {
  color: var(--app-muted);
  font-weight: 800;
}

.score-bars {
  display: grid;
  gap: .9rem;
}

.score-bar-row {
  align-items: center;
  display: grid;
  gap: .85rem;
  grid-template-columns: minmax(150px, 220px) minmax(120px, 1fr) minmax(72px, auto);
}

.score-bar-row span,
.score-bar-row strong {
  font-weight: 850;
}

.score-bar-row small {
  color: var(--app-muted);
  display: block;
  margin-top: .15rem;
}

.score-track {
  background: #edf2f7;
  border-radius: 999px;
  height: .7rem;
  overflow: hidden;
}

.score-track span {
  background: linear-gradient(90deg, var(--app-blue), var(--app-teal));
  display: block;
  height: 100%;
}

.run-tabs {
  gap: .25rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0;
}

.run-tabs .nav-link {
  border-radius: 8px 8px 0 0;
  color: var(--app-muted);
  font-weight: 850;
  white-space: nowrap;
}

.run-tabs .nav-link.active {
  color: var(--app-blue);
}

.run-tab-content {
  padding-top: 1.25rem;
}

.detail-grid {
  display: grid;
  gap: .85rem;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.detail-item {
  display: grid;
  gap: .25rem;
  padding: .85rem;
}

.detail-item dt {
  color: var(--app-muted);
  font-size: .75rem;
  font-weight: 850;
  margin: 0;
  text-transform: uppercase;
}

.detail-item dd {
  font-weight: 750;
  margin: 0;
  overflow-wrap: anywhere;
}

.finding-list {
  display: grid;
  gap: .75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.finding-list li {
  align-items: flex-start;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  display: grid;
  gap: .85rem;
  grid-template-columns: auto 1fr;
  padding: .9rem;
}

.finding-list p {
  margin: .2rem 0 0;
}

.findings-table td:nth-child(3) {
  min-width: 280px;
}

.metric-card {
  display: grid;
  gap: .45rem;
  min-height: 140px;
  padding: 1.1rem;
  position: relative;
}

.metric-card::before {
  background: var(--app-blue);
  border-radius: 999px;
  content: "";
  height: 4px;
  inset: 0 1.1rem auto;
  position: absolute;
}

.metric-card.accent-green::before {
  background: var(--app-teal);
}

.metric-card.accent-amber::before {
  background: var(--app-amber);
}

.metric-card.accent-rose::before {
  background: var(--app-rose);
}

.metric-card strong {
  font-size: 2.05rem;
  line-height: 1;
  margin-top: .55rem;
}

.metric-card .metric-text {
  font-size: 1.15rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.metric-label,
.metric-note {
  color: var(--app-muted);
}

.metric-label {
  font-size: .85rem;
  font-weight: 800;
}

.metric-note {
  font-size: .85rem;
}

.content-band,
.summary-panel {
  padding: 1.25rem;
}

.section-title {
  align-items: center;
  display: flex;
  gap: .75rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-title h2,
.content-band h2 {
  font-size: 1.12rem;
  font-weight: 850;
  letter-spacing: 0;
  margin: 0;
}

.section-title p,
.content-band p {
  color: var(--app-muted);
  margin: .25rem 0 0;
  max-width: 65rem;
}

.form-band {
  max-width: 760px;
}

.form-label {
  color: #344054;
  font-weight: 800;
}

.form-control {
  border-color: var(--app-border);
  border-radius: 8px;
  min-height: 44px;
}

.form-control:focus,
.form-check-input:focus,
.btn:focus-visible {
  border-color: #9db7ff;
  box-shadow: 0 0 0 .2rem rgba(36, 87, 214, .15);
}

.btn {
  border-radius: 8px;
  font-weight: 800;
}

.btn-primary {
  --bs-btn-bg: var(--app-blue);
  --bs-btn-border-color: var(--app-blue);
  --bs-btn-hover-bg: #1d46ac;
  --bs-btn-hover-border-color: #1d46ac;
}

.table {
  --bs-table-color: var(--app-ink);
  margin-bottom: 0;
}

.table thead th {
  background: #f7f9fc;
  border-bottom: 1px solid var(--app-border);
  color: var(--app-muted);
  font-size: .75rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.table tbody td {
  border-color: #edf1f6;
  padding: .95rem .75rem;
  vertical-align: middle;
}

.table a {
  text-decoration: none;
}

.table-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  justify-content: flex-end;
}

.table-actions form {
  margin: 0;
}

.text-truncate-cell {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  align-items: center;
  display: grid;
  gap: .75rem;
  justify-items: start;
  min-height: 210px;
  padding: 2rem;
}

.empty-state h2 {
  font-size: 1.25rem;
  font-weight: 850;
  margin: 0;
}

.empty-state p {
  margin: 0;
}

.empty-icon {
  align-items: center;
  background: #eef5ff;
  border: 1px solid #d7e5ff;
  border-radius: 8px;
  color: var(--app-blue);
  display: flex;
  font-size: 1.35rem;
  font-weight: 850;
  height: 48px;
  justify-content: center;
  width: 48px;
}

.progress-track {
  background: #edf1f6;
  border-radius: 999px;
  height: 9px;
  overflow: hidden;
}

.progress-fill {
  background: linear-gradient(90deg, var(--app-blue), var(--app-teal));
  height: 100%;
}

.login-shell {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(36, 87, 214, .12), rgba(13, 148, 136, .10)),
    var(--app-bg);
  display: flex;
  min-height: 100vh;
  justify-content: center;
  padding: 1.5rem;
}

.login-panel {
  max-width: 450px;
  padding: 2rem;
  width: 100%;
}

.login-brand {
  align-items: center;
  color: var(--app-ink);
  display: flex;
  font-weight: 850;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.login-panel h1 {
  font-size: 1.75rem;
  font-weight: 850;
  margin-bottom: .35rem;
}

.login-panel .login-copy {
  color: var(--app-muted);
  margin-bottom: 1.5rem;
}

@media (min-width: 992px) {
  .app-main {
    margin-left: 280px;
  }

  .topbar {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .page-canvas {
    padding: 1.5rem;
  }
}

@media (min-width: 1200px) {
  .executive-summary {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}

@media (max-width: 767.98px) {
  .page-header,
  .dashboard-heading,
  .section-title {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .account-cluster {
    gap: .5rem;
  }

  .page-canvas {
    padding: .85rem;
  }

  .score-summary,
  .score-bar-row,
  .finding-list li {
    grid-template-columns: 1fr;
  }

  .score-ring {
    max-width: 180px;
  }
}
