:root {
  color-scheme: light;
  --bg: #f6f8fc;
  --bg-strong: #e8f2ff;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --surface-muted: #f1f5f9;
  --surface-blue: #edf6ff;
  --line: rgba(100, 116, 139, 0.22);
  --line-strong: rgba(37, 99, 235, 0.28);
  --text: #172033;
  --muted: #667085;
  --soft: #94a3b8;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --primary-soft: rgba(37, 99, 235, 0.1);
  --safe: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 12px 28px rgba(15, 23, 42, 0.06);
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --sidebar-width: 282px;
  font-family: "Segoe UI", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 10%, rgba(37, 99, 235, 0.16), transparent 30%),
    radial-gradient(circle at 84% 6%, rgba(16, 185, 129, 0.14), transparent 28%),
    linear-gradient(135deg, #fbfdff 0%, var(--bg) 48%, #eef6ff 100%);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
}

code {
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: 8px;
  padding: 2px 6px;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(20px);
  padding: 26px 18px;
  box-shadow: 10px 0 40px rgba(15, 23, 42, 0.04);
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 8px 6px 4px;
}

.brand-badge {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 19px;
  background: linear-gradient(145deg, #1d4ed8, #06b6d4);
  color: white;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.26);
}

.brand-kicker,
.topbar-eyebrow,
.task-banner-kicker,
.dialog-kicker {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.brand h1 {
  margin: 5px 0 3px;
  font-size: 19px;
}

.brand p,
.topbar p,
.section-card-header p,
.card p,
.home-stack p,
.info-list {
  color: var(--muted);
  line-height: 1.65;
}

.brand p {
  margin: 0;
  font-size: 12px;
}

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

.nav-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transition: 180ms ease;
}

.nav-item:hover {
  transform: translateY(-1px);
  background: rgba(37, 99, 235, 0.06);
}

.nav-item.active {
  color: white;
  background: linear-gradient(135deg, #1d4ed8, #0891b2);
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.22);
}

.nav-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: var(--surface-muted);
  color: var(--primary);
  font-weight: 800;
}

.nav-item.active .nav-icon {
  background: rgba(255, 255, 255, 0.18);
  color: white;
}

.nav-item strong,
.nav-item small {
  display: block;
}

.nav-item small {
  margin-top: 3px;
  font-size: 12px;
  opacity: 0.8;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.8);
  color: var(--muted);
  font-size: 12px;
}

.sidebar-footer strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
}

.workspace,
.main {
  display: grid;
  align-content: start;
  gap: 20px;
  min-width: 0;
  padding: 28px 34px 42px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.topbar h2 {
  margin: 6px 0 4px;
  font-size: clamp(26px, 3vw, 38px);
  letter-spacing: -0.04em;
}

.topbar p {
  margin: 0;
}

.topbar-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.status-dot {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-dot span {
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: var(--soft);
}

.status-dot-ok span {
  background: var(--safe);
}

.status-dot-warn span {
  background: var(--warn);
}

.status-dot-danger span {
  background: var(--danger);
}

.status-dot-running span {
  background: var(--primary);
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.12);
}

.task-banner {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(237, 246, 255, 0.96), rgba(255, 255, 255, 0.92));
  box-shadow: var(--shadow-soft);
}

.task-banner-main {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.task-banner h3 {
  margin: 4px 0;
  font-size: 18px;
}

.task-banner p {
  margin: 0;
  color: var(--muted);
}

.task-banner-actions,
.next-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.task-progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
}

.task-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #06b6d4);
  transition: width 240ms ease;
}

.view-mount {
  min-width: 0;
}

.home-page {
  display: grid;
  gap: 22px;
}

.home-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  min-height: 470px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 34px;
  background:
    radial-gradient(circle at 28% 22%, rgba(37, 99, 235, 0.14), transparent 28%),
    radial-gradient(circle at 74% 18%, rgba(16, 185, 129, 0.14), transparent 26%),
    linear-gradient(135deg, #ffffff 0%, #f2f8ff 100%);
  box-shadow: var(--shadow);
  padding: 36px;
}

