:root {
  --bg: #f5f7fb;
  --sidebar: #ffffff;
  --topbar: #ffffff;
  --card: #ffffff;
  --ink: #1f2d3d;
  --muted: #6b778c;
  --line: #dfe5ef;
  --line-strong: #c8d2e1;
  --blue: #0d6efd;
  --blue-dark: #174ea6;
  --green: #198754;
  --amber: #f59e0b;
  --red: #dc3545;
  --purple: #6f42c1;
  --shadow: 0 10px 30px rgba(31, 45, 61, 0.08);
  --radius: 8px;
  --sidebar-width: 268px;
  --topbar-height: 64px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--bg);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::selection {
  background: #cfe2ff;
  color: #102a56;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a,
input,
label {
  -webkit-tap-highlight-color: transparent;
}

button,
input,
textarea {
  font: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
.source-card:focus-within,
.check-card:focus-within {
  outline: 3px solid rgba(13, 110, 253, 0.18);
  outline-offset: 3px;
}

code {
  display: inline-block;
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: #243447;
  overflow-wrap: anywhere;
}

p,
small,
dd,
strong,
h1,
h2,
h3 {
  overflow-wrap: anywhere;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar);
  box-shadow: 0 2px 18px rgba(31, 45, 61, 0.06);
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--blue-dark);
  font-size: 18px;
  font-weight: 780;
}

