/* m-suite 관리 화면 공통 스타일.
   레이아웃: 데스크톱은 왼쪽 메뉴 + 본문, 폰은 위쪽 탭. 등록 페이지는 폰 한 손 사용 기준. */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --fg: #18202c;
  --muted: #5b6676;
  --line: #dde2ea;
  --accent: #2752c4;
  --accent-fg: #ffffff;
  --accent-soft: #e4ebfb;
  --live: #d9700f; --live-soft: #fde9d6;
  --ok: #18825a;
  --ok-soft: #dcf2e8;
  --warn: #a8630b;
  --warn-soft: #fbefd9;
  --bad: #b3302a;
  --bad-soft: #fbe4e2;
  --screen: #1f5fd1;
  --screen-soft: #e2ecfd;
  --run: #7a3fd1;
  --run-soft: #efe6fb;
  --shadow: 0 1px 2px rgba(20, 30, 50, .06), 0 6px 20px rgba(20, 30, 50, .06);
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11151c; --surface: #19202a; --surface-2: #212a36; --fg: #e7ebf1; --muted: #9aa5b4; --line: #2d3746;
    --accent: #7c9cf2; --accent-fg: #0f1520; --accent-soft: #1f2b47;
    --live: #f3a460; --live-soft: #3d2712;
    --ok: #5bc795; --ok-soft: #173327; --warn: #e3a64e; --warn-soft: #3a2c14; --bad: #f08a82; --bad-soft: #3d1d1b;
    --screen: #84a9f5; --screen-soft: #1c2a47; --run: #b99af2; --run-soft: #2b2142;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; line-height: 1.3; text-wrap: balance; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 650; }
p { margin: 0; }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* ── 버튼·입력 ─────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px;
       border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; white-space: nowrap;
       font-weight: 550; text-decoration: none; color: var(--fg); }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.lg { height: 52px; font-size: 17px; border-radius: 12px; }
.btn.block { width: 100%; }
.input, .select { height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
                  min-width: 0; }
.select.sm { height: 30px; padding: 0 8px; font-size: 13px; }
.input:focus, .select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-weight: 600; font-size: 14px; }
.field .hint { font-size: 13px; color: var(--muted); }

/* ── 상태 표시 ─────────────────────────────────── */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px;
        font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.off { background: var(--surface-2); color: var(--muted); }
/* 켜짐 = 정상(초록 점, 바탕은 중립), 꺼짐 = 회색. 색은 상태의 뜻 하나만 가진다 */
.pill.on { background: var(--surface-2); color: var(--fg); }
.pill.on .dot { color: var(--ok); }
.pill.off .dot { color: var(--muted); opacity: .6; }
.pill.warn .dot, .pill.bad .dot { color: currentColor; }
.icon.wifi { width: 15px; height: 15px; flex: none; }
/* 연결: 연한 초록 채움 / 끊김: 회색 채움 */
.pill.net-on { background: var(--ok-soft); color: var(--ok); }
.pill.motor-on { background: var(--screen-soft); color: var(--screen); }  /* 모터 켜짐: 파랑 채움 */
.pill.motor-idle { background: var(--surface); color: var(--screen); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--screen) 45%, transparent); }  /* 모터 대기(켜져 있고 우산을 기다림): 파랑 테두리 */
.pill.net-off { background: var(--surface-2); color: var(--muted); }
.status.off { color: var(--muted); }
/* 정상 작동(파랑) / 기기 오류(빨강) — 누르면 HDMI·센서·모터가 펼쳐진다 */
button.pill.check { border: 0; cursor: pointer; font: inherit; font-size: 13px; font-weight: 650; }
.pill.check.good { background: var(--screen-soft); color: var(--screen); }
.pill.check.bad { background: var(--bad-soft); color: var(--bad); }
.pill.check:hover { box-shadow: inset 0 0 0 1.5px currentColor; }
.pill.check .chev-s { font-size: 10px; margin-left: 2px; }
.check-list { list-style: none; margin: 4px 0 2px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); display: grid; gap: 6px; }
.check-list li { display: grid; grid-template-columns: 10px 64px minmax(0, 1fr); gap: 8px; align-items: center; font-size: 13.5px; }
.check-list li.ok .dot { color: var(--ok); } .check-list li.bad .dot { color: var(--bad); }
.check-list li.bad span { color: var(--bad); }
.check-list li.warn .dot { color: var(--warn); } .check-list li.warn span { color: var(--warn); }
.check-list li { grid-template-columns: 10px 72px minmax(0, 1fr); }
/* 콘텐츠 · SW · 기기 온도/여유 공간 */
.facts { list-style: disc; margin: 4px 0 0; padding-left: 18px; font-size: 13.5px; color: var(--muted); display: grid; gap: 2px; }
/* 화면 방향 버튼 네 개 */
.seg4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); }
.seg4 button { height: 46px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 650; font-size: 16px; cursor: pointer;
  font-variant-numeric: tabular-nums; transition: background-color .15s ease, color .15s ease, transform .1s ease-out; }