.home-stack {
  width: min(920px, 100%);
  text-align: center;
}

.home-stack h2 {
  margin: 14px 0 10px;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.02;
  letter-spacing: -0.06em;
}

.hero-action-grid {
  display: grid;
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  margin-top: 30px;
  text-align: left;
}

.hero-orb {
  display: grid;
  width: min(280px, 100%);
  aspect-ratio: 1;
  place-items: center;
  justify-self: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.78), transparent 22%),
    conic-gradient(from 140deg, #2563eb, #06b6d4, #10b981, #2563eb);
  color: white;
  cursor: pointer;
  box-shadow: 0 28px 70px rgba(37, 99, 235, 0.28);
  transition: 220ms ease;
}

.hero-orb:hover:not(:disabled) {
  transform: translateY(-4px) scale(1.01);
}

.hero-orb:disabled {
  cursor: not-allowed;
  filter: grayscale(0.3);
  opacity: 0.72;
}

.hero-orb span,
.hero-orb strong {
  display: block;
  text-align: center;
}

.hero-orb span {
  align-self: end;
  font-size: 18px;
  font-weight: 800;
}

.hero-orb strong {
  align-self: start;
  max-width: 150px;
  font-size: 30px;
  line-height: 1.05;
}

.hero-orb-busy {
  animation: pulse-orb 1.4s ease-in-out infinite;
}

@keyframes pulse-orb {
  0%, 100% {
    box-shadow: 0 28px 70px rgba(37, 99, 235, 0.24);
  }
  50% {
    box-shadow: 0 28px 90px rgba(37, 99, 235, 0.38);
  }
}

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

.mode-card {
  display: grid;
  gap: 8px;
  min-height: 128px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.mode-card strong {
  font-size: 17px;
}

.mode-card span {
  color: var(--muted);
  line-height: 1.55;
}

.check-progress-card {
  display: grid;
  gap: 20px;
}

.check-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.check-progress-head h3 {
  margin: 10px 0 8px;
  font-size: 26px;
  letter-spacing: -0.03em;
}

.check-progress-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.check-progress-target {
  display: grid;
  gap: 6px;
  min-width: 220px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 18px;
  background: var(--primary-soft);
  padding: 14px;
}

.check-progress-target span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.check-progress-target strong {
  overflow-wrap: anywhere;
}

.check-stepper {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.check-step {
  position: relative;
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.78);
  padding: 14px;
}

.check-step span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #cbd5e1;
}

.check-step strong {
  color: var(--muted);
  font-size: 13px;
}

.check-step-done {
  border-color: rgba(37, 99, 235, 0.22);
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.96), rgba(255, 255, 255, 0.96));
}

.check-step-done span {
  background: linear-gradient(135deg, var(--primary), #06b6d4);
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.1);
}

.check-step-done strong {
  color: var(--text);
}

.check-result-stats {
  margin-top: 0;
}

.check-result-stats .stat strong {
  overflow-wrap: anywhere;
}

.card,
.section-card {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.inset-card {
  border-radius: var(--radius-md);
  background: rgba(248, 250, 252, 0.72);
}

.hero-card h2 {
  margin: 10px 0 12px;
  font-size: 30px;
}

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

.section-card-header h3,
.card-header h3,
.card h4 {
  margin: 0 0 6px;
}

.pill,
.status-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.25);
  color: var(--primary);
  background: var(--primary-soft);
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 800;
}

.split-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 20px;
  min-width: 0;
}

.inner-grid {
  margin-top: 20px;
}

.stats-grid,
.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.stat,
.kv-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.compact-form {
  margin-top: 12px;
}

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

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  outline: none;
  padding: 12px 14px;
  transition: 160ms ease;
}

