@font-face {
  font-family: 'Pretendard';
  src: url('font.woff2') format('woff2');
  font-weight: 45 920;
  font-display: swap;
}
:root {
  --bg: #ffffff; --surface: #ffffff; --line: #e2e8f0; --ink: #0f172a; --muted: #475569;
  --accent: #0d6efd; --alert: #b3261e; --alert-bg: #fbeceb; --warn-bg: #fdf5e3; --ok-bg: #e7f4ec; --ok: #0a6b36;
}
html[data-theme="dark"] {
  --bg: #0b1220; --surface: #111a2b; --line: #1f2a3a; --ink: #e6edf7; --muted: #94a3b8;
  --accent: #4d94ff; --alert: #ff8a80; --alert-bg: #3a1a1a; --warn-bg: #33290f; --ok-bg: #12301f; --ok: #5fd896;
  color-scheme: dark;
}
html.embedded, html.embedded body { background: transparent; }
html.embedded .home-link { display: none; }
* { box-sizing: border-box; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.6 'Pretendard', 'Malgun Gothic', sans-serif; word-break: keep-all; }
main { max-width: 1438px; margin: 0 auto; padding: 32px 24px 64px; display: grid; gap: 16px; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 19px; font-weight: 700; margin-bottom: 4px; }
h3 { font-size: 16px; font-weight: 700; margin-top: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
.draft { border: 2px solid var(--accent); }
.lead { color: var(--muted); margin-bottom: 12px; }
.help { color: var(--muted); font-size: 14px; margin-top: 8px; }
.url { font-size: 15px; overflow-wrap: anywhere; }
a { color: var(--accent); }
label { display: block; font-weight: 600; margin-bottom: 6px; }
input { width: 100%; font: inherit; color: var(--ink); background: var(--surface); padding: 10px 12px; border: 1px solid #98a1b0; border-radius: 6px; }
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
button { font: inherit; font-weight: 600; padding: 10px 18px; border-radius: 6px; border: 1px solid #98a1b0; background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap; }
button:active { transform: translateY(1px); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fdfdfe; }
.upload, .settings { display: grid; gap: 14px; justify-items: start; }
.upload input, .settings > div { width: 100%; }
.actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.notice { background: var(--ok-bg); color: var(--ok); padding: 12px 16px; border-radius: 8px; font-weight: 600; }
.error { background: var(--alert-bg); color: var(--alert); padding: 12px 16px; border-radius: 8px; }
.error ul, .warn { padding-left: 20px; }
.warn { background: var(--warn-bg); border-radius: 8px; padding: 10px 12px 10px 30px; margin-top: 6px; }
.ignored { margin-top: 12px; font-size: 14px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
dt { color: var(--muted); font-size: 14px; }
dd { margin: 0; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; color: var(--muted); font-size: 14px; font-weight: 500; border-bottom: 1px solid var(--line); padding: 4px 8px; }
td { padding: 6px 8px; }
.num { text-align: right; }
h4 { font-size: 15px; font-weight: 700; margin-top: 14px; }
select { width: 100%; font: inherit; color: var(--ink); background: var(--surface); padding: 10px 12px; border: 1px solid #98a1b0; border-radius: 6px; }
select:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
button:disabled { background: #e2e6ed; border-color: #c9ced8; color: var(--muted); cursor: not-allowed; }
.status { margin-top: 10px; font-size: 15px; }
.status.ok { color: var(--ok); font-weight: 600; }
.status.bad { color: var(--alert); font-weight: 600; }
.steps h3 { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 17px; }
.map-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 12px; }
.map-grid > div { min-width: 0; }
.req { color: var(--alert); font-weight: 500; font-size: 14px; }
.warn-line { background: var(--warn-bg); border-radius: 6px; padding: 8px 12px; margin-top: 10px; font-size: 15px; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-top: 12px; }
legend { font-weight: 600; padding: 0 6px; }
.check { display: block; font-weight: 400; margin: 4px 0; }
.check input { width: auto; }
.new { color: var(--alert); font-weight: 600; font-size: 14px; }
.blockers { background: var(--alert-bg); color: var(--alert); border-radius: 8px; padding: 10px 12px 10px 30px; margin-top: 12px; font-weight: 600; }
#result .stats { margin-top: 14px; }
main { grid-template-columns: minmax(0, 1fr); } /* 넓은 표가 화면 폭을 밀어내지 않고 표 안에서만 스크롤되게 한다. */
.settings fieldset { width: 100%; margin-top: 0; }
.tv-steps { padding-left: 22px; margin: 8px 0 12px; }
.tv-steps li + li { margin-top: 6px; }
.tv-address { font-size: 18px; overflow-wrap: anywhere; }
.compare { font-weight: 700; margin-top: 8px; }
.risks { background: var(--warn-bg); border: 1px solid #e0b85a; border-radius: 8px; padding: 12px 14px; margin-top: 10px; }
.risks ul { padding-left: 18px; margin-bottom: 8px; }
.current-display { background: var(--bg); border-radius: 6px; padding: 8px 12px; margin-top: 12px; font-size: 15px; }
.next-links { display: flex; flex-wrap: wrap; gap: 8px; }
.next-links a.button { margin-right: 0; }
.preview-board { display: block; width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); margin-top: 8px; }
.data-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; margin-top: 8px; }
details.confirm summary { cursor: pointer; color: var(--alert); font-weight: 600; font-size: 15px; }
details.confirm form { margin-top: 6px; }
#team-totals { margin-top: 4px; }
section[id] { scroll-margin-top: 12px; }
.page-links { display: flex; gap: 8px; flex: none; }
.page-links a.button { margin-right: 0; padding: 8px 12px; white-space: nowrap; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs[hidden] { display: none; }
.tabs a { padding: 10px 14px; font-weight: 600; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs .tab-board { margin-left: auto; color: var(--accent); }
[data-tab][hidden] { display: none; }
.code-input { font-size: 40px; font-weight: 800; letter-spacing: 2px; font-variant-numeric: tabular-nums; text-transform: uppercase; }
.code-input::placeholder { color: #c3c9d3; font-weight: 600; }
.consent { margin-top: 12px; font-weight: 600; }
fieldset > div + div { margin-top: 12px; }
.tv-code { font-size: clamp(40px, 11vw, 64px); white-space: nowrap; line-height: 1.1; font-size-adjust: none; font-weight: 800; letter-spacing: 2px; margin: 12px 0 0; font-variant-numeric: tabular-nums; }
.table-wrap td { white-space: normal; }
.table-wrap td:nth-child(3) { min-width: 118px; }
.org-links { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; padding: 0; margin-top: 8px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.upload > div { width: 100%; }
.num form { display: inline; }
.settings .map-grid { width: 100%; margin-top: 0; }
.downloads a.button { margin-bottom: 8px; }
.downloads { margin-bottom: 16px; font-size: 15px; color: var(--muted); }
a.button { display: inline-block; font-weight: 600; padding: 8px 16px; margin-right: 10px; border: 1px solid var(--accent); border-radius: 6px; text-decoration: none; }
.table-wrap { overflow-x: auto; }
.table-wrap td:first-child { font-weight: 600; }
.table-wrap td { vertical-align: top; border-bottom: 1px solid var(--line); }
.rules-list { margin-top: 14px; padding-left: 20px; font-size: 15px; }
.rules-list li + li { margin-top: 4px; }
/* 넓은 화면에서는 칸을 나눠 폭을 쓴다. 긴 글은 한 줄이 너무 길어지지 않게 막는다. */
.lead, .help { max-width: 86ch; }
@media (min-width: 1024px) {
  .settings { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; align-items: start; }
  .settings > button { grid-column: 1 / -1; }
  .settings > .map-grid { grid-column: 1 / -1; }
  .first-run { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 8px 32px; align-items: start; }
  .first-run > .notice, .first-run > .help { grid-column: 1 / -1; }
  #upload .upload { max-width: 860px; }
  .downloads { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
  .downloads a.button { margin: 0; }
}
@media (max-width: 560px) { .stats { grid-template-columns: 1fr; } main { padding: 20px 16px 48px; } .panel { padding: 18px; } }

.guide { margin: 0 0 16px; }
#upload:not([hidden]) { display: flow-root; }
.guide-video { aspect-ratio: 16 / 9; width: 100%; background: #000; border-radius: 8px; overflow: hidden; }
.guide-video iframe { width: 100%; height: 100%; border: 0; display: block; }
/* 넓은 화면에서는 올리기 양식 옆 빈 자리에 둔다. 양식을 아래로 밀지 않는다. */
@media (min-width: 1024px) { .guide { float: right; width: min(42%, 560px); margin: 0 0 16px 32px; } }
#terms-guide .guide { float: none; width: min(100%, 720px); margin: 0; }
