:root {
  --blue: #0a4da3; --blue-dark: #063a7c; --sky: #eaf2fc; --ink: #14213d; --muted: #6b7280;
  --ok: #0f9d58; --no: #c62828; --warn: #ef6c00; --line: #e3e8ef; --bg: #f4f6fa; --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif; }
button, input, select { font: inherit; }
main { max-width: 560px; margin: 0 auto; padding: 12px 12px 90px; }
.top { position: sticky; top: 0; z-index: 5; background: var(--blue); color: #fff; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); display: flex; justify-content: space-between; align-items: center; }
.brand { display: flex; gap: 10px; align-items: center; font-weight: 700; font-size: 18px; }
.logo { background: #fff; color: var(--blue); border-radius: 8px; width: 28px; height: 28px; display: grid; place-items: center; font-weight: 900; }
.who { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.link { background: none; border: 0; color: #fff; text-decoration: underline; padding: 4px; }
.card { background: #fff; border-radius: var(--radius); padding: 18px; box-shadow: 0 1px 3px rgba(20,33,61,.08); display: grid; gap: 12px; }
h1 { font-size: 20px; margin: 0; } h2 { font-size: 18px; margin: 0; }
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
input, select { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font-size: 16px; }
input:focus, select:focus { outline: 2px solid var(--blue); border-color: transparent; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stations { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: end; }
.stations input { font-size: 20px; font-weight: 700; text-align: center; }
.swap { border: 1px solid var(--line); background: var(--sky); border-radius: 50%; width: 44px; height: 44px; margin-bottom: 1px; color: var(--blue); font-size: 20px; }
button.primary { background: var(--blue); color: #fff; border: 0; border-radius: 10px; padding: 14px; font-weight: 700; font-size: 16px; }
button.primary:active { background: var(--blue-dark); }
button.primary[disabled] { opacity: .6; }
button.secondary { background: var(--sky); color: var(--blue); border: 0; border-radius: 10px; padding: 12px; font-weight: 600; }
button.small { padding: 8px 12px; font-size: 14px; border-radius: 8px; }
button.danger { background: #fdecec; color: var(--no); }
.hint { color: var(--muted); font-size: 13px; margin: 4px 0 10px; }
.fine { color: var(--muted); font-size: 12px; margin: 0; }
.error { color: var(--no); font-size: 14px; margin: 0; background: #fdecec; padding: 10px; border-radius: 8px; }
details summary { cursor: pointer; color: var(--blue); font-size: 14px; }
details .row { margin-top: 10px; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); background: #fff; border-radius: var(--radius); padding: 4px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(20,33,61,.08); }
.tabs button { border: 0; background: none; padding: 10px; border-radius: 10px; color: var(--muted); font-weight: 600; }
.tabs button.active { background: var(--sky); color: var(--blue); }
.badge { background: var(--warn); color: #fff; border-radius: 10px; padding: 0 6px; font-size: 11px; margin-left: 4px; }
.train { background: #fff; border-radius: var(--radius); padding: 14px 16px; margin-top: 10px; display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; box-shadow: 0 1px 3px rgba(20,33,61,.06); }
.train .type { font-size: 12px; color: var(--muted); }
.train .no { font-weight: 800; color: var(--blue); }
.train .time { font-size: 22px; font-weight: 800; letter-spacing: -.5px; }
.train .time small { font-size: 13px; color: var(--muted); font-weight: 500; margin: 0 6px; }
.seats { display: flex; gap: 6px; }
.seat { font-size: 12px; padding: 4px 8px; border-radius: 6px; background: #f1f3f7; color: var(--muted); }
.seat.ok { background: #e6f6ec; color: var(--ok); font-weight: 700; }
.seat.no { background: #fdecec; color: var(--no); }
.job, .hold { background: #fff; border-radius: var(--radius); padding: 14px 16px; margin-top: 10px; box-shadow: 0 1px 3px rgba(20,33,61,.06); display: grid; gap: 8px; }
.job .head, .hold .head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.status { font-size: 12px; padding: 4px 8px; border-radius: 6px; font-weight: 700; background: #f1f3f7; color: var(--muted); }
.status.running, .status.provisioning { background: #fff4e5; color: var(--warn); }
.status.reserved { background: #e6f6ec; color: var(--ok); }
.status.failed { background: #fdecec; color: var(--no); }
.meta { font-size: 13px; color: var(--muted); }
pre.log { margin: 0; background: #0f172a; color: #cbd5e1; font-size: 11px; padding: 10px; border-radius: 8px; max-height: 160px; overflow: auto; white-space: pre-wrap; }
.empty { color: var(--muted); text-align: center; padding: 30px 0; }
.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; align-items: end; z-index: 10; }
.sheet-body { background: #fff; border-radius: 18px 18px 0 0; padding: 20px 18px max(20px, env(safe-area-inset-bottom)); display: grid; gap: 12px; max-width: 560px; width: 100%; margin: 0 auto; max-height: 92vh; overflow: auto; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
legend { font-size: 13px; color: var(--muted); margin-bottom: 6px; width: 100%; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 20px; font-size: 14px; color: var(--ink); }
.chip:has(input:checked) { background: var(--sky); border-color: var(--blue); color: var(--blue); font-weight: 700; }
.chip input { width: auto; margin: 0; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); }
.check input { width: auto; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 14px; z-index: 20; max-width: 90vw; }
