:root{
  --navy:#0f2038;
  --navy-2:#16304f;
  --navy-3:#1e3d63;
  --gold:#c9a227;
  --gold-soft:#e5c76b;
  --bg:#f5f6f8;
  --surface:#ffffff;
  --line:#e2e6ec;
  --text:#1c2530;
  --muted:#66727f;
  --danger:#b3261e;
  --danger-bg:#fdeceb;
  --ok:#1b6b3a;
  --ok-bg:#eaf5ee;
  --radius:10px;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:"Malgun Gothic","맑은 고딕",-apple-system,"Apple SD Gothic Neo","Noto Sans KR",sans-serif;
  background:var(--bg); color:var(--text); font-size:15px; line-height:1.6;
}

/* ── 상단 ── */
.topbar{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  background:var(--navy); color:#fff; padding:14px 22px; flex-wrap:wrap;
  border-bottom:3px solid var(--gold);
}
.brand{display:flex; align-items:baseline; gap:12px}
.brand-mark{font-size:12px; letter-spacing:.18em; color:var(--gold-soft); font-weight:700}
.topbar h1{font-size:19px; margin:0; font-weight:700}
.privacy-badge{
  background:rgba(201,162,39,.15); border:1px solid var(--gold);
  color:var(--gold-soft); padding:6px 13px; border-radius:999px; font-size:13px; font-weight:600;
}

/* ── 레이아웃 ── */
.layout{display:flex; align-items:flex-start; min-height:calc(100vh - 60px)}
.sidebar{
  width:190px; flex:0 0 190px; background:var(--navy-2); min-height:calc(100vh - 60px);
  padding:12px 0;
}
.main{flex:1; min-width:0; padding:22px 26px 40px; max-width:960px}

