/* Design: see design.md (stone neutrals, ink as the only accent, color only for status) */
:root {
  --primary: #1c1917;
  --primary-foreground: #fff;
  --foreground: #292524;
  --subtle: #57534e;
  --muted: #78716c;
  --stroke: #e7e5e4;
  --background: #fafaf9;
  --surface: #fff;
  --inset: #f5f5f4;
  --bar: #1c1917;
  --brand: #ffcc00;
  --brand-foreground: #1c1917;
  --success-bg: #ecfdf5;
  --success-fg: #047857;
  --warning-bg: #fffbeb;
  --warning-fg: #b45309;
  --danger-bg: #fef2f2;
  --danger-fg: #b91c1c;
  --info-bg: #f0f9ff;
  --info-fg: #0369a1;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --heading: "Outfit", var(--sans);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --primary: #f5f5f4;
    --primary-foreground: #1c1917;
    --foreground: #fafaf9;
    --subtle: #d6d3d1;
    --muted: #a8a29e;
    --stroke: #44403c;
    --background: #1c1917;
    --surface: #292524;
    --inset: #1c1917;
    --bar: #0c0a09;
    --success-bg: rgba(16, 185, 129, 0.15);
    --success-fg: #6ee7b7;
    --warning-bg: rgba(245, 158, 11, 0.15);
    --warning-fg: #fcd34d;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --danger-fg: #fca5a5;
    --info-bg: rgba(14, 165, 233, 0.15);
    --info-fg: #7dd3fc;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font: 14px/1.43 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--foreground);
  text-decoration: underline;
  text-decoration-color: var(--stroke);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.2s;
}
a:hover {
  text-decoration-color: currentColor;
}
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}
svg.i {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* ── The bar ── */
.bar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  height: 64px;
  background: var(--bar);
  border-bottom: 1px solid rgba(0, 0, 0, 0.3);
  color: #fff;
}
.bar-inner {
  max-width: 1152px;
  height: 100%;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font: 700 18px var(--heading);
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.brand-tile {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  transform: rotate(3deg);
}
.brand-tile svg {
  width: 22px;
  height: 22px;
}
.bar form {
  flex: 1;
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}
.bar form svg.i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: rgba(255, 255, 255, 0.6);
  pointer-events: none;
}
.bar input {
  width: 100%;
  height: 38px;
  padding: 0 14px 0 36px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font: 500 14px var(--sans);
  outline: none;
  transition:
    background 0.2s,
    border-color 0.2s;
}
.bar input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}
.bar input:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
}
.bar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.nav-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s;
}
.nav-icon:hover:not(:disabled) {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
.nav-icon:disabled {
  opacity: 0.35;
  cursor: default;
}
.tip {
  pointer-events: none;
  position: absolute;
  top: 100%;
  left: 50%;
  margin-top: 8px;
  transform: translateX(-50%);
  white-space: nowrap;
  border-radius: 8px;
  background: #1c1917;
  color: #fff;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.15s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  z-index: 50;
}
.nav-icon:hover .tip,
.nav-icon:focus-visible .tip {
  opacity: 1;
}
.bar-actions .tip {
  left: auto;
  right: 0;
  transform: none;
}

/* ── Page ── */
main {
  max-width: 1152px;
  margin: 0 auto;
  padding: 112px 32px 64px;
}
.page-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 24px;
}
/* Logos come in every shape: a wide wordmark gets up to 240px, a square icon stays 96px */
.logo {
  height: 96px;
  width: auto;
  min-width: 96px;
  max-width: 240px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: #fff;
  object-fit: contain;
  padding: 12px;
  flex-shrink: 0;
}
.logo.tile {
  width: 96px;
  display: grid;
  place-items: center;
  padding: 0;
  font: 700 36px var(--heading);
  background: var(--inset);
  color: var(--foreground);
}
h1 {
  font: 700 24px/1.3 var(--heading);
  letter-spacing: -0.02em;
  margin: 0;
}
.domain-line {
  font: 12px var(--mono);
  color: var(--muted);
  margin-top: 2px;
}
.domain-line a {
  color: var(--subtle);
}
.lead {
  color: var(--subtle);
  margin: 10px 0 0;
  max-width: 72ch;
  font-size: 15px;
  line-height: 1.55;
}
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 11px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: var(--inset);
  color: var(--subtle);
  border: 1px solid var(--stroke);
  white-space: nowrap;
}
.badge.success {
  background: var(--success-bg);
  color: var(--success-fg);
  border-color: transparent;
}
.badge.warning {
  background: var(--warning-bg);
  color: var(--warning-fg);
  border-color: transparent;
}
.badge.danger {
  background: var(--danger-bg);
  color: var(--danger-fg);
  border-color: transparent;
}
.badge.info {
  background: var(--info-bg);
  color: var(--info-fg);
  border-color: transparent;
}
.meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 10px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 14px 16px;
}
.stat-value {
  font: 700 20px var(--heading);
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.wide {
  grid-column: 1 / -1;
}
.card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  min-width: 0;
}
.card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--stroke);
}
.label {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0;
}
.count {
  font-size: 12px;
  color: var(--muted);
}
.card-body {
  padding: 16px 20px;
}
dl {
  display: grid;
  grid-template-columns: minmax(96px, max-content) 1fr;
  gap: 8px 20px;
  margin: 0;
}
dt {
  color: var(--muted);
}
dd {
  margin: 0;
  overflow-wrap: anywhere;
  min-width: 0;
}
.empty {
  color: var(--muted);
  margin: 0;
}
.mono {
  font-family: var(--mono);
  font-size: 12px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--inset);
  border: 1px solid var(--stroke);
  font-size: 12px;
  color: var(--foreground);
  text-decoration: none;
  white-space: nowrap;
}
a.chip:hover {
  border-color: var(--muted);
}
.swatch {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}
.sub {
  color: var(--muted);
  font-size: 12px;
}
.list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

