* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: #172033;
  background: #f7f8fa;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  line-height: 1.5;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 44px;
}

.container > h1 {
  margin: 32px 0 24px;
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  color: #172033;
  line-height: 1.12;
  letter-spacing: 0;
}

h2 {
  margin: 28px 0 10px;
}

h3 {
  margin: 18px 0 8px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid #dbe2e8;
}

.brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand:hover {
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: #172033;
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1rem;
}

.brand small {
  color: #64748b;
  font-size: 0.75rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.site-nav a {
  padding: 4px 0;
  color: #334155;
  font-size: 0.94rem;
  line-height: 1.2;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: #172033;
  box-shadow: 0 2px 0 #172033;
}

.site-nav-separator {
  width: 1px;
  height: 18px;
  background: #dbe2e8;
}

.site-nav form {
  margin: 0;
}

.nav-button {
  appearance: none;
  padding: 4px 0;
  border: 0;
  color: #334155;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 0.94rem;
  line-height: 1.2;
}

.nav-button:hover {
  color: #172033;
  box-shadow: 0 2px 0 #172033;
}

.eyebrow {
  margin: 0;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.login-shell {
  min-height: 100vh;
}

.login-header,
.login-main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.login-header {
  display: flex;
  align-items: center;
  min-height: 69px;
  padding: 16px 0;
  border-bottom: 1px solid #dbe2e8;
}

.login-main {
  padding: 32px 0 44px;
}

.login-panel {
  display: grid;
  gap: 16px;
  width: min(100%, 520px);
  margin: 28px 0;
  padding: 28px;
  border: 1px solid #dbe2e8;
  border-radius: 8px;
  background: #fff;
}

.login-panel h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3rem);
}

.login-panel > p:not(.eyebrow):not(.form-error) {
  margin: 0;
  color: #475569;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: #64748b;
  font-weight: 600;
}

.login-form input {
  width: 100%;
}

.form-error {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 7px;
  color: #991b1b;
  background: #fef2f2;
  font-weight: 700;
}

.account-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.account-panel > div,
.account-section {
  padding: 20px;
  border: 1px solid #dbe2e8;
  border-radius: 8px;
  background: #fff;
}

.account-panel > div {
  min-width: 0;
}

.account-panel strong {
  display: block;
  margin-top: 6px;
  font-size: 1.1rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.account-section {
  margin-top: 18px;
}

.account-section h2 {
  margin-top: 0;
}

.account-entities {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.account-entities a {
  padding: 7px 10px;
  border: 1px solid #dbe2e8;
  border-radius: 999px;
  background: #f8fbf9;
  text-transform: capitalize;
  text-decoration: none;
}

.account-password-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 16px;
  max-width: 980px;
}

.account-password-form label {
  display: grid;
  gap: 8px;
  color: #64748b;
  font-weight: 600;
}

.account-password-form input {
  width: 100%;
}

.account-password-form .btn {
  justify-self: start;
}

.personal-dashboard-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 32px 0 0;
}

.personal-dashboard-summary article {
  padding: 20px;
  border: 1px solid #dbe2e8;
  border-radius: 8px;
  background: #fff;
}

.personal-dashboard-summary span {
  display: block;
  color: #64748b;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.personal-dashboard-summary strong {
  display: block;
  margin-top: 6px;
  color: #172033;
  font-size: 1.45rem;
}

.personal-dashboard-summary small {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 0.85rem;
}

.dashboard-insights {
  margin-top: 32px;
}

.dashboard-insights h2 {
  margin: 0 0 14px;
}

.dashboard-insights > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.dashboard-insight {
  padding: 18px 20px;
  border: 1px solid #dbe2e8;
  border-left: 4px solid #94a3b8;
  border-radius: 8px;
  background: #fff;
}

.dashboard-insight.positive {
  border-left-color: #16803c;
}

.dashboard-insight.negative {
  border-left-color: #b42318;
}

.dashboard-insight strong {
  color: #172033;
}

.dashboard-insight p {
  margin: 6px 0 0;
  color: #64748b;
  line-height: 1.45;
}

.dashboard-empty-assignment {
  max-width: 720px;
  padding: 14px 16px;
  border: 1px solid #dbe2e8;
  border-radius: 8px;
  color: #475569;
  background: #fff;
}

