/* 운영자 통계: 휴대폰·태블릿 공통. 권한은 기존 서버 세션으로 확인한다. */
.adm-overlay, .adm-shell, .adm-body { min-width: 0; max-width: 100%; }
.adm-body > *, .adm-card, .adm-grid-2 > *, .adm-grid-3 > * { min-width: 0; }
.adm-body { overscroll-behavior: contain; }
.adm-table-wrap, .ec-heatmap { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.adm-tabs .adm-tab { flex-shrink: 0; }
.adm-close { padding: 0; }
.adm-close svg { flex: 0 0 19px; width: 19px; height: 19px; }
.adm-overlay :is(button, input, select):focus-visible { outline: 3px solid #3b6fe0; outline-offset: 2px; }

@media ((max-width: 900px) and (not ((hover: hover) and (pointer: fine)))), (pointer: coarse) {
  html.is-admin #adminOpen { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 10px 16px; font-size: 14px; }
  html.is-admin #adminOpen::before { content: ''; width: 16px; height: 16px; background: linear-gradient(to top,#fff 0 100%) 0 100% / 3px 7px no-repeat,linear-gradient(to top,#fff 0 100%) 6px 100% / 3px 12px no-repeat,linear-gradient(to top,#fff 0 100%) 12px 100% / 3px 16px no-repeat; }
  .adm-overlay { height: 100dvh; padding-top: env(safe-area-inset-top, 0px); }
  .adm-bar { position: relative; padding: 12px 16px; gap: 10px; }
  .adm-bar-l { flex: 1 1 100%; width: 100%; min-height: 44px; padding-right: 112px; gap: 10px; }
  .adm-bar-t { min-width: 0; }
  .adm-bar-t h1 { font-size: 20px; }
  .adm-bar-t p { overflow-wrap: anywhere; line-height: 1.5; }
  .adm-bar-r { width: 100%; display: flex; gap: 8px; }
  .adm-members-total { position: absolute; top: 12px; right: 16px; min-width: 96px; padding-left: 10px; }
  .adm-members-total strong { font-size: 25px; }
  .adm-presets { flex: 1 1 auto; }
  .adm-preset, .adm-btn, .adm-tab, .adm-close { min-height: 44px; touch-action: manipulation; }
  .adm-close { width: 44px; }
  .adm-tabs { padding: 0 10px; scrollbar-width: thin; }
  .adm-prev { display: none; }
  .adm-body { padding: 14px 16px calc(24px + env(safe-area-inset-bottom, 0px)); overflow-x: hidden; }
  .adm-kpis { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
  .adm-grid-2, .adm-grid-3, .adm-overview-charts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .adm-overview-charts > :first-child { grid-column: 1 / -1; }
  .adm-grid-3 > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .adm-audience-demographics .ec-donut-wrap { flex-wrap: wrap; }
  .adm-traffic-tools select, .adm-dates input, .adm-dates select { min-height: 44px; font-size: 16px; }
  .adm-table { width: max-content; min-width: 100%; }
  .adm-table th, .adm-table td { font-size: 13px; padding-top: 12px; padding-bottom: 12px; }
  .adm-table-wrap { margin: 0; padding: 0; }
  .adm-member-detail { max-height: calc(100dvh - 20px); }
  .adm-traffic-daily { max-height: 300px; }
}

@media ((max-width: 640px) and (not ((hover: hover) and (pointer: fine)))) {
  html.is-admin .topbar #adminOpen { flex: 1 0 100%; grid-column: 1 / -1; justify-self: stretch; order: 20; width: 100%; border-radius: 12px; background: #173e81; box-shadow: 0 3px 9px #173e8120; }
  .adm-bar { padding: 10px 12px; gap: 8px; }
  .adm-bar-l { padding-right: 92px; gap: 8px; }
  .adm-bar-t h1 { font-size: 18px; }
  .adm-bar-t p { font-size: 12px; }
  .adm-members-total { right: 12px; top: 12px; min-width: 80px; }
  .adm-members-total strong { font-size: 23px; }
  .adm-bar-r { display: grid; grid-template-columns: minmax(0,1fr); gap: 6px; }
  .adm-presets { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); width: 100%; padding: 2px; gap: 1px; }
  .adm-preset { padding: 5px 2px; font-size: 12px; white-space: nowrap; }
  .adm-bar-r > .adm-btn { justify-self: end; min-height: 36px; padding: 6px 10px; font-size: 12px; }
  .adm-shell > .adm-dates { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; padding: 10px 12px; max-height: 38dvh; overflow-y: auto; }
  .adm-shell > .adm-dates[hidden] { display: none; }
  .adm-dates label { display: flex; flex-direction: column; align-items: stretch; gap: 4px; font-size: 12px; min-width: 0; }
  .adm-dates label:first-child, .adm-date-hint, .adm-date-error { grid-column: 1 / -1; }
  .adm-dates > span:not([class]) { display: none; }
  .adm-dates input, .adm-dates select { width: 100%; min-width: 0; }
  .adm-body { padding: 12px 10px calc(24px + env(safe-area-inset-bottom, 0px)); }
  .adm-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .adm-kpi { min-height: 112px; padding: 13px 12px 0; }
  .adm-kpi-v { font-size: 23px; overflow-wrap: anywhere; }
  .adm-kpi-lb, .adm-stat-lb { font-size: 13px; }
  .adm-grid-2, .adm-grid-3, .adm-overview-charts { grid-template-columns: minmax(0,1fr); }
  .adm-grid-3 > :last-child:nth-child(odd), .adm-overview-charts > :first-child { grid-column: auto; }
  .adm-card { padding: 14px 12px; }
  .adm-card-h { gap: 6px; flex-wrap: wrap; }
  .adm-card-h h3 { font-size: 15px; }
  .adm-traffic-glance { gap: 10px; padding: 12px; }
  .adm-traffic-tools { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .adm-traffic-tools label { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
  .adm-traffic-tools label:first-child { grid-column: 1 / -1; }
  .adm-traffic-tools select { width: 100%; min-width: 0; }
  .adm-audience-demographics .ec-donut-wrap { flex-wrap: nowrap; gap: 12px; }
  .adm-audience-demographics .ec-donut { width: clamp(76px,22vw,96px); height: clamp(76px,22vw,96px); flex: 0 0 clamp(76px,22vw,96px); }
  .adm-audience-demographics .ec-dlg-list { flex-basis: 0; gap: 8px; }
  .adm-audience-demographics .ec-dlg { grid-template-columns: 8px minmax(44px,1fr) auto auto; gap: 4px; font-size: 12px; line-height: 1.35; }
  .adm-audience-demographics .ec-dlg-lb { white-space: normal; overflow: visible; }
  .adm-audience-demographics .ec-dlg small { grid-column: auto; text-align: right; font-size: 12px; }
  .adm-overlay .ec-hm-row { min-width: 520px; }
  .adm-overlay .ec-axis { font-size: 11px; }
  .adm-overlay .ec-donut-mid b { font-size: 15px; }
}