details {
  margin-top: 12px;
}
details summary {
  cursor: pointer;
  color: var(--subtle);
  font-weight: 600;
  font-size: 13px;
}
pre {
  margin: 8px 0 0;
  padding: 14px 16px;
  background: var(--inset);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  font: 12px/1.6 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 420px;
  overflow: auto;
}
pre.json {
  max-height: 70vh;
  margin: 0;
  border: 0;
  border-radius: 0 0 16px 16px;
}
.text {
  color: var(--subtle);
  line-height: 1.6;
  margin: 8px 0 0;
  max-height: 220px;
  overflow: auto;
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}
.thumbs a {
  display: block;
  aspect-ratio: 1;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--inset);
  overflow: hidden;
}
.thumbs img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
th {
  padding: 10px 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--subtle);
  background: var(--inset);
  border-bottom: 1px solid var(--stroke);
  white-space: nowrap;
}
td {
  padding: 10px 20px;
  border-bottom: 1px solid var(--stroke);
  vertical-align: top;
}
tbody tr:last-child td {
  border-bottom: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  color: var(--foreground);
  font: 600 12px var(--sans);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
  white-space: nowrap;
}
.btn:hover {
  background: var(--inset);
}
.btn svg.i {
  width: 14px;
  height: 14px;
}

.state {
  max-width: 520px;
  margin: 48px auto 0;
  text-align: center;
}
.state h1 {
  margin-bottom: 6px;
}
.state p {
  color: var(--subtle);
  margin: 0 0 16px;
}
.state .chips {
  justify-content: center;
}
.alert {
  border-radius: 16px;
  padding: 16px 20px;
  background: var(--danger-bg);
  color: var(--danger-fg);
}
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--stroke);
  border-top-color: var(--foreground);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  vertical-align: -4px;
  margin-right: 10px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 2.4s;
  }
}

/* ── Bar links ── */
.bar-link {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  text-decoration: none;
  transition:
    background 0.2s,
    color 0.2s;
}
.bar-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
.bar-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}
.bar-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.25);
  margin: 0 6px;
}

