:root {
  color-scheme: light dark;
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1c2330;
  --muted: #5f6b7a;
  --line: #dde2e8;
  --accent: #1f7a4d;
  --accent-text: #ffffff;
  --accent-soft: #e6f3ec;
  --error: #b3261e;
  --error-soft: #fbeceb;
  --meta-bg: #f1f3f6;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14181d;
    --card: #1d232a;
    --text: #e7ebf0;
    --muted: #9aa6b4;
    --line: #313a45;
    --accent: #4fbf87;
    --accent-text: #0d1f16;
    --accent-soft: #1d3329;
    --error: #ff8a80;
    --error-soft: #3a2220;
    --meta-bg: #232a32;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Hiragino Sans", "Yu Gothic UI", "PingFang SC", "Microsoft YaHei", "Nirmala UI", "Noto Sans KR", "Noto Sans JP", "Noto Sans SC", "Noto Sans Devanagari", sans-serif;
  word-break: keep-all;
}
.wrap { max-width: 920px; margin: 0 auto; padding: 0 20px; }
[hidden] { display: none !important; }

.top { border-bottom: 1px solid var(--line); background: var(--card); }
.top .wrap { display: flex; align-items: baseline; gap: 10px; padding-top: 14px; padding-bottom: 14px; }
.brand { font-weight: 800; letter-spacing: 0.04em; color: var(--accent); }
.tag { color: var(--muted); font-size: 14px; }

.hero { padding: 40px 0 16px; }
.hero h1 { margin: 0 0 12px; font-size: clamp(24px, 4.5vw, 34px); line-height: 1.3; letter-spacing: -0.01em; }
.hero p { margin: 0 0 10px; color: var(--muted); max-width: 640px; }
.privacy { display: inline-block; padding: 8px 14px; border-radius: 8px; background: var(--accent-soft); color: var(--text) !important; font-size: 14px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin: 16px 0; }
.step-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
h2 { margin: 0; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-text); font-size: 13px; }
.optional { font-size: 12px; font-weight: 500; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.hint { margin: 0 0 12px; color: var(--muted); font-size: 14px; }

.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 28px 16px; border: 2px dashed var(--line); border-radius: 10px; text-align: center; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.drop.small { padding: 14px 16px; }
.drop:hover, .drop.over, .drop:focus-within { border-color: var(--accent); background: var(--accent-soft); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-main { font-weight: 600; }
.drop-sub { color: var(--muted); font-size: 13px; }

.files { list-style: none; margin: 0; padding: 0; }
.files li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.files li:first-child { margin-top: 10px; }
.files li:last-child { border-bottom: 0; }
.file-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.file-error { color: var(--error); font-size: 13px; }
.files li.bad .file-name { color: var(--muted); text-decoration: line-through; }

button { font: inherit; cursor: pointer; }
.remove, .link { background: none; border: 0; color: var(--muted); font-size: 13px; padding: 4px 6px; border-radius: 6px; }
.link { color: var(--accent); font-weight: 600; font-size: 14px; }
.remove:hover, .link:hover { background: var(--meta-bg); }
.primary { background: var(--accent); color: var(--accent-text); border: 0; border-radius: 8px; padding: 9px 16px; font-weight: 700; }
.primary:hover { filter: brightness(1.08); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.field { margin-bottom: 12px; }
.field-label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span { display: inline-block; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; color: var(--muted); }
.chip input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }

.message { margin: 16px 0; padding: 12px 16px; border-radius: 10px; background: var(--accent-soft); font-size: 14px; }
.message.error { background: var(--error-soft); color: var(--error); }

.stats { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.table-scroll { overflow: auto; max-height: 520px; border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
th { position: sticky; top: 0; background: var(--meta-bg); font-weight: 600; z-index: 1; }
td.meta { background: var(--meta-bg); color: var(--muted); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: 0; }

.how { margin: 32px 0; }
.how h2 { margin-bottom: 10px; }
.how dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; }
.how dt { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 13px; color: var(--accent); }
.how dd { margin: 0; color: var(--muted); }
@media (max-width: 560px) { .how dl { grid-template-columns: 1fr; } .how dd { margin-bottom: 8px; } }

.foot { padding-top: 16px; padding-bottom: 40px; color: var(--muted); font-size: 13px; }

a { color: var(--accent); }
a.brand { text-decoration: none; }
.nav { margin-left: auto; font-size: 14px; }
.nav a { text-decoration: none; font-weight: 600; }
.foot p { margin: 0 0 6px; }

.prose { padding: 32px 0 8px; max-width: 720px; }
.prose h1 { font-size: clamp(24px, 4vw, 30px); line-height: 1.3; margin: 0 0 16px; }
.prose h2 { display: block; font-size: 20px; margin: 32px 0 10px; }
.prose h3 { font-size: 16px; margin: 20px 0 6px; }
.prose p, .prose li { color: var(--text); }
.prose ol, .prose ul { padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose code { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 0.9em; background: var(--meta-bg); padding: 1px 5px; border-radius: 4px; }
.prose .cta { display: inline-block; margin-top: 8px; background: var(--accent); color: var(--accent-text); padding: 10px 18px; border-radius: 8px; font-weight: 700; text-decoration: none; }
.prose table { width: auto; margin: 10px 0; border: 1px solid var(--line); }
.prose th { position: static; }
.prose td, .prose th { white-space: normal; }

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 20px 0 4px; }
.tabs button { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--muted); }
.tabs button strong { font-size: 16px; color: var(--text); }
.tabs button span { font-size: 13px; }
.tabs button:hover { border-color: var(--accent); }
.tabs button[aria-selected="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
@media (max-width: 560px) { .tabs button span { display: none; } }

.hint code, .how code { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 0.92em; background: var(--meta-bg); padding: 1px 5px; border-radius: 4px; }
input.text { font: inherit; width: 100%; max-width: 280px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); }
#fill-password-field { margin: 12px 0 0 24px; }
#fill-password-field .hint { margin: 8px 0 0; }
.primary.big { display: block; margin-top: 16px; padding: 11px 22px; font-size: 16px; }
.primary:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }
.names { margin: 0; padding: 0; list-style: none; max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.names li { padding: 7px 12px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.names li:last-child { border-bottom: 0; }
#fill-notes { margin: 12px 0 0; }

/* 언어 메뉴 */
.nav { display: flex; align-items: center; gap: 14px; }
.lang { position: relative; font-size: 14px; }
.lang summary { display: flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; list-style: none; color: var(--text); white-space: nowrap; }
.lang summary::-webkit-details-marker { display: none; }
.lang summary:hover, .lang[open] summary { border-color: var(--accent); }
.lang ul { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; margin: 0; padding: 6px; list-style: none; min-width: 150px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14); }
.lang li a { display: block; padding: 7px 10px; border-radius: 6px; color: var(--text); font-weight: 500; }
.lang li a:hover { background: var(--meta-bg); }
.lang li a[aria-current] { background: var(--accent-soft); font-weight: 700; }
@media (max-width: 640px) { .top .tag { display: none; } }

/* 한국어는 어절 단위로, 나머지 언어는 각 언어의 기본 규칙대로 줄을 바꾼다 */
body { word-break: normal; overflow-wrap: anywhere; }
:lang(ko) body, html:lang(ko) body { word-break: keep-all; overflow-wrap: break-word; }
.how dt.plain { font-family: inherit; font-size: 14px; font-weight: 600; }