.follower-goal {
  margin-top: 32px;
  padding: 16px 20px;
  border: 1px solid #dbe2e8;
  border-radius: 8px;
  background: #fff;
}

.follower-goal .section-heading {
  align-items: center;
  margin-bottom: 14px;
}

.follower-goal .section-heading h2 {
  margin: 0;
  font-size: 1.1rem;
}

.follower-goal .section-heading p {
  margin: 4px 0 0;
  color: #64748b;
}

.goal-empty,
.goal-progress-card,
.goal-form,
.monthly-report-loading {
  padding: 20px;
  border: 1px solid #dbe2e8;
  border-radius: 8px;
  background: #fff;
}

.goal-empty {
  margin: 0;
  color: #64748b;
}

.follower-goal .goal-progress-card,
.follower-goal .goal-empty,
.follower-goal .goal-form {
  padding: 0;
  border: 0;
}

.goal-progress-card > div:first-child {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.goal-progress-card strong {
  color: #172033;
  font-size: 1rem;
}

.goal-progress-card span,
.goal-progress-card small,
.goal-progress-card p {
  color: #64748b;
}

.goal-progress-card p {
  margin: 10px 0 2px;
}

.goal-progress {
  height: 10px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8ece9;
}

.goal-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #16803c;
}

.goal-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
}

.goal-form label {
  display: grid;
  flex: 1 1 220px;
  gap: 6px;
  color: #64748b;
  font-weight: 600;
}

.goal-form input {
  width: 100%;
}

.goal-delete {
  color: #991b1b;
}

.monthly-chart-card {
  min-width: 0;
  margin: 20px 0;
  padding: 24px;
  background: #fff;
  border: 1px solid #dbe2e8;
  border-radius: 12px;
}

.monthly-chart-card h3,
.monthly-chart-card h4 {
  margin: 0 0 12px;
}

.monthly-chart-note {
  color: #64748b;
  margin: 0 0 16px;
  line-height: 1.6;
}

.monthly-chart-scroll {
  overflow-x: auto;
  margin: 12px 0 20px;
}

.monthly-chart-scroll svg {
  display: block;
  width: 100%;
  min-width: 260px;
  height: 245px;
}

.monthly-chart-scroll text {
  font-size: 12px;
  fill: #64748b;
}

.monthly-chart-data summary {
  cursor: pointer;
  padding: 12px 0;
}

.monthly-contributions,
.monthly-chart-legend {
  list-style: none;
  margin: 0;
  padding: 0;
}

.monthly-contributions li {
  margin: 18px 0;
}

.monthly-contributions li > div:first-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  margin-bottom: 8px;
}

.monthly-contribution-track {
  height: 8px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
}

.monthly-contribution-track span {
  display: block;
  height: 100%;
}

.monthly-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin: 16px 0;
}

.monthly-chart-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.monthly-chart-legend li > span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .monthly-chart-card {
    padding: 16px;
  }
}

@media screen and (max-width: 600px) {
  .monthly-chart-scroll {
    margin-left: -8px;
    margin-right: -8px;
  }
}

@media print {
  .monthly-chart-card {
    break-inside: avoid;
  }

  .monthly-chart-scroll svg {
    min-width: 0;
  }
}

.monthly-report-controls,
.monthly-report-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: flex-end;
  gap: 8px;
}

.monthly-report-controls {
  justify-content: flex-start;
  margin-bottom: 20px;
}

.monthly-report-controls > label,
.monthly-report-actions label {
  display: grid;
  gap: 4px;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 600;
}

.monthly-report-controls select,
.monthly-report-actions select {
  width: auto;
}

.monthly-compare-picker {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

.monthly-compare-picker > label {
  display: grid;
  gap: 5px;
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 600;
}

.monthly-compare-picker input {
  width: min(320px, 80vw);
}

.monthly-compare-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 12;
  width: min(360px, 90vw);
  overflow: hidden;
  border: 1px solid #dbe2e8;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgb(15 23 42 / 14%);
}

.monthly-compare-suggestions button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #edf0f2;
  border-radius: 0;
  background: #fff;
  color: #172033;
  text-align: left;
}