/* ── Page types ── */
.page-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}
.page-tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: var(--surface);
  min-width: 0;
}
.page-tile-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: var(--primary-foreground);
  flex-shrink: 0;
}
.page-icon svg.i {
  width: 18px;
  height: 18px;
}
.page-tile-title {
  font-weight: 600;
}
.page-tile-desc {
  color: var(--subtle);
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.page-tile .chips {
  gap: 4px;
}
.page-tile .chip {
  font-size: 11px;
  padding: 1px 6px;
}
.missing {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.missing .chip {
  color: var(--muted);
  background: none;
  border-style: dashed;
}

/* ── Technologies page ── */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}
.search {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 420px;
}
.search svg.i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}
.input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 36px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  color: var(--foreground);
  font: 14px var(--sans);
  outline: none;
  transition: border-color 0.2s;
}
.input:focus {
  border-color: var(--muted);
  box-shadow: 0 0 0 3px rgba(28, 25, 23, 0.08);
}
button.chip {
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}
button.chip[aria-pressed="true"] {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}
button.chip .n {
  color: var(--muted);
}
button.chip[aria-pressed="true"] .n {
  color: inherit;
  opacity: 0.7;
}
.tech-table {
  table-layout: fixed;
  min-width: 640px;
}
.tech-table th:nth-child(1) {
  width: 24%;
}
.tech-table th:nth-child(3) {
  width: 30%;
}
.tech-name {
  font-weight: 600;
}
.tech-desc {
  color: var(--subtle);
}
td.nowrap {
  white-space: nowrap;
}
.page-title-sub {
  color: var(--subtle);
  margin: 4px 0 20px;
}

.nav-icon.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}
code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--inset);
  border: 1px solid var(--stroke);
  border-radius: 6px;
  padding: 1px 5px;
}

/* ── Modal (native <dialog>) ── */
.modal {
  width: min(640px, calc(100% - 32px));
  max-height: calc(100vh - 64px);
  padding: 0;
  border: 1px solid var(--stroke);
  border-radius: 24px;
  background: var(--surface);
  color: var(--foreground);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
}
.modal::backdrop {
  background: rgba(12, 10, 9, 0.5);
}
.modal[open] {
  animation: scale-in 0.2s ease-out;
}
@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 16px 24px;
  border-bottom: 1px solid var(--stroke);
}
.modal-header h2 {
  margin: 0;
  font: 600 20px var(--heading);
}
.modal-body {
  padding: 20px 24px 24px;
  color: var(--subtle);
  line-height: 1.6;
}
.modal-body .label {
  margin: 20px 0 6px;
}
.modal-body ol,
.modal-body ul {
  margin: 0;
  padding-left: 20px;
}
.modal-body li {
  margin-bottom: 4px;
}
.btn-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--subtle);
  cursor: pointer;
  transition: background 0.2s;
}
.btn-icon:hover {
  background: var(--inset);
  color: var(--foreground);
}

/* ── Images with their alt text ── */
.images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.image {
  margin: 0;
  min-width: 0;
}
.image a {
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--inset);
  overflow: hidden;
}
.image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.image figcaption {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--subtle);
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.image figcaption.no-alt {
  color: var(--warning-fg);
}

