.scfw-root {
  --scfw-bg: #07111f;
  --scfw-panel: rgba(14, 26, 45, 0.94);
  --scfw-panel-2: rgba(18, 34, 57, 0.92);
  --scfw-line: rgba(148, 163, 184, 0.2);
  --scfw-text: #e8eef8;
  --scfw-muted: #9aa9bd;
  --scfw-accent: #62d9c8;
  --scfw-accent-2: #7aa2ff;
  --scfw-warning: #f4c36a;
  --scfw-danger: #f18e98;
  position: fixed;
  inset: 0;
  z-index: 12000;
  color: var(--scfw-text);
  background: var(--scfw-bg);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

.scfw-root[hidden] { display: none !important; }
.scfw-root * { box-sizing: border-box; }
.scfw-root button, .scfw-root select { font: inherit; }
.scfw-root button { color: inherit; }

.scfw-shell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: auto;
  background:
    radial-gradient(circle at 12% 0%, rgba(62, 125, 169, 0.2), transparent 34%),
    radial-gradient(circle at 90% 20%, rgba(50, 164, 145, 0.13), transparent 31%),
    linear-gradient(180deg, #081320 0%, #07111f 52%, #050d18 100%);
}

.scfw-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 68px;
  padding: 10px 22px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto 40px;
  align-items: center;
  gap: 22px;
  border-bottom: 1px solid var(--scfw-line);
  background: rgba(7, 17, 31, 0.9);
  backdrop-filter: blur(18px);
}

.scfw-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.scfw-brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 12px;
  color: #06201c;
  background: linear-gradient(135deg, #8be7da, #4eb9a7);
  box-shadow: 0 8px 28px rgba(98, 217, 200, 0.22);
  font-size: 18px;
  font-weight: 900;
}
.scfw-brand div { min-width: 0; display: flex; flex-direction: column; }
.scfw-brand strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.scfw-brand span:not(.scfw-brand-mark) { color: var(--scfw-muted); font-size: 11px; margin-top: 3px; }

.scfw-topbar nav { display: flex; gap: 4px; }
.scfw-topbar nav button {
  border: 0;
  border-radius: 8px;
  padding: 8px 11px;
  background: transparent;
  color: #aebbd0;
  cursor: pointer;
}
.scfw-topbar nav button:hover { background: rgba(122, 162, 255, 0.12); color: #fff; }

.scfw-icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--scfw-line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}
.scfw-icon-button:hover { border-color: rgba(122, 162, 255, 0.55); background: rgba(122, 162, 255, 0.12); }

