:root {
  --navy: #101828; --navy-2: #1b2539; --blue: #2345d8; --blue-2: #3c64dc; --blue-soft: #e9eefc;
  --paper: #f5f4f0; --card: #fff; --ink: #10110f; --sub: #5d6470; --line: #e3e2dc;
  --good: #128a4e; --good-soft: #e3f5ea; --bad: #d1432f; --bad-soft: #fdeceb; --warn: #b7791f; --warn-soft: #fdf4e3;
  --kakao: #fee500; --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "Pretendard Variable", Pretendard, "Noto Sans KR", "Malgun Gothic", sans-serif; background: var(--paper); color: var(--ink); font-size: 15px; line-height: 1.55; display: flex; min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }

/* sidebar */
.side { width: 248px; flex: none; background: var(--navy); color: #c9d2e3; padding: 22px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.brand { display: flex; flex-direction: column; gap: 6px; padding: 0 10px; text-decoration: none; color: #fff; }
.brand img { height: 30px; width: auto; align-self: flex-start; }
.brand b { font-size: 22px; letter-spacing: .08em; }
.brand span { font-size: 12px; color: #8a96ad; }
#nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group { font-size: 11px; color: #6f7b93; margin: 14px 10px 4px; letter-spacing: .04em; }
#nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: #c9d2e3; text-decoration: none; font-size: 14.5px; }
#nav a:hover { background: var(--navy-2); color: #fff; }
#nav a.on { background: var(--blue); color: #fff; font-weight: 600; }
#nav a i { font-style: normal; width: 18px; text-align: center; opacity: .9; }
.side-cta { margin-top: auto; display: block; background: linear-gradient(135deg, #2345d8, #3c64dc); border-radius: var(--radius); padding: 16px; color: #fff; text-decoration: none; }
.side-cta strong { display: block; font-size: 15px; }
.side-cta span { display: block; font-size: 12.5px; opacity: .85; margin: 4px 0 10px; }
.side-cta em { font-style: normal; font-size: 13px; background: var(--kakao); color: #191600; padding: 6px 10px; border-radius: 8px; font-weight: 700; display: inline-block; }

/* main */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; padding: 18px 32px; border-bottom: 1px solid var(--line); background: rgba(245,244,240,.92); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; }
.top h1 { font-size: 21px; margin: 0; flex: 1; letter-spacing: -.02em; }
.menu { display: none; background: none; border: 0; font-size: 22px; cursor: pointer; padding: 4px 8px; }
#view { padding: 26px 32px 40px; flex: 1; outline: none; max-width: 1240px; width: 100%; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 18px 32px; font-size: 12.5px; color: var(--sub); border-top: 1px solid var(--line); }

/* building blocks */
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.card h2 { font-size: 16.5px; margin: 0 0 4px; letter-spacing: -.01em; }
.card h2 + p.sub, p.sub { margin: 0 0 14px; color: var(--sub); font-size: 13.5px; }
.stack > * + * { margin-top: 16px; }
.stat .k { font-size: 13px; color: var(--sub); }
.stat .v { font-size: 30px; font-weight: 800; letter-spacing: -.03em; margin: 6px 0 2px; }
.stat .v small { font-size: 15px; font-weight: 600; color: var(--sub); margin-left: 2px; }
.stat .d { font-size: 12.5px; color: var(--sub); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 15px; cursor: pointer; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 14px; white-space: nowrap; }
.btn:hover { border-color: #c8c7c0; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-2); }
.btn.kakao { background: var(--kakao); border-color: var(--kakao); color: #191600; }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: wait; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1; min-width: 180px; }
label.f { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
input[type=text], input[type=url], input[type=date], input[type=time], select, textarea { width: 100%; border: 1px solid #d6d5ce; border-radius: 10px; padding: 9px 12px; background: #fff; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, #nav a:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
textarea { min-height: 160px; resize: vertical; }
.hint { font-size: 12.5px; color: var(--sub); margin-top: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--blue-soft); color: var(--blue); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 13.5px; font-weight: 600; }
.chip button { border: 0; background: rgba(35,69,216,.12); color: var(--blue); border-radius: 50%; width: 20px; height: 20px; cursor: pointer; line-height: 1; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: #eef0f3; color: var(--sub); }
.tag.good { background: var(--good-soft); color: var(--good); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.blue { background: var(--blue-soft); color: var(--blue); }
.up { color: var(--good); font-weight: 700; } .down { color: var(--bad); font-weight: 700; } .flat { color: var(--sub); }
.notice { background: var(--blue-soft); border-radius: 12px; padding: 12px 14px; font-size: 13.5px; color: #253a8f; }
.notice.warn { background: var(--warn-soft); color: #7a5312; }
.empty { text-align: center; color: var(--sub); padding: 28px 10px; font-size: 14px; }
.tbl-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12.5px; color: var(--sub); font-weight: 600; white-space: nowrap; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.me td { background: #f3f6ff; font-weight: 700; }
.rank { font-weight: 800; font-size: 16px; }
.rank.out { color: var(--sub); font-weight: 600; font-size: 14px; }
.top5 { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--sub); }
.top5 li.me { color: var(--blue); font-weight: 700; }
details summary { cursor: pointer; font-size: 13px; color: var(--blue); }
.bar { height: 10px; border-radius: 99px; background: #eceae4; overflow: hidden; display: flex; }
.bar span { display: block; height: 100%; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--sub); margin-top: 8px; flex-wrap: wrap; }
.legend b { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .meta { font-size: 12.5px; color: var(--sub); margin-top: 3px; }
.list a.t { color: var(--ink); text-decoration: none; font-weight: 600; }
.list a.t:hover { color: var(--blue); }
mark { background: #ffe1dc; color: var(--bad); border-radius: 3px; padding: 0 2px; }
mark.warn { background: #fdf0d2; color: #8a5a0d; }
.hero { background: var(--navy); color: #fff; border-radius: 18px; padding: 26px 28px; display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(60,100,220,.55), transparent 70%); }
.hero h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.02em; }
.hero p { margin: 0; color: #b9c3d6; font-size: 14px; }
.hero .row { position: relative; z-index: 1; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; font-size: 14px; }
.steps li::before { content: counter(s); flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.chart { width: 100%; height: auto; display: block; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .h { font-size: 12px; color: var(--sub); text-align: center; padding: 4px 0; }
.cal .d { min-height: 74px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 6px; font-size: 12px; background: #fff; cursor: pointer; }
.cal .d.other { background: #faf9f6; color: #b4b3ad; }
.cal .d.today { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.cal .d .ev { display: block; background: var(--blue-soft); color: var(--blue); border-radius: 4px; padding: 1px 4px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.result-item { border: 1px solid var(--line); border-left-width: 4px; border-radius: 10px; padding: 12px 14px; }
.result-item.bad { border-left-color: var(--bad); }
.result-item.warn { border-left-color: var(--warn); }
.result-item .fix { font-size: 13px; color: var(--sub); margin-top: 4px; }
.law-item { padding: 14px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 72px 1fr; gap: 12px; }
.law-item:last-child { border-bottom: 0; }
.law-item .no { font-weight: 800; color: var(--blue); }
.law-item p { margin: 4px 0 0; font-size: 13.5px; color: var(--sub); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 50; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) {
  body { display: block; }
  .side { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .side.open { transform: none; }
  .menu { display: block; }
  .top { padding: 12px 16px; }
  .top h1 { font-size: 18px; }
  #view { padding: 18px 16px 32px; }
  .foot { padding: 16px; }
  .g4, .g3, .g2 { grid-template-columns: 1fr; }
  .g4.keep2 { grid-template-columns: 1fr 1fr; }
  .cal .d { min-height: 52px; font-size: 11px; padding: 3px; }
  .cal .d .ev { font-size: 10px; }
  .hero { padding: 22px 20px; }
  .law-item { grid-template-columns: 1fr; gap: 2px; }
}
