/* ==========================================================================
  honeybee - Google Developers docs style
  Material palette, Roboto, sticky app bar + left nav + right rail.
  ========================================================================== */

:root {
  /* google blue */
  --blue: #1a73e8;
  --blue-d: #1967d2;
  --blue-l: #e8f0fe;
  --blue-l2: #d2e3fc;

  /* greys */
  --ink: #202124;
  --ink2: #3c4043;
  --muted: #5f6368;
  --muted2: #80868b;
  --border: #dadce0;
  --border-l: #e8eaed;
  --bg: #ffffff;
  --bg2: #f8f9fa;
  --bg3: #f1f3f4;
  --surface: #ffffff;

  /* status */
  --green-bg: #e6f4ea;
  --green-fg: #137333;
  --amber-bg: #fef7e0;
  --amber-fg: #b06000;
  --red-bg: #fce8e6;
  --red-fg: #c5221f;

  --shadow-1: 0 1px 2px 0 rgba(60, 64, 67, 0.3),
    0 1px 3px 1px rgba(60, 64, 67, 0.15);
  --shadow-2: 0 1px 3px 0 rgba(60, 64, 67, 0.3),
    0 4px 8px 3px rgba(60, 64, 67, 0.15);

  --r: 8px;
  --r-sm: 4px;
  --appbar-h: 64px;
  --font: "Roboto", "Helvetica Neue", Arial, sans-serif;
  --mono: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink2);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
h3,
h4 {
  color: var(--ink);
  font-weight: 400;
  margin: 0;
}

/* ==========================================================================
  app bar
  ========================================================================== */

.appbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--bg);
  border-bottom: 1px solid var(--border-l);
}

.appbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  height: var(--appbar-h);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}
.brand:hover {
  text-decoration: none;
}
.brand-name {
  font-family: "Kalam", "Segoe Script", cursive;
  font-size: 32px;
  font-weight: 700;
  color: #0b3d91;
  line-height: 1;
  letter-spacing: 0;
}
html[data-theme="dark"] .brand-name,
html[data-theme="dark"] .onboard-wordmark {
  color: #ffffff;
}

.appnav {
  display: flex;
  align-items: center;
  margin-left: 20px;
  height: var(--appbar-h);
}
.appnav-link {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  height: var(--appbar-h);
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}
.appnav-link:hover {
  background: var(--bg2);
  color: var(--ink);
}
.appnav-link.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.appbar-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 220px;
  min-width: 140px;
  max-width: 420px;
  height: 44px;
  padding: 0 12px;
  background: var(--bg3);
  border: 1px solid transparent;
  border-radius: var(--r);
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease;
}
.appbar-search:focus-within {
  background: var(--bg);
  box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
}
.appbar-search .ic {
  fill: var(--muted);
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.appbar-search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
}
.appbar-search input::placeholder {
  color: var(--muted);
}
.appbar-search kbd {
  font-family: inherit;
  font-size: 11px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 1px 6px;
  flex-shrink: 0;
}

.appbar-meta {
  font-size: 12px;
  color: var(--muted2);
  white-space: nowrap;
  margin-left: 8px;
}

.btn-text {
  appearance: none;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  white-space: nowrap;
}
.btn-text:hover {
  background: var(--blue-l);
}
.btn-text .ic {
  fill: currentColor;
  width: 18px;
  height: 18px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue-l);
  display: grid;
  place-items: center;
  font-size: 16px;
  margin-left: 4px;
  flex-shrink: 0;
}

/* ==========================================================================
  shell
  ========================================================================== */

.shell {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 300px;
  align-items: start;
}

/* ---------- left nav ---------- */

.sidenav {
  position: sticky;
  top: var(--appbar-h);
  max-height: calc(100vh - var(--appbar-h));
  overflow-y: auto;
  padding: 24px 12px 40px 24px;
  border-right: 1px solid var(--border-l);
}

.side-block {
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-l);
  padding-bottom: 10px;
}
.side-block[open] {
  margin-bottom: 22px;
}

.side-title {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 4px 12px;
  margin-bottom: 0;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  border-radius: 6px;
}
.side-title::-webkit-details-marker {
  display: none;
}
.side-title::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: auto;
  border-right: 1.6px solid var(--muted2);
  border-bottom: 1.6px solid var(--muted2);
  transform: rotate(45deg) translateY(-1px);
  transition: transform 0.18s ease;
}
.side-block[open] > .side-title::after {
  transform: rotate(-135deg) translateY(-1px);
}
.side-title:hover {
  background: var(--bg2);
  color: var(--ink2);
}
.side-block[open] > .side-title {
  margin-bottom: 8px;
}

.controls {
  display: flex;
  flex-direction: column;
}
.controls select {
  width: 100%;
  height: 40px;
  padding: 0 10px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink2);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.controls select:hover {
  border-color: var(--muted2);
}
.controls select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}

.quick {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.quickchip {
  appearance: none;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink2);
  text-align: left;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition:
    background 0.12s ease,
    color 0.12s ease;
}
.quickchip:hover {
  background: var(--bg2);
}
.quickchip.active {
  background: var(--blue-l);
  color: var(--blue-d);
  font-weight: 500;
}
.chip-cnt {
  font-size: 12px;
  color: var(--muted2);
  font-variant-numeric: tabular-nums;
}
.quickchip.active .chip-cnt {
  color: var(--blue-d);
}

.surface-filter {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 2px 0 4px;
}
.surface-filter label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--ink2);
  cursor: pointer;
}
.surface-filter label:hover {
  background: var(--bg2);
}
.surface-filter input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--blue);
  flex: 0 0 auto;
}
.surface-filter .chip-cnt {
  margin-left: auto;
}
#clear-surfaces {
  margin: 8px 12px 2px;
  justify-content: center;
}
#clear-surfaces[hidden] {
  display: none;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.side-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  color: var(--ink2);
  text-decoration: none;
}
.side-link:hover {
  background: var(--bg2);
  text-decoration: none;
}
.side-link.active {
  background: var(--blue-l);
  color: var(--blue-d);
  font-weight: 500;
}
.side-count {
  font-size: 12px;
  color: var(--muted2);
  font-variant-numeric: tabular-nums;
}
.side-link.active .side-count {
  color: var(--blue-d);
}

