* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: #eef1f5;
  font-family: "Malgun Gothic", "맑은 고딕", Arial, sans-serif;
  font-size: 14px;
  color: #222;
}

.wrap { max-width: 720px; margin: 0 auto; padding: 40px 12px; }

.card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  padding: 24px 28px;
  margin-bottom: 16px;
}

h1 { font-size: 20px; margin: 0 0 4px; }

.privacy-note { margin: 0 0 18px; color: #667; font-size: 12.5px; }

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  flex-wrap: wrap;
}

.row-label { width: 100px; flex-shrink: 0; font-weight: 600; }

input[type="text"] {
  padding: 6px 8px;
  border: 1px solid #bbb;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  min-width: 0;
}

input[type="text"]:read-only { background: #f7f7f7; }

.sub-note { color: #667; font-size: 12.5px; margin: 4px 0 12px; }

.hint { margin: 2px 0 12px; color: #0066cc; font-size: 12.5px; font-weight: 600; }

button {
  padding: 8px 14px;
  border: 1px solid #aaa;
  border-radius: 4px;
  background: #f7f7f7;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
}

button:hover:not(:disabled) { background: #ececec; }
button:disabled { opacity: 0.5; cursor: default; }

button.primary {
  background: #4caf50;
  border-color: #43a047;
  color: #fff;
  font-weight: 600;
  padding-inline: 22px;
}

button.primary:hover:not(:disabled) { background: #43a047; }

.btn-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 16px 0 4px;
  flex-wrap: wrap;
}

button:focus-visible, input:focus-visible { outline: 3px solid #176fb5; outline-offset: 3px; }

/* ---------- 상태 ---------- */
.status-row { margin: 0 0 6px; }
#status { flex: 1; margin: 0; font-weight: 600; min-height: 32px; display: flex; align-items: center; }

.spinner {
  display: inline-block;
  flex-shrink: 0;
  width: 11px;
  height: 11px;
  margin-right: 6px;
  vertical-align: -1px;
  border: 2px solid #c8e6c9;
  border-top-color: #2e7d32;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
.status-wait { color: #1565c0; }
.status-run { color: #2e7d32; }

#notice {
  margin: 12px 0 0;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 600;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.notice-success { color: #1b5e20; background: #e8f5e9; border-color: #a5d6a7; }
.notice-error { color: #b71c1c; background: #fdecea; border-color: #ef9a9a; }
.notice-warn { color: #7a4f01; background: #fff4e5; border-color: #ffcc80; }

section { padding: 14px 0 4px; border-top: 1px solid #e6e9ee; }

#joinCode { width: 150px; font-family: monospace; font-size: 16px; letter-spacing: 3px; }

/* 코드·링크: 어느 쪽을 전달해도 되는 동급 값이므로 나란히 배치 */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pair .row-label { width: auto; display: block; margin-bottom: 2px; }
.pair .row { margin: 0; flex-wrap: nowrap; }
.pair input { flex: 1; }
#code { flex: 1; padding: 6px 8px; border: 1px solid #bbb; border-radius: 4px; background: #f7f7f7; font-family: monospace; font-size: 18px; letter-spacing: 2px; }
#code span + span { margin-left: 14px; }

#verificationCode { display: block; font-family: monospace; font-size: 26px; letter-spacing: 2px; text-align: center; padding: 12px 0; }

/* ---------- 전송 ---------- */
#fileInput { flex: 1; min-width: 160px; }

.list-head { justify-content: space-between; margin: 0 0 6px; }
.list-head .row-label { width: auto; }

.progress-track { height: 8px; background: #e3e6ea; border-radius: 4px; overflow: hidden; }
.file-table .progress-track { margin-top: 4px; min-width: 80px; }
.file-table .spinner { margin-right: 4px; }
.progress-bar { height: 100%; width: 0; background: #4caf50; transition: width 0.15s; }

/* ---------- 파일 목록 ---------- */
#fileListWrap { overflow-x: auto; } /* 좁은 화면에서 표가 카드 밖으로 넘치지 않게 */
.file-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  font-size: 13px;
}

.file-table th, .file-table td {
  padding: 5px 8px;
  border-bottom: 1px solid #e6e9ee;
  text-align: left;
  vertical-align: middle;
}

.file-table th { color: #556; background: #f5f7fa; white-space: nowrap; }
.file-table td { overflow-wrap: anywhere; }
.col-dir, .col-act, .file-table td:first-child, .file-table td:last-child { width: 1%; white-space: nowrap; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 8px; font-size: 12px; white-space: nowrap; }
.badge-send { background: #e3f2fd; color: #0d47a1; }
.badge-receive { background: #e8f5e9; color: #1b5e20; }

.row-btn, .row-btn.primary { padding: 1px 7px; font-size: 12px; margin-right: 4px; }
.row-btn:last-child { margin-right: 0; }
.st-done { color: #2e7d32; }
.st-stop { color: #7a4f01; }

.dl-btn { padding: 1px 7px; font-size: 12px; margin-right: 4px; }
.del-btn { padding: 1px 7px; font-size: 12px; }

/* ---------- 안내 ---------- */
.guide { font-size: 13px; line-height: 1.7; color: #444; }
.guide h2 { font-size: 15px; margin: 0 0 8px; color: #222; }
.guide ol, .guide ul { margin: 0; padding-left: 20px; }
.guide dl { margin: 0; }
.guide dt { font-weight: 600; margin-top: 8px; }
.guide dd { margin: 2px 0 0 0; color: #555; }

footer { margin-top: 28px; text-align: center; color: #667; font-size: 12px; }
footer a { color: inherit; }

header.site h1 { font-size: 26px; margin: 0 0 28px; }
header.site h1 a { color: inherit; text-decoration: none; }

[hidden] { display: none !important; }

@media (max-width: 520px) {
  .card { padding: 18px; }
  .pair { grid-template-columns: 1fr; }
  .row-label { width: auto; }
}
