:root {
  color-scheme: light;
  --bg: #f8f8fb;
  --surface: #ffffff;
  --surface-2: #f4f5f8;
  --border: #ececf1;
  --border-strong: #e0e1e8;
  --text: #1f2329;
  --text-sub: #495057;
  --text-dim: #9a9fa8;
  --accent: #4263eb;
  --accent-soft: #edf0fe;
  --positive: #2f9e44;
  --positive-soft: #ebfbee;
  --negative: #e03131;
  --negative-soft: #fff5f5;
  --warn: #f08c00;
  --warn-soft: #fff4e6;
  --radius: 16px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  display: flex;
}

/* ===== Sidebar ===== */
.sidebar {
  width: 230px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 16px;
  border-bottom: 1px solid var(--border);
}
.brand-logo {
  height: 26px;
  width: auto;
  /* 원본 로고가 흰색이라 밝은 사이드바에서 보이도록 검정으로 반전 */
  filter: invert(1);
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-section {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 12px 8px;
}
/* 앞 그룹의 마지막 메뉴와 붙어 보여서 구분선 역할을 하는 여백을 준다
   (첫 섹션은 사이드바 상단 여백이 이미 있어 제외) */
.nav-item + .nav-section { margin-top: 28px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-sub);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item.disabled { color: var(--text-dim); cursor: not-allowed; }
.nav-item.disabled:hover { background: transparent; color: var(--text-dim); }
.nav-icon, .nav-item svg.lucide {
  width: 16px; height: 16px;
  flex-shrink: 0;
  stroke-width: 1.8;
  opacity: 0.75;
}
.nav-item.active svg.lucide { opacity: 1; }
.nav-badge {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 6px;
  background: var(--warn-soft);
  color: var(--warn);
  border-radius: 6px;
  font-weight: 600;
}
.sidebar-foot {
  margin-top: auto;
  color: var(--text-dim);
  font-size: 11px;
  padding: 0 12px;
}

/* ===== App ===== */
.app { flex: 1; min-width: 0; }

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 28px 32px 20px;
  gap: 24px;
}
.topbar-eyebrow {
  color: var(--text-dim); font-size: 12px;
  font-weight: 500; margin-bottom: 6px;
}
.topbar h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.topbar-meta { display: flex; align-items: flex-end; gap: 12px; }
.topbar-meta-text { text-align: right; }
.meta-label { display: block; color: var(--text-dim); font-size: 11px; margin-bottom: 4px; }

.refresh-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: #fff;
  border: 0; border-radius: 999px;
  padding: 8px 14px;
  font-family: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  white-space: nowrap;
}
.refresh-btn:hover { background: #3651c8; transform: translateY(-1px); }
.refresh-btn:active { transform: translateY(0); }
.refresh-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.refresh-btn svg.lucide { width: 14px; height: 14px; stroke-width: 2.4; }
.refresh-btn svg { transition: transform 0.6s; }
.refresh-btn.spinning svg { transform: rotate(360deg); }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff;
  padding: 10px 18px; border-radius: 999px;
  font-size: 12px; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 200; opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(-4px); }
.meta-value {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--text-sub);
  font-variant-numeric: tabular-nums;
}