/* ---------- main column ---------- */

.doc {
  padding: 28px 44px 96px;
  min-width: 0;
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--muted);
}
.crumbs a {
  color: var(--muted);
}
.crumbs a:hover {
  color: var(--blue);
}
.crumbs .sep {
  color: var(--muted2);
}
.crumb-current {
  color: var(--ink2);
}
.crumb-right {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted2);
}
.crumb-right b {
  color: var(--ink2);
  font-weight: 500;
}

.h1-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 10px 0 20px;
}
.h1-row h1 {
  font-size: 44px;
  line-height: 1.15;
  letter-spacing: -0.6px;
  flex: 1;
  min-width: 0;
}
.h1-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  padding: 0;
}
.icon-btn:hover {
  background: var(--bg2);
}
.icon-btn .ic {
  fill: var(--muted);
  width: 20px;
  height: 20px;
}

/* in-page toc */
.toc-box {
  border-left: 4px solid var(--blue);
  background: var(--bg);
  padding: 10px 16px;
  margin: 0 0 24px;
}
.toc-box summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--ink);
  font-size: 15px;
  list-style: none;
}
.toc-box summary::-webkit-details-marker {
  display: none;
}
.toc-box summary::after {
  content: "";
  float: right;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
}
.toc-box[open] summary::after {
  transform: rotate(-135deg);
  margin-top: 8px;
}
.toc-box ul {
  margin: 8px 0 0;
  padding-left: 18px;
}
.toc-box li {
  font-size: 14px;
  margin: 2px 0;
}

/* callout */
.callout {
  background: var(--blue-l);
  border-radius: var(--r);
  padding: 14px 18px;
  margin: 0 0 32px;
}
.callout summary {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--blue-d);
}
.callout summary::-webkit-details-marker {
  display: none;
}
.callout summary::after {
  content: "";
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--blue-d);
  border-bottom: 2px solid var(--blue-d);
  transform: rotate(45deg);
}
.callout[open] summary::after {
  transform: rotate(-135deg);
}
.callout .diamond {
  fill: var(--blue);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.callout-body {
  padding: 10px 0 0 30px;
}
.callout-body p {
  margin: 0 0 10px;
  font-size: 15px;
  color: var(--ink2);
}
.callout-body p:last-child {
  margin-bottom: 0;
}

.doc h2 {
  font-size: 28px;
  letter-spacing: -0.3px;
  margin: 44px 0 12px;
  padding-top: 8px;
}
.doc h2:first-of-type {
  margin-top: 8px;
}

.section-note {
  margin: -6px 0 16px;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- stats ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.stat {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px;
}
.stat .k {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
}
.stat .v {
  font-size: 30px;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.2;
  margin: 6px 0 2px;
  font-variant-numeric: tabular-nums;
}
.stat .s {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.stat.green .v {
  color: var(--green-fg);
}
.stat.red .v {
  color: var(--red-fg);
}
.stat.accent .v {
  color: var(--blue);
}

.tierbar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--border-l);
  margin: 18px 0 10px;
}
.tierbar i {
  display: block;
  height: 100%;
}
.tierbar .t-green {
  background: #34a853;
}
.tierbar .t-yellow {
  background: #fbbc04;
}
.tierbar .t-red {
  background: #ea4335;
}
.tierbar .t-unknown {
  background: var(--border);
}

.tierlegend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted);
}
.tierlegend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tierlegend i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: block;
}
.tierlegend b {
  color: var(--ink);
  font-weight: 500;
}

/* ---------- top 10 cards ---------- */

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  display: flex;
  flex-direction: column;
  transition:
    box-shadow 0.15s ease,
    border-color 0.15s ease;
}
.card:hover {
  box-shadow: var(--shadow-1);
  border-color: #c6cace;
}
.card.top {
  background: linear-gradient(180deg, var(--blue-l), var(--surface) 60%);
}
.card.picked {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}

.card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}
.card-rank {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.6px;
}

.card-name {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink);
  margin: 12px 0 3px;
  min-height: 43px;
  display: flex;
  align-items: flex-end;
}
.card-name a {
  color: inherit;
}
.card-name a:hover {
  color: var(--blue);
  text-decoration: none;
}
.card-sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-score {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 4px;
}
.card-num {
  font-size: 24px;
  font-weight: 500;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}
.card-bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--border-l);
  overflow: hidden;
}
.card-bar i {
  display: block;
  height: 100%;
  background: var(--blue);
  border-radius: 3px;
}
.card-pct {
  font-size: 11px;
  color: var(--muted2);
  white-space: nowrap;
}

.card-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border-l);
}
.card-metrics dt {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted2);
}
.card-metrics dd {
  margin: 3px 0 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.card-foot {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.card-cmp {
  appearance: none;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: var(--blue);
  padding: 6px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
}
.card-cmp:hover {
  background: var(--blue-l);
}
.card-cmp.on {
  background: var(--blue);
  color: #fff;
}
.card-open {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}
.card-open:hover {
  color: var(--blue);
}

/* ---------- program list ---------- */

.list {
  border-top: 1px solid var(--border-l);
}

.row {
  background: var(--bg);
  border-bottom: 1px solid var(--border-l);
}
.row:hover {
  background: var(--bg2);
}
.row.open {
  background: var(--bg2);
}
.row.flash {
  animation: rowflash 1.2s ease-out;
}

.row-main {
  display: grid;
  grid-template-columns: 26px 28px minmax(150px, 1.5fr) 78px 122px 72px 64px 64px 76px;
  gap: 8px;
  align-items: center;
  padding: 12px;
  cursor: pointer;
}

.sel {
  display: flex;
  align-items: center;
  justify-content: center;
}
.sel input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
  cursor: pointer;
}

.rank {
  font-size: 13px;
  color: var(--muted2);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pname .n {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.35;
}
.pname .n a {
  color: inherit;
}
.pname .n a:hover {
  color: var(--blue);
  text-decoration: none;
}
.pname .sub {
  font-size: 12px;
  color: var(--muted);
}

.scorecell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.scorecell .num {
  font-size: 17px;
  font-weight: 500;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}
.scorecell .bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--border-l);
  overflow: hidden;
}
.scorecell .bar i {
  display: block;
  height: 100%;
  background: var(--blue);
  border-radius: 3px;
}

