:root {
  --ink: #223036;
  --muted: #66757c;
  --soft: #f3f8f8;
  --line: #d7e5e5;
  --paper: #ffffff;
  --slate: #334248;
  --slate-dark: #1f2b30;
  --teal: #20bfc4;
  --teal-dark: #128b91;
  --teal-soft: #e6f8f7;
  --green: #0f9f75;
  --green-soft: #e8f7f2;
  --blue: #168f96;
  --orange: #d97706;
  --red: #dc2626;
  --gray-cell: #d9dee5;
  --shadow: 0 14px 32px rgba(31, 48, 54, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(32, 191, 196, 0.08), rgba(243, 248, 248, 0) 260px),
    var(--soft);
}

button {
  font: inherit;
}

.site-header {
  background: #151515;
  color: #fff;
  border-bottom: 5px solid var(--teal);
}

.header-inner {
  width: min(1500px, calc(100vw - 48px));
  margin: 0 auto;
  min-height: 150px;
  display: grid;
  grid-template-columns: 185px minmax(0, 1fr) 265px;
  gap: 28px;
  align-items: center;
  padding: 22px 0;
}

.brand-mark {
  width: 185px;
  height: 112px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(32, 191, 196, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  box-shadow: 0 14px 30px rgba(5, 34, 38, 0.22);
}

.brand-mark img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.header-copy h1 {
  margin: 0;
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: 0;
}

.subhead {
  max-width: 760px;
  margin: 12px 0 0;
  color: #d9dde2;
  font-size: 16px;
}

.gmb-details {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.gmb-chip {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid rgba(32, 191, 196, 0.28);
  border-radius: 8px;
  background: rgba(230, 248, 247, 0.08);
  color: #f4f6f8;
  font-size: 14px;
  line-height: 1.2;
  text-decoration: none;
}

.gmb-details b {
  flex: 0 0 auto;
  margin-right: 8px;
  color: var(--teal);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.gmb-chip span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.gmb-details a {
  color: #fff;
}

.gmb-details a:hover {
  border-color: rgba(32, 191, 196, 0.75);
  background: rgba(32, 191, 196, 0.14);
}

.header-meta {
  justify-self: end;
  width: 100%;
  border: 1px solid rgba(32, 191, 196, 0.24);
  border-radius: 8px;
  padding: 16px;
  background: rgba(230, 248, 247, 0.08);
}

.header-meta span,
.label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.header-meta span {
  color: #bbc2cc;
}

.header-meta strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

#printButton {
  width: 100%;
  height: 38px;
  margin-top: 14px;
  border: 0;
  border-radius: 8px;
  background: var(--teal);
  color: #062f33;
  font-weight: 800;
  cursor: pointer;
}

#printButton:hover {
  background: #46d0d3;
}

.page-shell {
  width: min(1500px, calc(100vw - 48px));
  margin: 24px auto 48px;
}

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

.overview-card,
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.overview-card {
  padding: 18px;
  min-height: 100px;
}

.overview-card strong {
  display: block;
  margin-top: 10px;
  font-size: 34px;
  line-height: 1;
}

.overview-card.positive strong {
  color: var(--green);
}

.panel {
  padding: 22px;
}

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

.section-heading h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
}