.scfw-boundary-banner {
  position: sticky;
  top: 68px;
  z-index: 19;
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 8px 18px;
  border-bottom: 1px solid rgba(244, 195, 106, 0.18);
  background: rgba(56, 44, 20, 0.92);
  color: #f7dca1;
  font-size: 12px;
  backdrop-filter: blur(14px);
}
.scfw-boundary-banner strong { color: #fff0c7; }

.scfw-context-banner {
  width: min(1500px, calc(100% - 36px));
  margin: 18px auto 0;
  padding: 13px 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(122, 162, 255, 0.28);
  border-radius: 13px;
  background: rgba(39, 68, 113, 0.2);
}
.scfw-context-banner div { display: flex; flex-direction: column; gap: 3px; }
.scfw-context-banner strong { color: #dce8ff; font-size: 12px; }
.scfw-context-banner span { color: #8fb0e9; font-size: 11px; }
.scfw-context-banner p { margin: 0; color: #aebdd1; font-size: 12px; line-height: 1.5; }
.scfw-context-banner button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(122, 162, 255, 0.34);
  border-radius: 9px;
  color: #dce8ff;
  background: rgba(122, 162, 255, 0.1);
  cursor: pointer;
}
.scfw-context-banner button:hover { background: rgba(122, 162, 255, 0.2); }

.scfw-content { width: min(1500px, calc(100% - 36px)); margin: 0 auto; padding: 28px 0 60px; }
.scfw-section {
  scroll-margin-top: 126px;
  margin-bottom: 20px;
  padding: 24px;
  border: 1px solid var(--scfw-line);
  border-radius: 18px;
  background: linear-gradient(150deg, rgba(19, 35, 58, 0.92), rgba(10, 23, 40, 0.93));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}

.scfw-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 18px;
}
.scfw-section-heading h1, .scfw-section-heading h2 { margin: 5px 0 6px; color: #f7f9fd; line-height: 1.2; }
.scfw-section-heading h1 { font-size: clamp(24px, 2.4vw, 36px); }
.scfw-section-heading h2 { font-size: 21px; }
.scfw-section-heading p { margin: 0; color: var(--scfw-muted); font-size: 13px; }
.scfw-eyebrow { color: var(--scfw-accent); font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }

.scfw-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.scfw-metric {
  min-height: 122px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}
.scfw-metric span { color: var(--scfw-muted); font-size: 12px; }
.scfw-metric strong { margin: 9px 0 8px; color: #fff; font-size: 25px; }
.scfw-metric small { margin-top: auto; color: #8ea0b8; line-height: 1.45; }

.scfw-audit-panel {
  margin-top: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(98, 217, 200, 0.18);
  border-radius: 14px;
  background: rgba(40, 121, 111, 0.08);
}
.scfw-audit-title { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; color: var(--scfw-muted); font-size: 12px; }
.scfw-audit-title strong { color: #c9f3ec; font-weight: 650; }
.scfw-audit-panel dl { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 0; }
.scfw-audit-panel dl div { min-width: 0; padding: 9px 10px; border-radius: 9px; background: rgba(0, 0, 0, 0.13); }
.scfw-audit-panel dt { color: #7890a9; font-size: 10px; }
.scfw-audit-panel dd { margin: 5px 0 0; overflow: hidden; color: #dce8f4; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

.scfw-record-counts { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.scfw-record-counts span, .scfw-count-pill {
  padding: 7px 10px;
  border: 1px solid var(--scfw-line);
  border-radius: 999px;
  color: var(--scfw-muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 11px;
}
.scfw-record-counts b { color: #fff; margin-right: 3px; }

.scfw-filter-panel {
  position: sticky;
  top: 101px;
  z-index: 18;
  margin-bottom: 20px;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(220px, 1.35fr) minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--scfw-line);
  border-radius: 14px;
  background: rgba(9, 21, 36, 0.94);
  backdrop-filter: blur(16px);
}
.scfw-filter-field { display: flex; flex-direction: column; gap: 5px; }
.scfw-filter-field label { color: #8da0b7; font-size: 10px; font-weight: 700; }
.scfw-filter-field select {
  width: 100%;
  height: 38px;
  padding: 0 34px 0 10px;
  border: 1px solid rgba(148, 163, 184, 0.23);
  border-radius: 9px;
  color: #e6edf6;
  background: #102139;
  outline: none;
}
.scfw-filter-field select:focus { border-color: rgba(98, 217, 200, 0.65); box-shadow: 0 0 0 3px rgba(98, 217, 200, 0.08); }
.scfw-filter-field select:disabled { opacity: .5; cursor: not-allowed; }
.scfw-reset-button {
  height: 38px;
  padding: 0 15px;
  border: 1px solid var(--scfw-line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}
.scfw-reset-button:hover { background: rgba(122, 162, 255, 0.13); }

.scfw-segmented { display: inline-flex; padding: 3px; border: 1px solid var(--scfw-line); border-radius: 10px; background: rgba(0, 0, 0, 0.15); }
.scfw-segmented button { padding: 7px 10px; border: 0; border-radius: 7px; color: var(--scfw-muted); background: transparent; cursor: pointer; font-size: 11px; }
.scfw-segmented button.active { color: #08211e; background: var(--scfw-accent); font-weight: 800; }

.scfw-table-wrap { width: 100%; overflow: auto; border: 1px solid var(--scfw-line); border-radius: 12px; }
.scfw-table-wrap table { width: 100%; min-width: 1000px; border-collapse: collapse; }
.scfw-table-wrap th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 12px;
  color: #8094ad;
  background: #0c1a2c;
  font-size: 10px;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
}
.scfw-table-wrap td { padding: 11px 12px; border-top: 1px solid rgba(148, 163, 184, 0.11); color: #d9e4ef; font-size: 11px; vertical-align: top; }
.scfw-table-wrap tbody tr:hover { background: rgba(122, 162, 255, 0.04); }
.scfw-table-wrap td b, .scfw-table-wrap td small { display: block; }
.scfw-table-wrap td small { margin-top: 4px; color: #7f92aa; }
.scfw-identity-cell { min-width: 180px; }
.scfw-identity-cell strong { color: #f2f6fb; font-size: 12px; }
.scfw-identity-cell span { display: block; margin-top: 4px; color: #9db0c7; font-size: 10px; }
.scfw-limit-cell { min-width: 245px; color: #a8b7ca !important; line-height: 1.55; }
.scfw-unit-badge { display: inline-block; padding: 5px 7px; border-radius: 7px; color: #cbd8e6; background: rgba(148, 163, 184, 0.1); font-size: 10px; }

.scfw-status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid currentColor; border-radius: 999px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.scfw-status i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.scfw-status-ok { color: #6ee7d4; background: rgba(46, 179, 159, 0.08); }
.scfw-status-partial { color: #f5c96f; background: rgba(245, 201, 111, 0.08); }
.scfw-status-semantic { color: #c8a8ff; background: rgba(163, 116, 255, 0.08); }
.scfw-status-missing { color: #f3a0a9; background: rgba(243, 160, 169, 0.08); }
.scfw-status-neutral { color: #a9b8ca; background: rgba(169, 184, 202, 0.06); }

.scfw-evidence-button {
  padding: 6px 8px;
  border: 1px solid rgba(122, 162, 255, 0.3);
  border-radius: 7px;
  color: #b8cdff !important;
  background: rgba(122, 162, 255, 0.07);
  cursor: pointer;
  white-space: nowrap;
  font-size: 10px;
}
.scfw-evidence-button:hover { background: rgba(122, 162, 255, 0.16); }
.scfw-inventory-note { margin: -4px 0 12px; padding: 10px 12px; border-left: 3px solid var(--scfw-warning); color: #d7caa7; background: rgba(244, 195, 106, 0.06); font-size: 11px; }

.scfw-gap-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.scfw-gap-card { padding: 15px; border: 1px solid var(--scfw-line); border-radius: 12px; background: rgba(255, 255, 255, 0.022); }
.scfw-gap-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.scfw-gap-card h3 { margin: 9px 0 0; color: #eef4fb; font-size: 14px; }
.scfw-gap-identity { display: flex; justify-content: space-between; gap: 12px; margin: 13px 0; padding: 10px; border-radius: 8px; background: rgba(0, 0, 0, 0.13); }
.scfw-gap-identity strong { color: #dfe9f4; font-size: 11px; }
.scfw-gap-identity span { color: #7f92aa; font-size: 10px; }
.scfw-gap-card dl { margin: 0; }
.scfw-gap-card dl div + div { margin-top: 9px; }
.scfw-gap-card dt { color: #6f849c; font-size: 9px; font-weight: 800; }
.scfw-gap-card dd { margin: 4px 0 0; color: #aebdd0; font-size: 11px; line-height: 1.55; }

.scfw-empty { padding: 34px 16px; color: var(--scfw-muted); text-align: center; font-size: 12px; }
.scfw-footer { display: flex; justify-content: space-between; gap: 18px; padding: 14px 2px; color: #7e90a6; font-size: 10px; }
.scfw-footer strong { color: #a9b8c9; }

.scfw-load-state {
  position: absolute;
  inset: 68px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--scfw-muted);
}
.scfw-loading-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--scfw-accent); box-shadow: 0 0 0 0 rgba(98, 217, 200, 0.5); animation: scfw-pulse 1.4s infinite; }
.scfw-load-error { flex-direction: column; color: #f4a6ae; }
.scfw-load-error button { margin-top: 8px; padding: 7px 12px; border: 1px solid var(--scfw-line); border-radius: 8px; background: rgba(255,255,255,.05); cursor: pointer; }
.scfw-inline-error { position: static; min-height: 180px; }
@keyframes scfw-pulse { 70% { box-shadow: 0 0 0 10px rgba(98, 217, 200, 0); } 100% { box-shadow: 0 0 0 0 rgba(98, 217, 200, 0); } }

.scfw-drawer-layer { position: fixed; inset: 0; z-index: 12010; display: flex; justify-content: flex-end; }
.scfw-drawer-backdrop { position: absolute; inset: 0; border: 0; background: rgba(0, 0, 0, 0.62); cursor: default; }
.scfw-evidence-drawer { position: relative; width: min(620px, 92vw); height: 100%; padding: 20px; overflow: auto; border-left: 1px solid var(--scfw-line); background: #0a1728; box-shadow: -20px 0 60px rgba(0, 0, 0, 0.42); }
.scfw-drawer-header { display: flex; justify-content: space-between; gap: 16px; }
.scfw-drawer-header h2 { margin: 5px 0 5px; font-size: 20px; }
.scfw-drawer-header p { margin: 0; color: var(--scfw-muted); font-size: 11px; }
.scfw-drawer-boundary { margin: 18px 0 12px; padding: 10px 12px; border-left: 3px solid var(--scfw-accent); color: #b9c9d9; background: rgba(98, 217, 200, 0.06); font-size: 11px; }
.scfw-evidence-drawer pre { margin: 0; padding: 16px; overflow: auto; border: 1px solid var(--scfw-line); border-radius: 10px; color: #cfe1ef; background: #050d17; font: 11px/1.65 Consolas, "SFMono-Regular", monospace; white-space: pre-wrap; word-break: break-word; }

@media (max-width: 1000px) {
  .scfw-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scfw-audit-panel dl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .scfw-filter-panel { grid-template-columns: 1fr 1fr; }
  .scfw-gap-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .scfw-topbar { min-height: 60px; padding: 8px 12px; grid-template-columns: minmax(0, 1fr) 36px; }
  .scfw-topbar nav { display: none; }
  .scfw-brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .scfw-brand strong { font-size: 12px; }
  .scfw-brand span:not(.scfw-brand-mark) { font-size: 9px; }
  .scfw-boundary-banner { top: 60px; justify-content: flex-start; overflow: auto; white-space: nowrap; }
  .scfw-context-banner { width: calc(100% - 20px); grid-template-columns: 1fr; gap: 9px; }
  .scfw-context-banner button { justify-self: start; }
  .scfw-content { width: calc(100% - 20px); padding-top: 15px; }
  .scfw-section { padding: 16px; border-radius: 13px; }
  .scfw-section-heading { flex-direction: column; gap: 12px; }
  .scfw-summary-grid { grid-template-columns: 1fr; }
  .scfw-audit-panel dl { grid-template-columns: 1fr 1fr; }
  .scfw-filter-panel { top: 92px; grid-template-columns: 1fr; }
  .scfw-filter-field:nth-child(2) { grid-column: auto; }
  .scfw-gap-identity, .scfw-footer { flex-direction: column; }
}
