:root {
  color-scheme: light;
  --bg: #f3f6f8;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #667085;
  --line: #d7dee7;
  --accent: #0f766e;
  --accent-strong: #0b5c55;
  --danger: #b42318;
  --warn: #b54708;
  --ok: #067647;
  --unknown: #475467;
  --blue: #175cd3;
  --shadow: 0 8px 18px rgba(16, 24, 40, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(rgba(17, 24, 39, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 24, 39, 0.025) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.icon-sprite {
  display: none;
}

.login-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(420px, 100%);
}

.login-panel {
  display: grid;
  gap: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-form {
  display: grid;
  gap: 14px;
}

.form-error {
  margin: 0;
  color: var(--danger);
  font-weight: 600;
}

.app-frame {
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
  width: 100%;
  min-height: 100vh;
  overflow-x: clip;
}

button,
input,
select {
  font: inherit;
}

.sidebar {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 16px;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  padding: 20px 16px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
}

.brand-block {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
}

.brand-kicker {
  margin: 0 0 2px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 600;
}

.brand-block strong {
  font-size: 14px;
}

.sidebar-context,
.sidebar-safety {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.sidebar-safety span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.sidebar-context {
  display: grid;
  gap: 10px;
}

.sidebar-context label {
  color: var(--muted);
  font-size: 12px;
}

.sidebar-context select {
  min-height: 38px;
}

.sidebar-nav {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  scrollbar-gutter: stable;
}

.sidebar-link {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) minmax(24px, auto);
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
}

.sidebar-link .nav-icon {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 8px;
  border-radius: 8px;
  background: #eef2f6;
  color: var(--unknown);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.sidebar-link strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.sidebar-link em {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: #eef2f6;
  color: var(--unknown);
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
}

.sidebar-link:hover,
.sidebar-link.active {
  border-color: #9fd8d1;
  background: #f0fdfa;
}

.sidebar-link.active .nav-icon {
  background: var(--accent);
  color: #fff;
}

.sidebar-link.active em {
  background: #ccfbf1;
  color: var(--accent-strong);
}

.sidebar-sub-link {
  min-height: 46px;
  margin-left: 22px;
  padding-block: 6px;
  position: relative;
}

.sidebar-sub-link::before {
  content: "";
  position: absolute;
  left: -9px;
  top: -6px;
  bottom: 50%;
  width: 12px;
  border-left: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
  border-bottom-left-radius: 8px;
}

.sidebar-sub-link .nav-icon {
  width: 30px;
  height: 30px;
  padding: 7px;
  background: #f8fafc;
}

.sidebar-safety {
  background: #fffbeb;
}

.sidebar-safety p {
  margin: 0;
  color: #7a4d00;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

.shell {
  width: min(1360px, calc(100% - 32px));
  min-width: 0;
  margin: 0 auto;
  padding: 24px 0 40px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
  padding: 8px 0 2px;
}

.page-title-block {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.page-title-block span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-title-block h1 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

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

.user-pill {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.user-form {
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 600;
}

.lead-text {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
  font-weight: 600;
}

h3 {
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 600;
}

.status-pill,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e6f4f1;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.rank-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  white-space: normal;
}

.rank-tag.danger {
  border-color: #fecaca;
  background: #fee2e2;
  color: #991b1b;
}

.rank-tag.warn {
  border-color: #fed7aa;
  background: #ffedd5;
  color: #9a3412;
}

.rank-tag.ok {
  border-color: #bbf7d0;
  background: #dcfce7;
  color: #166534;
}

.rank-tag.unknown {
  border-color: #d0d5dd;
  background: #f2f4f7;
  color: #344054;
}

.notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #bfdbd6;
  border-radius: 8px;
  background: #f0fdfa;
  color: #134e4a;
  font-size: 14px;
}

.selected-customer-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.selected-customer-card strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 16px;
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.dashboard-page[hidden] {
  display: none;
}

.dashboard-page {
  margin-bottom: 16px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.scan-panel,
.result-panel,
.history-panel,
.overview-panel,
.assets-panel,
.monitor-panel {
  min-width: 0;
  padding: 16px;
}

.overview-panel,
.assets-panel,
.monitor-panel {
  margin-bottom: 16px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-width: 0;
  margin-bottom: 14px;
}

.panel-heading > div {
  min-width: 0;
}

.panel-heading span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
}

.panel-heading.compact {
  margin-top: 16px;
  margin-bottom: 8px;
}

.form-grid {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.management-grid,
.inline-form {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
}

.selected-customer-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.selected-customer-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.inline-disclosure {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.inline-disclosure summary {
  min-height: 42px;
  padding: 10px 12px;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}

.inline-disclosure .inline-form {
  margin-top: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
}

.inline-form {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.inline-form h3 {
  margin-bottom: 2px;
}

.subdomain-prefix-panel {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.subdomain-prefix-panel strong {
  color: var(--ink);
  font-size: 13px;
}

.subdomain-prefix-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.prefix-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.prefix-chip-list span {
  padding: 3px 7px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
}

label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.helper-text {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.checkline {
  display: flex;
  grid-template-columns: none;
  gap: 8px;
  align-items: flex-start;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.checkline input {
  flex: 0 0 18px;
  width: 18px;
  min-height: 18px;
  height: 18px;
  margin-top: 3px;
  padding: 0;
  accent-color: var(--accent);
}

input,
select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
}

input:focus,
select:focus {
  outline: 2px solid #99f6e4;
  border-color: var(--accent);
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 8px 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.ghost-button {
  min-height: 34px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.scope-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.management-grid > .scope-list {
  margin-top: 0;
}

.scope-list li,
.timeline-item {
  display: grid;
  gap: 3px;
  list-style: none;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
}

.scope-list strong {
  display: block;
  font-size: 13px;
}

.scope-list span,
.timeline-item span {
  color: var(--muted);
  font-size: 12px;
}

.empty {
  padding: 32px 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.compact-empty {
  padding: 18px 12px;
  font-size: 13px;
}

.table-empty-action {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 18px 12px;
  color: var(--muted);
  text-align: center;
}

.table-empty-action strong {
  color: var(--ink);
  font-size: 14px;
}

.table-empty-action span {
  max-width: 560px;
  font-size: 13px;
  line-height: 1.5;
}

.table-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.hidden {
  display: none;
}

.checks-box {
  display: grid;
  gap: 10px;
  min-width: 0;
  min-inline-size: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.checks-box legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.schedule-box {
  display: grid;
  gap: 10px;
  min-width: 0;
  min-inline-size: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.schedule-box legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.schedule-grid {
  display: grid;
  grid-template-columns: minmax(96px, 0.55fr) minmax(0, 0.75fr) minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}

.checks-list,
.checks-group-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.checks-list {
  grid-template-columns: 1fr;
}

.checks-group {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.checks-group-heading {
  display: grid;
  gap: 3px;
}

.checks-group-heading strong {
  font-size: 14px;
}

.checks-group-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.check-card {
  display: flex;
  grid-template-columns: none;
  gap: 8px;
  align-items: flex-start;
  min-width: 0;
  min-height: 86px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.check-card input {
  flex: 0 0 18px;
  width: 18px;
  min-height: 18px;
  height: 18px;
  margin-top: 3px;
  padding: 0;
  accent-color: var(--accent);
}

.check-card strong,
.check-card small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.check-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

.preflight-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #fedf89;
  border-radius: 8px;
  background: #fffbeb;
}

.preflight-summary {
  color: #7a4d00;
  font-size: 13px;
  line-height: 1.5;
}

.safety-note {
  margin: 0;
  color: #7a4d00;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

.risk-top-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: stretch;
  min-width: 0;
  margin-bottom: 16px;
}

.integrated-risk-panel {
  display: grid;
  grid-template-columns: minmax(240px, 0.68fr) minmax(0, 1fr);
  gap: 12px 16px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #99f6e4;
  border-top: 3px solid var(--accent-strong);
  border-radius: 8px;
  background: #f0fdfa;
}

.integrated-risk-heading {
  display: flex;
  grid-column: 1 / -1;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding-bottom: 2px;
}

.integrated-risk-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.3;
}

.integrated-risk-heading span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.score-grid {
  display: grid;
  align-content: start;
  min-width: 0;
}

.score-grid .kpi-group-heading {
  display: none;
}

.integrated-severity-panel {
  display: grid;
  align-content: start;
  min-width: 0;
  min-height: 178px;
  padding: 12px;
  border: 1px solid #5eead4;
  border-radius: 8px;
  background: #fff;
}

.integrated-severity-panel .panel-heading.compact {
  margin-top: 0;
  margin-bottom: 10px;
}

.integrated-severity-panel .panel-heading h3 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

.integrated-severity-panel .panel-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi-group {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.kpi-group-asset {
  border-top: 3px solid var(--accent);
}

.kpi-group-risk {
  border-top: 3px solid var(--warn);
}

.kpi-group-score {
  border: 0;
  padding: 0;
  background: transparent;
}

.kpi-group-heading {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.kpi-group-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.kpi-group-score .kpi-group-cards {
  grid-template-columns: 1fr;
}

.kpi-card {
  min-height: 96px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.kpi-card span,
.kpi-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

.kpi-card strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 28px;
  line-height: 1.1;
}

.kpi-card-score {
  min-height: 178px;
  display: grid;
  align-content: start;
  border-color: #5eead4;
  background: #fff;
}

.kpi-card-score strong {
  font-size: 42px;
  color: var(--accent-strong);
}

.score-breakdown {
  display: grid;
  gap: 5px;
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.score-breakdown div {
  display: grid;
  grid-template-columns: minmax(72px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.score-breakdown dt,
.score-breakdown dd {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.score-breakdown dd {
  color: var(--ink);
}

.overview-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
}

.overview-columns.single {
  grid-template-columns: 1fr;
}

.priority-list,
.severity-bars {
  display: grid;
  gap: 8px;
}

.priority-item {
  display: grid;
  width: 100%;
  min-height: 84px;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.priority-item-header {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 0;
}

.priority-item-header strong {
  min-width: 0;
}

.priority-item-header .rank-tag {
  flex: 0 0 auto;
}

.priority-item strong,
.priority-item span,
.priority-item small {
  overflow-wrap: anywhere;
}

.priority-item span,
.priority-item small {
  font-size: 12px;
  font-weight: 500;
}

.priority-item .priority-history {
  color: var(--muted);
  font-weight: 600;
}

.priority-item .priority-target {
  color: var(--ink);
  font-weight: 500;
}

.priority-item .priority-meta {
  color: var(--muted);
}

.priority-item small {
  color: var(--muted);
}

.severity-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 32px;
  gap: 8px;
  align-items: center;
  min-height: 28px;
}

.severity-row span,
.severity-row strong {
  font-size: 12px;
  line-height: 1.45;
}

.severity-row span {
  color: var(--muted);
  font-weight: 600;
}

.severity-row strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-align: right;
}

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

.severity-fill {
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
}

.severity-critical,
.severity-high {
  background: var(--danger);
}

.severity-medium {
  background: var(--warn);
}

.severity-low {
  background: var(--ok);
}

.severity-info {
  background: var(--unknown);
}

.monitor-table-wrap table {
  min-width: min(980px, 100%);
}

.risk-catalog-panel {
  padding: 18px;
}

.risk-catalog-panel .panel-heading {
  margin-bottom: 18px;
}

.risk-catalog-grid {
  display: grid;
  gap: 18px;
}

.risk-reference-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.risk-reference-card h3 {
  margin: 0;
  font-size: 16px;
}

.risk-table {
  min-width: 0;
  table-layout: fixed;
}

.risk-table th:nth-child(1) {
  width: 20%;
}

.risk-table th:nth-child(2) {
  width: 108px;
}

.risk-table th:nth-child(3),
.risk-table th:nth-child(4),
.risk-table th:nth-child(5) {
  width: auto;
}

.risk-table td {
  vertical-align: top;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.risk-table th,
.risk-table td {
  padding: 14px 12px;
}

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

.result-summary-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.result-summary-context {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.result-summary-context span,
.result-summary-sub span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.result-summary-context span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.diagnostic-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.diagnostic-tag {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.diagnostic-tag.needs-action {
  border-color: #fecaca;
  background: #fee2e2;
  color: #991b1b;
}

.diagnostic-tag.pending {
  border-color: var(--line);
  background: #fff;
  color: var(--muted);
}

.diagnostic-tag.ok {
  border-color: #86efac;
  background: #dcfce7;
  color: #166534;
}

.result-summary-main {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.result-summary-card {
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.result-summary-primary {
  border-color: #99f6e4;
  background: #f0fdfa;
}

.result-summary-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.result-summary-card strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 18px;
}

.result-summary-primary strong {
  font-size: 20px;
}

.result-summary-card .result-tag {
  min-height: 30px;
  padding: 5px 11px;
  font-size: 13px;
}

.result-summary-sub {
  display: grid;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.result-summary-sub > span {
  color: var(--ink);
}

.result-verification-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.result-verification-list span {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.result-verification-list span.verified {
  border-color: #86efac;
  background: #dcfce7;
  color: #166534;
}

.detail-block {
  margin-top: 14px;
}

.detail-block p {
  margin-bottom: 0;
  line-height: 1.6;
}

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

.finding-view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.finding-view-tab {
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 6px 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.finding-view-tab.active {
  border-color: #99f6e4;
  background: #fff;
  color: var(--accent-strong);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.finding-diagnostic-group {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.finding-diagnostic-heading {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.finding-diagnostic-heading strong,
.finding-diagnostic-heading span {
  display: block;
}

.finding-diagnostic-heading span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.finding-diagnostic-heading em {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  color: var(--ink);
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
}

.finding-diagnostic-items {
  display: grid;
  gap: 8px;
}

.finding-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.finding-card-empty {
  gap: 4px;
  background: #f8fafc;
  color: var(--muted);
}

.finding-card-empty strong {
  color: var(--ink);
  font-size: 13px;
}

.diagnostic-subsection-title {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.diagnostic-support-card {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.diagnostic-support-card strong {
  color: var(--ink);
  font-size: 13px;
}

.diagnostic-support-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.finding-card-header {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.finding-card-header strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.finding-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.finding-badge {
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.finding-badge.danger,
.finding-badge.severity-critical,
.finding-badge.severity-high {
  background: #fee2e2;
  color: #991b1b;
}

.finding-badge.warn,
.finding-badge.severity-medium {
  background: #fef3c7;
  color: #92400e;
}

.finding-badge.ok,
.finding-badge.severity-low {
  background: #dcfce7;
  color: #166534;
}

.finding-badge.unknown,
.finding-badge.severity-info,
.finding-badge.severity-unknown {
  background: #f2f4f7;
  color: #344054;
}

.finding-card p {
  color: var(--ink);
  font-size: 13px;
}

.result-legend {
  margin: 4px 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.finding-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.finding-meta div {
  min-width: 0;
}

.finding-meta dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.finding-meta dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.finding-remediation {
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted) !important;
}

.timeline {
  display: grid;
  gap: 8px;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
  overflow-wrap: anywhere;
}

th {
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #fbfcfe;
}

td.actions {
  display: flex;
  gap: 8px;
}

.mini-button {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 12px;
}

.danger {
  color: var(--danger);
  font-weight: 600;
}

.warn {
  color: var(--warn);
  font-weight: 600;
}

.ok {
  color: var(--ok);
  font-weight: 600;
}

.unknown {
  color: var(--unknown);
  font-weight: 600;
}

.history-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.history-actions input {
  min-width: 280px;
}

.button-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.button-link.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.not-found-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.not-found-panel {
  width: min(680px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.not-found-panel h1 {
  margin-bottom: 12px;
}

.not-found-panel p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.7;
}

.not-found-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

@media (max-width: 860px) {
  .app-frame {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    z-index: 10;
    height: auto;
    overflow: visible;
    gap: 10px;
    padding: 12px 10px;
  }

  .brand-block,
  .sidebar-safety {
    display: none;
  }

  .sidebar-context {
    gap: 8px;
  }

  .sidebar-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
  }

  .sidebar-link {
    grid-template-columns: 1fr auto;
    justify-items: center;
    min-width: 112px;
    min-height: 58px;
    gap: 4px;
  }

  .sidebar-link .nav-icon {
    grid-column: 1 / -1;
    width: 30px;
    height: 30px;
    padding: 7px;
    border-radius: 999px;
  }

  .sidebar-sub-link {
    margin-left: 0;
  }

  .sidebar-sub-link::before {
    display: none;
  }

  .sidebar-link em {
    min-width: 22px;
    height: 22px;
  }

  .shell {
    width: min(100% - 20px, 1280px);
    padding-top: 16px;
  }

  .topbar,
  .layout,
  .panel-heading,
  .history-actions {
    display: grid;
  }

  .result-summary-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finding-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-grid,
  .risk-top-row,
  .integrated-risk-panel,
  .overview-columns,
  .settings-grid,
  .schedule-grid {
    grid-template-columns: 1fr;
  }

  .kpi-group-cards {
    grid-template-columns: 1fr;
  }

  .checks-group-list {
    grid-template-columns: 1fr;
  }

  .history-actions input {
    min-width: 0;
  }
}