main {
  padding: 0 32px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* 카드는 main 이 아니라 뷰 래퍼(#summaryView, #newsView ...) 안에 있어서
   main 의 gap 이 카드 사이에는 적용되지 않는다. 여기서 따로 지정.
   뷰를 새로 추가할 때 빠뜨리지 않도록 ID 대신 main 의 직계 래퍼로 잡는다.
   :not([hidden]) — app.js 가 hidden 속성으로 뷰를 전환하므로 필수 */
main > div:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ===== KPI ===== */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid transparent;
  transition: border-color 0.15s, transform 0.15s;
}
.kpi-icon {
  position: absolute;
  top: 20px; right: 20px;
  width: 36px; height: 36px;
  background: var(--surface-2);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim);
}
.kpi-icon svg.lucide { width: 18px; height: 18px; stroke-width: 1.8; }
.kpi-card.accent .kpi-icon {
  background: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.92);
}
.kpi-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.kpi-card.accent { background: var(--accent); color: #fff; }
.kpi-card.accent .kpi-label,
.kpi-card.accent .kpi-sub { color: rgba(255, 255, 255, 0.75); }
.kpi-card.accent .kpi-value { color: #fff; }

.kpi-label {
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 500;
}
.kpi-value {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
/* 날짜는 32px 로 두면 카드 폭을 넘겨 두 줄로 접힌다 */
.kpi-value.kpi-date { font-size: 24px; letter-spacing: -0.02em; }
.kpi-sub { color: var(--text-dim); font-size: 11px; }

/* ===== Card ===== */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
}
.card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 20px;
}
.card h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.head-icon svg.lucide,
svg.lucide.head-icon {
  width: 18px; height: 18px;
  stroke-width: 1.8;
  color: var(--accent);
}
.hint { color: var(--text-dim); font-size: 12px; }

.chart-card .chart-wrap { height: 320px; position: relative; }
.chart-card .chart-wrap.chart-wrap-tall { height: 420px; }

.card-head-actions { display: flex; align-items: center; gap: 8px; }
.year-select {
  appearance: none;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 28px 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23495057' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.15s;
}
.year-select:hover { border-color: var(--border-strong); }
.year-select:focus { outline: none; border-color: var(--accent); }

/* ===== Table ===== */
.table-wrap { overflow-x: auto; margin: -4px; padding: 4px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left;
  padding: 12px 14px;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color 0.15s;
}
thead th:hover { color: var(--text); }
tbody td {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-sub);
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }

.store-link {
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
}
.store-link:hover { color: var(--accent); }

/* 이번 업데이트에서 새로 추가된 리뷰 표시 */
.new-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.6;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
.review-meta .new-badge { margin-left: 0; }