/* ── Timeline (recently indexed) ── */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 27px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--stroke);
}
.timeline-day {
  position: relative;
  margin: 24px 0 12px 56px;
}
.timeline-day:first-child {
  margin-top: 0;
}
.timeline-item {
  position: relative;
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}
.timeline-mark {
  width: 56px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  padding-top: 18px;
}
.timeline-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--muted);
  position: relative;
  z-index: 1;
}
.timeline-item.latest .timeline-dot {
  background: var(--primary);
  border-color: var(--primary);
}
.timeline-card {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s;
}
.timeline-card:hover {
  border-color: var(--muted);
}
.timeline-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: #fff;
  object-fit: contain;
  padding: 4px;
  flex-shrink: 0;
}
.timeline-logo.tile {
  display: grid;
  place-items: center;
  padding: 0;
  font: 700 20px var(--heading);
  background: var(--inset);
  color: var(--foreground);
}
.timeline-title {
  font-weight: 600;
  color: var(--foreground);
}
.timeline-time {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

/* Small uppercase line above a title */
.eyebrow {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 6px;
}

/* ── Text pages (About) ── */
.prose {
  max-width: 760px;
}
.prose p,
.prose li {
  color: var(--subtle);
  line-height: 1.65;
}
.prose h2 {
  font: 600 18px var(--heading);
  margin: 28px 0 8px;
  color: var(--foreground);
}
.prose li {
  margin-bottom: 6px;
}
.prose strong {
  color: var(--foreground);
}

.prose h3 {
  font: 600 15px var(--sans);
  margin: 18px 0 4px;
  color: var(--foreground);
}
.prose pre {
  max-height: none;
}
.prose .table-wrap {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  margin: 8px 0 12px;
}
.prose td,
.prose th {
  padding: 8px 12px;
  font-size: 13px;
}
.toc {
  font-size: 13px;
  margin: 8px 0 8px;
}
.docs {
  max-width: 880px;
}

/* ── Panels ── */
.panel-no {
  display: inline-block;
  font-family: var(--mono);
  font-weight: 500;
  color: var(--subtle);
  background: var(--inset);
  border: 1px solid var(--stroke);
  border-radius: 6px;
  padding: 0 5px;
  margin-right: 8px;
  letter-spacing: 0;
}
.ok {
  color: var(--success-fg);
}
.no {
  color: var(--danger-fg);
}
svg.i.ok {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
}
.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--warning-bg);
  color: var(--warning-fg);
  margin-bottom: 16px;
}

/* Verdict */
.verdict {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
.verdict-item .label {
  margin-bottom: 6px;
}
.verdict-value {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
}
.crumbs a {
  color: var(--foreground);
}

/* Report */
.report {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 28px;
}
.report-score {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.grade {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font: 700 28px var(--heading);
  background: var(--inset);
}
.grade-A,
.grade-B {
  background: var(--success-bg);
  color: var(--success-fg);
}
.grade-C,
.grade-D {
  background: var(--warning-bg);
  color: var(--warning-fg);
}
.grade-E {
  background: var(--danger-bg);
  color: var(--danger-fg);
}
.report-number {
  font: 700 32px var(--heading);
}
.report-number span {
  font-size: 16px;
  color: var(--muted);
  font-weight: 500;
}
.score-row {
  display: grid;
  grid-template-columns: 130px 1fr 32px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.score-row strong {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.bar-track {
  height: 6px;
  border-radius: 999px;
  background: var(--inset);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 999px;
}
.bar-fill.good {
  background: var(--success-fg);
}
.bar-fill.mid {
  background: var(--warning-fg);
}
.bar-fill.bad {
  background: var(--danger-fg);
}
.tips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.tip-item {
  padding: 8px 12px 8px 14px;
  border-radius: 12px;
  background: var(--inset);
  border-left: 3px solid var(--stroke);
  line-height: 1.5;
}
.tip-item.high {
  border-left-color: var(--danger-fg);
}
.tip-item.medium {
  border-left-color: var(--warning-fg);
}

/* Checks (SEO, accessibility, security) */
dl.checks {
  grid-template-columns: minmax(140px, max-content) 1fr;
}
table.hours {
  width: auto;
  border-collapse: collapse;
}
table.hours td {
  padding: 1px 16px 1px 0;
  border: 0;
}
.tech-chip img {
  width: 14px;
  height: 14px;
  object-fit: contain;
}
.missing-wrap {
  margin-top: 16px;
}
.missing-wrap .missing {
  margin-top: 8px;
}

/* Technologies */
.tech-rows .tech-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 20px;
  border-bottom: 1px solid var(--stroke);
}
.tech-rows .tech-row:last-child {
  border-bottom: 0;
}
.tech-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--inset);
  display: grid;
  place-items: center;
}
.tech-icon img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}
.tech-count {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Crawl log: one compact line for the title, one for the keywords */
.log-cell {
  max-width: 520px;
}
.one-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Forms */
.textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  color: var(--foreground);
  font: 13px/1.5 var(--mono);
  resize: vertical;
}

