:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f3f2ee;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --accent: #2a78d6;
  --up: #006300;
  --down: #c62f2f;
  --good: #0ca30c;
  --warning: #fab219;
  --critical: #d03b3b;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948; --s9: #8c6d46; --s-other: #a9a79f;
  --prev: #b9b7ae;
  --up-bg: rgba(0, 140, 0, 0.10); --down-bg: rgba(198, 47, 47, 0.10);
  --warn-ink: #b37a00; --warn-bg: rgba(217, 148, 0, 0.13);
  --ref: #c9c7bd; --shadow: 0 0.0625rem 0.125rem rgba(0, 0, 0, .04), 0 0.25rem 1rem rgba(0, 0, 0, .04);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --surface-2: #232321;
    --ink: #f0efec; --ink-2: #c3c2b7; --muted: #898781;
    --grid: #2c2c2a; --axis: #383835; --border: rgba(255, 255, 255, 0.10);
    --accent: #3987e5; --up: #0ca30c; --down: #e66767;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
    --s5: #d55181; --s6: #0ca30c; --s7: #9085e9; --s8: #e66767; --s9: #b08a5f; --s-other: #6b6a64;
    --prev: #55544f;
    --up-bg: rgba(12, 163, 12, 0.16); --down-bg: rgba(230, 103, 103, 0.15);
    --warn-ink: #e0a420; --warn-bg: rgba(224, 164, 32, 0.15);
    --ref: #4a4945; --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --surface-2: #232321;
  --ink: #f0efec; --ink-2: #c3c2b7; --muted: #898781;
  --grid: #2c2c2a; --axis: #383835; --border: rgba(255, 255, 255, 0.10);
  --accent: #3987e5; --up: #0ca30c; --down: #e66767;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --s5: #d55181; --s6: #0ca30c; --s7: #9085e9; --s8: #e66767; --s9: #b08a5f; --s-other: #6b6a64;
  --prev: #55544f;
  --up-bg: rgba(12, 163, 12, 0.16); --down-bg: rgba(230, 103, 103, 0.15);
  --warn-ink: #e0a420; --warn-bg: rgba(224, 164, 32, 0.15);
  --ref: #4a4945; --shadow: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
/* 모든 크기는 rem: 앱(Mac 등)이 --app-zoom 만 바꾸면 글씨·여백·표가 함께 커진다. 브라우저에서는 1 */
html { font-size: calc(16px * var(--app-zoom, 1)); }
/* iOS 가로 화면에서 긴 문단 글씨를 멋대로 키우지 않게 */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: var(--page);
  color: var(--ink);
  font: 0.875rem/1.5 system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.num, td.n, th.n { font-variant-numeric: tabular-nums; }

/* 상단 (2026-11-29: Vigma 와 같은 어두운 상단바 + 아바타 메뉴, 스크롤하면 숨김) */
:root { --bar: #2C2C2C; --bar-2: #3A3A3A; --bar-on: #444; --bar-ink: #CFCFCF; }
header.top {
  position: sticky; top: 0; z-index: 25;   /* 상태 막대 유리(.sb-glass 20)보다 위: 상단바가 보일 때는 상단바가, 숨으면 유리가 보인다 */
  display: flex; align-items: center; gap: 1.25rem;
  /* 앱에서는 상태 막대 자리(안전 영역)까지 상단바 바탕으로 채운다 */
  padding: env(safe-area-inset-top, 0px) calc(1.5rem + env(safe-area-inset-right, 0px)) 0 calc(1.5rem + env(safe-area-inset-left, 0px));
  min-height: calc(3.25rem + env(safe-area-inset-top, 0px));
  background: var(--bar); color: #fff;
  transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}
header.top.hide { transform: translateY(-100%); }
header.top .brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 0.9375rem; white-space: nowrap; color: #fff; }
.brand-v { display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; border-radius: 0.375rem; background: #E0301E; color: #fff; font-size: 0.875rem; font-weight: 800; }
nav.tabs { display: flex; gap: 0.125rem; overflow-x: auto; flex: 1; scrollbar-width: none; }
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs a {
  padding: 0.375rem 0.625rem; border-radius: 0.375rem; color: var(--bar-ink); text-decoration: none; white-space: nowrap; font-weight: 500;
}
nav.tabs a:hover { background: var(--bar-2); color: #fff; }
nav.tabs a.on { background: var(--bar-on); color: #fff; font-weight: 600; }
.userbox { display: flex; align-items: center; gap: 0.5rem; color: var(--bar-ink); font-size: 0.8125rem; white-space: nowrap; }
header.top select { background: var(--bar-2); border-color: var(--bar-2); color: #fff; }
header.top .carry-tog { border-color: #4a4a4a; color: var(--bar-ink); }
header.top .carry-tog.on { color: #fff; background: color-mix(in srgb, var(--accent) 30%, transparent); }
header.top .carry-tog .knob { background: #5a5a5a; }
header.top .carry-tog.on .knob { background: var(--accent); }
.avatar { width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.8125rem; flex: none; }
button.avatar { border: 0; padding: 0; cursor: pointer; font-family: inherit; }
button.avatar:focus-visible { outline: 0.125rem solid #fff; outline-offset: 0.125rem; }
.avatar.lg { width: 2.25rem; height: 2.25rem; font-size: 0.9375rem; }
.me-menu { position: fixed; z-index: 300; width: 15rem; background: var(--surface); color: var(--ink); border: 0.0625rem solid var(--border); border-radius: 0.75rem; box-shadow: 0 0.75rem 2.25rem rgba(0,0,0,.22); padding: 0.5rem; font-size: 0.8125rem; }
.me-menu[hidden] { display: none; }
.me-menu .me-head { display: flex; gap: 0.625rem; align-items: center; padding: 0.375rem 0.375rem 0.5rem; }
.me-menu .me-nm { font-weight: 700; font-size: 0.875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-menu .me-role { font-size: 0.75rem; color: var(--muted); }
.me-menu .me-access { display: flex; align-items: center; gap: 0.375rem; font-size: 0.75rem; color: var(--ink-2); background: var(--surface-2); border-radius: 0.5rem; padding: 0.375rem 0.5rem; margin: 0 0.125rem 0.375rem; }
.me-menu .me-access .dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--good); }
.me-menu .me-access .dot.ext { background: var(--warning); }
.me-menu form { margin: 0; }
.me-menu .me-item { display: block; width: 100%; box-sizing: border-box; text-align: left; background: none; border: 0; border-radius: 0.5rem; padding: 0.5625rem 0.5rem; color: inherit; cursor: pointer; font: inherit; text-decoration: none; }
.me-menu .me-item:hover { background: var(--surface-2); }
.me-menu .me-item.danger { color: var(--down); }
/* 상태 막대 뒤 유리 바탕 (앱에서 상단바가 숨어도 시계·Wi-Fi 가 보이게). 브라우저는 높이 0 */
.sb-glass { position: fixed; top: 0; z-index: 20; pointer-events: none;
  background: rgba(44, 44, 44, .74); -webkit-backdrop-filter: blur(1.25rem) saturate(1.8); backdrop-filter: blur(1.25rem) saturate(1.8); }
.sb-glass { left: 0; right: 0; height: env(safe-area-inset-top, 0px); }
/* [이월 데이터 보정] 스위치 */
.carry-tog { display: inline-flex; align-items: center; gap: 0.375rem; cursor: pointer; padding: 0.25rem 0.625rem 0.25rem 0.375rem; border-radius: 62rem; border: 0.0625rem solid var(--border); color: var(--ink-2); font-size: 0.75rem; user-select: none; }
.carry-tog input { position: absolute; opacity: 0; width: 0; height: 0; }
.carry-tog .knob { position: relative; width: 1.75rem; height: 1rem; border-radius: 62rem; background: var(--axis); transition: background 0.15s; flex: none; }
.carry-tog .knob::after { content: ""; position: absolute; top: 0.125rem; left: 0.125rem; width: 0.75rem; height: 0.75rem; border-radius: 50%; background: #fff; transition: transform 0.15s; box-shadow: 0 0.0625rem 0.125rem rgba(0,0,0,.25); }
.carry-tog.on { border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--ink); font-weight: 600; }
.carry-tog.on .knob { background: var(--accent); }
.carry-tog.on .knob::after { transform: translateX(0.75rem); }
.carry-tog input:focus-visible + .knob { outline: 0.125rem solid var(--accent); outline-offset: 0.125rem; }
.badge { padding: 0.125rem 0.5rem; border-radius: 62.4375rem; font-size: 0.75rem; background: var(--surface-2); color: var(--ink-2); }

main { max-width: 80rem; margin: 0 auto; padding: 1.5rem; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem; }
.toolbar h1 { font-size: 1.25rem; margin: 0 auto 0 0; }
.toolbar .hint { color: var(--muted); font-size: 0.8125rem; }
select, input[type=text], input[type=password], input[type=number], input[type=date], input[type=month], input[type=url], textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 0.0625rem solid var(--border); border-radius: 0.5rem; padding: 0.375rem 0.625rem; min-height: 2.125rem;
}
button.btn, a.btn {
  font: inherit; cursor: pointer; border: 0.0625rem solid var(--border); background: var(--surface);
  color: var(--ink); border-radius: 0.5rem; padding: 0.375rem 0.875rem; min-height: 2.125rem;
}
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; box-sizing: border-box; white-space: nowrap; }
button.btn.primary, a.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.btn:disabled { opacity: .5; cursor: default; }
.seg { display: inline-flex; border: 0.0625rem solid var(--border); border-radius: 0.5rem; overflow: hidden; }
.seg button { all: unset; cursor: pointer; padding: 0.375rem 0.75rem; color: var(--ink-2); font-size: 0.8125rem; }
.seg button.on { background: var(--surface-2); color: var(--ink); font-weight: 600; }

/* 카드 */
.grid { display: grid; gap: 1rem; }
.grid.kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 1rem; }
.grid.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
/* 하루 요약 · 쇼핑몰 펼쳐 보기 */
.drill-box { margin-top: 1rem; padding: 0.875rem; border-radius: 0.625rem; background: var(--page); border: 0.0625rem solid var(--border); }
.seg.sm button { padding: 0.25rem 0.625rem; font-size: 0.75rem; }
.seg button[disabled] { opacity: 0.4; cursor: default; }
.drill-head { margin-bottom: 0.625rem; font-size: 0.8125rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; }
.drill-head .seg { margin-left: auto; }
.grid.drill-cols { grid-template-columns: minmax(0, 3fr) minmax(0, 5fr); gap: 1rem; }
.drill-box table { background: var(--surface); }
td.sig { font-size: 0.6875rem; min-width: 10rem; }
td.sig span { display: block; line-height: 1.35; }
.sig-bad { color: var(--down); }
.sig-good { color: var(--up); }
.sig-warn { color: var(--warning); }
/* 할인율 탭 */
.muted { color: var(--muted); }
table.disc { font-size: 0.8125rem; }
table.disc th, table.disc td { padding-left: 0.4rem; padding-right: 0.4rem; }
table.disc .pname { position: sticky; left: 0; z-index: 1; background: var(--surface); white-space: nowrap; text-align: left; }
table.disc tr.grp th { font-size: 0.6875rem; color: var(--muted); text-align: center; border-bottom: none; padding-bottom: 0; }
table.disc tr.grp th.g-own { border-bottom: 2px solid var(--s1); }
table.disc tr.grp th.g-other { border-bottom: 2px dashed var(--axis); }
table.disc th.mall-h { white-space: nowrap; vertical-align: bottom; }
table.disc th.mall-h.other { color: var(--ink-2); }
table.disc .ev-tag { font-size: 0.625rem; font-weight: 600; color: var(--accent); white-space: nowrap; max-width: 6rem; overflow: hidden; text-overflow: ellipsis; margin-left: auto; }
table.disc td.dc { min-width: 3.25rem; white-space: nowrap; }
table.disc td.dc { position: relative; }
table.disc td.dc.top { font-weight: 700; }
table.disc td.dc.top::after { content: ''; position: absolute; inset: 4px 2px; border: 1.5px solid var(--s1); border-radius: 6px; pointer-events: none; }
table.disc tr.lob-row td { background: var(--page); padding-top: 0.45rem; padding-bottom: 0.45rem; cursor: pointer; user-select: none; }
table.disc tr.lob-row td.pname { background: var(--page); font-weight: 700; color: var(--ink); }
table.disc tr.lob-row .chev { display: inline-block; width: 1.1rem; font-size: 0.875rem; text-align: center; margin-right: 0.2rem; color: var(--muted); transition: transform .15s; }
table.disc tr.lob-row.folded .chev { transform: rotate(-90deg); }
table.disc tr.lob-row .cnt { font-weight: 400; font-size: 0.6875rem; color: var(--muted); margin-left: 0.35rem; }
table.disc tr.p-row.hide { display: none; }
.lob-tools { display: flex; gap: 0.375rem; justify-content: flex-end; margin-bottom: 0.375rem; }
.lob-tools button { font-size: 0.75rem; }
table.disc .best { background: var(--page); font-weight: 600; white-space: nowrap; }
table.disc .best .hint { font-size: 0.625rem; font-weight: 400; color: var(--muted); }
table.disc .dd { display: block; font-size: 0.625rem; line-height: 1.1; }
table.disc td.memo { min-width: 14rem; max-width: 24rem; font-size: 0.75rem; color: var(--ink-2); }
table.disc td.memo span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.grid.disc-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.memo-h { font-size: 0.8125rem; margin: 0.75rem 0 0.375rem; color: var(--ink-2); }
ul.memos { margin: 0; padding-left: 1rem; font-size: 0.75rem; color: var(--ink-2); }
ul.memos li { margin-bottom: 0.25rem; }
.card {
  background: var(--surface); border: 0.0625rem solid var(--border); border-radius: 0.75rem; padding: 1.125rem 1.25rem;
  min-width: 0;
}
.card + .card, .grid + .card, .card + .grid, .grid + .grid { margin-top: 1rem; }
.grid > .card { margin-top: 0; }
.card h2 { font-size: 0.9375rem; margin: 0 0 0.25rem; }
.card .sub { color: var(--muted); font-size: 0.75rem; margin: 0 0 0.875rem; }
.kpi .label { color: var(--ink-2); font-size: 0.8125rem; }
.kpi .value { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; margin: 0.25rem 0 0.375rem; }
.kpi .value small { font-size: 0.9375rem; font-weight: 600; margin-left: 0.125rem; color: var(--ink-2); }
.kpi .deltas { display: flex; flex-direction: column; gap: 0.125rem; font-size: 0.75rem; color: var(--muted); }
.up { color: var(--up); }
.down { color: var(--down); }

/* 표 */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.8125rem; }
th, td { padding: 0.4375rem 0.625rem; border-bottom: 0.0625rem solid var(--grid); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 0.75rem; }
td.n, th.n { text-align: right; }
tr.total td { font-weight: 700; border-top: 0.0625rem solid var(--axis); }
tbody tr:hover td { background: var(--surface-2); }
.sw { display: inline-block; width: 0.625rem; height: 0.625rem; border-radius: 0.1875rem; margin-right: 0.5rem; vertical-align: -0.0625rem; }
.bar-cell { display: flex; align-items: center; gap: 0.5rem; min-width: 6.875rem; }
.bar-track { flex: 1; height: 0.5rem; background: var(--surface-2); border-radius: 0.25rem; position: relative; overflow: hidden; }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0.25rem; background: var(--accent); }
.bar-mark { position: absolute; top: -0.1875rem; bottom: -0.1875rem; width: 0.125rem; background: var(--ink-2); }
.status { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.75rem; }
.status i { width: 0.5rem; height: 0.5rem; border-radius: 50%; display: inline-block; }

.chart-box { position: relative; height: 20rem; }
.chart-box.short { height: 16.25rem; }
.legend { display: flex; flex-wrap: wrap; gap: 0.375rem 0.875rem; font-size: 0.75rem; color: var(--ink-2); margin-bottom: 0.625rem; }

.empty { color: var(--muted); padding: 1.5rem 0; text-align: center; }
/* 탭을 옮기는 동안: 이전 화면을 흐리게 (빠르게 열리면 거의 안 보이도록 살짝 늦게) */
#view { transition: opacity 0.12s; }
#view.loading { opacity: 0.45; pointer-events: none; transition: opacity 0.2s 0.15s; }
.note { color: var(--muted); font-size: 0.75rem; margin-top: 0.625rem; }
.err { color: var(--down); }
.neg, .kpi .value.neg, .kpi .value.neg small { color: var(--down); }
.period { margin: -0.5rem 0 1rem; color: var(--ink-2); font-size: 0.8125rem; line-height: 1.7; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.25rem; }
.card-head h2 { margin: 0; }
.picker { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.375rem; font-size: 0.75rem; color: var(--ink-2); margin-bottom: 0.75rem; }
.picker label { display: inline-flex; align-items: center; gap: 0; padding: 0.25rem 0.5rem; border: 0.0625rem solid var(--border); border-radius: 62.4375rem; cursor: pointer; user-select: none; }
/* 체크박스도 글자 크기(배율)를 따라가게 */
input[type=checkbox] { width: 0.875rem; height: 0.875rem; }
.picker label input { margin: 0 0.375rem 0 0; accent-color: var(--accent); }
.picker label .sw { margin-right: 0.3125rem; }
.picker label:has(input:not(:checked)) { color: var(--muted); opacity: .6; }
.picker-all { margin-left: 0.375rem; display: inline-flex; gap: 0.625rem; }
button.link { all: unset; cursor: pointer; color: var(--accent); font-size: 0.75rem; }
.filter-card { padding: 0.75rem 1rem; }
.filter-card .picker { margin-bottom: 0; }
.filter-head { display: flex; gap: 0.625rem; align-items: baseline; font-size: 0.8125rem; margin-bottom: 0.5rem; }
th.ev-col { white-space: normal; min-width: 10rem; color: var(--ink-2); }
.form-col { display: flex; flex-direction: column; gap: 0.5rem; max-width: 20rem; }
.drop {
  display: block; border: 0.125rem dashed var(--axis); border-radius: 0.75rem; padding: 2rem; text-align: center; color: var(--ink-2);
  cursor: pointer;
}
.drop.over { border-color: var(--accent); background: var(--surface-2); }
.form-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.hidden { display: none !important; }

@media (max-width: 900px) {
  .grid.kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.two, .grid.ev-tops, .grid.drill-cols { grid-template-columns: minmax(0, 1fr) !important; }
}
/* 탭이 한 줄에 다 들어가지 않는 폭(휴대폰, 폴더블, 좁은 창): 탭을 둘째 줄 전체 폭으로 (가로 스크롤) */
@media (max-width: 1200px) {
  header.top { padding-top: calc(0.5rem + env(safe-area-inset-top, 0px)); gap: 0.25rem 0.75rem; flex-wrap: wrap; }
  header.top .userbox { margin-left: auto; }
  nav.tabs { order: 2; flex-basis: 100%; padding-bottom: 0.375rem; }
}
@media (max-width: 560px) {
  .grid.disc-kpi { grid-template-columns: minmax(0, 1fr); }
  header.top { padding-left: calc(1rem + env(safe-area-inset-left, 0px)); padding-right: calc(1rem + env(safe-area-inset-right, 0px)); }
  header.top .brand-t { display: none; }
  .carry-tog .long { display: none; }
  main { padding: 1rem; }
  .kpi .value { font-size: 1.375rem; }
  .chart-box { height: 16.25rem; }
}

/* iPhone Duo 처럼 한쪽 옆에만 카메라·상태 정보 줄이 있는 화면 (app.js applySafeArea 가 html 에 app-side 를 붙임).
   웹은 그 줄까지 넓게 쓰고, 상단바 안의 버튼만 그 줄을 피한다. 줄 맨 위(시계·Wi-Fi)에는 상단바와 같은 유리 바탕을 깔고,
   그 아래로 오는 첫 줄(제목·도구)도 그 자리를 피한다. 예전 앱은 웹을 옆 줄까지만 넓혀 env() 대신 setAppSide 값(--app-side-*)을 쓴다. */
html.app-side header.top {
  padding-left: calc(var(--app-side-l, 0px) + 1rem);
  padding-right: calc(var(--app-side-r, 0px) + 0.75rem);
}
html.side-status main > .toolbar:first-child,
html.side-status main > :first-child > .toolbar:first-child,
html.side-status main > .rp-wrap > :first-child {
  padding-left: var(--app-side-l, 0px);
  padding-right: var(--app-side-r, 0px);
  box-sizing: border-box;
}
main { padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px)); }
.app-opt { display: flex; gap: 0.625rem; align-items: flex-start; cursor: pointer; }
.app-opt input { margin-top: 0.25rem; }
.brief-opts { display: grid; gap: 0.625rem; margin: 0.75rem 0 0 1.5rem; }
.brief-opts.off { opacity: 0.45; pointer-events: none; }
.chip-ck { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.25rem 0.5rem; border: 0.0625rem solid var(--border); border-radius: 999px; font-size: 0.8125rem; cursor: pointer; }
.ck-col { display: grid; gap: 0.375rem; }
.btn.sm { padding: 0.25rem 0.625rem; font-size: 0.8125rem; }

/* ================================================================ 카드·그래프 화면 공통 (.dash) — 요약·비교·일자별·행사 탭
   처음 들어올 때 .dash.anim 이 붙어 카드가 떠오르고 막대·그래프가 자란다.
   각 요소의 시작 시각은 인라인 --d 로 준다. 크기는 모두 rem (앱 배율을 따라감). */
.dash .toolbar { margin-bottom: 0.5rem; }
.dash .toolbar h1 { margin: 0; }
.dash-period { color: var(--muted); font-size: 0.8125rem; margin-right: auto; }
.progress-mini { display: inline-block; width: 3.5rem; height: 0.25rem; border-radius: 0.125rem; background: var(--grid); vertical-align: middle; margin-left: 0.375rem; overflow: hidden; }
.progress-mini i { display: block; height: 100%; background: var(--muted); border-radius: 0.125rem; }
.dash .sec-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.5rem; margin: 1.5rem 0 0.625rem; }
.dash .sec-title h2 { font-size: 0.9375rem; margin: 0; }
.dash .sec-title .hint, .dash .hint { color: var(--muted); font-size: 0.75rem; font-weight: 400; }
.dash .card { border-radius: 0.875rem; padding: 1rem 1.125rem; box-shadow: var(--shadow); }
.dash .grid + .grid, .dash .card + .grid, .dash .grid + .card { margin-top: 0; }
.dash .grid { gap: 0.75rem; }
.dash .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dash .g-brief { grid-template-columns: minmax(0, 4fr) minmax(0, 5fr) minmax(0, 5fr); }
.dash .g2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.dash .up { color: var(--up); } .dash .down { color: var(--down); }

