:root {
  --ink: #172e48;
  --muted: #5a6d80;
  --line: #dde4eb;
  --bg: #f5f7fa;
  --google: #226a5d;
  --meta: #526bb1;
  --accent: #245581;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    15px/1.55 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.button {
  border: 1px solid #b9c8d5;
  border-radius: 7px;
  background: white;
  color: var(--ink);
  padding: 9px 15px;
  cursor: pointer;
  display: inline-block;
  font-weight: 600;
}
button:hover,
.button:hover {
  background: #eaf0f6;
  text-decoration: none;
}
button.primary {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}
button.primary:hover {
  background: #294965;
}
button.text-button {
  border: 0;
  background: transparent;
  padding: 7px;
}
input,
select,
textarea {
  color: var(--ink);
  background: white;
  border: 1px solid #b9c8d5;
  border-radius: 6px;
  padding: 10px;
  max-width: 100%;
  width: 100%;
}
textarea {
  resize: vertical;
}
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 16px;
}
label.inline-label {
  margin: 0;
}
.inline-label input,
.inline-label select {
  width: auto;
  min-width: 160px;
}
input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid #8fb6da;
  outline-offset: 2px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.16;
  letter-spacing: -1.4px;
  font-weight: 650;
  margin-bottom: 14px;
}
h2 {
  font-size: 21px;
  letter-spacing: -0.4px;
  font-weight: 650;
  margin-bottom: 20px;
}
h3 {
  font-size: 16px;
  font-weight: 600;
}
p {
  max-width: 80ch;
}
small,
.small {
  font-size: 12px;
}
.muted {
  color: var(--muted);
}
.topbar {
  height: 82px;
  padding: 0 max(24px, calc((100vw - 1240px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  border-bottom: 1px solid var(--line);
  gap: 20px;
}
.brand {
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
}
.brandmark {
  background: var(--ink);
  color: white;
  font:
    italic 30px Georgia,
    serif;
  line-height: 36px;
  text-align: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
}
nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 13px;
}
nav form {
  margin: 0;
}
.username {
  color: var(--muted);
}
.demo-strip {
  background: #e9f0f7;
  color: #34516e;
  text-align: center;
  font-size: 12px;
  padding: 6px;
}
main {
  max-width: 1240px;
  margin: auto;
  padding: 42px 24px 64px;
}
footer {
  max-width: 1240px;
  margin: auto;
  padding: 24px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
.report-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
  margin-bottom: 26px;
}
.client-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  font-weight: 600;
}
.badge {
  display: inline-block;
  padding: 3px 9px;
  border: 1px solid #c8d4df;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.logo {
  max-width: 100px;
  height: 38px;
  object-fit: contain;
}
.report-tools {
  text-align: right;
}
.month-form,
.inline-form {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}
.month-form label,
.inline-form label {
  margin: 0;
}
.month-form input {
  max-width: 200px;
}
.report-tools > .text-button {
  margin-top: 12px;
}
.meta-line {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
  font-size: 12px;
  color: var(--muted);
}
.commentary {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 36px;
  margin: 32px 0 40px;
  background: #eaf0f5;
  padding: 28px 32px;
  border-left: 3px solid #6086a6;
  border-radius: 0 10px 10px 0;
}
.commentary h2 {
  margin: 5px 0;
}
.commentary p {
  margin: 0;
  line-height: 1.8;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 20px;
}
.section-heading h2,
.section-heading p {
  margin: 0;
}
.currency-report {
  margin-top: 34px;
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.kpi {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px 26px;
}
.kpi h3 {
  font-weight: 500;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
}
.kpi strong {
  font-size: clamp(25px, 2.8vw, 34px);
  font-weight: 620;
  letter-spacing: -1.2px;
  line-height: 1.3;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.kpi p {
  font-size: 11px;
  margin: 15px 0 0;
}
.kpi.featured {
  background: var(--ink);
  color: white;
}
.kpi.featured h3,
.kpi.featured .muted {
  color: #cfdeeb;
}
.delta {
  font-weight: 650;
  display: inline-block;
  margin-right: 3px;
}
.good {
  color: #1d7455;
}
.bad {
  color: #a34934;
}
.neutral {
  color: var(--muted);
}
.featured .neutral {
  color: #fff;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 26px;
  margin-bottom: 24px;
  min-width: 0;
}
.platform-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.platform-numbers {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1.2fr;
  gap: 15px;
}
.platform-numbers span {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-bottom: 7px;
}
.platform-numbers strong {
  font-weight: 600;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  background: var(--muted);
}
.dot.google {
  background: var(--google);
}
.dot.meta {
  background: var(--meta);
}
.platform details {
  margin-top: 20px;
}
summary {
  cursor: pointer;
  font-weight: 600;
}
details[open] > summary {
  margin-bottom: 22px;
}
summary::marker {
  color: var(--muted);
}
.metrics-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  font-size: 13px;
}
.metrics-detail dd {
  text-align: right;
}
.chart svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
  min-height: 160px;
}
.chart text {
  font-family: inherit;
  font-size: 12px;
  fill: var(--muted);
}
.chart .grid-line {
  stroke: #e7edf2;
  stroke-width: 1;
}
.chart path {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chart .google {
  stroke: var(--google);
}
.chart .meta {
  stroke: var(--meta);
}
.chart .point.google {
  fill: var(--google);
}
.chart .point.meta {
  fill: var(--meta);
}
.legend {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  font-size: 12px;
}
.legend span {
  display: flex;
  align-items: center;
}
.table-scroll {
  max-width: 100%;
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
th,
td {
  padding: 16px 13px;
  border-bottom: 1px solid #e7edf2;
}
th:first-child,
td:first-child {
  text-align: left;
  padding-left: 0;
}
thead th {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
tbody th {
  font-weight: 500;
}
tbody tr:last-child td,
tbody tr:last-child th {
  border-bottom: 0;
}
th small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  margin-top: 3px;
}
th button {
  padding: 0;
  border: 0;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}
.highlights {
  margin: 32px 0;
}
.highlights .panel {
  margin-bottom: 10px;
}
.highlights h3 {
  margin: 10px 0;
}
.highlights p {
  margin-bottom: 0;
}
.highlight-number {
  font-size: 25px;
  letter-spacing: -0.7px;
}
.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
  border-top: 1px solid var(--line);
  margin-top: 36px;
  padding-top: 32px;
}
.notes-grid h2 {
  font-size: 18px;
}
.notes-grid p {
  font-size: 14px;
  line-height: 1.8;
}
.notice,
.alert {
  padding: 14px 18px;
  border-radius: 6px;
  margin-bottom: 20px;
  background: #eaf0f6;
  font-size: 13px;
}
.alert {
  background: #fff0eb;
  color: #8c3829;
}
.empty {
  text-align: center;
  padding: 64px 24px;
}
.empty p {
  margin: 0 auto 20px;
}
.login-wrap {
  min-height: 66vh;
  display: grid;
  grid-template-columns: 1fr 420px;
  align-items: center;
  gap: 60px;
  max-width: 1000px;
  margin: auto;
}
.login-intro h1 {
  font-size: clamp(38px, 5vw, 60px);
  letter-spacing: -2px;
  line-height: 1.13;
}
.login-intro p {
  font-size: 17px;
  color: var(--muted);
}
.login-form {
  padding: 36px;
}
.login-form .primary {
  width: 100%;
  margin: 8px 0 20px;
}
.login-art {
  display: flex;
  height: 100px;
  align-items: end;
  gap: 12px;
  max-width: 300px;
  margin-top: 35px;
}
.login-art span {
  flex: 1;
  background: #b2c7d8;
  border-radius: 4px 4px 0 0;
  height: 30%;
}
.login-art span:nth-child(2) {
  height: 50%;
}
.login-art span:nth-child(3) {
  height: 44%;
}
.login-art span:nth-child(4) {
  height: 65%;
}
.login-art span:nth-child(5) {
  height: 60%;
}
.login-art span:nth-child(6) {
  height: 82%;
}
.login-art span:nth-child(7) {
  height: 100%;
  background: #456d90;
}
.admin-layout {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}
.client-list a {
  display: block;
  color: var(--ink);
  padding: 13px 12px;
  border-radius: 6px;
  margin: 3px -10px;
}
.client-list small {
  display: block;
  color: var(--muted);
}
.client-list .selected {
  background: #eaf0f6;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 20px;
}
.form-end {
  display: flex;
  align-items: end;
  padding-bottom: 16px;
}
.account-row,
.user-row {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.account-row:last-child,
.user-row:last-child {
  border-bottom: 0;
}
.check-label {
  flex-direction: row;
  align-items: center;
  margin-top: 15px;
}
.check-label input {
  width: auto;
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}
.client-link {
  color: var(--ink);
}
code {
  overflow-wrap: anywhere;
}
strong,
b {
  font-weight: 650;
}
@media (max-width: 1000px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .platform-grid {
    grid-template-columns: 1fr;
  }
  .platform-numbers strong {
    font-size: 22px;
  }
  .admin-layout {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  .commentary {
    grid-template-columns: 180px 1fr;
  }
  .login-wrap {
    gap: 30px;
    grid-template-columns: 1fr 380px;
  }
  .notes-grid {
    gap: 20px;
  }
  .username {
    display: none;
  }
}
@media (max-width: 680px) {
  .topbar {
    height: 68px;
    padding: 0 18px;
  }
  .brand {
    font-size: 16px;
  }
  .brandmark {
    width: 30px;
    height: 30px;
    line-height: 30px;
  }
  nav {
    gap: 8px;
  }
  nav > a {
    display: none;
  }
  main {
    padding: 26px 16px 40px;
  }
  .report-head {
    display: block;
    margin-bottom: 22px;
  }
  .report-head > div:first-child {
    margin-bottom: 24px;
  }
  .report-tools {
    text-align: left;
  }
  .month-form {
    flex-wrap: nowrap;
  }
  .month-form label {
    flex: 1;
  }
  .month-form input {
    max-width: none;
  }
  .report-tools > .text-button {
    margin: 8px 0 0;
    padding-left: 0;
  }
  .client-title {
    flex-wrap: wrap;
    gap: 9px;
  }
  .meta-line {
    flex-direction: column;
    gap: 6px;
  }
  .commentary {
    display: block;
    padding: 22px;
    margin: 24px 0;
  }
  .commentary h2 {
    margin-bottom: 16px;
  }
  .kpi-grid {
    gap: 10px;
  }
  .kpi {
    padding: 18px 15px;
  }
  .kpi h3 {
    font-size: 12px;
    min-height: 18px;
    margin-bottom: 12px;
  }
  .kpi strong {
    font-size: 24px;
    white-space: normal;
  }
  .kpi p {
    font-size: 10px;
  }
  .kpi p .muted {
    display: block;
    margin-top: 5px;
  }
  .panel {
    padding: 20px 16px;
    margin-bottom: 18px;
  }
  .platform-numbers {
    gap: 12px;
  }
  .platform-numbers strong {
    font-size: 18px;
  }
  .platform-numbers span {
    font-size: 11px;
  }
  .section-heading {
    align-items: start;
    flex-wrap: wrap;
    gap: 14px;
  }
  h2 {
    font-size: 19px;
  }
  .notes-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .chart svg {
    min-height: 140px;
  }
  .legend {
    gap: 15px;
  }
  .login-wrap {
    display: block;
    min-height: 0;
  }
  .login-intro {
    padding: 15px 8px;
  }
  .login-intro h1 {
    font-size: 40px;
  }
  .login-art {
    display: none;
  }
  .login-form {
    padding: 25px;
  }
  .admin-layout {
    display: block;
  }
  .client-list {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
  }
  .client-list h2 {
    width: 100%;
    margin: 0;
  }
  .client-list a {
    margin: 0;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .inline-form {
    align-items: stretch;
  }
  .inline-form > label {
    flex: 1;
    min-width: 130px;
  }
  .inline-label input {
    min-width: 100px;
  }
  footer {
    padding: 20px 16px;
    display: block;
  }
  footer span {
    display: none;
  }
}
@media print {
  body {
    background: white;
    color: #172e48;
    font-size: 11px;
  }
  .topbar,
  footer,
  .report-tools,
  .campaign-search,
  .inline-label,
  .demo-strip,
  nav {
    display: none;
  }
  main {
    padding: 0;
    max-width: none;
  }
  .panel,
  .kpi {
    break-inside: avoid;
  }
  .kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .kpi.featured {
    background: white;
    color: var(--ink);
  }
  .kpi.featured h3,
  .kpi.featured .muted,
  .featured .neutral {
    color: var(--muted);
  }
  .table-scroll {
    overflow: visible;
  }
  table {
    font-size: 9px;
    white-space: normal;
  }
  th,
  td {
    padding: 9px 4px;
  }
  .campaign-panel {
    padding: 12px;
  }
  h2 {
    break-after: avoid;
  }
  .chart {
    break-inside: avoid;
  }
  .commentary {
    padding: 18px;
  }
  .notes-grid {
    gap: 20px;
  }
  .badge {
    font-size: 10px;
  }
  .platform-grid {
    grid-template-columns: 1fr 1fr;
  }
  @page {
    size: A4;
    margin: 12mm;
  }
}

.highlights-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
@media (max-width: 680px) {
  .highlights-grid {
    grid-template-columns: 1fr;
  }
}