.metric {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.metric .lbl {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted2);
}
.metric b {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ---------- chips / badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.badge.green {
  background: var(--green-bg);
  color: var(--green-fg);
}
.badge.yellow {
  background: var(--amber-bg);
  color: var(--amber-fg);
}
.badge.red {
  background: var(--red-bg);
  color: var(--red-fg);
}
.badge.unknown {
  background: var(--bg3);
  color: var(--muted);
}

/* ---------- detail panel ---------- */

.detail {
  display: none;
  padding: 4px 20px 24px 66px;
  background: var(--bg2);
  border-top: 1px solid var(--border-l);
}
.row.open .detail {
  display: block;
}

.reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 14px;
}
.reason {
  display: inline-block;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--bg3);
  color: var(--ink2);
}
.reason.good {
  background: var(--green-bg);
  color: var(--green-fg);
}
.reason.bad {
  background: var(--red-bg);
  color: var(--red-fg);
}
.reason.neutral {
  background: var(--blue-l);
  color: var(--blue-d);
}

.mix {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.mixchip {
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2px 10px;
  color: var(--muted);
  background: var(--bg);
}
.mixchip b {
  color: var(--ink);
  font-weight: 500;
}

.bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 8px 28px;
  margin-bottom: 20px;
}
.barline {
  display: grid;
  grid-template-columns: 128px 1fr 40px;
  gap: 12px;
  align-items: center;
}
.barline span:first-child {
  font-size: 12px;
  color: var(--muted);
  text-transform: capitalize;
}
.barline .track {
  height: 6px;
  border-radius: 3px;
  background: var(--border-l);
  overflow: hidden;
}
.barline .track i {
  display: block;
  height: 100%;
  background: #8ab4f8;
  border-radius: 3px;
}
.barline .track i.hot {
  background: var(--blue);
}
.barline .val {
  font-size: 12px;
  color: var(--ink);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.scope-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.scope-head h4 {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}
.scope-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0 20px;
  font-family: var(--mono);
  font-size: 12px;
  max-height: 300px;
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 14px;
}
.scope-item {
  border-bottom: 1px solid var(--border-l);
  padding: 3px 0;
  word-break: break-all;
  color: var(--ink2);
}
.scope-item:last-child {
  border-bottom: none;
}
.scope-item .t {
  font-family: var(--font);
  font-size: 10px;
  color: var(--muted2);
  margin-left: 8px;
  letter-spacing: 0.4px;
}

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

.btn {
  appearance: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.3px;
  height: 40px;
  padding: 0 20px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--blue);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease;
}
.btn:hover {
  background: var(--blue-l);
  text-decoration: none;
}
.btn.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3);
}
.btn.primary:hover {
  background: var(--blue-d);
  border-color: var(--blue-d);
}
.btn.ghost {
  border-color: transparent;
  background: none;
}
.btn.ghost:hover {
  background: var(--blue-l);
}
.btn.sm {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}
.btn.full {
  width: 100%;
}
.star-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.star-btn .ic {
  width: 15px;
  height: 15px;
  fill: currentColor;
}
.star-icon .ic {
  fill: currentColor;
}
.star-icon:hover .ic {
  fill: var(--blue);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--bg3);
  color: var(--muted);
  border-color: transparent;
  box-shadow: none;
}

/* ---------- right rail ---------- */

.rail {
  position: sticky;
  top: var(--appbar-h);
  max-height: calc(100vh - var(--appbar-h));
  overflow-y: auto;
  padding: 28px 24px 40px 20px;
  border-left: 1px solid var(--border-l);
}
.rail-block {
  margin-bottom: 28px;
}
.rail-block h3 {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}
.rail-toc {
  list-style: none;
  margin: 0;
  padding: 0;
}
.rail-toc a {
  display: block;
  font-size: 14px;
  color: var(--ink2);
  padding: 5px 0 5px 10px;
  border-left: 2px solid transparent;
}
.rail-toc a:hover {
  color: var(--blue);
  border-left-color: var(--blue);
  text-decoration: none;
}

.rail-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rail-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}
.rail-stat .lbl {
  color: var(--muted);
}
.rail-stat .val {
  color: var(--ink);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.rail-empty {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.rail-cmp-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-l);
}
.rail-cmp-item span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink2);
}
.rail-cmp-item button {
  appearance: none;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.rail-cmp-item button:hover {
  color: var(--red-fg);
}
#rail-compare .btn {
  margin-top: 12px;
}

/* ---------- tray (narrow screens only) ---------- */