.seg4 button:hover:not(.on) { color: var(--fg); }
.seg4 button:active:not(.on) { transform: scale(.96); }
.seg4 button.on { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgba(20, 30, 50, .12), 0 2px 8px rgba(20, 30, 50, .08); cursor: default; }
@media (prefers-reduced-motion: reduce) { .seg4 button { transition: none; } }
/* 목록 한 줄 요약 */
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; font-size: 13.5px; }
.status.ok { color: var(--ok); } .status.warn { color: var(--warn); } .status.bad { color: var(--bad); }
.state-text { font-size: 13px; color: var(--muted); }
/* 켜기·끄기 세그먼트: 선택된 쪽이 바탕 위로 또렷하게 올라온다(흐리게 하지 않는다) */
.seg2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); }
.seg2 button { height: 46px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 650; font-size: 16px;
  cursor: pointer; transition: background-color .15s ease, color .15s ease, transform .1s ease-out; }
.seg2 button:hover:not(.on):not(:disabled) { color: var(--fg); }
.seg2 button:active:not(.on):not(:disabled) { transform: scale(.97); }
.seg2 button.on { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgba(20, 30, 50, .12), 0 2px 8px rgba(20, 30, 50, .08); cursor: default; }
.seg2 button:disabled { cursor: not-allowed; opacity: .55; }
@media (prefers-reduced-motion: reduce) { .seg2 button { transition: none; } }
.warn-text { color: var(--warn); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.pill.ok .dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }

/* ── 앱 틀 ─────────────────────────────────────── */
.app { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 20px 14px; display: flex; flex-direction: column; gap: 4px;
        border-right: 1px solid var(--line); background: var(--surface); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 750; font-size: 17px; letter-spacing: -.01em; }
.brand-mark { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); position: relative; flex: none; }
.brand-mark::after { content: ""; position: absolute; inset: 7px 6px 9px; border: 2px solid var(--accent-fg); border-radius: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 8px; color: var(--muted);
         text-decoration: none; font-weight: 600; }
