.range-card {
  margin-bottom: 18px;
  padding: 14px 18px;
}

.range-form,
.discord-demo-form {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.range-form label,
.discord-demo-form label {
  color: var(--muted);
  display: grid;
  font-size: 11px;
  font-weight: 750;
  gap: 6px;
}

.range-form select,
.range-form input,
.discord-demo-form input {
  background: #fff;
  border: 1px solid #dfe3eb;
  border-radius: 10px;
  color: var(--ink);
  min-width: 145px;
  padding: 10px 12px;
}

.custom-range {
  display: flex;
  gap: 10px;
}

.discord-demo-card {
  margin-top: 18px;
}

.discord-demo-form {
  margin-top: 18px;
}

.admin-add-form {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin: 18px 0 8px;
}

.admin-add-form label {
  color: var(--muted);
  display: grid;
  font-size: 11px;
  font-weight: 750;
  gap: 6px;
}

.admin-add-form input {
  background: #fff;
  border: 1px solid #dfe3eb;
  border-radius: 10px;
  color: var(--ink);
  min-height: 44px;
  padding: 10px 12px;
  width: 100%;
}

.form-help {
  color: var(--muted);
  display: block;
  line-height: 1.45;
  margin-bottom: 15px;
}

.admin-user-list {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.user-actions {
  align-items: center;
  display: flex !important;
  flex: 0 0 auto;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.user-actions form {
  margin: 0;
}

.kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
}

.heading-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.section-date-filter {
  align-items: flex-end;
  display: flex;
  gap: 9px;
}

.section-date-filter label {
  color: var(--muted);
  display: grid;
  font-size: 11px;
  font-weight: 750;
  gap: 5px;
}

.section-date-filter input {
  background: #fff;
  border: 1px solid #dfe3eb;
  border-radius: 10px;
  color: var(--ink);
  padding: 9px 11px;
}

.daily-matrix-scroll {
  max-height: 560px;
}

.daily-matrix {
  min-width: 100%;
  width: max-content;
}

.daily-matrix th,
.daily-matrix td {
  min-width: 170px;
  white-space: nowrap;
}

.daily-matrix th:first-child,
.daily-matrix td:first-child {
  background: #fff;
  left: 0;
  min-width: 190px;
  position: sticky;
  text-align: left;
  z-index: 2;
}

.daily-matrix th:nth-child(2),
.daily-matrix td:nth-child(2) {
  background: #eef4ff;
  left: 190px;
  min-width: 130px;
  position: sticky;
  z-index: 2;
}

.daily-matrix thead th {
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 3;
}

.daily-matrix thead th:first-child,
.daily-matrix thead th:nth-child(2) {
  z-index: 4;
}

.daily-matrix tfoot td {
  border-top: 1px solid #cfd6e3;
  bottom: 0;
  font-weight: 800;
  position: sticky;
}

.daily-matrix tfoot td:not(:first-child):not(:nth-child(2)) {
  background: #f8fafc;
}

.matrix-dot {
  background: var(--violet);
  border-radius: 4px;
  display: inline-block;
  height: 9px;
  margin-right: 7px;
  width: 9px;
}

.pill.provisional {
  background: #fff1c7;
  color: #946200;
}

[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .topbar {
    flex-wrap: wrap;
    height: auto;
    min-height: 68px;
    padding: 12px 20px;
  }

  .brand {
    min-width: 0;
  }

  .nav {
    height: 44px;
    order: 3;
    overflow: auto;
    width: 100%;
  }

  .user-copy {
    display: none;
  }

  .app-shell {
    padding-top: 22px;
    width: min(100% - 24px, 1320px);
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .heading-actions {
    justify-content: space-between;
    width: 100%;
  }

  .dashboard-grid,
  .settings-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .mini-kpis {
    grid-template-columns: repeat(2, 1fr);
  }

  .property-row,
  .property-add,
  .inline-form {
    grid-template-columns: 1fr;
  }

  .login-layout {
    grid-template-columns: 1fr;
  }

  .login-story {
    display: none;
  }

  .login-card {
    margin: 10vh auto;
  }

  .card header {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 560px) {
  .kpi-grid,
  .mini-kpis {
    grid-template-columns: 1fr;
  }

  .range-form,
  .custom-range {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .range-form select,
  .range-form input,
  .range-form button {
    width: 100%;
  }

  .button-row {
    flex-wrap: wrap;
  }

  .admin-add-form {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .admin-add-form .btn {
    width: 100%;
  }

  .admin-user-row {
    align-items: stretch;
    flex-direction: column;
  }

  .user-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .user-actions form,
  .user-actions .btn,
  .user-actions .pill {
    width: 100%;
  }

  .section-date-filter {
    align-items: stretch;
    width: 100%;
  }

  .section-date-filter label {
    flex: 1;
  }

  .page-heading h1 {
    font-size: 26px;
  }
}

/* Mobile-first finishing layer. Keep desktop unchanged while making every
   primary action reachable and every wide report scrollable by touch. */
html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body,
main,
.card,
.page-heading > div,
.list-row > div {
  min-width: 0;
}

.table-scroll,
.fb-detail-table,
.report-range,
.nav {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

.mini-error,
.alert,
.list-row small,
.property-row small {
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .topbar {
    column-gap: 10px;
  }

  .nav {
    margin: 10px 0 -12px;
  }

  .user-menu .btn {
    display: inline-flex;
  }

  .heading-actions form {
    min-width: 0;
  }

  .table-scroll > table:not(.daily-matrix) {
    min-width: 680px;
  }

  .property-row {
    background: #fafbfc;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 9px 10px;
  }

  .brand span:last-child {
    display: grid;
  }

  .brand b {
    font-size: 14px;
  }

  .brand small,
  .user-menu img,
  .user-menu .avatar,
  .user-copy {
    display: none;
  }

  .user-menu {
    gap: 0;
  }

  .user-menu .btn {
    min-height: 38px;
    padding: 7px 10px;
  }

  .nav {
    gap: 2px;
    height: 46px;
    margin-top: 7px;
  }

  .nav a {
    flex: 0 0 auto;
    justify-content: center;
    min-height: 44px;
    padding: 0 13px;
  }

  .app-shell {
    padding: 14px 0 42px;
    width: calc(100% - 16px);
  }

  .page-heading {
    gap: 14px;
    margin-bottom: 17px;
  }

  .page-heading h1 {
    font-size: 24px;
    line-height: 1.15;
  }

  .page-heading p {
    font-size: 13px;
    line-height: 1.5;
  }

  .heading-actions {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

  .heading-actions form,
  .heading-actions form .btn,
  .heading-actions > .btn {
    width: 100%;
  }

  .btn {
    min-height: 44px;
  }

  .btn.small {
    min-height: 40px;
  }

  .card {
    border-radius: 14px;
  }

  .kpi,
  .fb-report-kpi {
    min-height: 0;
    padding: 17px;
  }

  .kpi strong,
  .fb-report-kpi > strong {
    margin: 12px 0 14px;
  }

  .chart-wrap,
  .fb-report-chart {
    height: 240px;
  }

  .status-row {
    align-items: flex-start;
  }

  .status-row .pill {
    flex: 0 0 auto;
  }

  .card header {
    gap: 12px;
  }

  .table-scroll,
  .fb-detail-table {
    margin-inline: -15px;
    padding-inline: 15px;
  }

  table {
    font-size: 12px;
  }

  th,
  td {
    padding: 11px 9px;
  }

  .table-scroll > table:not(.daily-matrix) th:first-child,
  .table-scroll > table:not(.daily-matrix) td:first-child {
    background: #fff;
    left: 0;
    min-width: 180px;
    position: sticky;
    text-align: left;
    z-index: 2;
  }

  .section-date-filter {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .section-date-filter input {
    min-height: 44px;
    width: 100%;
  }

  .daily-matrix th,
  .daily-matrix td {
    min-width: 145px;
  }

  .daily-matrix th:first-child,
  .daily-matrix td:first-child {
    min-width: 120px;
  }

  .daily-matrix th:nth-child(2),
  .daily-matrix td:nth-child(2) {
    left: 120px;
    min-width: 100px;
  }

  .report-toolbar {
    padding: 14px;
  }

  .report-range {
    width: 100%;
  }

  .report-range button {
    min-height: 42px;
  }

  .fb-report-section > header .btn {
    width: 100%;
  }

  .fb-report-legend {
    max-height: 150px;
  }

  .fb-detail-table th,
  .fb-detail-table td {
    min-width: 105px;
  }

  .fb-detail-table th:first-child,
  .fb-detail-table td:first-child {
    min-width: 88px;
  }

  .fb-detail-table th:nth-child(2),
  .fb-detail-table td:nth-child(2) {
    left: 88px;
    min-width: 102px;
  }

  .settings-grid,
  .admin-grid {
    gap: 12px;
  }

  .info-card dl div {
    align-items: start;
    display: grid;
    gap: 5px;
  }

  .info-card dd {
    overflow-wrap: anywhere;
    text-align: left;
  }

  .button-row {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .button-row form,
  .button-row .btn {
    width: 100%;
  }

  .inline-form,
  .property-add,
  .property-row,
  .discord-demo-form {
    gap: 10px;
  }

  .inline-form input,
  .inline-form select,
  .property-row input,
  .property-row select,
  .discord-demo-form input {
    min-height: 44px;
  }

  .check {
    min-height: 44px;
  }

  .list-row {
    align-items: flex-start;
  }

  .login-card {
    margin: 7vh auto;
    padding: 22px;
    width: calc(100% - 24px);
  }

  .center-card {
    margin-top: 8vh;
    padding: 24px 18px;
    width: calc(100% - 20px);
  }
}

/* True phone layout: navigation becomes a thumb-friendly bottom bar and
   summary tables become readable cards instead of squeezed desktop tables. */
@media (max-width: 560px) {
  body {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  .topbar {
    flex-wrap: nowrap;
    height: 58px;
    min-height: 58px;
  }

  .brand-mark {
    border-radius: 10px;
    height: 34px;
    width: 34px;
  }

  .nav {
    align-items: stretch;
    backdrop-filter: blur(18px);
    background: rgba(255, 255, 255, .94);
    border: 1px solid rgba(214, 220, 231, .9);
    border-radius: 17px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    box-shadow: 0 12px 32px rgba(22, 32, 51, .18);
    display: flex;
    height: 62px;
    left: 8px;
    margin: 0;
    overflow: visible;
    padding: 5px;
    position: fixed;
    right: 8px;
    width: auto;
    z-index: 60;
  }

  .nav a {
    border: 0;
    border-radius: 12px;
    color: #687084;
    flex: 1 1 0;
    flex-direction: column;
    font-size: 10px;
    gap: 2px;
    line-height: 1;
    min-width: 0;
    padding: 5px 3px;
  }

  .nav a::before {
    content: attr(data-icon);
    display: block;
    font-size: 18px;
    font-weight: 900;
    line-height: 1.1;
  }

  .nav a:hover,
  .nav a.active {
    background: #edf3ff;
    border: 0;
    color: var(--blue);
  }

  .app-shell {
    padding-bottom: 22px;
  }

  .heading-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
  }

  .heading-actions > .sync-label,
  .heading-actions > .pill {
    flex: 1 0 100%;
  }

  .heading-actions form {
    flex: 1 1 140px;
  }

  .kpi-grid,
  .mini-kpis,
  .fb-report-kpis {
    gap: 9px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-grid .kpi:first-child,
  .fb-report-kpis .fb-report-kpi:first-child,
  .fb-report-kpis .fb-report-kpi:last-child {
    grid-column: 1 / -1;
  }

  .kpi,
  .mini-kpis > div,
  .fb-report-kpi {
    padding: 14px;
  }

  .kpi > span,
  .fb-report-kpi > span,
  .mini-kpis span {
    font-size: 11px;
  }

  .kpi strong,
  .fb-report-kpi > strong,
  .mini-kpis strong {
    font-size: clamp(21px, 7.5vw, 29px);
    overflow-wrap: anywhere;
  }

  .kpi strong.text-value,
  .fb-report-kpi > strong.name {
    font-size: 16px;
    white-space: normal;
  }

  .kpi footer,
  .fb-report-kpi footer {
    align-items: flex-end;
    gap: 6px;
  }

  .mobile-card-table {
    display: block;
    min-width: 0 !important;
    width: 100%;
  }

  .mobile-card-table thead {
    display: none;
  }

  .mobile-card-table tbody {
    display: grid;
    gap: 10px;
  }

  .mobile-card-table tr {
    background: #fafbfc;
    border: 1px solid var(--line);
    border-radius: 13px;
    display: grid;
    padding: 10px 12px;
  }

  .mobile-card-table td,
  .table-scroll > .mobile-card-table td:first-child {
    align-items: center;
    background: transparent;
    border: 0;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    left: auto;
    min-width: 0;
    padding: 7px 0;
    position: static;
    text-align: right;
    width: 100%;
  }

  .mobile-card-table td::before {
    color: var(--muted);
    content: attr(data-label);
    flex: 0 0 auto;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
  }

  .mobile-card-table td:first-child {
    border-bottom: 1px solid var(--line);
    display: block;
    padding-bottom: 10px;
    text-align: left;
  }

  .mobile-card-table td:first-child::before {
    display: none;
  }

  .mobile-card-table td.empty {
    display: block;
    padding: 20px 8px;
    text-align: center;
  }

  .mobile-card-table td.empty::before {
    display: none;
  }

  .page-management-table .entity-name {
    align-items: flex-start;
  }

  .page-management-table code {
    max-width: 62%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .table-card:has(.mobile-card-table) .table-scroll {
    margin: 0;
    padding: 0;
  }

  .daily-matrix-scroll,
  .fb-detail-table {
    background: linear-gradient(90deg, transparent 92%, rgba(37, 99, 235, .08));
  }

  .range-card {
    padding: 12px;
  }

  .range-form {
    gap: 9px;
  }

  .report-toolbar {
    gap: 10px;
  }

  .report-range button {
    flex: 1 0 auto;
    padding-inline: 11px;
  }

  .fb-page-card {
    padding: 15px;
  }

  .fb-report-section {
    padding: 14px;
  }

  .facebook-settings > summary {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 13px;
  }
}

/* Dashboard information architecture: one concise overview and one drill-down. */
.dashboard-view-tabs {
  background: #e9edf5;
  border-radius: 12px;
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
  padding: 4px;
  width: min(360px, 100%);
}

.dashboard-view-tabs button,
.range-chips button {
  background: transparent;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  cursor: pointer;
  font-weight: 750;
  min-height: 40px;
  padding: 8px 14px;
}

.dashboard-view-tabs button.active,
.range-chips button.active {
  background: #fff;
  box-shadow: 0 2px 8px rgba(30, 41, 59, .09);
  color: var(--blue);
}

.unified-range-card { margin-bottom: 18px; padding: 16px; }
.unified-range-heading { align-items: center; display: flex; justify-content: space-between; margin-bottom: 12px; }
.unified-range-heading > div { align-items: baseline; display: flex; flex-wrap: wrap; gap: 8px 12px; }
.unified-range-heading strong { font-size: 14px; }
.unified-range-heading span { color: var(--muted); font-size: 12px; }
.range-chips {
  background: #eef2f8;
  border-radius: 11px;
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  padding: 4px;
}
.range-chips .range-custom-trigger.active { background: #fff; box-shadow: 0 2px 8px rgba(30, 41, 59, .09); color: var(--blue); }
.compact-range-dialog { width: min(520px, calc(100% - 28px)); }
.compact-range-dialog .range-dialog-shell { grid-template-rows: auto auto minmax(0, 1fr); }
.advanced-range-tabs { grid-template-columns: repeat(3, 1fr); }
.custom-range-intro { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 18px 0 0; }

.overview-kpis {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.overview-total {
  overflow: hidden;
  padding: 22px;
  position: relative;
}

.overview-total::before {
  background: var(--accent);
  bottom: 0;
  content: "";
  left: 0;
  position: absolute;
  top: 0;
  width: 4px;
}

.overview-total > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.overview-total > strong {
  display: block;
  font-size: 36px;
  letter-spacing: -.04em;
  margin: 10px 0 16px;
}

.overview-total footer {
  color: var(--muted);
  display: flex;
  font-size: 12px;
  justify-content: space-between;
}

.comparison-hint {
  color: var(--muted);
  display: block;
  font-size: 11px;
  line-height: 1.4;
  margin-top: 8px;
}

.highlights-card {
  margin-bottom: 18px;
  padding: 20px;
}

.highlight-list {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 14px;
}

.highlight-item {
  align-items: center;
  border-right: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 10px 18px;
}

.highlight-item:last-child { border-right: 0; }
.highlight-item > div { display: grid; min-width: 0; }
.highlight-item small { color: var(--muted); }
.highlight-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.highlight-item > b { font-size: 13px; white-space: nowrap; }
.highlight-icon { border-radius: 10px; display: grid; font-weight: 850; height: 36px; place-items: center; width: 36px; }
.highlight-icon.violet { background: #f1eafe; color: var(--violet); }
.highlight-icon.green { background: #e7f8f0; color: var(--green); }
.highlight-icon.amber { background: #fff3db; color: var(--amber); }
.highlight-icon.blue { background: #eaf1ff; color: var(--blue); }
.page-breakdown-card { scroll-margin-top: 90px; }

.section-title-line { align-items: center; display: flex; flex-wrap: wrap; gap: 9px; }
.blog-toolbar { align-items: center; display: grid; gap: 10px; grid-template-columns: minmax(220px, 1fr) auto auto; margin: 14px 0; }
.blog-search { align-items: center; border: 1px solid #dfe3eb; border-radius: 10px; display: flex; gap: 8px; min-height: 44px; padding: 0 12px; }
.blog-search:focus-within { border-color: #8fb1f9; box-shadow: 0 0 0 3px #eaf1ff; }
.blog-search input { border: 0; min-width: 0; outline: 0; width: 100%; }
.blog-sort { align-items: center; display: flex; gap: 8px; }
.blog-sort > span { color: var(--muted); font-size: 11px; font-weight: 750; }
.blog-sort select { background: #fff; border: 1px solid #dfe3eb; border-radius: 10px; min-height: 44px; padding: 0 10px; }

.blog-list { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.member-result + .member-result { border-top: 1px solid var(--line); }
.member-summary { align-items: center; background: #fff; border: 0; color: var(--ink); cursor: pointer; display: grid; gap: 12px; grid-template-columns: 34px minmax(0, 1fr) auto 20px; padding: 13px 16px; text-align: left; width: 100%; }
.member-summary:hover { background: #f8fafc; }
.member-rank { background: #eef3ff; border-radius: 9px; color: var(--blue); display: grid; font-size: 12px; font-weight: 850; height: 32px; place-items: center; width: 32px; }
.member-main, .member-total { display: grid; min-width: 0; }
.member-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-main small, .member-total small, .member-blog-row small { color: var(--muted); font-size: 11px; margin-top: 3px; }
.member-total { text-align: right; }
.member-total strong { font-size: 18px; }
.member-chevron { color: var(--muted); font-size: 20px; transition: transform .2s; }
.member-summary[aria-expanded="true"] .member-chevron { transform: rotate(180deg); }
.member-blogs { background: #f8fafc; border-top: 1px solid var(--line); padding: 4px 16px 8px 62px; }
.member-blog-row { align-items: center; display: flex; gap: 14px; justify-content: space-between; padding: 10px 0; }
.member-blog-row + .member-blog-row { border-top: 1px solid #e9edf3; }
.member-blog-row > div { display: grid; min-width: 0; }
.member-blog-row strong { overflow-wrap: anywhere; }
.member-blog-row > b { white-space: nowrap; }

.blog-daily-mobile { display: none; }

.detail-range-open {
  align-items: center;
  background: #f4f7fd;
  border: 1px solid #dce5f6;
  border-radius: 11px;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 3px 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 190px;
  padding: 9px 12px;
  text-align: left;
}
.detail-range-open > span:first-child { color: var(--muted); font-size: 10px; font-weight: 750; grid-column: 1; }
.detail-range-open > strong { color: var(--blue); grid-column: 1; }
.detail-range-open > span:last-child { grid-column: 2; grid-row: 1 / 3; }
.detail-range-summary { cursor: default; }

.range-dialog {
  background: #f8fafc;
  border: 0;
  border-radius: 22px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, .28);
  color: var(--ink);
  max-height: min(780px, calc(100vh - 40px));
  padding: 0;
  width: min(620px, calc(100% - 28px));
}
.range-dialog::backdrop { background: rgba(15, 23, 42, .52); backdrop-filter: blur(4px); }
.range-dialog-shell { display: grid; grid-template-rows: auto auto minmax(0, 1fr); max-height: inherit; }
.range-dialog-shell > header { align-items: center; background: #fff; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 44px 1fr auto; padding: 14px 18px; }
.range-dialog-shell > header h2 { font-size: 19px; letter-spacing: -.02em; margin: 0; text-align: center; }
.range-dialog-shell > header button { background: #eaf1ff; border: 0; border-radius: 10px; color: var(--blue); cursor: pointer; font-size: 14px; font-weight: 800; min-height: 40px; padding: 0 14px; }
.range-dialog-shell > header .range-dialog-close { background: transparent; color: var(--ink); font-size: 28px; font-weight: 400; padding: 0; }
.range-dialog-tabs { background: #edf2f8; border: 0; border-radius: 12px; display: grid; gap: 4px; grid-template-columns: repeat(4, 1fr); margin: 14px 18px 4px; padding: 4px; }
.range-dialog-tabs.advanced-range-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.range-dialog-tabs button { background: transparent; border: 0; border-radius: 9px; color: var(--muted); cursor: pointer; font-weight: 750; min-height: 42px; }
.range-dialog-tabs button.active { background: #fff; box-shadow: 0 3px 10px rgba(30, 41, 59, .09); color: var(--blue); }
.range-dialog-body { overflow-y: auto; padding: 12px 18px 20px; }
.detail-option-group { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.detail-option-group > button { align-items: center; background: #fff; border: 1px solid #e1e7f0; border-radius: 14px; color: var(--ink); cursor: pointer; display: flex; justify-content: space-between; min-height: 96px; padding: 16px; text-align: left; transition: border-color .18s, box-shadow .18s, transform .18s; width: 100%; }
.detail-option-group > button:hover { border-color: #aac3f8; box-shadow: 0 8px 20px rgba(37, 99, 235, .08); transform: translateY(-1px); }
.detail-option-group > button span { display: grid; gap: 5px; }
.detail-option-group > button strong { font-size: 16px; font-weight: 750; }
.detail-option-group > button small { color: var(--muted); font-size: 12px; }
.detail-option-group > button i { align-items: center; background: var(--blue); border-radius: 50%; color: #fff; display: none; flex: 0 0 auto; font-size: 13px; font-style: normal; height: 25px; justify-content: center; width: 25px; }
.detail-option-group > button.selected { background: #f5f8ff; border-color: #75a0f6; box-shadow: 0 0 0 3px rgba(37, 99, 235, .09); }
.detail-option-group > button.selected strong { color: var(--blue); }
.detail-option-group > button.selected i { display: flex; }
.detail-custom-range { background: #fff; border: 1px solid #e1e7f0; border-radius: 14px; display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); padding: 16px; }
.detail-custom-range label { color: var(--muted); display: grid; font-size: 11px; font-weight: 750; gap: 7px; letter-spacing: .02em; text-transform: uppercase; }
.detail-custom-range input { background: #f8fafc; border: 1px solid #d9e1ec; border-radius: 10px; color: var(--ink); font-size: 14px; min-height: 46px; padding: 8px 10px; width: 100%; }
.detail-custom-range input:focus { border-color: #75a0f6; box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); outline: 0; }
.detail-compare { background: #fff; border: 1px solid #e1e7f0; border-radius: 14px; margin: 12px 0 0; padding: 16px; }
.detail-compare > label { align-items: center; display: flex; justify-content: space-between; }
.detail-compare > label > span { display: grid; gap: 3px; }
.detail-compare small { color: var(--muted); }
.detail-compare input[role="switch"] { accent-color: var(--blue); cursor: pointer; height: 25px; width: 44px; }
.detail-compare select { background: #f8fafc; border: 1px solid #d9e1ec; border-radius: 10px; color: var(--ink); margin-top: 14px; min-height: 46px; padding: 8px 10px; width: 100%; }
.detail-compare select:disabled { opacity: .45; }

@media (max-width: 760px) {
  .overview-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .highlight-list { grid-template-columns: 1fr; }
  .highlight-item { border-bottom: 1px solid var(--line); border-right: 0; padding-inline: 0; }
  .highlight-item:last-child { border-bottom: 0; }
  .blog-toolbar { grid-template-columns: 1fr auto; }
  .blog-search { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .dashboard-heading { margin-bottom: 12px; }
  .dashboard-heading .eyebrow, .dashboard-heading p { display: none; }
  .dashboard-heading h1 { margin: 0; }
  .dashboard-heading .heading-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .dashboard-heading .sync-label { font-size: 11px; grid-column: 1 / -1; }
  .dashboard-heading .heading-actions form { display: block; min-width: 0; }
  .dashboard-heading .heading-actions form .btn { font-size: 12px; min-height: 42px; padding: 9px 7px; width: 100%; }
  .dashboard-view-tabs { position: sticky; top: 66px; width: 100%; z-index: 20; }
  .unified-range-card { padding: 11px; }
  .unified-range-heading { margin: 0 4px 9px; }
  .unified-range-heading > div { display: grid; gap: 2px; }
  .range-chips { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .range-chips button { font-size: 11px; grid-column: auto; line-height: 1.15; min-height: 40px; padding: 6px 2px; }
  .overview-kpis { gap: 9px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-total { padding: 14px; }
  .overview-total > span { font-size: 11px; }
  .overview-total > strong { font-size: 24px; margin-block: 7px 10px; }
  .overview-total footer { display: grid; gap: 3px; }
  .highlights-card { padding: 16px; }
  .highlight-item { grid-template-columns: 34px minmax(0, 1fr); }
  .highlight-item > b { color: var(--blue); grid-column: 2; }
  .legend { display: none; }
  .chart-wrap { height: 210px; }
  .blog-breakdown-card, .blog-history-card { padding: 15px; }
  .blog-toolbar { grid-template-columns: 1fr; }
  .blog-search, .blog-sort { grid-column: 1; width: 100%; }
  .blog-sort { display: grid; grid-template-columns: auto 1fr; }
  .blog-sort select { min-width: 0; width: 100%; }
  .member-summary { gap: 9px; grid-template-columns: 30px minmax(0, 1fr) auto 14px; padding: 12px 10px; }
  .member-rank { height: 28px; width: 28px; }
  .member-main strong { font-size: 14px; }
  .member-total strong { font-size: 16px; }
  .member-blogs { padding-left: 49px; padding-right: 10px; }
  .member-blog-row { font-size: 12px; }
  .section-date-filter button { display: none; }
  .section-date-filter { display: block; }
  .daily-matrix-scroll { display: none; }
  .blog-daily-mobile { display: grid; gap: 8px; }
  .daily-result { align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr) minmax(100px, .8fr) auto; padding: 12px; text-align: left; }
  .daily-result > span:first-child, .daily-result-value { display: grid; }
  .daily-result small { color: var(--muted); font-size: 10px; margin-top: 3px; }
  .daily-result-value { gap: 6px; text-align: right; }
  .daily-result-value i { background: #e4edff; border-radius: 4px; height: 4px; margin-left: auto; overflow: hidden; position: relative; width: 100%; }
  .daily-result-value i::after { background: var(--blue); border-radius: inherit; content: ""; height: 100%; position: absolute; right: 0; width: var(--bar); }
  .blog-breakdown-card > header { align-items: flex-start; }
  .detail-range-summary { min-width: 0; width: 100%; }
  .detail-range-summary > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .range-dialog { border-radius: 0; height: 100dvh; max-height: 100dvh; max-width: none; width: 100%; }
  .range-dialog-shell { height: 100%; max-height: none; padding-bottom: env(safe-area-inset-bottom); }
  .range-dialog-shell > header { padding-top: max(12px, env(safe-area-inset-top)); }
  .range-dialog-body { padding-inline: 18px; }
  .detail-option-group { grid-template-columns: 1fr; }
  .detail-option-group > button { min-height: 82px; }
  .detail-custom-range { grid-template-columns: 1fr; }
}