.tray {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  background: var(--bg);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 10px rgba(60, 64, 67, 0.18);
  transform: translateY(110%);
  transition: transform 0.25s ease;
}
.tray.show {
  transform: translateY(0);
}
.tray-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.tray-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
}
.tray-items {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tray-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  background: var(--bg3);
  border-radius: 999px;
  padding: 4px 8px 4px 12px;
  max-width: 220px;
}
.tray-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tray-item button {
  appearance: none;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.tray-item button:hover {
  color: var(--red-fg);
}
body.tray-open {
  padding-bottom: 68px;
}

/* ---------- dialogs ---------- */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
  overflow: auto;
}
.modal.open {
  display: flex;
}
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(32, 33, 36, 0.6);
}
.modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 600px;
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--shadow-2);
  padding: 24px;
}
.modal-card.wide {
  max-width: 1040px;
}
.modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.modal-head h2 {
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.2px;
}
.modal-head .btn {
  margin-left: auto;
}
.modal-head .btn + .btn {
  margin-left: 0;
}
.modal-card .lede {
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

/* ---------- what's new ---------- */

.news-btn {
  position: relative;
}
.news-dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red-fg);
  border: 1.5px solid var(--surface);
}
.news-card {
  max-width: 680px;
}
.news-sub {
  font-size: 12.5px;
  color: var(--muted);
}
#news-body {
  max-height: 62vh;
  overflow: auto;
  margin: 4px -8px 0;
}
.news-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
}
.news-item:hover {
  background: var(--bg2);
  text-decoration: none;
}
.news-ico {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 500;
}
.news-ico.green {
  background: var(--green-bg);
  color: var(--green-fg);
}
.news-ico.amber {
  background: var(--amber-bg);
  color: var(--amber-fg);
}
.news-ico.blue {
  background: var(--blue-l);
  color: var(--blue-d);
}
.news-ico.red {
  background: var(--red-bg);
  color: var(--red-fg);
}
.news-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.news-text b {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.news-text small {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.news-time {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}
.news-empty {
  padding: 16px 12px 22px;
}
.news-empty h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
}
.news-empty p {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}
.news-empty .hint {
  border-left: 2px solid var(--border);
  padding-left: 10px;
  font-size: 12px;
}

/* ---------- match card ---------- */

body.modal-open {
  overflow: hidden;
}
.match-card {
  max-width: 760px;
  padding: 0;
  overflow: hidden;
}
.match-card #match-body {
  padding: 0 28px 24px;
}
.match-head {
  position: relative;
  margin: 0 -28px 18px;
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--border-l);
  background: var(--bg2);
}
.match-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}
.match-head h2 {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.3px;
  margin: 8px 0 4px;
  padding-right: 36px;
}
.match-sub {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
  padding-right: 36px;
}
.modal-x {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.modal-x:hover {
  background: rgba(32, 33, 36, 0.08);
  color: var(--ink);
}

.why {
  background: var(--blue-l);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
.why-kicker {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--blue-d);
}
.why p {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink2);
}
.why .why-warn {
  color: var(--amber-fg);
  font-size: 13px;
}
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.mcell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.mcell span {
  font-size: 11px;
  color: var(--muted);
}
.mcell b {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mcell i {
  font-size: 11px;
  font-style: normal;
  color: var(--muted2);
}

.match-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 18px;
}
.match-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-l);
}
@media (max-width: 620px) {
  .why-grid,
  .match-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .match-card #match-body {
    padding: 0 18px 20px;
  }
  .match-head {
    margin: 0 -18px 16px;
    padding: 20px 18px 14px;
  }
}

.fieldset {
  margin-bottom: 22px;
}
.fieldset h3 {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}
.sliders {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.slider {
  display: grid;
  grid-template-columns: 132px 1fr 44px;
  gap: 12px;
  align-items: center;
  font-size: 13px;
  color: var(--ink2);
}
.slider input[type="range"] {
  width: 100%;
  accent-color: var(--blue);
}
.slider .sv {
  font-size: 13px;
  color: var(--ink);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 6px 14px;
  background: var(--bg);
  color: var(--ink2);
  cursor: pointer;
  user-select: none;
}
.chip:hover {
  background: var(--bg2);
}
.chip.on {
  background: var(--blue-l);
  border-color: transparent;
  color: var(--blue-d);
  font-weight: 500;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 8px;
}

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

.compare-scroll {
  overflow-x: auto;
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 620px;
}
.compare-table th,
.compare-table td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
  vertical-align: middle;
}
.compare-table thead th {
  background: var(--bg2);
}
.compare-table tbody th {
  background: var(--bg2);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.compare-table td {
  color: var(--ink2);
  font-variant-numeric: tabular-nums;
}
.compare-table td.best {
  background: var(--green-bg);
  color: var(--green-fg);
  font-weight: 500;
}
.compare-thumb {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.compare-thumb .ct-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
}
.compare-thumb .ct-sub {
  font-size: 12px;
  color: var(--muted);
}
.compare-thumb .badge {
  align-self: flex-start;
}

/* ---------- empty + foot ---------- */

.empty {
  border: 1px dashed var(--border);
  border-radius: var(--r);
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
}
.empty h3 {
  font-size: 20px;
  font-weight: 400;
  margin: 0 0 8px;
  color: var(--ink);
}
.empty p {
  margin: 0;
  font-size: 14px;
}

.foot {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink2);
  background: var(--bg2);
  border-radius: var(--r);
  padding: 18px 20px;
}
.foot b {
  color: var(--ink);
  font-weight: 500;
}
.method-links {
  font-size: 14px;
  color: var(--muted);
}

/* ==========================================================================
  catalog
  ========================================================================== */