.nav a:hover { background: var(--surface-2); color: var(--fg); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav .count { margin-left: auto; font-size: 12px; font-weight: 600; }
/* 본사 메뉴: 묶음 제목 → 하위 메뉴 → (송출콘텐츠 아래) 한 단계 더 */
.nav-group { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.nav-head { min-height: 36px; padding: 0 12px; font-size: 15px; font-weight: 700; color: var(--fg); }
.nav-sub-head { height: 38px; padding: 0 12px 0 22px; font-size: 14px; font-weight: 600; color: var(--muted); }
.nav-sub { display: flex; flex-direction: column; gap: 2px; }
/* 접는 제목: 누르는 곳임을 보이게 ▾ (접히면 ▸) */
.nav summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; border-radius: 6px; user-select: none; }
.nav summary::-webkit-details-marker { display: none; }
.nav summary::after { content: "▾"; font-size: 10px; margin-left: auto; padding-right: 4px; transition: transform .15s ease; }
.nav details:not([open]) > summary::after { transform: rotate(-90deg); }
.nav summary:hover { color: var(--fg); background: var(--surface-2); }
@media (prefers-reduced-motion: reduce) { .nav summary::after { transition: none; } }
.nav a.sub1 { padding-left: 22px; height: 38px; font-size: 14px; }
.nav a.sub2 { padding-left: 34px; height: 34px; font-size: 13px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.main { padding: 28px 32px 64px; display: flex; flex-direction: column; gap: 20px; min-width: 0; max-width: 1200px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 4px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }  /* 카드 수에 맞춰 한 줄 */
.stat { padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13px; }
.stat.attention b { color: var(--warn); }
.stat.down b { color: var(--bad); }

/* ── 표 ────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: center; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; text-align: center; }
td .row-actions { justify-content: center; }
td.c-title { text-align: left; }  /* 콘텐츠명만 왼쪽 */
tr:last-child td { border-bottom: 0; }
td .name { font-weight: 650; }
td .sub { font-size: 12.5px; color: var(--muted); }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }

.empty { padding: 48px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty h2 { font-size: 16px; }
.empty p { color: var(--muted); max-width: 44ch; }

/* ── 콘텐츠 ────────────────────────────────────── */
.drop { border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 22px; display: flex; align-items: center;
        justify-content: center; gap: 14px; color: var(--muted); background: var(--surface); text-align: center; flex-wrap: wrap; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.uploads { display: flex; flex-direction: column; gap: 6px; }
.upload-row { display: grid; grid-template-columns: minmax(0, 1fr) 160px 48px; gap: 12px; align-items: center; font-size: 13px; }
.upload-row .bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.upload-row .bar i { display: block; height: 100%; background: var(--accent); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.tile { overflow: hidden; display: flex; flex-direction: column; }
/* 콘텐츠는 세로형(FHD 1080×1920)이다 — 가로 모니터를 세로로 돌려 단다 */
.thumb { aspect-ratio: 9 / 16; background: #0c0f14; position: relative; display: block; width: 100%; max-width: 100%; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: contain; display: block; }
.thumb .kind { position: absolute; left: 8px; top: 8px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px;
               font-weight: 650; display: inline-flex; align-items: center; background: rgba(0, 0, 0, .6); color: #fff; }
.tile-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tile-name { font-weight: 600; overflow-wrap: anywhere; font-size: 14px; }
.tile-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); }

/* ── 재생목록 편집 ─────────────────────────────── */
.split { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.list { display: flex; flex-direction: column; padding: 6px; gap: 2px; }
.list button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; padding: 10px 12px;
               border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
.list button:hover { background: var(--surface-2); }
.list button[aria-current="true"] { background: var(--accent-soft); }
.list button b { font-weight: 650; }
.list button span { font-size: 12.5px; color: var(--muted); }
.editor { display: flex; flex-direction: column; }
.editor-head { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 14px 16px;
               border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.editor-head .input { font-weight: 650; font-size: 16px; flex: 1 1 220px; }
.items { display: flex; flex-direction: column; }
.item { display: grid; grid-template-columns: 28px 54px minmax(0, 1fr) 160px auto; gap: 12px; align-items: center;
        padding: 10px 16px; border-bottom: 1px solid var(--line); }
.item .idx { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; font-size: 13px; }
.item .thumb .kind { display: none; }
.item.fixed { grid-template-columns: 28px 54px minmax(0, 1fr) auto; }
.item .thumb { border-radius: 6px; overflow: hidden; }
.item .dur { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.item .dur .input { width: 88px; height: 32px; text-align: right; }
.editor-foot { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 16px; flex-wrap: wrap; }
.picker { border-top: 1px solid var(--line); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.picker .grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.picker .tile { cursor: pointer; border: 1px solid var(--line); }
.picker .tile:hover { border-color: var(--accent); }

/* ── 매장·승인·계정 ─────────────────────────────── */
.section { display: flex; flex-direction: column; gap: 12px; }
.section > h2 .muted { font-weight: 500; }
.note { font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 6px; }
.badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--warn);
         color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.tile-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.item-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.item-sub { display: flex; gap: 8px; align-items: center; font-size: 12.5px; flex-wrap: wrap; }
.reason { font-size: 12.5px; color: var(--bad); }
.order { list-style: none; margin: 0; padding: 4px 4px 8px; display: flex; gap: 10px; overflow-x: auto; }  /* 좌우 4px: 썸네일 테두리(outline 2px + offset 2px)가 스크롤 영역 밖으로 나가 잘리지 않게 */
.order li { flex: none; width: 88px; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); }
.order li .thumb { border-radius: 8px; overflow: hidden; outline: 2px solid transparent; outline-offset: 2px; }
.order li.hq .thumb { outline-color: var(--accent); }
.order li.own .thumb { outline-color: var(--ok); }
.order li .kind { display: none; }
.order li b { color: var(--fg); }
.checks { display: flex; flex-direction: column; gap: 6px; max-height: 200px; overflow-y: auto; padding: 4px 0; }
.check-row { display: flex; gap: 8px; align-items: center; }
dialog.preview { width: min(440px, calc(100vw - 32px)); background: #000; }
dialog.preview img, dialog.preview video { display: block; width: 100%; max-height: 78vh; object-fit: contain; }
dialog.preview .dialog-foot { background: var(--surface); padding: 12px 16px; justify-content: space-between; align-items: center; }
.side-foot .who { font-size: 12.5px; padding: 0 10px; }
.side .nav { display: flex; flex-direction: column; gap: 2px; }
a.name { color: var(--fg); text-decoration: none; }
a.name:hover { text-decoration: underline; }
a.pill { text-decoration: none; }

/* ── 운영 시간 ─────────────────────────────────── */
.pills { display: flex; gap: 4px; flex-wrap: wrap; }
.c-status .stack { align-items: flex-start; }
.pill.off { background: var(--surface-2); color: var(--muted); text-decoration: none; }
.sched-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sched { padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.sched-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.sched-head h3 { margin: 0; font-size: 15px; }
.sched-head p { font-size: 13px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex: none; }
.seg label { display: flex; align-items: center; gap: 6px; padding: 6px 10px; font-size: 13px; font-weight: 600; cursor: pointer; }
.seg label:has(input:checked) { background: var(--accent-soft); color: var(--accent); }
.seg input { margin: 0; }
table.week td { padding: 4px 6px; border: 0; font-size: 13px; text-align: left; }
table.week .input { height: 32px; padding: 0 8px; }
table.week input:disabled { opacity: .45; }
.sched-foot { display: flex; justify-content: flex-end; }

/* ── 매장 기기 상태 ─────────────────────────────── */
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.icon { width: 16px; height: 16px; flex: none; }
.dev-list { display: flex; flex-direction: column; }
.my-store { max-width: 320px; margin-bottom: 8px; }
a.dev-link { color: inherit; text-decoration: none; cursor: pointer; position: relative; padding-right: 36px; }
a.dev-link:hover { background: var(--surface-2); }
a.dev-link .chev { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 22px; color: var(--muted); }
.onoff-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
.onoff { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.onoff h3 { margin: 0; font-size: 15px; }
.onoff .row { display: flex; gap: 8px; }
.onoff .row .btn { flex: 1; }
.onoff p { margin: 0; font-size: 13px; }
table.week tr.closed td { color: var(--muted); }
table.week { width: 100%; }
table.week td.c-actions { text-align: right; white-space: nowrap; }
.sched { overflow-x: auto; }
.my-np { margin-top: 12px; padding: 12px 16px; max-width: none; }
.health-line { font-size: 13px; margin: 6px 0 0; }
.np-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; align-items: stretch; }
.np-row.single { grid-template-columns: minmax(0, 1fr); }
.np-row .my-np { margin-top: 0; }
.dev-setting { padding: 16px; display: flex; flex-direction: column; gap: 10px; margin-top: 12px; max-width: 520px; }
.shot-np { padding: 4px 20px 0; }
/* 기기 화면 섹션 사이 여백 */
.dev-sec { margin-top: 32px; }
.dev-sec.first { margin-top: 0; }
.ctl-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.ctl-grid .dev-setting { margin-top: 0; max-width: none; }
@media (max-width: 1000px) { .ctl-grid { grid-template-columns: 1fr; } }
.status-card { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.status-card .health-line { margin: 0; }
.dev-setting .field { margin: 0; }
@media (max-width: 720px) { .np-row { grid-template-columns: 1fr; } }
.server-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 20px; margin-bottom: 16px; }
.server-card h2 { margin: 0 0 4px; font-size: 16px; }
.server-card p { margin: 2px 0; font-size: 13px; }
.bad-text { color: var(--bad); font-weight: 600; }  /* 위(켜기/끄기)·아래(운영 시간)와 오른쪽 끝을 맞춘다 */
.my-actions { margin: 4px 0 12px; }
@media (max-width: 1100px) { .sched-grid { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .onoff-grid { grid-template-columns: 1fr; } }
.dev { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap;
       padding: 14px 16px; border-bottom: 1px solid var(--line); }
.dev:last-child { border-bottom: 0; }
.dev-name { display: flex; align-items: center; gap: 4px 6px; min-width: 0; flex-wrap: wrap; }
.dev-name b { font-size: 16px; }
.dev-name .muted { font-size: 12.5px; margin-left: 4px; }
.dev-state { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.icon-btn { width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--muted);
            cursor: pointer; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); color: var(--fg); }
.toggle { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border: 0; border-radius: 999px;
          font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; white-space: nowrap; }
.toggle.t-screen.on { background: var(--screen-soft); color: var(--screen); }
.toggle.t-run.on { background: var(--run-soft); color: var(--run); }
.toggle.off { background: var(--surface-2); color: var(--muted); }
.toggle:not(:disabled):hover { box-shadow: inset 0 0 0 1.5px currentColor; }
.toggle:disabled { cursor: not-allowed; opacity: .55; }

/* ── 내 콘텐츠 ─────────────────────────────────── */
.section.lib.over { outline: 2px dashed var(--accent); outline-offset: 8px; border-radius: 6px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
        font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.chip .num { font-weight: 700; }
.chip:hover { color: var(--fg); }
.chip[aria-pressed="true"] { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.chip.approved[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #fff; }
.chip.pending[aria-pressed="true"] { background: var(--warn); border-color: var(--warn); color: #fff; }
.chip.rejected[aria-pressed="true"] { background: var(--bad); border-color: var(--bad); color: #fff; }

/* ── 대화상자·알림 ─────────────────────────────── */
dialog { border: 0; border-radius: 14px; padding: 0; background: var(--surface); color: var(--fg); box-shadow: var(--shadow);
         width: min(440px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(10, 14, 20, .45); }
.dialog-body { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 22px 20px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; background: var(--fg); color: var(--bg);
         padding: 10px 16px; border-radius: 10px; font-weight: 550; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.toast.bad { background: var(--bad); color: #fff; }

/* ── 로그인 ────────────────────────────────────── */
.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login { width: min(380px, 100%); padding: 28px; display: flex; flex-direction: column; gap: 18px; box-shadow: var(--shadow); }
.login .brand { padding: 0; }

/* ── 폰 ────────────────────────────────────────── */
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .side { position: sticky; top: 0; z-index: 10; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px; padding: 12px;
          border-right: 0; border-bottom: 1px solid var(--line); }
  .side .brand { padding: 0 4px 0 0; }
  .side .brand span { display: none; }
  /* 폰: 첫 줄 = 로고 · 큰 메뉴 버튼 · 로그아웃, 큰 메뉴를 누르면 그 아래 줄에 하위 메뉴(.m-sub). details·display:contents 는 쓰지 않는다 */
  .side { align-items: flex-start; }
  .side .nav { flex: 1; min-width: 0; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 2px; }
  .nav .m-head { height: 40px; padding: 0 8px; border: 0; border-radius: 6px; background: none; font: inherit; font-size: 14px; font-weight: 700;
                 color: var(--fg); white-space: nowrap; cursor: pointer; }
  .nav .m-head.cur, .nav .m-head[aria-expanded="true"] { color: var(--accent); }
  .nav .m-sub { flex-basis: 100%; min-width: 0; display: flex; gap: 2px; overflow-x: auto; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
  .nav a.sub1, .nav a.sub2 { padding: 0 10px; height: 40px; font-size: 13px; }
  .nav a { height: 40px; padding: 0 10px; white-space: nowrap; flex: none; }
  .nav .count { display: none; }
  .side-foot { margin: 0 0 0 auto; flex-direction: row; }
  .side-foot .btn.primary, .side-foot .who { display: none; }  /* 기기 화면 머리에 같은 버튼이 있다 */
  .side-foot .btn { padding: 0 8px; }
  .main { padding: 18px 16px 48px; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
  .split, .sched-grid { grid-template-columns: 1fr; }
  .item, .item.fixed { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .item .idx { display: none; }
  .item .dur { grid-column: 2; }
  .upload-row { grid-template-columns: minmax(0, 1fr) 80px 40px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  /* 기기 표 → 카드 */
  table.devices thead { display: none; }
  table.devices tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  table.devices tr:last-child { border-bottom: 0; }
  table.devices td { padding: 0; border: 0; text-align: left; }
  table.devices td.c-playlist, table.devices td.c-np { grid-column: 1 / -1; max-width: none; min-width: 0; }
  table.devices td.c-playlist .select { width: 100%; }
  table.devices td.c-actions .row-actions { flex-wrap: wrap; }
  table.devices td.c-sync, table.devices td.c-seen { font-size: 13px; }
  table.devices td.c-actions { grid-column: 1 / -1; }
  table.devices td.c-actions .row-actions { justify-content: flex-start; }
}

/* ── 고객관리 ──────────────────────────────────── */
.input.search { width: min(320px, 100%); height: 34px; }
textarea.input { height: auto; padding: 8px 12px; resize: vertical; font: inherit; color: inherit; }
.c-addr { max-width: 280px; overflow-wrap: anywhere; }
table.customers td { vertical-align: middle; }
.info dl { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.info dl > div { padding: 14px 18px; border-bottom: 1px solid var(--line); min-width: 0; }
.info dl > div.wide { grid-column: span 2; }
.info dl > div.full { grid-column: 1 / -1; border-bottom: 0; }
.info dt { font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
.info dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.info dd a { text-decoration: none; }
.danger-zone { display: flex; justify-content: flex-end; }
.seg label.m-off:has(input:checked) { background: var(--surface-2); color: var(--fg); }
.sched-off { font-size: 13px; color: var(--muted); background: var(--surface-2); border-radius: 8px; padding: 10px 12px; }
@media (max-width: 900px) {
  .info dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .info dl > div { padding: 12px 14px; }
  .section-head { flex-wrap: wrap; }
}

/* ── 지금 재생 중 · 화면 보기 ───────────────────── */
.np { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; align-items: center; min-width: 220px; }
.np.none { display: block; font-size: 13px; min-width: 0; }
.np .thumb { border-radius: 5px; overflow: hidden; }
.np .thumb .kind { display: none; }
.np.off .thumb, .np.stale .thumb { opacity: .45; filter: grayscale(.7); }
.np-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; }
.np-head { display: flex; justify-content: space-between; gap: 8px; }
.np-label { display: inline-flex; align-items: center; gap: 5px; font-weight: 650; color: var(--ok); }
.np.off .np-label, .np.stale .np-label { color: var(--muted); }
.np-label .dot { width: 7px; height: 7px; animation: np-pulse 1.6s ease-in-out infinite; }
@keyframes np-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .np-label .dot { animation: none; } }
.np-name { font-size: 14px; font-weight: 600; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-progress { display: flex; align-items: center; gap: 8px; }
.np-progress .bar { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.np-progress .bar i { display: block; height: 100%; width: 0; background: var(--ok); transition: width 1s linear; }
.np.off .np-progress .bar i { background: var(--muted); }
.np-time { font-size: 12px; min-width: 64px; text-align: right; }
.np-next { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dev-np { flex: 1 0 100%; max-width: 520px; }
td.c-np { min-width: 240px; max-width: 320px; }
dialog.shot { width: min(720px, calc(100vw - 24px)); }
.shot-top { display: flex; align-items: baseline; gap: 8px; padding: 16px 20px 0; }
.shot-body { padding: 14px 20px; display: flex; flex-direction: column; gap: 10px; }
.shot-img { background: #000; border-radius: 10px; overflow: hidden; display: flex; justify-content: center; }
.shot-img img { display: block; max-width: 100%; max-height: 80vh; object-fit: contain; }
.shot-img.old { opacity: .6; }
.shot-wait { aspect-ratio: 9 / 16; max-height: 80vh; margin: 0 auto; width: 100%; border-radius: 10px; background: var(--surface-2);
             display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.shot-wait small, .shot-err small { color: var(--muted); font-weight: 400; display: block; margin-top: 4px; }
.shot-err { background: var(--bad-soft); color: var(--bad); border-radius: 10px; padding: 12px 14px; font-weight: 600; font-size: 14px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent);
           animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
dialog.shot .dialog-foot { justify-content: space-between; align-items: center; flex-wrap: wrap; }

/* 기기 메뉴: 고객별 묶음 */
table.devices td.c-name { min-width: 130px; }
table.devices td.c-actions .row-actions { flex-wrap: wrap; max-width: 230px; margin: 0 auto; }
table.devices td.c-name .sub { white-space: nowrap; }
.np-head { white-space: nowrap; }
.np-label { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
table.devices tr.grp td { text-align: left; background: var(--surface-2); padding: 9px 16px; border-top: 1px solid var(--line); }
table.devices tbody:first-of-type tr.grp td { border-top: 0; }
.grp-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grp-head .name { font-weight: 700; font-size: 15px; }
.grp-no { font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 1px 8px; font-size: 13px; }
@media (max-width: 860px) {
  table.devices tr.grp { display: block; padding: 0; }
  table.devices tr.grp td { display: block; }
}

/* 기기 메뉴: 간단한 목록 */
.devlist { overflow: hidden; }
.dl-group + .dl-group { border-top: 1px solid var(--line); }
.dl-group .grp-head { background: var(--surface-2); padding: 9px 16px; }
.grp-open { margin-left: auto; }
.dl-rows { list-style: none; margin: 0; padding: 0; }
.dl-row { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(0, 2fr) auto 16px; gap: 16px; align-items: center;
  padding: 12px 16px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; cursor: pointer; position: relative; }
.dl-row .dl-state { justify-content: flex-end; flex-wrap: nowrap; }
.dl-name .sub { color: var(--muted); font-size: 13px; letter-spacing: 0; margin-top: 2px; }
tr.row-link { cursor: pointer; }
tr.row-link:hover td { background: var(--surface-2); }
/* 콘텐츠 승인 요청서 */
.req-form { max-width: 640px; }
.req-form .label { font-weight: 600; font-size: 14px; }
.seg2.sm { max-width: 260px; }
.seg-opt { display: flex; align-items: center; justify-content: center; gap: 6px; height: 38px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg-opt:has(input:checked) { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgba(20, 30, 50, .12); }
.ad-form { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 16px; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.ad-form legend { font-weight: 700; padding: 0 6px; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.row2 .input { min-width: 0; width: 100%; }
@media (max-width: 400px) { .row2 { grid-template-columns: minmax(0, 1fr); } }
.req-actions { display: flex; justify-content: flex-end; gap: 8px; }
.ad-line { color: var(--muted); font-size: 12.5px; }
.dl-row:hover { background: var(--surface-2); }
.dl-row .chev { color: var(--muted); font-size: 20px; line-height: 1; }
.dl-name .sub { display: block; font-weight: 500; }
.dl-place, .dl-dates { font-size: 13px; }
.dates { display: flex; flex-direction: column; gap: 2px; }
.sn { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; padding: 2px 8px; border-radius: 6px; vertical-align: 3px;
      background: var(--surface-2); color: var(--fg); font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: 0; }
.sn .k { font-family: var(--font); color: var(--muted); font-weight: 600; }
/* 기기 화면 머리: 고객번호 · 고객명 · 설치장소 · 설치일자 */
.page-head p:has(.dev-meta) { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 8px; }
.dev-meta { display: inline-flex; gap: 6px; color: var(--fg); }
.dev-meta .k { color: var(--muted); }
.dev-meta .none { color: var(--muted); }
.pills { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.brand-user { display: flex; flex-direction: column; gap: 1px; margin: -10px 0 12px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: inherit; font-size: 13.5px; }
.brand-user:hover, .brand-user[aria-current="page"] { background: var(--surface-2); }
.brand-user .muted { font-size: 12px; }
.dl-row-legacy { display: grid; grid-template-columns: minmax(110px, 180px) minmax(0, 1fr) minmax(0, 200px) auto; gap: 12px; align-items: center;
          padding: 10px 16px; border-top: 1px solid var(--line); }
.dl-name { font-weight: 650; }
.dl-state { display: flex; gap: 4px 10px; flex-wrap: wrap; align-items: center; }
.dl-seen { font-size: 13px; }
@media (max-width: 700px) {
  .dl-row { grid-template-columns: minmax(0, 1fr) 16px; }
  .dl-place { grid-column: 1; grid-row: 2; }
  .dl-state { grid-column: 1 / -1; grid-row: 3; justify-content: flex-start; }
  .dl-row .chev { grid-column: 2; grid-row: 1; }
  .side .brand-user { display: none; }
}
/* 기기 확인 창 */
dialog.check-dlg { width: min(460px, calc(100vw - 24px)); }
.dc-body { padding: 20px 20px 14px; display: flex; flex-direction: column; gap: 14px; }
.dc-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.dc-top b { font-size: 17px; }
.dc-np .np { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; min-width: 0; }
.dc-np .np .thumb { border-radius: 8px; }
.dc-np .np-name { font-size: 16px; white-space: normal; }
.dc-np .np-main { font-size: 13px; gap: 6px; }
.dc-np .np.none { padding: 18px; background: var(--surface-2); border-radius: 10px; text-align: center; }
dialog.check-dlg .dialog-foot { justify-content: space-between; align-items: center; }

/* 설치담당자 홈: 큰 버튼 둘 */
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 8px; }
.home-btn { display: flex; flex-direction: column; gap: 6px; padding: 24px 22px; text-decoration: none; color: inherit; }
.home-btn b.num { font-size: 13px; color: var(--primary, #2752c4); }
.home-btn .home-title { font-size: 22px; font-weight: 700; }
.home-btn:hover { border-color: var(--primary, #2752c4); }
.form-page { display: flex; flex-direction: column; gap: 14px; padding: 20px; max-width: 520px; }
.form-page .err { background: #fdecec; color: #a12626; border-radius: 10px; padding: 12px; }

/* 입력 + 버튼 한 줄 (주소 검색 등) */
.row { display: flex; gap: 8px; align-items: stretch; }
.row .input { flex: 1; min-width: 0; }

/* 글자처럼 보이는 버튼 (표 안의 기기 이름 등) */
.linklike { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.linklike:hover { text-decoration: underline; }

/* 기기 확인 창 — 설치담당자 설정 */
.dc-setup { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.dc-setup .field { display: flex; flex-direction: column; gap: 6px; }
.dc-setup .field > span:first-child { font-size: 12.5px; font-weight: 600; color: var(--muted); }
@media (max-width: 560px) { .dc-setup { grid-template-columns: 1fr; } }

/* 계정 상세(마이페이지): 위 프로필 카드 + ⋯ 메뉴, 아래 두 칸 카드 */
.back { display: inline-block; margin-bottom: 12px; color: var(--muted); text-decoration: none; font-size: 14px; }
.back:hover { color: var(--fg); }
.acct-head { display: flex; align-items: center; gap: 16px; padding: 18px 20px; }
.avatar { flex: none; width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
          display: grid; place-items: center; font-size: 22px; font-weight: 700; }
.acct-title { flex: 1; min-width: 0; }
.acct-title h1 { margin: 0; font-size: 22px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.acct-title p { margin: 4px 0 0; }
.menu { position: relative; align-self: flex-start; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-btn { width: 40px; padding: 0; font-size: 20px; line-height: 1; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 180px; padding: 6px;
             background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.menu-list button { display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; background: none;
                    color: var(--fg); font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.menu-list button:hover, .menu-list button:focus-visible { background: var(--surface-2); }
.menu-list button.danger { color: var(--bad); }
.menu-list hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.acct-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; align-items: start; }
.acct-grid > div { display: grid; gap: 16px; }
.acct-card { padding: 16px 20px; }
.acct-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.acct-card-head h2 { margin: 0; font-size: 16px; }
.kv { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.acct-card-head + .kv { border-top: 0; }
.kv > span:last-child { text-align: right; }
.acct-foot { padding-top: 12px; border-top: 1px solid var(--line); }
.notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 20px; margin-top: 16px;
          background: var(--warn-soft); border-color: transparent; }
.notice p { margin: 0; }
section.card.acct-card + section { margin-top: 0; }
tr.child td:first-child { padding-left: 28px; }
@media (max-width: 860px) { .acct-grid { grid-template-columns: 1fr; } .acct-head { padding: 16px; } }

/* 콘텐츠 편성 편집 */
.plan-form { display: flex; flex-direction: column; gap: 18px; padding: 20px; }
.plan-form fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin: 0; min-width: 0; }
.plan-form fieldset:disabled { opacity: .45; }
.plan-form legend { font-weight: 700; padding: 0 6px; }
.plan-form legend .muted { font-weight: 400; font-size: 13px; }
.cb { display: inline-flex; align-items: center; gap: 6px; margin: 4px 14px 4px 0; cursor: pointer; }
.cb input { width: 16px; height: 16px; }
.region { padding: 6px 0; border-bottom: 1px solid var(--line); }
.region:last-of-type { border-bottom: 0; }
.region-kids { padding-left: 24px; }
.chip.inc { background: var(--accent-soft); color: var(--accent); }
.chip.exc { background: var(--bad-soft); color: var(--bad); }
.plan-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 14px; }
.plan-foot summary { cursor: pointer; }

/* 콘텐츠 보기: 왼쪽 세로 미리보기, 오른쪽 정보 */
.content-view { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 16px; align-items: start; }
.content-preview { background: #000; overflow: hidden; }
.content-preview img, .content-preview video { display: block; width: 100%; max-height: 70vh; object-fit: contain; }
.content-info { display: grid; gap: 16px; }
@media (max-width: 860px) { .content-view { grid-template-columns: 1fr; } .content-preview { max-width: 360px; } }
/* 개별 매장: 고르기 줄과 넣은·뺀 매장 사이 */
#pChips { margin: 0; gap: 8px; }
#pChips:not(:empty) { margin-top: 14px; }
.menu-list button:disabled { color: var(--muted); opacity: .55; cursor: not-allowed; background: none; }

@media (max-width: 360px) { .side .brand { display: none; } }  /* 아주 좁은 폰: 큰 메뉴·로그아웃이 한 줄에 들게 */
/* 폰·태블릿 폭: 표를 줄마다 카드로(첫 칸은 제목, 나머지는 '머리줄 이름 … 값'). 가로로 밀리지 않게 */
@media (max-width: 860px) {
  .table-wrap table:not(.devices):not(.week) thead { display: none; }
  .table-wrap table:not(.devices):not(.week), .table-wrap table:not(.devices):not(.week) :is(tbody, tr, td) { display: block; width: auto; }
  .table-wrap table:not(.devices):not(.week) tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .table-wrap table:not(.devices):not(.week) tr:last-child { border-bottom: 0; }
  .table-wrap table:not(.devices):not(.week) td { padding: 3px 0; border: 0; text-align: right; overflow-wrap: anywhere; max-width: none; min-width: 0; }
  .table-wrap table:not(.devices):not(.week) td::before { content: attr(data-label); float: left; margin-right: 12px; color: var(--muted); font-size: 12.5px; }
  .table-wrap table:not(.devices):not(.week) td:first-child { text-align: left; padding-bottom: 6px; }
  .table-wrap table:not(.devices):not(.week) td:first-child::before { display: none; }
  .table-wrap table:not(.devices):not(.week) td .row-actions { justify-content: flex-end; flex-wrap: wrap; }
  .table-wrap table:not(.devices):not(.week) td:empty { display: none; }
}

/* 콘텐츠 올리기: 고른 파일 미리보기 */
.req-preview:empty { display: none; }
.req-preview img, .req-preview video { display: block; max-width: 180px; max-height: 320px; border-radius: 8px; border: 1px solid var(--line); margin-top: 8px; }
/* 매장 화면 기기 줄 아래 오류 목록 */
.dev .check-list { margin-top: 8px; }

/* 기기 현황 숫자 카드: 누르면 그 상태의 기기 목록 */
a.stat { color: inherit; text-decoration: none; }
a.stat:hover { border-color: var(--accent); }

/* 설치 점검: 단계 카드(완료 = 초록 ✓, 문제 = 빨강, 기다림 = 회색) */
.setup-pick { padding: 16px; display: grid; gap: 8px; margin-bottom: 12px; }
.setup-pick label { font-weight: 650; }
.setup-search { display: flex; gap: 8px; max-width: 420px; }
.setup-search .input { flex: 1; min-width: 0; }
.setup-steps { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.setup-steps li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 14px 16px; align-items: start; }
.setup-no { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.setup-steps li.ok .setup-no { background: var(--ok); color: #fff; }
.setup-steps li.bad { border-color: var(--bad); }
.setup-steps li.bad .setup-no { background: var(--bad); color: #fff; }
.setup-body p { margin: 4px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.setup-body .row-actions { justify-content: flex-start; flex-wrap: wrap; margin-top: 8px; }

/* 송출 화면(#screen/ID) */
.screen-page { display: grid; gap: 12px; max-width: 560px; }
.screen-page .shot-np { padding: 12px 14px; }
.screen-shot { padding: 12px; display: grid; gap: 8px; }
.screen-shot .shot-img img { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; border-radius: 8px; }

/* 기기 리스트(본사): 줄 끝 [삭제] */
.dl-item { display: flex; align-items: center; border-top: 1px solid var(--line); }
.dl-item > .dl-row { flex: 1; min-width: 0; border-top: 0; }
.dl-item > .dl-del { flex: none; margin-right: 12px; }
.setup-reset { justify-content: flex-start; flex-wrap: wrap; }

/* 기기 화면 최근 기록: 꺼짐·끊김 줄은 흐리게 */
table.events tr.ev-off td { color: var(--muted); }

/* 서버 관리: 외부 정보 API 키 */
.api-key { padding: 14px 16px; display: grid; gap: 10px; margin-bottom: 10px; }
.api-key p { margin: 4px 0 0; }
.api-key-row { display: flex; gap: 8px; flex-wrap: wrap; }
.api-key-row .input { flex: 1; min-width: 200px; }

/* 매장: 화면 정보 띠 켜고 끄기 */
.ticker-set { padding: 12px 16px; display: grid; gap: 10px; }
.ticker-set .check-row { align-items: flex-start; cursor: pointer; }
.ticker-set input { width: 18px; height: 18px; margin-top: 2px; flex: none; }
