/* 관리자 화면 — Austin UI 가이드: 밝은 회색 무대 위 흰 카드, 딥네이비 잉크, 밝은 블루 액션 */
:root { --bg:#eef0f4; --surface:#fff; --ink:#14213d; --blue:#2f6bff; --blue-dark:#1f56e8; --blue-bg:#e8efff; --sub:#66718c; --line:#e3e7f0; --ok:#16a34a;
  --shadow-card: 0 14px 32px -24px rgba(20,33,61,.18), 0 1px 3px rgba(20,33,61,.04); --grad-blue: linear-gradient(180deg,#4a80ff,#2f63f0); --grad-navy: linear-gradient(180deg,#1d2e5c,#14213d); }
* { box-sizing: border-box; }
body { margin:0; font-family:-apple-system,"Apple SD Gothic Neo","Noto Sans KR",sans-serif; background: radial-gradient(140% 90% at 50% -20%, #f8fafd 0%, var(--bg) 65%); color:var(--ink); line-height:1.5; word-break:keep-all; }
.wrap { max-width:1180px; margin:0 auto; padding:28px 20px 64px; }
.top { display:flex; justify-content:space-between; align-items:flex-start; gap:20px; margin-bottom:20px; }
h1 { font-size:28px; font-weight:900; letter-spacing:-.02em; margin:0 0 4px; }
h2 { font-size:17px; font-weight:800; margin:0 0 8px; }
.sub { color:var(--sub); margin:0; font-size:14px; }
.status { display:flex; align-items:center; gap:8px; background:var(--surface); border-radius:999px; padding:8px 14px; font-size:13px; font-weight:700; box-shadow:var(--shadow-card); white-space:nowrap; }
.status .dot { width:9px; height:9px; border-radius:50%; background:#c4cad8; }
.status.on .dot { background:var(--ok); box-shadow:0 0 0 4px rgba(22,163,74,.15); }
.card { background:var(--surface); border-radius:20px; padding:24px; box-shadow:var(--shadow-card); margin-bottom:20px; }
.launch { display:grid; grid-template-columns:1.4fr 1fr; gap:24px; }
@media (max-width:820px) { .launch { grid-template-columns:1fr; } }
.hint { color:var(--sub); font-size:13px; margin:6px 0 10px; }
.btns { display:flex; flex-wrap:wrap; gap:8px; }
button { font:inherit; font-weight:800; border:0; border-radius:14px; padding:12px 18px; cursor:pointer; min-height:42px; letter-spacing:-.01em; }
.btn-primary { background:var(--grad-blue); color:#fff; box-shadow:0 14px 24px -12px rgba(47,99,240,.55), inset 0 1px 0 rgba(255,255,255,.22); }
.btn-primary:active { background:var(--blue-dark); transform:translateY(1px); }
.btn-dark { background:var(--grad-navy); color:#fff; box-shadow:0 14px 24px -12px rgba(20,33,61,.5); }
.btn-ghost { background:var(--blue-bg); color:var(--blue); }
.btn-ghost:active { transform:translateY(1px); }
.list-head { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.pill { display:inline-block; background:var(--blue-bg); color:var(--blue); border-radius:999px; padding:2px 10px; font-size:13px; margin-left:6px; }
.list { list-style:none; margin:8px 0 0; padding:0; display:grid; gap:10px; }
.item { display:grid; grid-template-columns:36px 160px 1fr auto; gap:14px; align-items:center; background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:10px 12px; cursor:grab; transition:box-shadow .15s, transform .15s; }
.item:hover { box-shadow:var(--shadow-card); }
.item.dragging { opacity:.5; }
.item.over { box-shadow:0 0 0 2px var(--blue); }
.item.current { border-color:var(--blue); background:#f5f8ff; }
.item.selected { box-shadow:0 0 0 2px var(--blue), var(--shadow-card); }
.tag.repl { background:#fff8eb; color:#8a6116; margin-left:6px; }
.item .ops button.del { background:#fdecec; color:#dc2626; }
.item .ops button.swap, .item .ops button.restore { background:#e8f7ee; color:#157347; }
/* 다른 관리자(럭키드로우) 안에 iframe 으로 들어갔을 때 */
body.embed { background:transparent; }
body.embed .wrap { padding:8px 24px 32px; max-width:none; }   /* 럭키드로우가 iframe 을 브라우저 폭 전체로 펼치므로 가장자리 여백은 여기서 준다 */
body.embed .top h1 { font-size:20px; } body.embed .top .sub { display:none; } body.embed .foot { display:none; }
.drop { display:none; position:fixed; inset:16px; border:3px dashed var(--blue); border-radius:24px; background:rgba(232,239,255,.85); z-index:8; align-items:center; justify-content:center; font-size:22px; font-weight:900; color:var(--blue); pointer-events:none; }
body.dropping .drop { display:flex; }
.item .n { font-size:18px; font-weight:900; color:var(--sub); text-align:center; font-variant-numeric:tabular-nums; }
.item.current .n { color:var(--blue); }
.item .thumb { width:160px; height:90px; border-radius:10px; background:#0b0f1a; display:flex; align-items:center; justify-content:center; color:#9fc0ff; font-size:13px; font-weight:800; overflow:hidden; }
.item .thumb img, .item .thumb video { width:100%; height:100%; object-fit:cover; display:block; }
.item .t { font-weight:800; font-size:15px; }
.item .m { color:var(--sub); font-size:12px; margin-top:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tag { display:inline-block; border-radius:999px; padding:1px 8px; font-size:11px; font-weight:800; margin-right:6px; vertical-align:1px; }
.tag.image { background:#eef0f4; color:var(--sub); } .tag.demo { background:var(--blue-bg); color:var(--blue); } .tag.video { background:#fff8eb; color:#8a6116; }
.item .ops { display:flex; gap:6px; }
.item .ops button { padding:8px 12px; min-height:36px; border-radius:11px; background:#f3f5f9; color:var(--ink); }
.item .ops button.go { background:var(--blue-bg); color:var(--blue); }
.foot { color:var(--sub); font-size:13px; text-align:center; } .foot a { color:var(--blue); }
.toast { position:fixed; left:50%; bottom:28px; transform:translateX(-50%); background:var(--ink); color:#fff; border-radius:999px; padding:12px 20px; font-weight:700; font-size:14px; box-shadow:0 24px 48px -22px rgba(20,33,61,.5); max-width:90vw; z-index:9; }
/* 모니터 배치도 — 감지된 모니터를 실제 위치 비율대로 그린다. 선택(파랑)·이 화면(회색 점선)·발표 중(녹색) */
.monitors { position:relative; background:#f3f5f9; border-radius:16px; margin:8px 0 12px; overflow:hidden; }
.monitors[hidden] { display:none; }
.mon { position:absolute; border:2px solid #c4cad8; border-radius:10px; background:#fff; cursor:pointer; padding:8px 10px; overflow:hidden; transition:box-shadow .15s, border-color .15s; user-select:none; }
.mon:hover { box-shadow:var(--shadow-card); }
.mon .num { font-size:22px; font-weight:900; line-height:1; color:var(--ink); }
.mon .lbl { font-size:12px; font-weight:800; margin-top:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mon .res { font-size:11px; color:var(--sub); }
.mon .tags { position:absolute; right:8px; top:8px; display:flex; gap:4px; }
.mon .tags span { font-size:10px; font-weight:800; border-radius:999px; padding:1px 7px; background:#eef0f4; color:var(--sub); }
.mon .tags .cur { background:#eef0f4; color:var(--sub); }
.mon .tags .show { background:#e8f7ee; color:#157347; }
.mon.current { border-style:dashed; }
.mon.selected { border-color:var(--blue); box-shadow:0 0 0 3px rgba(47,107,255,.2); background:#f5f8ff; }
.mon.selected .num { color:var(--blue); }
.mon.showing { border-color:var(--ok); }
/* 시청 지표 */
.stats h3 { font-size:14px; font-weight:800; margin:14px 0 6px; color:var(--sub); }
.stats-ctl { align-items:center; }
.seg { display:inline-flex; background:#f3f5f9; border-radius:999px; padding:3px; }
.seg button { padding:6px 14px; min-height:32px; border-radius:999px; background:transparent; color:var(--sub); font-size:13px; }
.seg button.on { background:var(--ink); color:#fff; }
.chk { font-size:13px; font-weight:700; color:var(--sub); display:flex; align-items:center; gap:6px; cursor:pointer; }
.pill.live { background:#e8f7ee; color:#157347; }
.pill.live::before { content:""; display:inline-block; width:7px; height:7px; border-radius:50%; background:var(--ok); margin-right:6px; box-shadow:0 0 0 3px rgba(22,163,74,.15); }
.tiles { display:grid; grid-template-columns:repeat(auto-fit, minmax(150px, 1fr)); gap:10px; margin-top:6px; }
.tile { background:#f3f5f9; border-radius:14px; padding:12px 14px; }
.tile .v { font-size:26px; font-weight:900; letter-spacing:-.02em; color:var(--ink); line-height:1.1; }
.tile .k { font-size:12px; color:var(--sub); font-weight:700; margin-top:4px; }
.stats-grid { display:grid; grid-template-columns:1.3fr 1fr; gap:24px; }
@media (max-width:820px) { .stats-grid { grid-template-columns:1fr; } }
.bars { list-style:none; margin:0; padding:0; display:grid; gap:6px; }
.bars li { display:grid; grid-template-columns:28px 1fr 64px 64px; gap:8px; align-items:center; font-size:13px; }
.bars .n { font-weight:900; color:var(--sub); text-align:right; font-variant-numeric:tabular-nums; }
.bars .bar { position:relative; height:26px; background:#f3f5f9; border-radius:8px; overflow:hidden; }
.bars .bar i { position:absolute; left:0; top:0; bottom:0; background:var(--blue-bg); border-radius:8px; }
.bars .bar b { position:absolute; left:10px; top:0; line-height:26px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; right:8px; }
.bars .bar.demo i { background:#dbe6ff; } .bars .bar.video i { background:#fff1d6; }
.bars .v { text-align:right; font-variant-numeric:tabular-nums; font-weight:800; }
.bars .s { text-align:right; font-variant-numeric:tabular-nums; color:var(--sub); font-size:12px; }
.bars .old b { color:var(--sub); }
.sessions { list-style:none; margin:0; padding:0; display:grid; gap:6px; }
.sessions li { display:grid; grid-template-columns:auto 1fr auto; gap:10px; align-items:center; background:#f3f5f9; border-radius:12px; padding:8px 12px; font-size:13px; }
.sessions .when { font-weight:800; font-variant-numeric:tabular-nums; }
.sessions .d { color:var(--sub); font-size:12px; }
.sessions .live { color:#157347; font-weight:800; }
.sessions .role { display:inline-block; font-size:10px; font-weight:800; border-radius:999px; padding:1px 7px; background:#eef0f4; color:var(--sub); margin-left:6px; vertical-align:1px; }
.sessions .role.p { background:var(--blue-bg); color:var(--blue); }
.empty { color:var(--sub); font-size:13px; padding:10px 0; }
.pill[hidden], .mon[hidden] { display:none; }
/* 상단 내비게이션 */
.top-right { display:flex; flex-direction:column; align-items:flex-end; gap:8px; }
.nav { display:flex; gap:4px; background:var(--surface); border-radius:999px; padding:4px; box-shadow:var(--shadow-card); }
.nav a { text-decoration:none; color:var(--sub); font-weight:800; font-size:13px; padding:7px 14px; border-radius:999px; white-space:nowrap; }
.nav a.on { background:var(--ink); color:#fff; }
.nav a:hover:not(.on) { background:var(--blue-bg); color:var(--blue); }
body.embed .nav a[href="./"] { display:none; }
.nav a.home { background:var(--blue-bg); color:var(--blue); }   /* event.torder.ai: 내 발표 목록으로 */
/* 모니터 역할 칩 (발표 / 발표자) */
.mon .roles { position:absolute; left:8px; right:8px; bottom:6px; display:flex; gap:4px; }
.mon .roles .r { flex:1; padding:2px 0; min-height:22px; border-radius:999px; font-size:11px; font-weight:800; background:#eef0f4; color:var(--sub); }
.mon .roles .r.show.on { background:var(--blue); color:#fff; }
.mon .roles .r.pres.on { background:#14213d; color:#fff; }
.mon .num { font-size:20px; }
/* 발표자 메모 칸 */
.notebox { grid-column:1 / -1; display:grid; gap:4px; padding:2px 0 4px; }
.notebox textarea { width:100%; font:inherit; font-size:15px; line-height:1.55; border:1px solid var(--line); border-radius:12px; padding:10px 12px; resize:vertical; background:#fbfcfe; color:var(--ink); }
.notebox textarea:focus { outline:2px solid var(--blue); border-color:transparent; }
.notebox small { color:var(--sub); font-size:12px; }
.tag.note { background:#e8f7ee; color:#157347; margin-left:6px; }
.item .ops button.memo { background:#eef0f4; }
/* 큰 미리보기 (마우스를 올렸을 때) */
.preview { position:fixed; z-index:20; width:min(72vw, 1280px); background:#000; border-radius:16px; box-shadow:0 30px 60px -20px rgba(20,33,61,.55), 0 0 0 4px #fff; overflow:hidden; pointer-events:none; }
.preview img { display:block; width:100%; aspect-ratio:16/9; object-fit:contain; }
.preview[hidden], .preview [hidden] { display:none !important; }
.pv-text { aspect-ratio:16/9; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; padding:6%; word-break:keep-all; }
.pv-text.left { align-items:flex-start; text-align:left; }
.pv-text b { font-size:clamp(20px, 3.4vw, 48px); font-weight:900; line-height:1.2; margin-bottom:12px; }
.pv-text span { font-size:clamp(14px, 1.8vw, 26px); font-weight:600; white-space:pre-wrap; line-height:1.45; }
.pv-frame { position:relative; aspect-ratio:16/9; background:#0b0f1a; overflow:hidden; }
/* 시연 앱 첫 화면 — 설계 크기로 띄워 transform 으로 축소, 클릭은 막음 */
.item .thumb .live { position:relative; width:100%; height:100%; overflow:hidden; background:#0b0f1a; }
.item .thumb .live iframe, .pv-frame iframe { position:absolute; left:0; top:0; border:0; transform-origin:0 0; pointer-events:none; background:#fff; }
.item .thumb .live .ld, .pv-frame .ld { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; text-align:center; padding:8px; font-size:11px; line-height:1.35; color:#9fc0ff; font-weight:800; }
.pv-frame .ld { font-size:16px; }
.item .n, .item .t, .item .m { user-select:none; }
.item .n { cursor:pointer; }
.item .n input { width:56px; font:inherit; font-size:16px; font-weight:900; text-align:center; color:var(--ink); border:2px solid var(--blue); border-radius:9px; padding:3px 2px; background:#fff; outline:0; -moz-appearance:textfield; }
.item .n input::-webkit-inner-spin-button, .item .n input::-webkit-outer-spin-button { -webkit-appearance:none; margin:0; }              /* 두 번 누르기(발표 화면 이동)로 글자가 선택되지 않게 */
/* 장표 가져오기 창 */
.dlg { border:0; border-radius:22px; padding:0; width:min(560px, 94vw); box-shadow:0 40px 80px -30px rgba(20,33,61,.5); }
.dlg::backdrop { background:rgba(20,33,61,.45); }
.dlg form { padding:26px 28px; display:grid; gap:12px; }
.dlg h2 { margin:0; font-size:20px; }
.fld { display:grid; gap:6px; font-size:13px; font-weight:800; color:var(--sub); }
.fld input { font:inherit; font-size:15px; font-weight:500; color:var(--ink); border:1px solid var(--line); border-radius:12px; padding:11px 12px; background:#fbfcfe; }
.fld input:focus { outline:2px solid var(--blue); border-color:transparent; }
.or { text-align:center; color:var(--sub); font-size:12px; font-weight:800; }
.radios { display:grid; gap:6px; font-size:13px; color:var(--ink); }
.radios label { display:flex; gap:8px; align-items:flex-start; cursor:pointer; }
.btns.right { justify-content:flex-end; }
.btn-danger { background:#fdecec; color:#dc2626; }
.btn-danger:active { transform:translateY(1px); }
/* ---------- 모바일 (좁은 화면) ---------- */
input, textarea, select { font-size:16px; }                 /* iOS 자동 확대 방지 */
@media (max-width: 720px) {
  .wrap { padding:14px 12px 48px; }
  .top { flex-direction:column; align-items:stretch; gap:10px; margin-bottom:14px; }
  .top-right { align-items:stretch; }
  .nav { overflow-x:auto; -webkit-overflow-scrolling:touch; }
  .nav a { padding:9px 12px; font-size:12px; }
  .status { justify-content:center; }
  h1 { font-size:22px; } .sub { font-size:13px; }
  .card { padding:16px 14px; border-radius:16px; margin-bottom:14px; }
  .launch { grid-template-columns:1fr; gap:16px; }
  .btns button { flex:1 1 auto; padding:11px 12px; font-size:14px; }
  .list-head { flex-direction:column; align-items:stretch; gap:8px; }
  .list-head .btns { flex-wrap:wrap; }
  /* 카드: 번호 | 그림·제목 두 줄, 버튼은 아래 한 줄 */
  .item { grid-template-columns:28px 1fr; grid-template-areas:"n thumb" "n info" "ops ops"; gap:8px 10px; padding:10px; cursor:default; }
  .item .n { grid-area:n; font-size:15px; padding-top:2px; }
  .item .thumb { grid-area:thumb; width:100%; height:auto; aspect-ratio:16/9; }
  .item > div:nth-child(3) { grid-area:info; min-width:0; }
  .item .ops { grid-area:ops; flex-wrap:wrap; gap:6px; }
  .item .ops button { flex:1 1 auto; min-height:40px; }
  .item .m { white-space:normal; word-break:break-all; font-size:11px; }
  .notebox { grid-column:1 / -1; }
  .monitors { margin:6px 0 10px; }
  .mon .lbl { font-size:11px; } .mon .res { display:none; } .mon .roles .r { font-size:10px; }
  .dlg form { padding:20px 16px; }
  .tiles { grid-template-columns:repeat(2, 1fr); }
  .tile .v { font-size:22px; }
  .stats-grid { grid-template-columns:1fr; gap:16px; }
  .bars li { grid-template-columns:22px 1fr 54px; font-size:12px; }
  .bars .s { display:none; }
  .sessions li { grid-template-columns:auto 1fr; font-size:12px; }
  .sessions li > span:last-child { grid-column:1 / -1; text-align:right; }
  .toast { bottom:16px; font-size:13px; }
}
@media (hover: none) { .preview { display:none !important; } }   /* 터치 기기: 마우스 올리기 미리보기 없음 */
/* 시연 장표 규격 선택 */
.item .vp { display:inline-flex; align-items:center; gap:6px; margin-top:6px; font-size:12px; font-weight:800; color:var(--sub); }
.item .vp select { font:inherit; font-size:13px; font-weight:700; color:var(--ink); border:1px solid var(--line); border-radius:9px; padding:4px 8px; background:#fbfcfe; max-width:280px; }
/* 텍스트 장표 대화창 */
.swatches { display:flex; gap:8px; align-items:center; margin-top:4px; }
.sw { width:36px; height:36px; border-radius:10px; border:2px solid var(--line); cursor:pointer; padding:0; min-height:0; }
.sw.on { border-color:var(--blue); box-shadow:0 0 0 3px rgba(47,107,255,.2); }
.sw.custom { display:flex; align-items:center; justify-content:center; background:conic-gradient(#f87171,#fbbf24,#34d399,#60a5fa,#a78bfa,#f87171); overflow:hidden; }
.sw.custom input { opacity:0; width:100%; height:100%; cursor:pointer; }
.fld textarea { font:inherit; font-size:15px; color:var(--ink); border:1px solid var(--line); border-radius:12px; padding:10px 12px; background:#fbfcfe; resize:vertical; }
.row2 { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.fld select { font:inherit; font-size:15px; border:1px solid var(--line); border-radius:12px; padding:10px 12px; background:#fbfcfe; color:var(--ink); }
.preview-box { aspect-ratio:16/9; border-radius:12px; border:1px solid var(--line); display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; padding:6%; overflow:hidden; word-break:keep-all; }
.preview-box.left { align-items:flex-start; text-align:left; }
.preview-box b { font-size:clamp(14px, 3.2cqw, 26px); font-weight:900; line-height:1.2; margin-bottom:6px; }
.preview-box span { font-size:clamp(11px, 1.7cqw, 15px); font-weight:600; white-space:pre-wrap; line-height:1.45; }
.item .thumb.tx { flex-direction:column; padding:8px; text-align:center; word-break:keep-all; font-size:12px; line-height:1.3; }
.item .thumb.tx b { font-size:13px; font-weight:900; }
.tag.text { background:#eef0f4; color:var(--ink); }
/* 리모컨 시험 */
.remote { margin-top:10px; background:#f3f5f9; border-radius:14px; padding:10px 14px; }
.remote summary { cursor:pointer; font-weight:800; font-size:13px; color:var(--ink); }
.remote-last { margin:8px 0; padding:12px 14px; border-radius:12px; background:var(--surface); border:1px solid var(--line); font-weight:800; font-size:14px; min-height:44px; }
.remote-last.ok { border-color:#16a34a; background:#e8f7ee; color:#157347; }
.remote-last.unknown { border-color:#f59e0b; background:#fff8eb; color:#8a6116; }