/* 이달 현황 */
.dash .kpi .value { font-size: 1.875rem; font-weight: 750; margin: 0.125rem 0 0.5rem; line-height: 1.15; }
.pills { display: flex; flex-wrap: wrap; gap: 0.375rem; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.75rem; padding: 0.125rem 0.5rem; border-radius: 62rem; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill b { font-weight: 650; }
.pill.up { background: var(--up-bg); } .pill.up b { color: var(--up); }
.pill.down { background: var(--down-bg); } .pill.down b { color: var(--down); }
.spark { display: block; width: 100%; height: 2.75rem; margin-top: 0.625rem; overflow: visible; cursor: crosshair; }
.spark .area { fill: var(--accent); opacity: .12; }
.spark .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.spark .zero { stroke: var(--axis); stroke-width: 1; }
.spark-cap { display: flex; justify-content: space-between; font-size: 0.6875rem; color: var(--muted); margin-top: 0.125rem; }
.ring-wrap { display: flex; align-items: center; gap: 0.875rem; margin-bottom: 0.625rem; }
.ring { width: 5.75rem; height: 5.75rem; flex: none; }
.ring .track { fill: none; stroke: var(--grid); stroke-width: 10; }
.ring .fill { fill: none; stroke: var(--accent); stroke-width: 10; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; stroke-dasharray: 1; stroke-dashoffset: var(--off); }
.ring .mark { stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; }
.dash .ring-wrap .value { margin: 0; }
.ring-meta { font-size: 0.75rem; color: var(--muted); display: grid; gap: 0.1875rem; }
.ring-meta b { color: var(--ink); font-weight: 650; }
.dash .kpi .fc-line { font-size: 0.75rem; color: var(--muted); margin: -0.125rem 0 0.375rem; }
.dash .kpi .fc-line b { color: var(--ink); font-weight: 650; }
.lg-sw { display: inline-block; width: 0.625rem; height: 0.1875rem; border-radius: 0.125rem; vertical-align: middle; margin-right: 0.3125rem; background: var(--ink); }
.st { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.6875rem; font-weight: 650; padding: 0.125rem 0.5rem; border-radius: 62rem; justify-self: end; white-space: nowrap; }
.st.ok { color: var(--up); background: var(--up-bg); }
.st.warn { color: var(--warn-ink); background: var(--warn-bg); }
.st.bad { color: var(--down); background: var(--down-bg); }

/* 하루 요약 */
.dash .insight { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem 0.75rem; padding: 0.875rem 1.125rem; border-radius: 0.875rem; background: var(--surface); border: 0.0625rem solid var(--border); box-shadow: var(--shadow); margin-bottom: 0.75rem; }
.insight .day { font-weight: 700; font-size: 0.9375rem; }
.insight .say { color: var(--ink-2); }
.insight .events { margin-left: auto; display: flex; gap: 0.375rem; flex-wrap: wrap; }
.insight .ev { font-size: 0.75rem; padding: 0.1875rem 0.625rem; border-radius: 62rem; border: 0.0625rem solid var(--border); color: var(--ink-2); text-decoration: none; }
.insight .ev::before { content: "● "; color: var(--s5); }
.insight .ev:hover { background: var(--surface-2); }
.dash .info { display: inline-grid; place-items: center; width: 1rem; height: 1rem; border-radius: 50%; border: 0.0625rem solid var(--axis); color: var(--muted); font-size: 0.625rem; font-weight: 700; cursor: help; font-style: normal; flex: none; }
.mini-h { font-size: 0.8125rem; font-weight: 650; margin: 0 0 0.625rem; display: flex; align-items: center; gap: 0.375rem; }
.mini-h .hint { margin-left: auto; }
.daykpi { display: grid; grid-template-columns: 4.25rem minmax(0, 1fr); gap: 0.375rem 0.75rem; align-items: center; }
.daykpi + .daykpi { margin-top: 0.875rem; padding-top: 0.875rem; border-top: 0.0625rem solid var(--border); }
.daykpi .k { font-size: 0.75rem; color: var(--ink-2); }
.daykpi .v { font-size: 1.25rem; font-weight: 750; line-height: 1.1; }
.daykpi .v small { font-size: 0.75rem; color: var(--muted); font-weight: 500; margin-left: 0.0625rem; }
.daykpi .vs { font-size: 0.6875rem; }
.cmp { grid-column: 1 / -1; margin-top: 0.5rem; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.375rem; }
.cmp .col { display: grid; gap: 0.1875rem; justify-items: center; }
.cmp .bar-v { position: relative; width: 100%; max-width: 2.125rem; height: 2.875rem; }
.cmp .bar-v i { position: absolute; left: 0; right: 0; background: var(--ref); border-radius: 0.25rem 0.25rem 0 0; }
.cmp .bar-v i.neg { border-radius: 0 0 0.25rem 0.25rem; }
.cmp .bar-v .zl { position: absolute; left: -0.25rem; right: -0.25rem; height: 0.0625rem; background: var(--axis); }
.cmp .col.today .bar-v i { background: var(--accent); }
.cmp .cap { font-size: 0.6875rem; color: var(--muted); white-space: nowrap; }
.cmp .cv { font-size: 0.6875rem; color: var(--ink-2); }
.cmp .cv.neg { color: var(--down); }
.mall-row { display: grid; grid-template-columns: 6rem minmax(0, 1fr) 4rem; align-items: center; gap: 0.625rem; padding: 0.375rem; border-radius: 0.5rem; cursor: pointer; }
.mall-row:hover { background: var(--surface-2); }
.mall-row.open { background: color-mix(in srgb, var(--s1) 12%, transparent); }
.mall-row .nm { font-size: 0.8125rem; display: flex; align-items: center; white-space: nowrap; overflow: hidden; }
.mall-row .nm .sw { margin-right: 0.375rem; }
.mall-row .nm .sw, .goal .nm .sw, .hl .t .nm .sw { flex: none; }
.mall-row .chev { display: inline-block; width: 0.75rem; color: var(--muted); font-size: 0.6875rem; transition: transform 0.15s; flex: none; }
.mall-row.open .chev { transform: rotate(90deg); }
.bullet { position: relative; height: 0.875rem; }
.bullet .bg { position: absolute; inset: 0.3125rem 0; background: var(--surface-2); border-radius: 0.125rem; }
.bullet .fill { position: absolute; left: 0; top: 0.125rem; bottom: 0.125rem; border-radius: 0 0.25rem 0.25rem 0; }
.bullet .tick { position: absolute; top: -0.0625rem; bottom: -0.0625rem; width: 0.15625rem; margin-left: -0.078rem; background: var(--ink); border-radius: 0.0625rem; }
.mall-row .amt { text-align: right; font-size: 0.6875rem; font-weight: 650; line-height: 1.3; }
.mall-row .amt b { display: block; font-size: 0.8125rem; color: var(--ink); }
.mall-row .amt b.neg { color: var(--down); }
.mall-row.rest { cursor: default; color: var(--muted); font-size: 0.75rem; }
.mall-row.rest:hover { background: none; }
.mall-row.rest .nm { font-size: 0.75rem; padding-left: 0.75rem; }
.mall-row.rest .rest-names { font-size: 0.6875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mall-row.rest .amt { font-weight: 400; color: var(--muted); }
.legend-sm { display: flex; gap: 0.875rem; font-size: 0.6875rem; color: var(--muted); margin-top: 0.5rem; padding-left: 0.375rem; }
.legend-sm i { display: inline-block; vertical-align: middle; margin-right: 0.3125rem; }
.legend-sm .lg-fill { width: 0.875rem; height: 0.5rem; border-radius: 0.125rem; background: var(--muted); }
.legend-sm .lg-tick { width: 0.15625rem; height: 0.75rem; background: var(--ink); }
.hl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.125rem 0.625rem; padding: 0.5rem 0; border-bottom: 0.0625rem dashed var(--border); }
.hls .hl:last-child { border-bottom: 0; }
.hls .hl.extra { display: none; }
.hls.all .hl.extra { display: grid; }
.hl .t { font-size: 0.8125rem; font-weight: 600; display: flex; gap: 0.375rem; align-items: center; min-width: 0; }
.hl .t .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hl .t .nm .sw { margin-right: 0.25rem; }
.hl .kind { font-size: 0.625rem; font-weight: 700; padding: 0.0625rem 0.375rem; border-radius: 0.25rem; background: var(--surface-2); color: var(--ink-2); flex: none; }
.hl .lift { font-size: 0.9375rem; font-weight: 750; color: var(--up); text-align: right; }
.hl .d { grid-column: 1 / -1; font-size: 0.6875rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.liftbar { grid-column: 1 / -1; height: 0.25rem; border-radius: 0.125rem; background: var(--surface-2); overflow: hidden; margin-top: 0.1875rem; }
.liftbar i { display: block; height: 100%; background: var(--up); opacity: .7; border-radius: 0.125rem; }
.dash .more { all: unset; cursor: pointer; font-size: 0.75rem; color: var(--accent); padding-top: 0.375rem; }
.dash #brief-drill:not(:empty) { margin-top: 0.75rem; }
.dash #brief-drill .drill-box { margin-top: 0; background: var(--surface); }

/* 목표 대비 실적 */
.goal { display: grid; grid-template-columns: 6rem minmax(0, 1fr) 3.75rem 4.25rem; align-items: center; gap: 0.75rem; padding: 0.5rem 0.25rem; border-bottom: 0.0625rem solid var(--border); }
.goal.total { border-top: 0.125rem solid var(--axis); border-bottom: 0; margin-top: 0.125rem; padding-top: 0.75rem; font-weight: 700; }
.goal + .goal.total { border-top: 0.125rem solid var(--axis); }
.goal .nm { display: flex; align-items: center; font-size: 0.8125rem; white-space: nowrap; overflow: hidden; }
.gbar { position: relative; height: 1.375rem; }
.gbar .bg { position: absolute; inset: 0.4375rem 0; border-radius: 0.25rem; background: var(--surface-2); }
.gbar .fill { position: absolute; left: 0; top: 0.4375rem; bottom: 0.4375rem; border-radius: 0.25rem; }
.gbar .mark { position: absolute; top: 0.125rem; bottom: 0.125rem; width: 0.125rem; margin-left: -0.0625rem; background: var(--ink); opacity: .55; }
.goal .pct { text-align: right; font-size: 0.8125rem; font-weight: 650; }
.goal-legend { display: flex; flex-wrap: wrap; gap: 0.25rem 0.875rem; font-size: 0.6875rem; color: var(--muted); margin-top: 0.625rem; }
.goal-legend i { display: inline-block; width: 0.125rem; height: 0.75rem; background: var(--ink); opacity: .55; vertical-align: middle; margin-right: 0.3125rem; }

/* 매출 구성 */
.card-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; gap: 0.5rem; }
.card-h h3 { margin: 0; font-size: 0.875rem; }
.card-h .ctl { display: flex; gap: 0.375rem; align-items: center; }
.strip { display: flex; height: 1.625rem; border-radius: 0.375rem; overflow: hidden; gap: 0.125rem; }
.strip i { display: block; height: 100%; flex: none; }
.comp-list { margin-top: 0.75rem; display: grid; gap: 0.125rem; }
.comp-wrap { container-type: inline-size; }
.comp-row { display: grid; grid-template-columns: 0.875rem minmax(0, 1fr) 4.5rem 3.75rem 3.5rem 4rem; align-items: center; gap: 0.5rem; font-size: 0.8125rem; padding: 0.3125rem 0.25rem; border-radius: 0.375rem; }
.comp-row:not(.comp-head):hover { background: var(--surface-2); }
.comp-row .sw { margin: 0; }
.comp-row .k { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comp-row .n { text-align: right; font-variant-numeric: tabular-nums; }
.comp-row .sh { color: var(--ink-2); }
.comp-row .q { font-size: 0.75rem; }
.comp-head { font-size: 0.6875rem; color: var(--muted); }
.comp-head .n, .comp-head .q { font-size: 0.6875rem; }

/* 설명창 */
.dash-tip { position: fixed; pointer-events: none; z-index: 50; background: var(--surface); color: var(--ink); border: 0.0625rem solid var(--axis); border-radius: 0.625rem; padding: 0.5rem 0.625rem; font-size: 0.75rem; line-height: 1.5; box-shadow: 0 0.375rem 1.25rem rgba(0, 0, 0, .14); opacity: 0; transition: opacity .12s; min-width: 9rem; max-width: 18rem; }
.dash-tip .r { display: flex; justify-content: space-between; gap: 0.875rem; color: var(--ink-2); }
.dash-tip .r b { color: var(--ink); font-variant-numeric: tabular-nums; }
.dash-tip .h { font-weight: 700; margin-bottom: 0.25rem; }

/* 등장 애니메이션 (처음 들어올 때만) */
.dash.anim .rise { animation: dash-rise .6s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0ms); }
.dash.anim .bullet .fill, .dash.anim .gbar .fill, .dash.anim .liftbar i, .dash.anim .strip i { animation: dash-grow-w .9s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0ms); }
.dash.anim .cmp .bar-v i { animation: dash-grow-h .9s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0ms); }
.dash.anim .bullet .tick { animation: dash-fade .3s both; animation-delay: 1.1s; }
.dash.anim .spark .line { animation: dash-draw 1.3s cubic-bezier(.4, 0, .2, 1) both; animation-delay: var(--d, 0ms); }
.dash.anim .spark .area { animation: dash-fade .6s both; animation-delay: calc(var(--d, 0ms) + 900ms); }
.dash.anim .ring .fill { animation: dash-ring 1.2s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0ms); }
@keyframes dash-rise { from { opacity: 0; transform: translateY(0.625rem); } }
@keyframes dash-grow-w { from { width: 0; } }
@keyframes dash-grow-h { from { height: 0; } }
@keyframes dash-fade { from { opacity: 0; } }
@keyframes dash-draw { from { stroke-dashoffset: 1; } }
@keyframes dash-ring { from { stroke-dashoffset: 1; } }
@media (prefers-reduced-motion: reduce) {
  .dash.anim *, .dash.anim .rise { animation: none !important; }
}

