:root {
  --ink: #1f2937; --sub: #6b7280; --line: #e5e7eb; --bg: #f4f6f9; --card: #ffffff;
  --navy: #1e3a5f; --navy2: #3b5b85; --blue: #2563eb; --soft: #f1f5f9;
  --ok: #047857; --ok-bg: #ecfdf5; --warn: #b45309; --warn-bg: #fef3c7; --bad: #b91c1c; --bad-bg: #fee2e2;
  --amber: #f59e0b;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Pretendard Variable", Pretendard, "맑은 고딕", sans-serif; font-size: 14px; }
button, input, select { font: inherit; }
.hidden { display: none !important; }
.spacer { flex: 1; }
.hint { color: var(--sub); font-size: 12.5px; margin: 6px 0; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 18px 28px; background: var(--navy); color: #fff; }
.brand { display: flex; gap: 14px; align-items: center; }
.logo { width: 42px; height: 42px; border-radius: 12px; background: #fff; color: var(--navy); display: grid; place-items: center; font-weight: 800; font-size: 22px; }
.top h1 { margin: 0; font-size: 19px; }
.top p { margin: 2px 0 0; font-size: 12.5px; opacity: .8; }
.top .ghost { color: #fff; border-color: rgba(255,255,255,.35); }

main { max-width: 1120px; margin: 0 auto; padding: 22px 20px 60px; display: grid; gap: 18px; }
.card { background: var(--card); border-radius: 14px; padding: 22px 24px; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(15,23,42,.04); }
.step { font-size: 16px; font-weight: 700; color: var(--navy); display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.step b { width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 13px; }
.step-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.step-row .step { margin-bottom: 10px; }

button { border: 1px solid var(--navy); background: var(--navy); color: #fff; border-radius: 9px; padding: 8px 14px; cursor: pointer; font-weight: 600; }
button:hover { filter: brightness(1.1); }
button.ghost { background: transparent; color: var(--navy); border-color: #cbd5e1; }
button.ghost:hover { background: var(--soft); filter: none; }
button.small { padding: 5px 10px; font-size: 12.5px; }
button.primary { background: var(--blue); border-color: var(--blue); }
button.big { padding: 13px 26px; font-size: 16px; border-radius: 11px; }
button.link { background: none; border: 0; color: var(--blue); padding: 2px 4px; font-weight: 600; }

.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 2px dashed #cbd5e1; border-radius: 14px; padding: 34px 16px; cursor: pointer; transition: .15s; background: #fafbfd; }
.drop.over { border-color: var(--blue); background: #eff6ff; }
.drop-icon { font-size: 28px; color: var(--navy2); }
.drop-main { font-size: 16px; }
.drop-sub { color: var(--sub); font-size: 12.5px; }
.drop-btns { display: flex; gap: 8px; margin-top: 10px; }
.privacy { color: var(--sub); font-size: 12.5px; margin: 12px 2px 0; }

.own { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.own label { font-weight: 600; color: var(--sub); font-size: 13px; }
.own input, .own select { border: 1px solid #cbd5e1; border-radius: 8px; padding: 7px 10px; min-width: 200px; background: #fffbea; }
.own select { min-width: 100px; }

.summary { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; }
.pill { background: var(--soft); border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.pill b { color: var(--navy); }
.issues { border: 1px solid #fde68a; background: #fffbeb; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-size: 13px; }
.issues summary { cursor: pointer; font-weight: 700; color: var(--warn); }
.issues ul { margin: 8px 0 0; padding-left: 18px; max-height: 220px; overflow: auto; }
.issues li { margin: 3px 0; }

.filter { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.chip { background: #fff; color: var(--sub); border: 1px solid #d1d5db; border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }

.table-wrap { max-height: 520px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
table.files { width: 100%; border-collapse: collapse; table-layout: fixed; }
.files th { position: sticky; top: 0; background: var(--soft); text-align: left; font-size: 12px; color: var(--sub); padding: 8px 10px; z-index: 1; }
.files td { border-top: 1px solid var(--line); padding: 8px 10px; vertical-align: top; }
.files td.st { width: 34px; text-align: center; font-size: 16px; }
.files .fname { font-weight: 600; word-break: break-all; }
.files .fpath { color: var(--sub); font-size: 12px; }
.files .res { font-size: 13px; }
.files .res .tag { display: inline-block; background: var(--soft); color: var(--navy); border-radius: 6px; padding: 1px 7px; margin-right: 4px; font-size: 12px; font-weight: 700; }
.files .res .warn { color: var(--warn); font-size: 12.5px; margin-top: 3px; }
.files .res .bad { color: var(--bad); font-size: 12.5px; }
.files td.act { text-align: right; }
.files td.act button { margin: 0 0 4px 4px; }
.files .res > div { overflow-wrap: anywhere; }
.files .edit { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.files .edit select, .files .edit input { border: 1px solid #cbd5e1; border-radius: 6px; padding: 3px 6px; font-size: 12.5px; }
.files .edit input.p { width: 140px; max-width: 100%; }
.files tr.ai td { background: #faf5ff; }

.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 6px 0 18px; }
.kpi { background: var(--soft); border-radius: 10px; padding: 12px 14px; border-left: 4px solid var(--navy); }
.kpi .l { font-size: 12px; color: var(--sub); font-weight: 600; }
.kpi .v { font-size: 20px; font-weight: 800; margin-top: 4px; }
.kpi .s { font-size: 12px; color: var(--sub); margin-top: 2px; }
.kpi.green { border-color: var(--ok); } .kpi.green .v { color: var(--ok); }
.kpi.red { border-color: var(--bad); } .kpi.red .v { color: var(--bad); }
.kpi.amber { border-color: var(--warn); } .kpi.amber .v { color: var(--warn); }
.two { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; }
.two h3 { margin: 0 0 10px; font-size: 14px; color: var(--navy); }
.months { display: grid; gap: 5px; }
.mrow { display: grid; grid-template-columns: 34px 1fr 92px; gap: 8px; align-items: center; font-size: 12.5px; }
.bars { display: grid; gap: 2px; }
.bar { height: 8px; border-radius: 4px; background: var(--navy2); min-width: 1px; }
.bar.b { background: var(--amber); }
.mrow .num { text-align: right; color: var(--sub); }
table.mini { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini td { padding: 6px 4px; border-bottom: 1px solid var(--line); }
.mini td:last-child { text-align: right; font-weight: 600; }
.mini .rk { color: var(--sub); width: 24px; }
.download { text-align: center; margin-top: 22px; }

dialog { border: 0; border-radius: 14px; padding: 0; max-width: min(1100px, 96vw); width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(15,23,42,.45); }
.dlg { padding: 18px 22px; display: grid; gap: 10px; }
.dlg.narrow { max-width: 520px; }
#dlgSettings { max-width: 520px; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; }
.dlg h2 { margin: 0; font-size: 17px; color: var(--navy); }
.dlg h3 { margin: 8px 0 0; font-size: 14px; color: var(--navy); }
.dlg-foot { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.map-controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.map-controls label, label.block { display: grid; gap: 3px; font-size: 12px; color: var(--sub); font-weight: 600; }
.map-controls select, .map-controls input, label.block input { border: 1px solid #cbd5e1; border-radius: 7px; padding: 6px 8px; color: var(--ink); font-weight: 400; }
.remember { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.grid-wrap { max-height: 56vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
table.grid { border-collapse: collapse; font-size: 12px; }
.grid th, .grid td { border: 1px solid var(--line); padding: 3px 6px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid thead th { position: sticky; top: 0; background: var(--soft); z-index: 2; }
.grid thead select { font-size: 11.5px; max-width: 110px; border: 1px solid #cbd5e1; border-radius: 5px; }
.grid thead select.set { background: #dbeafe; border-color: var(--blue); }
.grid td.rn { position: sticky; left: 0; background: var(--soft); cursor: pointer; text-align: center; color: var(--sub); font-weight: 600; }
.grid tr.hdr td { background: #dbeafe; font-weight: 700; }
.grid tr.hdr td.rn { background: var(--blue); color: #fff; }
.grid tr.data td:not(.rn) { background: #f8fbff; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13.5px; z-index: 50; box-shadow: 0 8px 24px rgba(0,0,0,.2); }

@media (max-width: 760px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi .v { font-size: 16.5px; }
  .two { grid-template-columns: 1fr; }
  .top { padding: 14px 16px; }
  main { padding: 14px 12px 40px; }
  .card { padding: 16px; }
  .files td.act { width: auto; }
}
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--navy2); vertical-align: -1px; }
.lg.b { background: var(--amber); }

/* ---- 회원 ---- */
.top-right { display: flex; gap: 8px; align-items: center; }
button.light { background: #fff; color: var(--navy); border-color: #fff; }
.acct-chip { display: inline-flex; align-items: center; gap: 7px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.acct-chip.trial .dot { background: var(--blue); } .acct-chip.expired .dot, .acct-chip.blocked .dot { background: var(--bad); }
.price-note { margin: 6px 2px 0; font-size: 13px; color: var(--navy); }
.stack { display: grid; gap: 10px; }
.err { color: var(--bad); font-size: 13px; min-height: 18px; margin: 0; }
.small-print { font-size: 11.5px; }
.notice { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 8px 12px; margin: 0; font-size: 13px; }
.plan { background: var(--soft); border-radius: 10px; padding: 12px 14px; font-size: 14px; }
.plan .bad, .bad { color: var(--bad); font-weight: 700; }
.row2 { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row2 .block { flex: 1 1 140px; }
.ro { display: block; padding: 7px 0; color: var(--ink); font-weight: 600; font-size: 14px; }
.block select { border: 1px solid #cbd5e1; border-radius: 7px; padding: 6px 8px; }
.bank { background: #fffbea; border: 1px solid #fde68a; border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.pending { background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 8px; padding: 10px 12px; font-size: 13.5px; line-height: 1.6; }
#dlgLogin, #dlgAccount { max-width: 520px; }
footer.biz { max-width: 1120px; margin: 0 auto; padding: 4px 20px 40px; color: var(--sub); font-size: 12px; line-height: 1.8; }
footer.biz a { color: var(--sub); }
footer.biz .todo { color: var(--bad); }
@media (max-width: 760px) {
  .brand p { display: none; }
  .acct-chip { max-width: 190px; }
  #btnSettings { padding: 6px 9px; }
}
