/* ============================================================================
   Markef — Social Competitor Analysis
   Palette is sampled from logo.png: green #40b090, blue #3070a0,
   navy #103050, charcoal #303030. Nothing here is invented colour.
   ========================================================================== */

:root {
  /* brand */
  --green: #38a683;
  --green-lo: #2b8268;
  --blue: #3070a0;
  --blue-lo: #245a83;
  --navy: #103050;
  --ink: #303030;

  /* surfaces — dark is the default */
  --bg: #0b1a29;
  --bg-2: #0e2233;
  --surface: #12283b;
  --surface-2: #17324a;
  --raised: #1a3a54;

  --text: #eef4f8;
  --muted: #9db1c2;
  --faint: #6c8298;

  --line: rgba(147, 183, 209, .16);
  --line-2: rgba(147, 183, 209, .3);

  --accent: var(--green);
  --accent-2: var(--blue);
  --ok: #4cc38a;
  --warn: #e0a33e;
  --danger: #e06c6c;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 4px 16px rgba(0, 0, 0, .28);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, .38);

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 20px;

  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

[data-theme='light'] {
  --bg: #f5f7f9;
  --bg-2: #eef2f6;
  --surface: #ffffff;
  --surface-2: #f4f7fa;
  --raised: #ffffff;

  --text: #16222e;
  --muted: #5a6b7b;
  --faint: #8a9bab;

  --line: rgba(16, 48, 80, .12);
  --line-2: rgba(16, 48, 80, .22);

  --accent: #2b8268;
  --accent-2: #245a83;
  --ok: #1f8a5a;
  --warn: #a86a12;
  --danger: #c04a4a;

  --shadow-sm: 0 1px 2px rgba(16, 48, 80, .06);
  --shadow: 0 4px 16px rgba(16, 48, 80, .08);
  --shadow-lg: 0 18px 40px rgba(16, 48, 80, .12);
}

/* ------------------------------------------------------------------ base -- */

*,
*::before,
*::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* A single soft brand wash, not the old two-blob gradient. */
body::before {
  content: '';
  position: fixed;
  inset: 0 0 auto 0;
  height: 420px;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 340px at 18% -60px, color-mix(in srgb, var(--green) 14%, transparent), transparent 70%),
    radial-gradient(900px 340px at 82% -80px, color-mix(in srgb, var(--blue) 15%, transparent), transparent 70%);
}

body > * { position: relative; z-index: 1; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.018em; font-weight: 700; }

img { max-width: 100%; }

.wrap {
  width: min(1520px, 100% - 48px);
  margin-inline: auto;
}

:where(button, a, input, select, textarea):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- header -- */

.app-header {
  position: sticky;
  top: 0;
  z-index: 60;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0 12px;
}

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

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

/* The logo file is 445x377 with the MARKEF wordmark below the chevron. The
   wordmark sits at roughly 78% down, so clipping to the top ~76% leaves the
   mark alone — in full brand colour, no inversion needed on either theme. */
.brand-mark {
  display: block;
  flex: none;
  width: 40px;
  height: 26px;
  overflow: hidden;
}

.brand-mark img {
  display: block;
  width: 40px;
  height: auto;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .25));
}

.brand-text { display: grid; line-height: 1.15; }

.brand-text strong {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.brand-text small {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: .01em;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-wrap { position: relative; display: flex; align-items: center; }

.search-icon {
  position: absolute;
  left: 11px;
  width: 15px;
  height: 15px;
  color: var(--faint);
  pointer-events: none;
}

.search {
  width: 210px;
  height: 36px;
  padding: 0 12px 0 33px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.search::placeholder { color: var(--faint); }
.search:focus { border-color: var(--accent); }

/* ------------------------------------------------------------------ tabs -- */

.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px 13px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .15s;
}

.tab:hover { color: var(--text); }

.tab.is-active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.tab-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dot, var(--accent));
  opacity: .55;
  transition: opacity .15s;
}

.tab.is-active .tab-dot { opacity: 1; }

/* --------------------------------------------------------------- buttons -- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, border-color .15s, transform .12s;
}

.btn:hover {
  background: var(--surface-2);
  border-color: var(--line-2);
  text-decoration: none;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--green), var(--blue));
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover { filter: brightness(1.07); background: linear-gradient(135deg, var(--green), var(--blue)); }
.btn-primary:disabled { opacity: .55; cursor: default; filter: none; }

.btn-ghost { background: transparent; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); }
.btn-icon { min-width: 66px; }

/* ------------------------------------------------------------------ hero -- */

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  padding: 34px 0 26px;
}

