:root {
  --bg: #f8fafc; --card: #fff; --ink: #0f172a; --muted: #5b6b80; --line: #e2e8f0;
  --accent: #2a5298; --accent-ink: #fff; --error: #b3261e; --ok: #1b6e3c; --warn: #8a5a00;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { word-break: keep-all; overflow-wrap: break-word; }
body {
  margin: 0; background: var(--bg); color: var(--ink); line-height: 1.6; font-size: 16px;
  font-family: "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
}
.top { display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: var(--card); border-bottom: 1px solid var(--line); }
main { max-width: 1320px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 20px; min-width: 0; }
h2 { font-size: 1.1rem; margin: 0 0 12px; }
label { display: block; font-weight: 600; margin: 12px 0 6px; }
input:not([type=checkbox]) { width: 100%; padding: 10px 12px; border: 1px solid #8795a3; border-radius: 6px; font: inherit; background: #fff; color: inherit; }
button { font: inherit; font-weight: 600; padding: 10px 18px; border: 0; border-radius: 6px; background: var(--accent); color: var(--accent-ink); cursor: pointer; white-space: nowrap; }
button.link { background: none; color: var(--accent); padding: 2px 6px; margin-left: 4px; text-decoration: underline; font-weight: 500; }
button.danger { background: var(--error); }
:focus-visible { outline: 3px solid #e8a200; outline-offset: 2px; }
.hint { color: var(--muted); font-size: .92rem; margin: 6px 0; font-weight: 400; }
.msg { min-height: 1.6em; margin: 10px 0 0; }
.notice { font-size: .92rem; color: var(--muted); margin: 0; }
.notice.error { color: var(--error); font-weight: 600; }
.result iframe { width: 100%; height: 760px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.images { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.images img { width: 100%; border: 1px solid var(--line); }
.row { display: flex; gap: 8px; align-items: center; }
.controls { display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: flex-end; }
.controls label { margin-top: 0; }
.controls .hint { flex-basis: 100%; }
.check { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.check input { width: 18px; height: 18px; }
.scroll { overflow: auto; max-height: 520px; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { position: sticky; top: 0; background: var(--card); }
.state.done { color: var(--ok); font-weight: 600; }
.state.failed, .state.refused, .state.locked { color: var(--error); font-weight: 600; }
.state.queued, .state.running { color: var(--warn); font-weight: 600; }
pre { white-space: pre-wrap; word-break: keep-all; background: var(--bg); padding: 12px; border-radius: 6px; max-height: 480px; overflow: auto; font: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 640px) { .row { flex-wrap: wrap; } .result iframe { height: 560px; } }

.button { display: inline-block; padding: 10px 18px; border-radius: 6px; background: #1a4fa3; color: #fff; font-weight: 700; text-decoration: none; }
.button:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }

/* 휴대폰에서 입력칸과 버튼이 화면 밖으로 나가지 않게 한다. */
.row { flex-wrap: wrap; }
.row input { flex: 1 1 160px; min-width: 0; }
.controls > div { min-width: 0; max-width: 100%; }
main > div, #panel { min-width: 0; }
#panel { display: grid; gap: 16px; }
.card { overflow-wrap: anywhere; }
.top { flex-wrap: wrap; }
.code-value { font-family: Consolas, Menlo, monospace; font-weight: 700; font-size: 1.1rem; overflow-wrap: normal; }
#code-table { margin-top: 8px; }
.worker-state { flex-basis: 100%; margin: 0; font-weight: 700; color: var(--ok); }
.worker-state.off { color: var(--error); }

/* 사용 설명서와 같은 머리글과 표면 */
.top { padding: 10px 24px; background: linear-gradient(135deg, #1e3a6b 0%, #2a5298 60%, #4a7bc4 100%); border-bottom: 0; color: #fff; }
.top .hint { margin: 0; color: #dbe6ff; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; margin-right: auto; }
.brand img { width: 40px; height: 40px; object-fit: cover; object-position: top; border-radius: 50%; background: #fff; border: 2px solid rgba(255, 255, 255, .7); }
.brand small { display: block; font-size: .74rem; line-height: 1.3; color: #f6d48e; font-weight: 600; }
.brand strong { display: block; font-size: 1.05rem; line-height: 1.3; }
main { padding: 24px 16px 48px; }
.card { border-radius: 14px; padding: 24px; box-shadow: 0 1px 2px rgba(15, 23, 42, .05); }
button { border-radius: 10px; min-height: 42px; transition: background .15s; }
button:not(.danger):not(.link):hover { background: #1e3a6b; }
button.link { min-height: 0; }
input:not([type=checkbox]) { border-radius: 10px; }
:focus-visible { outline-color: #e8a020; }
