.status-pill { display:inline-flex; align-items:center; gap:6px; min-height:26px; padding:0 10px; border:1px solid var(--line); border-radius:999px; background:var(--surface-1); color:var(--text-muted); font-size:11px; font-weight:700; }
.status-pill::before { content:""; width:6px; height:6px; border-radius:50%; background:var(--success); }
.mon-page { display:flex; flex-direction:column; gap:22px; }
.mon-card, .panel, .tab-placeholder { min-width:0; padding:28px 32px; border:1px solid var(--line); border-radius:var(--radius-lg); background:var(--panel-bg); box-shadow:var(--shadow-panel); }
.mon-card h2,.mon-card h3,.mon-card h4 { margin-top:0; }
.tab-placeholder { text-align:center; color:var(--text-muted); padding-block:54px; }
.tab-placeholder h3 { margin-bottom:6px; color:var(--text); }
.primary-button,.secondary-button,.ghost-button,.mon-sum-btn { display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:38px; padding:0 16px; border-radius:9px; border:1px solid transparent; font-weight:700; transition:background var(--fast),border-color var(--fast),color var(--fast); }
.primary-button { color:var(--on-color); background:var(--accent-gradient); box-shadow:var(--shadow-primary); }
.primary-button:hover { filter:brightness(1.08); }
.secondary-button { background:var(--button-secondary-bg); border-color:var(--button-secondary-line); color:var(--text); }
.secondary-button:hover { background:var(--button-secondary-hover); }

.compact-button,.mon-sum-btn { min-height:30px; padding:0 11px; font-size:12px; }
.mon-sum-btn { background:var(--accent-soft); border-color:var(--accent-line); color:var(--accent-text); }
button:disabled { opacity:.48; cursor:not-allowed; }
.page-tabs { display:flex; align-items:center; gap:8px; padding:4px; overflow-x:auto; scrollbar-width:thin; }
.page-tab,.keyword-button { flex:0 0 auto; min-height:38px; padding:0 16px; border:1px solid var(--line); border-radius:999px; background:var(--surface-1); color:var(--text-muted); font-weight:700; white-space:nowrap; }
.page-tab:hover,.keyword-button:hover { color:var(--text); border-color:var(--line-strong); }
.page-tab.is-active,.keyword-button.is-active { color:var(--on-accent-soft); border-color:var(--accent); background:var(--accent-soft); }
.field { display:grid; gap:6px; color:var(--text-muted); font-size:12px; font-weight:700; }
.field input,.field select,.field textarea,input[type="text"],input[type="search"],input[type="url"],input[type="date"],select,textarea { min-height:40px; border:1px solid var(--line); border-radius:9px; background:var(--input-bg); color:var(--text); padding:0 12px; }
.date-range-input { cursor:pointer; }
.date-range-input::-webkit-calendar-picker-indicator { cursor:pointer; filter:invert(.8); opacity:.85; }
:root[data-theme="light"] .date-range-input::-webkit-calendar-picker-indicator { filter:none; } /* 다크용 반전은 라이트에서 해제 */
.table-wrap { width:100%; overflow:auto; border-radius:12px; }
.mon-table,.table-wrap table { width:100%; min-width:720px; border-collapse:collapse; table-layout:fixed; }
.mon-table th,.table-wrap th { padding:12px; color:var(--text-muted); font-size:12px; font-weight:700; text-align:left; border-bottom:1px solid var(--line); }
.table-sort-button { display:inline-flex; align-items:center; gap:5px; width:100%; padding:0; border:0; background:transparent; color:inherit; font:inherit; text-align:left; cursor:pointer; }
.table-sort-button span { color:var(--text-faint); font-size:10px; }
.table-sort-button:hover,.table-sort-button.is-active { color:var(--accent-text); }
.mon-table td,.table-wrap td { padding:13px 12px; color:var(--table-text); border-bottom:1px solid var(--table-line); vertical-align:top; }
.mon-table tbody tr:hover,.table-wrap tbody tr:hover { background:var(--row-hover); }
.mon-td-title a:hover { color:var(--accent-text); }
.mon-td-date,.mon-td-media,.mon-td-views { color:var(--text-muted); white-space:nowrap; }
.mon-empty,.mon-empty-cell,.table-empty { padding:30px!important; text-align:center!important; color:var(--text-faint)!important; }
.mon-kw-hint { margin:8px 0 0; color:var(--text-faint); font-size:12px; }
.mon-modal { position:fixed; inset:0; z-index:100; display:grid; place-items:center; padding:20px; background:var(--modal-scrim); backdrop-filter:blur(6px); }
.mon-modal-box { width:min(560px,100%); max-height:min(760px,90vh); overflow:auto; padding:28px; border:1px solid var(--line-strong); border-radius:20px; background:var(--modal-bg); box-shadow:var(--shadow-modal); }
.mon-modal-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:18px; }
.mon-field { display:grid; gap:6px; margin-top:12px; color:var(--text-muted); font-size:12px; font-weight:700; }
.mon-field input { width:100%; min-height:42px; padding:0 12px; border:1px solid var(--line); border-radius:9px; background:var(--input-bg); }
.mon-chip-x { border:0; background:none; color:var(--text-muted); }
.mon-sum-text { max-height:50vh; overflow:auto; white-space:pre-wrap; padding:16px; border:1px solid var(--line); border-radius:10px; background:var(--input-bg); font-family:var(--font-body); }
.mon-sum-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:16px; }
.mon-sum-head h3 { margin:0; }
.mon-sum-status { min-height:18px; margin:10px 0 0; color:var(--text-muted); font-size:12px; }
.mon-modal-error { min-height:18px; margin:10px 0 0; color:var(--danger); font-size:12px; }
.loading-dots::after { content:"."; animation:loadingDots 1.4s steps(1,end) infinite; }
@keyframes loadingDots { 0%{content:"."} 33%{content:".."} 66%,100%{content:"..."} }

