    :root {
      --bg-main: #f1f5f9;
      --bg-card: #ffffff;
      --border: #cbd5e1;
      --border-light: #e2e8f0;
      --text: #0f172a;
      --muted: #64748b;
      --primary: #2563eb;
      --primary-dark: #1d4ed8;
      --success: #059669;
      --warning: #d97706;
      --danger: #dc2626;
      --header: #0f172a;
      /* stacking — docs/ui-layers.md */
      --z-local: 1;
      --z-local-raised: 2;
      --z-popover: 100;
      --z-scrim: 150;
      --z-header: 200;
      --z-nav: 300;
      --z-float: 900;
      --z-modal: 1000;
      --z-modal-pop: 1100;
      --z-toast: 2000;
      --z-auth: 3000;
      --z-auth-dialog: 3100;
    }
    * { box-sizing: border-box; margin: 0; padding: 0; }
    body {
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
      background: var(--bg-main); color: var(--text);
      height: 100vh; height: 100dvh;
      display: flex; flex-direction: column; overflow: hidden;
    }
    header {
      height: 52px; background: var(--header); color: #fff;
      display: flex; align-items: center; gap: 12px;
      padding: 0 16px; flex-shrink: 0; position: relative; z-index: var(--z-header);
    }
    .brand { font-size: 13px; font-weight: 800; letter-spacing: -0.02em; white-space: nowrap; flex-shrink: 0; }
    .brand span { color: #93c5fd; font-weight: 600; margin-left: 6px; font-size: 11px; }
    .nav-switcher {
      display: flex; align-items: center; background: #1e293b; border-radius: 4px; padding: 2px; gap: 2px;
      overflow: hidden; min-width: 0; flex: 1 1 auto;
    }
    .nav-btn {
      padding: 6px 12px; font-size: 11px; font-weight: 700; color: #94a3b8;
      background: transparent; border: none; border-radius: 3px; cursor: pointer; white-space: nowrap;
      flex: 0 0 auto; touch-action: manipulation;
    }
    .nav-btn.active { background: var(--primary); color: #fff; }
    .header-right {
      display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto;
    }
    .nav-toggle {
      display: none; align-items: center; justify-content: center;
      width: 36px; height: 36px; padding: 0; border: 1px solid #334155; border-radius: 6px;
      background: #1e293b; color: #e2e8f0; cursor: pointer; touch-action: manipulation;
    }
    /* 메뉴가 넘치면 가로스크롤 대신 햄버거 */
    header.nav-compact .nav-toggle { display: inline-flex; }
    header.nav-compact .nav-switcher {
      display: none;
      position: absolute; top: calc(100% + 6px); left: 10px; right: 10px;
      flex: none; flex-direction: column; align-items: stretch;
      padding: 6px; gap: 4px; border: 1px solid #334155;
      border-radius: 8px; background: #0f172a;
      box-shadow: 0 12px 28px rgba(15, 23, 42, 0.45);
      overflow: visible; z-index: var(--z-nav);
    }
    header.nav-compact.nav-open .nav-switcher { display: flex; }
    header.nav-compact .nav-btn {
      width: 100%; justify-content: flex-start; text-align: left;
      padding: 12px 14px; font-size: 13px; min-height: 44px; border-radius: 6px;
    }
    .nav-logout {
      display: none; width: 100%; margin-top: 6px; padding: 12px 14px !important;
      min-height: 44px; border-radius: 6px; border: 1px solid #7f1d1d;
      background: #450a0a; color: #fecaca; font-size: 13px; font-weight: 700;
      cursor: pointer; text-align: left;
    }
    header.nav-compact .nav-logout { display: block; }
    header.nav-compact .header-user .btn-ghost-logout { display: none; }
    header.nav-compact .header-user .who { max-width: 100px; }
    .nav-toggle:hover { background: #334155; }
    .nav-toggle-bars,
    .nav-toggle-bars::before,
    .nav-toggle-bars::after {
      display: block; width: 16px; height: 2px; background: currentColor; border-radius: 1px;
      position: relative; transition: transform .15s ease, opacity .15s ease;
    }
    .nav-toggle-bars::before,
    .nav-toggle-bars::after {
      content: ""; position: absolute; left: 0;
    }
    .nav-toggle-bars::before { top: -5px; }
    .nav-toggle-bars::after { top: 5px; }
    header.nav-open .nav-toggle-bars { background: transparent; }
    header.nav-open .nav-toggle-bars::before { top: 0; transform: rotate(45deg); }
    header.nav-open .nav-toggle-bars::after { top: 0; transform: rotate(-45deg); }
    .nav-backdrop {
      display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45);
      z-index: var(--z-scrim); border: none; padding: 0; cursor: pointer;
    }
    .nav-backdrop.show { display: block; }
    /* overflow 측정에 의존하면 버튼이 잘리기만 하고 햄버거가 안 뜬다. 폭으로 고정한다. */
    @media (max-width: 1100px) {
      header .nav-toggle { display: inline-flex; width: 40px; height: 40px; }
      header .nav-switcher {
        display: none;
        position: absolute; top: calc(100% + 6px); left: 8px; right: 8px;
        flex: none; flex-direction: column; align-items: stretch;
        padding: 6px; gap: 4px; border: 1px solid #334155;
        border-radius: 8px; background: #0f172a;
        box-shadow: 0 12px 28px rgba(15, 23, 42, 0.45);
        overflow: auto; max-height: min(70vh, 28rem); z-index: var(--z-nav);
      }
      header.nav-open .nav-switcher { display: flex; }
      header .nav-btn {
        width: 100%; justify-content: flex-start; text-align: left;
        padding: 12px 14px; font-size: 14px; min-height: 44px; border-radius: 6px;
      }
      header .nav-logout { display: block; }
      header .header-user .btn-ghost-logout { display: none; }
      header .header-user .who { max-width: 88px; }
    }
    .header-user {
      display: none; align-items: center; gap: 8px; max-width: 220px;
    }
    body.is-authed .header-user { display: inline-flex; }
    .header-user .who {
      font-size: 10px; color: #cbd5e1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
      max-width: 140px;
    }
    .header-user .who b { color: #fff; font-weight: 700; }
    .btn-ghost {
      height: 28px; padding: 0 8px; border-radius: 4px; border: 1px solid #475569;
      background: transparent; color: #e2e8f0; font-size: 10px; font-weight: 700; cursor: pointer;
    }
    .btn-ghost:hover { background: #1e293b; }

    /* Admin 로그인 (Genesys 비의존) */
    .login-gate {
      position: fixed; inset: 0; z-index: var(--z-auth);
      display: flex; align-items: center; justify-content: center;
      padding: 20px;
      background:
        radial-gradient(1200px 600px at 10% -10%, rgba(37,99,235,0.35), transparent 55%),
        radial-gradient(900px 500px at 100% 0%, rgba(14,165,233,0.22), transparent 50%),
        #0f172a;
    }
    .login-gate[hidden] { display: none !important; }
    body.is-authed .login-gate { display: none !important; }
    body:not(.is-authed) #appHeader,
    body:not(.is-authed) #navBackdrop,
    body:not(.is-authed) main.page { visibility: hidden; pointer-events: none; }
    .login-card {
      width: min(420px, 100%); background: #fff; border-radius: 12px;
      padding: 28px 24px 22px; box-shadow: 0 24px 60px rgba(0,0,0,0.35);
    }
    .login-card .login-logo-wrap {
      display: none; justify-content: center; margin: 0;
    }
    .login-card .login-logo-wrap:has(img:not([hidden])) {
      display: flex; margin-bottom: 14px;
    }
    .login-card .login-logo {
      max-height: 52px; max-width: 220px; object-fit: contain;
    }
    .brand-logo-preview {
      display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
      padding: 10px; border: 1px dashed var(--border); border-radius: 6px; background: #f8fafc;
      margin-bottom: 8px;
    }
    .brand-logo-preview img {
      max-height: 48px; max-width: 180px; object-fit: contain; background: #fff;
      border: 1px solid var(--border-light); border-radius: 4px; padding: 4px;
    }
    .brand-logo-preview .empty { font-size: 11px; color: #94a3b8; font-weight: 600; }
    .login-card h1 { font-size: 18px; font-weight: 800; color: #0f172a; margin-bottom: 4px; }
    .login-card .sub { font-size: 12px; color: #64748b; line-height: 1.5; margin-bottom: 18px; }
    .login-card .form-group { margin-bottom: 12px; }
    .login-card .form-group label { font-size: 12px; }
    .login-card .form-group input {
      width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--border);
      border-radius: 6px; font-size: 13px; box-sizing: border-box;
    }
    .org-combo { position: relative; }
    .org-combo input { padding-right: 34px !important; }
    .org-combo-toggle {
      position: absolute; right: 2px; top: 50%; transform: translateY(-50%);
      width: 28px; height: 28px; padding: 0; border: 0; background: transparent;
      color: #64748b; cursor: pointer; font-size: 12px; line-height: 1;
    }
    .org-combo-list {
      position: absolute; left: 0; right: 0; top: calc(38px + 4px); z-index: var(--z-popover);
      background: #fff; border: 1px solid #cbd5e1; border-radius: 6px;
      box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
      max-height: 180px; overflow: auto;
    }
    .org-combo-item { display: flex; align-items: center; gap: 4px; }
    .org-combo-item.is-active, .org-combo-item:hover { background: #eff6ff; }
    .org-combo-pick {
      flex: 1; min-width: 0; height: 36px; padding: 0 10px; border: 0; background: transparent;
      text-align: left; font-size: 13px; color: #0f172a; cursor: pointer;
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .org-combo-del {
      flex: 0 0 auto; width: 32px; height: 32px; margin-right: 4px;
      border: 0; border-radius: 4px; background: transparent; color: #94a3b8;
      cursor: pointer; font-size: 16px; line-height: 1;
    }
    .org-combo-del:hover { background: #fee2e2; color: #b91c1c; }
    .login-actions { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
    .login-actions .btn { height: 38px; font-size: 13px; width: 100%; }
    .login-code-row {
      display: flex;
      align-items: stretch;
      gap: 8px;
    }
    .login-code-row input {
      flex: 1 1 auto;
      min-width: 0;
      margin: 0;
    }
    .login-code-row .btn {
      flex: 0 0 auto;
      width: auto;
      height: auto;
      white-space: nowrap;
      padding: 0 12px;
      font-size: 12px;
    }
    .login-sso { margin-top: 4px; }
    .login-sso .btn { width: 100%; height: 38px; font-size: 13px; }
    .login-or {
      display: flex; align-items: center; gap: 10px; margin: 14px 0 10px;
      color: #94a3b8; font-size: 11px; font-weight: 700;
    }
    .login-or::before, .login-or::after {
      content: ""; flex: 1; height: 1px; background: #e2e8f0;
    }
    .login-hint {
      margin-top: 14px; padding: 10px 12px; border-radius: 6px; background: #f8fafc;
      border: 1px solid #e2e8f0; font-size: 11px; color: #475569; line-height: 1.5;
    }
    .login-hint code { font-size: 10px; background: #e2e8f0; padding: 1px 5px; border-radius: 3px; }
    .login-error { display: none; margin-top: 8px; font-size: 12px; color: #b91c1c; font-weight: 700; }
    .login-error.show { display: block; }

    .status-pill {
      display: inline-flex; align-items: center; gap: 6px;
      font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
    }
    .status-pill.ok { background: #dcfce7; color: #166534; }
    .status-pill.bad { background: #fee2e2; color: #991b1b; }
    .status-pill.warn { background: #fef3c7; color: #92400e; }
    .secret-row { display: flex; gap: 6px; align-items: center; }
    .secret-row input { flex: 1; min-width: 0; }
    .secret-row > .secret-field { flex: 1; min-width: 0; }
    .secret-field { position: relative; display: block; width: 100%; }
    .secret-field input { width: 100%; padding-right: 34px !important; }
    .secret-eye {
      position: absolute; right: 2px; top: 50%; transform: translateY(-50%);
      width: 28px; height: 28px; padding: 0; border: 0; background: transparent;
      color: #64748b; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    }
    .secret-eye:hover { color: #0f172a; }
    .secret-eye svg { width: 16px; height: 16px; display: block; }
    .secret-eye .eye-off { display: none; }
    .secret-eye.is-shown .eye-open { display: none; }
    .secret-eye.is-shown .eye-off { display: block; }
    .btn:disabled,
    .btn.is-disabled {
      opacity: 0.45; cursor: not-allowed; background: #f1f5f9; color: #94a3b8;
      border-color: #e2e8f0; box-shadow: none;
    }
    .integ-map-table td, .integ-map-table th { font-size: 11px; }
    .live-pill {
      display: inline-flex; align-items: center; gap: 6px;
      font-size: 10px; font-weight: 700; padding: 4px 8px; border-radius: 999px;
      background: #064e3b; color: #a7f3d0; border: 1px solid #065f46;
    }
    .live-pill.offline { background: #450a0a; color: #fecaca; border-color: #7f1d1d; }
    .live-pill .dot {
      width: 7px; height: 7px; border-radius: 50%; background: #34d399;
      box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6); animation: pulse 1.6s infinite;
    }
    .live-pill.offline .dot { background: #f87171; animation: none; }
    @keyframes pulse {
      0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
      70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
      100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
    }
    .header-meta { font-size: 10px; color: #94a3b8; }

    .page {
      flex: 1; min-height: 0;
      overflow: auto;
      -webkit-overflow-scrolling: touch;
      padding: 14px 16px 20px;
      padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
    }
    .page-panel { display: none; }
    .page-panel.active { display: block; }

    .page-hd {
      display: flex; justify-content: space-between; align-items: flex-start;
      gap: 12px; margin-bottom: 12px; flex-wrap: wrap;
    }
    .page-hd h1 { font-size: 18px; font-weight: 800; }
    .page-hd p { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
    .toolbar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
    .toolbar input, .toolbar select {
      height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: 4px;
      font-size: 11px; background: #fff; outline: none; min-width: 120px;
    }
    .toolbar input[type="datetime-local"] { min-width: 168px; flex: 0 1 180px; }
    .stats-filters {
      display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
      margin: -4px 0 10px; padding: 8px 10px;
      background: #f8fafc; border: 1px solid var(--border); border-radius: 6px;
    }
    .stats-filters .hint { font-size: 11px; color: var(--muted); }
    .ms-filter { position: relative; }
    .ms-filter > button {
      height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: 4px;
      background: #fff; font-size: 11px; font-weight: 700; color: #334155; cursor: pointer;
      min-width: 108px; text-align: left;
    }
    .ms-filter > button.has-sel { border-color: #93c5fd; background: #eff6ff; color: #1d4ed8; }
    .ms-filter-panel {
      display: none; position: absolute; z-index: var(--z-popover); top: calc(100% + 4px); left: 0;
      min-width: 200px; max-height: 260px; overflow: auto;
      background: #fff; border: 1px solid var(--border); border-radius: 6px;
      box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12); padding: 6px;
    }
    .ms-filter.open .ms-filter-panel { display: block; }
    .ms-filter-panel label {
      display: flex; align-items: center; gap: 8px; padding: 5px 6px;
      font-size: 11px; color: #334155; border-radius: 4px; cursor: pointer;
    }
    .ms-filter-panel label:hover { background: #f1f5f9; }
    .ms-filter-panel input { accent-color: #2563eb; }
    .ms-filter-actions {
      display: flex; gap: 4px; padding: 4px 2px 2px; border-top: 1px solid #e2e8f0; margin-top: 4px;
    }
    .btn-filter-reset {
      box-sizing: border-box;
      width: 30px; height: 30px; padding: 0; margin-left: 2px;
      border-radius: 4px; border: 1px dashed #cbd5e1;
      background: transparent; color: #64748b; cursor: pointer;
      display: inline-flex; align-items: center; justify-content: center;
      flex-shrink: 0;
    }
    .btn-filter-reset:hover {
      border-color: #f87171; background: #fef2f2; color: #dc2626;
    }
    .btn-filter-reset:disabled,
    .btn-filter-reset.is-idle {
      opacity: 0.45; cursor: default;
    }
    .btn-filter-reset.is-idle:hover {
      border-color: #cbd5e1; background: transparent; color: #64748b;
    }
    .btn-filter-reset svg { width: 15px; height: 15px; display: block; }
    .btn {
      box-sizing: border-box;
      height: 30px; padding: 0 10px; border-radius: 4px; border: 1px solid var(--border);
      background: #fff; font-size: 11px; font-weight: 700; cursor: pointer; color: #334155;
      white-space: nowrap;
      display: inline-flex; align-items: center; justify-content: center;
    }
    .btn:hover { background: #f8fafc; }
    .btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
    .btn-primary:hover { background: var(--primary-dark); }
    .btn-danger { background: #fff; border-color: #fecaca; color: var(--danger); }
    .btn-danger:hover { background: #fef2f2; }
    .btn-sm {
      height: 26px; min-width: 48px; padding: 0 8px; font-size: 10px;
      line-height: 1;
    }
    /* 활성/비활성 — 버튼 문구 = 할 동작 (현재 상태 ≠ 라벨) */
    .btn-sm.btn-toggle { min-width: 72px; width: 72px; padding: 0; }
    .btn-sm.btn-status-activate {
      min-width: 72px; width: 72px; padding: 0;
      background: #ecfdf5; border-color: #a7f3d0; color: #047857;
    }
    .btn-sm.btn-status-activate:hover { background: #d1fae5; }
    .btn-sm.btn-status-deactivate {
      min-width: 72px; width: 72px; padding: 0;
      background: #fff; border-color: #fecaca; color: #b91c1c;
    }
    .btn-sm.btn-status-deactivate:hover { background: #fef2f2; }
    .btn-row { display: inline-flex; gap: 4px; align-items: center; flex-wrap: nowrap; }

    /* People식 일괄 선택 */
    .bulk-bar {
      display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
      margin: 0 0 8px; padding: 8px 10px;
      border: 1px solid var(--border); border-radius: 4px; background: #f8fafc;
    }
    .bulk-bar[hidden] { display: none !important; }
    .bulk-bar-count { font-size: 12px; font-weight: 700; color: #334155; margin-right: 4px; }
    table.data th.col-check,
    table.data td.col-check {
      width: 36px; min-width: 36px; max-width: 36px;
      text-align: center; padding-left: 8px; padding-right: 4px;
    }
    table.data th.col-check input,
    table.data td.col-check input {
      width: 14px; height: 14px; margin: 0; accent-color: var(--primary); cursor: pointer;
    }

    /* 자동배정 스위치 (목록·모달 공통) */
    .aa-switch {
      display: inline-flex; align-items: center; gap: 5px;
      border: 1px solid var(--border); border-radius: 999px; background: #fff;
      padding: 2px 8px 2px 3px; cursor: pointer; height: 26px;
      touch-action: manipulation; vertical-align: middle;
    }
    .aa-switch:disabled { opacity: 0.45; cursor: not-allowed; }
    .aa-switch .aa-track {
      position: relative; width: 30px; height: 16px; border-radius: 999px;
      background: #94a3b8; transition: background .15s ease; flex-shrink: 0;
    }
    .aa-switch .aa-knob {
      position: absolute; top: 2px; left: 2px; width: 12px; height: 12px;
      border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2);
      transition: transform .15s ease;
    }
    .aa-switch.is-on { border-color: #86efac; background: #f0fdf4; }
    .aa-switch.is-on .aa-track { background: #16a34a; }
    .aa-switch.is-on .aa-knob { transform: translateX(14px); }
    .aa-switch.is-off { border-color: #fdba74; background: #fff7ed; }
    .aa-switch.is-off .aa-track { background: #ea580c; }
    .aa-switch.is-off .aa-knob { transform: translateX(0); }
    .aa-switch .aa-text { font-size: 10px; font-weight: 800; min-width: 22px; }
    .aa-switch.is-on .aa-text { color: #166534; }
    .aa-switch.is-off .aa-text { color: #c2410c; }
    .aa-field {
      display: flex; align-items: center; gap: 10px; padding: 8px 10px;
      border: 1px solid var(--border-light); border-radius: 6px; background: #f8fafc;
    }
    .aa-field .aa-field-label { font-size: 12px; font-weight: 700; color: #334155; }
    .pager-bar {
      display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
      padding: 8px 12px; border-top: 1px solid var(--border-light); background: #f8fafc;
      font-size: 11px; color: #475569;
    }
    .pager-bar .pager-meta { font-weight: 600; }
    .pager-bar .pager-hint { color: #94a3b8; font-weight: 500; }
    .pager-actions { display: flex; gap: 6px; align-items: center; }
    .notify-route-grid {
      border: 1px solid var(--border); border-radius: 4px; background: #fff; overflow: hidden;
    }
    .notify-route-row {
      display: grid; grid-template-columns: 110px 1fr; gap: 8px; align-items: center;
      padding: 6px 8px; border-bottom: 1px solid var(--border-light); font-size: 11px; font-weight: 600;
    }
    .notify-route-row:last-child { border-bottom: none; }
    .notify-route-row select {
      width: 100%; padding: 5px 8px; border: 1px solid var(--border); border-radius: 4px;
      font-size: 11px; background: #fff;
    }

    .kpi-grid {
      display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px;
    }
    /* 통계 요약 KPI: 5개 한 줄 */
    #rptKpiGrid.kpi-grid {
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 8px;
      margin-bottom: 12px;
    }
    #rptKpiGrid .kpi-card {
      padding: 10px 12px;
      min-width: 0;
      gap: 4px;
    }
    #rptKpiGrid .kpi-label { font-size: 11px; font-weight: 600; }
    #rptKpiGrid .kpi-value { font-size: 22px; }
    #rptKpiGrid .kpi-sub { font-size: 10px; margin-top: 2px; }
    .kpi-card {
      background: var(--bg-card);
      border: 1px solid var(--border-light);
      border-radius: 6px;
      padding: 14px 16px 12px;
      box-shadow: none;
      display: flex;
      flex-direction: column;
      gap: 6px;
      min-width: 0;
    }
    .kpi-head {
      display: flex; align-items: center; justify-content: flex-start; gap: 8px;
      padding-bottom: 0; border-bottom: none;
    }
    .kpi-label {
      font-size: 12px; font-weight: 650; color: #64748b;
      display: inline-flex; align-items: center; gap: 7px; min-width: 0;
      letter-spacing: -0.01em;
    }
    .kpi-label .tip { border-bottom: none; }
    .kpi-dot {
      width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
      background: #94a3b8;
    }
    .kpi-card.tone-green .kpi-dot { background: var(--success); }
    .kpi-card.tone-amber .kpi-dot { background: var(--warning); }
    .kpi-card.tone-red .kpi-dot { background: var(--danger); }
    .kpi-card.tone-slate .kpi-dot { background: #64748b; }
    .kpi-card.tone-green .kpi-value { color: #166534; }
    .kpi-card.tone-amber .kpi-value { color: #b45309; }
    .kpi-card.tone-red .kpi-value { color: #b91c1c; }
    .kpi-card.tone-slate .kpi-value { color: #475569; }
    .kpi-value {
      font-size: 34px; font-weight: 800; letter-spacing: -0.04em; line-height: 1;
      font-variant-numeric: tabular-nums; color: #0f172a; text-align: left; white-space: nowrap;
      margin: 2px 0 0;
    }
    .kpi-sub {
      font-size: 11px; color: #94a3b8; margin-top: 2px; line-height: 1.35;
      padding-top: 8px; border-top: 1px solid var(--border-light);
    }
    .kpi-delta { font-weight: 700; color: #64748b; }
    .kpi-delta.up { color: var(--success); }
    .kpi-delta.down { color: var(--danger); }

    /* 분류별 운영: 지표 10개를 한 줄로 · 숫자 가독성 우선 */
    .stat-board { display: flex; flex-direction: column; gap: 16px; }
    .stat-cat { min-width: 0; }
    .stat-cat-title {
      font-size: 14px; font-weight: 800; color: #1e293b;
      margin: 0 0 8px 2px;
    }
    .stat-cat-row {
      display: grid;
      grid-template-columns: repeat(10, minmax(0, 1fr));
      gap: 6px;
      background: #eef2f7; border-radius: 8px; padding: 8px;
      min-width: 0;
    }
    .stat-tile {
      background: #fff; border: 1px solid #e2e8f0; border-radius: 6px;
      padding: 10px 6px; text-align: center; min-width: 0;
    }
    .stat-tile .lbl {
      font-size: 11px; font-weight: 700; color: #64748b;
      margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .stat-tile .val {
      font-size: 20px; font-weight: 800; color: #0f172a;
      letter-spacing: -0.03em; line-height: 1.1;
      font-variant-numeric: tabular-nums;
    }
    .stat-tile .sub {
      display: block; margin-top: 4px; font-size: 10px; font-weight: 600;
      color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .stat-tile.total {
      background: #0f172a; border-color: #0f172a; color: #fff;
    }
    .stat-tile.total .lbl { color: rgba(255,255,255,0.78); }
    .stat-tile.total .val { color: #fff; }
    .stat-tile.total.has-accent {
      background: var(--dept-accent, #9f1239);
      border-color: var(--dept-accent, #9f1239);
      color: var(--dept-accent-fg, #fff);
    }
    .stat-tile.total.has-accent .lbl,
    .stat-tile.total.has-accent .val {
      color: var(--dept-accent-fg, #fff);
    }
    .stat-tile.total.has-accent .lbl { opacity: 0.85; }
    .stat-tile.total.has-accent .tip {
      border-bottom-color: color-mix(in srgb, var(--dept-accent-fg, #fff) 45%, transparent);
    }
    .dept-swatch {
      display: inline-flex; align-items: center; justify-content: center;
      width: 22px; height: 22px; border-radius: 4px; flex-shrink: 0;
      border: 1px solid var(--border); font-size: 10px; font-weight: 800;
    }
    .dept-accent-row {
      display: flex; align-items: center; gap: 10px; padding: 8px 10px;
      border: 1px solid var(--border-light); border-radius: 6px; background: #fff;
      flex-wrap: wrap;
    }
    .dept-accent-toggle {
      display: inline-flex; align-items: center; gap: 4px;
      font-size: 11px; font-weight: 700; color: var(--muted); white-space: nowrap; cursor: pointer;
    }
    .dept-accent-toggle-label { user-select: none; }
    .dept-show-toggle { margin-left: auto; }
    .dept-accent-name { flex: 1; font-weight: 700; font-size: 12px; min-width: 0; }
    .dept-accent-pick {
      display: inline-flex; align-items: center; gap: 4px;
    }
    .dept-accent-pick-label {
      font-size: 10px; font-weight: 700; color: var(--muted); white-space: nowrap;
    }
    .dept-accent-pick input[type="color"] {
      width: 36px; height: 28px; padding: 0; border: 1px solid var(--border);
      border-radius: 4px; background: #fff; cursor: pointer;
    }
    .tip { cursor: help; border-bottom: 1px dotted rgba(100,116,139,0.55); }
    .stat-tile.total .tip { border-bottom-color: rgba(255,255,255,0.45); }
    @media (max-width: 1100px) {
      .stat-cat-row { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    }
    @media (max-width: 720px) {
      .stat-cat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }

    .split-main, .split-even {
      display: grid; gap: 12px; align-items: start; margin-bottom: 12px;
    }
    .split-main { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); }
    .split-even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .split-main > .card, .split-even > .card { margin: 0; min-width: 0; }
    .split-main .table-wrap, .split-even .table-wrap { max-height: min(70vh, 36rem); }
    .split-main .card-hd .hint, .split-even .card-hd .hint { max-width: none; }
    .grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; margin-bottom: 12px; }
    .grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
    .grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
    @media (max-width: 1100px) {
      .grid-4 { grid-template-columns: 1fr; }
    }
    .card {
      background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 8px;
      padding: 14px; min-width: 0;
    }
    .card-hd {
      display: flex; justify-content: space-between; align-items: center;
      margin-bottom: 12px; gap: 8px;
    }
    .card-hd h2 { font-size: 14px; font-weight: 800; }
    .card-hd .hint { font-size: 11px; color: var(--muted); line-height: 1.35; max-width: 52%; text-align: right; }

    table.data {
      width: 100%; min-width: 72rem; table-layout: fixed; border-collapse: collapse; font-size: 12px;
    }
    table.data th {
      text-align: left; font-size: 11px; color: var(--muted); font-weight: 700;
      padding: 8px 10px; border-bottom: 1px solid var(--border-light); background: #f8fafc;
      white-space: nowrap; word-break: keep-all; overflow: hidden; text-overflow: ellipsis;
    }
    table.data td {
      padding: 8px 10px; border-bottom: 1px solid var(--border-light); vertical-align: middle;
      font-variant-numeric: tabular-nums; white-space: nowrap; word-break: keep-all;
      overflow: hidden; text-overflow: ellipsis;
    }
    table.data:has(.btn-row) th:last-child,
    table.data td:has(.btn-row) {
      width: 206px; overflow: visible; text-align: right; text-overflow: clip;
    }
    table.data:has(.btn-row-equal) th:last-child,
    table.data td:has(.btn-row-equal) {
      width: 210px;
    }
    table.data tr:hover td { background: #f8fafc; }
    table.data tr.row-muted td {
      opacity: 0.52; background: #f8fafc; color: #94a3b8;
    }
    table.data tr.row-muted:hover td { background: #f1f5f9; opacity: 0.68; }
    table.data tr.row-warn td { background: #fffbeb; }
    table.data tr.row-warn:hover td { background: #fef3c7; }
    table.data tr.row-warn td:first-child { box-shadow: inset 3px 0 0 #f59e0b; }
    table.data tr.row-danger td { background: #fef2f2; }
    table.data tr.row-danger:hover td { background: #fee2e2; }
    table.data tr.row-danger td:first-child { box-shadow: inset 3px 0 0 #ef4444; }
    .table-wrap { overflow: auto; max-height: min(70vh, 36rem); max-width: 100%; -webkit-overflow-scrolling: touch; }
    table.data .btn-row {
      display: inline-flex; flex-wrap: nowrap; gap: 4px; align-items: center; white-space: nowrap;
    }
    table.data .btn-row .btn { flex: 0 0 auto; width: auto; min-width: 48px; padding: 0 8px; }
    table.data .btn-row .btn.btn-status-activate,
    table.data .btn-row .btn.btn-status-deactivate {
      min-width: 72px; width: 72px; padding: 0;
    }
    table.data .btn-row-equal {
      display: inline-flex; gap: 4px; align-items: center;
    }
    table.data .btn-row-equal .btn {
      width: 66px; min-width: 66px; height: 26px; padding: 0 4px; font-size: 11px;
      box-sizing: border-box;
    }
    table.data .btn-row-equal .btn.btn-status-activate,
    table.data .btn-row-equal .btn.btn-status-deactivate {
      width: 66px; min-width: 66px;
    }

    .bar-row { display: grid; grid-template-columns: minmax(4.5rem, 6rem) 1fr minmax(2.5rem, 3rem); gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; }
    .bar-row .name { font-size: 12px; font-weight: 600; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .bar-track { height: 0.625rem; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
    .bar-fill { height: 100%; background: var(--primary); border-radius: 999px; }
    .bar-row .cnt { font-size: 12px; font-weight: 700; color: #475569; text-align: right; font-variant-numeric: tabular-nums; }
    .donut-wrap {
      display: flex; flex-direction: column; align-items: center;
      gap: 0.75rem; padding: 0.125rem 0 0.25rem;
    }
    .donut-svg {
      width: min(100%, clamp(10rem, 42vw, 14rem)); height: auto; aspect-ratio: 1 / 1;
      display: block;
    }
    .donut-legend {
      display: flex; flex-wrap: wrap; justify-content: center;
      gap: 8px 14px; width: 100%;
    }
    .donut-legend-item {
      display: inline-flex; align-items: center; gap: 6px;
      font-size: 11px; font-weight: 700; color: #334155;
      white-space: nowrap;
    }
    .donut-legend-item i {
      width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0;
    }
    .donut-legend-item .cnt {
      font-weight: 600; color: #64748b; font-variant-numeric: tabular-nums;
    }
    .donut-slice-pct {
      font-size: 12px; font-weight: 800; fill: #fff;
      paint-order: stroke fill; stroke: rgba(15,23,42,.28); stroke-width: 2.5px;
    }
    .donut-center-label {
      font-size: 12px; font-weight: 700; fill: #64748b;
    }
    .donut-center-value {
      font-size: 22px; font-weight: 800; fill: #0f172a;
    }

    .feed {
      display: flex; flex-direction: column; gap: 0.4rem;
      max-height: min(50vh, 28rem); overflow: auto;
    }
    .feed-item {
      display: grid; grid-template-columns: 64px 1fr; gap: 8px;
      padding: 9px; border: 1px solid var(--border-light); border-radius: 6px; background: #f8fafc;
    }
    .feed-item .t { font-size: 11px; color: var(--muted); font-weight: 700; }
    .feed-item .b { font-size: 12px; line-height: 1.45; }
    .feed-item.new { border-color: #93c5fd; background: #eff6ff; }

    .badge {
      display: inline-flex; align-items: center; font-size: 10px; font-weight: 800;
      padding: 2px 7px; border-radius: 999px; white-space: nowrap;
    }
    .badge-green { background: #dcfce7; color: #166534; }
    .badge-blue { background: #dbeafe; color: #1e40af; }
    .badge-amber { background: #fef3c7; color: #92400e; }
    .badge-red { background: #fee2e2; color: #991b1b; }
    .badge-slate { background: #e2e8f0; color: #334155; }

    .prio-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
    .prio-URGENT { background: #dc2626; }
    .prio-HIGH { background: #ea580c; }
    .prio-MID { background: #2563eb; }
    .prio-LOW { background: #64748b; }

    .alert-list { display: flex; flex-direction: column; gap: 6px; }
    .alert-item {
      display: flex; justify-content: space-between; gap: 10px; align-items: flex-start;
      padding: 10px 12px; border-radius: 6px; border: 1px solid var(--border-light); font-size: 12px;
    }
    .alert-item.sla { background: #fff7ed; border-color: #fed7aa; }
    .alert-item.breach { background: #fef2f2; border-color: #fecaca; }
    .alert-item.follow { background: #eff6ff; border-color: #bfdbfe; }
    .alert-item.is-acked { opacity: 0.5; background: #f8fafc; border-color: #e2e8f0; }
    .alert-item.is-pending { box-shadow: inset 3px 0 0 #ef4444; }

    .appsync-box {
      font-size: 10px; color: #334155; background: #0f172a; color: #cbd5e1;
      border-radius: 6px; padding: 10px 12px; line-height: 1.55; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
      white-space: pre-wrap;
    }
    .appsync-box b { color: #93c5fd; }

    .modal-backdrop {
      position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55);
      display: none; align-items: center; justify-content: center; z-index: var(--z-modal); padding: 16px;
      cursor: pointer;
    }
    /* 인증 게이트 위 — 로그인 중 확인 모달 (docs/ui-layers.md) */
    #appConfirmModal.modal-backdrop {
      z-index: var(--z-auth-dialog);
    }
    .modal-backdrop > .modal { cursor: default; }
      .modal {
      background: #fafbfc; width: min(620px, 96vw); max-height: 90vh; overflow: auto;
      border-radius: 8px; padding: 14px; box-shadow: 0 20px 50px rgba(15,23,42,0.28);
    }
    .modal-title { font-size: 14px; font-weight: 800; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 2px solid #e2e8f0; }
    .form-group { margin-bottom: 8px; }
    .form-group label { display: block; font-size: 11px; font-weight: 700; margin-bottom: 3px; color: #334155; }
    .form-group input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
    .form-group select,
    .form-group textarea {
      width: 100%; padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px;
      font-size: 11px; outline: none; background: #fff; box-sizing: border-box;
    }
    .form-group textarea,
    textarea {
      resize: vertical;
      max-width: 100%;
    }
    .stat-tile.sla-ok .val { color: #15803d; }
    .stat-tile.sla-warn .val { color: #b45309; }
    .stat-tile.sla-bad .val { color: #b91c1c; }
    .stat-tile.sla-warn { border-color: #fcd34d; background: #fffbeb; }
    .stat-tile.sla-bad { border-color: #fca5a5; background: #fef2f2; }
    .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    
    .feature-enable-row {
      display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
      margin-bottom: 12px; padding: 10px 12px;
      background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px;
    }
    .feature-check {
      position: absolute !important; opacity: 0 !important; width: 1px !important; height: 1px !important;
      margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important;
      border: 0 !important; padding: 0 !important; pointer-events: none !important;
    }
    .toggle-gated { position: relative; }
    .toggle-gated.is-off > .toggle-gated-body { display: none; }
    .metric-chart-wrap {
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
      min-height: 0;
      padding: 0;
    }
    .metric-chart-legend {
      display: flex; gap: 0.75rem; flex-wrap: wrap; flex-shrink: 0;
      font-size: 10px; font-weight: 700; color: #64748b;
    }
    .metric-chart-legend span { display: inline-flex; align-items: center; gap: 0.25rem; }
    .metric-chart-legend i { width: 0.75rem; height: 0.2rem; border-radius: 2px; display: inline-block; }
    .metric-chart-svg {
      flex: 1;
      width: 100%;
      min-height: clamp(12rem, 28vh, 18rem);
      height: clamp(12rem, 28vh, 18rem);
      display: block;
      background: #f8fafc;
      border-radius: 6px;
      border: 1px solid var(--border-light);
    }
    .metric-card {
      display: flex;
      flex-direction: column;
      min-height: clamp(16rem, 36vh, 24rem);
    }
    .metric-card .metric-chart-wrap { flex: 1; }
    .metric-card #metricChartHint { flex-shrink: 0; margin-top: 0; }
    .dash-alerts-metrics,
    .dash-queue-feed {
      align-items: stretch;
    }
    .dash-alerts-metrics > .card,
    .dash-queue-feed > .card {
      display: flex;
      flex-direction: column;
      /* 카드 높이를 뷰포트 기준으로 고정 → 내부만 스크롤 (페이지 무한 확장 방지) */
      height: clamp(18rem, 42vh, 28rem);
      min-height: clamp(16rem, 36vh, 24rem);
      max-height: clamp(18rem, 42vh, 28rem);
    }
    .dash-alerts-metrics .alert-list,
    .dash-queue-feed .table-wrap,
    .dash-queue-feed .feed {
      flex: 1 1 auto;
      min-height: 0;
      max-height: none;
      overflow: auto;
    }
    @media (max-width: 1100px) {
      .dash-alerts-metrics > .card,
      .dash-queue-feed > .card {
        height: clamp(16rem, 50vh, 26rem);
        max-height: clamp(16rem, 50vh, 26rem);
      }
    }

    .settings-footer-actions {
      display: flex; justify-content: flex-start; align-items: center; gap: 8px; flex-wrap: wrap;
      margin-top: 16px; padding: 12px 0 4px; border-top: 1px solid var(--border-light);
    }
    .settings-footer-actions .btn { min-width: 88px; }
    .section-save-row {
      display: flex; justify-content: flex-start; align-items: center; gap: 8px;
      margin: 12px 12px 12px; padding-top: 12px; border-top: 1px solid var(--border-light);
    }
    .section-save-row .btn { min-width: 108px; }
    .modal-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #e2e8f0; }
    .modal-actions .btn { min-width: 72px; height: 30px; }
    .check-grid {
      display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center;
      padding: 8px 10px; border: 1px solid var(--border); border-radius: 4px;
      background: #fff; max-height: 118px; overflow: auto;
    }
    .check-grid > label {
      display: inline-flex !important; align-items: center; gap: 6px;
      margin: 0; font-size: 11px; font-weight: 600; color: #334155;
      white-space: nowrap; cursor: pointer; line-height: 1.2;
    }
    .check-grid input[type="checkbox"] {
      width: 14px; height: 14px; margin: 0; flex-shrink: 0;
      accent-color: var(--primary); cursor: pointer;
    }
    .field-hint { font-size: 10px; color: #64748b; margin-top: 3px; line-height: 1.35; }
    .queue-chip {
      display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 6px;
      border-radius: 3px; background: #eff6ff; color: #1d4ed8; margin: 1px 2px 1px 0;
    }
    .group-chip {
      display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 6px;
      border-radius: 3px; background: #f0fdf4; color: #15803d; margin: 1px 2px 1px 0;
      vertical-align: middle; max-width: 100%;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .group-chip.removable {
      cursor: pointer; margin: 0; padding: 2px 7px;
      display: inline-flex; align-items: center; gap: 4px;
    }
    .group-chip.removable:hover { background: #fee2e2; color: #b91c1c; }
    td.col-groups, th.col-groups {
      white-space: normal !important; word-break: break-word;
      vertical-align: middle;
    }
    td.col-groups {
      line-height: 1.45;
    }
    .queue-picker {
      border: 1px solid var(--border); border-radius: 4px; background: #fff; overflow: hidden;
    }
    .queue-selected {
      display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
      padding: 6px 8px; min-height: 32px; border-bottom: 1px solid var(--border-light);
      background: #f8fafc;
    }
    .queue-selected .queue-empty { font-size: 10px; color: #94a3b8; font-weight: 600; }
    .queue-chip.removable {
      cursor: pointer; margin: 0; padding: 2px 7px;
      display: inline-flex; align-items: center; gap: 4px;
    }
    .queue-chip.removable:hover { background: #fee2e2; color: #b91c1c; }
    .queue-picker-search {
      width: 100%; border: none !important; border-radius: 0 !important;
      border-bottom: 1px solid var(--border-light) !important;
      padding: 7px 10px !important; font-size: 11px; outline: none; background: #fff;
      box-sizing: border-box;
    }
    .queue-picker-list {
      border: none !important; border-radius: 0 !important; max-height: 168px;
      flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 2px;
    }
    .queue-picker-list > label {
      white-space: normal !important; padding: 4px 2px; width: 100%;
    }
    .queue-picker-meta { color: #94a3b8; font-weight: 500; font-size: 10px; }
    .queue-picker-count { font-size: 10px; color: #64748b; margin-top: 4px; font-weight: 600; }

    .toast-host {
      position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
      z-index: var(--z-toast); display: flex; flex-direction: column; gap: 6px; pointer-events: none;
    }
    .toast {
      background: #0f172a; color: #fff; font-size: 12px; font-weight: 600;
      padding: 8px 14px; border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    }

    .empty { padding: 24px; text-align: center; color: var(--muted); font-size: 12px; }

    .stage-chip {
      display: inline-flex; align-items: center; font-size: 10px; font-weight: 800;
      padding: 2px 7px; border-radius: 3px; white-space: nowrap;
    }
    .seg-tabs {
      display: flex; gap: 0; margin-bottom: 10px; background: #e2e8f0; border-radius: 6px;
      padding: 2px; border: 1px solid #cbd5e1; width: fit-content; max-width: 100%;
      overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap;
    }
    .seg-tabs button {
      border: none; background: transparent; padding: 6px 12px; font-size: 11px; font-weight: 700;
      color: #64748b; border-radius: 4px; cursor: pointer; flex: 0 0 auto; white-space: nowrap;
    }
    .seg-tabs button.active { background: #fff; color: #1d4ed8; box-shadow: 0 1px 2px rgba(15,23,42,0.1); }
    .rpt-grain-wrap { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
    .rpt-grain-wrap label { font-size: 11px; font-weight: 700; color: var(--muted); white-space: nowrap; }
    .rpt-grain-wrap select {
      height: 28px; padding: 0 8px; border: 1px solid var(--border); border-radius: 4px;
      font-size: 11px; background: #fff;
    }
    .trans-matrix { overflow: auto; }
    .trans-matrix table {
      min-width: 640px; table-layout: fixed; border-collapse: collapse; width: 100%;
    }
    .trans-matrix th, .trans-matrix td {
      text-align: center; font-size: 10px; vertical-align: middle;
      padding: 6px 4px; width: 3.5rem;
    }
    .trans-matrix th.from-col, .trans-matrix td.from-col {
      text-align: left; font-weight: 700; white-space: nowrap;
      width: 9.5rem; min-width: 9.5rem; padding-left: 8px;
    }
    .trans-matrix .trans-cell {
      width: 28px; height: 28px; margin: 0 auto;
      border-radius: 4px; border: 1px solid #e2e8f0;
      display: flex; align-items: center; justify-content: center;
      cursor: pointer; background: #fff;
    }
    .trans-cell.on { background: #dbeafe; border-color: #93c5fd; color: #1d4ed8; font-weight: 800; }
    .trans-cell.self { background: #f1f5f9; color: #94a3b8; cursor: default; }
    .ddb-note {
      font-size: 11px; line-height: 1.55; color: #334155;
      background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; padding: 10px 12px;
    }
    .ddb-note code { font-size: 10px; background: #e2e8f0; padding: 1px 4px; border-radius: 3px; }

    @media (max-width: 1100px) {
      .kpi-grid { grid-template-columns: repeat(2, 1fr); }
      #rptKpiGrid.kpi-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
      .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
      .stat-cat-row { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    }
    @media (max-width: 980px) {
      .split-main, .split-even { grid-template-columns: 1fr; }
    }
    @media (max-width: 900px) {
      header {
        height: 52px; padding: 0 10px; gap: 8px;
      }
      .brand span { display: none; }
      .header-meta { display: none; }
      .header-user .who { max-width: 90px; }
      .live-pill { font-size: 9px; padding: 3px 7px; }
      .page {
        padding: 10px 10px max(28px, calc(20px + env(safe-area-inset-bottom, 0px)));
        /* overflow-x:hidden 단독 지정은 iOS에서 세로 스크롤을 깨뜨릴 수 있음 */
        overflow: auto;
        -webkit-overflow-scrolling: touch;
      }
      .bar-row { grid-template-columns: minmax(64px, 80px) 1fr 44px; gap: 6px; }
      .kpi-value { font-size: 28px; }
      .stat-tile .val { font-size: 18px; }
      .stat-tile .lbl { font-size: 11px; }
      .card-hd .hint { max-width: none; text-align: left; }
      .notify-route-row { grid-template-columns: 1fr; gap: 4px; }
      .modal { width: min(620px, 100vw - 16px); }
      .form-grid { grid-template-columns: 1fr; }
      .pager-bar { flex-direction: column; align-items: stretch; }
    }
    @media (max-width: 720px) {
      .kpi-grid { grid-template-columns: 1fr 1fr; }
      #rptKpiGrid.kpi-grid {
        display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 8px;
        grid-template-columns: none; -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
      }
      #rptKpiGrid .kpi-card { flex: 0 0 128px; }
      #rptKpiGrid .kpi-value { font-size: 18px; }
      .stat-cat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .page-hd { flex-direction: column; align-items: stretch; }
      .toolbar { width: 100%; }
      .toolbar input, .toolbar select { min-width: 0; flex: 1 1 140px; }
      .table-wrap { max-height: none; }
      #page-stats .table-wrap {
        margin-bottom: 8px;
      }
      #page-stats {
        padding-bottom: 8px;
      }
      table.data .btn-row { flex-wrap: nowrap; }
      .stats-filters { padding: 8px; gap: 6px; }
      .ms-filter > button { min-width: 0; }
      .ms-filter-panel { left: 0; right: auto; max-width: min(280px, calc(100vw - 24px)); }
      .card-hd { flex-wrap: wrap; gap: 8px; }
      .rpt-grain-wrap { margin-left: 0; width: 100%; }
      .rpt-grain-wrap select { flex: 1; }
      .seg-tabs { width: 100%; }
      .seg-tabs button { min-height: 40px; padding: 8px 14px; font-size: 13px; }
      .toolbar input, .toolbar select, .toolbar .btn { flex: 1 1 100%; min-width: 0; height: 36px; }
      .secret-row { flex-wrap: wrap; }
      .secret-row .btn { flex: 1 1 100%; height: 36px; }
      .modal-actions { flex-wrap: wrap; }
      .modal-actions .btn { flex: 1 1 auto; min-height: 40px; height: auto; }
      .login-card { padding: 22px 16px 18px; }
      .form-group .btn { min-height: 36px; height: auto; }
      .header-user .who { display: none; }
      .trans-cell { width: 36px; height: 36px; }
    }
  
