:root {
  --bg: #f4f1e8;
  --ink: #202724;
  --muted: #65716b;
  --panel: #fffdf8;
  --line: rgba(32, 39, 36, 0.13);
  --line-strong: rgba(32, 39, 36, 0.22);
  --green: #2b7d62;
  --green-soft: rgba(43, 125, 98, 0.11);
  --blue: #345f93;
  --blue-soft: rgba(52, 95, 147, 0.11);
  --red: #a64b36;
  --red-soft: rgba(166, 75, 54, 0.10);
  --gold: #8a6a20;
  --shadow: 0 12px 28px rgba(32, 39, 36, 0.08);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body {
  font-family: Arial, "Malgun Gothic", sans-serif;
  color: var(--ink);
  background: var(--bg);
  padding: 18px;
}
button { font: inherit; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p, small, strong, span { overflow-wrap: anywhere; letter-spacing: 0; }
h1 { margin: 12px 0; max-width: 26ch; font-size: 2.35rem; line-height: 1.08; }
h2 { margin: 0; font-size: 1.35rem; }
h3 { margin: 0 0 8px; font-size: 1rem; }
p { line-height: 1.58; }
small { color: var(--muted); line-height: 1.45; }

.app-header {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) auto;
  gap: 12px;
  max-width: 1480px;
  margin: 0 auto 14px;
}
.brand, nav, .hero, .panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: var(--shadow);
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
}
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: var(--panel);
  font-weight: 900;
}
.brand strong { display: block; }
.brand span { display: block; color: var(--muted); margin-top: 2px; font-size: 0.9rem; }
nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
}
.nav-button {
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  padding: 9px 12px;
  font-weight: 800;
  cursor: pointer;
}
.nav-button:hover { border-color: var(--line); color: var(--ink); }
.nav-button.active { background: var(--green-soft); color: var(--green); border-color: rgba(43, 125, 98, 0.24); }

main {
  max-width: 1480px;
  margin: 0 auto;
}
.tab-panel { display: none; }
.tab-panel.active { display: grid; gap: 14px; }
.hero {
  padding: 24px;
  min-height: 315px;
  display: grid;
  align-content: end;
  background:
    linear-gradient(90deg, rgba(255,253,248,0.96), rgba(255,253,248,0.82)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='430' viewBox='0 0 900 430'%3E%3Crect width='900' height='430' fill='%23f6f0df'/%3E%3Cg fill='none' stroke='%23202724' stroke-opacity='.22' stroke-width='2'%3E%3Cpath d='M90 280h210v-80h170v-70h250'/%3E%3Cpath d='M160 130h140v70h170v80h270'/%3E%3Cpath d='M560 110l80 45-80 45-80-45z'/%3E%3Cpath d='M610 250l75 40-75 40-75-40z'/%3E%3C/g%3E%3Cg fill='%232b7d62' fill-opacity='.15'%3E%3Crect x='70' y='245' width='220' height='70' rx='8'/%3E%3Crect x='595' y='255' width='170' height='70' rx='8'/%3E%3C/g%3E%3Cg fill='%23345f93' fill-opacity='.13'%3E%3Crect x='60' y='95' width='230' height='70' rx='8'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
}
.hero p:not(.eyebrow) { max-width: 76ch; color: var(--muted); margin: 0 0 16px; }
.eyebrow {
  display: inline-flex;
  width: fit-content;
  margin: 0;
  padding: 6px 10px;
  border-radius: 7px;
  background: var(--green-soft);
  color: var(--green);
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 900;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.metric, .evidence-card, .task-card, .file-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.62);
}
.metric {
  padding: 12px;
}
.metric span { display: block; color: var(--muted); font-size: 0.78rem; font-weight: 800; text-transform: uppercase; }
.metric strong { display: block; margin-top: 7px; font-size: 1.55rem; font-variant-numeric: tabular-nums; }

.grid.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.panel { padding: 18px; }
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 12px;
}
.section-head span { color: var(--muted); font-size: 0.82rem; font-weight: 800; }
.section-title {
  border-left: 4px solid var(--green);
  padding-left: 14px;
}
.section-title h2 { margin-top: 8px; font-size: 1.75rem; }

.kv-list dl, .stat-table dl {
  display: grid;
  gap: 8px;
  margin: 0;
}
.kv-list div, .stat-table div {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}
dt { color: var(--muted); font-weight: 800; }
dd { margin: 0; line-height: 1.45; }
.task-list, .card-list, .file-list {
  display: grid;
  gap: 10px;
}
.task-card, .evidence-card {
  padding: 14px;
}
.task-card span, .tag {
  display: inline-flex;
  width: fit-content;
  border-radius: 7px;
  padding: 4px 8px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
  margin-bottom: 8px;
}
.task-card p, .evidence-card p { margin: 6px 0; color: var(--muted); }
.card-list.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
}
.compact .evidence-card { padding: 12px; }
.file-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 12px;
  padding: 11px 12px;
}
.file-row span { color: var(--muted); font-variant-numeric: tabular-nums; }
.risk-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.risk-list li {
  border-left: 4px solid var(--red);
  border-radius: 0 8px 8px 0;
  background: var(--red-soft);
  padding: 12px 14px;
  line-height: 1.55;
}

@media (max-width: 1180px) {
  .app-header, .grid.two, .card-list.three { grid-template-columns: 1fr; }
  nav { flex-wrap: wrap; justify-content: flex-start; }
}

@media (max-width: 680px) {
  body { padding: 10px; }
  h1 { font-size: 1.9rem; max-width: 18ch; }
  .metric-grid { grid-template-columns: 1fr; }
  .hero, .panel { padding: 16px; }
  .kv-list div, .stat-table div, .file-row { grid-template-columns: 1fr; }
}