.channel-badge { display:inline-flex; align-items:center; gap:6px; min-height:24px; padding:0 9px; border-radius:999px; background:var(--surface-1); color:var(--text-muted); font-size:11px; font-weight:700; }
.channel-distribution-unit { margin-left:4px; color:var(--text-muted); font-size:12px; font-weight:600; }
.channel-distribution-type { color:var(--text-muted); font-size:11px; font-weight:500; }
@media (max-width:768px) {
  .mon-card,.panel,.tab-placeholder { padding:20px 16px; border-radius:16px; }
  .page-tabs { margin-inline:-4px; }
  .is-card-table { overflow:visible; }
  .is-card-table table,.is-card-table tbody,.is-card-table tr,.is-card-table td { display:block; width:100%; min-width:0; }
  .is-card-table thead { display:none; }
  .is-card-table tbody { display:grid; gap:12px; }
  .is-card-table tr { padding:14px; border:1px solid var(--line); border-radius:12px; background:var(--surface-1); }
  .is-card-table td { display:grid; grid-template-columns:68px minmax(0,1fr); gap:10px; padding:6px 0; border:0; white-space:normal; }
  .is-card-table td::before { content:attr(data-label); color:var(--text-faint); font-size:11px; font-weight:700; }
  .is-card-table td[data-label="제목"] { display:block; font-size:15px; font-weight:700; }
  .is-card-table td[data-label="제목"]::before { display:block; margin-bottom:4px; }
  .is-scroll-table { overflow-x:auto; }
  .is-scroll-table table { min-width:720px; }
  .mon-modal { align-items:end; padding:0; }
  .mon-modal-box { width:100%; max-height:88vh; border-radius:20px 20px 0 0; padding:24px 18px; }
  input,select,textarea { font-size:16px; }
}
.rep-pagination { display:flex; align-items:center; justify-content:space-between; gap:16px; padding-top:12px; }
.rep-page-range { color:var(--text-faint); font-size:11px; white-space:nowrap; }
.rep-page-buttons { display:flex; align-items:center; gap:5px; }
.rep-page { min-width:32px; height:32px; padding:0 8px; border:1px solid var(--line); border-radius:8px; background:var(--surface-1); color:var(--text-muted); font-size:11px; font-weight:700; }
.rep-page:hover:not(:disabled) { color:var(--text); border-color:var(--line-strong); }
.rep-page.is-active { color:var(--on-accent-soft); border-color:var(--accent); background:var(--accent-soft); }
.rep-page:disabled { cursor:not-allowed; opacity:.42; }
.rep-page-move { min-width:46px; }

