:root {
  --color-canvas: #f3f5f8;
  --color-surface: #ffffff;
  --color-surface-muted: #f7f8fa;
  --color-ink: #111318;
  --color-muted: #667085;
  --color-border: #dce1e8;
  --color-accent: #0868d7;
  --color-accent-soft: #e9f2ff;
  --color-success: #0e9f6e;
  --shadow-panel: 0 12px 34px rgba(17, 24, 39, 0.07);
  --radius-sm: 6px;
  --radius-md: 8px;
  --sidebar-width: 236px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  color: var(--color-ink);
  background: var(--color-canvas);
  font-family: Arial, "Noto Sans KR", sans-serif;
  line-height: 1.5;
  letter-spacing: 0;
}
button, input { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  z-index: 10;
}
.brand { color: inherit; text-decoration: none; display: grid; gap: 2px; margin-bottom: 42px; }
.brand-mark { font-weight: 900; font-size: 17px; }
.brand-product { color: var(--color-muted); font-size: 10px; font-weight: 700; }
.primary-nav { display: grid; gap: 6px; }
.nav-item {
  min-height: 44px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #344054;
  background: transparent;
  border: 0;
  border-radius: var(--radius-md);
  text-align: left;
  font-weight: 700;
}
.nav-item:hover, .nav-item:focus-visible { background: var(--color-surface-muted); }
.nav-item.is-active { color: var(--color-accent); background: var(--color-accent-soft); box-shadow: inset 3px 0 0 var(--color-accent); }
.nav-item span { min-width: 24px; padding: 1px 6px; border-radius: 999px; background: #fff; text-align: center; font-size: 11px; }
.sidebar-status { margin-top: auto; padding-top: 20px; border-top: 1px solid var(--color-border); display: flex; gap: 10px; align-items: flex-start; }
.sidebar-status div { display: grid; gap: 2px; font-size: 12px; }
.sidebar-status span { color: var(--color-muted); }
.status-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: #f0a202; box-shadow: 0 0 0 4px #fff3d6; flex: 0 0 auto; }
.main-content { margin-left: var(--sidebar-width); padding: 30px; max-width: 1740px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 5px; color: #52637a; font-family: Consolas, monospace; font-size: 11px; font-weight: 700; letter-spacing: 2px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: 34px; line-height: 1.15; }
h2 { margin-bottom: 0; font-size: 21px; }
h3 { font-size: 16px; }
.page-description { margin-bottom: 0; color: var(--color-muted); font-size: 14px; }
.header-meta { display: flex; align-items: center; gap: 14px; color: var(--color-muted); font-size: 12px; }
.button { min-height: 42px; padding: 0 16px; border-radius: var(--radius-md); border: 1px solid var(--color-border); background: var(--color-surface); font-weight: 700; }
.button-primary { color: #fff; border-color: var(--color-ink); background: var(--color-ink); }
.button:hover, .button:focus-visible { transform: translateY(-1px); }
.control-band, .view-panel { padding: 20px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); box-shadow: var(--shadow-panel); }
.control-band { margin-bottom: 18px; }
.source-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 14px; border-bottom: 1px solid var(--color-border); }
.source-tab { min-height: 38px; padding: 0 13px; white-space: nowrap; color: #475467; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 999px; font-weight: 700; }
.source-tab span { color: #98a2b3; margin-left: 3px; }
.source-tab.is-active { color: #fff; border-color: var(--color-ink); background: var(--color-ink); }
.source-tab.is-active span { color: #d0d5dd; }
.filter-row { display: flex; justify-content: space-between; gap: 16px; padding-top: 14px; }
.segmented-control { display: inline-flex; padding: 3px; background: var(--color-surface-muted); border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.segmented-control button { min-width: 58px; min-height: 34px; border: 0; border-radius: var(--radius-sm); color: var(--color-muted); background: transparent; }
.segmented-control button.is-active { color: var(--color-ink); background: #fff; box-shadow: 0 1px 4px rgba(16, 24, 40, 0.12); font-weight: 700; }
.search-field { flex: 0 1 340px; }
.search-field input { width: 100%; min-height: 42px; padding: 0 13px; border: 1px solid var(--color-border); border-radius: var(--radius-md); outline: none; }
.search-field input:focus { border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-soft); }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-heading > span { color: var(--color-muted); font-size: 12px; }
.trend-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.trend-card { min-width: 0; overflow: hidden; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: #fff; }
.trend-media { position: relative; aspect-ratio: 4 / 3; background: #edf0f4; overflow: hidden; }
.trend-media img { width: 100%; height: 100%; display: block; object-fit: cover; }
.source-badge { position: absolute; top: 10px; left: 10px; padding: 4px 8px; color: #fff; background: rgba(17, 19, 24, 0.82); border-radius: 999px; font-size: 10px; font-weight: 700; }
.trend-body { padding: 14px; }
.trend-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--color-muted); font-size: 11px; }
.trend-card h3 { min-height: 48px; margin: 8px 0 10px; font-size: 16px; line-height: 1.45; }
.tag-list, .keyword-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-list span, .keyword-list span { padding: 4px 8px; color: #475467; background: var(--color-surface-muted); border: 1px solid var(--color-border); border-radius: 999px; font-size: 10px; }
.card-actions { display: flex; gap: 7px; margin-top: 14px; }
.card-actions button, .card-actions a { min-height: 36px; padding: 0 11px; display: inline-flex; align-items: center; justify-content: center; color: var(--color-ink); text-decoration: none; background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-sm); font-size: 12px; font-weight: 700; }
.card-actions button.is-saved { color: var(--color-accent); border-color: #9cc7fa; background: var(--color-accent-soft); }
.empty-state { min-height: 380px; display: grid; place-items: center; align-content: center; text-align: center; padding: 32px; }
.empty-state[hidden], .sample-notice[hidden] { display: none; }
.empty-symbol { width: 56px; height: 56px; margin-bottom: 16px; display: grid; place-items: center; color: #fff; background: var(--color-ink); border-radius: var(--radius-md); font-weight: 900; }
.empty-state h3 { margin-bottom: 6px; }
.empty-state p { max-width: 480px; margin-bottom: 18px; color: var(--color-muted); }
.sample-notice { position: fixed; right: 20px; bottom: 20px; z-index: 30; padding: 10px 14px; color: #fff; background: #344054; border-radius: var(--radius-sm); font-size: 12px; box-shadow: var(--shadow-panel); }
.report-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; }
.report-lead, .report-panel { padding: 22px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface-muted); }
.report-lead h3 { max-width: 620px; margin-bottom: 10px; font-size: 24px; line-height: 1.3; }
.report-lead > p:last-child { margin-bottom: 0; color: var(--color-muted); }
.report-panel h3 { margin-bottom: 16px; }
.source-breakdown { display: grid; gap: 10px; }
.source-row { display: grid; grid-template-columns: 72px 1fr 28px; align-items: center; gap: 8px; color: var(--color-muted); font-size: 11px; }
.source-bar { height: 7px; overflow: hidden; background: #e4e7ec; border-radius: 999px; }
.source-bar i { display: block; height: 100%; background: var(--color-accent); border-radius: inherit; }

@media (max-width: 1180px) { .trend-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .report-grid { grid-template-columns: 1fr 1fr; } .report-lead { grid-column: 1 / -1; } }
@media (max-width: 820px) {
  .sidebar { position: static; width: auto; min-height: auto; padding: 18px; border-right: 0; border-bottom: 1px solid var(--color-border); }
  .brand { margin-bottom: 16px; }
  .primary-nav { display: flex; overflow-x: auto; }
  .nav-item { flex: 0 0 auto; min-width: 110px; }
  .sidebar-status { display: none; }
  .main-content { margin-left: 0; padding: 18px; }
  .page-header, .filter-row { align-items: stretch; flex-direction: column; }
  .header-meta { justify-content: space-between; }
  .search-field { flex-basis: auto; }
  .trend-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .main-content { padding: 12px; }
  h1 { font-size: 28px; }
  .page-description { font-size: 13px; }
  .header-meta { align-items: stretch; flex-direction: column; }
  .control-band, .view-panel { padding: 14px; }
  .segmented-control { width: 100%; }
  .segmented-control button { flex: 1; min-width: 0; }
  .trend-grid, .report-grid { grid-template-columns: 1fr; }
  .trend-card h3 { min-height: auto; }
  .report-lead { grid-column: auto; }
}