.bar { display: flex; align-items: center; gap: 10px; min-width: 140px; }
.bar-track {
  flex: 1;
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  min-width: 70px;
}
.bar-fill { height: 100%; border-radius: 999px; transition: width 0.3s; }
.bar-fill.positive { background: var(--positive); }
.bar-fill.negative { background: var(--negative); }
.bar-value {
  color: var(--text-sub);
  font-size: 12px;
  min-width: 42px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* ===== Modal ===== */
.modal {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal[hidden] { display: none; }
.modal-bg {
  position: absolute; inset: 0;
  background: rgba(31, 35, 41, 0.4);
  backdrop-filter: blur(4px);
}
.modal-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 640px;
  width: calc(100% - 32px);
  max-height: 84vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(31, 35, 41, 0.15);
}
.modal-close {
  position: absolute; top: 14px; right: 18px;
  background: transparent; border: 0;
  color: var(--text-dim);
  font-size: 26px; cursor: pointer; line-height: 1;
  transition: color 0.15s;
}
.modal-close:hover { color: var(--text); }
.modal h3 {
  margin: 0 0 20px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.review-section { margin-top: 24px; }
.review-section:first-of-type { margin-top: 0; }
.review-section-title {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.review-section-title.positive { color: var(--positive); }
.review-section-title.negative { color: var(--negative); }
.empty-msg { color: var(--text-dim); font-size: 12px; margin: 8px 0; }

.review-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 8px;
  background: var(--surface);
}
.review-item:last-child { margin-bottom: 0; }
.review-meta {
  display: flex; gap: 8px; align-items: center;
  color: var(--text-dim); font-size: 11px; margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}
.sentiment-tag {
  padding: 2px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.02em;
}
.sentiment-tag.positive { background: var(--positive-soft); color: var(--positive); }
.sentiment-tag.negative { background: var(--negative-soft); color: var(--negative); }
.sentiment-tag.neutral { background: var(--surface-2); color: var(--text-dim); }
.review-text {
  line-height: 1.6; font-size: 13px;
  white-space: pre-wrap; word-break: break-word;
  color: var(--text);
}

/* ===== 자동 답글 ===== */
.auto-reply-btn {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 10px;
  padding: 5px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  font-size: 11px; font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.auto-reply-btn:hover { background: var(--accent-soft); border-color: var(--accent); }
.auto-reply-btn.active { background: var(--accent-soft); border-color: var(--accent); }
.auto-reply-btn svg { width: 13px; height: 13px; }
.auto-reply-panel {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid #dbe2fd;
  animation: replyExpand 0.28s ease;
}
@keyframes replyExpand {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.auto-reply-head {
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--accent); margin-bottom: 6px;
  text-transform: uppercase;
}
.auto-reply-body {
  line-height: 1.65; font-size: 13px; color: var(--text);
  white-space: pre-wrap; word-break: break-word;
}
.auto-reply-copy {
  margin-top: 10px;
  padding: 4px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-sub);
  font-size: 11px; font-family: inherit; cursor: pointer;
}
.auto-reply-copy:hover { color: var(--accent); border-color: var(--accent); }
/* 분석 중 상태: 본문/복사 숨기고 펄스 표시 */
.auto-reply-panel.analyzing .auto-reply-body,
.auto-reply-panel.analyzing .auto-reply-copy { visibility: hidden; }
.auto-reply-panel.analyzing { position: relative; min-height: 44px; }
.auto-reply-panel.analyzing .auto-reply-head::after {
  content: ' · 분석 중…';
  font-weight: 500; text-transform: none; letter-spacing: 0;
  color: var(--text-dim);
  animation: replyPulse 1s ease-in-out infinite;
}
@keyframes replyPulse { 0%,100% { opacity: 0.4; } 50% { opacity: 1; } }

/* ===== 검색 순위 뷰 ===== */
.rank-store { margin-bottom: 22px; }
.rank-store:last-child { margin-bottom: 0; }
.rank-store-name {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 14px; color: var(--text);
  margin: 0 0 8px 2px;
}
.store-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.rank-table { width: 100%; border-collapse: collapse; }
.rank-table th {
  text-align: left; font-size: 11px; font-weight: 600; color: var(--text-dim);
  padding: 8px 12px; border-bottom: 1px solid var(--border);
}
.rank-table td {
  padding: 11px 12px; font-size: 13px; color: var(--text);
  border-bottom: 1px solid var(--border); vertical-align: middle;
}
.rank-table tr:last-child td { border-bottom: 0; }
.rank-table td b { font-size: 15px; font-weight: 700; }
.rank-kw { font-weight: 500; }
.rank-out { color: var(--text-dim); font-size: 12px; }
.rank-total { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.rank-chg { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rank-chg.up { color: var(--positive); }
.rank-chg.down { color: var(--negative); }
.rank-chg.flat { color: var(--text-dim); }
.spark { display: block; }
.spark-empty { color: var(--text-dim); font-size: 12px; }

/* ===== 뉴스 모니터링 뷰 ===== */
.scope-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
}
.scope-tabs {
  display: inline-flex;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.scope-tab {
  border: 0; background: transparent; cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--text-sub);
  padding: 7px 14px; border-radius: 8px;
  transition: background 0.12s, color 0.12s;
}
.scope-tab:hover { color: var(--text); }
.scope-tab.active { background: var(--surface); color: var(--accent); box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.news-month {
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
  color: var(--text-dim);
  padding: 14px 2px 8px;
  border-bottom: 1px solid var(--border);
}
.news-month:first-child { padding-top: 0; }
.news-item {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
  padding: 14px 12px;
  margin: 0 -12px;
  border-bottom: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.12s;
}
.news-item:hover { background: var(--surface-2); }
.news-item:last-child { border-bottom: 0; }
/* 사진 없는 기사도 같은 크기의 틀을 둬서 제목 시작선을 맞춘다 */
.news-thumb {
  flex-shrink: 0;
  width: 104px; height: 70px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.news-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* lucide 가 <i> 를 <svg> 로 갈아끼우므로 svg 를 잡아야 한다 */
.news-thumb svg { width: 20px; height: 20px; stroke-width: 1.5; color: var(--text-dim); opacity: 0.7; }
.news-item-main { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.news-title {
  font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.45;
}
.news-item:hover .news-title { color: var(--accent); }
.news-desc {
  font-size: 12px; color: var(--text-sub); line-height: 1.5;
  /* 요약은 2줄까지만 — 길이가 제각각이라 안 자르면 행 높이가 튄다 */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-item-meta {
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
  flex-shrink: 0; text-align: right;
}
.news-press { font-size: 12px; font-weight: 600; color: var(--text-sub); white-space: nowrap; }
/* 공식 채널 글 표시 — 외부 입소문과 자사 홍보를 목록에서 바로 구분하기 위함 */
.mention-badge {
  display: inline-block; vertical-align: 1px; margin-right: 6px;
  padding: 1px 6px; border-radius: 4px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.02em;
  color: var(--accent); background: var(--accent-soft);
}
.news-date { font-size: 11px; color: var(--text-dim); font-variant-numeric: tabular-nums; }

/* 목록 행의 댓글 감성 막대. 행 전체가 링크라 여기만 커서를 바꿔 눌러볼 수 있음을 알린다 */
.cmt-chip {
  display: inline-flex; flex-direction: column; align-items: flex-end; gap: 4px;
  margin-top: 2px;
  cursor: pointer;
  border-radius: 6px;
  padding: 3px 4px; margin-right: -4px;
  transition: background 0.12s;
}
.cmt-chip:hover { background: var(--accent-soft); }
.cmt-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cmt-bar {
  display: flex; width: 96px; height: 5px;
  border-radius: 999px; overflow: hidden;
  background: var(--surface-2);
}
.cmt-seg { display: block; height: 100%; }
.cmt-seg.positive { background: var(--positive); }
.cmt-seg.neutral { background: #adb5bd; }
.cmt-seg.negative { background: var(--negative); }
.cmt-num {
  font-size: 11px; color: var(--text-sub); font-weight: 600;
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
/* 모달 안 댓글 작성자 — 나머지 메타(날짜·좋아요)보다 한 단계 진하게 */
.cmt-author {
  color: var(--text-sub); font-weight: 600;
  max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ===== Empty / setup banner ===== */
.empty-banner {
  background: var(--accent-soft);
  border: 1px solid #d6dffc;
  border-radius: var(--radius);
  padding: 20px 24px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
}
.empty-banner strong { font-size: 14px; color: var(--accent); }
.empty-banner p { margin: 6px 0 8px; color: var(--text-sub); }
.empty-banner ol { margin: 0; padding-left: 20px; color: var(--text-sub); }
.empty-banner li { margin-bottom: 4px; }
.empty-banner code {
  background: rgba(66, 99, 235, 0.1);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 12px;
}

/* ===== Error banner ===== */
.error-banner {
  margin: 24px 32px;
  padding: 16px 20px;
  background: var(--negative-soft);
  border: 1px solid #ffd6d6;
  border-radius: var(--radius);
  color: var(--negative);
  font-size: 13px;
}
.error-banner code {
  background: rgba(0, 0, 0, 0.06);
  padding: 2px 6px; border-radius: 4px;
  font-size: 12px;
}

/* 유튜브 뷰만 KPI 5장 (댓글 긍정률 추가).
   5는 4처럼 화면 폭에 딱 나눠떨어지지 않아 고정 열 수를 못 쓴다 —
   들어가는 만큼 채우고 모자라면 다음 줄로 흘린다 */
.kpi-row.kpi-row-5 { grid-template-columns: repeat(auto-fit, minmax(208px, 1fr)); }

/* ===== Responsive ===== */
/* 5장이 한 줄에 안 들어가는 폭에서는 4+1 로 갈라져 마지막 한 장만 덩그러니 남는다.
   3+2 면 두 줄 다 차서 의도한 배치로 보인다 */
@media (max-width: 1400px) {
  .kpi-row.kpi-row-5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1100px) {
  .kpi-row,
  .kpi-row.kpi-row-5 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  body { display: block; }
  .sidebar {
    width: 100%; height: auto; position: static;
    flex-direction: row; align-items: center;
    padding: 16px 20px; gap: 16px;
    border-right: 0; border-bottom: 1px solid var(--border);
  }
  .brand { padding: 0; border: 0; flex-shrink: 0; }
  .nav { flex-direction: row; flex: 1; }
  .sidebar-foot { display: none; }
  .topbar { padding: 20px; }
  .topbar h1 { font-size: 18px; }
  main { padding: 0 20px 32px; gap: 16px; }
  main > div:not([hidden]) { gap: 16px; }
  .news-item { flex-wrap: wrap; gap: 12px; }
  .news-thumb { width: 76px; height: 56px; }
  .news-item-main { flex: 1 1 60%; }
  .news-item-meta {
    flex: 1 1 100%;
    flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px;
    text-align: left;
  }
  .cmt-chip { flex-direction: row; align-items: center; gap: 8px; margin-top: 0; }
}
