[hidden] {
  display: none !important;
}

html.editorial-console .scm-shell .topbar::after {
  display: none;
}

html.editorial-console .scm-shell .topbar-meta {
  flex-shrink: 0;
}

@media (min-width: 960px) {
  html.editorial-console .scm-shell .topbar-meta {
    flex-direction: row;
    align-items: center;
    gap: 14px;
  }

  html.editorial-console .scm-shell .topbar-tools {
    order: 1;
  }

  html.editorial-console .scm-shell .user-chip {
    order: 2;
    padding-left: 14px;
    border-left: 1px solid var(--ed-line);
  }
}

.scm-scroll {
  padding: 20px 24px 48px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.scm-shell.scm--idle #insightGrid,
.scm-shell.scm--idle #tablePanel,
.scm-shell.scm--idle .scm-footnote {
  display: none !important;
}

.scm-shell.scm--idle .scm-scroll {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 0;
}

.scm-shell.scm--idle .scm-hero {
  margin-bottom: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: min(440px, calc(100vh - 168px));
  padding: 28px 32px 32px;
}

.scm-hero--idle .scm-hero__head,
.scm-hero--idle .scm-kpi-grid {
  display: none;
}

.scm-welcome {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
}

.scm-welcome__eyebrow {
  margin: 0 0 8px;
  font-size: var(--ed-micro, 11px);
  font-weight: 550;
  letter-spacing: var(--ed-track-label, 0.14em);
  text-transform: uppercase;
  color: var(--ed-faint);
}

.scm-welcome__title {
  margin: 0 0 10px;
  font-size: clamp(1.35rem, 2.2vw, 1.65rem);
  font-weight: 540;
  letter-spacing: var(--ed-track-title, -0.02em);
  color: var(--ed-ink);
}

.scm-welcome__lead {
  margin: 0 auto 22px;
  max-width: 42ch;
  font-size: var(--ed-ui, 13px);
  line-height: 1.55;
  color: var(--ed-mute);
}

.scm-welcome__lead.is-error {
  color: var(--ed-danger, #9b3148);
}

.scm-welcome__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

.scm-welcome__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  font: inherit;
  font-size: var(--ed-ui, 13px);
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--ed-line-strong, var(--ed-line));
  background: var(--ed-canvas);
  color: var(--ed-ink);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.scm-welcome__btn:hover {
  border-color: var(--ed-ink);
  background: var(--ed-paper);
}

.scm-welcome__btn--primary {
  background: var(--ed-ink);
  border-color: var(--ed-ink);
  color: var(--ed-paper);
}

.scm-welcome__btn--primary:hover {
  background: #000;
  border-color: #000;
}

.scm-welcome__btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ed-mute);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.scm-welcome__btn--ghost:hover {
  color: var(--ed-ink);
  background: transparent;
}

.scm-topbar-tools {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pill-upload {
  position: relative;
  cursor: pointer;
}

.pill-upload input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.scm-drive-link {
  text-decoration: none;
  color: inherit;
}

.scm-hero {
  margin-bottom: 18px;
}

.scm-hero--idle .scm-asof {
  display: none;
}

.scm-table-panel--idle .scm-filters {
  display: none;
}

.scm-hero__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.scm-asof {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted, var(--ed-faint));
  letter-spacing: 0.02em;
}

.scm-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 980px) {
  .scm-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .scm-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.kpi-scm-risk::before {
  background: #dc2626;
}

.kpi-scm-defect::before {
  background: #b45309;
}

.kpi-scm-avail::before {
  background: var(--accent, #2eac39);
}

.kpi-scm-scope::before {
  background: #0f172a;
}

.scm-dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 18px;
  margin-bottom: 18px;
}

@media (max-width: 900px) {
  .scm-dash-grid {
    grid-template-columns: 1fr;
  }
}

.scm-chart-wrap {
  position: relative;
  height: 220px;
  max-width: 340px;
  margin: 0 auto 8px;
}

.scm-band-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  font-size: 12px;
  color: var(--muted, var(--ed-mute));
}

.scm-band-legend li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--surface-2, #f8fafc);
  border: 1px solid var(--line, var(--ed-line));
}

.scm-band-legend strong {
  font-variant-numeric: tabular-nums;
  color: var(--ink, var(--ed-ink));
}

.scm-band-legend .muted {
  font-weight: 400;
  color: var(--muted, var(--ed-faint));
  font-size: 11px;
}

