:root {
  --bg: oklch(0.17 0.02 280);
  --bg-2: oklch(0.2 0.025 280);
  --surface: oklch(0.23 0.025 280);
  --line: oklch(0.32 0.03 280);
  --ink: oklch(0.96 0.01 280);
  --muted: oklch(0.76 0.03 280);
  --accent: oklch(0.62 0.2 280);
  --accent-2: oklch(0.72 0.16 75);
  --ok: oklch(0.74 0.15 155);
  --warn: oklch(0.8 0.14 75);
  --bad: oklch(0.68 0.19 25);
  --radius: 14px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body.zseo-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

.zseo-side {
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.zseo-brand {
  font-family: Outfit, Inter, sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
}
.zseo-side nav { display: flex; flex-direction: column; gap: 6px; }
.zseo-side nav a, .zseo-side-foot a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 10px;
}
.zseo-side nav a:hover, .zseo-side nav a.is-on { background: var(--surface); color: var(--ink); }
.zseo-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 13px; }

.zseo-main { padding: 28px 32px 64px; min-width: 0; }
.zseo-loading { color: var(--muted); }

.zseo-h {
  font-family: Outfit, Inter, sans-serif;
  font-size: clamp(1.4rem, 2vw, 2rem);
  letter-spacing: -0.03em;
  margin: 0 0 6px;
  text-wrap: balance;
}
.zseo-lead { color: var(--muted); margin: 0 0 24px; }

.zseo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.zseo-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 180ms var(--ease), border-color 180ms var(--ease);
}
a.zseo-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.zseo-card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.zseo-card p { margin: 0; color: var(--muted); font-size: 13px; }
.zseo-score {
  font-family: Outfit, sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}
.zseo-card-meta { margin-top: 8px !important; font-size: 12px !important; }
.zseo-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 0 0 28px;
}
.zseo-stats > div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: grid;
  gap: 4px;
}
.zseo-stats b { font-family: Outfit, sans-serif; font-size: 1.6rem; letter-spacing: -0.03em; }
.zseo-stats span { color: var(--muted); font-size: 12px; }
.zseo-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.zseo-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--muted);
}
.zseo-delta {
  margin-left: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  vertical-align: middle;
}
.zseo-delta.up { color: var(--ok); }
.zseo-delta.down { color: var(--bad); }
.zseo-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.zseo-filters button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
  font: 500 12px Inter, sans-serif;
}
.zseo-card-fix { margin-top: 8px !important; color: var(--ink) !important; font-size: 13px !important; }
.zseo-fix {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  display: grid;
  gap: 8px;
  max-width: 72ch;
}
.zseo-rec {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  padding: 12px 14px;
  cursor: pointer;
  font: inherit;
}
.zseo-rec:hover { border-color: var(--accent); }
.zseo-rec p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 13px; }
.zseo-rec span { color: var(--muted); font-size: 13px; }
.zseo-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.zseo-search {
  flex: 1;
  min-width: 160px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  font: 13px Inter, sans-serif;
}
.zseo-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100vw);
  height: 100vh;
  background: var(--bg-2);
  border-left: 1px solid var(--line);
  padding: 20px;
  overflow: auto;
  z-index: 20;
}
.zseo-drawer ul { padding-left: 18px; }

.zseo-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 18px; align-items: center; }
.zseo-btn {
  appearance: none;
  border: 0;
  background: var(--accent);
  color: white;
  font: 600 14px Inter, sans-serif;
  padding: 10px 14px;
  border-radius: 11px;
  cursor: pointer;
}
.zseo-btn[disabled] { opacity: .5; cursor: wait; }
.zseo-btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.zseo-tabs { display: flex; gap: 6px; margin: 8px 0 16px; }
.zseo-tabs button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font: 500 13px Inter, sans-serif;
}
.zseo-tabs button.is-on { color: var(--ink); border-color: var(--accent); background: color-mix(in oklch, var(--accent) 16%, transparent); }

.zseo-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.zseo {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.zseo th, table.zseo td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.zseo th { color: var(--muted); font-weight: 600; background: var(--bg-2); position: sticky; top: 0; }
table.zseo td.url { max-width: 280px; word-break: break-all; }
.sev-error { color: var(--bad); font-weight: 600; }
.sev-warn { color: var(--warn); font-weight: 600; }
.sev-info { color: var(--muted); }

.zseo-form { display: grid; gap: 12px; max-width: 640px; }
.zseo-form label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.zseo-form input {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
  font: 14px Inter, sans-serif;
}
.zseo-note {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  color: var(--muted);
  max-width: 72ch;
}
.zseo-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line); }
.zseo-pill.on { border-color: var(--ok); color: var(--ok); }
.zseo-progress { height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; max-width: 420px; }
.zseo-progress > span { display: block; height: 100%; background: var(--accent); width: 0; transition: width 200ms var(--ease); }

@media (max-width: 800px) {
  body.zseo-app { grid-template-columns: 1fr; }
  .zseo-side { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .zseo-side nav { flex-direction: row; }
  .zseo-side-foot { margin: 0 0 0 auto; }
  .zseo-main { padding: 18px 16px 48px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Landing */
body.zseo-land {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, sans-serif;
}
.land-wrap { max-width: 1080px; margin: 0 auto; padding: 28px 20px 80px; }
.land-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 72px; }
.land-nav a { color: var(--ink); text-decoration: none; }
.land-hero h1 {
  font-family: Outfit, sans-serif;
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  letter-spacing: -0.04em;
  line-height: 1.05;
  max-width: 16ch;
  text-wrap: balance;
  margin: 0 0 16px;
}
.land-hero p { color: var(--muted); font-size: 1.15rem; max-width: 46ch; }
.land-cta { display: inline-block; margin-top: 28px; background: var(--accent); color: #fff; text-decoration: none; padding: 12px 18px; border-radius: 12px; font-weight: 600; }
.land-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 72px; }
.land-grid article {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  background: var(--surface);
}
.land-grid h2 { font-family: Outfit, sans-serif; font-size: 1.2rem; margin: 0 0 8px; }
.land-grid p { margin: 0; color: var(--muted); }
.land-sites { margin-top: 56px; color: var(--muted); }
.land-sites strong { color: var(--ink); }