.monthly-compare-suggestions button:hover {
  background: #f4f7f5;
}

.monthly-compare-suggestions small {
  color: #64748b;
}

.monthly-compare-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.monthly-compare-tags > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid #dbe2e8;
  border-radius: 999px;
  background: #fff;
  color: #475569;
}

.monthly-compare-tags button {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #64748b;
  line-height: 1;
}

.monthly-report-loading {
  min-height: 120px;
  color: #64748b;
}

.monthly-report-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.monthly-report-kpis article,
.monthly-highlights article {
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid #dbe2e8;
  border-radius: 8px;
  background: #fff;
}

.monthly-report-kpis span,
.monthly-highlights span {
  display: block;
  color: #64748b;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.monthly-report-kpis strong,
.monthly-highlights strong {
  display: block;
  margin-top: 5px;
  color: #172033;
  font-size: 1.3rem;
}

.monthly-report-kpis small,
.monthly-highlights small {
  display: block;
  margin-top: 3px;
  color: #64748b;
}

.monthly-anomalies {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.monthly-anomalies article {
  padding: 16px 18px;
  border: 1px solid #dbe2e8;
  border-left: 4px solid #94a3b8;
  border-radius: 8px;
  background: #fff;
}

.monthly-anomalies article.positive {
  border-left-color: #16803c;
}

.monthly-anomalies article.negative {
  border-left-color: #b42318;
}

.monthly-anomalies p {
  margin: 5px 0;
  color: #475569;
}

.monthly-anomalies small {
  color: #64748b;
}

.monthly-anomalies-empty {
  margin: 12px 0 0;
  padding: 14px 16px;
  border: 1px solid #dbe2e8;
  border-radius: 8px;
  color: #64748b;
  background: #fff;
}

.monthly-report-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(220px, 0.8fr);
  gap: 12px;
  margin-top: 12px;
}

.monthly-report-grid .table-scroll {
  margin: 0;
  border: 1px solid #dbe2e8;
  border-radius: 8px;
  background: #fff;
}

.monthly-platform-table {
  margin: 0;
  border: 0;
}

.monthly-highlights {
  display: grid;
  gap: 12px;
}

.monthly-comparison {
  margin-top: 20px;
}

.monthly-comparison h3 {
  margin: 0 0 10px;
}

.report-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 34px 0 24px;
}

.report-title h1 {
  margin: 4px 0;
}

.report-title p {
  margin: 0;
  color: #64748b;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 32px 0 24px;
}

.admin-heading h1 {
  margin: 4px 0 0;
  font-size: clamp(2rem, 4.5vw, 3rem);
}

.admin-heading > span {
  color: #64748b;
  font-weight: 600;
}

.form-success {
  padding: 10px 12px;
  border: 1px solid #bbdfc8;
  border-radius: 8px;
  color: #14532d;
  background: #edf6f0;
  font-weight: 700;
}

.admin-user-section {
  margin: 28px 0;
}

.admin-user-form,
.admin-user-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid #dbe2e8;
  border-radius: 8px;
  background: #fff;
}

.admin-user-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}

.admin-user-form label,
.admin-user-card label {
  display: grid;
  gap: 8px;
  color: #64748b;
  font-weight: 600;
}

.admin-user-form input,
.admin-user-form select,
.admin-user-card input,
.admin-user-card select {
  width: 100%;
}

.admin-user-entity {
  grid-row: span 2;
}

.admin-user-entity select {
  text-transform: capitalize;
}

.checkbox-label {
  display: flex !important;
  align-items: center;
  align-self: center;
  gap: 8px;
  grid-template-columns: auto 1fr;
}

.checkbox-label input {
  width: auto;
}

.admin-user-actions {
  display: flex;
  justify-content: flex-start;
}