.section-heading p:not(.eyebrow) {
  max-width: 470px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.section-heading.compact {
  margin-bottom: 14px;
}

.positive-panel {
  margin-bottom: 18px;
}

.positive-movers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.positive-card {
  border: 1px solid #bfeceb;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--teal-soft), #fff);
  padding: 16px;
}

.positive-card h3 {
  margin: 0 0 14px;
  font-size: 20px;
}

.positive-card .metric-line {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border-top: 1px solid #bfeceb;
  padding-top: 12px;
}

.positive-card .metric-line > span {
  min-width: 0;
}

.positive-card strong {
  color: var(--green);
  display: block;
  font-size: 20px;
  line-height: 1.05;
  white-space: nowrap;
}

.report-grid {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.keyword-panel {
  position: sticky;
  top: 18px;
}

.keyword-list {
  display: grid;
  gap: 10px;
}

.keyword-button {
  width: 100%;
  min-height: 82px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  padding: 12px;
}

.keyword-button.active {
  border-color: var(--teal-dark);
  box-shadow: inset 5px 0 0 var(--teal);
}

.keyword-button strong {
  display: block;
  font-size: 15px;
  margin-bottom: 8px;
}

.keyword-button .row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.delta {
  font-weight: 800;
}

.delta.positive {
  color: var(--green);
}

.delta.negative {
  color: var(--red);
}

.delta.neutral,
.delta.empty {
  color: var(--muted);
}

.detail-topline {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.detail-topline h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.12;
}

.selected-date {
  min-width: 220px;
  text-align: right;
}

.selected-date span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.selected-date strong {
  display: block;
  margin-top: 7px;
  font-size: 30px;
}

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

.metric-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfefe;
}

.metric-box strong {
  display: block;
  margin-top: 7px;
  font-size: 23px;
}

.visual-layout {
  display: grid;
  grid-template-columns: minmax(410px, 1.05fr) minmax(360px, 0.95fr);
  gap: 18px;
}

.grid-card,
.timeline-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.grid-card-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.grid-card-head h3 {
  margin: 0;
  font-size: 18px;
}

.grid-card-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 12px;
  max-width: 260px;
  color: var(--muted);
  font-size: 12px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.top {
  background: var(--teal-dark);
}

.legend-dot.mid {
  background: var(--teal);
}

.legend-dot.low {
  background: var(--orange);
}

.legend-dot.none {
  background: var(--gray-cell);
}

.rank-grid {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #eef7f7;
}

.grid-shot {
  display: block;
  width: 100%;
  aspect-ratio: 1080 / 567;
  object-fit: cover;
}

.trend-chart {
  min-height: 290px;
}

.trend-chart svg {
  width: 100%;
  height: auto;
  display: block;
}

.trend-axis {
  stroke: #c6dada;
  stroke-width: 1;
}

.trend-line {
  fill: none;
  stroke: var(--blue);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-dot {
  fill: var(--paper);
  stroke: var(--blue);
  stroke-width: 3;
}

.trend-label {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.timeline-section {
  margin-top: 22px;
}

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

.timeline-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  cursor: pointer;
  text-align: left;
}

.timeline-button.active {
  border-color: var(--teal-dark);
  box-shadow: inset 0 4px 0 var(--teal);
}

.timeline-button strong {
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
}

.timeline-button .mini-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 10px;
}

.mini-grid {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #eef7f7;
}

.mini-shot {
  display: block;
  width: 100%;
  aspect-ratio: 1080 / 567;
  object-fit: cover;
}

.latest-panel {
  margin-top: 18px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 870px;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  text-align: left;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

th {
  background: var(--slate-dark);
  color: #fff;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

td strong {
  display: block;
  margin-bottom: 2px;
}

td .sub {
  color: var(--muted);
  font-size: 12px;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: #f4fbfb;
}

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

@media (max-width: 1100px) {
  .header-inner,
  .report-grid,
  .visual-layout {
    grid-template-columns: 1fr;
  }

  .header-meta {
    justify-self: stretch;
  }

  .keyword-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .header-inner,
  .page-shell {
    width: min(100vw - 24px, 1500px);
  }

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

  .section-heading,
  .detail-topline,
  .grid-card-head {
    display: block;
  }

  .selected-date {
    text-align: left;
    margin-top: 12px;
  }

  .header-copy h1 {
    font-size: 32px;
  }
}

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

  .site-header {
    break-after: avoid;
  }

  #printButton,
  .keyword-panel,
  .timeline-button:not(.active) {
    display: none;
  }

  .page-shell {
    width: 100%;
    margin: 16px 0;
  }

  .panel,
  .overview-card {
    box-shadow: none;
  }
}
