:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #172033;
  --muted: #64748b;
  --line: #d9e1ec;
  --navy: #17365d;
  --blue: #2563eb;
  --blue-2: #e8f0ff;
  --green: #087f5b;
  --green-bg: #e7f8f0;
  --amber: #a16207;
  --amber-bg: #fff7d6;
  --red: #b42318;
  --red-bg: #fff0ee;
  --shadow: 0 8px 30px rgba(20, 42, 74, .08);
  font-family: Inter, Pretendard, "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.topbar {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
  padding: 28px clamp(20px, 4vw, 56px); background: linear-gradient(135deg, #102a4c, #17365d 60%, #244a79); color: white;
  position: sticky; top: 0; z-index: 20; box-shadow: 0 5px 24px rgba(13, 36, 66, .18);
}
.eyebrow { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; opacity: .7; margin-bottom: 6px; }
h1 { margin: 0; font-size: clamp(24px, 3vw, 34px); }
.subtitle { margin: 8px 0 0; color: #dbe8f8; max-width: 920px; line-height: 1.55; }
.top-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.btn { border: 1px solid transparent; border-radius: 10px; padding: 10px 14px; text-decoration: none; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; }
.btn.primary { background: #fff; color: var(--navy); }
.btn.secondary { background: transparent; border-color: rgba(255,255,255,.35); color: #fff; }
.btn.dark { background: var(--navy); color: white; }
.btn.light { background: var(--blue-2); color: #1d4ed8; }
.btn.danger { background: var(--red-bg); color: var(--red); }
.btn.small { padding: 7px 10px; font-size: 13px; }
main { padding: 18px clamp(16px, 3vw, 44px) 60px; max-width: 1800px; margin: 0 auto; }
.status-strip { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.status-strip > div { display: flex; align-items: center; gap: 8px; }
.label { font-size: 12px; color: var(--muted); }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 8px; font-size: 11px; font-weight: 800; }
.badge.warning { background: var(--amber-bg); color: var(--amber); }
.badge.good { background: var(--green-bg); color: var(--green); }
.badge.danger { background: var(--red-bg); color: var(--red); }
.badge.info { background: var(--blue-2); color: #1d4ed8; }
.hero-card, .panel-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.hero-card { padding: clamp(24px, 4vw, 48px); min-height: 320px; display: grid; place-items: center; }
.hero-copy { max-width: 1080px; width: 100%; }
.hero-copy h2 { margin-top: 0; font-size: clamp(24px, 3vw, 36px); color: var(--navy); }
.hero-copy > p { color: var(--muted); line-height: 1.65; font-size: 16px; }
.callouts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 28px; }
.callouts > div { border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 18px; }
.callouts strong { display: block; color: var(--navy); margin-bottom: 7px; }
.callouts span { color: var(--muted); line-height: 1.5; font-size: 14px; }
.workspace { display: block; }
.hidden { display: none !important; }
.tabs { display: flex; overflow-x: auto; gap: 4px; background: var(--surface); border: 1px solid var(--line); padding: 6px; border-radius: 12px; position: sticky; top: 142px; z-index: 10; box-shadow: 0 4px 16px rgba(20,42,74,.05); }
.tab { border: 0; background: transparent; color: var(--muted); font-weight: 750; padding: 10px 14px; border-radius: 8px; white-space: nowrap; }
.tab.active { background: var(--navy); color: white; }
.tab-panel { display: none; padding-top: 16px; }
.tab-panel.active { display: block; }
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); }
.kpi .k { color: var(--muted); font-size: 12px; }
.kpi .v { margin-top: 6px; font-size: 24px; font-weight: 850; color: var(--navy); }
.kpi .s { margin-top: 5px; font-size: 12px; color: var(--muted); }
.panel-card { padding: 18px; margin-bottom: 14px; }
.panel-card h2, .panel-card h3 { margin-top: 0; color: var(--navy); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.panel-header h2, .panel-header h3 { margin: 0; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.field { display: grid; gap: 5px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 700; }
input, select, textarea { border: 1px solid #cbd5e1; border-radius: 8px; padding: 8px 9px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(37,99,235,.18); border-color: var(--blue); }
input[type="number"] { text-align: right; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: white; }
table { width: 100%; border-collapse: collapse; min-width: 740px; }
th, td { padding: 9px 10px; border-bottom: 1px solid #e8edf4; text-align: right; vertical-align: top; font-size: 13px; }
th { background: #edf3fb; color: var(--navy); font-weight: 800; position: sticky; top: 0; z-index: 1; }
th:first-child, td:first-child, .left { text-align: left; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #fafcff; }
.num.negative { color: var(--red); }
.note { color: var(--muted); font-size: 12px; line-height: 1.5; }
.notice { border-radius: 10px; padding: 11px 13px; line-height: 1.55; font-size: 13px; margin: 10px 0; }
.notice.warning { background: var(--amber-bg); color: #7c4a03; border: 1px solid #f1d77a; }
.notice.danger { background: var(--red-bg); color: #8f1f16; border: 1px solid #f1b9b2; }
.notice.info { background: var(--blue-2); color: #1e4d91; border: 1px solid #bed2fa; }
.notice.good { background: var(--green-bg); color: #066344; border: 1px solid #ace0ce; }
.timeline { display: grid; gap: 9px; }
.timeline-item { display: grid; grid-template-columns: 105px 12px 1fr; gap: 10px; align-items: start; }
.timeline-date { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.timeline-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); margin-top: 4px; }
.timeline-dot.warning { background: #d97706; }
.timeline-dot.good { background: var(--green); }
.timeline-title { font-weight: 750; }
.timeline-note { color: var(--muted); font-size: 12px; margin-top: 2px; }
.rule-grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: auto; }
.core-rule-grid { grid-template-columns: 74px repeat(19, minmax(100px, 1fr)); }
.special-rule-grid { grid-template-columns: 74px repeat(19, minmax(120px, 1fr)); }
.rule-grid > div { background: white; padding: 7px; font-size: 12px; min-width: 78px; }
.rule-grid .head { background: #edf3fb; color: var(--navy); font-weight: 800; text-align: center; }
.rule-grid input, .rule-grid select { width: 100%; min-width: 72px; padding: 5px; font-size: 12px; }
.rule-grid .check { display: flex; justify-content: center; align-items: center; }
.rule-grid .check input { width: auto; }
.json-editor { width: 100%; min-height: 280px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.asset-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; }
.asset-card h3 { margin: 0 0 6px; font-size: 16px; }
.asset-card .meta { color: var(--muted); font-size: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.flag-list { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.flag { font-size: 11px; padding: 4px 7px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line); }
.flag.danger { color: var(--red); background: var(--red-bg); }
.flag.good { color: var(--green); background: var(--green-bg); }
.flag.warning { color: var(--amber); background: var(--amber-bg); }
.dialog { width: min(1100px, 94vw); max-height: 90vh; border: 0; border-radius: 16px; padding: 0; box-shadow: 0 30px 80px rgba(0,0,0,.28); }
.dialog::backdrop { background: rgba(15,23,42,.46); }
#detailDialogBody { padding: 24px; max-height: 86vh; overflow: auto; }
.dialog-close { position: absolute; top: 8px; right: 12px; border: 0; background: transparent; font-size: 28px; color: var(--muted); }
.toast { position: fixed; right: 22px; bottom: 22px; max-width: 430px; background: #172033; color: #fff; padding: 12px 15px; border-radius: 10px; box-shadow: var(--shadow); z-index: 100; font-size: 13px; }
.source-list { display: grid; gap: 10px; }
.source { border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.source strong { color: var(--navy); }
.source .meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.split-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.small { font-size: 12px; }
.muted { color: var(--muted); }
@media (max-width: 980px) {
  .topbar { position: static; flex-direction: column; }
  .tabs { top: 8px; }
  .callouts, .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .top-actions { justify-content: flex-start; }
}
.core-rule-grid-v2 { grid-template-columns: 74px repeat(12, minmax(110px, 1fr)); }
.special-rule-grid-v2 { grid-template-columns: 74px repeat(9, minmax(125px, 1fr)); }

.land-rule-grid-v2 { grid-template-columns: 74px repeat(6, minmax(125px, 1fr)); }
.corp-rate-grid-v2 { grid-template-columns: 74px repeat(5, minmax(210px, 1fr)); }
.rental-rule-grid-v2 { grid-template-columns: 74px repeat(12, minmax(135px, 1fr)); }
.rental-roll-grid-v2 { grid-template-columns: 74px repeat(6, minmax(130px, 1fr)); }
.special-program-grid-v2 { grid-template-columns: 74px repeat(6, minmax(145px, 1fr)); }