.admin-user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.admin-user-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-user-card-heading span {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.status-active {
  color: #14532d;
  background: #edf6f0;
}

.status-inactive {
  color: #991b1b;
  background: #fef2f2;
}

.stats {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid #dbe2e8;
  border-radius: 8px;
  background: #fff;
}

.stats th,
.stats td {
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #edf1f5;
  text-align: left;
}

.stats th {
  color: #475569;
  background: #f1f5f2;
  font-size: 0.84rem;
}

.stats tbody tr:last-child > * {
  border-bottom: 0;
}

.stats tbody tr:hover > * {
  background: #f8fbf9;
}

.stats .number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table-scroll,
.ranking-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.table-scroll:focus-visible {
  outline: 2px solid #14532d;
  outline-offset: 2px;
}

.table-scroll .stats {
  min-width: 640px;
}

.responsive-form,
.ranking-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.responsive-form label,
.ranking-filters label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.limit-input {
  width: 90px;
}

.min-followers-input {
  width: 120px;
}

.follower-ranking {
  min-width: 850px;
}

.follower-ranking .number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.sort-link {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.sort-link:hover {
  color: #14532d;
  text-decoration: underline;
}

.follower-ranking .rank {
  width: 72px;
  text-align: center;
  font-weight: 600;
  white-space: nowrap;
}

.rank-number {
  display: inline-block;
  min-width: 22px;
}

.follower-ranking .rank-change {
  display: inline-block;
  min-width: 32px;
  margin-left: 6px;
  font-size: 0.9em;
  font-weight: 600;
  text-align: left;
}

.trend-value.up {
  color: #166534;
}

.trend-value.down {
  color: #991b1b;
}

.trend-value.flat {
  color: #64748b;
}

.rank-change.up {
  color: #166534;
}

.rank-change.down {
  color: #991b1b;
}

.rank-change.flat {
  color: #64748b;
}

.data-age {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-size: 0.9em;
}

.data-age::before {
  width: 0.55em;
  height: 0.55em;
  margin-right: 0.4em;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.data-age.fresh {
  color: #166534;
}

.data-age.warn {
  color: #b45309;
}

.data-age.stale {
  color: #991b1b;
}

.data-age.missing {
  color: #64748b;
}

.growth-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 16px;
  align-items: start;
}

.growth-card h2 {
  margin: 0 0 10px;
}

.growth-card {
  padding: 18px;
  border: 1px solid #dbe2e8;
  border-radius: 8px;
  background: #fff;
}

.table-scroll .growth-table {
  min-width: 0;
}

.growth-table .number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.empty-table {
  padding: 12px;
  text-align: center !important;
}

.card {
  padding: 18px;
  border: 1px solid #dbe2e8;
  border-radius: 8px;
  min-width: 140px;
  background: #fff;
}
.card .k {
  font-size: 12px;
  color: #666;
}
.card .v {
  font-size: 18px;
  font-weight: 600;
}

.chart-card {
  width: 100%;
  border: 1px solid #dbe2e8;
  border-radius: 8px;
  background: #fff;
}
.chart-wrap {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}
.chart-wrap svg {
  width: 100%;
  height: auto;
  display: block;
}

.dashboard-chart {
  box-sizing: border-box;
  padding: 24px;
}

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

.chart-heading h2 {
  margin: 0;
}

.chart-heading p {
  margin: 4px 0 0;
  color: #64748b;
}

.chart-heading-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.chart-heading-actions label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  line-height: 1.3;
  white-space: nowrap;
}

.chart-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px 16px;
  margin-top: 12px;
}

.chart-legend-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  transition: opacity 0.15s;
}

.chart-legend-item.inactive {
  opacity: 0.45;
}

.chart-legend-item a {
  min-width: 0;
  text-decoration: none;
}

.chart-legend-item a:hover {
  text-decoration: underline;
}

