:root {
  color-scheme: dark;
  --bg: #07101d;
  --panel: rgba(15, 28, 45, .82);
  --panel-strong: #12243a;
  --line: rgba(155, 194, 223, .17);
  --text: #edf7ff;
  --muted: #9bb0c2;
  --cyan: #57e6d0;
  --blue: #77a8ff;
  --warning: #ffc66b;
  --danger: #ff7d89;
  --success: #6ee7a7;
  --shadow: 0 22px 70px rgba(0, 0, 0, .28);
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, Pretendard, "Noto Sans KR", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(circle at 12% 0%, rgba(53, 116, 167, .23), transparent 34rem),
    radial-gradient(circle at 88% 12%, rgba(35, 178, 160, .13), transparent 29rem),
    linear-gradient(160deg, #07101d, #091522 58%, #07101d);
}
button, select, input { font: inherit; }
button, select { color: inherit; }
.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 70px 0 40px; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 42px; align-items: end; margin-bottom: 38px; }
.eyebrow, .section-kicker { margin: 0 0 10px; color: var(--cyan); font-size: .72rem; font-weight: 800; letter-spacing: .2em; }
h1 { margin: 0; max-width: 820px; font-size: clamp(2.25rem, 5vw, 4.8rem); line-height: 1.03; letter-spacing: -.055em; }
h1 span { color: transparent; background: linear-gradient(90deg, var(--cyan), var(--blue)); background-clip: text; -webkit-background-clip: text; }
.hero-copy { max-width: 720px; margin: 22px 0 0; color: var(--muted); font-size: 1.02rem; line-height: 1.75; }
.hero-badges { display: flex; max-width: 240px; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.hero-badges span { padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; background: rgba(17, 37, 57, .7); color: #bed0df; font-size: .72rem; white-space: nowrap; }
.panel { margin-top: 18px; padding: 28px; border: 1px solid var(--line); border-radius: 22px; background: var(--panel); box-shadow: var(--shadow); backdrop-filter: blur(20px); }
.drop-zone { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; min-height: 130px; padding: 24px; border: 1px dashed rgba(87, 230, 208, .38); border-radius: 17px; background: rgba(18, 41, 59, .43); cursor: pointer; transition: .2s ease; outline: none; }
.drop-zone:hover, .drop-zone:focus-visible, .drop-zone.dragging { border-color: var(--cyan); background: rgba(26, 67, 78, .52); transform: translateY(-1px); }
.drop-icon { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 15px; color: #061716; background: var(--cyan); font-size: 1.8rem; font-weight: 900; }
.drop-zone h2 { margin: 0 0 7px; font-size: 1.18rem; }
.drop-zone p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.5; }
.upload-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; min-width: 184px; }
.upload-actions .button { grid-column: 1 / -1; }
.sample-button { min-height: 31px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: rgba(8, 22, 36, .72); font-size: .67rem; cursor: pointer; }
.sample-button:hover { color: var(--cyan); border-color: rgba(87, 230, 208, .45); }
.file-meta { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: rgba(4, 14, 25, .55); color: #bdd0de; font-size: .84rem; overflow-wrap: anywhere; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.section-head h2 { margin: 0; font-size: 1.5rem; letter-spacing: -.025em; }
.confidence-badge { padding: 8px 12px; border-radius: 999px; font-size: .78rem; font-weight: 750; background: rgba(119, 168, 255, .13); color: var(--blue); }
.confidence-badge.high { color: var(--success); background: rgba(110, 231, 167, .12); }
.confidence-badge.low { color: var(--warning); background: rgba(255, 198, 107, .12); }
.confidence-badge.idle { color: var(--muted); }
.summary { color: #d6e7f2; line-height: 1.65; }
.summary strong { color: var(--cyan); }
.confidence-track { height: 4px; margin: 17px 0 23px; overflow: hidden; border-radius: 99px; background: rgba(140, 171, 197, .13); }
.confidence-track div { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--cyan)); transition: width .35s ease; }
.candidate-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.candidate-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 15px; color: inherit; text-align: left; background: rgba(6, 17, 29, .58); cursor: pointer; transition: .18s ease; }
.candidate-card:hover, .candidate-card:focus-visible { border-color: rgba(119, 168, 255, .55); transform: translateY(-2px); outline: none; }
.candidate-card.active { border-color: var(--cyan); box-shadow: inset 0 0 0 1px rgba(87, 230, 208, .25); background: rgba(21, 57, 65, .42); }
.candidate-title { display: flex; align-items: start; justify-content: space-between; gap: 10px; font-size: .87rem; font-weight: 750; }
.candidate-score { color: var(--cyan); font-variant-numeric: tabular-nums; }
.candidate-reasons { min-height: 34px; margin: 9px 0; color: var(--muted); font-size: .7rem; line-height: 1.45; }
.candidate-card pre { height: 92px; margin: 0; overflow: hidden; color: #c6d6e1; font: .74rem/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; word-break: break-all; mask-image: linear-gradient(#000 70%, transparent); }
.empty { grid-column: 1 / -1; padding: 24px; color: var(--muted); text-align: center; border: 1px dashed var(--line); border-radius: 14px; }
.control-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: end; }
.field { display: grid; gap: 8px; }
.field span { color: #b9cedd; font-size: .78rem; font-weight: 700; }
select { width: 100%; min-height: 48px; padding: 0 42px 0 13px; border: 1px solid var(--line); border-radius: 12px; background: #0b1929; }
select:focus-visible { border-color: var(--cyan); outline: 2px solid rgba(87, 230, 208, .16); }
select:disabled { opacity: .5; }
.arrow { padding-bottom: 13px; color: var(--cyan); font-size: 1.25rem; }
.loss-toggle { display: flex; align-items: center; gap: 9px; width: fit-content; margin-top: 17px; color: var(--muted); font-size: .78rem; cursor: pointer; }
.loss-toggle input { width: 17px; height: 17px; accent-color: var(--cyan); }
.actions { display: flex; gap: 10px; margin-top: 22px; }
.button { min-height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: 11px; font-weight: 780; cursor: pointer; transition: .18s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.08); }
.button:disabled { opacity: .42; cursor: not-allowed; }
.button.primary { color: #061817; background: linear-gradient(125deg, var(--cyan), #7cf0bd); }
.button.secondary { border-color: var(--line); background: rgba(18, 39, 60, .83); }
.conversion-meta { min-height: 20px; margin-top: 15px; color: #bfd2df; font-size: .82rem; line-height: 1.55; }
.conversion-meta.error { color: var(--danger); }
.conversion-meta.warning { color: var(--warning); }
.conversion-meta.success { color: var(--success); }
.preview-head { margin-bottom: 14px; }
.preview-meta { max-width: 58%; color: var(--muted); font-size: .76rem; text-align: right; }
#mainPreview { min-height: 260px; max-height: 620px; margin: 0; padding: 20px; overflow: auto; border: 1px solid var(--line); border-radius: 14px; color: #d8e5ee; background: #06111e; font: .82rem/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.diagnostics summary { cursor: pointer; font-weight: 750; }
.diagnostic-intro { color: var(--muted); font-size: .8rem; line-height: 1.6; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .76rem; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-weight: 700; }
.log-area { max-height: 210px; margin-top: 18px; overflow: auto; border-radius: 12px; background: #06111e; }
.log-line { padding: 8px 11px; border-bottom: 1px solid rgba(155, 194, 223, .08); color: #a9bdcc; font: .72rem/1.5 ui-monospace, monospace; }
.log-line.warn { color: var(--warning); } .log-line.error { color: var(--danger); } .log-line.success { color: var(--success); }
footer { padding: 28px 0 4px; color: #6f8799; font-size: .72rem; text-align: center; }
@media (max-width: 820px) {
  .shell { width: min(100% - 20px, 680px); padding-top: 34px; }
  .hero { grid-template-columns: 1fr; gap: 20px; }
  .hero-badges { max-width: none; justify-content: flex-start; }
  .candidate-grid { grid-template-columns: 1fr 1fr; }
  .panel { padding: 20px; border-radius: 17px; }
}
@media (max-width: 560px) {
  .drop-zone { grid-template-columns: auto 1fr; }
  .upload-actions { grid-column: 1 / -1; width: 100%; }
  h1 { font-size: 1.9rem; }
  .candidate-grid, .control-grid { grid-template-columns: 1fr; }
  .arrow { display: none; }
  .actions { flex-direction: column; }
  .actions .button { width: 100%; }
  .preview-meta { max-width: 52%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
