:root {
  color: #172234;
  background: #f3f6fa;
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", Inter, system-ui, sans-serif;
  font-synthesis: none;
  --navy: #10233f;
  --blue: #2165d6;
  --line: #dfe5ed;
  --muted: #697587;
  --surface: #ffffff;
  --green: #148267;
  --red: #c94848;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: #f3f6fa; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(33, 101, 214, .22); outline-offset: 2px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 228px minmax(0, 1fr); }
.sidebar { background: var(--navy); color: #dce6f5; padding: 24px 16px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 27px; border-bottom: 1px solid rgba(255,255,255,.11); }
.brand-mark { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 11px; background: linear-gradient(145deg, #2f7aee, #1bb393); font-size: 18px; font-weight: 800; color: white; box-shadow: 0 8px 22px rgba(0,0,0,.18); }
.brand strong { display: block; color: white; font-size: 15px; letter-spacing: -.3px; }
.brand small { color: #93a6bf; font-size: 11px; }
.nav-label { padding: 28px 12px 9px; color: #7187a2; font-size: 10px; font-weight: 800; letter-spacing: 1.3px; }
.nav-button { border: 0; color: #aebdd0; background: transparent; padding: 11px 12px; border-radius: 9px; display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; font-size: 13px; margin: 2px 0; }
.nav-button:hover { background: rgba(255,255,255,.06); color: white; }
.nav-button.active { color: white; background: rgba(62,124,222,.24); box-shadow: inset 3px 0 #4d8df0; }
.nav-icon { width: 19px; height: 19px; border: 1px solid currentColor; border-radius: 5px; display: grid; place-items: center; font-size: 10px; }
.sidebar-foot { margin-top: auto; padding: 15px 11px 2px; border-top: 1px solid rgba(255,255,255,.1); color: #7f93aa; font-size: 11px; line-height: 1.55; }
.sidebar-foot b { color: #bfd0e3; display: block; font-weight: 650; }

.workspace { min-width: 0; }
.topbar { height: 64px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 32px; position: sticky; top: 0; z-index: 8; backdrop-filter: blur(10px); }
.crumb { font-size: 12px; color: #8490a0; }.crumb b { color: #354257; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.api-pill { display: flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 999px; background: #ecf8f4; color: #17725e; font-size: 11px; font-weight: 700; }
.api-dot { width: 7px; height: 7px; border-radius: 50%; background: #1da47f; box-shadow: 0 0 0 3px rgba(29,164,127,.13); }
.avatar { width: 31px; height: 31px; border-radius: 50%; display: grid; place-items: center; background: #e8eef7; color: #39516f; font-size: 11px; font-weight: 800; }

.content { padding: 30px 32px 54px; max-width: 1500px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 23px; }
.eyebrow { color: var(--blue); text-transform: uppercase; letter-spacing: 1.3px; font-weight: 800; font-size: 10px; margin-bottom: 7px; }
h1 { margin: 0; font-size: 26px; letter-spacing: -.7px; color: #16243a; }
.page-head p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.header-stats { display: flex; gap: 20px; }
.header-stat { border-left: 1px solid var(--line); padding-left: 18px; min-width: 78px; }
.header-stat span { display: block; color: #8590a0; font-size: 10px; margin-bottom: 3px; }
.header-stat strong { font-size: 19px; letter-spacing: -.5px; }

.notice { display: flex; align-items: center; gap: 11px; padding: 12px 15px; color: #596b83; border: 1px solid #d9e5f7; background: #f4f8fe; border-radius: 10px; margin-bottom: 16px; font-size: 12px; line-height: 1.5; }
.notice-icon { color: var(--blue); width: 22px; height: 22px; flex: 0 0 auto; border-radius: 50%; background: #dfebfc; display: grid; place-items: center; font-weight: 800; }
.notice b { color: #2a466d; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 4px 18px rgba(27,44,70,.035); }
.upload-panel { padding: 21px; display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; }
.panel-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.panel-title h2 { margin: 0 0 5px; font-size: 15px; letter-spacing: -.3px; }
.panel-title p { margin: 0; color: var(--muted); font-size: 11px; }
.field-label { display: block; font-size: 11px; color: #667387; font-weight: 700; margin-bottom: 7px; }
.select { border: 1px solid #ced6e2; border-radius: 8px; padding: 9px 34px 9px 11px; background: white; color: #26364d; min-width: 160px; font-size: 12px; }
.dropzone { border: 1.5px dashed #b8c6d9; border-radius: 11px; min-height: 154px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; transition: .18s ease; background: #fbfcfe; }
.dropzone.dragging { border-color: var(--blue); background: #f3f7fe; transform: translateY(-1px); }
.upload-symbol { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--blue); background: #eaf1fc; font-size: 21px; margin-bottom: 10px; }
.dropzone strong { font-size: 13px; }.dropzone p { font-size: 11px; color: #7c8796; margin: 5px 0 14px; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.btn { border: 1px solid #cfd7e2; background: white; color: #35445a; padding: 8px 13px; border-radius: 8px; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.btn:hover { border-color: #9bacbf; background: #fafbfd; }
.btn.primary { background: var(--blue); color: white; border-color: var(--blue); box-shadow: 0 4px 11px rgba(33,101,214,.16); }
.btn.primary:hover { background: #1858c1; }
.btn.success { background: #16866c; border-color: #16866c; color: white; }
.btn.ghost { border-color: transparent; background: transparent; color: #647287; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.hidden-input { display: none; }

.rule-side { border-left: 1px solid var(--line); padding-left: 22px; }
.rule-side h3 { font-size: 12px; margin: 0 0 4px; }.rule-side > p { color: #7c8795; font-size: 10px; margin: 0 0 12px; }
.rule-list { display: grid; gap: 7px; }
.rule-item { display: grid; grid-template-columns: 31px 1fr auto; align-items: center; gap: 9px; border: 1px solid #e5e9ef; border-radius: 9px; padding: 9px; }
.service-mark { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; color: white; font-size: 9px; font-weight: 800; }
.rule-item strong { display: block; font-size: 11px; }.rule-item span { color: #8490a0; font-size: 9px; display: block; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rule-ok { color: #16866c !important; font-size: 10px !important; font-weight: 800; margin: 0 !important; }

.batch-panel { margin-top: 16px; overflow: hidden; }
.batch-toolbar { padding: 16px 19px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); gap: 16px; }
.file-meta { display: flex; align-items: center; gap: 10px; min-width: 0; }
.file-icon { width: 34px; height: 38px; border: 1px solid #cdd9e8; background: #f3f7fc; color: #2e639f; display: grid; place-items: center; border-radius: 7px; font-size: 9px; font-weight: 900; }
.file-meta strong { font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.file-meta span { font-size: 10px; color: #8590a0; }
.result-summary { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.count-pill { padding: 5px 8px; border-radius: 6px; font-size: 10px; font-weight: 750; background: #edf1f6; color: #526174; }
.count-pill.ready { background: #e9f6f2; color: #13725d; }.count-pill.error { background: #faeeee; color: #b34040; }
.toolbar-actions { display: flex; gap: 7px; }
.table-wrap { overflow: auto; max-height: 460px; }
table { width: 100%; border-collapse: collapse; min-width: 970px; }
th { position: sticky; top: 0; z-index: 2; background: #f7f9fb; color: #798596; padding: 10px 12px; text-align: left; font-size: 9px; letter-spacing: .3px; font-weight: 800; border-bottom: 1px solid var(--line); }
td { padding: 12px; border-bottom: 1px solid #edf0f4; font-size: 11px; vertical-align: middle; color: #344359; }
tbody tr:hover { background: #fbfcfe; }
.row-num { color: #8994a3; font-variant-numeric: tabular-nums; }.person strong { display: block; color: #25344a; font-size: 11px; }.person span { display: block; color: #8994a4; font-size: 9px; margin-top: 2px; }
.service-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 7px; font-weight: 750; background: #f0f3f7; white-space: nowrap; }
.service-badge i { width: 6px; height: 6px; border-radius: 50%; display: block; }
.status { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status.ready { color: #176fb3; background: #eaf4fc; }.status.mapping_error, .status.api_error, .status.excluded { color: #b73e3e; background: #fceded; }.status.registered { color: #15745e; background: #e8f5f1; }
.error-copy { max-width: 270px; color: #b04949; line-height: 1.35; }.dim { color: #8a95a4; }.mono { font-family: "SFMono-Regular", Consolas, monospace; font-size: 10px; }
.detail-btn { border: 0; background: transparent; color: var(--blue); font-size: 10px; font-weight: 800; padding: 5px; }
.empty-table { padding: 48px 20px; text-align: center; color: #7d8998; }.empty-table strong { display: block; color: #4b5a70; font-size: 13px; margin-bottom: 5px; }.empty-table span { font-size: 11px; }

.view-panel { margin-top: 16px; padding: 20px; }
.registry-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 17px 0; }
.metric-card { border: 1px solid var(--line); border-radius: 10px; padding: 14px; }.metric-card span { font-size: 10px; color: #7c8898; }.metric-card strong { font-size: 22px; display: block; margin-top: 5px; }.metric-card small { color: #169075; font-size: 9px; }
.history-list { display: grid; gap: 8px; }.history-item { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 9px; padding: 11px 13px; font-size: 10px; }.history-item strong { display: block; font-size: 11px; }.history-item span { color: #7f8a99; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 30; background: #17263a; color: white; border-radius: 10px; padding: 12px 15px; box-shadow: 0 12px 35px rgba(20,36,58,.25); font-size: 11px; transform: translateY(20px); opacity: 0; pointer-events: none; transition: .22s ease; max-width: 340px; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { background: #8e3030; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(13,27,46,.42); z-index: 20; display: grid; place-items: center; padding: 20px; }
.modal { width: min(680px, 100%); max-height: min(760px, 90vh); overflow: auto; background: white; border-radius: 14px; box-shadow: 0 30px 80px rgba(10,24,42,.3); }
.modal-head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }.modal-head h3 { margin: 0; font-size: 15px; }.close-btn { width: 29px; height: 29px; border: 0; border-radius: 7px; background: #f0f3f7; color: #607086; }
.modal-body { padding: 20px; }.detail-section { margin-bottom: 20px; }.detail-section:last-child { margin-bottom: 0; }.detail-section h4 { margin: 0 0 9px; font-size: 11px; color: #66758a; text-transform: uppercase; letter-spacing: .6px; }
.trace { display: grid; grid-template-columns: 1fr 24px 1.2fr; gap: 7px; align-items: center; border-bottom: 1px solid #eef1f5; padding: 8px 0; font-size: 10px; }.trace b { color: #2460b4; text-align: center; }.trace code { color: #31506f; }.trace-value { color: #68768a; font-size: 9px; display: block; margin-top: 2px; }
.error-box { background: #fff4f4; border: 1px solid #f1d1d1; color: #a33c3c; border-radius: 8px; padding: 10px 12px; font-size: 10px; line-height: 1.55; }
.api-box { background: #f3f7fc; border: 1px solid #dce6f1; border-radius: 8px; padding: 12px; font-size: 10px; color: #45607e; line-height: 1.6; }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 74px minmax(0, 1fr); }.sidebar { padding: 20px 10px; }.brand { padding: 0 8px 22px; }.brand-copy, .nav-button span:not(.nav-icon), .nav-label, .sidebar-foot { display: none; }.nav-button { justify-content: center; padding: 11px; }.upload-panel { grid-template-columns: 1fr; }.rule-side { border-left: 0; border-top: 1px solid var(--line); padding: 18px 0 0; }.rule-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .app-shell { display: block; }.sidebar { position: static; height: 62px; padding: 10px 14px; flex-direction: row; align-items: center; gap: 8px; }.brand { border: 0; padding: 0; margin-right: auto; }.brand-copy { display: block; }.nav-label, .sidebar-foot { display: none; }.nav-button { width: auto; margin: 0; }.nav-button span:not(.nav-icon) { display: none; }.topbar { padding: 0 16px; }.content { padding: 22px 15px 40px; }.header-stats { display: none; }.page-head { align-items: flex-start; }.upload-panel { padding: 15px; }.panel-title-row { flex-direction: column; }.rule-list { grid-template-columns: 1fr; }.batch-toolbar { align-items: flex-start; flex-wrap: wrap; }.toolbar-actions { width: 100%; }.toolbar-actions .btn { flex: 1; }.registry-grid { grid-template-columns: repeat(2, 1fr); }.history-item { grid-template-columns: 1fr auto; }.history-item span:nth-child(3) { display: none; }
}