.chart-legend-color {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.chart-series-toggle {
  display: inline-grid;
  grid-template-columns: 10px 10px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #d7decf;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  color: #172033;
}

.chart-series-toggle:hover {
  border-color: #b8d3c2;
  color: #14532d;
  background: #f8fbf9;
}

.chart-selection-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.chart-selection-actions .btn:disabled {
  cursor: default;
  opacity: 0.45;
}

.chart-empty-selection {
  display: grid;
  min-height: 220px;
  place-items: center;
  color: #64748b;
  text-align: center;
}

.chart-toolbar,
.metric-buttons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.chart-toolbar {
  margin-bottom: 8px;
}

.entity-chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.entity-chart-header .chart-toolbar {
  flex: 0 0 auto;
  justify-content: flex-end;
  margin-bottom: 0;
}

.entity-chart-title {
  margin-bottom: 18px;
}

.entity-chart-header .entity-chart-title {
  min-width: 0;
  margin-bottom: 0;
}

.entity-chart-title h2 {
  margin: 0;
}

.entity-chart-title p {
  margin: 4px 0 0;
  color: #64748b;
}

.metric-buttons {
  gap: 6px;
}

.chart-period-label {
  margin-left: 12px;
}

.compare-picker {
  position: relative;
}

.compare-picker label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.compare-picker input {
  width: 180px;
}

.compare-suggestions {
  position: absolute;
  z-index: 5;
  top: calc(100% + 4px);
  right: 0;
  width: min(320px, 80vw);
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.compare-suggestions button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: #172033;
  cursor: pointer;
  text-align: left;
}

.compare-suggestions button:hover {
  color: #14532d;
  background: #f8fbf9;
}

.compare-suggestions small {
  color: #64748b;
}

.search-feedback {
  padding: 12px;
  color: #64748b;
  font-size: 0.875rem;
}

.compare-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 10px;
  color: #64748b;
  font-size: 0.875rem;
}

.compare-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 7px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fbf9;
}

.compare-legend i {
  display: inline-block;
  width: 22px;
  border-top: 3px solid;
}

.compare-legend .primary-line {
  border-color: #2563eb;
}

.compare-legend .compare-line {
  border-color: #ea580c;
  border-top-style: dashed;
}

.compare-remove {
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  border: 1px solid #d7decf;
  border-radius: 999px;
  background: #fff;
  color: #172033;
  cursor: pointer;
  line-height: 1;
}

.entity-section {
  margin-top: 28px;
}

.entity-section > h2,
.section-heading h2 {
  margin: 0 0 12px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.section-heading > span {
  color: #64748b;
  font-size: 0.875rem;
}

.section-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.section-filter label {
  display: flex;
  gap: 8px;
  align-items: center;
}

.section-filter select {
  width: auto;
}

.entity-chart-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}

.entity-chart-summary span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.875rem;
}

.entity-chart-summary strong {
  color: #172033;
  font-size: 0.95rem;
}

.entity-chart-summary .up strong {
  color: #166534;
}

.entity-chart-summary .down strong {
  color: #991b1b;
}

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

.platform-card {
  padding: 14px;
  border: 1px solid #dbe2e8;
  border-radius: 8px;
  background: #fff;
}

.platform-card-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.platform-card-heading span,
.platform-card small {
  color: #64748b;
  font-size: 0.75rem;
}

.platform-followers {
  margin-top: 14px;
  font-size: 1.25rem;
  font-weight: 700;
}

.platform-followers span {
  margin-left: 6px;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 400;
}

.platform-share {
  height: 6px;
  margin: 12px 0 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.platform-share span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #14532d;
}

.summary-row td {
  background: #f8fbf9;
  font-weight: 700;
}

.data-tools {
  margin-top: 28px;
  padding: 12px 14px;
  border: 1px solid #dbe2e8;
  border-radius: 8px;
  background: #fff;
}

.data-tools > summary {
  font-weight: 600;
}

.data-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.875rem;
}

.table-action-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #d7decf;
  color: #172033;
  -webkit-text-fill-color: currentColor;
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
}
.btn:hover {
  border-color: #b8d3c2;
  color: #14532d;
  background: #f8fbf9;
}

button.btn {
  color: #172033;
  -webkit-text-fill-color: currentColor;
}

.btn-danger {
  border-color: #ef4444;
  color: #b91c1c;
}
.btn-danger:hover {
  background: #fef2f2;
}
.btn-primary {
  border-color: #cfe1d6;
  background: #edf6f0;
  color: #14532d;
}

.btn-primary:hover {
  border-color: #b8d3c2;
  color: #14532d;
  background: #e4f1e8;
}

button.btn-primary {
  color: #14532d;
  -webkit-text-fill-color: currentColor;
}

.badge {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 999px;
  border: 1px solid #ddd;
  background: #f9f9f9;
}
input[type="text"],
input[type="search"],
input[type="number"],
input[type="email"],
input[type="password"] {
  max-width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  font: inherit;
}

td form input[type="text"] {
  padding: 4px 6px;
  font-size: 12px;
}