.tab{
  display:flex; align-items:center; gap:9px; width:100%; text-align:left;
  background:none; border:0; border-left:3px solid transparent;
  color:#c8d3e0; padding:11px 16px; cursor:pointer; font-size:14px; font-family:inherit;
}
.tab:hover{background:var(--navy-3); color:#fff}
.tab.active{background:var(--navy-3); color:#fff; border-left-color:var(--gold); font-weight:700}
.tab .ico{font-size:15px; width:20px; text-align:center}

/* ── 카드 ── */
.feature-head{margin:0 0 16px}
.feature-head h2{margin:0 0 4px; font-size:22px}
.feature-head p{margin:0; color:var(--muted); font-size:14px}

.card{
  background:var(--surface); border:1px solid var(--line); border-radius:var(--radius);
  padding:16px 18px; margin-bottom:14px;
}
.card-title{margin:0 0 12px; font-size:13px; color:var(--muted); font-weight:700; letter-spacing:.02em}

.note{
  background:#fff8e1; border:1px solid #ecd9a0; border-left:4px solid var(--gold);
  border-radius:8px; padding:11px 14px; margin-bottom:14px; font-size:13.5px;
}

/* ── 드롭존 ── */
.dropzone{
  border:2px dashed #c3ccd8; border-radius:var(--radius); background:#fafbfc;
  padding:26px 16px; text-align:center; cursor:pointer; transition:.12s;
}
.dropzone:hover,.dropzone:focus{border-color:var(--gold); background:#fffdf5; outline:none}
.dropzone.over{border-color:var(--gold); background:#fff6dd}
.dz-icon{font-size:26px; color:var(--gold); line-height:1}
.dz-text{margin-top:6px; font-size:14px}
.dz-hint{margin-top:4px; font-size:12.5px; color:var(--muted)}

.filelist{list-style:none; margin:12px 0 0; padding:0}
.filelist li{
  display:flex; align-items:center; gap:10px; padding:8px 10px;
  border:1px solid var(--line); border-radius:8px; margin-bottom:6px; background:#fff; font-size:14px;
}
.filelist .fname{flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.filelist .fsize{color:var(--muted); font-size:12.5px; flex:0 0 auto}
.filelist .warn{color:var(--danger); font-size:12.5px; font-weight:700}
.filetools{display:flex; gap:8px; margin-top:10px}

/* ── 폼 ── */
.optrow{display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin-bottom:11px}
.optrow:last-child{margin-bottom:0}
.optrow > label.lbl{flex:0 0 118px; font-size:13.5px; color:var(--muted); font-weight:600}
.optrow .hint{font-size:12.5px; color:var(--muted); flex-basis:100%; margin-left:128px}
input[type=text],input[type=number],select{
  font-family:inherit; font-size:14px; padding:7px 10px;
  border:1px solid var(--line); border-radius:7px; background:#fff; color:var(--text);
}
input[type=text]{min-width:210px}
input[type=number]{width:92px}
input[type=file]{font-size:13px; font-family:inherit}
.radio,.check{display:inline-flex; align-items:center; gap:5px; font-size:14px; cursor:pointer}
.radio input,.check input{margin:0}

/* ── 버튼 ── */
.btn-primary{
  background:var(--navy); color:#fff; border:0; border-radius:8px;
  padding:11px 26px; font-size:15px; font-weight:700; cursor:pointer; font-family:inherit;
}
.btn-primary:hover{background:var(--navy-3)}
.btn-primary:disabled{background:#9aa5b1; cursor:not-allowed}
.btn-ghost{
  background:#fff; border:1px solid var(--line); border-radius:7px;
  padding:6px 12px; font-size:13px; cursor:pointer; font-family:inherit; color:var(--text);
}
.btn-ghost:hover{border-color:var(--gold); background:#fffdf5}
.run-card{display:flex; align-items:center; gap:16px; flex-wrap:wrap}

.progress{display:flex; align-items:center; gap:10px; flex:1; min-width:180px}
.progress-bar{flex:1; height:8px; background:#e8ebef; border-radius:99px; overflow:hidden}
.progress-bar i{display:block; height:100%; width:0; background:var(--gold); transition:width .15s}
.progress span{font-size:13px; color:var(--muted); flex:0 0 auto}

/* ── 알림 ── */
.banner{border-radius:8px; padding:12px 15px; margin-bottom:14px; font-size:14px; font-weight:600}
.banner.err{background:var(--danger-bg); border:1px solid #f0b7b3; color:var(--danger)}
.banner.ok{background:var(--ok-bg); border:1px solid #b8dcc6; color:var(--ok)}

.log{
  margin:0; font-family:Consolas,"D2Coding",monospace; font-size:12.5px; line-height:1.75;
  background:#fbfcfd; border:1px solid var(--line); border-radius:8px; padding:10px 12px;
  max-height:190px; overflow:auto; white-space:pre-wrap; word-break:break-all; color:#3a4553;
}

/* ── 결과 패널 ── */
#panel .preview{
  font-family:Consolas,"D2Coding",monospace; font-size:12.5px; white-space:pre-wrap;
  background:#fbfcfd; border:1px solid var(--line); border-radius:8px;
  padding:12px; max-height:340px; overflow:auto;
}
.info-table{width:100%; border-collapse:collapse; font-size:14px}
.info-table th,.info-table td{border-bottom:1px solid var(--line); padding:8px 6px; text-align:left; vertical-align:top}
.info-table th{width:150px; color:var(--muted); font-weight:600}

.thumbgrid{display:grid; grid-template-columns:repeat(auto-fill,minmax(148px,1fr)); gap:12px}
.thumb{border:1px solid var(--line); border-radius:8px; padding:7px; background:#fff; text-align:center}
.thumb.removed{opacity:.32; background:#f2f3f5}
.thumb canvas{max-width:100%; height:auto; border:1px solid #eceff3; display:block; margin:0 auto; background:#fff}
.thumb .tno{font-size:12px; color:var(--muted); margin:5px 0 4px}
.thumb .tbtns{display:flex; justify-content:center; gap:3px; flex-wrap:wrap}
.thumb .tbtns button{
  border:1px solid var(--line); background:#fff; border-radius:5px;
  font-size:12px; padding:2px 6px; cursor:pointer; line-height:1.4; font-family:inherit;
}
.thumb .tbtns button:hover{border-color:var(--gold); background:#fffdf5}

.foot{
  display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap;
  color:var(--muted); font-size:12.5px; margin-top:20px; padding-top:12px; border-top:1px solid var(--line);
}
.hidden{display:none !important}

@media (max-width:760px){
  .layout{flex-direction:column}
  .sidebar{width:100%; flex:none; min-height:0; display:flex; overflow-x:auto; padding:0}
  .tab{width:auto; white-space:nowrap; border-left:0; border-bottom:3px solid transparent}
  .tab.active{border-left:0; border-bottom-color:var(--gold)}
  .main{padding:16px}
  .optrow > label.lbl{flex-basis:100%}
  .optrow .hint{margin-left:0}
}