.cat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 8px;
}
.cat-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 10px 0 6px;
}
.cat-sort {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.cat-sort select {
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
}
.cat-new {
  font-size: 10px;
  color: var(--blue-d);
  background: var(--blue-l);
  border-radius: 10px;
  padding: 1px 7px;
  margin-left: 6px;
}
.catseen {
  font-size: 11.5px;
  color: var(--muted2);
  font-variant-numeric: tabular-nums;
}
.catrow.latest {
  grid-template-columns: minmax(220px, 2fr) 96px 130px 100px 82px;
}
@media (max-width: 700px) {
  .catrow.latest {
    grid-template-columns: minmax(150px, 2fr) 84px 90px;
  }
  .catrow.latest .catnum,
  .catrow.latest .catcov {
    display: none;
  }
}
.cat-chip {
  appearance: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink2);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 6px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.cat-chip:hover {
  background: var(--bg2);
}
.cat-chip span {
  font-size: 11px;
  color: var(--muted2);
  font-variant-numeric: tabular-nums;
}
.cat-chip.active {
  background: var(--blue-l);
  border-color: transparent;
  color: var(--blue-d);
  font-weight: 500;
}
.cat-chip.active span {
  color: var(--blue-d);
}

.cat-plat {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.4px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1px 8px;
}

.catrow {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) 96px 76px minmax(120px, 1fr) 78px 86px 62px;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-l);
  font-size: 13px;
  color: var(--ink2);
}
.catrow:hover {
  background: var(--bg2);
}
.catname {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.catname a {
  color: var(--ink);
  font-weight: 500;
}
.catname a:hover {
  color: var(--blue);
  text-decoration: none;
}
.cat-scored {
  font-size: 10px;
  color: var(--green-fg);
  background: var(--green-bg);
  border-radius: 10px;
  padding: 1px 7px;
  margin-left: 6px;
}
.catplat {
  font-size: 12px;
  color: var(--muted);
}
.catnum {
  font-variant-numeric: tabular-nums;
  color: var(--ink2);
}
.cattypes {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.catcov {
  font-size: 12px;
  color: var(--muted2);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1000px) {
  .catrow {
    grid-template-columns: minmax(180px, 2fr) 90px 70px minmax(90px, 1fr) 70px 62px;
  }
  .catrow .catcov {
    display: none;
  }
}
@media (max-width: 700px) {
  .catrow {
    grid-template-columns: minmax(150px, 2fr) 84px 64px 70px;
  }
  .catrow .cattypes,
  .catrow .catcov {
    display: none;
  }
}

/* ---------- method ---------- */

.method-lede {
  max-width: 760px;
  font-size: 15px;
  color: var(--ink2);
}
.subhead {
  font-size: 18px;
  font-weight: 500;
  margin: 32px 0 10px;
  letter-spacing: -0.1px;
}
.doc .subhead:first-of-type {
  margin-top: 20px;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 6px 0 14px;
  max-width: 820px;
}
.doc-table th,
.doc-table td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}
.doc-table thead th {
  background: var(--bg2);
  font-weight: 500;
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.doc-table td {
  color: var(--ink2);
}
.doc-table td:first-child {
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
}

.formula {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  background: var(--bg2);
  border: 1px solid var(--border-l);
  border-radius: var(--r);
  padding: 16px 18px;
  overflow-x: auto;
  color: var(--ink2);
  max-width: 820px;
}

.limits {
  margin: 6px 0 0;
  padding-left: 20px;
  font-size: 14px;
  color: var(--ink2);
}
.limits li {
  margin: 4px 0;
}

/* ---------- method figures and research ---------- */

.trustbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 26px;
}
.trustbar span {
  font-size: 12px;
  color: var(--green-fg);
  background: var(--green-bg);
  border-radius: 14px;
  padding: 4px 12px;
  font-weight: 500;
}
.trustbar span::before {
  content: "\2713";
  margin-right: 6px;
  font-weight: 700;
}

.figure {
  margin: 18px 0 26px;
  max-width: 820px;
}
.figure-svg {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border-l);
  border-radius: var(--r);
  background: var(--surface);
  padding: 10px;
}
.fig-t {
  font-family: Roboto, Arial, sans-serif;
  font-size: 11.5px;
  font-weight: 500;
  fill: #202124;
}
.fig-s {
  font-family: Roboto, Arial, sans-serif;
  font-size: 10.5px;
  fill: #5f6368;
}
.figure figcaption,
.figure-cap {
  margin: 10px 2px 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

.research-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 18px 0 30px;
  max-width: 820px;
}
@media (max-width: 900px) {
  .research-grid {
    grid-template-columns: 1fr;
  }
}
.research {
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px;
  background: var(--surface);
}
.research-tag {
  font-size: 10.5px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--blue-d);
  font-weight: 500;
}
.research h4 {
  font-size: 14px;
  font-weight: 500;
  margin: 4px 0 6px;
  color: var(--ink);
}
.research p {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 10px;
}
.research a {
  font-size: 12px;
}

.wchart {
  border: 1px solid var(--border-l);
  border-radius: var(--r);
  background: var(--surface);
  padding: 14px 18px;
  max-width: 640px;
}
.wrow {
  display: grid;
  grid-template-columns: 170px 1fr 42px;
  gap: 12px;
  align-items: center;
  font-size: 12.5px;
  color: var(--ink2);
  padding: 5px 0;
}
.wrow i {
  display: block;
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, #1a73e8, #6aa6f8);
}
.wrow b {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--ink);
}
@media (max-width: 600px) {
  .wrow {
    grid-template-columns: 110px 1fr 36px;
  }
}

.covbars {
  border: 1px solid var(--border-l);
  border-radius: var(--r);
  background: var(--surface);
  padding: 16px 18px;
}
.covbar {
  display: grid;
  grid-template-columns: 96px 1fr 54px;
  gap: 12px;
  align-items: center;
  font-size: 12.5px;
  color: var(--ink2);
  padding: 4px 0;
}
.covbar i {
  display: block;
  height: 10px;
  border-radius: 5px;
  background: #1a73e8;
}
.covbar i.cov2 {
  background: #6aa6f8;
}
.covbar b {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.covbar-empty {
  font-size: 13px;
  color: var(--muted);
}
.cov-split {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-l);
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}

.callout-note {
  background: var(--blue-l);
  border-left: 3px solid var(--blue);
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink2);
  margin: 12px 0 16px;
  max-width: 820px;
}
.callout-note.warn {
  background: var(--amber-bg);
  border-left-color: #f0a200;
}
.callout-note b {
  color: var(--ink);
}

.verify,
.refs {
  margin: 6px 0 0;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink2);
  max-width: 820px;
}
.verify li,
.refs li {
  margin: 6px 0;
}
.refs i {
  color: var(--ink);
}

/* ---------- onboarding ---------- */
#onboard .modal-card {
  max-width: 520px;
}
.onboard-wordmark {
  text-align: center;
  margin-bottom: 8px;
  font-family: "Kalam", "Segoe Script", cursive;
  font-size: 36px;
  font-weight: 700;
  color: #0b3d91;
  line-height: 1;
}
#onboard h2 {
  text-align: center;
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.2px;
}
#onboard .lede {
  text-align: center;
}