@media (max-width: 1000px) {
  .dash .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash .g-brief { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .dash .g-brief > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .dash .g4 { gap: 0.5rem; }
  .dash .kpi { padding: 0.75rem 0.875rem; }
  .dash .kpi .value { font-size: 1.375rem; }
  .dash .spark { height: 2.125rem; }
  .ring { width: 4rem; height: 4rem; }
  .ring-wrap { gap: 0.625rem; }
  .ring-meta { font-size: 0.6875rem; }
  .dash .g-brief, .dash .g2 { grid-template-columns: minmax(0, 1fr); }
  .goal { grid-template-columns: 5.5rem minmax(0, 1fr) 3rem 3.5rem; gap: 0.5rem; }
  .goal .nm, .mall-row .nm { font-size: 0.75rem; }
  .insight .events { margin-left: 0; }
  .mall-row { grid-template-columns: 6rem minmax(0, 1fr) 3.5rem; gap: 0.5rem; }
}

/* ---------------------------------------------------------------- 공통 보강 */
.dash .filter-card { padding: 0.75rem 1rem; margin-bottom: 0.75rem; }
.dash .toolbar .seg { background: var(--surface); }
.dash .toolbar .rng-pick { display: inline-flex; align-items: center; gap: 0.375rem; flex-wrap: wrap; }
.dash .toolbar .rng-pick input[type=date] { min-width: 0; }
.dash .sec-title .sec-ctl { margin-left: auto; }
.dash .legend { margin-bottom: 0; }
.dash .card-h .legend { margin: 0; }
.legend-sm.wrap { flex-wrap: wrap; gap: 0.25rem 0.75rem; }
.chip { display: inline-block; font-size: 0.6875rem; padding: 0.0625rem 0.4375rem; border-radius: 0.3125rem; white-space: nowrap; }
.chip-bad { color: var(--down); background: var(--down-bg); }
.chip-good { color: var(--up); background: var(--up-bg); }
.chip-warn { color: var(--warn-ink); background: var(--warn-bg); }
.pill.link-pill { text-decoration: none; color: var(--accent); }

/* ---------------------------------------------------------------- 하루 요약 · 쇼핑몰 펼쳐 보기 */
.dash #brief-drill .drill-box { padding: 1rem 1.125rem; border-radius: 0.875rem; box-shadow: var(--shadow); }
.drill-box .drill-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin-bottom: 0.5rem; font-size: 0.8125rem; }
.drill-head .dh-t { font-size: 0.9375rem; display: inline-flex; align-items: center; gap: 0.25rem; }
.drill-head .dh-v b { font-size: 1rem; }
.drill-head .dh-ctl { margin-left: auto; display: inline-flex; align-items: center; gap: 0.75rem; }
.drill-head .dh-ctl .seg { margin: 0; }
.drill-say { margin: 0 0 0.875rem; font-size: 0.8125rem; color: var(--ink-2); }
.dv-list { display: grid; }
.dv-row { display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr) 7.5rem 2.75rem; align-items: center; gap: 0.625rem; padding: 0.3125rem 0.25rem; border-radius: 0.375rem; }
.dv-row:hover { background: var(--surface-2); }
.dv-nm { display: flex; flex-direction: column; min-width: 0; font-size: 0.8125rem; }
.dv-nm .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-nm .sw { display: none; }
.dv-nm .hint { font-size: 0.6875rem; }
.dv-bar { position: relative; height: 1rem; }
.dv-bar .axis { position: absolute; left: 50%; top: -0.125rem; bottom: -0.125rem; width: 0.0625rem; background: var(--axis); }
.dv-bar i { position: absolute; top: 0.1875rem; bottom: 0.1875rem; }
.dv-bar i.pos { background: var(--up); opacity: .75; border-radius: 0 0.25rem 0.25rem 0; }
.dv-bar i.neg { background: var(--down); opacity: .75; border-radius: 0.25rem 0 0 0.25rem; }
.dv-val { display: flex; flex-direction: column; align-items: flex-end; font-size: 0.75rem; line-height: 1.3; }
.dv-val b { font-weight: 650; font-size: 0.8125rem; }
.dv-val .hint { font-size: 0.6875rem; white-space: nowrap; }
.dv-sh { text-align: right; font-size: 0.6875rem; color: var(--muted); }
.dv-disc { display: flex; flex-wrap: wrap; gap: 0.25rem; padding: 0 0.25rem 0.375rem 0.25rem; margin-top: -0.125rem; border-bottom: 0.0625rem dashed var(--border); }
.dv-disc .pill { font-size: 0.6875rem; padding: 0.0625rem 0.4375rem; }
.dv-disc .dd { margin-left: 0.25rem; font-size: 0.625rem; }
.drill-box .note { margin-top: 0.75rem; font-size: 0.6875rem; }
.drill-box.anim .dv-bar i { animation: dash-grow-w .7s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0ms); }
.drill-box.anim { animation: dash-rise .35s cubic-bezier(.2, .8, .2, 1) both; }