details > summary {
  cursor: pointer;
}
details form input[type="text"] {
  padding: 4px 6px;
  font-size: 12px;
}

select {
  max-width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  font: inherit;
}

a {
  color: #14532d;
  text-decoration: underline;
  overflow-wrap: anywhere;
}

a:hover {
  color: #14532d;
  text-decoration: underline;
}

code {
  overflow-wrap: anywhere;
}

@media (max-width: 1024px) {
  .monthly-report-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

@media (max-width: 768px) {
  .container {
    width: min(100% - 24px, 1180px);
    padding: 0 0 32px;
  }

  .container > h1 {
    margin: 24px 0 18px;
    font-size: 2rem;
  }

  .container > h2 {
    font-size: 1.2rem;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .site-nav {
    justify-content: flex-start;
    gap: 10px 16px;
  }

  .site-nav-separator {
    display: none;
  }

  .admin-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    margin: 24px 0 18px;
  }

  .admin-user-form {
    grid-template-columns: 1fr;
  }

  .account-password-form {
    grid-template-columns: 1fr;
  }

  .admin-user-entity {
    grid-row: auto;
  }

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

  .personal-dashboard-summary article:first-child {
    grid-column: 1 / -1;
  }

  .dashboard-insights > div {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .monthly-report-controls,
  .report-title {
    align-items: stretch;
    flex-direction: column;
  }

  .monthly-report-actions {
    justify-content: flex-start;
  }

  .monthly-report-controls {
    align-items: stretch;
  }

  .monthly-report-controls > label,
  .monthly-report-controls select {
    width: 100%;
  }

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

  .monthly-report-grid {
    grid-template-columns: 1fr;
  }

  .monthly-report-grid .table-scroll {
    margin-inline: 0;
    width: 100%;
  }

  .monthly-compare-picker > label,
  .monthly-compare-picker input {
    width: 100%;
  }

  .login-panel {
    margin-top: 24px;
    padding: 20px;
  }

  .responsive-form,
  .ranking-filters {
    align-items: stretch;
  }

  .responsive-form label,
  .ranking-filters label {
    flex: 1 1 180px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .responsive-form input:not([type="hidden"]),
  .responsive-form select,
  .ranking-filters input,
  .ranking-filters select {
    width: 100% !important;
    min-height: 42px;
  }

  .responsive-form > .btn,
  .ranking-filters > .btn {
    min-height: 42px;
  }

  .table-scroll {
    margin-inline: -12px;
    width: calc(100% + 24px);
    max-width: none;
  }

  .table-scroll .stats {
    margin-top: 8px;
    font-size: 0.875rem;
  }

  .table-scroll th,
  .table-scroll td {
    padding: 7px 8px;
    white-space: nowrap;
  }

  .dashboard-chart {
    padding: 12px;
  }

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

  .growth-card {
    min-width: 0;
  }

  .table-scroll .growth-table {
    min-width: 560px;
  }

  .chart-heading {
    flex-direction: column;
    gap: 8px;
  }

  .entity-chart-header {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .entity-chart-header .chart-toolbar {
    justify-content: flex-start;
  }

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

  .chart-period-label {
    margin-left: 0;
  }

  .compare-picker,
  .compare-picker label,
  .compare-picker input {
    width: 100%;
  }

  .compare-suggestions {
    right: auto;
    left: 0;
    width: 100%;
  }

  .entity-chart-summary {
    gap: 16px;
  }

  .entity-chart-summary span {
    padding: 4px 8px;
    font-size: 0.75rem;
  }

  .entity-chart-summary strong {
    font-size: 0.8rem;
  }

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

  .table-action-form input[type="text"] {
    min-width: 180px;
  }

  .pagination .btn {
    min-width: 40px;
    min-height: 42px;
  }
}

@media (max-width: 420px) {
  .monthly-report-kpis {
    grid-template-columns: 1fr;
  }

  .responsive-form label,
  .ranking-filters label {
    flex-basis: 100%;
  }

  .responsive-form > .btn,
  .ranking-filters > .btn {
    flex: 1 1 calc(50% - 4px);
  }

  .metric-buttons {
    width: 100%;
  }

  .metric-buttons .btn {
    flex: 1 1 calc(33.333% - 4px);
  }
}

.report-print-brand {
  display: none;
}

@page monthly-report {
  size: A4 portrait;
  margin: 14mm;
}

@media print {
  body {
    background: #fff;
  }

  .site-header,
  .no-print {
    display: none !important;
  }

  .container {
    width: 100%;
    max-width: none;
    padding: 0;
  }

  .report-title {
    margin-top: 0;
  }

  .monthly-report-kpis,
  .monthly-anomalies,
  .monthly-report-grid,
  .monthly-comparison {
    break-inside: avoid;
  }

  .report-page {
    page: monthly-report;
    font-size: 10pt;
    line-height: 1.4;
    color: #172033;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .report-page .report-print-brand {
    display: block;
    border-bottom: 1px solid #dbe2e8;
    padding-bottom: 3mm;
    margin-bottom: 5mm;
    font-size: 9pt;
    font-weight: 600;
    color: #475569;
  }

  .report-page .monthly-chart-data,
  .report-page .monthly-report-controls {
    display: none !important;
  }

  .report-page .report-title {
    display: block;
    margin: 0 0 5mm;
  }

  .report-page .report-title h1 {
    font-size: 24pt;
    margin: 2mm 0;
  }

  .report-page .report-title p {
    margin: 1mm 0;
    font-size: 10pt;
  }

  .report-page .monthly-report-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3mm;
  }

  .report-page .monthly-report-kpis article,
  .report-page .monthly-highlights article,
  .report-page .monthly-anomalies article {
    padding: 3mm;
    box-shadow: none;
  }

  .report-page .monthly-report-kpis span,
  .report-page .monthly-highlights span {
    font-size: 8pt;
  }

  .report-page .monthly-report-kpis strong,
  .report-page .monthly-highlights strong {
    font-size: 15pt;
  }

  .report-page .monthly-chart-card {
    margin: 5mm 0;
    padding: 3mm;
    border-radius: 2mm;
    box-shadow: none;
  }

  .report-page h3 {
    font-size: 13pt;
    break-after: avoid;
  }

  .report-page h4 {
    font-size: 10pt;
    break-after: avoid;
  }

  .report-page .monthly-chart-note {
    font-size: 9pt;
    line-height: 1.4;
    margin-bottom: 3mm;
  }

  .report-page .monthly-chart-scroll {
    overflow: visible;
    margin: 2mm 0 4mm;
  }

  .report-page .monthly-chart-scroll svg {
    min-width: 0;
    height: auto;
    max-height: none;
  }

  .report-page .monthly-platform-contributions,
  .report-page .monthly-comparison {
    break-before: page;
    margin-top: 0;
  }

  .report-page .monthly-comparison {
    break-inside: auto;
  }

  .report-page .monthly-contributions li {
    margin: 3mm 0;
    break-inside: avoid;
  }

  .report-page .monthly-report-grid {
    display: block;
    break-inside: auto;
    margin-top: 4mm;
  }

  .report-page .monthly-highlights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 3mm;
    break-inside: avoid;
  }

  .report-page .table-scroll {
    width: 100%;
    max-width: none;
    margin: 0;
    overflow: visible;
  }

  .report-page .table-scroll .stats {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    font-size: 9pt;
  }

  .report-page .table-scroll th,
  .report-page .table-scroll td {
    padding: 2.5mm 2mm;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .report-page .table-scroll .num {
    white-space: nowrap;
  }

  .report-page thead {
    display: table-header-group;
  }

  .report-page tr {
    break-inside: avoid;
  }

  .report-page .monthly-anomalies {
    grid-template-columns: 1fr;
    break-inside: auto;
  }

  .report-page .monthly-anomalies article {
    break-inside: avoid;
  }
}
/* Immediate feedback for full-page navigation; hovered internal links warm the route. */
.navigation-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  height: 3px;
  background: var(--accent, #2563eb);
  opacity: 0;
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 4s cubic-bezier(0.1, 0.65, 0.2, 1), opacity 120ms;
}

.navigation-progress.is-loading {
  opacity: 1;
  transform: scaleX(0.92);
}

@media (prefers-reduced-motion: reduce) {
  .navigation-progress {
    transition: opacity 120ms;
  }

  .navigation-progress.is-loading {
    transform: scaleX(1);
  }
}
