/* 화면에 남기는 것은 셋뿐 — 파일 놓는 자리, 실행, 다운로드. */
:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #e2e5ea;
  --line-soft: #eef0f4;
  --text: #10131a;
  --muted: #6b7280;
  /* 글로벌탑넷 로고 색 */
  --accent: #3a62a6;      /* 로고에서 뽑은 파랑 */
  --accent-dark: #31538d;
  --go: #009fbf;          /* 로고에서 뽑은 청록 */
  --go-dark: #0087a3;
  --ok: #1a7f5a;
  --warn: #9a6700;
  --err: #c0392b;
  --radius: 12px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic",
               "Noto Sans KR", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* --- 뼈대: 가운데 무대 + 오른쪽 사이드바 --- */
.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  height: 100%;
}

.stage {
  padding: 40px 44px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  overflow-y: auto;
}

.side {
  background: var(--panel);
  border-left: 1px solid var(--line);
  padding: 32px 24px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; height: auto; }
  .side { border-left: 0; border-top: 1px solid var(--line); }
  .stage { padding: 24px 18px; }
}

/* --- 양식 탭 --- */
.tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0;
  flex-wrap: wrap;
}
.tabs:empty { display: none; }
.tab {
  border: 1px solid transparent;
  border-bottom: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 10px 10px 0 0;
  margin-bottom: -1px;
}
.tab:hover { color: var(--text); background: #eef1f6; }
.tab[aria-selected="true"] {
  background: var(--panel);
  border-color: var(--line);
  border-bottom: 1px solid var(--panel);
  color: var(--accent);
}
.tab .count {
  display: inline-block;
  margin-left: 6px;
  min-width: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  line-height: 17px;
  text-align: center;
}
.tab[aria-selected="false"] .count { background: #b9c0cc; }
.tab .count:empty { display: none; }

/* --- 파일 놓는 자리 --- */
.drop {
  flex: 1;
  min-height: 340px;
  border: 2px dashed #cfd4dc;
  border-radius: 20px;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 40px 24px;
  transition: border-color .14s, background .14s, transform .14s;
}
.drop.over {
  border-color: var(--accent);
  background: #f4f7fc;
  transform: scale(1.006);
}
.drop-icon {
  width: 54px; height: 54px;
  fill: none; stroke: #b9c0cc; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.drop.over .drop-icon { stroke: var(--accent); }
.drop-title { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.2px; }
.drop-hint { margin: 0; font-size: 13px; color: var(--muted); }

/* --- 버튼 --- */
button {
  font: inherit;
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 9px 16px;
  transition: background .12s, opacity .12s;
}
button:disabled { cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-dark); }
.btn-primary:disabled { background: #d7d9de; border-color: #d7d9de; color: #fff; }

.btn-download {
  background: var(--go);
  border-color: var(--go);
  color: #fff;
  font-weight: 700;
}
.btn-download:hover:not(:disabled) { background: var(--go-dark); }
.btn-download:disabled { background: #e6e8ec; border-color: #e6e8ec; color: #a5abb6; }

.btn-lg { padding: 12px 26px; font-size: 16px; border-radius: 999px; }
.btn-block { display: block; width: 100%; padding: 14px 18px; font-size: 16px; }

.link {
  border: 0; background: transparent; color: var(--muted);
  font-size: 13px; padding: 6px; width: 100%;
}
.link:hover { color: var(--text); text-decoration: underline; }

/* --- 파일 목록 --- */
.files { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.files:empty { display: none; }
.files li {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.files .name {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 14px;
}
.files .meta { font-size: 12px; color: var(--muted); white-space: nowrap; }
.files .state { font-size: 12px; white-space: nowrap; }
.files .state.ok { color: var(--ok); font-weight: 600; }
.files .state.warn { color: var(--warn); font-weight: 600; }
.files .state.err { color: var(--err); font-weight: 600; }
.files .remove {
  border: 0; background: transparent; color: #aab0ba;
  padding: 2px 4px; font-size: 18px; line-height: 1; border-radius: 6px;
}
.files .remove:hover { color: var(--err); background: var(--line-soft); }
.files .save { padding: 6px 12px; font-size: 13px; }

/* --- 사이드바 --- */
.logo-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.logo { width: 34px; height: 34px; flex: none; }
.brand { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.2px; }
.brand-sub { margin: 0 0 22px; font-size: 13px; color: var(--muted); line-height: 1.6; }

.check {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 14px; cursor: pointer;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfbfc;
}
.check + .check { margin-top: 8px; }
.check:hover { border-color: #cfd4dc; }
.check input { margin: 2px 0 0; width: 16px; height: 16px; accent-color: var(--accent); }

.status {
  margin: 16px 0 0; font-size: 13px; color: var(--muted);
  background: var(--line-soft); border-radius: 10px; padding: 10px 12px;
}
.status.err { background: #fdecea; color: var(--err); }
.status.ok { background: #e7f6ef; color: var(--ok); }
.status.warn { background: #fff4ce; color: var(--warn); }

/* --- 처리 결과 로그 --- */
.log {
  margin-top: 14px; display: grid; gap: 8px;
  max-height: 46vh; overflow-y: auto; overflow-x: hidden;
  min-width: 0;
}
.log:empty { display: none; }
.log-item {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-left: 3px solid var(--go);
  border-radius: 10px;
  padding: 9px 11px;
  background: #fbfcfd;
}
.log-item.err { border-left-color: var(--err); }
.log-item.warn { border-left-color: var(--warn); }
.log-name {
  font-size: 12.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-bottom: 3px;
}
.log-line { font-size: 12px; color: var(--text); line-height: 1.5; }
.log-line.muted { color: var(--muted); }
.log-line.err { color: var(--err); }
.log-line.warn { color: var(--warn); }

.side-bottom { display: grid; gap: 10px; }

/* --- 진행률 --- */
.progress { height: 6px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width .18s; }

/* --- 토스트 --- */
.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  background: #22262e; color: #fff; padding: 12px 16px;
  border-radius: 10px; font-size: 14px; max-width: 380px;
  box-shadow: 0 6px 20px rgba(0,0,0,.2);
}
.toast.err { background: var(--err); }
.toast.ok { background: var(--ok); }