.hero-copy { max-width: 62ch; }

.eyebrow {
  margin: 0 0 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 { font-size: clamp(24px, 2.6vw, 34px); font-weight: 800; }

.lede {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14.5px;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(112px, 1fr));
  gap: 10px;
}

.kpi {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.kpi b {
  display: block;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
}

.kpi span {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}

.kpi-accent {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--green) 12%, transparent),
      color-mix(in srgb, var(--blue) 10%, transparent)),
    var(--surface);
}

.kpi-accent b { color: var(--accent); }

/* --------------------------------------------------------------- panels --- */

.tab-panel { display: none; padding-bottom: 64px; }
.tab-panel.is-active { display: block; }

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.section-title h2 { font-size: 19px; font-weight: 700; }

.hint { margin: 0; color: var(--muted); font-size: 12.5px; max-width: 74ch; }
.empty-line { padding: 26px 0; }

.panel {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.empty { text-align: center; color: var(--muted); }
.empty h2 { margin-bottom: 8px; color: var(--text); }

/* --------------------------------------------------------------- matrix --- */

.table-shell {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table-scroll { overflow: auto; max-height: 74vh; }

.matrix {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.matrix th,
.matrix td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.matrix thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--surface-2);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--muted);
  border-bottom: 1px solid var(--line-2);
}

.matrix .first-col {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
  font-weight: 600;
  min-width: 230px;
}

.matrix thead .first-col { z-index: 4; background: var(--surface-2); }

.matrix .first-col small {
  display: block;
  margin-top: 1px;
  font-weight: 400;
  font-size: 11px;
  color: var(--faint);
}

.matrix tbody tr:last-child th,
.matrix tbody tr:last-child td { border-bottom: 0; }

.matrix tbody tr:hover td,
.matrix tbody tr:hover .first-col { background: var(--surface-2); }

/* Our own row reads as the anchor the others are measured against. */
.matrix tbody tr:not(.is-competitor) .first-col {
  box-shadow: inset 3px 0 0 var(--accent);
}

.is-competitor .first-col {
  padding-left: 30px;
  font-weight: 500;
  color: var(--muted);
}

.vs {
  display: inline-block;
  margin-right: 5px;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--faint);
}

.yes {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ok);
  font-weight: 600;
  font-size: 12.5px;
}

.yes::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.no { color: var(--faint); }

/* Kept as a table-cell — making the td itself a flex container broke row
   height alignment and left a seam down the column. */
.coverage {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

.coverage-inner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.bar {
  display: block;
  width: 62px;
  height: 5px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

/* ---------------------------------------------------------------- cards --- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(318px, 1fr));
  gap: 18px;
}

.grid-tight { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }

.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow .18s, border-color .18s, transform .18s;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--line-2);
  transform: translateY(-2px);
}

.card.is-hidden { display: none; }

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.card-head-text { min-width: 0; flex: 1; }

.card-head h3 {
  font-size: 13.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-head p {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: var(--dot, var(--accent));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--dot, var(--accent)) 20%, transparent);
}

.card-open {
  flex: none;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--faint);
  font-size: 13px;
  text-decoration: none;
  transition: background .15s, color .15s;
}

.card-open:hover { background: var(--raised); color: var(--text); text-decoration: none; }

.card-body { flex: 1; min-height: 0; }

.card-note {
  padding: 9px 15px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 8%, transparent);
}

.card-absent { opacity: .5; }

/* Ours reads first; theirs stays secondary. */
.card-ours {
  border-color: color-mix(in srgb, var(--accent) 48%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent), var(--shadow-sm);
}

.card-ours .card-head {
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--green) 16%, transparent),
      color-mix(in srgb, var(--blue) 12%, transparent)),
    var(--surface-2);
}

.tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.tag-ours { background: var(--accent); color: #fff; }
.tag-rival { background: var(--raised); color: var(--muted); }

/* --------------------------------------------------------------- embeds --- */

.embed { min-height: 430px; padding: 12px; }
.embed[data-embed='youtube'] { padding: 0; min-height: 0; }

.embed iframe { display: block; width: 100%; border: 0; }
.embed[data-embed='youtube'] iframe { aspect-ratio: 16 / 9; height: auto; }

.embed .fb-page,
.embed .fb-page span,
.embed .fb-page iframe { width: 100% !important; }

.embed-skeleton {
  height: 410px;
  border-radius: var(--r);
  background: linear-gradient(100deg, var(--surface-2) 30%, var(--raised) 50%, var(--surface-2) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.4s infinite linear;
}

@keyframes shimmer {
  from { background-position: 180% 0; }
  to   { background-position: -80% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .embed-skeleton { animation: none; }
  .card:hover { transform: none; }
}

/* One post at a time, paged. Mounting every post at once is what stalled the
   browser, so the viewer holds a single iframe and swaps its src. */
.embed-posts { padding: 0; min-height: 0; }

.post-viewer { display: flex; flex-direction: column; }

.post-frame {
  display: block;
  width: 100%;
  height: 560px;
  border: 0;
  background: #fff;
}

.post-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 9px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.post-nav-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.post-nav-btn:hover:not(:disabled) { border-color: var(--accent); background: var(--raised); }
.post-nav-btn:disabled { opacity: .3; cursor: default; }

.post-count {
  min-width: 54px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.post-open {
  margin-left: 6px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.post-open:hover {
  border-color: var(--accent);
  color: var(--text);
  text-decoration: none;
}

.stub {
  display: grid;
  place-content: center;
  gap: 12px;
  min-height: 190px;
  padding: 28px;
  text-align: center;
}

.stub p { margin: 0; }
.stub-why { color: var(--muted); font-size: 12.5px; }
.stub-none { min-height: 130px; color: var(--faint); }

.stub-gap {
  border: 1px dashed var(--line-2);
  border-radius: var(--r-lg);
  background: var(--surface);
}

/* -------------------------------------------------------------- compare --- */

.compare {
  margin-bottom: 26px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.compare.is-hidden { display: none; }

.compare-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.compare-head h3 { font-size: 16px; }

.pill {
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
}

.compare-platform { margin-left: auto; }

.compare-platform label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.compare-select {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
}

.compare-body { display: none; gap: 22px; padding: 20px; }
.compare-body.is-active { display: grid; grid-template-columns: minmax(310px, 1fr) 2.2fr; }

.compare-label {
  margin: 0 0 10px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--faint);
}

/* ---------------------------------------------------------------- admin --- */

.admin-main { padding: 30px 0 70px; }

.admin-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.admin-bar h1 { font-size: 22px; margin-right: auto; }

.list {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface);
}

.list-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--surface-2); }
.list-row .grow { flex: 1; min-width: 0; }
.list-row h3 { font-size: 14px; }
.list-row p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }

.form { display: grid; gap: 20px; max-width: 1180px; }

.field { display: grid; gap: 6px; }

.field > label,
.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.input,
.textarea,
select.input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

[data-theme='light'] .input,
[data-theme='light'] .textarea { background: var(--surface); }

.textarea {
  min-height: 66px;
  resize: vertical;
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 12px;
}

.input:focus, .textarea:focus { border-color: var(--accent); }

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

.fieldset {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.fieldset > h2 { font-size: 16px; margin-bottom: 5px; }
.fieldset > .hint { margin-bottom: 16px; }

.platform-row {
  display: grid;
  grid-template-columns: 168px 1fr 1fr;
  gap: 14px;
  align-items: start;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.platform-row:first-of-type { border-top: 0; }

.platform-name {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 13px;
  padding-top: 8px;
}

.badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.badge-live { background: color-mix(in srgb, var(--ok) 22%, transparent); color: var(--ok); }
.badge-posts { background: color-mix(in srgb, var(--blue) 26%, transparent); color: var(--accent-2); }
.badge-link { background: var(--raised); color: var(--faint); }

[data-theme='light'] .badge-posts { color: #1f5378; }

.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.login-shell { display: grid; place-items: center; min-height: 100vh; padding: 24px; }

.login-card {
  width: min(380px, 100%);
  display: grid;
  gap: 16px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.login-card .brand { margin-bottom: 4px; }

.error { color: var(--danger); font-size: 13px; margin: 0; }

.app-footer {
  padding: 26px 0 44px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
}

.footer-inner { display: flex; align-items: center; gap: 10px; }

/* Same top-crop as the header mark, at a smaller size. */
.footer-logo {
  width: 26px;
  height: 17px;
  object-fit: cover;
  object-position: top;
  opacity: .85;
}

/* ----------------------------------------------------------- responsive --- */

@media (max-width: 1100px) {
  .compare-body.is-active { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .hero { gap: 26px; }
}

@media (max-width: 860px) {
  .platform-row { grid-template-columns: 1fr; }
  .platform-name { padding-top: 0; }
  .masthead { flex-wrap: wrap; }
  .search { width: 160px; }
}

@media (max-width: 620px) {
  .wrap { width: calc(100% - 28px); }
  .search { width: 130px; }
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .kpi b { font-size: 22px; }
  .hero { padding: 24px 0 20px; }
}
