:root{
  --ground:#F4F5F8; --surface:#FFFFFF; --ink:#12151C; --muted:#5B6270; --line:#E2E5EB; --field:#CBD0D9;
  --blue:#1E4FD8; --blue-d:#163BA6; --blue-soft:#E8EEFD; --blue-mid:#9DB4F2;
  --green:#12703A; --green-soft:#E5F4EA; --orange:#B4410F; --orange-soft:#FDEDE4; --orange-ink:#7A2C0A;
  --gray-chip:#EEF0F4; --gray-ink:#4A505C; --stage:#1D2230;
  --r-sm:10px; --r:14px; --r-lg:18px;
}
*{box-sizing:border-box}
[hidden]{display:none!important}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--ground);color:var(--ink);font-family:'Pretendard','Noto Sans KR',-apple-system,BlinkMacSystemFont,'Apple SD Gothic Neo','Malgun Gothic',system-ui,sans-serif;font-size:15px;line-height:1.5}
a{color:var(--blue);text-decoration:none}a:hover{color:var(--blue-d)}
h1,h2,h3{margin:0;letter-spacing:-0.01em}
button,input,select,textarea{font:inherit;color:inherit}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* 머리글 */
.topbar{background:var(--surface);border-bottom:1px solid var(--line);position:sticky;top:0;z-index:10}
.topbar .in{max-width:1200px;margin:0 auto;padding:10px 16px;display:flex;flex-wrap:wrap;align-items:center;gap:8px 20px}
.brand{display:flex;flex-direction:column;line-height:1.2}
.brand small{font-size:11px;font-weight:700;letter-spacing:.12em;color:var(--blue)}
.brand b{font-size:19px;font-weight:900}
.topnav{display:flex;gap:4px;flex:0 1 auto;overflow-x:auto;scrollbar-width:none}
.topnav a{height:44px;padding:0 14px;border-radius:12px;color:var(--gray-ink);display:flex;align-items:center;white-space:nowrap;font-size:14px}
.topnav a.on{background:var(--blue-soft);color:var(--blue);font-weight:700}
.gear{width:44px;height:44px;border-radius:12px;display:flex;align-items:center;justify-content:center;color:var(--gray-ink);margin-left:auto;flex:0 0 auto}
.gear:hover{background:var(--ground);color:var(--ink)}.gear.on{background:var(--blue-soft);color:var(--blue)}
.subnav{border-top:1px solid #EEF0F4;background:var(--surface)}
.subnav .in{max-width:1200px;margin:0 auto;padding:4px 16px;display:flex;gap:4px;overflow-x:auto;scrollbar-width:none}
.subnav a{height:40px;padding:0 12px;display:flex;align-items:center;font-size:14px;color:var(--gray-ink);white-space:nowrap;border-bottom:3px solid transparent}
.subnav a.on{color:var(--blue);font-weight:700;border-bottom-color:var(--blue)}
.wrap{max-width:1200px;margin:0 auto;padding:20px 16px 40px;display:flex;flex-direction:column;gap:20px}
.pagehead{display:flex;align-items:center;gap:6px}
.back{width:44px;height:44px;display:flex;align-items:center;justify-content:center;border-radius:12px;color:var(--ink)}
.pagehead h1{font-size:20px;font-weight:700}
.sub{font-size:13px;color:var(--muted)}

/* 기본 블록 */
.card{background:var(--surface);border-radius:var(--r-lg);padding:16px;display:flex;flex-direction:column;gap:10px}
.card.link{color:var(--ink)}
.card.link:hover{outline:2px solid var(--blue-mid)}
.row{display:flex;align-items:center;gap:8px}
.between{justify-content:space-between}
.wrapflex{flex-wrap:wrap}
.grow{flex:1 1 auto;min-width:0}
.stack{display:flex;flex-direction:column;gap:12px}
.section-title{font-size:17px;font-weight:700}
.grid-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px}
.stat{background:var(--surface);border-radius:var(--r-lg);padding:14px 16px;display:flex;flex-direction:column;gap:2px}
.stat span{font-size:13px;color:var(--muted)}
.stat b{font-size:30px;font-weight:900}
.grid-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(290px,1fr));gap:12px}
.two-col{display:flex;flex-wrap:wrap;gap:20px;align-items:flex-start}
.two-col>.main{flex:999 1 520px;min-width:0;display:flex;flex-direction:column;gap:14px}
.two-col>.side{flex:1 1 300px;min-width:0;display:flex;flex-direction:column;gap:14px}