/* ---------------------------------------------------------------- 비교 */
.dash .dash-period .vs-chip { display: inline-flex; gap: 0.25rem; padding: 0.1875rem 0.625rem; border-radius: 62rem; font-size: 0.75rem; border: 0.0625rem solid var(--border); background: var(--surface); }
.dash p.dash-period { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem 0.5rem; margin: 0 0 0.75rem; }
.vs-chip.a { border-color: color-mix(in srgb, var(--s1) 45%, transparent); }
.vs-chip.a::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 0.125rem; background: var(--s1); align-self: center; }
.vs-chip.b::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 0.125rem; background: var(--prev); align-self: center; }
.dash-period .vs { color: var(--muted); font-size: 0.75rem; }
.insight .movers { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; font-size: 0.75rem; color: var(--ink-2); }
.insight .movers .sep { width: 0.0625rem; height: 0.875rem; background: var(--border); }
.insight .movers .sw { margin-right: 0.25rem; }
.pair { display: grid; gap: 0.3125rem; margin-top: 0.75rem; }
.pr { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr) 4.5rem; align-items: center; gap: 0.5rem; font-size: 0.6875rem; }
.pr .pl { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr .pt { height: 0.5rem; background: var(--surface-2); border-radius: 0.25rem; overflow: hidden; }
.pr .pt i { display: block; height: 100%; border-radius: 0.25rem; }
.pr .pt i.a { background: var(--s1); }
.pr .pt i.b { background: var(--prev); }
.pr .pt i.negv { background: var(--down); opacity: .7; }
.pr .pv { text-align: right; color: var(--ink-2); }
.cr-list { display: grid; gap: 0.125rem; }
.cr { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) 5.25rem; align-items: center; gap: 0.625rem; padding: 0.375rem 0.25rem; border-radius: 0.5rem; }
.cr:not(.total):hover { background: var(--surface-2); }
.cr .nm { font-size: 0.8125rem; display: flex; align-items: center; white-space: nowrap; overflow: hidden; }
.cr .nm .sw { flex: none; }
.cr .cb { display: grid; gap: 0.1875rem; }
.cr .cb i { display: block; height: 0.5rem; border-radius: 0 0.25rem 0.25rem 0; }
.cr .cb i.b { height: 0.3125rem; background: var(--prev); }
.cr .cv { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.3; font-size: 0.6875rem; font-weight: 650; }
.cr .cv b { font-size: 0.8125rem; color: var(--ink); }
.cr .cv b.neg { color: var(--down); }
.cr.total { border-top: 0.125rem solid var(--axis); border-radius: 0; margin-top: 0.25rem; padding-top: 0.625rem; font-weight: 700; }
.cr.total .hint { font-size: 0.6875rem; }

/* ---------------------------------------------------------------- 일자별 */
.best-top { display: grid; gap: 0.1875rem; margin-top: 0.75rem; font-size: 0.75rem; color: var(--ink-2); }
.best-top span { display: flex; align-items: center; }
.best-top .sw { flex: none; }
.best-top b { margin-left: auto; font-weight: 650; color: var(--ink); }
.cal-head, .cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.375rem; }
.cal-head { margin-bottom: 0.375rem; font-size: 0.6875rem; color: var(--muted); text-align: center; }
.cal-head .wkend { color: var(--down); }
.cal-c { position: relative; min-height: 4.75rem; border-radius: 0.5rem; padding: 0.375rem 0.5rem 0.625rem; display: flex; flex-direction: column; gap: 0.0625rem;
  background: color-mix(in srgb, var(--s1) var(--h, 0%), var(--surface)); border: 0.0625rem solid var(--border); overflow: hidden; cursor: default; }
.cal-c.empty { background: none; border: 0; }
.cal-c.nodata { background: var(--surface-2); opacity: .5; }
.cal-c .dn { font-size: 0.6875rem; color: var(--ink-2); font-weight: 600; }
.cal-c.wkend .dn { color: var(--down); }
.cal-c b { font-size: 0.875rem; font-weight: 700; color: var(--ink); line-height: 1.2; }
.cal-c b.neg { color: var(--down); }
.cal-c .mg { font-size: 0.625rem; color: var(--muted); }
.cal-c .mg.neg { color: var(--down); }
.cal-c .mix { position: absolute; left: 0; right: 0; bottom: 0; height: 0.25rem; display: flex; gap: 0.0625rem; }
.cal-c .mix i { display: block; height: 100%; }
.cal-c.best { outline: 0.125rem solid var(--accent); outline-offset: -0.0625rem; }
.cal-c:hover { border-color: var(--axis); }
.legend-sm .lg-heat { width: 2rem; height: 0.5rem; border-radius: 0.125rem; background: linear-gradient(90deg, var(--surface-2), color-mix(in srgb, var(--s1) 64%, var(--surface))); }
table.heat tr.wkend td:first-child { color: var(--down); }
table.heat td.tot { position: relative; min-width: 7rem; }
table.heat td.tot .tot-bar { position: absolute; left: 0.375rem; right: 0.375rem; bottom: 0.25rem; height: 0.1875rem; }
table.heat td.tot .tot-bar i { display: block; height: 100%; margin-left: auto; background: var(--ink-2); opacity: .35; border-radius: 0.125rem; }
.dash.anim .cal-c:not(.empty) { animation: dash-rise .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0ms); }