.onboard-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0 8px;
}
.onboard-option {
  appearance: none;
  font-family: inherit;
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition:
    border-color 0.12s ease,
    background 0.12s ease,
    box-shadow 0.12s ease;
}
.onboard-option:hover {
  border-color: var(--blue);
  background: var(--blue-l);
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.2);
}
.onboard-option b {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}
.onboard-option span {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.onboard-actions {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

/* ---------- profile modal hints ---------- */

.hint {
  margin: 10px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}

/* ---------- match block (detail) ---------- */

.matchblock {
  border: 1px solid var(--border-l);
  border-radius: var(--r);
  background: var(--bg);
  padding: 12px 14px;
  margin: 0 0 16px;
  max-width: 560px;
}
.matchblock-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 10px;
}
.matchblock-delta {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.mline {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  border-top: 1px solid var(--border-l);
}
.mline:first-of-type {
  border-top: none;
}
.msurface {
  font-size: 13px;
  color: var(--ink2);
  text-transform: capitalize;
  min-width: 96px;
}
.mshare {
  font-size: 12px;
  color: var(--muted);
  min-width: 88px;
  font-variant-numeric: tabular-nums;
}
.mskill {
  font-size: 12px;
  padding: 2px 8px;
}

.matchblock-note {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.5;
}

/* ---------- row notes ---------- */

.match-note {
  color: var(--blue-d);
}
.crowd-note {
  color: var(--amber-fg);
}

/* ---------- rail skill gaps ---------- */

.gap-item {
  border-top: 1px solid var(--border-l);
  padding: 8px 0;
}
.gap-item:first-child {
  border-top: none;
}
.gap-head {
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
  text-transform: capitalize;
}
.gap-body {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.5;
}
.gap-example {
  font-size: 11.5px;
  color: var(--muted2);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- animations ---------- */

@keyframes rowflash {
  0% {
    background: var(--blue-l);
  }
  100% {
    background: transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ==========================================================================
  responsive
  ========================================================================== */

@media (max-width: 1240px) {
  .shell {
    grid-template-columns: 236px minmax(0, 1fr);
  }
  .rail {
    display: none;
  }
}

@media (max-width: 1100px) {
  .appbar-search {
    max-width: 320px;
  }
  .appbar-meta {
    display: none;
  }
  .doc {
    padding: 24px 24px 80px;
  }
  .row-main {
    grid-template-columns: 24px 26px minmax(130px, 1fr) 74px 122px 66px 66px;
  }
  .hide-md {
    display: none;
  }
}

@media (max-width: 1000px) {
  .avatar,
  .appbar-search kbd {
    display: none;
  }
  .btn-text {
    padding: 0 10px;
  }
  .btn-text span {
    display: none;
  }
  .appnav {
    margin-left: 8px;
  }
  .appnav-link {
    padding: 0 9px;
    font-size: 12px;
  }
}

@media (max-width: 860px) {
  :root {
    --appbar-h: 60px;
  }
  .appbar-inner {
    padding: 0 12px;
    gap: 4px;
  }
  .appnav {
    margin-left: 8px;
  }
  .appnav-link {
    padding: 0 10px;
    font-size: 12px;
  }
  .appbar-search {
    width: auto;
    max-width: none;
    flex: 1 1 auto;
    min-width: 0;
  }
  .appbar-search kbd {
    display: none;
  }
  .btn-text {
    padding: 0 8px;
  }
  .btn-text span {
    display: none;
  }
  .avatar {
    display: none;
  }

  .banner-inner {
    padding: 14px 16px;
    font-size: 17px;
  }

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

  /* sidebar becomes a horizontal scroller */
  .sidenav {
    position: static;
    max-height: none;
    overflow: visible;
    border-right: none;
    border-bottom: 1px solid var(--border-l);
    padding: 14px 16px;
    display: flex;
    gap: 24px;
    overflow-x: auto;
    align-items: flex-start;
  }
  .side-block {
    margin-bottom: 0;
    flex-shrink: 0;
  }
  .side-title {
    padding-left: 0;
  }
  .quick {
    flex-direction: row;
    flex-wrap: nowrap;
  }
  .quickchip {
    width: auto;
    white-space: nowrap;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 6px 12px;
  }
  .quickchip.active {
    border-color: transparent;
  }
  .chip-cnt {
    display: none;
  }
  .side-nav {
    flex-direction: row;
    gap: 4px;
  }
  .side-link {
    white-space: nowrap;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 6px 12px;
  }
  .side-link.active {
    border-color: transparent;
  }
  .controls select {
    min-width: 170px;
  }

  .doc {
    padding: 20px 16px 80px;
  }
  .h1-row h1 {
    font-size: 30px;
  }
  .doc h2 {
    font-size: 22px;
  }
  .h1-actions {
    display: none;
  }
  .crumb-right {
    display: none;
  }
  .detail {
    padding-left: 20px;
  }
}

@media (max-width: 620px) {
  .row-main {
    grid-template-columns: 20px 22px minmax(96px, 1fr) 62px 88px 62px;
  }
  .hide-sm {
    display: none;
  }
  .badge {
    font-size: 0;
    padding: 0 7px;
  }
  .badge .dot {
    width: 8px;
    height: 8px;
  }
  .compare-table td.best::after {
    content: "";
  }
}

/* ==========================================================================
   dark theme
   ========================================================================== */

[data-theme="dark"] {
  --blue: #8ab4f8;
  --blue-d: #aecbfa;
  --blue-l: #1b2b44;
  --blue-l2: #23395c;

  --ink: #e8eaed;
  --ink2: #c6c9ce;
  --muted: #9aa0a6;
  --muted2: #80868b;
  --border: #3c4043;
  --border-l: #2a2e33;
  --bg: #0f1216;
  --bg2: #171b21;
  --bg3: #1f242b;
  --surface: #171b21;

  --green-bg: #10331f;
  --green-fg: #81c995;
  --amber-bg: #3a2c0a;
  --amber-fg: #fdd663;
  --red-bg: #3b1715;
  --red-fg: #f28b82;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.6), 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 4px 16px rgba(0, 0, 0, 0.55);

  color-scheme: dark;
}

html[data-theme="dark"] body,
html[data-theme="dark"] .appbar {
  background: var(--bg);
}

[data-theme="dark"] .btn.primary {
  color: #0b1017;
}

[data-theme="dark"] .btn-text:hover,
[data-theme="dark"] .btn:hover,
[data-theme="dark"] .btn.ghost:hover {
  background: var(--bg3);
}

[data-theme="dark"] .icon-btn {
  background: var(--bg2);
}

[data-theme="dark"] .toc-box,
[data-theme="dark"] .callout {
  background: var(--bg2);
}

[data-theme="dark"] .formula {
  background: var(--bg2);
}

[data-theme="dark"] .figure-svg rect[fill="#ffffff"] {
  fill: #1b2028;
}

[data-theme="dark"] .figure-svg rect[fill="#e8f0fe"] {
  fill: #1b2b44;
  stroke: #8ab4f8;
}

[data-theme="dark"] .figure-svg rect[fill="#fef7e0"] {
  fill: #3a2c0a;
  stroke: #fdd663;
}

[data-theme="dark"] .figure-svg line[stroke="#dadce0"] {
  stroke: #3c4043;
}

[data-theme="dark"] .figure-svg line[stroke="#e8eaed"] {
  stroke: #2a2e33;
}

[data-theme="dark"] .figure-svg polyline[stroke="#1a73e8"] {
  stroke: #8ab4f8;
}

[data-theme="dark"] .fig-t {
  fill: #e8eaed;
}

[data-theme="dark"] .fig-s {
  fill: #9aa0a6;
}

/* theme toggle: one icon at a time */
.theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

.spacer {
  flex: 1 1 auto;
}

/* ==========================================================================
   home
   ========================================================================== */

.page-home {
  background: var(--bg);
}

.home-bar .appbar-inner {
  gap: 12px;
}

.home-explore {
  margin-left: 4px;
}

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

.home-hero {
  position: relative;
  overflow: hidden;
  background: radial-gradient(
      circle at 78% 18%,
      rgba(47, 127, 212, 0.55),
      transparent 46%
    ),
    linear-gradient(145deg, #0b3d91 0%, #082f70 55%, #062352 100%);
  color: #fff;
}

[data-theme="dark"] .home-hero {
  background: radial-gradient(
      circle at 78% 18%,
      rgba(47, 127, 212, 0.35),
      transparent 46%
    ),
    linear-gradient(145deg, #071f4a 0%, #051733 55%, #030d1f 100%);
}

.hero-hive {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-hive svg {
  width: 100%;
  height: 100%;
  display: block;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 48px;
  align-items: center;
  padding-top: 72px;
  padding-bottom: 72px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  padding: 6px 14px;
}

.refresh-ic {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #1a73e8;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.refresh-ic svg {
  width: 14px;
  height: 14px;
  fill: #ffffff;
}

.refresh-badge {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 8px 16px;
}
.refresh-badge b {
  color: #fff;
  font-weight: 500;
  letter-spacing: 0.1px;
}
.refresh-badge #home-refresh {
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.62);
  font-variant-numeric: tabular-nums;
}

.home-hero h1 {
  margin: 22px 0 18px;
  font-size: clamp(42px, 5.6vw, 68px);
  line-height: 1.03;
  letter-spacing: -2.2px;
  font-weight: 500;
  color: #fff;
  max-width: 12ch;
}

.hero-sub {
  margin: 0;
  max-width: 56ch;
  font-size: 17px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.8);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 34px;
}

.btn.lg {
  height: 46px;
  padding: 0 22px;
  font-size: 15px;
}

.hero-cta .btn.primary {
  background: #fff;
  border-color: #fff;
  color: #0b3d91;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.hero-cta .btn.primary:hover {
  background: #eef4ff;
  border-color: #eef4ff;
  color: #0b3d91;
}

.hero-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.hero-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 34px;
}

.hero-stats div {
  display: flex;
  flex-direction: column;
}

.hero-stats b {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.8px;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.hero-stats span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.62);
}

.hero-art {
  position: relative;
}

.mock-card {
  background: var(--surface);
  color: var(--ink2);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transform: rotate(-1.2deg);
}

.mock-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mock-top .badge {
  flex-shrink: 0;
}

.mock-score {
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -1.2px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.mock-name {
  margin-top: 14px;
  font-size: 19px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.2px;
}

.mock-sub {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
}

.mock-fit {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-l);
}

.mock-fit-head {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 8px;
}

.mock-fit-head b {
  color: var(--green-fg);
  font-weight: 500;
}

.mock-line {
  display: grid;
  grid-template-columns: 54px 1fr 40px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--ink2);
  padding: 3px 0;
}

.mock-line i {
  display: block;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--blue), #6aa6f8);
}

.mock-line em {
  font-style: normal;
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.mock-why {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--blue-l);
  color: var(--ink2);
  font-size: 12.5px;
  line-height: 1.55;
}

.mock-note {
  margin-top: 14px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.home-sources {
  border-bottom: 1px solid var(--border-l);
  background: var(--bg);
}

.home-sources .wrap {
  padding-top: 26px;
  padding-bottom: 26px;
}

.sources-label {
  margin: 0 0 16px;
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
}

.source-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.source {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.source img {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  object-fit: contain;
  background: #f1f3f4;
  border: 1px solid var(--border-l);
  padding: 4px;
  flex-shrink: 0;
}

.source b {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.section {
  padding-top: 64px;
  padding-bottom: 64px;
}

.section-title {
  font-size: clamp(28px, 3.2vw, 36px);
  font-weight: 500;
  letter-spacing: -0.9px;
  color: var(--ink);
  margin: 0;
}

.section-lede {
  max-width: 62ch;
  margin: 12px 0 0;
  font-size: 16px;
  line-height: 1.65;
  color: var(--muted);
}

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

.solve-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  display: flex;
  flex-direction: column;
}

.solve-kicker {
  font-size: 11px;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--blue);
  font-weight: 500;
}

.solve-card h3 {
  margin: 8px 0 8px;
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.2px;
}

.solve-card p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- home: what the index shows ---------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.feature-num {
  font-family: "Roboto Mono", monospace;
  font-size: 12px;
  letter-spacing: 1.2px;
  color: var(--blue);
}

.feature h3 {
  margin: 10px 0 8px;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.2px;
  color: var(--ink);
}

.feature p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--muted);
}

