:root {
  --navy: #172033;
  --navy-soft: #25314a;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --green: #16a34a;
  --green-soft: #ecfdf3;
  --red: #dc2626;
  --text: #182033;
  --muted: #687386;
  --line: #e5e9f0;
  --surface: #ffffff;
  --background: #f5f7fa;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: var(--background);
  font-family: Pretendard, "Noto Sans KR", "Malgun Gothic", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
}

.dashboard-mobile-header,
.mobile-global-navigation,
.mobile-report-tabs,
.sidebar-backdrop {
  display: none;
}

.primary-report-actions,
.mobile-more-actions,
.mobile-more-content {
  display: contents;
}

.mobile-more-actions > summary {
  display: none;
}

@media (min-width: 769px) {
  #review-points-button { order: 1; }
  #excel-export-button { order: 2; }
  #pdf-export-button { order: 3; }
  #admin-page-button { order: 4; }
  #supabase-save-open { order: 5; }
  #upload-data-link { order: 6; }
  #reset-demo { order: 7; }
  .topbar-actions .report-period { order: 8; }
}

.dashboard {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  display: flex;
  width: 254px;
  flex-direction: column;
  padding: 28px 20px 22px;
  color: #e8edf7;
  background: var(--navy);
}

.brand {
  display: flex;
  min-height: 76px;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: inherit;
  text-decoration: none;
}

.brand:hover strong,
.brand:focus-visible strong {
  color: #ffffff;
}

.brand:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.9);
  outline-offset: 4px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 12px;
  color: var(--navy);
  background: #ffffff;
  font-size: 18px;
  font-weight: 800;
  object-fit: cover;
}

.brand div,
.sidebar-footer div {
  display: flex;
  flex-direction: column;
}

.brand .brand-copy {
  min-width: 0;
  flex: 1 1 auto;
  justify-content: center;
  gap: 2px;
}

.brand strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
}

.brand span:not(.brand-mark),
.sidebar-footer span {
  color: #9ba8be;
  font-size: 12px;
}