.brand-mark {
  position: relative;
  display: block;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, #0d6efd 0%, #13a38b 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.brand-mark::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 7px;
  width: 18px;
  height: 20px;
  background:
    radial-gradient(circle at 3px 3px, #ffffff 0 2.6px, transparent 3px),
    radial-gradient(circle at 16px 10px, #f0bc70 0 2.8px, transparent 3.2px),
    radial-gradient(circle at 16px 18px, #ffffff 0 2.8px, transparent 3.2px),
    linear-gradient(#ffffff, #ffffff) 2px 3px / 3px 15px no-repeat,
    linear-gradient(90deg, #ffffff, #ffffff) 4px 9px / 12px 3px no-repeat,
    linear-gradient(90deg, #ffffff, #ffffff) 4px 17px / 12px 3px no-repeat;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: -8px auto auto -8px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.topbar-brand:hover .brand-mark {
  transform: translateY(-1px) rotate(-2deg);
  filter: saturate(1.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.34), 0 10px 22px rgba(13, 110, 253, 0.2);
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.sidebar {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  bottom: 0;
  z-index: 20;
  width: var(--sidebar-width);
  padding: 20px 16px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
}

.sidebar nav {
  display: grid;
  gap: 6px;
}

.sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: #41536a;
  font-weight: 680;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.sidebar-link:hover,
.sidebar-link.is-active {
  color: var(--blue-dark);
  background: #eef5ff;
}

.sidebar-link.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: var(--blue);
}

.sidebar-link:hover {
  transform: translateX(2px);
}

.nav-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f2f6fc;
  color: var(--blue-dark);
  overflow: hidden;
  transition: background 180ms ease, transform 180ms ease;
}

.sidebar-link:hover .nav-icon,
.sidebar-link.is-active .nav-icon {
  background: #dcecff;
  transform: scale(1.04);
}

.nav-icon::before,
.nav-icon::after {
  content: "";
  position: absolute;
  display: block;
}

.nav-icon-dashboard::before {
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-radius: 4px;
  box-shadow: -6px -6px 0 -4px currentColor, 6px -6px 0 -4px currentColor, -6px 6px 0 -4px currentColor, 6px 6px 0 -4px currentColor;
}

.nav-icon-run::before {
  left: 10px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid currentColor;
}

.nav-icon-source::before,
.nav-icon-files::before {
  width: 14px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.nav-icon-source::after {
  width: 8px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor;
}

.nav-icon-options::before {
  width: 16px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}

.nav-icon-options::after {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(4px, -6px);
  box-shadow: -8px 6px 0 currentColor, 2px 12px 0 currentColor;
}

.nav-icon-files::before {
  width: 16px;
  height: 11px;
  transform: translateY(2px);
}

.nav-icon-files::after {
  top: 7px;
  left: 7px;
  width: 8px;
  height: 4px;
  border-radius: 3px 3px 0 0;
  background: currentColor;
}

.nav-icon-review::before {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.nav-icon-review::after {
  width: 9px;
  height: 5px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg) translate(1px, -1px);
}

.nav-icon-cards::before {
  width: 14px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 3px;
  box-shadow: 3px 3px 0 #d8e7ff;
}

.nav-icon-log::before {
  width: 16px;
  height: 13px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.nav-icon-log::after {
  width: 11px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor;
  transform: translateX(2px);
}

.sidebar-note {
  display: grid;
  gap: 8px;
  margin-top: 28px;
  padding: 14px;
  border: 1px solid #d8e7ff;
  border-radius: var(--radius);
  background: #f6faff;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.sidebar-note strong {
  color: var(--blue-dark);
}

.main {
  width: calc(100% - var(--sidebar-width));
  max-width: 1440px;
  margin-left: var(--sidebar-width);
  padding: calc(var(--topbar-height) + 28px) 28px 72px;
}

.page-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.page-title > div,
.card-header > div,
.submit-card > div,
.main > *,
.card,
.status-panel article,
.metric-card,
.source-card,
.check-card,
.issue-card {
  min-width: 0;
}

.page-title h1 {
  margin: 4px 0 6px;
  max-width: 960px;
  color: #243447;
  font-size: 30px;
  line-height: 1.16;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.page-title p {
  margin: 0;
  max-width: 820px;
  color: var(--muted);
  line-height: 1.6;
}

.breadcrumb,
.card-kicker {
  margin: 0;
  color: #8392a8;
  font-size: 13px;
  font-weight: 760;
}

.page-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--blue);
  border-radius: var(--radius);
  background: var(--blue);
  color: #ffffff;
  font-weight: 760;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover,
button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(13, 110, 253, 0.2);
}

.button-outline {
  background: #ffffff;
  color: var(--blue-dark);
}

.button-outline:hover {
  background: #eef5ff;
}

.button.is-pressed,
button.is-pressed,
.download-grid a.is-pressed {
  transform: translateY(0) scale(0.99);
}

.card,
.metric-card,
.source-card,
.check-card,
.alert-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.card {
  padding: 22px;
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.card-header h2,
.submit-card h2,
.section-heading h2 {
  margin: 4px 0 0;
  color: #243447;
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: 0;
}

.section-heading {
  margin: 0 0 16px;
}

.card-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.card-copy {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.dashboard-grid {
  display: grid;
  grid-auto-flow: dense;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.status-panel {
  display: grid;
  grid-auto-flow: dense;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 24px;
}

.status-panel article {
  min-height: 156px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.status-panel article:hover {
  transform: translateY(-2px);
  border-color: #b8d6ff;
  box-shadow: 0 14px 34px rgba(31, 45, 61, 0.12);
}

.status-panel strong {
  display: block;
  margin: 14px 0 8px;
  color: #243447;
  font-size: 19px;
  line-height: 1.25;
}

.status-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
  overflow-wrap: anywhere;
}

.quality-chain {
  margin: 0 0 24px;
  padding: 22px;
  border: 1px solid #cfe0f7;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #ffffff 0%, #f3f8ff 58%, #f4fbf8 100%);
}

.quality-chain-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.quality-chain-header h2 {
  margin: 4px 0 8px;
  color: #243447;
  font-size: 23px;
  line-height: 1.22;
  letter-spacing: 0;
}

.quality-chain-header p {
  margin: 0;
  max-width: 780px;
  color: #41536a;
  line-height: 1.6;
}

.quality-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.quality-card {
  position: relative;
  min-height: 202px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 26px rgba(31, 45, 61, 0.08);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.quality-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--blue);
}

.quality-card::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 18px;
  width: 26px;
  height: 10px;
  border-top: 2px solid rgba(23, 78, 166, 0.28);
  border-right: 2px solid rgba(23, 78, 166, 0.28);
  transform: skewX(18deg);
}

.quality-card:hover {
  transform: translateY(-2px);
  border-color: #9bc7ff;
  box-shadow: 0 16px 34px rgba(31, 45, 61, 0.13);
}

.quality-rules::before {
  background: var(--amber);
}

.quality-review::before {
  background: var(--green);
}

.quality-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 28px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: #eef5ff;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 850;
}

.quality-rules .quality-step {
  background: #fff5df;
  color: #8a5200;
}

.quality-review .quality-step {
  background: #e8f6ef;
  color: #12613d;
}

.quality-card strong {
  display: block;
  margin-bottom: 9px;
  color: #243447;
  font-size: 19px;
  line-height: 1.25;
}

.quality-card p {
  margin: 0 0 12px;
  color: #41536a;
  line-height: 1.58;
}

.quality-card small {
  display: block;
  color: var(--muted);
  line-height: 1.48;
}

.quality-note {
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 1px solid #d8e7ff;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  color: #41536a;
  line-height: 1.55;
}

.quality-note strong {
  color: var(--blue-dark);
}

.command-card,
.readiness-card {
  min-height: 220px;
}

.definition-list {
  display: grid;
  gap: 14px;
  margin: 0;
}

.definition-list div {
  padding: 14px;
  border-radius: var(--radius);
  background: #f8fafc;
  transition: background 160ms ease, transform 160ms ease;
}

.definition-list div:hover {
  background: #eef5ff;
  transform: translateX(2px);
}

.definition-list dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.definition-list dd {
  margin: 0;
  color: #243447;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.step-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.step-rail span {
  flex: 0 1 auto;
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef5ff;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 720;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.step-rail span:hover {
  background: #ffffff;
  color: #0b4ca3;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(13, 110, 253, 0.14);
}

.run-form {
  display: grid;
  gap: 24px;
}

.source-grid,
.options-grid,
.metrics-grid,
.download-grid {
  display: grid;
  grid-auto-flow: dense;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.review-upload-form {
  display: grid;
  gap: 10px;
  margin: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}

.review-upload-form small {
  color: var(--muted);
}

.review-upload-form button {
  justify-self: start;
}

.source-card,
.check-card {
  position: relative;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  min-height: 124px;
  padding: 17px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.source-card::after,
.check-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.source-card:hover,
.check-card:hover,
.metric-card:hover,
.issue-card:hover,
.download-grid a:hover {
  transform: translateY(-2px);
  border-color: #b8d6ff;
  box-shadow: 0 14px 34px rgba(31, 45, 61, 0.12);
}

.source-card:hover::after,
.check-card:hover::after {
  transform: scaleX(0.42);
}

.source-grid:hover .source-card,
.options-grid:hover .check-card {
  opacity: 0.9;
}

.source-grid:hover .source-card:hover,
.options-grid:hover .check-card:hover,
.source-card.is-selected,
.check-card.is-selected {
  opacity: 1;
}

.source-card:has(input:checked),
.check-card:has(input:checked),
.source-card.is-selected,
.check-card.is-selected {
  border-color: #9bc7ff;
  background: #f7fbff;
}

.source-card:has(input:checked)::after,
.check-card:has(input:checked)::after,
.source-card.is-selected::after,
.check-card.is-selected::after {
  transform: scaleX(1);
}

input[type="radio"],
input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--blue);
}

.source-card strong,
.check-card strong {
  display: block;
  margin-bottom: 7px;
  color: #243447;
}

.source-card > span,
.check-card > span {
  min-width: 0;
}

.source-card small,
.check-card small,
.field-row small {
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.upload-row,
.field-row {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.upload-row {
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: #fbfdff;
}

.upload-row[hidden] {
  display: none;
}

label {
  font-weight: 720;
}

input[type="file"],
input[type="text"],
textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
}

.file-input-native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.file-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #ffffff;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.file-picker:hover,
.file-input-native:focus-visible + .file-picker {
  border-color: #8ec0ff;
  background: #fbfdff;
  box-shadow: 0 8px 22px rgba(31, 45, 61, 0.08);
}

.file-picker-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #b8d6ff;
  border-radius: 6px;
  background: #eef5ff;
  color: var(--blue-dark);
  font-weight: 760;
  white-space: nowrap;
}

.file-picker-name {
  min-width: 0;
  color: var(--muted);
  font-weight: 560;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

input[type="file"]:focus,
input[type="text"]:focus,
textarea:focus {
  outline: 3px solid rgba(13, 110, 253, 0.14);
  border-color: var(--blue);
}

.ask-card textarea {
  min-height: 112px;
  margin-top: 8px;
  resize: vertical;
  line-height: 1.6;
}

.ask-upload {
  margin: 0 0 16px;
}

.ask-upload small {
  color: var(--muted);
  line-height: 1.5;
}

.ask-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
}

.ask-actions small {
  color: var(--muted);
  line-height: 1.5;
}

.ask-actions button {
  flex: 0 0 auto;
}

.submit-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-color: #b8d6ff;
  background: linear-gradient(135deg, #ffffff, #f4f9ff);
}

.submit-card p {
  margin: 6px 0 0;
  color: var(--muted);
}

.alert-card {
  margin-bottom: 22px;
  padding: 16px 18px;
  border-color: #f1b8bf;
  background: #fff5f6;
}

.alert-card strong {
  color: var(--red);
}

.alert-card p {
  margin: 6px 0 0;
  color: #7c2730;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  font-weight: 780;
  line-height: 1.2;
  white-space: nowrap;
}

.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: currentColor;
}

.summary-strip {
  display: grid;
  grid-auto-flow: dense;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 24px;
}

.summary-strip article {
  min-height: 94px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.summary-strip article:hover {
  transform: translateY(-2px);
  border-color: #b8d6ff;
  box-shadow: 0 14px 34px rgba(31, 45, 61, 0.12);
}

.summary-strip span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.summary-strip strong {
  display: block;
  color: #243447;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.status-local,
.status-info {
  background: #eef5ff;
  color: var(--blue-dark);
}

.status-success {
  background: #e8f6ef;
  color: #12613d;
}

.status-warning {
  background: #fff5df;
  color: #8a5200;
}

.status-error {
  background: #fdecee;
  color: #a51f2f;
}

.status-muted {
  background: #eef1f5;
  color: #5f6c7b;
}

.metric-card {
  position: relative;
  min-height: 138px;
  padding: 20px;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.metric-card span {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin-bottom: 14px;
  color: #243447;
  font-size: 34px;
  line-height: 1;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.metric-warning {
  border-color: #f4c66b;
}

.run-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #41536a;
}

.run-summary-card {
  border-color: #c9ddff;
}

.output-code {
  display: block;
  width: 100%;
  padding: 12px 14px;
  background: #f8fafc;
  color: #243447;
  line-height: 1.55;
}

.bars {
  display: grid;
  gap: 13px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(140px, 1.5fr) 40px;
  gap: 12px;
  align-items: center;
  margin: 0 -8px;
  padding: 6px 8px;
  border-radius: var(--radius);
  transition: background 160ms ease;
}

.bar-row:hover {
  background: #f7fbff;
}

.bar-row span {
  color: #41536a;
  min-width: 0;
  overflow-wrap: anywhere;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #e8edf5;
  overflow: hidden;
}

.bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transform-origin: left;
  animation: barIn 620ms ease both;
}

.priority-p0 .bar-track i,
.priority-pill.priority-p0 {
  background: var(--red);
}

.priority-p1 .bar-track i,
.priority-pill.priority-p1 {
  background: var(--amber);
}

.priority-p2 .bar-track i,
.priority-pill.priority-p2 {
  background: var(--green);
}

.priority-pill {
  display: inline-flex;
  justify-content: center;
  min-width: 38px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 850;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #41536a;
  background: #f6f8fb;
  font-size: 13px;
}

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

tbody tr {
  transition: background 160ms ease;
}

tbody tr:hover {
  background: #f7fbff;
}

.risk-p0 {
  background: #fff5f6;
}

.risk-low-confidence {
  background: #fffaf0;
}

.risk-multi {
  background: #f4fbf8;
}

.issue-grid {
  display: grid;
  grid-auto-flow: dense;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.issue-card {
  position: relative;
  min-height: 252px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.issue-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--green);
}

.issue-card.needs-review {
  border-color: #f2ca7a;
  background: #fffdf7;
}

.issue-card.needs-review::before {
  background: var(--amber);
}

.issue-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.issue-card h3 {
  margin: 15px 0 8px;
  color: #243447;
  overflow-wrap: anywhere;
}

.issue-card p {
  color: var(--muted);
  line-height: 1.58;
  overflow-wrap: anywhere;
}

.issue-card small {
  display: block;
  margin-top: 13px;
  color: #243447;
  font-weight: 780;
}

.review-badge {
  margin-top: 12px;
  white-space: normal;
}

.download-grid a,
.disabled-download {
  position: relative;
  display: grid;
  align-content: space-between;
  min-height: 106px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: #243447;
  font-weight: 780;
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.download-grid a::before,
.disabled-download::before {
  content: "";
  position: absolute;
  top: 16px;
  right: 16px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
}

.download-grid a::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--blue);
  border-right: 2px solid var(--blue);
  opacity: 0;
  transform: rotate(45deg) translateX(-3px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.download-grid a:hover::after {
  opacity: 1;
  transform: rotate(45deg) translateX(0);
}

.disabled-download::before {
  background: var(--muted);
}

.download-grid a span,
.disabled-download small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 560;
  overflow-wrap: anywhere;
}

.disabled-download {
  opacity: 0.58;
}

[data-reveal] {
  scroll-margin-top: 92px;
}

@keyframes barIn {
  from { transform: scaleX(0.12); }
  to { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 1080px) {
  :root {
    --sidebar-width: 224px;
  }

  .dashboard-grid,
  .status-panel,
  .quality-grid,
  .source-grid,
  .options-grid,
  .metrics-grid,
  .summary-strip,
  .download-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .topbar {
    padding: 0 14px;
  }

  .topbar-meta .status-local {
    display: none;
  }

  .sidebar {
    position: static;
    width: auto;
    margin-top: var(--topbar-height);
    padding: 12px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar nav {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .sidebar-note {
    display: none;
  }

  .main {
    width: 100%;
    margin-left: 0;
    padding: 24px 14px 64px;
  }

  .page-title,
  .card-header,
  .quality-chain-header,
  .submit-card,
  .ask-actions {
    display: grid;
    justify-content: stretch;
  }

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

  .dashboard-grid,
  .status-panel,
  .quality-grid,
  .source-grid,
  .options-grid,
  .metrics-grid,
  .summary-strip,
  .download-grid {
    grid-template-columns: 1fr;
  }

  .bar-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .topbar-brand span:last-child {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .page-title h1 {
    font-size: 26px;
  }

  .card {
    padding: 18px;
  }
}