/* ---------------------------------------------------------------- 행사 */
.ev-live-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ev-live-grid.one { grid-template-columns: minmax(0, 1fr); }
.ev-live { display: grid; gap: 0.75rem; border-top: 0.1875rem solid var(--accent); }
.ev-live-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.ev-live-h .ev-t { font-size: 1rem; display: flex; align-items: center; }
.ev-live-h .ev-t .sw { flex: none; }
.dday { font-size: 0.75rem; font-weight: 700; padding: 0.1875rem 0.625rem; border-radius: 62rem; background: var(--accent); color: #fff; white-space: nowrap; }
.ev-live-b { display: flex; align-items: center; gap: 1rem; }
.ev-live-b .ring { width: 5.5rem; height: 5.5rem; }
.ring .ring-txt { font-size: 1.125rem; font-weight: 750; fill: var(--ink); }
.ev-nums .label { font-size: 0.75rem; color: var(--ink-2); }
.ev-nums .value { font-size: 1.75rem; font-weight: 750; line-height: 1.15; margin: 0.125rem 0 0.375rem; }
.ev-nums .value small { font-size: 0.8125rem; font-weight: 600; color: var(--ink-2); margin-left: 0.125rem; }
.ev-facts { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-size: 0.75rem; color: var(--muted); }
.ev-facts b { color: var(--ink); font-weight: 650; }
.ev-facts b.down { color: var(--down); } .ev-facts b.up { color: var(--up); }
.ev-days { position: relative; display: flex; align-items: flex-end; gap: 0.1875rem; height: 4.5rem; padding-top: 0.25rem; border-bottom: 0.0625rem solid var(--axis); }
.evd { flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 0; }
.evd i { display: block; width: 100%; background: var(--accent); border-radius: 0.1875rem 0.1875rem 0 0; }
.evd.future i { background: repeating-linear-gradient(135deg, var(--grid) 0 0.25rem, transparent 0.25rem 0.5rem); border: 0.0625rem dashed var(--axis); border-bottom: 0; }
.ref-line { position: absolute; left: 0; right: 0; height: 0; border-top: 0.0625rem dashed var(--ink-2); z-index: 1; pointer-events: none; }
.ref-line.need { border-top-color: var(--warn-ink); }
.ref-line em { position: absolute; right: 0; bottom: 0.125rem; font-style: normal; font-size: 0.625rem; color: var(--ink-2); background: var(--surface); padding: 0 0.25rem; border-radius: 0.1875rem; }
.ref-line.need em { color: var(--warn-ink); right: auto; left: 0; }
.ev-days-cap { display: flex; justify-content: space-between; font-size: 0.6875rem; color: var(--muted); margin-top: -0.375rem; }
.dash.anim .evd i { animation: dash-grow-h .8s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0ms); }
.ev-list { padding: 0.375rem 0.5rem; }
/* 목록 접기: 쇼핑몰 필터와 체크하지 않은 행사를 숨긴다 (체크한 행사는 남겨 비교 대상이 보이게) */
.ev-listwrap.folded .ev-mallpick, .ev-listwrap.folded .ev-row:not(.on), .ev-listwrap.folded .ev-list .empty { display: none; }
.ev-listwrap.folded .ev-list:not(:has(.ev-row.on)) { display: none; }
.ev-listwrap.folded .ev-row.on { border-bottom: 0; }
.ev-row { display: grid; grid-template-columns: 1rem 3.75rem minmax(0, 1fr) 10rem 7rem; align-items: center; gap: 0.75rem; padding: 0.625rem 0.5rem; border-radius: 0.5rem; cursor: pointer; border-bottom: 0.0625rem solid var(--border); }
.ev-row:last-child { border-bottom: 0; }
.ev-row:hover { background: var(--surface-2); }
.ev-row.on { background: color-mix(in srgb, var(--s1) 9%, transparent); }
.ev-row input { margin: 0; accent-color: var(--accent); }
.ev-st { justify-self: start; font-size: 0.6875rem; font-weight: 650; padding: 0.0625rem 0.5rem; border-radius: 62rem; white-space: nowrap; }
.ev-st.on { background: var(--accent); color: #fff; }
.ev-st.up { background: #f6c343; color: #3d2c00; }  /* 예정: 노란색으로 채워 종료와 구분 */
.ev-st.end { background: var(--surface-2); color: var(--muted); }
.ev-nm { display: flex; flex-direction: column; min-width: 0; }
.ev-nm-t { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.ev-nm b { font-size: 0.875rem; display: flex; align-items: center; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ev-dur { flex: none; font-size: 1.125rem; font-weight: 750; line-height: 1; color: var(--ink); padding: 0.1875rem 0.5rem; border-radius: 0.375rem; background: var(--surface-2); }
.ev-dur small { font-size: 0.6875rem; font-weight: 600; color: var(--muted); margin-left: 0.0625rem; }
.ev-nm b .sw { flex: none; }
.ev-nm .hint { font-size: 0.6875rem; }
.ev-prog { display: grid; gap: 0.125rem; }
.ev-prog .gbar { display: block; height: 0.75rem; }
.ev-prog .gbar .bg, .ev-prog .gbar .fill { display: block; top: 0.1875rem; bottom: 0.1875rem; }
.ev-prog .hint { font-size: 0.6875rem; }
.ev-amt { display: flex; flex-direction: column; align-items: flex-end; }
.ev-amt b { font-size: 0.9375rem; }
.ev-amt .hint { font-size: 0.6875rem; white-space: nowrap; }
.ev-cmp-cards { gap: 0.75rem; }
.ev-cc { border-top: 0.1875rem solid var(--c); }
.ev-cc .label { display: flex; align-items: center; font-weight: 650; color: var(--ink); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ev-cc .label .sw { flex: none; }
.ev-cc > .hint { font-size: 0.6875rem; }
.dash .ev-cc .value { font-size: 1.5rem; margin-top: 0.375rem; }
.ev-cc-avg { display: grid; grid-template-columns: 2.75rem minmax(0, 1fr) auto; align-items: center; gap: 0.5rem; margin-top: 0.75rem; font-size: 0.75rem; }
.ev-cc-avg .pt { height: 0.5rem; background: var(--surface-2); border-radius: 0.25rem; overflow: hidden; }
.ev-cc-avg .pt i { display: block; height: 100%; border-radius: 0.25rem; }
.ev-cc-f { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; margin-top: 0.5rem; font-size: 0.6875rem; color: var(--muted); }
.ev-cc-f b { color: var(--ink); font-weight: 650; }
.ev-cc-f b.neg { color: var(--down); }
.dash.anim .ev-cc-avg .pt i, .dash.anim .top-row .tb i { animation: dash-grow-w .9s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0ms); }
.ev-detail { padding: 0.75rem 1.125rem; }
.ev-detail summary { cursor: pointer; font-size: 0.8125rem; font-weight: 600; color: var(--ink-2); }
.ev-detail[open] summary { margin-bottom: 0.625rem; }
.dash .ev-detail { margin-top: 0.75rem; }
.dash #evcmp > .card, .dash #evcmp > .grid { margin-top: 0.75rem; }
.ev-strip { margin-bottom: 0.75rem; }
.ev-strip-h { display: flex; align-items: center; gap: 0.25rem; font-size: 0.75rem; font-weight: 600; margin-bottom: 0.3125rem; }
.ev-strip-h .hint { margin-left: auto; font-weight: 400; }
.ev-strip .strip { height: 1.25rem; }
.top-row { display: grid; grid-template-columns: 1.25rem minmax(0, 8.5rem) minmax(0, 1fr) 4rem; align-items: center; gap: 0.5rem; padding: 0.25rem; border-radius: 0.375rem; font-size: 0.8125rem; }
.top-row:hover { background: var(--surface-2); }
.top-row .rk { color: var(--muted); font-size: 0.75rem; text-align: right; }
.top-row .nm { display: flex; align-items: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.top-row .nm .sw { flex: none; }
.top-row .tb { height: 0.5rem; background: var(--surface-2); border-radius: 0.25rem; overflow: hidden; }
.top-row .tb i { display: block; height: 100%; border-radius: 0.25rem; opacity: .85; }
.top-row b { text-align: right; font-weight: 650; }
#toppick button { display: inline-flex; align-items: center; gap: 0.125rem; }
#toppick .sw { margin-right: 0.125rem; }

@media (max-width: 1000px) {
  .ev-live-grid { grid-template-columns: minmax(0, 1fr); }
  .dash .ev-cmp-cards { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .insight .movers { margin-left: 0; }
}
@media (max-width: 700px) {
  .dv-row { grid-template-columns: minmax(0, 6rem) minmax(0, 1fr) 5.25rem; }
  .dv-sh { display: none; }
  .drill-head .dh-ctl { margin-left: 0; width: 100%; justify-content: space-between; }
  .cr { grid-template-columns: 5.25rem minmax(0, 1fr) 4.5rem; gap: 0.5rem; }
  .pr { grid-template-columns: 2.75rem minmax(0, 1fr) 3.75rem; }
  .cal-head, .cal { gap: 0.1875rem; }
  .cal-c { min-height: 3.5rem; padding: 0.25rem 0.25rem 0.5rem; }
  .cal-c b { font-size: 0.6875rem; }
  .cal-c .mg { display: none; }
  .ev-row { grid-template-columns: 1rem minmax(0, 1fr) 5.5rem; grid-template-areas: "cb nm amt" "cb st prog"; gap: 0.25rem 0.625rem; }
  .ev-row input { grid-area: cb; } .ev-row .ev-st { grid-area: st; } .ev-row .ev-nm { grid-area: nm; } .ev-row .ev-prog { grid-area: prog; } .ev-row .ev-amt { grid-area: amt; }
  .dash .ev-cmp-cards { grid-template-columns: minmax(0, 1fr) !important; }
  .top-row { grid-template-columns: 1.25rem minmax(0, 6.5rem) minmax(0, 1fr) 3.5rem; }
  .ev-live-b .ring { width: 4.5rem; height: 4.5rem; }
  .ev-nums .value { font-size: 1.375rem; }
}
@media (prefers-reduced-motion: reduce) {
  .drill-box.anim, .drill-box.anim * { animation: none !important; }
}
.dash .grid.drill-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 900px) { .dash .grid.drill-cols { grid-template-columns: minmax(0, 1fr); } }
.mini-h .mini-sel { margin-left: auto; font-size: 0.75rem; padding: 0.125rem 0.375rem; max-width: 9rem; }

/* 설정 > 행사 관리: 목록 안에서 바로 고치는 줄 */
tr.ev-edit-row > td { background: color-mix(in srgb, var(--accent) 7%, transparent); padding: 0.625rem 0.5rem; white-space: normal; }
tr.ev-edit-row .err:empty { display: none; }
td.nowrap { white-space: nowrap; }

/* 트래픽 탭: 쇼핑몰별 표 (GMV 막대) */
.dash table.tr-tbl td.tot { position: relative; min-width: 8.5rem; }
.dash table.tr-tbl td.tot .tot-bar { position: absolute; left: 0.375rem; right: 0.375rem; bottom: 0.25rem; height: 0.25rem; }
.dash table.tr-tbl td.tot .tot-bar i { display: block; height: 100%; margin-left: auto; border-radius: 0.125rem; opacity: 0.85; }
.dash.anim table.tr-tbl td.tot .tot-bar i { transform-origin: right; animation: dash-grow-w 0.7s cubic-bezier(.2,.7,.2,1) both; animation-delay: var(--d, 0ms); }
.dash table.tr-tbl .nm { display: inline-flex; align-items: center; white-space: nowrap; }

/* ================================================================ 행사 리포트 (미리 보기 · PDF 인쇄)
   문서처럼 늘 밝은 종이 색(다크 모드에서도). PDF 는 이 화면을 A4 세로로 인쇄해서 만든다. */
/* 종이 폭 = A4 인쇄 폭(약 710px)과 같게 고정: 화면에서 본 그대로 PDF 가 나온다 (그래프 크기도 같음) */
.rp-wrap { max-width: 50rem; margin: 0 auto; }
.rp-actions { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.rp-actions .rp-act-r { margin-left: auto; display: flex; gap: 0.5rem; }
.report { --r-ink: #1f2328; --r-ink2: #4a4945; --r-muted: #6b6a64; --r-line: #e3e5e8; --r-soft: #f5f6f8;
  --up: #1a7f37; --down: #c62828;
  background: #fff; color: var(--r-ink); border-radius: 0.75rem; box-shadow: 0 0.0625rem 0.1875rem rgba(0,0,0,.08), 0 0.5rem 1.5rem rgba(0,0,0,.06);
  padding: 2.5rem 2.75rem; font-size: 0.8125rem; line-height: 1.5; max-width: 50rem; box-sizing: border-box; }
.report .muted { color: var(--r-muted); }
.report .up { color: var(--up); font-weight: 600; } .report .down { color: var(--down); font-weight: 600; }
.report .up, .report .down { white-space: nowrap; }
.rp-head { border-bottom: 0.125rem solid var(--r-ink); padding-bottom: 1rem; margin-bottom: 1.5rem; }
.rp-kicker { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; color: #2a78d6; }
.rp-head h1 { font-size: 1.875rem; margin: 0.25rem 0 0.375rem; line-height: 1.2; }
.rp-meta { color: var(--r-muted); font-size: 0.8125rem; }
.rp-legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin-top: 0.875rem; }
.rp-legend > span { display: inline-flex; flex-direction: column; }
.rp-legend small { color: var(--r-muted); font-size: 0.6875rem; padding-left: 1.125rem; }
.rp-legend.sm { margin-top: 0.5rem; gap: 0.25rem 1rem; }
.rp-legend.sm > span { flex-direction: row; }
.rp-chip { display: inline-flex; align-items: center; gap: 0.375rem; font-weight: 600; white-space: nowrap; }
.rp-chip i { width: 0.75rem; height: 0.75rem; border-radius: 0.1875rem; flex: none; }
.rp-note { margin-top: 0.75rem; padding: 0.5rem 0.75rem; border-radius: 0.375rem; background: #fff7e0; color: #7a5300; font-size: 0.75rem; }
.rp-sec { margin-bottom: 1.75rem; }
.rp-sec h2 { font-size: 1rem; margin: 0 0 0.75rem; padding-bottom: 0.375rem; border-bottom: 0.0625rem solid var(--r-line); display: flex; align-items: baseline; gap: 0.625rem; flex-wrap: wrap; }
.rp-sec h2 small { font-size: 0.6875rem; font-weight: 400; color: var(--r-muted); }
.rp-insights { margin: 0 0 1rem; padding-left: 1.125rem; }
.rp-insights li { margin: 0.25rem 0; }
.rp-insights li::marker { color: #2a78d6; }
.rp-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; }
.rp-kpi { border: 0.0625rem solid var(--r-line); border-radius: 0.625rem; padding: 0.875rem; background: var(--r-soft); }
.rp-kl { font-size: 0.75rem; color: var(--r-muted); font-weight: 600; }
.rp-kv { font-size: 1.5rem; font-weight: 750; margin: 0.125rem 0 0.375rem; font-variant-numeric: tabular-nums; }
.rp-kc { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; font-size: 0.6875rem; color: var(--r-ink2); padding: 0.125rem 0; border-top: 0.0625rem dashed var(--r-line); }
.rp-kc span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rp-target { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.375rem; font-size: 0.6875rem; color: var(--r-muted); }
.rp-ring { width: 3rem; height: 3rem; flex: none; }
.rp-bars { display: grid; gap: 0.5rem; }
.rp-bar { display: grid; grid-template-columns: 15rem minmax(0, 1fr) 5rem 5.5rem; align-items: center; gap: 0.75rem; }
.rp-bn { display: flex; flex-direction: column; min-width: 0; }
.rp-bn small { color: var(--r-muted); font-size: 0.6875rem; padding-left: 1.125rem; }
.rp-bt { height: 0.875rem; background: var(--r-soft); border-radius: 0.25rem; overflow: hidden; }
.rp-bt i { display: block; height: 100%; border-radius: 0.25rem; }
.rp-bar b { text-align: right; font-variant-numeric: tabular-nums; }
.rp-bc { text-align: right; font-size: 0.75rem; }
.rp-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem 1.25rem; }
.rp-chart h3 { font-size: 0.8125rem; margin: 0 0 0.25rem; }
.rp-cbox { height: 11rem; position: relative; }
.rp-tw { overflow-x: auto; }
.rp-tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 0.75rem; }
.rp-tbl th { font-weight: 600; color: var(--r-muted); text-align: left; padding: 0.375rem 0.5rem; border-bottom: 0.0625rem solid var(--r-ink); vertical-align: bottom; } /* 머리글은 두 줄 허용 → 표가 종이 폭에 들어감 */
.rp-tbl td { padding: 0.375rem 0.5rem; border-bottom: 0.0625rem solid var(--r-line); white-space: nowrap; }
.rp-tbl .n { text-align: right; }
.rp-tbl td.base { background: #eaf2fc; font-weight: 650; }
.rp-tbl tr.strong td { font-weight: 700; }
.rp-tbl td small { display: block; color: var(--r-muted); font-size: 0.625rem; }
.rp-days td, .rp-days th { padding: 0.3125rem 0.375rem; font-size: 0.6875rem; }
.rp-lobs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem 1.5rem; }
.rp-lob { break-inside: avoid; }
.rp-lh { display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.25rem; font-size: 0.75rem; }
.rp-lh b { font-size: 0.8125rem; margin-right: auto; }
.rp-lh span { color: var(--r-muted); font-size: 0.6875rem; }
.rp-lr { display: grid; grid-template-columns: minmax(0, 1fr) 4.5rem; gap: 0.5rem; align-items: center; font-size: 0.6875rem; }
.rp-lt { height: 0.5rem; background: var(--r-soft); border-radius: 0.125rem; overflow: hidden; }
.rp-lt i { display: block; height: 100%; }
.rp-lr .num { text-align: right; }
.rp-foot { margin-top: 2rem; padding-top: 0.75rem; border-top: 0.0625rem solid var(--r-line); color: var(--r-muted); font-size: 0.6875rem; }
@media screen and (max-width: 760px) {
  .report { padding: 1.25rem 1rem; }
  .rp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rp-charts, .rp-lobs { grid-template-columns: minmax(0, 1fr); }
  .rp-bar { grid-template-columns: minmax(0, 1fr) 4.5rem 4.5rem; }
  .rp-bar .rp-bt { grid-column: 1 / -1; grid-row: 2; }
}
@page { size: A4 portrait; margin: 12mm 11mm; }
@media print {
  html, body { background: #fff !important; }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  header.top, .rp-actions, .dash-tip { display: none !important; }
  main { padding: 0 !important; max-width: none !important; }
  .rp-wrap { max-width: none; }
  .report { box-shadow: none; border-radius: 0; padding: 0; max-width: none; }
  .rp-kpi, .rp-kpis, .rp-chart, .rp-bar, .rp-lob, .rp-tbl tr, .rp-insights { break-inside: avoid; }
  .rp-sec h2 { break-after: avoid; }
  .rp-tw { overflow: visible; }
  .rp-cbox canvas { width: 100% !important; height: 100% !important; } /* 화면에서 정한 픽셀 폭이 남아 넘치지 않게 */
  .rp-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .rp-charts, .rp-lobs { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
/* 앱(아이폰·아이패드·Mac)에서 PDF 를 만들 때: 웹이 html 에 rp-printing 을 붙여 인쇄 모양으로 바꾼 뒤 앱이 PDF 로 그린다 */
html.rp-printing, html.rp-printing body { background: #fff !important; }
html.rp-printing body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
html.rp-printing header.top, html.rp-printing .rp-actions, html.rp-printing .dash-tip { display: none !important; }
html.rp-printing main { padding: 0 !important; max-width: none !important; }
html.rp-printing .report { box-shadow: none; border-radius: 0; padding: 0; }
html.rp-printing .rp-kpi, html.rp-printing .rp-kpis, html.rp-printing .rp-chart, html.rp-printing .rp-bar, html.rp-printing .rp-lob, html.rp-printing .rp-tbl tr, html.rp-printing .rp-insights { break-inside: avoid; }
html.rp-printing .rp-sec h2 { break-after: avoid; }
html.rp-printing .rp-tw { overflow: visible; }
html.rp-printing .rp-cbox canvas { width: 100% !important; height: 100% !important; } /* 화면에서 정한 픽셀 폭이 남아 넘치지 않게 */
html.rp-printing .rp-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
html.rp-printing .rp-charts, html.rp-printing .rp-lobs { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }

/* 데이터 탭: 파일별 데이터 마지막 날짜 */
.latest-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.latest-grid .card { margin: 0; }
.card.latest .label { font-size: 0.75rem; color: var(--muted); font-weight: 600; }
.card.latest .value { font-size: 1.375rem; font-weight: 700; margin: 0.25rem 0 0.125rem; }
.card.latest .value small { font-size: 0.875rem; color: var(--ink-2); font-weight: 600; }
@media (max-width: 700px) { .latest-grid { grid-template-columns: minmax(0, 1fr); } }
/* 리포트 표가 종이 폭(약 710px)에 들어가도록: 머리글 색 이름은 줄바꿈 허용, 칸 여백을 줄임, 상품명은 두 줄 허용 */
.rp-tbl th .rp-chip { white-space: normal; align-items: flex-start; }
.rp-tbl th .rp-chip i { margin-top: 0.1875rem; }
.rp-tbl th, .rp-tbl td { padding-left: 0.375rem; padding-right: 0.375rem; }
.rp-tbl td:first-child { white-space: normal; min-width: 7rem; }

/* 비교 탭 하루 평균 비교 (2026-11-27) */
.dash .avg-card { margin-top: 0.75rem; }
.dash .avg-card .card-h { flex-wrap: wrap; gap: 0.5rem; }
.dash .avg-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-left: auto; }
.dash .avg-ctl .hint { color: var(--muted); font-size: 0.75rem; }
.dash .avg-pair .pr { grid-template-columns: 9rem minmax(0, 1fr) 6rem 4.5rem; font-size: 0.8125rem; }
.dash .avg-pair .pr .pt { height: 0.75rem; }
.dash .pr .pt i.m { background: repeating-linear-gradient(135deg, var(--ink-2) 0 3px, transparent 3px 6px); border: 0.0625rem solid var(--ink-2); }
.dash .avg-pair .pc { text-align: right; font-size: 0.75rem; }
.dash .avg-note, .dash .avg-off { margin: 0.625rem 0 0; font-size: 0.75rem; color: var(--muted); }
@media (max-width: 40rem) {
  .dash .avg-pair .pr { grid-template-columns: 6.5rem minmax(0, 1fr) 4.5rem 3.5rem; font-size: 0.6875rem; }
  .dash .avg-ctl { margin-left: 0; }
}
.dash.cmp-page .card-h { flex-wrap: wrap; gap: 0.5rem; }
.dash.cmp-page .card-h .seg button { white-space: nowrap; }

/* 요약 탭 '오늘 실시간' · 설정 탭 '쇼핑몰 실시간 연동' */
.dash .card.live { border-left: 0.1875rem solid var(--accent); }
.live-top { display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; align-items: flex-start; }
.live-top .label { color: var(--ink-2); font-size: 0.8125rem; }
.live-top .value { font-size: 1.75rem; font-weight: 700; }
.live-top .value small { font-size: 0.875rem; margin-left: 0.125rem; }
.live-top-items { flex: 1 1 16rem; min-width: 0; }
.live-it { display: flex; justify-content: space-between; gap: 0.75rem; font-size: 0.8125rem; padding: 0.125rem 0; }
.live-it span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.live-rows { margin-top: 0.75rem; border-top: 0.0625rem solid var(--grid); }
.live-row { display: grid; grid-template-columns: 1fr auto 3.5rem; gap: 0.5rem; align-items: center; padding: 0.375rem 0; border-bottom: 0.0625rem solid var(--grid); font-size: 0.875rem; }
.live-row .hint { text-align: right; }
.live-h { font-size: 0.875rem; margin: 1rem 0 0.375rem; }
.live-mall { border-top: 0.0625rem solid var(--grid); padding: 0.75rem 0; }
.live-mall .form-row input { min-width: 0; max-width: 100%; }
#livecfg .hint { font-size: 0.75rem; color: var(--muted); }
.live-lob { padding: 0.1875rem 0; }
.live-subs { display: flex; flex-wrap: wrap; gap: 0.125rem 0.75rem; font-size: 0.75rem; color: var(--ink-2); padding-left: 1rem; }
.lm-codes { font-size: 0.75rem; margin-top: 0.375rem; }
.lm-raw { margin-top: 0.5rem; }
.lm-raw summary { cursor: pointer; color: var(--accent); }
.lm-raw pre { max-height: 26rem; overflow: auto; background: var(--surface-2); border-radius: 0.5rem; padding: 0.625rem; font-size: 0.6875rem; white-space: pre-wrap; word-break: break-all; }
.live-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.live-kpis .label { color: var(--ink-2); font-size: 0.8125rem; }
.live-kpis .value { font-size: 1.625rem; font-weight: 700; }
.live-kpis .value small { font-size: 0.8125rem; margin-left: 0.125rem; font-weight: 500; }
.lv-tbl { width: 100%; font-size: 0.875rem; }
.lv-tbl td, .lv-tbl th { padding: 0.375rem 0.5rem; }
.lv-tbl th.n, .lv-tbl td.n { text-align: right; white-space: nowrap; }
.lv-tog { cursor: pointer; }
.lv-tog:hover td { background: var(--surface-2); }
.lv-caret { display: inline-block; width: 1rem; color: var(--muted); transition: transform .15s; }
.lv-tog.open > td:first-child .lv-caret { transform: rotate(90deg); }
.lv-sub td { font-size: 0.8125rem; color: var(--ink-2); }
.lv-sub td:first-child { padding-left: 2.25rem; }
.lv-detail > td { padding: 0.25rem 0 0.5rem 1rem; background: var(--surface-2); }
.lv-inner { width: 100%; font-size: 0.8125rem; }
.lv-inner th { font-weight: 500; color: var(--muted); }
@media (max-width: 30rem) { .live-kpis .value { font-size: 1.25rem; } .lv-tbl td, .lv-tbl th { padding: 0.375rem 0.25rem; } }
@media (max-width: 30rem) {
  .lv-tbl .badge { display: none; }
  .lv-tbl td:first-child { white-space: normal; word-break: keep-all; }
  .lv-detail > td { padding-left: 0.25rem; }
  .lv-sub td:first-child { padding-left: 1.25rem; }
}
/* 오늘 실시간 (2026-11-29 2차): 매출은 한 줄짜리 띠, LOB별·쇼핑몰별은 어떤 폭에서도 좌우 나란히 */
.live-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; margin-top: 0.75rem; }
.live-grid > .card { margin: 0; min-width: 0; }
.lv-day { margin-left: 0.25rem; }
.lv-day button { padding: 0.25rem 0.75rem; font-size: 0.75rem; }
.lv-time { color: var(--ink); font-weight: 700; }
.live-foot { margin: 0.5rem 0 0; }
.dash .card.lv-strip { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 2rem; padding: 0.75rem 1.125rem; border-left: 0.1875rem solid var(--accent); }
.lv-k { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.lv-k .label { color: var(--ink-2); font-size: 0.8125rem; }
.lv-k b { font-size: 1.5rem; font-weight: 700; }
.lv-k b small { font-size: 0.8125rem; margin-left: 0.125rem; font-weight: 500; }
.lv-fail { font-size: 0.75rem; flex-basis: 100%; }
@media (max-width: 40rem) {
  .live-grid { gap: 0.5rem; }
  .live-grid > .card { padding: 0.75rem 0.5rem; }
  .live-grid .mini-h .hint { display: none; }
  .live-grid .lv-tbl { font-size: 0.75rem; }
  .live-grid .lv-tbl td, .live-grid .lv-tbl th { padding: 0.3125rem 0.1875rem; }
  .live-grid .lv-caret { width: 0.625rem; }
  .live-grid .lv-sub td:first-child { padding-left: 0.875rem; }
  .live-grid .lv-detail > td { padding-left: 0; }
  .live-grid .sw { margin-right: 0.25rem; }
  .lv-k b { font-size: 1.25rem; }
}
/* 하루 요약 '비교': 지표 × (그날·전일·평시·같은 요일) 한 장 표 */
.dk-tbl { width: 100%; border-collapse: collapse; font-size: 0.8125rem; table-layout: fixed; }
.dk-tbl th { font-weight: 500; color: var(--muted); font-size: 0.75rem; text-align: right; padding: 0 0.25rem 0.375rem; }
.dk-tbl th:first-child { text-align: left; width: 3.25rem; }
.dk-tbl th.cur { color: var(--accent); }
.dk-tbl td { text-align: right; padding: 0.5rem 0.25rem; border-top: 0.0625rem solid var(--grid); vertical-align: top; }
.dk-tbl td:first-child { text-align: left; color: var(--ink-2); }
.dk-tbl td.cur { font-weight: 700; font-size: 1rem; background: color-mix(in srgb, var(--accent) 7%, transparent); border-radius: 0.375rem; }
.dk-tbl .dv { display: block; font-size: 0.6875rem; margin-top: 0.125rem; white-space: nowrap; }
.dk-tbl .sub { display: block; font-size: 0.6875rem; color: var(--muted); font-weight: 400; margin-top: 0.125rem; }
.dk-note { font-size: 0.6875rem; color: var(--muted); margin: 0.5rem 0 0; }

/* iPhone Duo 펼친 화면: 위 상태 띠(약 80pt)의 왼쪽이 비어 있어, 로고·단위·아바타 줄을 그 띠 안으로 올린다.
   시계·Wi-Fi 는 오른쪽 위 구석에만 있으므로 그 줄의 오른쪽만 비워 둔다 (Vigma 앱과 같은 방식). app.js 가 duo-band 를 붙인다 */
html.duo-band header.top { padding-top: max(0.375rem, calc(env(safe-area-inset-top, 0px) / 2 - 1.125rem)); }
html.duo-band header.top .userbox { margin-right: 8.75rem; }

/* 오늘 실시간 (2026-11-29 3차): 쇼핑몰별 위(한 줄 꽉), LOB별은 접어 두고 눌러서 펼침. 많이 팔린 항목 ▲ 강조 */
.live-stack { display: grid; gap: 0.75rem; margin-top: 0.75rem; }
.live-stack > .card { margin: 0; min-width: 0; }
.lv-lobhead { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 0.375rem; width: 100%; cursor: pointer; }
.lv-lobhead .hint { margin-left: auto; }
.lv-lobcard:not(.open) { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.lv-lobcard:not(.open) .lv-lobhead { margin: 0; }
.lv-lobcard.open > .lv-lobhead .lv-caret { transform: rotate(90deg); }
.lv-hot { display: inline-block; margin-left: 0.375rem; padding: 0 0.375rem; border-radius: 62rem; background: var(--up-bg); color: var(--up); font-size: 0.6875rem; font-weight: 700; white-space: nowrap; vertical-align: 0.0625rem; }
.lv-hot.sm { padding: 0 0.3125rem; }
.lv-tbl tr.hot > td { background: color-mix(in srgb, var(--good) 7%, transparent); }
/* 좁은 화면(휴대폰): 쇼핑몰별 위, LOB별은 접어 둠 / 넓은 화면(64rem 이상): 좌우 나란히, LOB별은 항상 펼침 */
.lv-wide-hint { display: none; }
.lv-lobcard:not(.open) .lv-lobbody { display: none; }
.lv-lobcard.open .lv-lobhead { margin-bottom: 0.5rem; }
@media (min-width: 64rem) {
  .live-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .live-stack .lv-lobcard .lv-lobbody { display: block; }
  .live-stack .lv-lobcard { padding-top: 1rem; padding-bottom: 1rem; }
  .live-stack .lv-lobhead { cursor: default; pointer-events: none; margin-bottom: 0.5rem; }
  .live-stack .lv-lobhead > .lv-caret, .live-stack .lv-fold-hint { display: none; }
  .live-stack .lv-wide-hint { display: inline; }
}

/* 오늘 실시간 LOB별 비중 (2026-12-02): 매출 기준·수량 기준 막대 + 표에 수량 비중·매출 비중 열 */
.lv-share { margin: 0.625rem 0 0.75rem; display: grid; gap: 0.375rem; }
.lv-sh-bar { display: grid; grid-template-columns: 3.75rem minmax(0, 1fr); align-items: center; gap: 0.5rem; }
.lv-sh-bar .strip { height: 1.125rem; }
.lv-lobcard:not(.open) .lv-share { margin-bottom: 0; }
@media (min-width: 64rem) { .live-stack .lv-lobcard .lv-share { margin-bottom: 0.75rem; } }
.lv-share-tbl td.lv-sh { color: var(--muted); font-size: 0.75rem; }
@media (max-width: 26rem) { .lv-share-tbl th, .lv-share-tbl td { padding-left: 0.25rem; padding-right: 0.25rem; } }

/* 비교 탭 쇼핑몰·LOB별: 평균 환산 막대·내보내기 (2026-11-30) */
.cr .cb i.m { height: 0.3125rem; background: repeating-linear-gradient(135deg, var(--ink-2) 0 2px, transparent 2px 4px); box-shadow: inset 0 0 0 0.0625rem var(--ink-2); }
.cr .cv .av { font-size: 0.625rem; font-weight: 600; }
.cr-list.with-avg .cr .cv { line-height: 1.2; }
.legend-sm .lg-fill.lg-avg { background: repeating-linear-gradient(135deg, var(--ink-2) 0 2px, transparent 2px 4px); box-shadow: inset 0 0 0 0.0625rem var(--ink-2); }
.cmp-tools { display: inline-flex; align-items: center; gap: 0.375rem; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.cmp-tools .btn.sm { padding: 0.1875rem 0.5rem; font-size: 0.75rem; }
.dash .card-h .cmp-pick { font-size: 0.75rem; padding: 0.1875rem 1.5rem 0.1875rem 0.5rem; max-width: 11rem; }

/* 툴바 오른쪽 끝 버튼 (행사 탭 [행사 관리], 네쇼라 탭 등) */
.toolbar .tb-end { margin-left: auto; }

/* ---------- 네쇼라 (NAVER 쇼핑 라이브, 2026-11-30) ---------- */
.btn.danger { color: var(--down); }
.note-card { font-size: 0.8125rem; color: var(--ink-2); border-left: 0.1875rem solid var(--down); }
.nsl-layout { display: grid; gap: 1rem; align-items: start; }
@media (min-width: 64rem) { .nsl-layout { grid-template-columns: minmax(19rem, 24rem) minmax(0, 1fr); } .nsl-list { position: sticky; top: 4.5rem; max-height: calc(100vh - 6rem); overflow: auto; } }
.nsl-layout > .card, .nsl-main > .card { margin-top: 0; }
.nsl-main { display: grid; gap: 1rem; min-width: 0; }
.nsl-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 0.5rem; padding: 0.5rem 0.375rem; border-radius: 0.5rem; }
.nsl-row + .nsl-row { border-top: 0.0625rem solid var(--border); }
.nsl-row.on { background: var(--surface-2); }
.nsl-row-main { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; color: inherit; text-decoration: none; }
.nsl-row-t { display: flex; align-items: center; gap: 0.375rem; min-width: 0; }
.nsl-row-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.875rem; }
.nsl-row-main .hint { font-size: 0.75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nsl-row-v { display: flex; flex-direction: column; align-items: flex-end; font-size: 0.8125rem; font-weight: 650; white-space: nowrap; }
.nsl-st { flex: none; font-size: 0.6875rem; font-weight: 700; padding: 0.0625rem 0.4375rem; border-radius: 62rem; background: var(--surface-2); color: var(--ink-2); }
.nsl-st.live { background: #03C75A; color: #fff; }
.nsl-st.plan { background: transparent; box-shadow: inset 0 0 0 0.0625rem var(--border); }
.nsl-thumb { flex: none; display: block; object-fit: cover; border-radius: 0.375rem; background: var(--surface-2); }
.nsl-thumb.sm { width: 2.5rem; height: 2.5rem; }
.nsl-thumb.lg { width: 7.5rem; height: 7.5rem; border-radius: 0.625rem; }
.nsl-thumb.none { display: grid; place-items: center; font-size: 0.625rem; font-weight: 800; color: #03C75A; letter-spacing: 0.04em; }
.nsl-cmpbar { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.5rem; padding: 0.5rem 0.625rem; border-radius: 0.5rem; background: var(--surface-2); font-size: 0.8125rem; }
.nsl-cmpbar[hidden] { display: none; }
.nsl-hero { display: flex; gap: 1rem; align-items: flex-start; }
.nsl-hero-t { min-width: 0; flex: 1; }
.nsl-hero-top { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.8125rem; }
.nsl-hero h2 { margin: 0.25rem 0 0.5rem; font-size: 1.125rem; word-break: keep-all; }
.nsl-dl { display: grid; grid-template-columns: auto 1fr; gap: 0.125rem 0.75rem; margin: 0 0 0.625rem; font-size: 0.8125rem; }
.nsl-dl dt { color: var(--muted); }
.nsl-dl dd { margin: 0; }
.nsl-links { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.nsl-memo { margin-top: 0.75rem; padding: 0.625rem 0.75rem; border-radius: 0.5rem; background: var(--surface-2); font-size: 0.8125rem; white-space: pre-wrap; }
.nsl-shots { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.nsl-shot { position: relative; display: block; width: 6rem; height: 6rem; border-radius: 0.5rem; overflow: hidden; border: 0.0625rem solid var(--border); background: var(--surface-2); }
.nsl-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nsl-shot.add { display: grid; place-items: center; cursor: pointer; font-size: 0.75rem; color: var(--ink-2); border-style: dashed; }
.nsl-shot-x { position: absolute; top: 0.125rem; right: 0.125rem; width: 1.375rem; height: 1.375rem; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; line-height: 1; }
.nsl-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.nsl-when { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; font-size: 0.8125rem; margin-bottom: 0.625rem; }
.nsl-note { font-weight: 700; color: var(--accent); }
.nsl-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.5rem; margin-bottom: 0.875rem; }
.nsl-k { display: flex; flex-direction: column; gap: 0.125rem; padding: 0.625rem 0.75rem; border-radius: 0.625rem; background: var(--surface-2); min-width: 0; }
.nsl-k .label { font-size: 0.75rem; color: var(--muted); }
.nsl-k b { font-size: 1.125rem; overflow-wrap: anywhere; line-height: 1.25; }
.nsl-k.main b { font-size: 1.25rem; }
.nsl-k.down b { color: var(--down); }
.nsl-k .hint { font-size: 0.75rem; }
.nsl-chart { position: relative; height: 11rem; margin-bottom: 0.25rem; }
.nsl-tables { display: grid; gap: 1rem; margin-top: 0.75rem; }
@media (min-width: 80rem) { .nsl-tables { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); } }
.nsl-tables > div { min-width: 0; }
.nsl-tables .table-wrap { overflow-x: auto; }
.nsl-tables .lv-tbl { table-layout: auto; }
.nsl-tables .lv-tbl td:first-child { white-space: normal; word-break: keep-all; overflow-wrap: anywhere; }
.nsl-tables h4, .nsl-cmp h4 { margin: 0 0 0.375rem; font-size: 0.875rem; }
.nsl-bp { display: inline-block; margin-right: 0.25rem; padding: 0 0.3125rem; border-radius: 0.25rem; font-size: 0.625rem; font-weight: 700; color: #fff; background: #03C75A; vertical-align: 0.0625rem; }
.nsl-sum { font-size: 0.875rem; margin: 0 0 0.5rem; }
.nsl-cmp .cr { grid-template-columns: minmax(8rem, 14rem) minmax(0, 1fr) 9rem; }
.nsl-cmp .cr .nm { flex-direction: column; align-items: flex-start; white-space: normal; }
.nsl-cmp .cr .nm a { color: inherit; font-weight: 600; }
.nsl-cmp .cr .cb i.a { height: 0.75rem; }
.nsl-form label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.8125rem; color: var(--ink-2); margin-bottom: 0.625rem; }
.nsl-form input[type=url], .nsl-form input[type=text], .nsl-form textarea { width: 100%; min-width: 0; }
.nsl-form .form-row input[type=url] { flex: 1; }
.nsl-f-grid { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.nsl-f-grid .wide { grid-column: 1 / -1; }
.nsl-info { display: flex; gap: 0.75rem; align-items: center; padding: 0.5rem; margin-bottom: 0.75rem; border-radius: 0.5rem; background: var(--surface-2); font-size: 0.8125rem; }
.nsl-info img { width: 4rem; height: 4rem; object-fit: cover; border-radius: 0.375rem; }
.nsl-info > div { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
/* 방송 목표 매출 (2026-12-02) */
.nsl-goal { margin: 0 0 0.75rem; padding: 0.5rem 0.625rem; border-radius: 0.5rem; background: var(--surface-2); font-size: 0.8125rem; }
.nsl-goal-t { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem; margin-bottom: 0.375rem; }
.nsl-goal-bar { height: 0.5rem; border-radius: 0.25rem; background: color-mix(in srgb, var(--ink-2) 15%, transparent); overflow: hidden; }
.nsl-goal-bar i { display: block; height: 100%; border-radius: 0.25rem; background: var(--accent); }
.nsl-goal .pos, .nsl-cmp b.pos { color: var(--up); }
/* 방송 비교 공유 (2026-12-02) */
.nsl-cmp .btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.nsl-share { margin: 0 0 0.875rem; padding: 0.75rem; border-radius: 0.5rem; background: var(--surface-2); font-size: 0.8125rem; }
.nsl-share[hidden] { display: none; }
.nsl-share p { margin: 0.375rem 0 0; }
.nsl-share h4 { margin: 0.875rem 0 0.375rem; }
.nsl-sh-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem 0.875rem; }
.nsl-sh-form label { display: flex; flex-direction: column; gap: 0.25rem; color: var(--ink-2); }
.nsl-sh-form label.chk { flex-direction: row; align-items: center; gap: 0.375rem; padding-bottom: 0.375rem; }
.nsl-sh-form #sh-code { width: 6.5rem; }
.nsl-sh-form #sh-code:not(:placeholder-shown) { letter-spacing: 0.25em; }
.nsl-sh-form #sh-date { margin-top: 0.25rem; }
.sh-made { margin-top: 0.625rem; }
.sh-made .form-row input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.sh-rows { display: grid; gap: 0.375rem; }
.sh-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.125rem 0.5rem; align-items: center; padding: 0.375rem 0.5rem; border-radius: 0.375rem; background: var(--surface); }
.sh-row .sh-url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.75rem; }
.sh-row .hint { grid-column: 1; }
.sh-row .sh-act { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 0.25rem; }
.share-page .nsl-page.share { max-width: 75rem; margin: 0 auto; }
.share-page .share-note { color: var(--bar-ink); font-size: 0.75rem; }
.share-page header.top .brand-t { display: inline; }
/* 방송 비교 (2026-12-02 개편): 비교 탭처럼 KPI 카드 + LOB 막대 목록. 방송마다 고정 색 */
.nb-dot { display: inline-block; flex: none; width: 0.625rem; height: 0.625rem; border-radius: 50%; margin-right: 0.375rem; background: var(--muted); vertical-align: 0.0625rem; }
.nb-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: 0.5rem; }
.nb-item { display: flex; align-items: flex-start; gap: 0.125rem; padding: 0.5rem 0.625rem; border-radius: 0.5rem; background: var(--surface-2); min-width: 0; }
.nb-item .nb-dot { margin-top: 0.3125rem; }
.nb-item.lead { box-shadow: inset 0 0 0 0.0625rem var(--accent); }
.nb-t { display: flex; flex-direction: column; gap: 0.0625rem; min-width: 0; font-size: 0.8125rem; }
.nb-t a { color: inherit; }
.nb-t b { overflow-wrap: anywhere; }
.nb-t small { font-size: 0.6875rem; }
.nsl-page .insight { margin: 0.75rem 0; }
.nsl-kpis { margin-bottom: 0.75rem; }
.nsl-vs { display: flex; flex-direction: column; gap: 0.0625rem; max-width: 100%; padding: 0.25rem 0.5rem; border-radius: 0.5rem; background: var(--surface-2); font-size: 0.75rem; color: var(--ink-2); min-width: 0; }
.nsl-vs .vn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nsl-vs.up { background: var(--up-bg); } .nsl-vs.up b { color: var(--up); }
.nsl-vs.down { background: var(--down-bg, color-mix(in srgb, var(--down) 12%, transparent)); } .nsl-vs.down b { color: var(--down); }
.nsl-kpis .kpi { min-width: 0; }
.nsl-kpis .pr { grid-template-columns: minmax(0, 6.5rem) minmax(0, 1fr) auto; }
.nsl-kpis .pr .pl { display: flex; align-items: center; }
.nsl-kpis .pr.lead .pl { color: var(--ink); font-weight: 600; }
.nsl-kpis .pr .pv { text-align: right; white-space: nowrap; }
.nsl-lobcard { margin-top: 0; }
.nb-rows { display: grid; gap: 0.375rem; }
.nb-row { padding: 0.5rem 0.625rem; border-radius: 0.5rem; background: var(--surface-2); }
.nb-h { display: flex; align-items: center; gap: 0.375rem; width: 100%; padding: 0 0 0.375rem; border: 0; background: none; color: inherit; font: inherit; font-size: 0.875rem; text-align: left; cursor: pointer; }
.nb-h .hint { margin-left: auto; font-size: 0.6875rem; }
.nb-row.open .lv-caret { transform: rotate(90deg); }
.nb-row.total .nb-h { cursor: default; }
.nb-ls { display: grid; gap: 0.1875rem; }
.nb-l { display: grid; grid-template-columns: minmax(0, 1fr) 4.5rem 3rem; align-items: center; gap: 0.5rem; font-size: 0.75rem; }
.nb-l > .num:not(.hint) { text-align: right; white-space: nowrap; }
.nb-l .hint { text-align: right; font-size: 0.6875rem; white-space: nowrap; }
.nb-l.lead > .num:not(.hint) { font-weight: 700; }
.nb-bar { height: 0.5rem; border-radius: 0.25rem; background: color-mix(in srgb, var(--ink-2) 10%, transparent); overflow: hidden; }
.nb-bar i { display: block; height: 100%; border-radius: 0.25rem; }
.nb-subs[hidden] { display: none; }
.nb-sub { margin-top: 0.5rem; padding: 0.375rem 0 0 0.75rem; border-top: 0.0625rem solid var(--border); }
.nb-st { font-size: 0.75rem; font-weight: 600; color: var(--ink-2); margin-bottom: 0.1875rem; }
.nsl-lobcard .legend-sm { flex-wrap: wrap; gap: 0.375rem 0.875rem; }
@media (max-width: 40rem) {
  .nsl-cmp .card-h { flex-wrap: wrap; gap: 0.375rem; }
  .nsl-opts .seg button { padding-left: 0.5rem; padding-right: 0.5rem; }
  .nsl-kpis .pr { grid-template-columns: minmax(0, 1fr) auto; }
  .nsl-kpis .pr .pt { grid-column: 1 / -1; grid-row: 2; }
  .nsl-kpis .kpi .value { font-size: 1.375rem; }
  .nb-h .hint { display: none; }
}
  /* 공유 화면은 탭이 없어 좁은 화면에서도 제목을 보인다 */
.sh-gate { max-width: 22rem; margin: 2rem auto; }
.sh-gate input { width: 7rem; letter-spacing: 0.3em; text-align: center; }
@media (max-width: 40rem) {
  .nsl-thumb.lg { width: 4.5rem; height: 4.5rem; }
  .nsl-cmp .cr { grid-template-columns: minmax(0, 1fr) 7.5rem; }
  .nsl-cmp .cr .cb { grid-column: 1 / -1; grid-row: 2; }
  .nsl-shot { width: 4.5rem; height: 4.5rem; }
}
@media (max-width: 63.99rem) { .nsl-layout.focus .nsl-main { order: -1; } } /* 휴대폰: 방송을 고르면 내용이 목록 위로 */
.nsl-row.on .nsl-thumb.none { background: var(--surface); }
/* 네쇼라: 눌린 쪽이 확실히 보이게 (2026-11-30 사용자 요청) */
.nsl-page .seg button.on { background: var(--accent); color: #fff; font-weight: 700; }
/* 네쇼라 방송 비교: 오늘 방송 강조, LOB·SUB LOB 표 (2026-11-30) */
.nsl-basis { margin: -0.25rem 0 0.5rem; font-size: 0.75rem; }
.nsl-cmp .is-today { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.nsl-cmp .cr.is-today { box-shadow: inset 0.1875rem 0 0 var(--accent); }
.nsl-cmp tr.is-today > td:first-child { box-shadow: inset 0.1875rem 0 0 var(--accent); }
.nsl-cmp .nsl-ov td:first-child a { color: inherit; }
.nsl-cmp .nsl-ov td:first-child, .nsl-cmp .nsl-mx td:first-child { white-space: normal; word-break: keep-all; }
.nsl-mx-h { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 1rem; }
.nsl-mx-h h4 { margin: 0; }
.nsl-mx td.nc { position: relative; min-width: 7.5rem; vertical-align: top; }
.nsl-mx .nc-v { display: block; }
.nsl-mx .nc-q { display: block; font-size: 0.6875rem; }
.nsl-mx .nc-bar { display: block; height: 0.25rem; margin: 0.1875rem 0 0 auto; border-radius: 0.125rem; background: var(--s1); opacity: .55; }
.nsl-mx td.nc.is-today .nc-bar { background: var(--accent); opacity: 1; }
.nsl-mx .lv-tog td { background: var(--surface-2); }
.nsl-mx .lv-tog td.is-today { background: color-mix(in srgb, var(--accent) 16%, var(--surface-2)); }
.nsl-cmp .nsl-ov td:first-child { min-width: 9rem; }
.nsl-cmp .nsl-mx td:first-child { min-width: 8rem; }

/* ------------------------------------------------------------------ 계정 관리: 접속 현황·통계 */
.acc-page { display: grid; gap: 1rem; }
.acc-page .card.card { margin: 0; min-width: 0; }
.acc-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; }
.acc-kpi { margin: 0; padding: 0.875rem 1rem; }
.acc-kpi .k { font-size: 0.8125rem; color: var(--muted); }
.acc-kpi .v { font-size: 1.75rem; font-weight: 750; line-height: 1.2; margin: 0.125rem 0; }
.acc-kpi .v small { font-size: 0.875rem; font-weight: 600; color: var(--muted); margin-left: 0.125rem; }
.acc-kpi .s { font-size: 0.75rem; color: var(--muted); }
.acc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.acc-chart { position: relative; height: 13rem; }
.acc-chart.sm { height: 10rem; }
.acc-tbl td { vertical-align: top; }
.acc-tbl .hint { font-size: 0.75rem; }
.acc-u { white-space: nowrap; }
.acc-dot { display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--border); margin-right: 0.375rem; vertical-align: 0.0625rem; }
.acc-dot.on { background: var(--up); box-shadow: 0 0 0 0.1875rem var(--up-bg); }
.acc-top { white-space: normal !important; min-width: 10rem; }
.acc-top .badge { display: inline-block; margin: 0 0.125rem 0.25rem 0; }
.acc-feats { display: grid; gap: 0.5rem; }
.acc-f { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) auto; align-items: center; gap: 0.625rem; font-size: 0.8125rem; }
.acc-f .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-f .bar { height: 0.5rem; background: var(--surface-2); border-radius: 0.25rem; overflow: hidden; }
.acc-f .bar i { display: block; height: 100%; background: var(--accent); border-radius: 0.25rem; }
.acc-f .v { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.acc-logins { max-height: 22rem; overflow: auto; }
@media (max-width: 56rem) {
  .acc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acc-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 30rem) {
  .acc-kpi .v { font-size: 1.375rem; }
  .acc-f { grid-template-columns: 5rem minmax(0, 1fr) auto; }
}

/* 매출 구성: 카드가 좁으면 이익률 → 기준이 아닌 값(매출/수량) 순서로 숨긴다 */
.comp-row .alt { color: var(--ink-2); }
@container (max-width: 27rem) {
  .comp-row { grid-template-columns: 0.875rem minmax(0, 1fr) 4rem 3.25rem 3rem; gap: 0.375rem; }
  .comp-row .q { display: none; }
}
@container (max-width: 18rem) {
  .comp-row { grid-template-columns: 0.875rem minmax(0, 1fr) 4rem 3.25rem; }
  .comp-row .alt { display: none; }
}
/* 행사 쇼핑몰 데이터 (2026-12-02): 확정 매출 / 쇼핑몰 데이터 전환, 행사 줄의 데이터 표시·[매출 업로드], 업로드 창 */
.ev-tb { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }
.ev-tb .seg button.on { background: var(--accent); color: #fff; font-weight: 700; }
.ev-mallrow { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem 0.5rem; margin-top: 0.25rem; }
.ev-md { font-size: 0.6875rem; padding: 0.0625rem 0.4375rem; border-radius: 62rem; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--ink-2); white-space: nowrap; }
.ev-md.none { background: var(--surface-2); color: var(--muted); }
.ev-up.btn.sm { padding: 0.0625rem 0.5rem; font-size: 0.6875rem; min-height: 0; }
.ev-modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: max(1rem, env(safe-area-inset-top)) 1rem 1rem; background: rgba(0, 0, 0, 0.4); overflow-y: auto; }
.ev-modal-in { width: min(46rem, 100%); margin: 2rem 0; }
.ev-md-t { margin: 0 0 0.375rem; display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem 0.5rem; }
.ev-md-help { font-size: 0.75rem; margin: 0 0 0.75rem; line-height: 1.5; }
.ev-md-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.625rem 0.75rem; padding: 0.75rem; border-radius: 0.5rem; background: var(--surface-2); margin-bottom: 0.75rem; }
.ev-md-form label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.8125rem; min-width: 0; }
.ev-md-file { flex: 1 1 16rem; }
.ev-md-file input { max-width: 100%; }
.ev-md-pw input { width: 9rem; }
.ev-md-res p { margin: 0 0 0.5rem; font-size: 0.8125rem; }
.ev-md-res .ok, .ev-modal p.ok { color: var(--up); }
.ev-modal h4 { margin: 0.75rem 0 0.375rem; font-size: 0.875rem; }
/* 네쇼라 방송 비교 · 시간대별 (2026-12-02) */
.dash .nsl-hrcard .card-h { flex-wrap: wrap; gap: 0.5rem; }
.nsl-hrctl { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.25rem 0 0.375rem; }
.nsl-hrbox { position: relative; height: 16rem; }
.nsl-peaks { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin-top: 0.625rem; font-size: 0.8125rem; }
.nsl-peaks > span { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 40rem) { .nsl-hrbox { height: 13rem; } }
/* 네쇼라 [공유 링크] 관리 창 (2026-12-02) */
.nsl-tb { display: inline-flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }
.nsl-shn { display: inline-block; min-width: 1.25rem; padding: 0 0.3rem; margin-left: 0.25rem; border-radius: 0.625rem; background: var(--accent); color: #fff; font-size: 0.6875rem; line-height: 1.25rem; text-align: center; }
.shm-list { display: flex; flex-direction: column; gap: 0.5rem; }
.shm-row { border: 1px solid var(--border); border-radius: 0.5rem; padding: 0.625rem 0.75rem; display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.shm-row.expired { opacity: 0.75; }
.shm-t { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.5rem; font-size: 0.875rem; }
.shm-b { min-width: 0; overflow-wrap: anywhere; }
.shm-vs { color: var(--muted); font-size: 0.75rem; }
.shm-meta { font-size: 0.75rem; line-height: 1.5; }
.shm-link { display: flex; flex-direction: column; gap: 0.125rem; font-size: 0.8125rem; min-width: 0; }
.shm-link a { overflow-wrap: anywhere; }
.shm-link .hint { font-size: 0.6875rem; overflow-wrap: anywhere; }
.shm-act { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; }
.shm-until { display: inline-flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }
.shm-until input { font-size: 0.8125rem; padding: 0.125rem 0.25rem; }
.ev-md-tbl td:first-child { white-space: nowrap; }
.ev-md-log { margin: 0; padding-left: 1rem; font-size: 0.75rem; color: var(--ink-2); }
.ev-md-del { margin-top: 0.75rem; text-align: right; }
@media (max-width: 40rem) {
  .ev-modal { padding: env(safe-area-inset-top) 0.5rem 0.5rem; }
  .ev-modal-in { margin: 0.5rem 0; }
  .ev-md-form .btn { width: 100%; }
  .toolbar .ev-tb { margin-left: 0; justify-content: flex-start; }
}

/* 비교 탭 [내보내기] (2026-12-02) */
.cmp-rep-btn { margin-left: auto; }
.dash .card-h > .seg { flex: none; }
.dash .card-h > .seg button { white-space: nowrap; }

/* 데이터 탭: 구글 시트 가져오기 */
.gs-row { margin-top: 0.5rem; flex-wrap: wrap; }
.gs-url { flex: 1 1 18rem; min-width: 0; max-width: 100%; }
.gs-times { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; }
.gs-t { cursor: default; font-variant-numeric: tabular-nums; }
.gs-del { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 0 0 0.125rem; font-size: 0.875rem; line-height: 1; }
.gs-del:hover { color: var(--down); }

/* ================================================================ 상단 메뉴 설정 (2026-12-03) */
.mn-list { display: grid; gap: 0.375rem; margin-top: 0.75rem; }
.mn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.375rem 0.5rem; border: 0.0625rem solid var(--border); border-radius: 0.5rem; }
.mn-row.off .mn-nm { color: var(--muted); text-decoration: line-through; }
.mn-mv { display: inline-flex; gap: 0.25rem; }
.mn-nm { min-width: 5rem; margin-right: auto; }
.mn-users { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 0.375rem; align-items: center; padding: 0.375rem 0 0.125rem; }

/* ================================================================ 관심모델 추적 (2026-12-03) */
.wt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: 0.75rem; }
.dash a.wt-card { display: grid; gap: 0.5rem; color: inherit; text-decoration: none; }
.dash a.wt-card:hover { border-color: var(--axis); }
.wt-head { display: flex; align-items: center; gap: 0.5rem; }
.wt-head b { font-size: 0.9375rem; margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wt-tags { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.wt-tags .pill { white-space: normal; }
.wt-kpi { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.5rem; }
.wt-kpi > div { display: grid; gap: 0.125rem; font-size: 0.75rem; }
.wt-kpi b { font-size: 1.25rem; font-weight: 700; }
.wt-form { display: grid; gap: 0.75rem; margin-top: 0.75rem; }
.wt-form label, .wt-form .wf-l { display: grid; gap: 0.25rem; font-size: 0.8125rem; color: var(--ink-2); }
.wt-form textarea { width: 100%; box-sizing: border-box; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8125rem; }
.wt-form input[type=text] { width: 100%; box-sizing: border-box; }
.wt-form .picker { margin-top: 0.25rem; }
.wt-form .picker[hidden] { display: none; }
.wt-form label.chip-ck, .wt-form .picker label { display: inline-flex; align-items: center; gap: 0.25rem; color: var(--ink); }
.wt-form .form-row label.btn { display: inline-flex; color: inherit; }
.wf-dates label { flex: 1 1 10rem; }
.wt-tbl td:first-child { min-width: 12rem; }
.wt-nm, .bt-nm { white-space: normal; font-size: 0.6875rem; max-width: 24rem; }
.wb-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 8.5rem), 1fr)); gap: 0.5rem; align-items: end; }
.wb-form label { display: grid; gap: 0.25rem; font-size: 0.75rem; color: var(--ink-2); min-width: 0; }
.wb-form input, .wb-form select { width: 100%; box-sizing: border-box; min-width: 0; }
.wb-form .wb-memo { grid-column: span 2; }
.wb-form .wb-act { grid-column: 1 / -1; }
.wb-tbl td.wb-m { white-space: normal; min-width: 8rem; font-size: 0.75rem; color: var(--ink-2); }
.wb-tbl .nowrap { white-space: nowrap; }
.link.danger { color: var(--down); }

/* ================================================================ BTS (2026-12-03) */
.bts-tbl tr.bt-sub td { background: var(--page); cursor: pointer; user-select: none; }
.bts-tbl tr.bt-sub .chev { display: inline-block; width: 1rem; color: var(--muted); transition: transform .15s; }
.bts-tbl tr.bt-sub.folded .chev { transform: rotate(-90deg); }
.bts-tbl tr.bt-sub .sw { margin-right: 0.375rem; }
.bts-tbl td:first-child { min-width: 12rem; }
.bt-code { font-weight: 600; padding-left: 1.375rem; }
.bts-tbl .bt-nm { padding-left: 1.375rem; }
@media (max-width: 40rem) {
  .wb-form .wb-memo { grid-column: 1 / -1; }
  .wt-kpi b { font-size: 1.0625rem; }
}
.pill.wrap { white-space: normal; }
/* 관심모델 목록: 그리드 안 카드끼리 '카드 + 카드' 위 여백이 붙어 높이가 달라 보이던 것 (2026-12-03) */
.wt-grid > .card { margin-top: 0; }
.lob-tools .lt-gap { flex: 1; }