.brand .brand-description {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: normal;
  word-break: keep-all;
  line-break: strict;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.navigation {
  flex: 1;
  padding-top: 24px;
  overflow-y: auto;
}

.nav-label {
  margin: 0 10px 10px;
  color: #76849c;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.nav-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 11px;
  margin-bottom: 4px;
  padding: 11px 12px;
  border: 0;
  border-radius: 9px;
  color: #b9c3d4;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
}

.nav-item.active {
  color: #ffffff;
  background: var(--navy-soft);
  font-weight: 700;
}

.nav-item:focus-visible {
  outline: 2px solid #8bb7ff;
  outline-offset: 2px;
}

.nav-icon {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 7px;
  color: #8996aa;
  font-size: 9px;
  font-weight: 700;
}

.nav-item.active .nav-icon {
  border-color: #4775c9;
  color: #bfdbfe;
  background: #2d5fae;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer strong {
  color: #dce3ef;
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #37d477;
  box-shadow: 0 0 0 4px rgba(55, 212, 119, 0.12);
}

.main {
  min-width: 0;
  margin-left: 254px;
}

.topbar {
  display: flex;
  min-height: 108px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 30px;
  padding: 23px 38px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.3;
  letter-spacing: -0.04em;
}

.report-period {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.report-period span {
  color: var(--muted);
  font-size: 11px;
}

.report-period strong {
  margin-top: 2px;
  font-size: 13px;
}

.topbar-actions {
  display: flex;
  min-width: 0;
  align-items: flex-end;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.report-picker {
  display: flex;
  flex: 1 1 245px;
  flex-direction: column;
  gap: 3px;
  min-width: 245px;
  max-width: 360px;
}

.report-picker span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.report-picker select {
  width: 100%;
  min-height: 38px;
  padding: 7px 30px 7px 10px;
  border: 1px solid #d7dde7;
  border-radius: 7px;
  color: #344054;
  background: #fff;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
}

.report-status-badge {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  padding: 7px 9px;
  border-radius: 7px;
  color: #667085;
  background: #f0f2f5;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.report-status-badge.published { color: #16733a; background: var(--green-soft); }
.report-status-badge.reviewed { color: #2458b6; background: var(--blue-soft); }
.report-status-badge.draft { color: #9a5b00; background: #fff7e7; }
.report-status-badge.archived { color: #667085; background: #eceff3; }

.data-state-badge {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid #cfe0ff;
  border-radius: 7px;
  color: #2458b6;
  background: var(--blue-soft);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.topbar-button,
.button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 7px 11px;
  border: 1px solid #d7dde7;
  border-radius: 7px;
  color: #536074;
  background: #fff;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.topbar-button:hover,
.button:hover {
  border-color: #aeb9c9;
  background: #f8fafc;
}

.topbar-button.primary,
.primary-button {
  border-color: var(--blue);
  color: #fff;
  background: var(--blue);
}

.topbar-button.primary:hover,
.primary-button:hover {
  border-color: #1d4ed8;
  background: #1d4ed8;
}

.topbar-button:disabled {
  opacity: 0.58;
  cursor: wait;
}

.export-pdf-stage {
  position: absolute;
  z-index: 10000;
  top: 0;
  left: 0;
  width: 192mm;
  pointer-events: none;
}

.export-pdf-root {
  position: relative;
  width: 192mm;
  min-height: 0;
  margin: 0;
  padding: 34px;
  box-sizing: border-box;
  color: #172033;
  background: #fff;
  font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 11px;
  line-height: 1.5;
}

.export-pdf-root * {
  box-sizing: border-box;
}

.export-pdf-header {
  padding-bottom: 20px;
  border-bottom: 2px solid #1f5cc4;
}

.export-pdf-header > p {
  margin: 0 0 7px;
  color: #1f5cc4;
  font-size: 11px;
  font-weight: 800;
}

.export-pdf-header h1 {
  margin: 0;
  color: #13274b;
  font-size: 24px;
}

.export-pdf-header dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 18px 0 0;
}

.export-pdf-header dl div {
  padding: 10px 12px;
  border-radius: 7px;
  background: #f4f7fc;
}

.export-pdf-header dt {
  color: #667085;
  font-size: 9px;
}

.export-pdf-header dd {
  margin: 3px 0 0;
  font-weight: 800;
}

.export-pdf-section {
  margin-top: 22px;
}

.export-pdf-section h2 {
  margin: 0 0 10px;
  color: #13274b;
  font-size: 15px;
}

.export-pdf-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.export-pdf-kpis div {
  min-height: 70px;
  padding: 12px;
  border: 1px solid #dfe6f1;
  border-radius: 8px;
  background: #fafcff;
}

.export-pdf-kpis span {
  display: block;
  color: #667085;
  font-size: 9px;
}

.export-pdf-kpis strong {
  display: block;
  margin-top: 8px;
  color: #163c7a;
  font-size: 16px;
}

.export-pdf-chart-caption {
  margin: -6px 0 4px;
  color: #667085;
  font-size: 9px;
}

.export-pdf-chart {
  display: block;
  width: 100%;
  height: 210px;
  border: 1px solid #e4e9f1;
  border-radius: 8px;
  background: #fff;
}

.export-pdf-chart line {
  stroke: #c9d3e2;
  stroke-width: 1;
}

.export-pdf-chart polyline {
  fill: none;
  stroke: #1f6feb;
  stroke-width: 3;
}

.export-pdf-chart circle {
  fill: #1f6feb;
}

.export-pdf-chart text {
  fill: #667085;
  font-size: 9px;
}

.export-pdf-root table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

.export-pdf-root thead {
  display: table-header-group;
  break-inside: avoid;
  page-break-inside: avoid;
}

.export-pdf-root tr {
  break-inside: avoid;
  page-break-inside: avoid;
}

.export-pdf-root th,
.export-pdf-root td {
  padding: 7px 6px;
  border: 1px solid #dfe5ee;
  text-align: right;
  word-break: keep-all;
}

.export-pdf-root th {
  color: #344054;
  background: #eef3fa;
  font-size: 9px;
}

.export-pdf-root th:first-child,
.export-pdf-root td:first-child,
.export-pdf-root th:nth-child(2),
.export-pdf-root td:nth-child(2) {
  text-align: left;
}

.export-pdf-root footer {
  margin-top: 22px;
  padding-top: 9px;
  border-top: 1px solid #dfe5ee;
  color: #7b8798;
  font-size: 8px;
}

.export-pdf-insight-list {
  display: grid;
  gap: 9px;
}

.export-pdf-insight-card {
  padding: 12px 14px;
  border: 1px solid #dfe6f1;
  border-left: 3px solid #2f6fed;
  border-radius: 7px;
  background: #f8fbff;
}

.export-pdf-insight-card h3 {
  margin: 0 0 6px;
  color: #19345f;
  font-size: 11px;
}

.export-pdf-insight-card p,
.export-pdf-insight-card ul,
.export-pdf-insight-card ol {
  margin: 0;
  color: #35435a;
  font-size: 9px;
  line-height: 1.65;
}

.export-pdf-insight-card ul,
.export-pdf-insight-card ol {
  padding-left: 17px;
}

.export-pdf-keep {
  break-inside: avoid;
  page-break-inside: avoid;
}

@page {
  size: A4 portrait;
  margin: 9mm;
}

.topbar-actions .report-period {
  min-width: 172px;
  margin-left: 8px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.client-info {
  display: flex;
  gap: 0;
  padding: 15px 38px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.client-info > div {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 185px;
  padding-right: 28px;
  margin-right: 28px;
  border-right: 1px solid var(--line);
}

.client-info > div:last-child {
  border-right: 0;
}

.client-info span {
  color: var(--muted);
  font-size: 12px;
}

.client-info strong {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.naver-badge,
.platform-badge {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 4px;
  color: #fff;
  background: #03cf5d;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.platform-badge.meta {
  background: #0766ff;
}

.platform-badge.naver {
  border: 1px solid rgba(0, 107, 49, 0.22);
  color: #06351b;
  background: #03cf5d;
}

.platform-badge.danggeun {
  background: #eb8717;
}

.platform-info {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.content {
  width: 100%;
  max-width: none;
  padding: 31px 38px 50px;
}

.report-section {
  animation: section-in 0.24s ease;
}

@keyframes section-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 23px;
}

.section-heading h2 {
  margin-bottom: 5px;
  font-size: 25px;
  line-height: 1.35;
  letter-spacing: -0.04em;
}

.section-heading p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.data-label {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid #d9e0ea;
  border-radius: 6px;
  color: #7a8597;
  background: #ffffff;
  font-size: 10px;
  font-weight: 700;
}

.data-label.approved {
  border-color: #b9e7ca;
  color: #16803c;
  background: var(--green-soft);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.summary-metric-grid {
  grid-auto-rows: auto;
  align-items: stretch;
}

.metric-card {
  min-height: 132px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.summary-metric-grid .metric-card {
  display: flex;
  min-width: 0;
  min-height: 146px;
  height: 100%;
  flex-direction: column;
  padding: 17px 16px;
}

.summary-metric-grid .metric-card > strong {
  margin: 14px 0 6px;
}

.summary-metric-grid .metric-card > small {
  display: block;
  margin-top: auto;
  line-height: 1.4;
}

.metric-card.primary {
  border-top: 3px solid var(--blue);
  padding-top: 16px;
}

.metric-card.highlight {
  border-color: #c9dafd;
  background: var(--blue-soft);
}

.metric-top {
  display: flex;
  min-height: 22px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #5e697b;
  font-size: 12px;
  font-weight: 600;
}

.metric-top > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.kpi-label-note {
  font-size: 0.8em;
  font-weight: 500;
  color: var(--muted);
  white-space: normal;
}

.metric-card > strong {
  display: block;
  margin: 13px 0 4px;
  color: #151c2b;
  font-size: 23px;
  line-height: 1.2;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}

.metric-card > strong.metric-value-long {
  font-size: 20px;
}

.metric-card > strong.metric-value-xlong {
  font-size: 17px;
}

.metric-card small {
  color: #8a94a5;
  font-size: 11px;
}

.mobile-secondary-metrics,
.secondary-metric-grid {
  display: contents;
}

.mobile-secondary-metrics > summary {
  display: none;
}

.metrics-collapse-label {
  display: none;
}

.trend {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}

.trend.up {
  border-color: #86d9a4;
  color: #087a35;
  background: #dcfce7;
}

.trend.down {
  border-color: #f2aa9f;
  color: #b42318;
  background: #fff0ed;
}

.trend.neutral {
  border-color: #cbd3df;
  color: #4e596b;
  background: #edf1f6;
}

.trend.positive {
  border-color: #86d9a4;
  color: #087a35;
  background: #dcfce7;
}

.trend.negative {
  border-color: #f2aa9f;
  color: #b42318;
  background: #fff0ed;
}

.metric-help {
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border: 1px solid #d9dee7;
  border-radius: 50%;
  color: #8d96a5;
  font-size: 9px;
}

.summary-row {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 12px;
  margin-top: 12px;
}

.panel,
.table-panel,
.comment-card,
.chart-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.chart-panel {
  margin-bottom: 12px;
  overflow: hidden;
}

.metric-grid + .chart-panel {
  margin-top: 12px;
}

.change-summary-panel {
  margin-top: 12px;
}

.change-summary-panel ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0 0 0 20px;
  color: #4f5d71;
  font-size: 13px;
  line-height: 1.65;
}

.budget-panel {
  margin-top: 12px;
}

.dashboard-alert,
.currency-notice {
  margin-bottom: 14px;
  padding: 13px 15px;
  border: 1px solid #d8e3f5;
  border-radius: 10px;
  color: #536074;
  background: #f8fbff;
  font-size: 12px;
}

.dashboard-alert.error {
  border-color: #f2c9c5;
  color: #a5372d;
  background: #fff6f5;
}

.currency-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 12px;
}

.currency-notice strong {
  color: #263246;
}

.currency-notice small {
  width: 100%;
  color: #7b8799;
}

.comment-card.placeholder-copy {
  display: block;
}

.report-insights-section {
  margin-top: 28px;
  padding: 24px;
  border: 1px solid #d8e2f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgb(29 51 84 / 7%);
  scroll-margin-top: 20px;
}

.summary-insights-shortcut {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  padding: 8px 14px;
  border: 1px solid #a9c2f3;
  border-radius: 9px;
  color: #235fc9;
  background: #f4f7ff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.summary-insights-shortcut[hidden] {
  display: none;
}

.summary-insights-shortcut:hover,
.summary-insights-shortcut:focus-visible {
  border-color: #2f6fed;
  outline: none;
  box-shadow: 0 0 0 3px rgb(47 111 237 / 12%);
}

.report-insights-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 17px;
  border-bottom: 1px solid #e5eaf2;
}

.report-insights-heading h2 {
  margin: 2px 0 5px;
  color: #182844;
  font-size: 22px;
  letter-spacing: -0.035em;
}

.report-insights-heading p:last-child {
  margin: 0;
  color: #68758a;
  font-size: 12px;
}

.report-insights-status-wrap {
  display: grid;
  justify-items: end;
  gap: 5px;
  text-align: right;
}

.report-insights-status-wrap small {
  max-width: 250px;
  color: #6f7b8e;
  font-size: 10px;
  line-height: 1.4;
}

.report-insights-status {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid #cfd8e6;
  border-radius: 999px;
  color: #58677e;
  background: #f4f6f9;
  font-size: 11px;
  font-weight: 800;
}

.report-insights-status.published {
  border-color: #91d4ab;
  color: #17643a;
  background: #eaf9f0;
}

.report-insights-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 13px 0 0;
  color: #748095;
  font-size: 11px;
}

.report-insights-meta strong {
  margin-left: 4px;
  color: #344158;
}

.report-insights-form {
  margin-top: 18px;
}

.report-insights-fields,
.report-insights-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.report-insight-field {
  min-width: 0;
  color: #2b3850;
  font-size: 12px;
  font-weight: 800;
}

.report-insight-editor {
  display: grid;
  gap: 7px;
}

.report-insight-field textarea {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  padding: 12px 13px;
  border: 1px solid #ccd6e4;
  border-radius: 9px;
  color: #202c40;
  background: #fbfcfe;
  font: inherit;
  font-weight: 500;
  line-height: 1.65;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.report-insight-field textarea:focus {
  outline: none;
  border-color: #2f6fed;
  box-shadow: 0 0 0 3px rgb(47 111 237 / 13%);
}

.report-insight-field textarea.invalid {
  border-color: #d92d20;
  box-shadow: 0 0 0 3px rgb(217 45 32 / 11%);
}

.report-insight-field small {
  color: #8490a2;
  font-size: 9px;
  font-weight: 500;
}

.report-insights-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 14px;
}

.report-insights-actions button {
  min-width: 112px;
  min-height: 42px;
  padding: 8px 15px;
  border: 1px solid #cbd5e2;
  border-radius: 8px;
  color: #334158;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.report-insights-actions .primary-button {
  border-color: #2f6fed;
  color: #fff;
  background: #2f6fed;
}

.report-insights-actions .ai-button {
  border-color: #8fb2f7;
  color: #1f5fd2;
  background: #eef4ff;
}

.report-insights-actions .ai-button:hover,
.report-insights-actions .ai-button:focus-visible {
  border-color: #2f6fed;
  box-shadow: 0 0 0 3px rgb(47 111 237 / 12%);
}

.report-insights-actions button:disabled {
  opacity: 0.62;
  cursor: wait;
}

.report-insights-actions button.loading::before {
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 7px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  content: "";
  vertical-align: -2px;
  animation: insight-spin 0.7s linear infinite;
}

@keyframes insight-spin {
  to { transform: rotate(360deg); }
}

.report-insights-message {
  min-height: 20px;
  margin: 13px 0 0;
  color: #68758a;
  font-size: 11px;
  text-align: right;
}

.report-insights-message.error,
.report-insights-error {
  color: #b42318;
}

.report-insights-message.success {
  color: #16733d;
}

.report-insights-loading,
.report-insights-error {
  padding: 20px;
  border-radius: 9px;
  background: #f7f9fc;
  font-size: 12px;
  text-align: center;
}

.report-insight-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid #dfe6f1;
  border-left: 4px solid #2f6fed;
  border-radius: 10px;
  background: #f9fbff;
}

.report-insight-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #20375f;
  cursor: pointer;
  list-style: none;
}

.report-insight-card summary::-webkit-details-marker {
  display: none;
}

.report-insight-card summary::after {
  flex: 0 0 auto;
  color: #65748b;
  content: "접기";
  font-size: 10px;
  font-weight: 700;
}

.report-insight-card:not([open]) summary::after {
  content: "펼치기";
}

.report-insight-card[open] summary {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e3e9f2;
}

.report-insights-cards {
  margin-top: 18px;
}

.report-insight-card h3 {
  margin: 0;
  color: #20375f;
  font-size: 14px;
}

.report-insight-copy p,
.report-insight-copy ul,
.report-insight-copy ol {
  margin: 0;
  color: #3f4d63;
  font-size: 12px;
  line-height: 1.75;
}

.report-insight-copy p + p,
.report-insight-copy p + ul,
.report-insight-copy p + ol,
.report-insight-copy ul + p,
.report-insight-copy ol + p {
  margin-top: 8px;
}

.report-insight-copy ul,
.report-insight-copy ol {
  padding-left: 20px;
}

.placeholder-copy .comment-body {
  min-height: 180px;
}

.load-error {
  max-width: 720px;
  margin: 60px auto;
  padding: 45px 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-align: center;
  box-shadow: var(--shadow);
}

.load-error-mark {
  display: grid;
  width: 44px;
  height: 44px;
  margin: 0 auto 16px;
  place-items: center;
  border-radius: 50%;
  color: #b42318;
  background: #fff0ee;
  font-size: 20px;
  font-weight: 800;
}

.load-error h2 {
  margin-bottom: 8px;
}

.load-error p {
  color: var(--muted);
}

.error-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 19px 22px 0;
}

.chart-header h3 {
  margin-bottom: 3px;
  font-size: 15px;
}

.chart-header p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 11px;
}

.chart-unit {
  flex: 0 0 auto;
  color: #7f8999;
  font-size: 10px;
}

.chart-note {
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin: 12px 22px 0;
  padding: 5px 8px;
  border-radius: 6px;
  color: #58667b;
  background: #f1f5f9;
  font-size: 10px;
}

.chart-note span {
  display: grid;
  width: 14px;
  height: 14px;
  place-items: center;
  border: 1px solid #aeb8c8;
  border-radius: 50%;
  font-size: 8px;
  font-weight: 800;
}

.chart-wrap {
  position: relative;
  width: 100%;
  min-height: 270px;
  padding: 10px 14px 14px;
}

.chart-wrap-horizontal {
  min-height: 350px;
}

.chart-wrap canvas {
  display: block;
  width: 100%;
  height: 246px;
}

.chart-wrap[data-chart^="danggeun-hour-"] {
  min-height: 306px;
  padding-top: 14px;
}

.chart-wrap[data-chart^="danggeun-hour-"] canvas {
  height: 278px;
}

.chart-tooltip {
  position: absolute;
  z-index: 3;
  display: grid;
  min-width: 130px;
  gap: 2px;
  padding: 9px 11px;
  border: 1px solid #dce3ed;
  border-radius: 8px;
  color: #5f6b7c;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 8px 24px rgba(23, 32, 51, 0.13);
  font-size: 10px;
  pointer-events: none;
}

.chart-tooltip strong {
  color: #253044;
  font-size: 11px;
}

.chart-tooltip b {
  color: var(--blue);
  font-size: 12px;
}

.chart-tooltip[hidden] {
  display: none;
}

.chart-wrap canvas[hidden] {
  display: none;
}

.chart-wrap-horizontal canvas {
  height: 326px;
}

.chart-empty {
  display: grid;
  min-height: 220px;
  margin: 0;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.chart-empty[hidden] {
  display: none;
}

.panel {
  min-height: 190px;
  padding: 23px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.panel-title {
  margin-bottom: 5px;
  font-weight: 700;
}

.panel-heading p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}

.panel-heading > strong {
  color: var(--blue);
  font-size: 23px;
}

.progress-track {
  height: 10px;
  margin: 30px 0 9px;
  overflow: hidden;
  border-radius: 99px;
  background: #e9edf4;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}

.insight-panel {
  border-color: #d9e4fa;
  background: linear-gradient(135deg, #f8fbff 0%, #ffffff 75%);
}

.insight-label {
  display: inline-block;
  margin-bottom: 15px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
}

.insight-panel h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

.insight-panel p {
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 12px;
}

.text-link {
  padding: 0;
  border: 0;
  color: var(--blue);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.text-link:hover {
  text-decoration: underline;
}

.table-panel {
  overflow: hidden;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 19px 22px;
  border-bottom: 1px solid var(--line);
}

.table-header h3 {
  margin-bottom: 0;
  font-size: 15px;
}

.table-header span {
  color: var(--muted);
  font-size: 11px;
}

.table-scroll {
  overflow-x: auto;
}

@media (min-width: 769px) {
  .responsive-fit-panel {
    container-type: inline-size;
  }

  .responsive-fit-panel > .table-scroll {
    overflow-x: clip;
  }

  .responsive-fit-panel table {
    min-width: 0;
    table-layout: fixed;
    white-space: normal;
  }

  .responsive-fit-panel th,
  .responsive-fit-panel td {
    padding: clamp(8px, 0.7cqw, 13px) clamp(3px, 0.45cqw, 8px);
    font-size: clamp(8px, 0.68cqw, 11px);
    line-height: 1.35;
  }

  .responsive-fit-panel .fit-primary-column {
    width: 17%;
  }

  .responsive-fit-panel .fit-dimension-column {
    width: 18%;
  }

  .responsive-fit-panel th:nth-child(-n + 3),
  .responsive-fit-panel td:nth-child(-n + 3) {
    overflow-wrap: anywhere;
    text-align: left;
    word-break: keep-all;
  }

  .responsive-fit-panel th:nth-child(n + 4),
  .responsive-fit-panel td:nth-child(n + 4) {
    overflow-wrap: anywhere;
    letter-spacing: -0.035em;
    white-space: normal;
  }

  .responsive-fit-panel .table-sort-button {
    gap: 2px;
    white-space: normal;
  }
}

.mobile-performance-list {
  display: none;
}

table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  white-space: nowrap;
}

th,
td {
  padding: 15px 19px;
  border-bottom: 1px solid #edf0f4;
  text-align: right;
}

th {
  color: #788395;
  background: #fafbfc;
  font-size: 11px;
  font-weight: 700;
}

.table-sort-button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: inherit;
}

.table-sort-button:hover,
.table-sort-button.active {
  color: #245fba;
}

.table-sort-button.active {
  font-weight: 800;
}

.table-sort-button span {
  min-width: 9px;
  font-size: 10px;
  opacity: 0.7;
}

.table-sort-button.active span {
  opacity: 1;
}

.result-count-note {
  margin: 10px 0;
  color: #68758a;
  font-size: 12px;
}

.analysis-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.analysis-subtab {
  padding: 8px 13px;
  border: 1px solid #d9e0ea;
  border-radius: 999px;
  color: #5d697c;
  background: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.analysis-subtab:hover,
.analysis-subtab.active {
  border-color: #2f6feb;
  color: #245fba;
  background: #eef4ff;
}

.analysis-empty-detail {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #e2e7ef;
  border-radius: 10px;
  color: #68758a;
  background: #f8fafc;
  font-size: 12px;
}

.analysis-empty-detail p {
  margin: 0;
}

th:first-child,
td:first-child {
  text-align: left;
}

td {
  color: #4f5a6c;
  font-size: 12px;
}

td strong {
  color: #222b3b;
  font-weight: 700;
}

tbody tr:hover {
  background: #fafcff;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tfoot td {
  border-top: 1px solid #dbe1e9;
  border-bottom: 0;
  color: #1c2637;
  background: #f6f8fb;
  font-weight: 800;
}

.best-row {
  background: #f7fbff;
}

.best-badge {
  display: inline-block;
  margin-left: 7px;
  padding: 2px 5px;
  border-radius: 4px;
  color: var(--blue);
  background: #e2ecff;
  font-size: 8px;
  font-weight: 800;
  vertical-align: middle;
}

.comment-card {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  padding: 0;
  overflow: hidden;
}

.comment-profile {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 28px;
  background: #f8fafc;
}

.avatar {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--navy);
  font-weight: 800;
}

.comment-profile div {
  display: flex;
  flex-direction: column;
}

.comment-profile strong {
  margin-top: 2px;
}

.comment-profile div span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.comment-body {
  padding: 34px 38px;
}

.comment-body h3 {
  margin-bottom: 18px;
  font-size: 20px;
  line-height: 1.45;
  letter-spacing: -0.03em;
}

.comment-body > p {
  max-width: 900px;
  margin-bottom: 14px;
  color: #5d687a;
  line-height: 1.8;
}

.comment-highlight {
  margin-top: 25px;
  padding: 18px 20px;
  border-left: 3px solid var(--blue);
  background: var(--blue-soft);
}

.comment-highlight span {
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
}

.comment-highlight p {
  margin: 5px 0 0;
  color: #2b3a53;
  font-weight: 700;
}

.action-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.action-list li {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.action-number {
  color: #9aa4b4;
  font-size: 13px;
  font-weight: 800;
}

.action-list h3 {
  margin-bottom: 5px;
  font-size: 15px;
}

.action-list p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}

.priority {
  min-width: 45px;
  padding: 5px 9px;
  border-radius: 6px;
  color: #6d7789;
  background: #f0f2f5;
  text-align: center;
  font-size: 10px;
  font-weight: 800;
}

.priority.high {
  color: var(--blue);
  background: var(--blue-soft);
}

@media (max-width: 1180px) {
  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .sidebar {
    position: static;
    width: 100%;
    padding: 16px;
  }

  .brand {
    padding: 0 2px 14px;
  }

  .navigation {
    display: flex;
    gap: 6px;
    padding-top: 14px;
    overflow-y: hidden;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .nav-label,
  .nav-icon,
  .sidebar-footer {
    display: none;
  }

  .nav-item {
    width: auto;
    flex: 0 0 auto;
    margin: 0;
    padding: 9px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  .main {
    margin-left: 0;
  }

  .topbar,
  .client-info,
  .content {
    padding-right: 20px;
    padding-left: 20px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-row {
    grid-template-columns: 1fr;
  }

  .chart-grid {
    grid-template-columns: 1fr;
  }

  .comment-card {
    grid-template-columns: 1fr;
  }

  .comment-profile {
    padding: 22px;
  }
}

@media (max-width: 600px) {
  .keyword-filter-panel,
  .settlement-grid { grid-template-columns: 1fr; }
  .topbar {
    min-height: 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
    padding-top: 20px;
    padding-bottom: 18px;
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .report-picker {
    width: 100%;
    min-width: 0;
  }

  .topbar-actions .report-period {
    width: 100%;
    min-width: 0;
    margin: 4px 0 0;
    padding: 10px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  h1 {
    font-size: 20px;
  }

  .report-period {
    align-items: flex-start;
  }

  .topbar-button {
    flex: 1 1 auto;
  }

  .client-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 18px;
  }

  .client-info > div {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .content {
    padding-top: 24px;
  }

  .section-heading {
    align-items: flex-start;
  }

  .section-heading h2 {
    font-size: 22px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 115px;
  }

  .chart-header {
    padding-right: 16px;
    padding-left: 16px;
  }

  .chart-wrap {
    min-height: 245px;
    padding-right: 6px;
    padding-left: 6px;
  }

  .chart-wrap canvas {
    height: 225px;
  }

  .chart-wrap[data-chart^="danggeun-hour-"] {
    min-height: 284px;
    padding-right: 4px;
    padding-left: 4px;
  }

  .chart-wrap[data-chart^="danggeun-hour-"] canvas {
    height: 258px;
  }

  .chart-wrap-horizontal {
    min-height: 338px;
  }

  .chart-wrap-horizontal canvas {
    height: 318px;
  }

  .table-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .comment-body {
    padding: 25px 22px;
  }

  .comment-body h3 {
    font-size: 17px;
  }

  .action-list li {
    grid-template-columns: 35px minmax(0, 1fr);
    align-items: flex-start;
    gap: 8px;
    padding: 18px;
  }

  .priority {
    grid-column: 2;
    width: fit-content;
  }
}

.nav-group {
  margin: 7px 0;
  border-top: 1px solid rgba(255, 255, 255, .08);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.nav-group-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 0;
  color: #d8e1ef;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.nav-group-toggle i { font-style: normal; transition: transform .2s ease; }
.nav-group-toggle[aria-expanded="false"] i { transform: rotate(-90deg); }
.nav-submenu .nav-item { padding-left: 22px; font-size: 11px; }
.media-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.media-summary-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.media-summary-head,
.media-summary-head > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}
.media-summary-head h3 { margin: 0; font-size: 16px; }
.media-detail-button {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--blue);
  background: #fff;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.media-period { margin: 12px 0; color: var(--muted); font-size: 10px; }
.media-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}
.media-metrics div { padding: 10px; border-radius: 8px; background: #f7f9fc; }
.media-metrics dt { color: var(--muted); font-size: 9px; overflow-wrap: anywhere; }
.media-metrics dd { margin: 4px 0 0; color: var(--navy); font-size: 13px; font-weight: 800; }
.media-panel-commerce {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 15px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}
.media-panel-commerce strong { margin-left: 4px; color: var(--navy); }
.integrated-chart-grid { margin-top: 18px; }
.platform-badge.multi { background: #4e5d78; }
.settlement-panel { margin-top: 18px; }
.settlement-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.settlement-grid > div { padding: 14px; border-radius: 9px; background: #f6f8fb; }
.settlement-grid span { display: block; color: var(--muted); font-size: 10px; }
.settlement-grid strong { display: block; margin-top: 5px; color: var(--navy); font-size: 16px; }
.campaign-filter-bar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid #dce5f3;
  border-radius: 10px;
  background: #f7faff;
}
.campaign-filter-bar label span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; }
.campaign-filter-bar select,
.keyword-filter-panel select,
.keyword-filter-panel input,
.keyword-chart-toolbar select {
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid #d5dce7;
  border-radius: 7px;
  color: #354258;
  background: #fff;
  font: inherit;
  font-size: 11px;
}
.campaign-filter-bar small { flex: 1 1 300px; color: var(--muted); font-size: 10px; }
.filter-active-badge { padding: 7px 10px; border-radius: 999px; color: #1e55af; background: #e8f1ff; font-size: 10px; font-weight: 800; }
.keyword-filter-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f8fafc;
}
.keyword-filter-panel label > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; }
.keyword-filter-panel select,
.keyword-filter-panel input { width: 100%; }
.keyword-filter-panel .keyword-check { display: flex; align-items: center; gap: 7px; align-self: end; min-height: 36px; padding: 7px 10px; border-radius: 7px; background: #fff; }
.keyword-filter-panel .keyword-check input { width: auto; min-height: 0; accent-color: var(--blue); }
.keyword-filter-panel .keyword-check span { margin: 0; color: #46536a; }
.keyword-chart-toolbar { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.keyword-chart-toolbar label { color: var(--muted); font-size: 10px; }
.keyword-chart-toolbar select { margin-left: 6px; }
.keyword-table-panel table { min-width: 1280px; }
.keyword-group-heading td { color: #2f496d; background: #f0f4f9; font-weight: 800; text-align: left !important; }
.keyword-subtotal-row td { color: #465872; background: #f8fafc; font-weight: 700; }
.report-status-badge.review_demo,
.data-state-badge {
  white-space: nowrap;
}
.report-status-badge.review_demo {
  color: #7c4a03;
  background: #fff4d8;
}
.review-points-button {
  color: #2458b6;
  border-color: #bfd2f5;
  background: #f3f7ff;
}
.review-points-panel {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(17, 28, 47, .48);
}
.review-points-panel[hidden] { display: none; }
.review-points-card {
  width: min(480px, 100%);
  padding: 24px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .2);
}
.review-points-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.review-points-heading h2 { margin: 0; font-size: 20px; }
.review-points-heading button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  font-size: 21px;
  cursor: pointer;
}
.review-points-card ul { margin: 20px 0 0; padding: 0; list-style: none; }
.review-points-card li {
  position: relative;
  margin-top: 9px;
  padding: 12px 14px 12px 36px;
  border-radius: 9px;
  color: #435168;
  background: #f6f8fb;
  font-size: 13px;
}
.review-points-card li::before {
  position: absolute;
  left: 14px;
  content: "✓";
  color: var(--blue);
  font-weight: 800;
}
.review-points-open { overflow: hidden; }

.conversion-edit-control {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  justify-content: flex-end;
  margin-left: 7px;
  vertical-align: middle;
}

.conversion-edit-button {
  min-height: 28px;
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, var(--platform-accent, var(--blue)) 55%, #fff);
  border-radius: 7px;
  color: var(--platform-accent, var(--blue));
  background: #fff;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.conversion-edit-button:hover,
.conversion-edit-button:focus-visible {
  background: var(--platform-soft, var(--blue-soft));
  outline: 2px solid color-mix(in srgb, var(--platform-accent, var(--blue)) 28%, transparent);
  outline-offset: 1px;
}

.conversion-adjusted-badge {
  padding: 2px 6px;
  border-radius: 999px;
  color: #2458b6;
  background: #eaf1ff;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.conversion-adjust-panel {
  position: fixed;
  z-index: 150;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(15 23 42 / 58%);
}

.conversion-adjust-panel[hidden] {
  display: none;
}

.conversion-adjust-open {
  overflow: hidden;
}

.conversion-adjust-card {
  width: min(480px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 24px;
  border: 1px solid #dce3ee;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 70px rgb(15 23 42 / 28%);
}

.conversion-adjust-heading {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.conversion-adjust-heading h2,
.conversion-adjust-heading p {
  margin: 0;
}

.conversion-adjust-heading h2 {
  margin-top: 3px;
  color: #152033;
  font-size: 22px;
}

.conversion-adjust-heading #conversion-adjust-target {
  margin-top: 6px;
  color: #667085;
  font-size: 13px;
}

.conversion-adjust-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 9px;
  color: #667085;
  background: #f3f5f8;
  font-size: 22px;
  cursor: pointer;
}

.conversion-adjust-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.conversion-adjust-values > div,
.conversion-adjust-values label,
.conversion-adjust-field {
  display: grid;
  gap: 7px;
  color: #4b5565;
  font-size: 12px;
  font-weight: 800;
}

.conversion-adjust-values > div {
  align-content: center;
  min-height: 72px;
  padding: 12px;
  border-radius: 10px;
  background: #f5f7fb;
}

.conversion-adjust-values strong {
  color: #152033;
  font-size: 19px;
}

.conversion-adjust-card input,
.conversion-adjust-card select,
.conversion-adjust-card textarea {
  width: 100%;
  border: 1px solid #cfd7e4;
  border-radius: 9px;
  color: #1f2937;
  background: #fff;
  font: inherit;
}

.conversion-adjust-card input,
.conversion-adjust-card select {
  min-height: 44px;
  padding: 0 11px;
}

.conversion-adjust-card textarea {
  padding: 10px 11px;
  resize: vertical;
}

.conversion-adjust-card input:focus,
.conversion-adjust-card select:focus,
.conversion-adjust-card textarea:focus {
  border-color: var(--blue);
  outline: 3px solid rgb(47 111 235 / 12%);
}

.conversion-adjust-field {
  margin-top: 14px;
}

.conversion-published-warning,
.conversion-adjust-message {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.5;
}

.conversion-published-warning {
  color: #854d0e;
  background: #fff7db;
}

.conversion-adjust-message {
  min-height: 20px;
  padding: 0;
  color: #b42318;
  background: transparent;
}

.conversion-adjust-message:empty {
  display: none;
}

.conversion-adjust-actions {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 8px;
  margin-top: 20px;
}

.conversion-adjust-actions button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid #cfd7e4;
  border-radius: 9px;
  color: #344054;
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}

.conversion-adjust-actions .primary {
  border-color: var(--blue);
  color: #fff;
  background: var(--blue);
}

.conversion-adjust-actions button:disabled {
  opacity: 0.58;
  cursor: wait;
}

@media (max-width: 980px) {
  .media-summary-grid { grid-template-columns: 1fr; }
  .keyword-filter-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settlement-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .report-section {
    animation: none;
  }

  .report-insights-actions button.loading::before {
    animation: none;
  }
}

@media (max-width: 768px) {
  .summary-insights-shortcut {
    width: 100%;
    justify-content: center;
  }

  .report-insights-section {
    margin-top: 18px;
    padding: 17px 14px;
    border-radius: 11px;
  }

  .report-insights-heading {
    display: grid;
    gap: 12px;
  }

  .report-insights-heading h2 {
    font-size: 19px;
  }

  .report-insights-status-wrap {
    justify-items: start;
    text-align: left;
  }

  .report-insights-fields,
  .report-insights-cards {
    grid-template-columns: minmax(0, 1fr);
  }

  .report-insight-field textarea {
    min-height: 120px;
  }

  .report-insights-message {
    text-align: left;
  }

  .report-insights-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-insights-actions button {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .dashboard-empty-state {
    width: 100%;
    margin: 24px auto;
    padding: 32px 18px;
  }

  .dashboard-empty-state .error-actions {
    flex-direction: column;
  }

  .dashboard-empty-state .error-actions .button {
    width: 100%;
    min-height: 46px;
  }

  .conversion-edit-control {
    margin-left: 5px;
  }

  .conversion-edit-button {
    min-height: 32px;
  }

  .conversion-adjust-panel {
    align-items: end;
    padding: 0;
  }

  .conversion-adjust-card {
    width: 100%;
    max-height: 90dvh;
    padding: 20px 16px calc(18px + env(safe-area-inset-bottom));
    border-radius: 18px 18px 0 0;
  }

  .conversion-adjust-values {
    grid-template-columns: 1fr;
  }

  .conversion-adjust-actions {
    grid-template-columns: 1fr 1fr;
  }

  .conversion-adjust-actions span {
    display: none;
  }

  .conversion-adjust-actions button {
    width: 100%;
  }

  .dashboard {
    width: 100%;
    overflow-x: clip;
  }

  .sidebar {
    position: fixed;
    z-index: 60;
    inset: 0 auto 0 0;
    display: flex;
    width: min(86vw, 320px);
    min-width: 260px;
    height: 100dvh;
    padding: 22px 18px;
    transform: translateX(-105%);
    transition: transform 180ms ease;
    box-shadow: 12px 0 32px rgb(15 23 42 / 28%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar .brand {
    min-height: 72px;
    padding: 2px 4px 18px;
  }

  .navigation {
    display: none;
    min-width: 0;
    padding-top: 16px;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .nav-label {
    display: block;
  }

  .nav-item {
    width: 100%;
    min-width: 0;
    margin: 0 0 4px;
    padding: 11px 12px;
    border: 0;
    white-space: nowrap;
    word-break: keep-all;
  }

  .nav-icon {
    display: grid;
    flex: 0 0 25px;
  }

  .sidebar-footer {
    display: none;
  }

  .mobile-global-navigation {
    display: grid;
    gap: 6px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgb(255 255 255 / 10%);
  }

  .mobile-global-navigation a,
  .mobile-global-navigation button {
    display: flex;
    width: 100%;
    min-height: 42px;
    align-items: center;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    color: #dce3ef;
    background: transparent;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    word-break: keep-all;
    cursor: pointer;
  }

  .mobile-global-navigation a:hover,
  .mobile-global-navigation button:hover {
    background: rgb(255 255 255 / 7%);
  }

  .sidebar-backdrop:not([hidden]) {
    position: fixed;
    z-index: 50;
    inset: 0;
    display: block;
    width: 100%;
    border: 0;
    background: rgb(15 23 42 / 48%);
  }

  body.mobile-menu-open {
    overflow: hidden;
  }

  .main {
    width: 100%;
    min-width: 0;
    margin-left: 0;
  }

  .topbar {
    display: block;
    min-height: 0;
    padding: 0 16px 18px;
  }

  .dashboard-mobile-header {
    display: flex;
    min-height: 64px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
  }

  .dashboard-mobile-header strong {
    display: block;
    max-width: calc(100vw - 100px);
    overflow: hidden;
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .dashboard-mobile-header .eyebrow {
    margin-bottom: 1px;
  }

  .dashboard-menu-button {
    min-width: 58px;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid #d7dde7;
    border-radius: 8px;
    color: #344054;
    background: #fff;
    font-weight: 700;
    white-space: nowrap;
  }

  .dashboard-heading {
    display: none;
  }

  .topbar-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .report-picker,
  .topbar-actions .report-period,
  .mobile-more-actions {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .report-picker select {
    width: 100%;
    min-width: 0;
  }

  .report-status-badge,
  .data-state-badge {
    min-width: 0;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .primary-report-actions {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .primary-report-actions .topbar-button {
    width: 100%;
    min-width: 0;
    white-space: nowrap;
  }

  .primary-report-actions .role-management-action {
    grid-column: 1 / -1;
  }

  .mobile-more-actions {
    display: block;
  }

  .mobile-more-actions > summary {
    display: flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    border: 1px solid #d7dde7;
    border-radius: 7px;
    color: #536074;
    background: #fff;
    font-size: 11px;
    font-weight: 700;
    list-style: none;
    cursor: pointer;
  }

  .mobile-more-actions > summary::-webkit-details-marker {
    display: none;
  }

  .mobile-more-content {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
  }

  .mobile-more-content .topbar-button {
    width: 100%;
    min-width: 0;
    white-space: nowrap;
  }

  .topbar-actions .report-period {
    margin-top: 2px;
    padding: 10px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
    align-items: flex-start;
  }

  .client-info {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 16px;
  }

  .client-info > div {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .client-info strong,
  .client-info span,
  .section-heading p,
  .panel-heading p {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: keep-all;
  }

  .content {
    width: 100%;
    min-width: 0;
    padding: 16px 16px 40px;
    overflow-x: clip;
  }

  .mobile-report-tabs {
    position: sticky;
    z-index: 35;
    top: 0;
    display: grid;
    width: 100%;
    min-width: 0;
    gap: 10px;
    padding: 12px 16px;
    overflow: visible;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: rgb(255 255 255 / 96%);
    box-shadow: 0 4px 12px rgb(24 37 58 / 6%);
    backdrop-filter: blur(10px);
  }

  .mobile-tab-current {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 1px 8px;
  }

  .mobile-tab-current > span {
    grid-column: 1 / -1;
    color: #7a8597;
    font-size: 10px;
    font-weight: 700;
  }

  .mobile-tab-current > strong {
    min-width: 0;
    overflow: hidden;
    color: var(--navy);
    font-size: 19px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-tab-current > small {
    max-width: 110px;
    padding: 3px 7px;
    overflow: hidden;
    border-radius: 999px;
    color: #2458b6;
    background: #edf4ff;
    font-size: 10px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-tab-select-label {
    display: grid;
    gap: 4px;
  }

  .mobile-tab-select-label > span {
    color: #687386;
    font-size: 10px;
    font-weight: 700;
  }

  .mobile-tab-select {
    width: 100%;
    min-height: 42px;
    padding: 8px 34px 8px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    color: #1f2a3d;
    background: #fff;
    font-size: 13px;
    font-weight: 750;
  }

  .mobile-core-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .mobile-report-tab {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 7px 6px;
    border: 1px solid #d9e0ea;
    border-radius: 9px;
    color: #536074;
    background: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.25;
    white-space: normal;
    word-break: keep-all;
  }

  .mobile-report-tab.active {
    border-color: var(--blue);
    color: #fff;
    background: var(--blue);
    box-shadow: 0 3px 10px rgb(47 111 235 / 22%);
  }

  .mobile-detail-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
  }

  .mobile-detail-toggle i {
    font-style: normal;
    transition: transform 160ms ease;
  }

  .mobile-detail-toggle.open i {
    transform: rotate(180deg);
  }

  .mobile-detail-tabs {
    display: grid;
    max-height: min(42vh, 330px);
    gap: 10px;
    padding: 10px;
    overflow-y: auto;
    border: 1px solid #dbe2ec;
    border-radius: 10px;
    background: #f7f9fc;
    overscroll-behavior: contain;
  }

  .mobile-detail-tabs[hidden] {
    display: none;
  }

  .mobile-detail-group {
    display: grid;
    gap: 6px;
  }

  .mobile-detail-group > strong {
    color: #42516a;
    font-size: 11px;
  }

  .mobile-detail-group > div {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .mobile-detail-group .mobile-report-tab {
    min-height: 40px;
    padding: 9px 11px;
    text-align: left;
  }

  .chart-wrap canvas {
    height: 270px;
  }

  .chart-header {
    gap: 8px;
    align-items: flex-start;
  }

  .chart-unit {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .summary-metric-grid .metric-card {
    min-width: 0;
    min-height: 124px;
    padding: 11px 12px;
    border-radius: 10px;
  }

  .metric-card.kpi-spend { order: 1; }
  .metric-card.kpi-clicks { order: 2; }
  .metric-card.kpi-conversions { order: 3; }
  .metric-card.kpi-cpa { order: 4; }
  .metric-card.kpi-revenue { order: 5; }
  .metric-card.kpi-roas { order: 6; }
  .metric-card.kpi-secondary { order: 20; }

  .summary-metric-grid .metric-card > strong {
    max-width: 100%;
    margin: 6px 0 2px;
    overflow-wrap: anywhere;
    font-size: clamp(15px, 4.6vw, 21px);
    line-height: 1.12;
    letter-spacing: -0.055em;
    white-space: normal;
  }

  .summary-metric-grid .metric-card > strong.metric-value-long {
    font-size: clamp(13px, 4vw, 18px);
  }

  .summary-metric-grid .metric-card > strong.metric-value-xlong {
    font-size: clamp(12px, 3.6vw, 16px);
  }

  .summary-metric-grid .metric-card small {
    display: -webkit-box;
    min-height: 26px;
    overflow: hidden;
    font-size: 10px;
    line-height: 1.3;
    overflow-wrap: normal;
    word-break: keep-all;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .summary-metric-grid .metric-top {
    min-width: 0;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 11px;
  }

  .summary-metric-grid .trend {
    max-width: 100%;
    min-height: 22px;
    padding: 3px 7px;
    font-size: 10px;
    line-height: 1.15;
    white-space: nowrap;
  }

  .summary-metric-grid .mobile-secondary-metrics {
    display: block;
    grid-column: 1 / -1;
    order: 10;
  }

  .mobile-secondary-metrics > summary {
    display: flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    border: 1px solid #d7dde7;
    border-radius: 8px;
    color: #536074;
    background: #fff;
    font-size: 11px;
    font-weight: 700;
    list-style: none;
    cursor: pointer;
  }

  .mobile-secondary-metrics > summary::-webkit-details-marker {
    display: none;
  }

  .mobile-secondary-metrics[open] .metrics-expand-label {
    display: none;
  }

  .mobile-secondary-metrics[open] .metrics-collapse-label {
    display: inline;
  }

  .secondary-metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
  }

  .settlement-grid {
    grid-template-columns: 1fr;
  }

  .table-panel > .table-scroll {
    display: none;
  }

  .mobile-performance-list {
    display: grid;
    gap: 10px;
    padding: 12px;
  }

  .mobile-table-total {
    min-width: 0;
    padding: 12px;
    border: 1px solid #d7e2f1;
    border-radius: 10px;
    background: #eef4ff;
  }

  .mobile-table-total > strong {
    display: block;
    margin-bottom: 9px;
    color: #20365f;
    font-size: 12px;
    font-weight: 850;
  }

  .mobile-table-total dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    margin: 0;
  }

  .mobile-table-total dl > div {
    min-width: 0;
  }

  .mobile-table-total dt {
    color: #6f7c91;
    font-size: 9px;
    font-weight: 700;
  }

  .mobile-table-total dd {
    margin: 2px 0 0;
    color: #1f2d46;
    font-size: 12px;
    font-weight: 850;
    overflow-wrap: anywhere;
  }

  .mobile-table-sort-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 8px;
  }

  .mobile-table-sort-bar label {
    display: grid;
    min-width: 0;
    gap: 4px;
  }

  .mobile-table-sort-bar label > span,
  .mobile-sort-current {
    color: #687386;
    font-size: 10px;
    font-weight: 700;
  }

  .mobile-table-sort-bar select {
    width: 100%;
    min-height: 40px;
    padding: 7px 30px 7px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #25314a;
    background: #fff;
    font-size: 12px;
    font-weight: 750;
  }

  .mobile-sort-current {
    padding-bottom: 10px;
    white-space: nowrap;
  }

  .mobile-performance-cards {
    display: grid;
    gap: 9px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .mobile-performance-card {
    min-width: 0;
  }

  .mobile-performance-card > article {
    min-width: 0;
    padding: 13px;
    border: 1px solid #e1e6ee;
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 1px 2px rgb(16 24 40 / 4%);
  }

  .mobile-performance-card-heading {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
  }

  .mobile-rank {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 8px;
    color: #2458b6;
    background: #edf4ff;
    font-size: 12px;
    font-weight: 850;
  }

  .mobile-performance-card-heading > div {
    min-width: 0;
  }

  .mobile-performance-card-heading small {
    display: block;
    color: #7a8597;
    font-size: 9px;
  }

  .mobile-performance-card-heading strong {
    display: block;
    overflow: hidden;
    color: #1d2738;
    font-size: 13px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  .mobile-core-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin: 11px 0 0;
  }

  .mobile-core-metrics > div {
    min-width: 0;
    padding: 8px 9px;
    border-radius: 8px;
    background: #f7f9fc;
  }

  .mobile-core-metrics dt {
    color: #788395;
    font-size: 9px;
    font-weight: 700;
  }

  .mobile-core-metrics dd {
    margin: 3px 0 0;
    color: #202b3e;
    font-size: 12px;
    font-weight: 850;
    overflow-wrap: anywhere;
  }

  .mobile-row-details {
    margin-top: 9px;
    border-top: 1px solid #edf0f4;
  }

  .mobile-row-details > summary {
    display: flex;
    min-height: 38px;
    align-items: center;
    justify-content: space-between;
    color: #536074;
    font-size: 11px;
    font-weight: 750;
    list-style: none;
    cursor: pointer;
  }

  .mobile-row-details > summary::-webkit-details-marker {
    display: none;
  }

  .mobile-row-details[open] > summary span {
    transform: rotate(180deg);
  }

  .mobile-row-details > dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 12px;
    margin: 0 0 4px;
  }

  .mobile-row-details > dl div {
    min-width: 0;
  }

  .mobile-row-details dt {
    color: #7a8597;
    font-size: 9px;
  }

  .mobile-row-details dd {
    margin: 2px 0 0;
    overflow-wrap: anywhere;
    color: #364258;
    font-size: 11px;
    font-weight: 700;
  }

  .mobile-performance-empty {
    margin: 0;
    padding: 26px 12px;
    color: #687386;
    text-align: center;
  }

  .keyword-table-panel {
    overflow-x: clip;
  }

  .table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }
}

@media (max-width: 360px) {
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .primary-report-actions,
  .mobile-more-content {
    grid-template-columns: 1fr;
  }

  .summary-metric-grid,
  .secondary-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Platform navigation colors: color supplements the visible platform labels. */
[data-platform-key="naver"],
[data-platform-theme="naver"] {
  --platform-color: #03cf5d;
  --platform-tint: rgba(3, 207, 93, 0.1);
  --platform-soft: rgba(3, 207, 93, 0.18);
  --platform-ink: #016b32;
  --platform-selected-text: #062f19;
}

[data-platform-key="meta"],
[data-platform-theme="meta"] {
  --platform-color: #0766ff;
  --platform-tint: rgba(0, 130, 251, 0.09);
  --platform-soft: rgba(0, 100, 224, 0.18);
  --platform-ink: #0754c7;
  --platform-selected-text: #fff;
}

[data-platform-key="danggeun"],
[data-platform-theme="danggeun"] {
  --platform-color: #eb8717;
  --platform-tint: rgba(235, 135, 23, 0.1);
  --platform-soft: rgba(235, 135, 23, 0.18);
  --platform-ink: #8b4900;
  --platform-selected-text: #382000;
}

.platform-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: var(--platform-color);
  box-shadow: 0 0 0 2px var(--platform-soft);
}

.nav-group-name,
.mobile-detail-group > strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nav-group[data-platform-key] {
  border-left: 2px solid var(--platform-color);
  background: linear-gradient(90deg, var(--platform-soft), transparent 42%);
}

.nav-group[data-platform-key] .nav-group-toggle:hover {
  color: #fff;
  background: var(--platform-soft);
}

.nav-group[data-platform-key] .nav-group-toggle:focus-visible,
.nav-item[data-platform-key]:focus-visible {
  outline-color: var(--platform-color);
}

.nav-item[data-platform-key] {
  border-left: 3px solid var(--platform-color);
  color: #dce4f0;
  background: rgba(255, 255, 255, 0.025);
}

.nav-item[data-platform-key]:hover {
  color: #fff;
  background: var(--platform-soft);
}

.nav-item[data-platform-key].active {
  color: #fff;
  background: var(--platform-soft);
  box-shadow: inset 0 0 0 1px var(--platform-color);
}

.nav-item[data-platform-key] .nav-icon {
  border-color: var(--platform-color);
  color: #fff;
  background: var(--platform-soft);
}

.media-summary-panel[data-platform-key] {
  border-left: 4px solid var(--platform-color);
  background: linear-gradient(135deg, var(--platform-tint), #fff 38%);
}

.media-summary-panel[data-platform-key] .media-detail-button {
  border-color: var(--platform-color);
  color: #273247;
}

.media-summary-panel[data-platform-key] .media-detail-button:hover,
.media-summary-panel[data-platform-key] .media-detail-button:focus-visible {
  color: #182135;
  background: var(--platform-tint);
  outline-color: var(--platform-color);
}

@media (max-width: 768px) {
  .mobile-tab-current[data-platform-key] {
    padding-left: 12px;
    border-left: 4px solid var(--platform-color);
    background: linear-gradient(90deg, var(--platform-tint), #fff 52%);
  }

  .mobile-tab-current[data-platform-key] > small {
    color: #273247;
    background: var(--platform-tint);
  }

  .mobile-tab-select[data-platform-key] {
    border-color: var(--platform-color);
    box-shadow: 0 0 0 2px var(--platform-tint);
  }

  .mobile-tab-select[data-platform-key]:focus {
    outline: 2px solid var(--platform-color);
    outline-offset: 2px;
  }

  .mobile-detail-group[data-platform-key] {
    padding: 9px;
    border-left: 4px solid var(--platform-color);
    border-radius: 8px;
    background: var(--platform-tint);
  }

  .mobile-detail-group[data-platform-key] > strong {
    color: #263247;
  }

  .mobile-detail-group[data-platform-key] .platform-dot {
    border-color: #fff;
  }

  .mobile-report-tab[data-platform-key] {
    border-color: color-mix(in srgb, var(--platform-color) 48%, #d9e0ea);
    border-left: 4px solid var(--platform-color);
    color: #354158;
    background: #fff;
  }

  .mobile-report-tab[data-platform-key]:hover,
  .mobile-report-tab[data-platform-key]:focus-visible {
    border-color: var(--platform-color);
    background: var(--platform-tint);
    outline: 2px solid var(--platform-color);
    outline-offset: 1px;
  }

  .mobile-report-tab[data-platform-key].active {
    border-color: var(--platform-color);
    color: var(--platform-selected-text);
    background: var(--platform-color);
    box-shadow: 0 3px 10px var(--platform-soft);
  }
}

.report-section[data-platform-key] .section-heading {
  padding: 18px 20px;
  border-left: 5px solid var(--platform-color);
  border-radius: 12px;
  background: linear-gradient(100deg, var(--platform-tint), #fff 68%);
}

.platform-overall-summary {
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--platform-color) 32%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--platform-color) 4%, #fff);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--platform-color) 8%, transparent);
}

.platform-overall-header {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 12px 16px;
  border-left: 5px solid var(--platform-color);
  background: linear-gradient(100deg, var(--platform-tint), #fff 72%);
}

.platform-overall-header > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.platform-overall-header small {
  display: block;
  margin-bottom: 2px;
  color: var(--platform-ink);
  font-size: 10px;
  font-weight: 800;
}

.platform-overall-header h2 {
  margin: 0;
  color: #172033;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -0.035em;
}

.platform-overall-body {
  padding: 12px 14px 14px;
}

.platform-overall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 8px;
}

.platform-overall-metric {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid color-mix(in srgb, var(--platform-color) 24%, var(--line));
  border-top: 3px solid var(--platform-color);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.96);
}

.platform-overall-metric span {
  display: block;
  margin-bottom: 5px;
  color: #667186;
  font-size: 10px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.platform-overall-metric strong {
  display: block;
  color: #172033;
  font-size: clamp(15px, 1.35vw, 19px);
  line-height: 1.18;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}

@media (min-width: 1181px) {
  .metric-grid,
  .platform-overall-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .summary-metric-grid:has(> .metric-card:nth-child(6)) {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .platform-overall-grid:has(> .platform-overall-metric:nth-child(6):last-child) {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .summary-metric-grid:has(> .mobile-secondary-metrics):not(:has(> .metric-card:nth-child(6))) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .summary-metric-grid > .mobile-secondary-metrics {
    grid-column: 1 / -1;
  }

  .summary-metric-grid .secondary-metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 961px) and (max-width: 1180px) {
  .metric-grid,
  .platform-overall-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .summary-metric-grid:has(> .metric-card:nth-child(6)) {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .platform-overall-grid:has(> .platform-overall-metric:nth-child(6):last-child) {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .summary-metric-grid > .mobile-secondary-metrics {
    grid-column: 1 / -1;
  }

  .summary-metric-grid .secondary-metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 769px) and (max-width: 960px) {
  .metric-grid,
  .platform-overall-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-metric-grid > .mobile-secondary-metrics {
    grid-column: 1 / -1;
  }

  .summary-metric-grid .secondary-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 769px) {
  .summary-metric-grid > .mobile-secondary-metrics:not([open]) {
    display: none;
  }

  .summary-metric-grid > .mobile-secondary-metrics {
    display: block;
    min-width: 0;
    height: auto;
  }

  .summary-metric-grid .secondary-metric-grid {
    display: grid;
    height: auto;
    gap: 12px;
  }

  .metric-grid:not(.summary-metric-grid):not(:has(> .mobile-secondary-metrics)):has(> .metric-card:nth-child(6):last-child),
  .platform-overall-grid:has(> .platform-overall-metric:nth-child(6):last-child) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .metric-card > strong,
  .platform-overall-metric strong {
    overflow-wrap: normal;
    white-space: nowrap;
  }
}

.report-section[data-platform-key] .section-heading .eyebrow {
  color: var(--platform-ink);
}

.report-section[data-platform-key] .section-heading h2 {
  color: #172033;
}

.report-section[data-platform-key] .data-label {
  border-color: color-mix(in srgb, var(--platform-color) 42%, #d9e0ea);
  color: var(--platform-ink);
  background: #fff;
}

.report-section[data-platform-key] .metric-card {
  border-color: color-mix(in srgb, var(--platform-color) 35%, var(--line));
  border-top: 3px solid var(--platform-color);
  padding-top: 16px;
  background: linear-gradient(180deg, var(--platform-tint), #fff 42%);
}

.report-section[data-platform-key] .metric-card.highlight {
  background: linear-gradient(145deg, var(--platform-soft), #fff 62%);
}

.report-section[data-platform-key] .chart-panel,
.report-section[data-platform-key] .table-panel {
  border-color: color-mix(in srgb, var(--platform-color) 28%, var(--line));
}

.report-section[data-platform-key] .chart-header,
.report-section[data-platform-key] .table-header {
  border-bottom-color: color-mix(in srgb, var(--platform-color) 24%, var(--line));
  background: linear-gradient(90deg, var(--platform-tint), #fff 58%);
}

.report-section[data-platform-key] .chart-header h3,
.report-section[data-platform-key] .table-header h3 {
  color: #202b3e;
}

.report-section[data-platform-key] .chart-header h3::before,
.report-section[data-platform-key] .table-header h3::before {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--platform-color);
  content: "";
  vertical-align: 1px;
}

.report-section[data-platform-key] .chart-tooltip {
  border-color: color-mix(in srgb, var(--platform-color) 38%, #dce3ed);
}

.report-section[data-platform-key] .chart-tooltip b {
  color: var(--platform-ink);
}

.report-section[data-platform-key] th {
  color: #566276;
  background: color-mix(in srgb, var(--platform-color) 7%, #fafbfc);
}

.report-section[data-platform-key] .table-overall-total-row > * {
  border-top: 1px solid color-mix(in srgb, var(--platform-color) 32%, var(--line));
  border-bottom-color: color-mix(in srgb, var(--platform-color) 28%, var(--line));
  color: var(--platform-ink);
  background: color-mix(in srgb, var(--platform-color) 13%, #fff);
  font-size: 12px;
  font-weight: 800;
}

.report-section[data-platform-key] .table-overall-total-row > th {
  text-align: left;
}

.report-section[data-platform-key] .table-overall-total-empty {
  color: #8a94a5;
}

.report-section[data-platform-key] tbody tr:hover {
  background: var(--platform-tint);
}

.report-section[data-platform-key] .table-sort-button:hover,
.report-section[data-platform-key] .table-sort-button:focus-visible,
.report-section[data-platform-key] .table-sort-button.active {
  color: var(--platform-ink);
}

.report-section[data-platform-key] .table-sort-button:focus-visible {
  border-radius: 3px;
  outline: 2px solid var(--platform-color);
  outline-offset: 2px;
}

.report-section[data-platform-key] .campaign-filter-bar,
.report-section[data-platform-key] .keyword-filter-panel {
  border-color: color-mix(in srgb, var(--platform-color) 30%, var(--line));
  background: color-mix(in srgb, var(--platform-color) 5%, #fff);
}

.report-section[data-platform-key] select:focus,
.report-section[data-platform-key] input:focus {
  border-color: var(--platform-color);
  outline: 3px solid var(--platform-soft);
}

.report-section[data-platform-key] .analysis-subtab:hover,
.report-section[data-platform-key] .analysis-subtab:focus-visible,
.report-section[data-platform-key] .analysis-subtab.active {
  border-color: var(--platform-color);
  color: var(--platform-ink);
  background: var(--platform-tint);
}

.report-section[data-platform-key] .filter-active-badge {
  color: var(--platform-ink);
  background: var(--platform-tint);
}

@media (max-width: 768px) {
  .platform-overall-summary {
    margin-bottom: 14px;
    border-radius: 12px;
  }

  .platform-overall-header {
    min-height: 62px;
    gap: 8px;
    padding: 10px 11px;
    border-left-width: 4px;
  }

  .platform-overall-header h2 {
    font-size: 16px;
  }

  .platform-overall-header .platform-badge {
    width: 29px;
    height: 29px;
    flex-basis: 29px;
  }

  .platform-overall-body {
    padding: 9px 10px 11px;
  }

  .platform-overall-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .platform-overall-metric {
    padding: 9px 10px;
  }

  .platform-overall-metric strong {
    font-size: clamp(14px, 4.2vw, 18px);
  }

  .report-section[data-platform-key] .section-heading {
    padding: 15px 14px;
    border-left-width: 4px;
  }

  .report-section[data-platform-key] .mobile-performance-card {
    border-top: 3px solid var(--platform-color);
    background: linear-gradient(180deg, var(--platform-tint), #fff 32%);
  }

  .report-section[data-platform-key] .mobile-table-sort-bar {
    border-color: color-mix(in srgb, var(--platform-color) 32%, #dce3ed);
    background: var(--platform-tint);
  }

  .report-section[data-platform-key] .mobile-table-sort-bar select {
    border-color: color-mix(in srgb, var(--platform-color) 45%, #cbd5e1);
  }
}

.main[data-platform-theme="naver"] {
  --theme-page-background: #f1fcf5;
  --theme-surface: #fbfffc;
  --theme-surface-soft: #f5fcf7;
  --theme-card-border: rgba(3, 207, 93, 0.24);
  --theme-card-shadow: 0 10px 28px rgba(1, 107, 50, 0.09);
  --theme-header-background:
    radial-gradient(circle at 82% 12%, rgba(3, 207, 93, 0.16), transparent 34%),
    linear-gradient(120deg, #f6fff9, #eafaf0);
}

.main[data-platform-theme="meta"] {
  --theme-page-background: #f2f7ff;
  --theme-surface: #fbfdff;
  --theme-surface-soft: #f5f9ff;
  --theme-card-border: rgba(7, 102, 255, 0.22);
  --theme-card-shadow: 0 10px 30px rgba(0, 100, 224, 0.1);
  --theme-header-background:
    radial-gradient(circle at 78% 10%, rgba(0, 130, 251, 0.16), transparent 32%),
    linear-gradient(120deg, #f7faff, #eaf3ff 58%, #f2f7ff);
}

.main[data-platform-theme="danggeun"] {
  --theme-page-background: #fff8ef;
  --theme-surface: #fffdfa;
  --theme-surface-soft: #fff9f1;
  --theme-card-border: rgba(235, 135, 23, 0.24);
  --theme-card-shadow: 0 10px 28px rgba(139, 73, 0, 0.09);
  --theme-header-background:
    radial-gradient(circle at 82% 12%, rgba(235, 135, 23, 0.16), transparent 34%),
    linear-gradient(120deg, #fffdf8, #fff3e2);
}

.main[data-platform-theme] {
  min-height: 100vh;
  background: var(--theme-page-background);
  transition: background-color 160ms ease;
}

.main[data-platform-theme] .topbar {
  border-bottom-color: var(--theme-card-border);
  background: var(--theme-header-background);
  box-shadow: 0 5px 20px color-mix(in srgb, var(--platform-color) 8%, transparent);
}

.main[data-platform-theme] .dashboard-heading .eyebrow,
.main[data-platform-theme] .dashboard-mobile-header .eyebrow {
  color: var(--platform-ink);
}

.main[data-platform-theme] .dashboard-heading h1,
.main[data-platform-theme] .dashboard-mobile-header strong {
  color: #172033;
}

.main[data-platform-theme] .topbar-actions .report-period {
  border-color: var(--theme-card-border);
}

.main[data-platform-theme] .report-period strong {
  color: var(--platform-ink);
}

.main[data-platform-theme] .client-info {
  border-bottom-color: var(--theme-card-border);
  background: var(--theme-surface-soft);
  box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--platform-color) 7%, transparent);
}

.main[data-platform-theme] .client-info > div {
  border-right-color: var(--theme-card-border);
}

.main[data-platform-theme] .client-info strong {
  color: #263247;
}

.main[data-platform-theme] .mobile-report-tabs {
  border-color: var(--theme-card-border);
  background: var(--theme-page-background);
}

.main[data-platform-theme] .content {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--platform-color) 3%, transparent), transparent 220px);
}

.main[data-platform-theme] .report-section[data-platform-key] .section-heading {
  border: 1px solid var(--theme-card-border);
  border-left: 6px solid var(--platform-color);
  background: var(--theme-header-background);
  box-shadow: var(--theme-card-shadow);
}

.main[data-platform-theme] .report-section[data-platform-key] .metric-card,
.main[data-platform-theme] .report-section[data-platform-key] .panel,
.main[data-platform-theme] .report-section[data-platform-key] .chart-panel,
.main[data-platform-theme] .report-section[data-platform-key] .table-panel {
  border-color: var(--theme-card-border);
  background-color: var(--theme-surface);
  box-shadow: var(--theme-card-shadow);
}

.main[data-platform-theme] .report-section[data-platform-key] .metric-card {
  background:
    linear-gradient(180deg, var(--platform-tint), rgba(255, 255, 255, 0.98) 45%);
}

.main[data-platform-theme] .report-section[data-platform-key] .chart-wrap,
.main[data-platform-theme] .report-section[data-platform-key] .table-scroll {
  background: rgba(255, 255, 255, 0.94);
}

.main[data-platform-theme] .report-section[data-platform-key] .chart-header,
.main[data-platform-theme] .report-section[data-platform-key] .table-header,
.main[data-platform-theme] .report-section[data-platform-key] .panel-heading {
  background: linear-gradient(90deg, var(--platform-tint), var(--theme-surface) 64%);
}

.main[data-platform-theme] .report-section[data-platform-key] .campaign-filter-bar,
.main[data-platform-theme] .report-section[data-platform-key] .keyword-filter-panel,
.main[data-platform-theme] .report-section[data-platform-key] .analysis-empty-detail {
  border-color: var(--theme-card-border);
  background: var(--theme-surface-soft);
  box-shadow: 0 5px 18px color-mix(in srgb, var(--platform-color) 6%, transparent);
}

.main[data-platform-theme] .report-section[data-platform-key] .mobile-performance-card {
  border-color: var(--theme-card-border);
  background: var(--theme-surface);
  box-shadow: var(--theme-card-shadow);
}

@media (max-width: 768px) {
  .main[data-platform-theme] .topbar {
    background: var(--theme-header-background);
  }

  .main[data-platform-theme] .client-info,
  .main[data-platform-theme] .mobile-report-tabs {
    background: color-mix(in srgb, var(--theme-page-background) 82%, #fff);
  }

  .main[data-platform-theme] .content {
    padding-top: 22px;
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--platform-color) 5%, transparent), transparent 180px);
  }

  .main[data-platform-theme] .report-section[data-platform-key] .section-heading {
    border-left-width: 5px;
    box-shadow: 0 7px 20px color-mix(in srgb, var(--platform-color) 10%, transparent);
  }
}