.field input:focus,
.field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.field-wide {
  grid-column: span 2;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.home-check {
  margin-top: 14px;
}

.check-row input {
  accent-color: var(--primary);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.compact-row {
  margin-top: 10px;
}

.primary-btn,
.secondary-btn,
.danger-btn,
.text-btn {
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 800;
  cursor: pointer;
  transition: 160ms ease;
}

.primary-btn {
  color: white;
  background: linear-gradient(135deg, var(--primary), #0891b2);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.2);
}

.secondary-btn {
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--surface-strong);
}

.danger-btn {
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.08);
}

.text-btn {
  margin-top: 12px;
  padding-inline: 0;
  color: var(--primary);
  background: transparent;
}

.primary-btn:hover:not(:disabled),
.secondary-btn:hover:not(:disabled),
.danger-btn:hover:not(:disabled),
.text-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.primary-btn:disabled,
.secondary-btn:disabled,
.danger-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.list-scroll {
  max-height: 420px;
  overflow: auto;
  min-width: 0;
  padding-right: 6px;
}

.list-item {
  display: grid;
  gap: 4px;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
}

.list-button {
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.selected-item {
  border-color: var(--line-strong);
  background: var(--surface-blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.06);
}

.muted-inline,
.danger-inline {
  font-size: 12px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.muted-inline {
  color: var(--muted);
}

.danger-inline {
  color: #dc2626;
}

.empty-state,
.inline-note {
  color: var(--muted);
}

.empty-state {
  padding: 18px 0;
}

.inline-note {
  margin-top: 14px;
}

.inline-panel {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-muted);
}

.inline-panel strong {
  display: block;
  margin-bottom: 8px;
}

.dense-list .list-item span {
  color: var(--muted);
}

.error-box,
.success-box {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
}

.error-box {
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: rgba(254, 242, 242, 0.96);
  color: #b91c1c;
}

.success-box {
  border: 1px solid rgba(16, 185, 129, 0.3);
  background: rgba(236, 253, 245, 0.96);
  color: #047857;
}

.scope-summary {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 10px 14px;
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  background: var(--surface-muted);
}

.scope-summary strong {
  color: var(--muted);
}

.risk-page,
.reports-page {
  display: grid;
  gap: 22px;
}

.risk-hero,
.report-hero {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: center;
  margin-top: 18px;
  padding: 22px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 12% 10%, rgba(37, 99, 235, 0.12), transparent 28%),
    linear-gradient(135deg, #ffffff 0%, #eef7ff 100%);
  border: 1px solid var(--line);
}

.risk-hero h3,
.report-hero h3 {
  margin: 10px 0 6px;
  font-size: clamp(24px, 3vw, 38px);
  letter-spacing: -0.04em;
}

.risk-hero p,
.report-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.risk-score {
  display: grid;
  place-items: center;
  min-width: 170px;
  min-height: 170px;
  border-radius: 50%;
  color: white;
  background: conic-gradient(from 150deg, #ef4444, #f59e0b, #2563eb, #ef4444);
  box-shadow: 0 24px 58px rgba(239, 68, 68, 0.18);
}

.risk-score strong {
  margin-top: 26px;
  font-size: 52px;
  line-height: 0.9;
}

.risk-score span {
  max-width: 100px;
  margin-bottom: 28px;
  text-align: center;
  font-weight: 800;
}

.risk-list {
  display: grid;
  gap: 14px;
}

.risk-item {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface-strong);
}

.risk-item-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.risk-item h4 {
  margin: 8px 0 0;
  font-size: 18px;
}

.severity-badge {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
}

.severity-danger {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.22);
}

.severity-warn {
  color: #92400e;
  background: rgba(245, 158, 11, 0.13);
  border: 1px solid rgba(245, 158, 11, 0.24);
}

.severity-ok {
  color: #047857;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.24);
}

.severity-info {
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid rgba(37, 99, 235, 0.22);
}

.risk-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.risk-detail-grid div {
  display: grid;
  gap: 6px;
  padding: 13px;
  border-radius: 16px;
  background: var(--surface-muted);
}

.risk-detail-grid strong {
  color: var(--muted);
  font-size: 12px;
}

.risk-detail-grid span {
  line-height: 1.55;
}

.inline-text-btn {
  margin: 0;
  padding: 0;
}

.report-center-grid {
  display: grid;
  grid-template-columns: minmax(260px, 380px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.report-preview-actions,
.report-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.report-file-list {
  max-height: 680px;
}

.report-filter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px 140px;
  gap: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.78);
  padding: 14px;
}

.report-file-item strong {
  font-size: 15px;
}

.report-dialog {
  display: grid;
  gap: 18px;
  width: min(1120px, 96vw);
  max-height: 92vh;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: white;
  padding: 22px;
  box-shadow: 0 34px 90px rgba(15, 23, 42, 0.22);
}

.report-dialog-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.report-dialog-header h3 {
  margin: 8px 0 4px;
  font-size: 24px;
}

.report-dialog-header p {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.terminal {
  margin-top: 18px;
  max-height: 580px;
  min-width: 0;
  overflow: auto;
  border: 1px solid rgba(15, 23, 42, 0.82);
  border-radius: 16px;
  background: #101827;
  color: #dbeafe;
  padding: 16px;
  font-family: Consolas, "Cascadia Mono", monospace;
}

.terminal-scroll {
  max-height: 520px;
}

.terminal-line {
  margin-bottom: 8px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.terminal-line.dim,
.terminal-time {
  color: #94a3b8;
}

.terminal-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.terminal-event {
  color: #93c5fd;
}

.terminal-time {
  font-size: 12px;
}

.tone-ok {
  color: #86efac;
}

.tone-warn {
  color: #fde68a;
}

.tone-danger {
  color: #fca5a5;
}

.tone-info {
  color: #93c5fd;
}

.report-preview {
  margin-top: 16px;
  max-height: 560px;
  min-width: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
  padding: 16px;
}

.report-preview-expanded {
  max-height: calc(92vh - 150px);
  margin-top: 0;
}

.boundary-page {
  display: grid;
  gap: 22px;
}

.boundary-hero {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: center;
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 18% 18%, rgba(16, 185, 129, 0.14), transparent 28%),
    linear-gradient(135deg, #ffffff 0%, #edfdf7 100%);
}

.boundary-hero h3 {
  margin: 10px 0 6px;
  font-size: clamp(24px, 3vw, 38px);
  letter-spacing: -0.04em;
}

.boundary-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.boundary-shield {
  position: relative;
  display: grid;
  min-width: 168px;
  min-height: 188px;
  place-items: center;
  color: white;
  background: linear-gradient(160deg, #059669, #0891b2 58%, #2563eb);
  clip-path: polygon(50% 0%, 94% 18%, 86% 72%, 50% 100%, 14% 72%, 6% 18%);
  filter: drop-shadow(0 24px 42px rgba(16, 185, 129, 0.22));
}

.boundary-shield strong,
.boundary-shield span {
  display: block;
  text-align: center;
}

.boundary-shield strong {
  align-self: end;
  font-size: 52px;
  line-height: 0.9;
}

.boundary-shield span {
  align-self: start;
  margin-top: 8px;
  font-weight: 900;
}

.boundary-chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.boundary-chip {
  display: grid;
  gap: 8px;
  padding: 15px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.boundary-chip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.boundary-chip strong {
  overflow-wrap: anywhere;
}

.boundary-chip-allow {
  border-color: rgba(16, 185, 129, 0.26);
  background: rgba(236, 253, 245, 0.84);
}

.boundary-chip-block {
  border-color: rgba(239, 68, 68, 0.24);
  background: rgba(254, 242, 242, 0.84);
}

.boundary-chip-neutral {
  background: var(--surface-muted);
}

.boundary-explain-list {
  display: grid;
  gap: 12px;
}

.boundary-explain-item {
  display: grid;
  gap: 6px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-strong);
}

.boundary-explain-item span {
  color: var(--muted);
  line-height: 1.6;
}

.boundary-timeline {
  display: grid;
  gap: 14px;
}

.boundary-event {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface-strong);
}

.boundary-event-danger {
  border-color: rgba(239, 68, 68, 0.24);
}

.boundary-event-warn {
  border-color: rgba(245, 158, 11, 0.26);
}

.boundary-event-time {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.boundary-event-body {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.boundary-event-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.boundary-event-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.boundary-event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.boundary-event-meta span {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
}

.compact-card {
  padding: 18px;
}

.no-top-gap {
  margin-top: 0;
}

.history-page {
  display: grid;
  gap: 22px;
}

.history-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.history-list {
  max-height: 560px;
}

.history-task-item {
  position: relative;
  padding-left: 18px;
}

.history-task-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--primary), #06b6d4);
}

.settings-page {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.settings-nav {
  position: sticky;
  top: 28px;
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.settings-nav-item {
  display: grid;
  gap: 5px;
  padding: 13px;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.settings-nav-item:hover {
  background: rgba(37, 99, 235, 0.06);
}

.settings-nav-item.active {
  color: white;
  background: linear-gradient(135deg, var(--primary), #0891b2);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.18);
}

.settings-nav-item strong,
.settings-nav-item span {
  display: block;
}

.settings-nav-item span {
  font-size: 12px;
  opacity: 0.82;
}

.settings-content {
  min-width: 0;
}

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

.diagnostics-list {
  grid-column: 1 / -1;
  max-height: 520px;
}

.report-preview pre {
  margin: 0;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Consolas, "Cascadia Mono", monospace;
}

.report-frame {
  width: 100%;
  min-height: 520px;
  border: none;
  border-radius: 12px;
  background: white;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.32);
  backdrop-filter: blur(10px);
}

.confirm-dialog {
  width: min(480px, 100%);
  border: 1px solid var(--line);
  border-radius: 26px;
  background: white;
  padding: 24px;
  box-shadow: 0 34px 90px rgba(15, 23, 42, 0.22);
}

.confirm-dialog h3 {
  margin: 8px 0;
  font-size: 24px;
}

.confirm-dialog p {
  color: var(--muted);
  line-height: 1.7;
}

.toast-host {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  display: grid;
  gap: 12px;
  width: min(380px, calc(100vw - 32px));
}

.toast {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--primary);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  padding: 14px 14px 14px 16px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(12px);
}

.toast strong {
  display: block;
  color: var(--text);
  font-size: 14px;
}

.toast p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.toast button {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.toast-success {
  border-left-color: var(--success);
}

.toast-error {
  border-left-color: var(--danger);
}

.toast-info {
  border-left-color: var(--primary);
}

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

  .sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .nav-list {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .topbar,
  .task-banner-main {
    flex-direction: column;
  }

  .topbar-status {
    justify-content: flex-start;
  }

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

  .risk-hero,
  .boundary-hero,
  .report-hero,
  .check-progress-head,
  .report-dialog-header {
    flex-direction: column;
    align-items: stretch;
  }

  .report-center-grid,
  .boundary-event,
  .risk-detail-grid,
  .history-grid,
  .settings-page {
    grid-template-columns: 1fr;
  }

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

  .report-preview-actions,
  .report-dialog-actions {
    justify-content: flex-start;
  }

  .settings-nav {
    position: relative;
    top: auto;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  }
}

@media (max-width: 720px) {
  .workspace,
  .main {
    padding: 18px;
  }

  .home-hero {
    min-height: auto;
    padding: 24px;
  }

  .hero-action-grid,
  .form-grid,
  .report-filter-grid,
  .mode-grid,
  .check-stepper,
  .scope-summary,
  .history-summary-grid,
  .diagnostics-grid {
    grid-template-columns: 1fr;
  }

  .field-wide {
    grid-column: span 1;
  }

  .hero-orb {
    width: min(230px, 100%);
  }

  .risk-score {
    width: 150px;
    min-width: 150px;
    min-height: 150px;
    justify-self: center;
  }

  .boundary-shield {
    min-width: 142px;
    min-height: 160px;
    justify-self: center;
  }

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