.scm-risk-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
}

.scm-risk-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line, var(--ed-line));
  background: var(--surface, #fff);
}

.scm-risk-item__name {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  grid-column: 1 / -1;
}

.scm-risk-item__meta {
  margin: 0;
  font-size: 11px;
  color: var(--muted, var(--ed-mute));
}

.scm-risk-empty {
  margin: 0;
  padding: 24px 12px;
  text-align: center;
  color: var(--muted, var(--ed-mute));
  font-size: 13px;
}

.scm-table-panel .panel-head {
  margin-bottom: 10px;
}

.scm-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}

.scm-filter {
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line, var(--ed-line));
  background: var(--surface, #fff);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.scm-filter__n {
  font-family: var(--mono);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  font-variant-numeric: tabular-nums;
}

.scm-filter.is-active {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}

.scm-filter.is-active .scm-filter__n {
  background: rgba(255, 255, 255, 0.18);
}

.scm-filter--danger.is-active {
  background: #991b1b;
  border-color: #991b1b;
}

.scm-filter--warn.is-active {
  background: #9a3412;
  border-color: #9a3412;
}

.scm-filter--caution.is-active {
  background: #854d0e;
  border-color: #854d0e;
}

.scm-search {
  margin-left: auto;
}

.scm-search input {
  font: inherit;
  font-size: 13px;
  padding: 7px 12px;
  border: 1px solid var(--line, var(--ed-line));
  border-radius: 8px;
  min-width: 200px;
  background: var(--surface, #fff);
}

.scm-table-wrap {
  overflow: auto;
  border: 1px solid var(--line, var(--ed-line));
  border-radius: 10px;
  max-height: min(62vh, 640px);
  background: var(--surface, #fff);
}

.scm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.scm-table th,
.scm-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line, #f1f5f9);
  text-align: left;
  vertical-align: middle;
}

.scm-table tbody tr:hover {
  background: rgba(15, 23, 42, 0.02);
}

.scm-table th.num,
.scm-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.scm-table thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 1;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted, var(--ed-mute));
  letter-spacing: 0.03em;
}

.scm-empty-state {
  text-align: center;
  padding: 48px 24px 56px;
  max-width: 420px;
  margin: 0 auto;
}

.scm-empty-state__title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.scm-empty-state__lead {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted, var(--ed-mute));
}

.scm-empty-state__lead code {
  font-size: 12px;
}

.scm-empty-state__steps {
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
  font-size: 12px;
  color: var(--muted, var(--ed-mute));
  border-top: 1px solid var(--line, var(--ed-line));
  padding-top: 14px;
}

.scm-empty-state__steps li {
  padding: 4px 0 4px 18px;
  position: relative;
}

.scm-empty-state__steps li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent, #2eac39);
}

.scm-table-empty {
  text-align: center;
  color: var(--muted, var(--ed-mute));
  padding: 28px !important;
}

.scm-band {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.scm-band--expired {
  background: #fee2e2;
  color: #991b1b;
}

.scm-band--within3 {
  background: #ffedd5;
  color: #9a3412;
}

.scm-band--within6 {
  background: #fef9c3;
  color: #854d0e;
}

.scm-band--ok {
  background: #dcfce7;
  color: #166534;
}

.scm-band--none {
  background: #f1f5f9;
  color: #475569;
}

.scm-footnote {
  margin: 20px 0 0;
  font-size: 11px;
  color: var(--muted, var(--ed-faint));
  line-height: 1.5;
}

.scm-loading[hidden] {
  display: none !important;
}

.scm-shell .main {
  position: relative;
}

.scm-loading {
  position: absolute;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: rgba(248, 250, 252, 0.72);
  backdrop-filter: blur(4px);
}

.scm-loading__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 26px 18px;
  border-radius: 10px;
  border: 1px solid var(--line, var(--ed-line));
  background: #fff;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
}

.scm-loading__spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--ed-line, #e2e8f0);
  border-top-color: var(--ed-ink, #0f172a);
  border-radius: 50%;
  animation: scm-loading-spin 0.7s linear infinite;
}

@keyframes scm-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.scm-loading__text {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--ed-ink, #0f172a);
}

.scm-shell.is-busy {
  pointer-events: none;
}

.scm-shell.is-busy .scm-loading {
  pointer-events: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
