/* m-suite 관리 화면 공통 스타일.
   레이아웃: 데스크톱은 왼쪽 메뉴 + 본문, 폰은 위쪽 탭. 등록 페이지는 폰 한 손 사용 기준. */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --fg: #18202c;
  --muted: #5b6676;
  --line: #dde2ea;
  --accent: #2752c4;
  --accent-fg: #ffffff;
  --accent-soft: #e4ebfb;
  --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;
    --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); }
.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; }
.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(4, minmax(0, 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: left; 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; }
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; }
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; }
.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: 1fr; }
  .side { position: sticky; top: 0; z-index: 10; height: auto; flex-direction: row; align-items: center; padding: 8px 12px;
          border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .side .brand { padding: 0 4px 0 0; }
  .side .brand span { display: none; }
  .side .nav { flex-direction: row; gap: 2px; }
  .nav a { height: 36px; padding: 0 9px; white-space: nowrap; }
  .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(2, minmax(0, 1fr)); }
  .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; }
  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(420px, 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: 66vh; object-fit: contain; }
.shot-img.old { opacity: .6; }
.shot-wait { aspect-ratio: 9 / 16; max-height: 66vh; 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-left: 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 { 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(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; flex-wrap: wrap; align-items: center; }
.dl-seen { font-size: 13px; }
@media (max-width: 700px) {
  .dl-row { grid-template-columns: minmax(0, 1fr) auto; }
  .dl-state { grid-column: 1 / -1; grid-row: 2; }
  .dl-seen { grid-column: 1 / -1; grid-row: 3; }
  .dl-row .btn { grid-column: 2; grid-row: 1; }
}
/* 기기 확인 창 */
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; } }
