:root {
  --bg: #f5f3ec;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: #fffdf8;
  --ink: #102320;
  --muted: #5a6c69;
  --line: rgba(16, 35, 32, 0.1);
  --accent: #155e63;
  --danger: #b42318;
  --warn: #c77700;
  --safe: #12693b;
  --safe-soft: #ddf3e4;
  --warn-soft: #fff0d6;
  --danger-soft: #fce8e5;
  --shadow: 0 18px 40px rgba(38, 51, 46, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", "Aptos", sans-serif;
  background:
    radial-gradient(circle at top right, rgba(21, 94, 99, 0.12), transparent 34%),
    linear-gradient(180deg, #f8f5ef 0%, #f0ede4 100%);
  color: var(--ink);
}

body {
  padding: 16px;
}

.app-shell {
  display: grid;
  gap: 14px;
}

.hero,
.panel,
.modal {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero {
  padding: 18px 18px 14px;
}

.eyebrow,
.label,
.modal-tag {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  color: var(--muted);
}

h1,
h2,
.status-text,
.summary-text {
  margin: 0;
}

h1 {
  margin-top: 6px;
  font-size: 28px;
  line-height: 1.05;
}

.hero-copy {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.panel {
  padding: 16px;
}

.status-row,
.risk-header,
.score-row,
.modal-score,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.status-text {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 600;
}

.mail-summary {
  margin-top: 14px;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.45;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.primary-button {
  background: var(--accent);
  color: #fff;
}

.secondary-button {
  background: #e8ebe7;
  color: var(--ink);
}

.danger-button {
  background: var(--danger);
  color: #fff;
}

.risk-panel {
  display: grid;
  gap: 16px;
}

.score-value {
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
}

.score-max {
  color: var(--muted);
  font-weight: 600;
}

.severity-pill {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.severity-low {
  background: var(--safe-soft);
  color: var(--safe);
}

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

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

.meter {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #e9ece6;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #1a8d54 0%, #e89a00 58%, #c02a1f 100%);
  transition: width 0.2s ease;
}

.summary-text,
.detail-copy,
.support-copy,
.modal-copy,
.delete-status {
  line-height: 1.5;
}

.category-grid,
.split-grid {
  display: grid;
  gap: 12px;
}

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

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

.category-card {
  margin: 0;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.category-title {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.category-result {
  margin: 6px 0 0;
  font-size: 16px;
  font-weight: 700;
}

.detail-list,
.source-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.detail-list li,
.source-list li {
  margin-bottom: 6px;
  line-height: 1.4;
}

.source-list a {
  color: var(--accent);
}

.hidden {
  display: none !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 33, 30, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal {
  width: min(100%, 420px);
  padding: 20px;
  background: #fff8f7;
}

.modal-copy {
  margin: 10px 0 14px;
}

.modal-score {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--danger-soft);
  margin-bottom: 14px;
}

.delete-status {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--muted);
}

@media (max-width: 520px) {
  body {
    padding: 12px;
  }

  .status-row,
  .risk-header,
  .split-grid,
  .modal-actions {
    grid-template-columns: 1fr;
    display: grid;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  button {
    width: 100%;
  }
}