/* Explore & taxonomy */
.more-filters {
  flex-basis: 100%;
  order: 10;
}
.more-filters summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--subtle);
}
.check-label {
  flex-direction: row !important;
  align-items: center;
  gap: 6px !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 13px !important;
  height: 36px;
}
.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 20px;
}
.filters-bar label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.select {
  height: 36px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  color: var(--foreground);
  font: 14px var(--sans);
  min-width: 160px;
}
.input.plain {
  padding-left: 12px;
  min-width: 180px;
}
.results {
  display: grid;
  gap: 12px;
}
.tree {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tree ul {
  list-style: none;
  margin: 4px 0 4px 18px;
  padding: 0 0 0 12px;
  border-left: 1px solid var(--stroke);
}
.tree li {
  margin: 3px 0;
}
.tree-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
}
.tree-row .sub {
  font-size: 12px;
}

@media (max-width: 960px) {
  .verdict {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .report {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  /* Two rows on phones: logo + icons, then the search box full width */
  .bar {
    height: auto;
  }
  .bar-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 12px;
    gap: 8px;
  }
  .bar form {
    order: 3;
    flex-basis: 100%;
    max-width: none;
    min-width: 0;
  }
  .bar-actions {
    margin-left: auto;
  }
  .bar-actions {
    gap: 0;
  }
  .nav-icon {
    width: 32px;
  }
  .brand-tile {
    width: 32px;
    height: 32px;
  }
  .brand-name,
  .bar-link,
  .bar-divider {
    display: none;
  }
  main {
    padding: 124px 16px 48px;
  }
  .grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .verdict {
    grid-template-columns: minmax(0, 1fr);
  }
  /* Facts stack on phones: label above value, so long labels don't push chips off-screen */
  dl,
  dl.checks {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  dd {
    margin-bottom: 10px;
  }
  .chip {
    white-space: normal;
  }
  .page-head {
    flex-direction: column;
  }
  .card-header,
  .card-body,
  th,
  td {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* The hidden attribute always wins over display rules (.btn, .row, ...) */
[hidden] {
  display: none !important;
}

/* ── The ⋯ menu in the bar ── */
.nav-more {
  position: relative;
}
.nav-more summary {
  list-style: none;
}
.nav-more summary::-webkit-details-marker {
  display: none;
}
.nav-more[open] summary .tip {
  opacity: 0;
}
.nav-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 230px;
  padding: 6px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  z-index: 60;
}
.nav-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--foreground);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.nav-menu-item .i {
  width: 16px;
  height: 16px;
  color: var(--muted);
}
.nav-menu-item:hover,
.nav-menu-item.active {
  background: var(--inset);
}

/* ── Search page ── */
.search-total .big-number {
  font: 700 44px/1 var(--heading);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.section-title {
  font-size: 16px;
  margin: 28px 0 12px;
}
.facets-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.facet-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(40px, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 5px 6px;
  margin: 0 -6px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--foreground);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.facet-row:hover {
  background: var(--inset);
}
.facet-row[data-narrow=""] {
  cursor: default;
}
.facet-row[data-narrow=""]:hover {
  background: none;
}
.facet-row .facet-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.facet-row .bar-fill {
  display: block;
  background: var(--primary);
}
.facet-row strong {
  font-variant-numeric: tabular-nums;
}
.result-lines {
  display: grid;
  gap: 2px;
}
.result-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 12px;
  padding: 6px 8px;
  margin: 0 -8px;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  font-size: 13px;
}
.result-line:hover {
  background: var(--inset);
}
@media (max-width: 640px) {
  .result-line {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* The report as an AI prompt */
.ai-prompt {
  margin: 0 0 16px;
}
.ai-prompt summary {
  cursor: pointer;
}
.prompt-text {
  margin: 8px 0 0;
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  font: 12px/1.5 var(--mono, monospace);
  background: var(--inset);
  border-radius: 12px;
  padding: 12px 14px;
}