@media (max-width:768px) {
  .rep-pagination { align-items:stretch; flex-direction:column; }
  .rep-page-buttons { justify-content:center; }
}

@media (max-width:480px) {
  .rep-page-buttons { gap:3px; }
  .rep-page { min-width:30px; padding-inline:6px; }
}

@media (max-width:320px) {
  .rep-page-move { min-width:42px; }
}

/* Loading feedback: stable placeholders for first entry, local status for refresh. */
.ui-spinner { display:inline-block; width:16px; height:16px; flex-shrink:0; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; animation:ui-spin .8s linear infinite; vertical-align:middle; margin-right:8px; }
@keyframes ui-spin { to { transform:rotate(360deg); } }
.auth-loading-status,.mon-risk-loading { display:flex; align-items:center; justify-content:center; gap:4px; }
.has-view-loading { position:relative; min-height:100px; }
.view-loading-notice { position:absolute; z-index:8; top:8px; right:8px; display:flex; align-items:center; gap:8px; max-width:calc(100% - 16px); padding:12px 16px; border:1px solid var(--line); border-radius:12px; color:var(--text-muted); background:var(--surface-1); box-shadow:var(--shadow-panel); font-size:13px; }
.view-loading-notice.is-error { color:var(--danger); }
.view-loading-notice button { white-space:nowrap; border:1px solid var(--line-strong); background:var(--surface-2); color:var(--text); border-radius:6px; padding:6px 10px; }
.is-refreshing .table-wrap { opacity:.6; transition:opacity .12s ease; }
.view-loading-empty { min-height:80px; }
.monitor-skeleton { padding:8px 0; min-height:580px; }
.skeleton-line { display:block; height:14px; border-radius:5px; background:var(--surface-3); animation:skeleton-breathe 1.5s ease-in-out .3s infinite; }
.skeleton-title { width:180px; height:26px; margin:8px 0 14px; }
.skeleton-description { width:min(380px,85%); height:12px; margin-bottom:26px; }
.skeleton-tabs { display:flex; gap:28px; padding:10px 0 18px; border-bottom:1px solid var(--line); color:var(--text-faint); font-size:14px; }
.skeleton-panel { padding:20px; margin-top:16px; border:1px solid var(--line); border-radius:12px; background:var(--surface-1); }
.skeleton-filter { width:min(280px,80%); height:32px; }
.skeleton-chips { display:flex; flex-wrap:wrap; gap:10px; margin-top:20px; }
.skeleton-chips .skeleton-line { width:72px; height:26px; border-radius:14px; }
.skeleton-list-heading { color:var(--text-faint); font-size:14px; padding-bottom:12px; }
.skeleton-row { display:grid; grid-template-columns:70px 1fr 90px; gap:24px; align-items:center; height:52px; border-top:1px solid var(--line); }
.skeleton-row:nth-child(even) .skeleton-line:nth-child(2) { width:78%; }
.skeleton-feature { display:flex; gap:20px; }
.skeleton-thumb { width:160px; height:90px; }
.skeleton-feature-copy { flex:1; display:flex; flex-direction:column; justify-content:center; gap:18px; }
@keyframes skeleton-breathe { 50% { opacity:.45; } }
@media (max-width:600px) {
  .skeleton-panel { padding:14px; }
  .skeleton-row { grid-template-columns:44px 1fr; gap:14px; height:64px; }
  .skeleton-row .skeleton-line:last-child { display:none; }
  .view-loading-notice { font-size:12px; padding:10px; flex-wrap:wrap; }
}
@media (prefers-reduced-motion:reduce) {
  .ui-spinner,.skeleton-line { animation:none; }
  .is-refreshing .table-wrap { transition:none; }
}

/* Reserve dot width so the summary explanation stays still while waiting. */
.summary-loading .loading-dots::after { display:inline-block; width:1.5em; text-align:left; }
@media (prefers-reduced-motion:reduce) {
  .summary-loading .loading-dots::after { animation:none; content:"..."; }
}