.chip{display:inline-flex;align-items:center;font-size:12px;font-weight:700;border-radius:999px;padding:4px 10px;white-space:nowrap}
.chip.blue{color:var(--blue);background:var(--blue-soft)}
.chip.green{color:var(--green);background:var(--green-soft)}
.chip.orange{color:var(--orange);background:var(--orange-soft)}
.chip.gray{color:var(--gray-ink);background:var(--gray-chip)}
.note{border-radius:12px;padding:10px 12px;font-size:14px;line-height:1.55}
.note.blue{background:var(--blue-soft);color:#16348F}
.note.orange{background:var(--orange-soft);color:var(--orange-ink)}
.note.green{background:var(--green-soft);color:#0E5A2E}
.bars{display:grid;gap:4px}
.bars span{height:6px;border-radius:3px;background:var(--line)}
.bars span.on{background:var(--blue)}.bars span.half{background:var(--blue-mid)}.bars span.ok{background:var(--green)}
.progress{height:6px;border-radius:3px;background:var(--line);overflow:hidden}
.progress>div{height:100%;background:var(--blue)}

/* 버튼·입력 */
.btn{height:50px;padding:0 18px;border-radius:var(--r);border:1px solid var(--field);background:var(--surface);color:var(--ink);font-size:15px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;gap:8px;cursor:pointer;text-decoration:none}
.btn:hover{color:var(--ink);border-color:var(--gray-ink)}
.btn.primary{background:var(--blue);border-color:var(--blue);color:#fff}.btn.primary:hover{background:var(--blue-d);color:#fff}
.btn.dark{background:var(--ink);border-color:var(--ink);color:#fff}
.btn.danger{border:2px solid var(--orange);color:var(--orange)}
.btn.small{height:40px;padding:0 12px;font-size:14px;border-radius:10px}
.btn.block{width:100%}
.btn[disabled]{opacity:.45;cursor:not-allowed}
.field{display:flex;flex-direction:column;gap:6px}
.field label,.label{font-size:13px;font-weight:500;color:var(--muted)}
.input,select.input,textarea.input{height:48px;border-radius:12px;border:1px solid var(--field);background:var(--surface);padding:0 12px;font-size:16px;width:100%;min-width:0}
textarea.input{height:auto;padding:10px 12px;line-height:1.5;resize:vertical}
.input:focus{outline:2px solid var(--blue);outline-offset:0;border-color:var(--blue)}
.seg{display:inline-grid;grid-auto-flow:column;grid-auto-columns:1fr;background:var(--ground);border-radius:10px;padding:3px;gap:2px}
.seg button{height:40px;border:none;border-radius:8px;background:transparent;color:var(--gray-ink);font-size:13px;padding:0 10px;cursor:pointer}
.seg button.on{background:var(--ink);color:#fff;font-weight:700}
.segopt{display:flex}.segopt span{flex:1;height:42px;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:14px;color:var(--gray-ink);cursor:pointer}
.segopt input:checked+span{background:var(--ink);color:#fff;font-weight:700}
.segopt input:focus-visible+span{outline:2px solid var(--blue)}
.check{display:flex;align-items:center;gap:10px;cursor:pointer}
.check input{width:22px;height:22px;accent-color:var(--blue);margin:0;flex:0 0 auto}
.drop{border:2px dashed var(--blue-mid);border-radius:var(--r-lg);padding:22px 16px;display:flex;flex-direction:column;align-items:center;gap:8px;text-align:center;cursor:pointer;background:var(--surface)}
.drop.has{border-style:solid;border-color:var(--green)}
.tplpick{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.tplpick label{border:1px solid var(--line);background:var(--surface);border-radius:var(--r);padding:8px;display:flex;flex-direction:column;gap:6px;cursor:pointer;font-size:13px;text-align:center}
.tplpick input{position:absolute;opacity:0}
.tplpick label:has(input:checked){border:2px solid var(--blue);color:var(--blue);font-weight:700;padding:7px}
.thumb{height:56px;border-radius:8px;background:var(--stage);display:flex;padding:6px}
.thumb.bar{align-items:flex-end}.thumb.bar i{height:12px;flex:1;border-radius:3px;background:var(--blue)}
.thumb.news{flex-direction:column;justify-content:flex-end;gap:2px}.thumb.news i{height:6px;width:40%;background:#F2B33D}.thumb.news em{height:10px;background:#fff}
.thumb.center{align-items:center;justify-content:center}.thumb.center i{height:14px;width:70%;border-radius:3px;background:#fff}

/* 하단 메뉴 (휴대폰) */
.bottomnav{display:none}
@media (max-width:719px){
  .topnav{display:none}
  .subnav{display:none}
  .bottomnav{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));position:sticky;bottom:0;background:var(--surface);border-top:1px solid var(--line);height:64px;z-index:10}
  .bottomnav a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:12px;color:var(--muted)}
  .bottomnav a.on{color:var(--blue);font-weight:700}
  .wrap{padding-bottom:24px}
}

/* 자막 미리보기 */
.screen{position:relative;width:100%;aspect-ratio:16/9;border-radius:var(--r-lg);background:var(--stage);overflow:hidden;container-type:inline-size}
.screen .label{position:absolute;top:10px;left:12px;font-size:11px;font-weight:700;letter-spacing:.08em;color:#C9CEDA}
.screen .num{position:absolute;top:10px;right:12px;font-size:11px;font-weight:700;color:#C9CEDA}
.sub-bar{position:absolute;left:4%;right:4%;bottom:7%;background:var(--blue);border-radius:8px;padding:2.2cqw 3cqw;text-align:center;color:#fff;font-size:clamp(14px,4.3cqw,30px);font-weight:700;line-height:1.45;white-space:pre-line}
.sub-news{position:absolute;left:4%;right:4%;bottom:7%;display:flex;flex-direction:column;align-items:flex-start}
.sub-news .tag{background:#F2B33D;color:var(--ink);font-size:clamp(11px,2.6cqw,16px);font-weight:900;padding:3px 8px}
.sub-news .txt{align-self:stretch;background:#fff;color:var(--ink);padding:1.8cqw 2.6cqw;font-size:clamp(14px,4.3cqw,30px);font-weight:700;line-height:1.45;white-space:pre-line}
.sub-center{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:6%;text-align:center;color:#fff;font-size:clamp(18px,6cqw,42px);font-weight:900;line-height:1.4;white-space:pre-line;text-shadow:0 2px 8px rgba(0,0,0,.6)}

/* 검토 화면: 휴대폰·태블릿은 위에서 아래로(목록은 맨 아래), PC는 왼쪽 목록 + 오른쪽 작업 */
.review{display:flex;flex-direction:column;gap:16px}
.review .list{order:2;min-width:0;background:var(--surface);border-radius:var(--r-lg);padding:10px;display:flex;flex-direction:column;gap:4px}
.review .work{order:1;min-width:0;display:flex;flex-direction:column;gap:14px}
.toprow{display:flex;flex-wrap:wrap;gap:14px;align-items:flex-start}
.toprow .screen{flex:999 1 460px}
.toprow .side{flex:1 1 260px;min-width:0;display:flex;flex-direction:column;gap:12px}
@media (min-width:1024px){
  .review{flex-direction:row;align-items:flex-start}
  .review .list{order:0;flex:0 0 300px;position:sticky;top:84px;max-height:calc(100vh - 104px);overflow:auto}
  .review .work{flex:1 1 auto}
}
.li{display:flex;align-items:center;gap:8px;min-height:48px;padding:6px 10px;border-radius:12px;border:1px solid transparent;background:transparent;cursor:pointer;text-align:left;width:100%}
.li.on{border:2px solid var(--blue);background:var(--blue-soft);padding:5px 9px}
.li .n{font-size:12px;font-weight:700;color:var(--muted);width:28px;flex:0 0 auto}
.li .t{flex:1 1 auto;min-width:0;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.textbox{min-height:96px;border-radius:12px;background:var(--ground);padding:10px 12px;font-size:18px;line-height:1.5;white-space:pre-line}
.textedit{min-height:96px;border-radius:12px;border:2px solid var(--blue);padding:10px 12px;font-size:18px;line-height:1.5;width:100%;resize:vertical}
.orig{font-size:13px;color:var(--muted);white-space:pre-line}.orig s{color:var(--muted)}
.tplbtns{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.tplbtns button{height:44px;border-radius:12px;border:1px solid var(--line);background:var(--surface);font-size:13px;white-space:nowrap;padding:0 4px;cursor:pointer}
.tplbtns button.on{border:2px solid var(--blue);background:var(--blue-soft);color:var(--blue);font-weight:700}
.actions{display:flex;gap:10px}
.actions .prev{width:56px;height:56px;flex:0 0 auto;padding:0}
.actions .next{flex:1 1 auto;height:56px;font-size:16px}
@media (max-width:719px){
  /* 휴대폰: 미리보기 → 텍스트 → 템플릿 순서, 확인 버튼은 화면 아래 고정 */
  .toprow{display:contents}
  .work>.head{order:0}.toprow .screen{order:1}.work>.textcard{order:2}.toprow .side{order:3}
  .actionbar{position:fixed;left:0;right:0;bottom:0;background:var(--surface);border-top:1px solid var(--line);padding:10px 16px calc(12px + env(safe-area-inset-bottom));z-index:20}
  body.has-actionbar .wrap{padding-bottom:96px}
}
.flagcard{border:2px solid transparent}
.flagcard.on{border-color:var(--orange)}
.flagcard .flagnote{display:none}
.flagcard.on .flagnote{display:block}
.flagnote input{background:var(--orange-soft);border-color:#F0B999;color:var(--orange-ink);height:42px;font-size:14px}
.timeline{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.timeline li{display:flex;gap:10px;font-size:14px}
.timeline .dot{width:10px;height:10px;border-radius:5px;margin-top:6px;flex:0 0 auto;background:var(--blue)}
.timeline .dot.green{background:var(--green)}.timeline .dot.orange{background:var(--orange)}.timeline .dot.gray{background:#8A909C}
.toast{position:fixed;left:50%;bottom:84px;transform:translateX(-50%);background:var(--ink);color:#fff;padding:10px 16px;border-radius:12px;font-size:14px;z-index:50;opacity:0;transition:opacity .2s;pointer-events:none}
.toast.show{opacity:1}
.center{text-align:center;align-items:center}
.member{display:flex;flex-wrap:wrap;align-items:center;gap:8px 10px;padding:10px 0;border-top:1px solid #EEF0F4}
.member:first-of-type{border-top:none}
.person{border-top:1px solid #EEF0F4;padding-top:12px;display:flex;flex-direction:column;gap:8px}
.numdot{width:26px;height:26px;border-radius:13px;background:var(--blue-soft);color:var(--blue);font-size:13px;font-weight:700;display:flex;align-items:center;justify-content:center;flex:0 0 auto}
.numdot.dark{background:var(--ink);color:#fff}
.iconbtn{width:44px;height:44px;border:none;background:transparent;border-radius:10px;display:flex;align-items:center;justify-content:center;cursor:pointer;color:var(--muted)}

/* 방송 대시보드 */
.timer{background:var(--ink);color:#fff;border-radius:22px;padding:20px;display:flex;flex-direction:column;gap:14px}
.timer .big{font-size:clamp(56px,14vw,104px);font-weight:900;line-height:1;letter-spacing:-.03em;font-variant-numeric:tabular-nums}
.timer .big.over{color:#FF9A6B}
.timer .big.live{color:#3DDC84}
.timer .big.soon{color:#FFC94D}
.progress.dark{height:8px;background:#2C3242}.progress.dark>div{background:#6F93FF}
.stat b{font-variant-numeric:tabular-nums}
.stat b span{font-size:inherit;color:inherit}
.chip.red{color:#fff;background:#C2410C}
.segbar{display:flex;gap:4px;height:10px}
.segbar>div{background:#2C3242;border-radius:5px;overflow:hidden;min-width:6px}
.segbar>div i{display:block;height:100%;width:0;background:#6F93FF}
.segbar>div.now i{background:#FF9A6B}
.seglist{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.seg-item{background:var(--surface);border-radius:14px;padding:10px 12px;display:flex;flex-direction:column;gap:0;border:2px solid transparent}
.seg-item b{font-size:18px}
.seg-item.now{border-color:#C2410C}
.seg-item.done{opacity:.55}
@media (max-width:420px){.seglist{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* 자막 운영 */
.subctl{display:grid;grid-template-columns:1fr 1fr 1.4fr 1fr;gap:8px}
.subctl .btn{height:56px;padding:0 8px}
@media (max-width:719px){.subctl{grid-template-columns:1fr 1fr 1.3fr 1fr}.subctl .btn{font-size:14px}}

/* 프롬프터 */
.pview{position:relative;height:min(70vh,720px);overflow-y:auto;background:#000;color:#fff;border-radius:var(--r-lg);scrollbar-width:none}
.pview:fullscreen{height:100vh;border-radius:0}
.pview::-webkit-scrollbar{display:none}
.ptext{padding:40vh 6% 70vh;line-height:1.45;font-weight:700;transform-origin:center}
.ptext p{margin:0 0 1.2em}
.pmark{position:sticky;top:38%;height:0;border-top:3px solid rgba(255,154,107,.85);z-index:2;pointer-events:none}

/* 탈리 */
.tally-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px}
.tally-card{background:var(--surface);border:3px solid var(--line);border-radius:18px;padding:16px;display:flex;flex-direction:column;gap:4px;color:var(--ink);min-height:120px}
.tally-card b{font-size:34px;font-weight:900;line-height:1}
.tally-card small{font-size:12px;color:var(--muted);font-weight:700}
.tally-card.pgm{background:#C2410C;border-color:#C2410C;color:#fff}.tally-card.pgm small{color:#fff}
.tally-card.pvw{background:#12703A;border-color:#12703A;color:#fff}.tally-card.pvw small{color:#fff}
.tally-full{position:fixed;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;background:#2A2F3A;color:#fff;text-align:center;z-index:100}
.tally-full:hover{color:#fff}
.tally-full.pgm{background:#D21F1F}.tally-full.pvw{background:#12803F}.tally-full.off{background:#555}
.tally-full .tnum{font-size:min(40vw,40vh);font-weight:900;line-height:1}
.tally-full .tstate{font-size:min(12vw,10vh);font-weight:900;letter-spacing:.04em}
.tally-full .ttitle{font-size:20px;opacity:.9}
.tally-full .thint{position:absolute;bottom:16px;font-size:13px;opacity:.7}

/* 녹화 표시: 평소 회색, 녹화 중 빨간색 + 깜빡이는 동그라미 */
.stat.rec b{color:#8A909C}
.stat.rec .recstate{display:flex;align-items:center;gap:6px;color:#8A909C;font-size:13px}
.stat.rec span.recstate span{color:inherit;font-size:inherit}
.recdot{width:12px;height:12px;border-radius:50%;background:#B8BDC7;flex:0 0 auto}
.stat.rec.on b{color:#D21F1F}
.stat.rec.on .recstate{color:#D21F1F;font-weight:700}
.stat.rec.on .recdot{background:#E5262A;box-shadow:0 0 0 4px rgba(229,38,42,.18);animation:recblink 1s steps(1,end) infinite}
@keyframes recblink{50%{opacity:.25}}
@media (prefers-reduced-motion:reduce){.stat.rec.on .recdot{animation:none}}

/* CAPTIONS_MOBILE169_V1 폰 세로: 컨펌 미리보기를 화면 너비에 맞춘 16:9로 */
@media (max-width:719px){.toprow .screen{flex:0 0 auto;width:100%;height:auto;aspect-ratio:16/9}}

/* CAPTIONS_MEMBERS_V2 폰에서도 서브메뉴 보이기 + 멤버는 권한 있는 메뉴만 */
@media (max-width:719px){.subnav{display:block}.subnav .in{padding:2px 8px}.subnav a{height:44px;font-size:15px}}
.is-mbr :is(.topnav,.bottomnav,.subnav) a,.is-mbr .gear{display:none!important}
.is-mbr.mperm-dashboard :is(.topnav,.bottomnav) a[href="/"],
.is-mbr.mperm-confirm :is(.topnav,.bottomnav) a[href="/confirm"],.is-mbr.mperm-confirm .subnav a:is([href="/confirm"],[href="/new"],[href="/lines"]),
.is-mbr.mperm-subtitles :is(.topnav,.bottomnav) a[href="/subtitles"],.is-mbr.mperm-subtitles .subnav a[href="/subtitles"],
.is-mbr.mperm-captions :is(.topnav,.bottomnav) a:is([href="/subtitles"],[href="/captions"]),.is-mbr.mperm-captions .subnav a[href="/captions"],
.is-mbr.mperm-prompter :is(.topnav,.bottomnav) a[href="/prompter"],
.is-mbr.mperm-tally :is(.topnav,.bottomnav) a[href="/tally"]{display:flex!important}
.is-mbr.mperm-settings .gear{display:flex!important}
@media (max-width:719px){.is-mbr .bottomnav{grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:1fr}}

/* CAPTIONS_LOGIN_V3 로그아웃 링크 */
.logoutlink{margin-left:auto;font-size:13px;color:var(--muted);padding:8px 10px;border-radius:10px;white-space:nowrap}
.logoutlink:hover{background:var(--ground);color:var(--ink)}
.logoutlink+.gear{margin-left:0}
.is-mbr .logoutlink{display:inline-flex!important}

/* SITES_V1 현장 선택 */
.sitesel{position:relative;margin-left:6px}
.sitesel summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;background:#EEF2FF;color:#1E3A8A;font-weight:700;font-size:13px;white-space:nowrap;max-width:200px;overflow:hidden;text-overflow:ellipsis}
.sitesel summary::-webkit-details-marker{display:none}
.sitesel summary i{width:8px;height:8px;border-radius:50%;background:#2F6BFF;flex:none}
.sitesel summary::after{content:"▾";font-size:11px;opacity:.7}
.sitesel-menu{position:absolute;top:calc(100% + 6px);left:0;z-index:60;min-width:230px;background:#fff;border:1px solid #E3E6EE;border-radius:12px;box-shadow:0 10px 30px rgba(15,23,42,.12);padding:6px}
.sitesel-menu a{display:flex;flex-direction:column;padding:8px 10px;border-radius:8px;color:inherit;text-decoration:none}
.sitesel-menu a:hover{background:#F4F5F8}
.sitesel-menu a.on{background:#EEF2FF}
.sitesel-menu a small{color:#8A93A6;font-size:11px}
.sitesel-menu .sitesel-admin{border-top:1px solid #EEF0F4;margin-top:4px;border-radius:0 0 8px 8px;color:#2F6BFF;font-weight:700;font-size:13px}
.is-mbr .sitesel-admin{display:none}
@media (max-width:760px){.sitesel summary{max-width:120px;font-size:12px}}
.is-mbr .sites-card{display:none}

/* AGENT_V1 vMix 연결 방식 */
.vmode{display:flex;background:#F1F3F7;border-radius:12px;padding:4px;gap:4px}
.vmode button{flex:1;border:0;background:transparent;padding:9px 8px;border-radius:9px;font-weight:700;font-size:14px;color:#5B6375;cursor:pointer}
.vmode button.on{background:#fff;color:#1B2A4E;box-shadow:0 1px 3px rgba(15,23,42,.12)}
.agentbox{display:flex;flex-direction:column;gap:10px;border:1px solid #E3E6EE;border-radius:12px;padding:12px;background:#FAFBFD}

/* AIBRIDGE_V1 */
.aireq{position:fixed;right:16px;bottom:84px;z-index:90;width:min(360px,calc(100vw - 32px));background:#fff;border:2px solid #7048E8;border-radius:14px;box-shadow:0 16px 40px rgba(15,23,42,.22);padding:14px;display:flex;flex-direction:column;gap:6px}
.aireq-h{font-size:12px;font-weight:800;color:#7048E8}
.aireq-p{font-size:12px;color:#5b6375;white-space:pre-wrap;word-break:break-all}
.aireq-b{display:flex;gap:8px;justify-content:flex-end;margin-top:4px}

/* ───────── THEME_V1 공통 바탕: 색 변수 · 다크/화이트 · 머리줄 한 줄 · 버튼 글자 ───────── */
body{word-break:keep-all}
.btn,.chip,.seg button,.vmode button,.tplbtns button{white-space:nowrap}
.tb-right{margin-left:auto;display:flex;align-items:center;gap:4px;flex:0 0 auto}
.tb-right .logoutlink,.tb-right .gear{margin-left:0}
.themebtn{display:none;width:44px;height:44px;border:0;border-radius:12px;background:transparent;color:var(--gray-ink);align-items:center;justify-content:center;cursor:pointer}
.themebtn:hover{background:var(--ground)}
body.dk-ok .themebtn{display:flex}
.zlogo{display:none}
.sitesel-logout{border-top:1px solid #EEF0F4;color:var(--muted)!important;font-size:13px}
@media (max-width:719px){
  .topbar .in{flex-wrap:nowrap;gap:8px;padding:8px 12px}
  .brand small,.brand b{display:none}
  .zlogo{display:flex;width:36px;height:36px;border-radius:10px;background:var(--blue);color:#fff;font-weight:900;font-size:17px;align-items:center;justify-content:center}
  .sitesel{flex:1 1 auto;min-width:0;margin-left:0}
  .sitesel summary{max-width:none;font-size:13px;padding:8px 12px;height:40px}
  .sitesel summary{display:flex}.sitesel summary>span,.sitesel summary{overflow:hidden;text-overflow:ellipsis}
  .tb-right .logoutlink{display:none}
  .is-mbr .tb-right .logoutlink{display:inline-flex!important}
  .themebtn,.gear{width:40px;height:40px}
  input[type=checkbox],input[type=radio]{min-width:22px;min-height:22px}
  .btn.small{min-height:40px}
}

/* 다크 화면 — 새 디자인으로 바꾼 화면(body.dk-ok)에만 적용 */
html[data-theme=dark] body.dk-ok{
  --ground:#0B0E13; --surface:#141922; --ink:#E8ECF2; --muted:#98A2B3; --line:#252D3A; --field:#353F50;
  --blue:#4C7DFF; --blue-d:#3A68E6; --blue-soft:#1A2440; --blue-mid:#3A4F86;
  --green:#3DCB7A; --green-soft:#12301F; --orange:#FF8A4C; --orange-soft:#3A2116; --orange-ink:#FFB08A;
  --gray-chip:#1F2633; --gray-ink:#B7C0CE; --stage:#0E1219;
  color-scheme:dark;
}
html[data-theme=dark] body.dk-ok .btn.dark{background:#E8ECF2;border-color:#E8ECF2;color:#0B0E13}
html[data-theme=dark] body.dk-ok .toast{background:#E8ECF2;color:#0B0E13}
html[data-theme=dark] body.dk-ok .sitesel summary{background:#1A2440;color:#C9D6FF}
html[data-theme=dark] body.dk-ok .sitesel-menu{background:#141922;border-color:#252D3A}
html[data-theme=dark] body.dk-ok .sitesel-menu a:hover,html[data-theme=dark] body.dk-ok .sitesel-menu a.on{background:#1F2633}
html[data-theme=dark] body.dk-ok :is(.subnav,.sitesel-menu .sitesel-admin,.sitesel-logout){border-color:#252D3A}
html[data-theme=dark] body.dk-ok .aireq{background:#141922}
html[data-theme=dark] body.dk-ok .seg button.on,html[data-theme=dark] body.dk-ok .segopt input:checked+span{background:var(--blue);color:#fff}

/* ───────── SIDEBAR_V1 PC(1100px 이상): 위 메뉴를 왼쪽 세로 메뉴로 (시안: PC 대시보드) ───────── */
.nvi{display:none;flex:0 0 auto}
@media (min-width:1100px){
  body:has(>.topbar){padding-left:232px}
  .topbar{position:fixed;left:0;top:0;bottom:0;width:232px;border-bottom:0;border-right:1px solid var(--line);overflow-y:auto;display:flex;flex-direction:column}
  .topbar .in{flex:1 1 auto;flex-direction:column;align-items:stretch;flex-wrap:nowrap;gap:14px;padding:18px 14px 14px;max-width:none;margin:0}
  .topbar .brand{padding:0 6px}
  .sitesel{margin:0}
  .sitesel summary{max-width:none;width:100%;padding:9px 12px}
  .sitesel-menu{min-width:204px}
  .topnav{flex-direction:column;gap:2px;overflow:visible}
  .topnav a{height:44px;gap:10px;padding:0 12px;font-size:15px}
  .nvi{display:block}
  .tb-right{margin:auto 0 0;justify-content:space-between;border-top:1px solid var(--line);padding-top:10px}
  .topbar .subnav{position:fixed;left:232px;right:0;top:0;z-index:9;border-top:0;border-bottom:1px solid var(--line)}
  .topbar .subnav .in{flex-direction:row;padding:4px 20px;gap:4px;max-width:none}
  body:has(.topbar .subnav) .wrap{padding-top:68px}
  .wrap{max-width:1500px}
  body.talent{padding-left:0!important}
}
.sitesel-menu .sitesel-spec{border-bottom:1px solid #EEF0F4;margin-bottom:4px;border-radius:8px 8px 0 0;color:#2F6BFF;font-weight:800;font-size:13px}
html[data-theme=dark] body.dk-ok .sitesel-menu .sitesel-spec{border-color:#252D3A}

/* TOUCH40_V1 휴대폰 · 터치 화면: 체크박스 줄 · 접기 제목 · 현장 모듈 칸을 최소 40px (ABT-39) */
@media (pointer:coarse), (max-width:719px){
  .check, label.modchk{min-height:40px}
  summary{min-height:40px}
}