.dataset-band {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 26px;
}

.dataset-kicker {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--blue);
}

.dataset-band h3 {
  margin: 6px 0 8px;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.3px;
  color: var(--ink);
}

.dataset-band p {
  margin: 0;
  max-width: 66ch;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
}

.dataset-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 720px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }
  .dataset-band {
    padding: 20px;
  }
}

.solve-ui {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-l);
  font-size: 12px;
  color: var(--ink2);
}

.badges-ui {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bars-ui div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  align-items: center;
  padding: 3px 0;
}

.bars-ui i {
  display: block;
  height: 8px;
  border-radius: 4px;
  background: var(--blue);
}

.bars-ui i.hot {
  background: var(--red-fg);
}

.fit-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
}

.fit-row b {
  font-weight: 500;
  color: var(--ink);
}

.fit-row.dim {
  opacity: 0.55;
}

.fit-cap {
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
}

.research-band {
  background: var(--bg2);
  border-top: 1px solid var(--border-l);
  border-bottom: 1px solid var(--border-l);
  padding: 60px 0 66px;
}

.home-research {
  margin-top: 30px;
}

.preview-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.preview-list {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}

.preview-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto 70px;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-l);
  color: var(--ink2);
  text-decoration: none;
}

.preview-row:last-child {
  border-bottom: 0;
}

