#empire-scan-root {
  display: block;
}

.empire-scan {
  max-width: 1060px;
  margin: 0 auto;
}

.empire-scan .es-head {
  margin-bottom: 18px;
}

.empire-scan .es-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 10px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.empire-scan .es-back:hover {
  border-color: var(--gold-line);
  color: var(--text);
}

.es-headline {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-top: 8px;
}

.es-headline h1 {
  margin: 0;
}

.es-headline .sub {
  margin: 8px 0 0;
}

.es-all {
  flex: 0 0 auto;
  min-height: 44px;
}

.es-all span {
  font-size: 12px;
  font-weight: 700;
  opacity: .72;
}

.es-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 16px 18px;
}

.es-summary div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 220px;
}

.es-summary span,
.es-dash-copy span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.es-summary strong,
.es-dash-copy strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.es-summary i,
.es-dash-bar {
  display: block;
  flex: 1 1 auto;
  height: 5px;
  border-radius: 99px;
  overflow: hidden;
  background: var(--surface-3);
}

.es-summary b,
.es-dash-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  box-shadow: 0 0 18px var(--glow);
  transition: width .25s var(--ease);
}

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

.es-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--surface-grad-2));
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 3%, transparent);
}

.es-row-state {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
}

.es-mark {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.es-ok {
  color: var(--bg);
  background: var(--ok);
}

.es-skip {
  color: var(--muted);
  background: var(--surface-3);
  border: 1px solid var(--border);
}

.es-idle {
  width: 9px;
  height: 9px;
  background: var(--surface-3);
  border: 1px solid var(--line-2);
}

.es-spin {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-top-color: var(--accent);
  animation: esSpin .75s linear infinite;
}

@keyframes esSpin {
  to { transform: rotate(360deg); }
}

.es-row-main {
  min-width: 0;
}

.es-row-top {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.es-row h3 {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  letter-spacing: 0;
}

.es-result {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.es-result:hover {
  color: var(--accent);
}

.es-run {
  min-width: 76px;
  padding: 8px 13px;
  border-radius: 9px;
}

.es-run:disabled {
  cursor: wait;
  opacity: .62;
  transform: none;
  box-shadow: none;
}

.es-row[data-status="degraded"] .es-result,
.es-row[data-status="skipped"] .es-result {
  color: var(--dim);
}

.es-row[data-status="done"] {
  border-color: color-mix(in srgb, var(--ok) 26%, var(--border));
}

.es-dash-card {
  display: block;
  margin-bottom: 26px;
  text-decoration: none;
  padding: 18px 20px;
}

.es-dash-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.es-dash-bar {
  margin-top: 12px;
  width: 100%;
}

.es-dash-card:hover {
  border-color: var(--gold-line);
}

@media (max-width: 720px) {
  .es-headline {
    display: grid;
    align-items: start;
  }

  .es-all {
    width: 100%;
  }

  .es-summary {
    display: grid;
  }

  .es-summary div {
    min-width: 0;
  }

  .es-row {
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: start;
  }

  .es-run {
    grid-column: 2;
    justify-self: start;
  }
}

/* Dashboard card v2 (Reis 2026-07-02): run button lives ON the card; in-app confirm modal */
#empire-scan-dashboard-card { display: flex; align-items: center; gap: 18px; }
.es-dash-main { flex: 1; min-width: 0; text-decoration: none; color: inherit; display: block; }
.es-dash-open { margin-left: 10px; font-style: normal; font-size: 11.5px; letter-spacing: .04em; color: var(--muted, #9a9aa2); }
.es-dash-main:hover .es-dash-open { color: var(--text, #f5f5f5); }
.es-dash-run { flex: 0 0 auto; }
@media (max-width: 720px) { #empire-scan-dashboard-card { flex-direction: column; align-items: stretch; } }
