/* GPTO 관리 앱 — 보고서 브랜드: Gothic A1, 밝은 종이 톤, 무지개는 가는 선에만 */
:root {
  --ink: #111318; --ink-2: #3a3f4b; --ink-3: #7a8190;
  --line: #e6e8ee; --line-2: #cfd3dc; --panel: #f3f4f7; --paper: #fff; --dark: #1a1b1e; --blue: #2f6bff;
  --red: #b42318; --red-bg: #fdeceb; --red-line: #f3c7c2;
  --amber: #8f4e06; --amber-bg: #fff3df; --amber-line: #f2d4a2;
  --green: #0f6b3a; --green-bg: #e5f4eb;
  --blue-ink: #1f4fd6; --blue-bg: #eaf0ff;
  --grey: #555c69; --grey-bg: #eceef3;
  --rainbow: linear-gradient(90deg, #ff5a3c, #ffb400, #22c55e, #2f6bff);
  --font: "Gothic A1", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --side: 228px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--panel); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { letter-spacing: -0.01em; }
svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.mono.big { font-size: 15px; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.right { text-align: right; }
.grow { flex: 1; }
.rainbow { height: 3px; background: var(--rainbow); }

/* 시작 · 설정 · 로그인 */
.boot, .setup, .login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.boot-msg { color: var(--ink-3); }
.setup-card, .login-card { width: min(400px, 100%); background: var(--paper); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: 0 12px 40px rgba(17, 19, 24, .06); }
.setup-card h1 { margin: 22px 26px 6px; font-size: 20px; }
.setup-card p { margin: 0 26px 14px; color: var(--ink-2); }
.setup-card p:last-child { margin-bottom: 24px; }
.login-brand { padding: 26px 28px 4px; }
.wm { font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.wm span { font-weight: 500; color: var(--ink-3); }
.login-brand .sub, .brand .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.login-form { padding: 14px 28px 26px; }
.login-form .btn.block { margin-top: 20px; }
.login-form .btn.ghost.block { margin-top: 6px; }
.login-lead { margin: 4px 0 8px; color: var(--ink-2); }
.login-mock { margin: 0; padding: 12px 28px; background: var(--panel); border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); }
.input.otp { font-family: var(--mono); font-size: 22px; letter-spacing: .3em; height: 48px; text-align: center; }
.placeholder { border: 1px dashed var(--line-2); border-radius: 10px; padding: 36px 12px; text-align: center; color: var(--ink-3); margin: 10px 0; background: var(--panel); }

/* 틀 */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--paper); border-right: 1px solid var(--line); z-index: 20; }
.brand { position: relative; padding: 20px 22px 16px; }
.brand::after { content: ""; position: absolute; left: 22px; bottom: 0; width: 40px; height: 2px; border-radius: 2px; background: var(--rainbow); }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 14px 10px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-weight: 500; white-space: nowrap; }
.nav a svg { width: 18px; height: 18px; flex: none; color: var(--ink-3); }
.nav a:hover { background: var(--panel); color: var(--ink); }
.nav a.on { background: var(--ink); color: #fff; }
.nav a.on svg { color: #fff; }
.cnt { margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 999px; background: var(--panel); color: var(--ink-2); font-size: 12px; line-height: 20px; text-align: center; font-weight: 600; }
.nav a.on .cnt { background: rgba(255, 255, 255, .18); color: #fff; }
.cnt.bad { background: #e5484d; color: #fff; }
.cnt.warn { background: var(--amber-bg); color: var(--amber); }
.qr { display: block; margin: 10px auto 4px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.side .foot { margin-top: auto; padding: 14px 18px 18px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.mock-pill { justify-self: start; font-size: 11.5px; padding: 2px 8px; border-radius: 6px; background: var(--amber-bg); color: var(--amber); font-weight: 600; }
.who { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-size: 13px; }
.who b { white-space: nowrap; }
.who span { color: var(--ink-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .foot .btn { justify-self: start; padding: 0 6px; margin-left: -6px; }

.main { min-width: 0; padding: 28px 36px 64px; }
.main.flush { padding: 0; }
.loading { color: var(--ink-3); padding: 40px 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 25px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.page-head .sub { margin-top: 4px; font-size: 13px; color: var(--ink-3); }
.head-actions { display: flex; gap: 8px; }
.crumb { display: flex; gap: 6px; font-size: 13px; color: var(--ink-3); margin-bottom: 6px; }
.crumb a { text-decoration: none; }
.crumb a:hover { color: var(--ink); text-decoration: underline; }

/* 버튼 · 배지 · 입력 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--paper); color: var(--ink); font-size: 13.5px; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer; }
.btn:hover { border-color: var(--ink-3); }
.btn:focus-visible, .chip:focus-visible, .thumb:focus-visible, .dcell:focus-visible, .mk:focus-visible, .org-tab:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: #1f5cf0; border-color: #1f5cf0; }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.danger { color: var(--red); border-color: var(--red-line); }
.btn.danger:hover { background: var(--red-bg); border-color: var(--red); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--panel); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn.lg { height: 46px; font-size: 15px; border-radius: 10px; }
.btn.block { display: flex; width: 100%; }
.btn[disabled] { opacity: .42; cursor: not-allowed; pointer-events: auto; }
.btn[disabled]:hover { border-color: inherit; }
.btn.primary[disabled] { background: var(--blue); }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--grey-bg); color: var(--grey); font-size: 12px; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.badge .d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.blue { background: var(--blue-bg); color: var(--blue-ink); }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.line { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink-2); }
.badge.ink { background: var(--ink); color: #fff; }
.kind { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 22px; padding: 0 6px; border-radius: 5px; font-size: 11.5px; font-weight: 700; vertical-align: middle; background: var(--panel); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.kind-start { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.kind-monthly { background: var(--blue-bg); color: var(--blue-ink); box-shadow: none; }
.kind-closing { background: var(--ink); color: #fff; box-shadow: none; }
.kind-contract { background: var(--amber-bg); color: var(--amber); box-shadow: none; }
.late-tag, .today-tag { font-size: 11px; font-weight: 700; color: var(--red); margin-left: 4px; }
.today-tag { color: var(--blue); }

.input { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; }
textarea.input { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus { outline: 3px solid rgba(47, 107, 255, .18); border-color: var(--blue); }
.input.search { width: 240px; }
.field { display: block; margin: 12px 0 0; }
.field > span { display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.req { font-style: normal; font-size: 11px; color: var(--red); margin-left: 4px; font-weight: 600; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 12px; }
.field-note { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-3); }
.field-note.warn { color: var(--amber); }
.check { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 13.5px; }
.hint { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-3); }
.err { margin: 10px 0 0; font-size: 13px; color: var(--red); }

/* 알림 띠 · 타일 · 목록 */
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 16px; border-radius: 10px; margin-bottom: 18px; border: 1px solid; font-size: 13.5px; }
.banner svg { width: 20px; height: 20px; flex: none; }
.banner > div { flex: 1; }
.banner.red { background: var(--red-bg); border-color: var(--red-line); color: #7a1a12; }
.banner.red svg { color: var(--red); }
.banner.amber { background: var(--amber-bg); border-color: var(--amber-line); color: #6b3b05; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 26px; }
.tile { display: flex; flex-direction: column; padding: 16px 18px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); text-decoration: none; transition: border-color .12s; }
.tile:hover { border-color: var(--line-2); }
.tile .k { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.tile .v { font-size: 36px; font-weight: 700; line-height: 1.15; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.tile .s { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.tile.bad .v { color: var(--red); }
.tile.warn .v { color: var(--amber); }
.tile.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

.section { margin-top: 26px; }
.section:first-child { margin-top: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-head h2 { margin: 0; font-size: 16px; font-weight: 700; }
.section-head h2 .muted { font-weight: 500; font-size: 13px; margin-left: 4px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.list { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.row { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.when { display: flex; flex-direction: column; font-size: 12px; color: var(--ink-3); line-height: 1.35; }
.when b { font-size: 13.5px; color: var(--ink); font-weight: 700; }
.when.late span { color: var(--red); font-weight: 600; }
.row-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.hn { font-weight: 700; text-decoration: none; }
.hn:hover { text-decoration: underline; }
.il { color: var(--ink-2); }
.row-text { margin: 5px 0 0; color: var(--ink-2); font-size: 13.5px; }
.list.quiet .row { padding: 11px 18px; }
.list.quiet .row-text { color: var(--ink-3); font-size: 13px; }
.empty { padding: 28px; text-align: center; color: var(--ink-3); }

/* 표 */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--paper); font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none; color: var(--ink-2); }
.chip span { color: var(--ink-3); font-size: 12px; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.on span { color: rgba(255, 255, 255, .7); }
.tbl-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { padding: 10px 14px; text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); background: #fafbfc; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th.center { text-align: center; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tr.link { cursor: pointer; }
.tbl tr.link:hover td { background: #fafbfc; }
.tbl tr.dim td { color: var(--ink-3); }
.tbl tr.dim .badge, .tbl tr.dim .kind { opacity: .75; }
.tbl tr.bad-row td { background: #fffafa; }
.tbl td.err-cell { max-width: 420px; color: var(--ink-2); }
.tbl .btn + .btn { margin-left: 4px; }
.prog { display: inline-block; width: 64px; height: 6px; margin-right: 8px; border-radius: 3px; background: var(--panel); overflow: hidden; vertical-align: middle; }
.prog i { display: block; height: 100%; background: var(--ink); border-radius: 3px; }
.foot-note { margin: 10px 2px 0; font-size: 12.5px; color: var(--ink-3); }
.foot-note.top { margin: 0 2px 10px; }
.raw { color: var(--ink-2); }

/* 대화상자 · 알림 */
dialog.dlg { width: min(480px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 14px; color: var(--ink); box-shadow: 0 24px 64px rgba(17, 19, 24, .28); }
dialog.dlg.wide { width: min(640px, calc(100vw - 32px)); }
dialog.dlg::backdrop { background: rgba(17, 19, 24, .4); }
.dlg header { padding: 20px 22px 0; }
.dlg h2 { margin: 0; font-size: 18px; font-weight: 700; }
.dlg-body { padding: 12px 22px 4px; color: var(--ink-2); font-size: 14px; }
.dlg-body p { margin: 8px 0; }
.dlg footer { display: flex; justify-content: flex-end; gap: 8px; padding: 18px 22px 20px; }
.dlg-item { line-height: 1.7; }
.confirm { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 6px 0 10px; }
.cl { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 13.5px; }
.cl:first-child { border-top: 0; }
.cl .k { color: var(--ink-3); font-size: 12.5px; padding-top: 1px; }
.cl.warn { background: var(--amber-bg); }
.cl.warn .k { color: var(--amber); font-weight: 600; }
.send-at { font-size: 15px; color: var(--ink); }
.secret { font-size: 18px; letter-spacing: .06em; color: var(--ink); }
.note { margin: 10px 0; padding: 10px 12px; border-radius: 8px; background: var(--panel); color: var(--ink-2); font-size: 13px; }
.facts { margin: 8px 0; padding-left: 18px; font-size: 13.5px; }
.facts li { margin: 4px 0; }
.raw-box { margin: 4px 0 6px; padding: 10px 12px; background: var(--panel); border-radius: 8px; color: var(--ink); }
.plan-preview { margin-top: 14px; padding: 10px 12px; border-radius: 8px; background: var(--blue-bg); color: var(--ink-2); font-size: 13px; }
.plan-preview:empty { display: none; }
.plan-preview .warn { margin-top: 4px; color: var(--amber); }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 1000; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 12px; padding: 11px 12px 11px 16px; border-radius: 10px; background: var(--dark); color: #fff; font-size: 13.5px; box-shadow: 0 12px 32px rgba(0, 0, 0, .22); }
.toast.bad { background: #7a1a12; }
.toast button { height: 28px; padding: 0 10px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 6px; background: transparent; color: #fff; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.toast button.x { border: 0; font-size: 18px; padding: 0 6px; opacity: .7; }
.seg { display: inline-flex; padding: 3px; border-radius: 9px; background: var(--panel); border: 1px solid var(--line); }
.seg button, .seg a { height: 26px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.seg .on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(17, 19, 24, .12); }
.seg.big a { height: 32px; padding: 0 14px; font-size: 13.5px; }

/* 검수 */
.rv { display: flex; flex-direction: column; height: 100vh; min-height: 600px; }
.rv-head { flex: none; padding: 14px 22px 12px; background: var(--paper); border-bottom: 1px solid var(--line); }
.rv-head:has(.org-tabs) { padding-bottom: 0; }
.rv-crumb { display: flex; gap: 6px; font-size: 12.5px; color: var(--ink-3); }
.rv-crumb a { text-decoration: none; }
.rv-crumb a:hover { color: var(--ink); text-decoration: underline; }
.rv-title { display: flex; align-items: center; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.rv-title h1 { margin: 0; font-size: 20px; font-weight: 800; }
.rv-title .ver { font-weight: 500; color: var(--ink-3); font-size: 16px; margin-left: 2px; }
.rv-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 4px; font-size: 13px; color: var(--ink-2); }
.org-tabs { display: flex; gap: 2px; margin-top: 10px; overflow-x: auto; }
.org-tab { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--ink-3); font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.org-tab:hover { color: var(--ink); }
.org-tab.on { color: var(--ink); border-bottom-color: var(--ink); }
.rv-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 146px minmax(0, 1fr) 356px; }
.rv-rail { overflow-y: auto; padding: 10px 0 20px; background: var(--panel); border-right: 1px solid var(--line); }
.thumb { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; width: 100%; padding: 6px 0; border: 0; background: none; cursor: pointer; content-visibility: auto; contain-intrinsic-size: 146px 186px; }
.tbox { display: block; width: 112px; height: 159px; overflow: hidden; border-radius: 2px; background: #fff; box-shadow: 0 0 0 1px var(--line-2), 0 1px 3px rgba(17, 19, 24, .08); }
.tbox.ph { display: grid; place-items: center; color: var(--ink-3); font-size: 18px; }
.thumb:hover .tbox { box-shadow: 0 0 0 1px var(--ink-3), 0 1px 3px rgba(17, 19, 24, .08); }
.thumb.on .tbox { box-shadow: 0 0 0 2px var(--blue); }
.thumb .no { font-size: 11.5px; color: var(--ink-3); }
.thumb.on .no { color: var(--blue); font-weight: 700; }
.thumb .flag { position: absolute; top: 2px; right: 10px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; }
.thumb .flag.block { background: #e5484d; }
.thumb .flag.warn { background: #f5a524; }
.thumb .flag.info { display: none; }
.rv-stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #dfe2e8; }
.rv-toolbar { flex: none; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px 0 16px; background: var(--paper); border-bottom: 1px solid var(--line); }
.pgno { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 70px; }
.rv-toolbar .sep { width: 1px; height: 20px; background: var(--line); }
.rv-canvas { flex: 1; min-height: 0; overflow-x: auto; overflow-y: hidden; }
.rv-sizer { position: relative; margin: 0 auto; overflow: hidden; }
.rv-sizer iframe { position: absolute; left: 0; top: 0; border: 0; transform-origin: 0 0; background: #dfe2e8; }
.rv-panel { overflow-y: auto; background: var(--paper); border-left: 1px solid var(--line); }
.panel-sec { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.panel-sec:last-child { border-bottom: 0; }
.panel-h { margin: 0 0 10px; font-size: 14px; font-weight: 700; }
.panel-h:not(:first-child) { margin-top: 18px; }
.why { margin: 8px 0 0; padding: 9px 11px; border-radius: 8px; background: var(--red-bg); color: var(--red); font-size: 13px; line-height: 1.45; }
.why.ok { background: var(--green-bg); color: var(--green); }
.panel-note { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
.undo { display: grid; gap: 2px; margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--amber-bg); color: var(--amber); font-size: 12.5px; }
.undo b { font-size: 13.5px; color: #6b3b05; }
.undo .left { font-variant-numeric: tabular-nums; font-weight: 700; }
.btn-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.actions .btn-row .btn { flex: 1; }
.chk-sum { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.chk-group { margin-top: 12px; }
.chk-head { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 6px; }
.chk-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); flex: none; }
.chk-dot.red { background: #e5484d; }
.chk-dot.amber { background: #f5a524; }
.chk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.chk { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); text-align: left; cursor: pointer; font-size: 13px; color: var(--ink); }
.chk:hover { border-color: var(--ink-3); }
.chk.nopage { cursor: default; }
.chk.nopage:hover { border-color: var(--line); }
.chk-group.block .chk { border-color: var(--red-line); background: #fffafa; }
.chk-group.warn .chk { border-color: var(--amber-line); background: #fffcf6; }
.chk-msg { line-height: 1.45; }
.chk-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.chk-meta .pg { font-size: 11.5px; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: var(--panel); color: var(--ink-2); white-space: nowrap; }
.chk-meta .pg.none { font-weight: 500; color: var(--ink-3); }
.chk-meta .org { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.chk-meta .org.other { color: var(--blue-ink); }
.chk-detail { grid-column: 1 / -1; font-size: 12px; color: var(--ink-3); line-height: 1.45; }
.chk-none { margin: 0; font-size: 12.5px; color: var(--ink-3); }
.ver-list, .rc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.ver-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ver-list li a { font-weight: 700; min-width: 24px; }
.ver-list li.on a { color: var(--blue); }
.ver-list li .small { flex-basis: 100%; }
.rc-list li { display: flex; flex-wrap: wrap; gap: 2px 6px; align-items: baseline; }
.rc-list li .mono { flex-basis: 100%; color: var(--ink-3); font-size: 12px; }
.log-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13px; }
.log-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; line-height: 1.45; }
.log-list li > div { flex-basis: 100%; color: var(--ink-2); }
.log-list .err-line { color: var(--red); }
.rv-body.novers { grid-template-columns: minmax(0, 1fr) 356px; }
.rv-body.novers .rv-stage { display: grid; place-items: center; background: var(--panel); }

/* 일정 */
.strip-wrap { margin-bottom: 20px; }
.strip { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 6px; }
.strip.d8 { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.dcell { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 0 7px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); cursor: pointer; }
.dcell:hover { border-color: var(--line-2); }
.dcell .dw { font-size: 11px; color: var(--ink-3); }
.dcell .dd { font-size: 12.5px; font-weight: 600; }
.dcell .dn { font-size: 20px; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
.dcell .dm { display: flex; gap: 3px; height: 6px; }
.dcell .dm i { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
.dcell.we, .dcell.hol { background: transparent; }
.dcell.we .dn, .dcell.hol .dn { color: var(--ink-3); }
.dcell.hol .dw, .dcell.hol .dd { color: var(--red); }
.dcell.today { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: var(--paper); }
.strip-sum { margin-top: 8px; font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 4px; }
.leg-m { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); margin-left: 4px; }
.day { margin-top: 18px; scroll-margin-top: 16px; }
.day-h { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 14px; font-weight: 700; }
.day-h .rel { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.day.is-today .day-h .rel { color: var(--blue); }
.day-h .muted { font-size: 12.5px; font-weight: 500; }
.slist { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.srow { display: grid; grid-template-columns: 46px minmax(140px, 200px) minmax(170px, 230px) 100px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 13px; min-height: 48px; }
.srow:first-child { border-top: 0; }
.c-label { display: flex; flex-direction: column; line-height: 1.35; }
.c-label .pd { font-size: 12px; color: var(--ink-3); }
.c-note { color: var(--ink-2); font-size: 12.5px; line-height: 1.45; }
.c-note .by { margin-left: 6px; color: var(--ink-3); }
.c-note .by::before, .tbl .note-cell .by::before { content: "· "; }
.c-note .moved { font-weight: 600; color: var(--amber); }
.dot-sep { margin: 0 6px; color: var(--line-2); }
.c-act { display: flex; gap: 2px; justify-content: flex-end; white-space: nowrap; }
.srow.skipped { background: #fbfbfc; }
.srow.skipped .lb, .srow.skipped .pd, .srow.skipped .c-name .hn { text-decoration: line-through; text-decoration-color: #9aa0ab; color: var(--ink-3); font-weight: 500; }
.srow.skipped .kind { opacity: .55; }
.picker { display: flex; align-items: center; gap: 10px; }
.picker span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.picker select { width: 280px; }
.contract-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 20px; margin-bottom: 12px; flex-wrap: wrap; }
.contract-card h2 { margin: 0 0 6px; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.cc-facts { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13px; color: var(--ink-2); }
.cc-facts b { color: var(--ink-3); font-weight: 500; margin-right: 4px; }
.cc-counts { display: flex; gap: 4px; }
.cc-counts div { display: flex; flex-direction: column; align-items: center; min-width: 56px; padding: 4px 8px; border-left: 1px solid var(--line); }
.cc-counts div:first-child { border-left: 0; }
.cc-counts b { font-size: 20px; font-variant-numeric: tabular-nums; }
.cc-counts span { font-size: 12px; color: var(--ink-3); }
.tl-card { padding: 14px 0 12px; margin-bottom: 8px; overflow-x: auto; }
.tl { position: relative; min-width: 760px; padding-bottom: 22px; }
.tl-ticks { position: relative; height: 24px; margin: 0 20px 0 140px; border-bottom: 1px solid var(--line); }
.tick { position: absolute; bottom: 0; transform: translateX(-50%); font-size: 11px; color: var(--ink-3); white-space: nowrap; display: flex; flex-direction: column; align-items: center; }
.tick em { font-style: normal; }
.tick::after { content: ""; width: 1px; height: 5px; margin-top: 2px; background: var(--line-2); }
.tl-lane { display: flex; align-items: center; height: 46px; border-bottom: 1px dashed var(--line); }
.tl-name { flex: none; width: 140px; padding-left: 18px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.tl-track { position: relative; flex: 1; height: 100%; margin-right: 20px; }
.tl-today { position: absolute; top: 24px; bottom: 22px; left: calc(140px + (100% - 160px) * var(--p)); width: 0; border-left: 2px solid var(--blue); pointer-events: none; }
.tl-today span { position: absolute; bottom: -20px; left: 0; transform: translateX(-50%); padding: 0 6px; border-radius: 4px; background: var(--blue); color: #fff; font-size: 11px; line-height: 18px; white-space: nowrap; }
.mk { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; padding: 0; border: 2px solid var(--blue); border-radius: 50%; background: #fff; cursor: pointer; }
.mk.k-start, .mk.k-monthly, .mk.k-closing { width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 5px; }
.mk.k-closing { border-radius: 2px; transform: rotate(45deg); }
.mk.st-published { background: var(--ink); border-color: var(--ink); }
.mk.st-review, .mk.st-waiting_measurement { background: #ffb400; border-color: #c98700; }
.mk.st-checks_failed { background: #e5484d; border-color: #c62a2f; }
.mk.st-generating { background: var(--blue-bg); border-color: var(--blue); }
.mk.st-skipped { background: #fff; border-color: #b8bdc8; overflow: hidden; }
.mk.st-skipped::after { content: ""; position: absolute; left: 50%; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: #b8bdc8; transform: rotate(45deg); }
.mk.st-before_service, .mk.st-cancelled, .mk.st-withdrawn { background: var(--panel); border-color: var(--line-2); }
.mk:hover { box-shadow: 0 0 0 4px rgba(47, 107, 255, .18); z-index: 2; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 18px 0; font-size: 12px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; }
.legend .mk { position: relative; top: auto; margin: 0 6px 0 0; cursor: default; }
.legend .mk:hover { box-shadow: none; }
.tbl.sched { table-layout: fixed; min-width: 980px; }
.tbl.sched td { padding: 9px 14px; }
.tbl.sched tr.skipped td { background: #fbfbfc; }
.tbl.sched tr.skipped .strike { text-decoration: line-through; text-decoration-color: #9aa0ab; color: var(--ink-3); }
.tbl.sched tr.skipped .kind { opacity: .55; }
.tbl.sched tr.past:not(.skipped) td { color: var(--ink-2); }
.tbl .note-cell { font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.tbl .note-cell .by { margin-left: 6px; color: var(--ink-3); }
.tbl .note-cell .moved { font-weight: 600; color: var(--amber); }
@keyframes flash { from { background: #fff3c4; } to { background: transparent; } }
.tbl tr.flash td { animation: flash 1.6s ease-out; }

/* 병원 상세 */
.page-head.detail { margin-bottom: 14px; }
.tabs { display: flex; gap: 2px; margin: 0 0 18px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; text-decoration: none; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--ink); }
.tabs a .muted { font-weight: 500; }
.facts-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 8px; }
.fact { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.fact .k { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.fact b { font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fact .s { font-size: 12px; color: var(--ink-3); }
.empty-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px; }
.empty-card p { margin: 0; line-height: 1.7; }
.spec-card { padding: 8px 20px 18px; max-width: 720px; }
.spec { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.spec th { width: 150px; padding: 11px 0; text-align: left; font-weight: 500; color: var(--ink-3); border-bottom: 1px solid var(--line); vertical-align: top; }
.spec td { padding: 11px 0; border-bottom: 1px solid var(--line); }
.spec.compact th, .spec.compact td { padding: 7px 0; font-size: 13px; }
.spec.compact th { width: 130px; }

/* gpto.io 연결 */
.cap-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cap-list { display: grid; gap: 12px; }
.cap-status, .cap-login { padding: 18px 20px; }
.cap-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cap-top h2 { margin: 0; font-size: 16px; }
.cap-status .cap-top .badge { height: 26px; font-size: 13px; padding: 0 10px; }
.cap-status.needs_login, .cap-status.broken { border-color: var(--red-line); box-shadow: inset 0 3px 0 #e5484d; }
.cap-status.ok { box-shadow: inset 0 3px 0 #22c55e; }
.cap-status.login_in_progress { box-shadow: inset 0 3px 0 #ffb400; }
.cap-sentence { margin: 10px 0 12px; color: var(--ink-2); }
.cap-jobs { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.cap-jobs h3 { margin: 0 0 8px; font-size: 13px; }
.cap-jobs ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.live { margin-top: 12px; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.live-bar { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
.live-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.live-bar .url { margin-left: 10px; flex: 1; height: 22px; line-height: 22px; padding: 0 10px; border-radius: 6px; background: var(--paper); font-size: 12px; color: var(--ink-3); font-family: var(--mono); }
.live-view { aspect-ratio: 16 / 10; background: #fafbfc; display: grid; place-items: center; }
.live-view iframe { width: 100%; height: 100%; border: 0; }
.live-ph { max-width: 360px; padding: 20px; text-align: center; color: var(--ink-2); display: grid; gap: 6px; font-size: 13.5px; }
.live-ph b { color: var(--ink); font-size: 15px; }
.live-ph ol { text-align: left; margin: 8px 0 0; padding-left: 18px; color: var(--ink-3); font-size: 13px; }

/* 태블릿 */
@media (max-width: 1100px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; height: auto; flex-direction: row; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 10px 16px; flex: none; }
  .brand .sub { display: none; }
  .brand::after { left: 16px; bottom: 4px; }
  .nav { flex-direction: row; padding: 6px; overflow-x: auto; flex: 1; }
  .nav a { padding: 8px 10px; }
  .side .foot { display: none; }
  .main { padding: 20px 20px 48px; }
  .tiles, .facts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* 검수: 미리보기 + 오른쪽 점검 칸, 쪽 썸네일은 위쪽 쪽 번호 줄로 */
  .rv { height: calc(100vh - 50px); min-height: 560px; }
  .rv-head { padding: 10px 16px 10px; }
  .rv-body { grid-template-columns: minmax(0, 1fr) 316px; grid-template-rows: auto minmax(0, 1fr); }
  .rv-rail { grid-column: 1; grid-row: 1; display: flex; gap: 4px; overflow-x: auto; overflow-y: hidden; padding: 7px 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .rv-stage { grid-column: 1; grid-row: 2; }
  .rv-panel { grid-column: 2; grid-row: 1 / span 2; }
  .thumb { width: auto; padding: 0; content-visibility: visible; }
  .thumb .tbox { display: none; }
  .thumb .no { display: grid; place-items: center; min-width: 30px; height: 28px; padding: 0 6px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--paper); font-size: 12px; color: var(--ink-2); }
  .thumb.on .no { background: var(--ink); border-color: var(--ink); color: #fff; }
  .thumb .flag { top: -3px; right: -3px; width: 10px; height: 10px; }
  .panel-sec { padding: 14px; }
  .srow { grid-template-columns: 46px minmax(0, 1fr) auto; grid-template-areas: "k n s" "k l l" "k o o" "k a a"; row-gap: 4px; }
  .srow .c-kind { grid-area: k; align-self: start; }
  .srow .c-name { grid-area: n; }
  .srow .c-label { grid-area: l; flex-direction: row; gap: 8px; }
  .srow .c-status { grid-area: s; }
  .srow .c-note { grid-area: o; }
  .srow .c-note:empty { display: none; }
  .srow .c-act { grid-area: a; justify-content: flex-start; }
  .strip { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .cap-grid { grid-template-columns: 1fr; }
  .input.search { width: 100%; }
}
@media (max-width: 760px) {
  .rv { height: auto; min-height: 0; }
  .rv-body { grid-template-columns: 1fr; grid-template-rows: auto; }
  .rv-rail, .rv-stage, .rv-panel { grid-column: auto; grid-row: auto; }
  .rv-stage { height: 70vh; }
  .rv-panel { border-left: 0; }
}
@media (max-width: 640px) {
  .row { grid-template-columns: 1fr; gap: 8px; }
  .when { flex-direction: row; gap: 8px; }
  .row-act { justify-self: start; }
  .tiles, .facts-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tile .v { font-size: 28px; }
}

/* 병원 추가 대화상자: 묶음 제목 · 전달할 로그인 정보 */
.dlg-h { margin: 14px 0 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.02em; color: var(--ink-3); text-transform: uppercase; }
.dlg-h:first-child { margin-top: 0; }
.spec.cred th { width: 110px; }
.spec.cred .mono.big { font-size: 18px; letter-spacing: 0.02em; user-select: all; }
.tbl td.right { text-align: right; white-space: nowrap; }