.preview-row:hover {
  background: var(--bg2);
  text-decoration: none;
}

.pv-rank {
  font-size: 12px;
  color: var(--muted2);
  font-variant-numeric: tabular-nums;
}

.pv-name {
  min-width: 0;
}

.pv-name b {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pv-name small {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
}

.pv-score {
  text-align: right;
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.preview-row.skeleton {
  height: 62px;
  opacity: 0.5;
}

.preview-row.skeleton span {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: var(--bg3);
}

.cta-band {
  background: linear-gradient(135deg, #0b3d91, #1967d2);
  color: #fff;
  padding: 56px 0;
}

.cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}

.cta-band h2 {
  margin: 0;
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 500;
  letter-spacing: -0.7px;
  color: #fff;
  max-width: 26ch;
}

.cta-band p {
  margin: 8px 0 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
}

.cta-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cta-band .btn.primary {
  background: #fff;
  border-color: #fff;
  color: #0b3d91;
}

.cta-band .btn.lg {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

/* ==========================================================================
   standalone pages (method)
   ========================================================================== */

.page-doc {
  max-width: 900px;
  margin: 0 auto;
  padding: 30px 28px 96px;
}

.page-crumbs {
  margin-bottom: 18px;
}

.page-doc > h1 {
  font-size: clamp(34px, 4vw, 46px);
  font-weight: 500;
  letter-spacing: -1.4px;
  color: var(--ink);
  margin: 0 0 16px;
}

.page-doc .method-lede {
  font-size: 17px;
  max-width: 70ch;
}

.page-method .doc-table {
  max-width: none;
}

.page-method .figure {
  max-width: none;
}

.site-foot {
  border-top: 1px solid var(--border-l);
  background: var(--bg);
  padding: 30px 0;
}

.site-foot-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.site-foot b {
  font-size: 16px;
  color: var(--ink);
  font-weight: 500;
}

.site-foot p {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

.site-foot nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.site-foot nav a {
  font-size: 13px;
  color: var(--muted);
}

.site-foot nav a:hover {
  color: var(--blue);
}

.foot-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
}

.foot-social {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px solid var(--border-l);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12.5px;
  color: var(--ink2);
  text-decoration: none;
}

.social-link:hover {
  border-color: var(--blue);
  color: var(--blue);
  text-decoration: none;
}

.social-link .ic {
  width: 14px;
  height: 14px;
  fill: currentColor;
  flex: 0 0 auto;
}

.social-link.bmc img {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  display: block;
}

.soon {
  font-size: 9px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border-l);
  border-radius: 4px;
  padding: 1px 4px;
}

@media (max-width: 640px) {
  .foot-side {
    align-items: flex-start;
  }
}

/* ==========================================================================
   home + page responsive
   ========================================================================== */

@media (max-width: 980px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 36px;
    padding-top: 52px;
    padding-bottom: 56px;
  }

  .home-hero h1 {
    max-width: 16ch;
  }

  .hero-art {
    max-width: 460px;
  }

  .source-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }

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

@media (max-width: 620px) {
  .wrap {
    padding: 0 16px;
  }

  .hero-stats {
    gap: 20px;
  }

  .hero-stats b {
    font-size: 23px;
  }

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

  .home-explore {
    display: none;
  }

  .star-btn {
    padding: 0 9px;
  }

  .star-btn .star-label {
    display: none;
  }

  .preview-row {
    grid-template-columns: 30px minmax(0, 1fr) 58px;
  }

  .preview-row .badge {
    display: none;
  }

  .page-doc {
    padding: 22px 16px 72px;
  }

  .page-doc .doc-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .cta-inner {
    align-items: flex-start;
  }
}

@media (max-width: 760px) {
  .appbar-inner {
    padding: 0 12px;
    gap: 6px;
  }

  .appnav {
    margin-left: 2px;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

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

  .appnav-link {
    padding: 0 8px;
    font-size: 12px;
    white-space: nowrap;
  }

  .home-bar .appnav-link[href="index.html"] {
    display: none;
  }

  .top-explore {
    display: none;
  }

  .theme-toggle {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
  }
}

@media (max-width: 700px) {
  .appbar-inner {
    height: auto;
    min-height: 56px;
    flex-wrap: wrap;
    padding: 8px 12px;
    row-gap: 6px;
  }

  .brand-name {
    font-size: 28px;
  }

  .appnav {
    order: 3;
    flex: 1 0 100%;
    margin-left: 0;
    overflow-x: auto;
    height: 40px;
  }

  .appnav-link {
    height: 40px;
  }

  .appbar-search {
    order: 2;
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    margin: 0;
  }

  .appbar-search input {
    min-width: 0;
  }

  .btn-text {
    display: none;
  }

  .home-explore {
    display: none;
  }

  .star-btn {
    padding: 0 9px;
  }

  .star-btn .star-label {
    display: none;
  }

  .appbar-meta {
    display: none;
  }

  .theme-toggle,
  .news-btn {
    flex: 0 0 auto;
  }

  .doc {
    padding-left: 16px;
    padding-right: 16px;
  }

  .surface-filter {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 360px;
    padding-top: 4px;
  }

  .surface-filter label {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 5px 10px;
    font-size: 12px;
  }

  .surface-filter .chip-cnt {
    display: none;
  }

  #clear-surfaces {
    margin: 4px 0 0;
  }
}
