:root {
  --bg: #edf3ee;
  --surface: #ffffff;
  --surface-soft: #f6f8f6;
  --surface-strong: #e4ede6;
  --line: #cad8ce;
  --text: #1c2821;
  --text-muted: #556459;
  --primary: #2f6f49;
  --primary-strong: #23553a;
  --primary-soft: #dcebdd;
  --danger: #b44a3d;
  --warning: #b97813;
  --info: #2b6485;
  --shadow: 0 16px 36px rgba(31, 60, 40, 0.08);
  --radius: 16px;
  --max-width: 1280px;
  --font-sans: "Noto Sans KR", "Malgun Gothic", sans-serif;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; color: var(--text); font-family: var(--font-sans); line-height: 1.5; background: radial-gradient(circle at top right, rgba(82, 143, 102, 0.14), transparent 35%), linear-gradient(180deg, rgba(225, 236, 227, 0.96) 0%, rgba(237, 243, 238, 1) 220px); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(248, 251, 249, 0.96); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(202, 216, 206, 0.9); }
.site-header-inner { max-width: var(--max-width); margin: 0 auto; padding: 14px 20px; display: grid; gap: 14px; }
.header-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { min-width: 0; display: flex; align-items: center; gap: 14px; }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(135deg, var(--primary) 0%, #538269 100%); color: #fff; font-weight: 700; box-shadow: var(--shadow); }
.brand-text strong, .brand-text span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text strong { font-size: 1rem; }
.brand-text span { color: var(--text-muted); font-size: 0.87rem; }
.nav-toggle { display: none; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 12px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.nav-links a { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 14px; border-radius: 999px; color: var(--text-muted); }
.nav-links a.active, .nav-links a:hover, .nav-links a:focus-visible { background: var(--primary-soft); color: var(--primary-strong); outline: none; }
.page-container { max-width: var(--max-width); margin: 0 auto; padding: 28px 20px 44px; }
.page-intro { margin-bottom: 22px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.page-intro h1 { margin: 0 0 8px; font-size: clamp(1.65rem, 2.3vw, 2.35rem); }
.page-intro p { margin: 0; max-width: 760px; color: var(--text-muted); }
.eyebrow { margin: 0 0 6px; color: var(--primary); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; font-weight: 700; }
.page-actions, .inline-actions, .quick-links, .print-actions, .pill-row { display: flex; gap: 10px; flex-wrap: wrap; }
.button { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 12px; padding: 11px 16px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.button.secondary { background: var(--surface-soft); }
.button.ghost { background: transparent; }
.button.danger { border-color: rgba(180, 74, 61, 0.35); color: var(--danger); }
.dashboard-grid, .summary-grid, .split-grid, .detail-grid, .report-grid, .filter-bar, .field-grid, .stack, .kv-list, .report-summary, .list-compact, .history-grid, .map-layout { display: grid; gap: 18px; }
.dashboard-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.summary-grid, .kv-list, .report-summary { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.split-grid { grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.95fr); }
.detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.filter-bar, .field-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.field-grid.compact { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.history-grid { grid-template-columns: 1fr 1fr; }
.map-layout { grid-template-columns: 1.1fr 0.9fr; }
.report-grid { grid-template-columns: 1fr; }
.card { background: var(--surface); border: 1px solid rgba(202, 216, 206, 0.95); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.card-header, .card-body, .card-footer { padding: 18px 20px; }
.card-header { border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-header h2, .card-header h3 { margin: 0; font-size: 1.08rem; }
.card-subtitle, .muted, .footer-note, .hint, .report-meta { color: var(--text-muted); }
.metric-card { grid-column: span 3; }
.metric-value { margin: 8px 0 4px; font-size: 2rem; font-weight: 700; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 720px; border-collapse: collapse; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
thead th { background: var(--surface-soft); font-size: 0.9rem; color: var(--text-muted); }
tbody tr:hover { background: rgba(220, 235, 221, 0.24); }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: 0.92rem; }
.field input, .field select, .field textarea { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); padding: 11px 12px; }
.field textarea { min-height: 110px; resize: vertical; }
.form-panel { position: sticky; top: 96px; }
.message { margin-bottom: 14px; padding: 12px 14px; border-radius: 12px; }
.message.success { background: #e5f2e9; color: #24553a; }
.message.warning { background: #fff4df; color: #8d6105; }
.message.info { background: #ebf3f8; color: #255b79; }
.empty-state { padding: 24px; text-align: center; color: var(--text-muted); }
.kv-item, .list-item, .score-panel, .cost-box, .map-placeholder, .report-sheet, .id-panel, .flow-card, .history-item, .map-fallback { border: 1px solid var(--line); border-radius: 14px; }
.kv-item { padding: 14px; background: var(--surface-soft); }
.kv-item strong { display: block; margin-bottom: 6px; font-size: 0.82rem; color: var(--text-muted); }
.kv-item span { font-weight: 700; }
.list-item, .history-item { padding: 12px 14px; background: var(--surface-soft); }
.list-item h4, .history-item h4 { margin: 0 0 4px; font-size: 0.98rem; }
.list-item p, .history-item p { margin: 0; color: var(--text-muted); font-size: 0.92rem; }
.score-panel { padding: 16px; background: linear-gradient(180deg, rgba(220, 235, 221, 0.45), rgba(235, 243, 248, 0.9)); }
.score-panel strong { display: block; margin-top: 6px; font-size: 1.7rem; }
.cost-box { padding: 16px; background: #f3f7f4; }
.map-placeholder, .map-fallback { min-height: 220px; padding: 20px; display: grid; place-items: center; text-align: center; color: var(--text-muted); background: linear-gradient(135deg, rgba(47, 111, 73, 0.12), rgba(37, 96, 131, 0.1)), repeating-linear-gradient(45deg, rgba(255,255,255,0.5), rgba(255,255,255,0.5) 12px, rgba(220,235,221,0.72) 12px, rgba(220,235,221,0.72) 24px); }
.map-canvas { min-height: 340px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.risk-badge, .flow-badge, .category-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 86px; padding: 6px 10px; border-radius: 999px; font-weight: 700; font-size: 0.82rem; }
.risk-observe, .flow-observe { background: #edf3f8; color: #355f84; }
.risk-self, .flow-school { background: #fff4db; color: #8b6200; }
.risk-review, .flow-expert { background: #fde9d8; color: #9a4e10; }
.risk-urgent, .flow-emergency { background: #f8ddda; color: #98342d; }
.chip-tree { background: #dcebdd; color: #23553a; }
.chip-zone { background: #fde9d8; color: #9a4e10; }
.id-panel { padding: 14px; background: #f3f7f4; }
.id-panel strong { display: block; margin-bottom: 8px; }
.qr-placeholder { margin-top: 10px; padding: 14px; border: 1px dashed var(--line); border-radius: 12px; text-align: center; color: var(--text-muted); background: #fff; }
.flow-card { padding: 16px; background: #fff; }
.flow-card-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.school-header, .tree-meta, .map-side-list { display: grid; gap: 14px; }
.report-sheet { background: #fff; padding: 24px; }
.report-title { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 20px; }
.report-title h2 { margin: 0 0 6px; }
.report-section { margin-top: 18px; }
.report-section h3 { margin: 0 0 10px; font-size: 1rem; }
.pill { display: inline-flex; align-items: center; min-height: 38px; padding: 8px 12px; border-radius: 999px; background: var(--surface-soft); border: 1px solid var(--line); font-size: 0.9rem; }
.mobile-table-note { display: none; color: var(--text-muted); font-size: 0.86rem; }
.legend-list { display: flex; gap: 10px; flex-wrap: wrap; }
.legend-item { display: inline-flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--text-muted); }
.legend-dot { width: 12px; height: 12px; border-radius: 999px; display: inline-block; }
.legend-dot.tree { background: #4f9364; }
.legend-dot.zone { background: #d89d5c; }
.filter-pills { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 1080px) {
  .metric-card { grid-column: span 6; }
  .split-grid, .detail-grid, .history-grid, .map-layout { grid-template-columns: 1fr; }
  .form-panel { position: static; }
}
@media (max-width: 760px) {
  .site-header-inner, .page-intro, .header-top, .report-title { display: grid; }
  .nav-toggle { display: inline-flex; justify-self: end; }
  .nav-links { display: none; flex-direction: column; width: 100%; }
  .site-header.nav-open .nav-links { display: flex; }
  .nav-links a, .button { width: 100%; }
  .page-container { padding: 20px 14px 34px; }
  .dashboard-grid, .summary-grid, .filter-bar, .field-grid, .kv-list, .report-summary { grid-template-columns: 1fr; }
  .metric-card { grid-column: span 12; }
  .card-header, .card-body, .card-footer, .report-sheet { padding: 16px; }
  table { min-width: 640px; }
  .mobile-table-note { display: block; margin-top: 10px; }
}
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; color: #000; }
  .site-header, .page-intro, .no-print, .nav-toggle, .button, .form-panel, .print-actions, .map-canvas { display: none !important; }
  .page-container { max-width: none; padding: 0; }
  .card, .report-sheet, .kv-item, .list-item, .score-panel, .cost-box, .flow-card { box-shadow: none; border-color: #b8b8b8; }
  .report-sheet { padding: 0; border: none; }
  .report-section, .card { break-inside: avoid; page-break-inside: avoid; }
  table { min-width: 0; font-size: 11px; }
  th, td { padding: 8px; }
  .risk-badge, .flow-badge, .category-chip { border: 1px solid #999; background: transparent !important; color: #000 !important; }
}
