:root {
  color: #172033;
  background: #f4f6f8;
  font-family: "Pretendard", "Noto Sans KR", Inter, system-ui, sans-serif;
  font-synthesis: none;
  --ink: #172033;
  --muted: #738092;
  --line: #dde2e8;
  --panel: #ffffff;
  --lime: #c7f05b;
  --green: #2b9361;
  --navy: #182338;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: #f4f6f8; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, label:focus-within { outline: 3px solid rgba(63, 130, 247, .25); outline-offset: 2px; }

.topbar { height: 70px; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; background: #fff; border-bottom: 1px solid #e0e4e9; position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; color: var(--lime); background: var(--navy); border-radius: 10px; }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.1; }
.brand b { font-size: 14px; letter-spacing: .12em; font-weight: 800; }
.brand small { margin-top: 5px; color: #7d8794; font-size: 10px; letter-spacing: .04em; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.local-badge { display: inline-flex; align-items: center; gap: 7px; color: #526071; font-size: 11px; font-weight: 700; margin-right: 7px; }
.local-badge i { width: 7px; height: 7px; background: #38a974; border-radius: 50%; box-shadow: 0 0 0 4px #e4f5ed; }
.button { height: 38px; padding: 0 15px; border-radius: 8px; border: 1px solid #dce1e7; background: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-size: 12px; font-weight: 700; transition: .18s ease; }
.button:hover { transform: translateY(-1px); border-color: #bfc7d1; box-shadow: 0 4px 12px rgba(26, 36, 52, .08); }
.button.dark { color: #fff; background: var(--navy); border-color: var(--navy); }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.icon { flex: 0 0 auto; }

.page-shell { width: min(1460px, calc(100% - 48px)); margin: 0 auto; padding: 31px 0 48px; }
.hero-row { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; }
.eyebrow, .panel-title span:first-child { color: #8a95a4; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
h1 { margin: 6px 0 7px; font-size: 26px; line-height: 1.25; letter-spacing: -.045em; }
.hero-row p { margin: 0; color: #737e8c; font-size: 12px; }
.run-area { display: flex; align-items: center; gap: 14px; }
.last-run { color: #87919e; font-size: 10px; }
.button.run { height: 43px; padding: 0 20px; background: var(--lime); border-color: #b8dc55; color: #172033; box-shadow: 0 6px 18px rgba(165, 205, 64, .2); }
.button.run:hover { background: #d2f879; }
.spinner { width: 14px; height: 14px; border: 2px solid rgba(24,35,56,.25); border-top-color: var(--navy); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.metric-strip { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--navy); color: #fff; border-radius: 11px; overflow: hidden; margin-bottom: 15px; box-shadow: 0 10px 30px rgba(24, 35, 56, .12); }
.metric { min-height: 84px; padding: 17px 22px; border-right: 1px solid rgba(255,255,255,.1); display: grid; grid-template-columns: 1fr auto; align-content: center; }
.metric:last-child { border-right: 0; }
.metric > span { color: #9da9ba; font-size: 10px; font-weight: 600; }
.metric strong { grid-row: span 2; font-size: 25px; letter-spacing: -.04em; }
.metric small { margin-top: 7px; color: #778599; font-size: 9px; }
.status-metric strong { display: flex; align-items: center; gap: 8px; font-size: 16px; color: #c4cbd4; }
.status-metric strong i { width: 8px; height: 8px; background: #778599; border-radius: 50%; }
.status-metric strong.passed { color: var(--lime); }
.status-metric strong.passed i { background: var(--lime); box-shadow: 0 0 0 4px rgba(199,240,91,.12); }
.status-metric strong.failed { color: #ff8d76; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 2px 8px rgba(24, 35, 56, .025); }
.workbench { display: grid; grid-template-columns: 256px minmax(420px, 1fr) 245px; min-height: 535px; margin-bottom: 15px; }
.workbench > .panel { border-radius: 0; margin-right: -1px; }
.workbench > .panel:first-child { border-radius: 10px 0 0 10px; }
.workbench > .panel:last-child { border-radius: 0 10px 10px 0; margin-right: 0; }
.panel-title { min-height: 70px; padding: 17px 18px 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e5e8ec; }
.panel-title h2 { margin: 4px 0 0; font-size: 14px; letter-spacing: -.025em; }
.count-badge { min-width: 26px; height: 23px; display: grid; place-items: center; background: #eef1f4; color: #566273; border-radius: 12px; font-family: "DM Mono", monospace; font-size: 10px; }

.queue-panel { display: flex; flex-direction: column; }
.dropzone { margin: 14px; min-height: 91px; border: 1px dashed #cbd2db; border-radius: 8px; display: grid; grid-template-columns: 38px 1fr; grid-template-rows: 1fr 1fr; align-items: center; padding: 14px; cursor: pointer; background: #fafbfc; transition: .18s ease; }
.dropzone:hover, .dropzone.dragging { border-color: #78963b; background: #f8fce9; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.drop-icon { grid-row: span 2; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: #edf1f4; color: #546170; }
.dropzone b { align-self: end; font-size: 11px; }
.dropzone small { align-self: start; margin-top: 4px; color: #8a95a2; font-size: 8px; }
.queue-list { padding: 0 9px 10px; flex: 1; min-height: 210px; max-height: 330px; overflow: auto; }
.queue-item { width: 100%; min-height: 63px; padding: 8px; border: 1px solid transparent; background: transparent; border-radius: 7px; display: grid; grid-template-columns: 20px 58px minmax(0, 1fr); align-items: center; gap: 7px; cursor: pointer; text-align: left; position: relative; }
.queue-item:hover { background: #f7f9fa; }
.queue-item.active { background: #f3f7e7; border-color: #c9dd93; }
.queue-number { color: #9aa3ae; font-family: "DM Mono", monospace; font-size: 8px; }
.thumb-slot canvas { width: 58px; height: 42px; object-fit: cover; border-radius: 4px; display: block; }
.queue-copy { min-width: 0; align-self: center; }
.queue-copy b, .queue-copy small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-copy b { font-size: 9px; margin-bottom: 5px; }
.queue-copy small { color: #87919d; font-family: "DM Mono", monospace; font-size: 7px; }
.queue-item .done, .queue-item .waiting { position: absolute; right: 8px; bottom: 4px; display: flex; align-items: center; gap: 2px; font-size: 7px; }
.queue-item .done { color: #338b5e; }
.queue-item .waiting { color: #9ba4af; }
.privacy-note { margin: 0 14px 14px; padding: 10px; display: flex; align-items: flex-start; gap: 8px; background: #f4f7f9; color: #7c8794; border-radius: 7px; font-size: 8px; line-height: 1.5; }
.privacy-note .icon { color: #3b9769; }
.privacy-note b { color: #52606f; }

.viewer-panel { min-width: 0; }
.viewer-title { padding-left: 21px; }
.switch-row { display: flex; align-items: center; gap: 7px; color: #697586; font-size: 9px; font-weight: 600; cursor: pointer; }
.switch-row input { position: absolute; opacity: 0; }
.switch { width: 28px; height: 16px; padding: 2px; background: #c9d0d8; border-radius: 12px; transition: .2s; }
.switch::after { content: ""; display: block; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch-row input:checked + .switch { background: #25334a; }
.switch-row input:checked + .switch::after { transform: translateX(12px); }
.comparison { display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); align-items: center; padding: 21px 19px 13px; }
.comparison-arrow { width: 23px; height: 23px; display: grid; place-items: center; justify-self: center; color: #86909d; background: #f0f2f4; border-radius: 50%; }
.image-card { min-width: 0; border: 1px solid #dfe3e8; border-radius: 7px; overflow: hidden; background: #f6f7f8; }
.image-label { height: 35px; padding: 0 11px; display: flex; align-items: center; justify-content: space-between; background: #fff; border-bottom: 1px solid #e6e9ed; }
.image-label span { font-size: 9px; font-weight: 700; }
.image-label small { color: #8a95a1; font-family: "DM Mono", monospace; font-size: 7px; }
.canvas-wrap { aspect-ratio: 360 / 220; min-height: 170px; display: grid; place-items: center; background-color: #e7e9eb; background-image: linear-gradient(45deg,#dfe2e5 25%,transparent 25%),linear-gradient(-45deg,#dfe2e5 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#dfe2e5 75%),linear-gradient(-45deg,transparent 75%,#dfe2e5 75%); background-size: 14px 14px; background-position: 0 0,0 7px,7px -7px,-7px 0; }
.canvas-wrap canvas { width: 100%; height: 100%; object-fit: contain; display: block; }
.empty-output { display: flex; flex-direction: column; align-items: center; gap: 8px; color: #98a1ab; text-align: center; font-size: 9px; line-height: 1.5; }
.legend { margin: 0 20px; min-height: 47px; padding: 10px 12px; display: flex; align-items: center; gap: 22px; border: 1px solid #e6e9ed; border-radius: 7px; }
.legend span { display: grid; grid-template-columns: 7px 1fr; column-gap: 6px; align-items: center; font-size: 8px; font-weight: 700; }
.legend i { width: 7px; height: 7px; background: var(--legend); border-radius: 2px; grid-row: span 2; }
.legend small { color: #99a2ad; font-family: "DM Mono", monospace; font-size: 6px; font-weight: 400; }
.viewer-actions { min-height: 56px; padding: 0 21px; display: flex; align-items: center; justify-content: space-between; color: #758190; font-size: 8px; }
.summary-check { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 4px; color: #2b9361; background: #e7f5ed; border-radius: 50%; vertical-align: middle; }
.text-button { border: 0; background: transparent; display: inline-flex; align-items: center; gap: 6px; color: #485566; font-size: 9px; font-weight: 700; cursor: pointer; padding: 7px; border-radius: 6px; }
.text-button:hover { background: #f0f3f5; }
.text-button:disabled { opacity: .4; cursor: not-allowed; }

.settings-panel > .panel-title > .icon { color: #83909e; }
.setting-block { margin: 0 17px; padding: 18px 0; border-bottom: 1px solid #e8ebee; }
.setting-block:last-child { border-bottom: 0; }
.setting-block > label { display: flex; justify-content: space-between; color: #596677; font-size: 9px; font-weight: 700; }
.setting-block output { color: #1e2a3d; font-family: "DM Mono", monospace; font-weight: 500; }
.setting-block input[type="range"] { width: 100%; height: 3px; margin: 19px 0 7px; appearance: none; background: linear-gradient(90deg, var(--navy) 0 40%, #dfe4e8 40%); border-radius: 2px; }
.setting-block input[type="range"]::-webkit-slider-thumb { appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--lime); border: 3px solid var(--navy); cursor: pointer; }
.range-labels { display: flex; justify-content: space-between; color: #a0a8b2; font-family: "DM Mono", monospace; font-size: 7px; }
.setting-block p { margin: 11px 0 0; color: #929ba6; font-size: 8px; line-height: 1.5; }
.fixed-mask { margin-top: 11px; padding: 9px; border: 1px solid #dfe4e8; border-radius: 7px; display: grid; grid-template-columns: 27px 1fr auto; gap: 9px; align-items: center; }
.fixed-mask > span { width: 27px; height: 27px; background: #121826; border-radius: 5px; }
.fixed-mask div { display: flex; flex-direction: column; }
.fixed-mask b { font-size: 8px; }
.fixed-mask small { margin-top: 3px; color: #929ca7; font-family: "DM Mono", monospace; font-size: 6px; }
.fixed-mask .icon { color: #3d9568; }
.model-list > div { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 7px; margin-top: 12px; color: #687486; font-size: 8px; }
.model-list i { width: 7px; height: 7px; border-radius: 2px; }
.face-dot { background: #ef7c55; }.plate-dot { background: #3f82f7; }.text-dot { background: #8b65d8; }
.model-list b { color: #8b95a1; font-family: "DM Mono", monospace; font-size: 6px; font-weight: 500; }
.coordinate-info { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
.coordinate-info label { grid-column: span 2; }
.coordinate-info code { color: #304052; font-family: "DM Mono", monospace; font-size: 7px; }
.coordinate-info span { color: #949da8; font-size: 7px; text-align: right; }

.results-grid { display: grid; grid-template-columns: 1.45fr .85fr; gap: 15px; }
.results-grid .panel-title { min-height: 66px; }
.table-wrap { overflow: auto; max-height: 300px; }
table { width: 100%; border-collapse: collapse; }
th { height: 37px; padding: 0 16px; color: #929ca8; background: #f8f9fa; border-bottom: 1px solid #e4e8ec; text-align: left; font-size: 7px; letter-spacing: .04em; white-space: nowrap; }
td { height: 45px; padding: 7px 16px; border-bottom: 1px solid #edf0f2; color: #566273; font-size: 8px; }
td code { font-family: "DM Mono", monospace; font-size: 7px; color: #465364; }
.empty-row { height: 140px; text-align: center; color: #9aa3ad; }
.type-pill, .status-pill { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.type-pill i { width: 6px; height: 6px; border-radius: 2px; }
.type-pill.face i { background: #ef7c55; }.type-pill.license_plate i { background: #3f82f7; }.type-pill.company_text i { background: #8b65d8; }
.ocr-value { display: block; margin: 3px 0 0 11px; color: #8a65c4; font-family: "DM Mono", monospace; font-size: 6px; }
.status-pill { padding: 4px 7px; color: #287b54; background: #eaf6ef; border-radius: 10px; font-size: 7px; }
.validation-empty { min-height: 232px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #788494; text-align: center; }
.report-orb { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 10px; color: #526172; background: #eef1f4; border-radius: 50%; }
.validation-empty b { font-size: 10px; }
.validation-empty p { color: #9aa2ad; font-size: 8px; }
.validation-content { padding: 14px 17px 15px; }
.validation-head { min-height: 53px; padding: 8px 10px; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 9px; background: #f3f8ec; border: 1px solid #dae9b8; border-radius: 7px; }
.validation-head .report-orb { width: 32px; height: 32px; margin: 0; color: #397552; background: #dff0dc; }
.validation-head div { display: flex; flex-direction: column; }
.validation-head b { font-size: 9px; }
.validation-head small { margin-top: 3px; color: #758573; font-size: 7px; }
.validation-head code { color: #58715b; font-family: "DM Mono", monospace; font-size: 7px; }
.validation-head.failed { background: #fff3f0; border-color: #f2c9c0; }
.validation-table { margin-top: 11px; border: 1px solid #e5e9ed; border-radius: 6px; overflow: hidden; }
.validation-tr { min-height: 31px; padding: 0 9px; display: grid; grid-template-columns: 1.7fr repeat(4, .65fr); align-items: center; border-bottom: 1px solid #edf0f2; color: #697586; font-size: 7px; text-align: center; }
.validation-tr:last-child { border-bottom: 0; }
.validation-tr.header { min-height: 26px; color: #929ca7; background: #f8f9fa; font-size: 6px; }
.validation-tr span:first-child { text-align: left; }
.validation-tr i { width: 6px; height: 6px; display: inline-block; margin-right: 6px; background: var(--row); border-radius: 2px; }
.good { color: #258057; }.bad { color: #d95943; }
.integrity-row { min-height: 30px; padding: 0 4px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #edf0f2; color: #7b8693; font-size: 7px; }

.faq-panel { margin-top: 15px; }
.faq-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.faq-grid article { min-height: 104px; padding: 18px 20px; border-right: 1px solid #e8ebee; }
.faq-grid article:last-child { border-right: 0; }
.faq-grid h3 { margin: 0 0 8px; color: #354254; font-size: 10px; line-height: 1.45; }
.faq-grid p { margin: 0; color: #7e8997; font-size: 8px; line-height: 1.7; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; max-width: calc(100% - 32px); padding: 11px 16px; color: #fff; background: #172033; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.22); font-size: 10px; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: .22s ease; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1120px) {
  .workbench { grid-template-columns: 225px minmax(390px, 1fr); }
  .settings-panel { grid-column: span 2; display: grid; grid-template-columns: 220px repeat(4, 1fr); align-items: stretch; }
  .workbench > .panel:last-child { border-radius: 0 0 10px 10px; grid-column: span 2; }
  .settings-panel .panel-title { border-bottom: 0; border-right: 1px solid #e5e8ec; }
  .settings-panel .setting-block { margin: 0; padding: 17px; border-bottom: 0; border-right: 1px solid #e8ebee; }
  .coordinate-info { display: none; }
}

@media (max-width: 820px) {
  .topbar { height: 62px; padding: 0 16px; }
  .brand small, .local-badge, .button.ghost { display: none; }
  .page-shell { width: min(100% - 24px, 700px); padding-top: 22px; }
  .hero-row { align-items: flex-start; gap: 18px; }
  .hero-row p, .last-run { display: none; }
  h1 { font-size: 21px; }
  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid rgba(255,255,255,.1); }
  .workbench { display: block; }
  .workbench > .panel, .workbench > .panel:first-child, .workbench > .panel:last-child { border-radius: 9px; margin: 0 0 12px; }
  .queue-list { display: flex; overflow-x: auto; min-height: auto; }
  .queue-item { min-width: 220px; }
  .privacy-note { display: none; }
  .settings-panel { display: grid; grid-template-columns: repeat(2, 1fr); }
  .settings-panel .panel-title { grid-column: span 2; border-right: 0; border-bottom: 1px solid #e5e8ec; }
  .settings-panel .setting-block { border-bottom: 1px solid #e8ebee; }
  .results-grid { grid-template-columns: 1fr; }
  .faq-grid { grid-template-columns: 1fr; }
  .faq-grid article { min-height: auto; border-right: 0; border-bottom: 1px solid #e8ebee; }
  .faq-grid article:last-child { border-bottom: 0; }
}

@media (max-width: 560px) {
  .top-actions .button.dark { width: 39px; padding: 0; font-size: 0; }
  .hero-row { display: block; }
  .run-area { margin-top: 15px; }
  .button.run { width: 100%; }
  .metric { padding: 14px; }
  .comparison { grid-template-columns: 1fr; gap: 10px; }
  .comparison-arrow { transform: rotate(90deg); }
  .canvas-wrap { min-height: 150px; }
  .legend { gap: 12px; overflow-x: auto; }
  .settings-panel { display: block; }
  .settings-panel .panel-title { display: flex; }
  .settings-panel .setting-block { border-right: 0; }
  .table-wrap { max-width: calc(100vw - 26px); }
}
