:root {
  color-scheme: light dark;
  --bg: #f5f6f8; --surface: #ffffff; --surface-2: #f0f2f5; --text: #1b1f24; --muted: #5c6570;
  --line: #dde1e6; --accent: #2456c4; --accent-weak: #e7edfb; --ok: #1d7a3e; --ok-weak: #e2f3e7;
  --warn: #8f5600; --warn-weak: #fff2d9; --bad: #b42318; --bad-weak: #fde7e4;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font: system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1216; --surface: #171b21; --surface-2: #1d232b; --text: #e5e9ee; --muted: #98a2ae;
    --line: #2b323b; --accent: #7ea4ff; --accent-weak: #1b2640; --ok: #5fd08a; --ok-weak: #13301f;
    --warn: #f0b45a; --warn-weak: #332410; --bad: #ff8a7a; --bad-weak: #3a1714; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); }
[hidden] { display: none !important; }
a { color: var(--accent); }
code, pre, .mono { font-family: var(--mono); font-size: 13px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; color: inherit; text-decoration: none; }
.brand strong { font-size: 17px; }
.sub { color: var(--muted); }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--warn-weak); color: var(--warn); }
.who { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.nav { display: flex; gap: 2px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--line); overflow-x: auto; position: sticky; top: 0; z-index: 3; }
.nav a { padding: 11px 12px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
main { max-width: 1180px; margin: 0 auto; padding: 16px 20px 56px; }
.strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); margin-bottom: 16px; }
.strip .spacer { flex: 1; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin: 4px 0 16px; }
.page-head h1 { font-size: 22px; margin: 0 0 4px; }
.page-head p { margin: 0; color: var(--muted); max-width: 760px; }
h2.section { font-size: 17px; margin: 28px 0 10px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 16px; min-width: 0; }
.card.narrow { max-width: 400px; margin: 40px auto; }
.card h1 { font-size: 21px; margin: 0 0 6px; }
.card h2 { font-size: 16px; margin: 0 0 10px; }
.card h3 { font-size: 14px; margin: 18px 0 8px; }
h2 small { font-weight: 400; color: var(--muted); margin-left: 6px; font-size: 13px; }
.muted { color: var(--muted); font-size: 14px; }
.error { color: var(--bad); min-height: 1.5em; margin: 8px 0 0; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); margin-bottom: 12px; }
label small { color: var(--muted); font-weight: 400; }
label.inline, .radios label, .checks label { flex-direction: row; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--text); }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 0; }
input[type="number"] { width: 110px; }
input.short { width: 76px; }
.fields input, .fields select, .row-item input, .row-item select { width: 100%; }
.card, [id] { scroll-margin-top: 56px; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
textarea { font-family: var(--mono); font-size: 13px; width: 100%; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button { font: inherit; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); cursor: pointer; white-space: nowrap; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.big { padding: 11px 22px; font-size: 16px; }
button.ghost { background: transparent; }
button.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
button.link { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; }
button:disabled { opacity: .55; cursor: progress; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.grow > input { flex: 1 1 260px; }
.bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.bar input { flex: 1 1 220px; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none; }
.tile:hover { border-color: var(--accent); box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 15%, transparent); }
.tile b { font-size: 17px; }
.tile small { color: var(--accent); }
.tile span { color: var(--muted); font-size: 14px; }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 14px; }
.choices button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; white-space: normal; padding: 10px 12px; background: var(--surface); }
.choices button span { color: var(--muted); font-size: 13px; }
.choices button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-weak); box-shadow: inset 0 0 0 1px var(--accent); }
.radios { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 14px; }
.radios.inline { flex-direction: row; gap: 18px; margin-bottom: 12px; }
.radios label { margin-bottom: 0; }
.radios small { color: var(--muted); }
.checks { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-bottom: 8px; }
.checks label { margin-bottom: 0; }
.scope { display: flex; gap: 14px; flex-wrap: wrap; }
.toggles { display: flex; flex-direction: column; }
.toggle { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.toggle:first-child { border-top: 0; padding-top: 0; }
.toggle b { display: block; }
.toggle span { color: var(--muted); font-size: 14px; }
.toggle .buttons { display: flex; gap: 6px; flex-shrink: 0; }
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; align-items: start; }
.flow .card { margin-bottom: 0; }
.step { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; margin-right: 6px; }
.flow + .card { margin-top: 16px; }
.conn { margin-bottom: 14px; }
.outcome:empty { display: none; }
.outcome { margin-top: 14px; border-radius: 10px; border: 1px solid var(--line); overflow: hidden; }
.outcome .head { padding: 12px 14px; font-weight: 600; }
.outcome.ok .head { background: var(--ok-weak); color: var(--ok); }
.outcome.warn .head { background: var(--warn-weak); color: var(--warn); }
.outcome.bad .head { background: var(--bad-weak); color: var(--bad); }
.outcome .detail { padding: 10px 14px 0; color: var(--muted); font-size: 14px; }
.outcome .follow { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 14px 0; }
.outcome .next { padding: 10px 14px 12px; }
.outcome .next b { display: block; margin-bottom: 4px; }
.outcome .next ol { margin: 0; padding-left: 20px; }
.outcome .next li { margin: 4px 0; }
.rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }
.row-item { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 10px; padding: 12px 12px 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); position: relative; }
.row-item label { margin-bottom: 8px; }
.row-item .remove { position: absolute; top: 6px; right: 6px; padding: 2px 8px; font-size: 13px; }
details.advanced { margin: 6px 0 10px; }
details.advanced > summary { cursor: pointer; color: var(--muted); font-size: 14px; padding: 4px 0; }
details.card.advanced > summary { font-weight: 600; color: var(--text); }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; white-space: nowrap; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.nowrap { white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; gap: 4px; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); }
.chip.ok { background: var(--ok-weak); color: var(--ok); border-color: transparent; }
.chip.bad { background: var(--bad-weak); color: var(--bad); border-color: transparent; }
.chip.warn { background: var(--warn-weak); color: var(--warn); border-color: transparent; }
.empty { color: var(--muted); font-size: 14px; padding: 6px 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 16px; }
.grid .card { margin: 0; }
.grid .wide { grid-column: 1 / -1; }
.folder { margin-bottom: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.folder strong { display: block; margin-bottom: 6px; }
.steps-list li { margin: 6px 0; }
dialog#help { width: min(880px, calc(100vw - 24px)); height: min(720px, calc(100vh - 40px)); padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); overflow: hidden; }
dialog#help[open] { display: flex; flex-direction: column; }
dialog#help::backdrop { background: rgba(10, 14, 20, .45); }
.help-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.help-head h2 { margin: 0; font-size: 18px; }
.help-body { display: grid; grid-template-columns: 170px 1fr; flex: 1; min-height: 0; }
.help-nav { display: flex; flex-direction: column; padding: 12px; gap: 2px; border-right: 1px solid var(--line); overflow-y: auto; }
.help-nav a { padding: 6px 8px; border-radius: 6px; text-decoration: none; color: var(--text); font-size: 14px; }
.help-nav a:hover { background: var(--surface-2); }
.help-text { padding: 6px 22px 22px; overflow-y: auto; min-height: 0; position: relative; }
.help-text section { padding-top: 12px; }
.help-text h3 { font-size: 16px; margin: 0 0 6px; }
.help-text li { margin: 5px 0; line-height: 1.65; }
@media (max-width: 720px) {
  .top { padding: 10px 14px; }
  .nav { padding: 0 8px; }
  main { padding: 12px 16px 48px; }
  .grid { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; }
  .toggle { flex-direction: column; align-items: stretch; }
  .help-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .help-nav { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand .sub { display: none; }
  .brand .badge, #account { display: none !important; }
}
