:root {
  --bg: #ffffff; --fg: #0a0a0a; --muted: #6b6b6b; --line: #e3e3e3; --soft: #f5f5f5;
  --accent: #0a0a0a; --accent-fg: #ffffff; --danger: #d0261b; --ok: #16803c;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0a0a0a; --fg: #f2f2f2; --muted: #8c8c8c; --line: #262626; --soft: #151515;
    --accent: #f2f2f2; --accent-fg: #0a0a0a; --danger: #ff5a4e; --ok: #3ccf6e; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--sans); }
body { min-height: 100vh; min-height: 100dvh; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.brand { font-family: var(--mono); font-weight: 600; letter-spacing: -0.02em; }
.brand b { color: var(--muted); font-weight: 600; }

/* ---------- 메인 ---------- */
.center { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; gap: 28px; text-align: center; }
.center.inner { min-height: 0; padding: 0; }
.center .brand { font-size: clamp(22px, 3vw, 30px); }
.label { font-family: var(--mono); font-size: 13px; letter-spacing: 0.24em; color: var(--muted); }
.code { display: flex; gap: clamp(8px, 1.6vw, 16px); }
.code input {
  width: clamp(60px, 11vw, 104px); height: clamp(80px, 14vw, 132px);
  font-family: var(--mono); font-size: clamp(40px, 7vw, 76px); font-weight: 600; text-align: center;
  border: 2px solid var(--line); border-radius: 14px; background: var(--soft); outline: none; caret-color: transparent;
}
.code input:focus { border-color: var(--fg); background: var(--bg); }
.code.error input { border-color: var(--danger); }
.btn {
  min-width: 240px; padding: 18px 28px; border: 2px solid var(--fg); border-radius: 14px;
  background: var(--accent); color: var(--accent-fg); font-family: var(--mono); font-size: 20px; font-weight: 700; letter-spacing: 0.12em;
}
.btn:focus-visible { outline: 3px solid var(--fg); outline-offset: 4px; }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn:disabled { opacity: .45; cursor: default; }
.msg { min-height: 22px; font-size: 15px; color: var(--muted); }
.msg.error { color: var(--danger); }
.result { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.result .fname { font-size: clamp(20px, 3vw, 30px); font-weight: 700; word-break: break-all; max-width: 90vw; }
.result .fsize { font-family: var(--mono); color: var(--muted); }
.result .btn.big { font-size: 26px; padding: 24px 48px; margin-top: 12px; }
.hint { font-size: 13px; color: var(--muted); font-family: var(--mono); }
kbd { font-family: var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; font-size: 12px; }
footer.note { position: fixed; bottom: 12px; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--muted); padding: 0 16px; }

/* ---------- 관리자 ---------- */
.wrap { max-width: 980px; margin: 0 auto; padding: 24px 16px 80px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.top .brand { font-size: 20px; }
.card { border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-bottom: 16px; background: var(--bg); }
.card h2 { margin: 0 0 14px; font-size: 13px; font-family: var(--mono); letter-spacing: .16em; color: var(--muted); font-weight: 600; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.field input, .field select { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); min-width: 140px; font-size: 16px; color: var(--fg); }
.field input:focus, .field select:focus { outline: 2px solid var(--fg); outline-offset: -1px; }
.drop { border: 2px dashed var(--line); border-radius: 14px; padding: 36px 16px; text-align: center; cursor: pointer; color: var(--muted); margin-top: 14px; }
.drop.over { border-color: var(--fg); color: var(--fg); background: var(--soft); }
.drop strong { color: var(--fg); display: block; font-size: 18px; margin-bottom: 4px; }
.progress { height: 8px; background: var(--soft); border-radius: 99px; overflow: hidden; margin-top: 12px; }
.progress > div { height: 100%; width: 0; background: var(--fg); transition: width .15s linear; }
.small { font-size: 13px; color: var(--muted); }
.ok { color: var(--ok); }
.bad { color: var(--danger); }
.done { text-align: center; padding: 8px 0; }
.done .big-code { font-family: var(--mono); font-size: clamp(56px, 12vw, 96px); font-weight: 700; letter-spacing: .08em; line-height: 1.1; }
.sbtn { padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; background: transparent; font-size: 13px; white-space: nowrap; }
.sbtn:hover { border-color: var(--fg); }
.sbtn.danger { color: var(--danger); }
.sbtn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.list { width: 100%; border-collapse: collapse; }
.list th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 500; padding: 8px; border-bottom: 1px solid var(--line); }
.list td { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 14px; }
.list .c { font-family: var(--mono); font-size: 22px; font-weight: 700; }
.list .n { word-break: break-all; font-weight: 600; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pill { display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); font-family: var(--mono); }
.pill.q { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.quick { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.quick .big-code { font-family: var(--mono); font-size: 48px; font-weight: 700; letter-spacing: .08em; }
.login { max-width: 380px; margin: 14vh auto 0; }
.login .field input { width: 100%; }
@media (max-width: 720px) {
  .list thead { display: none; }
  .list tr { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .list td { border: 0; padding: 0; }
  .list td.c { grid-row: span 2; align-self: center; }
  .list td.meta, .list td.actions-cell { grid-column: 1 / -1; }
  .actions { justify-content: flex-start; }
}
.code input::placeholder { color: var(--line); }
a.btn, a.sbtn { text-decoration: none; display: inline-block; text-align: center; color: inherit; }
a.btn { color: var(--accent-fg); }
