:root {
  --bg: #faf9f7; --surface: #ffffff; --border: #e7e3dc; --border-soft: #f0ede7;
  --text: #1c1a17; --muted: #8a8478; --faint: #b5afa3;
  --accent: #d97706; --accent-soft: #fdf3e3;
  --open: #1a7f4b; --open-bg: #e6f4ec;
  --closed: #6b6459; --closed-bg: #f0ede7;
  --bad: #b3423a;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141310; --surface: #1c1a16; --border: #302d27; --border-soft: #26241f;
    --text: #ece8e1; --muted: #948d80; --faint: #635d52;
    --accent: #f59e0b; --accent-soft: #2c2214;
    --open: #4ade80; --open-bg: #14291c;
    --closed: #a39c8f; --closed-bg: #262420;
    --bad: #f87171;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.wrap { max-width: 1140px; margin: 0 auto; padding: 40px 20px 64px; }
h1 { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; margin: 0 0 4px; }
.sub { color: var(--muted); margin: 0 0 28px; font-size: 14px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.navlink {
  flex-shrink: 0; margin-top: 6px; padding: 7px 14px; font-size: 13.5px; font-weight: 600;
  color: var(--accent); background: var(--accent-soft); border-radius: 8px; text-decoration: none;
  white-space: nowrap;
}
.navlink:hover { filter: brightness(0.97); }

.controls {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px;
  position: sticky; top: 0; z-index: 3; background: var(--bg); padding: 10px 0;
}
.search {
  flex: 1 1 200px; min-width: 160px;
  padding: 8px 12px; font-size: 14px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  outline: none;
}
.search:focus { border-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button {
  padding: 8px 14px; font-size: 13.5px; border: none; background: transparent;
  color: var(--muted); cursor: pointer; font-weight: 500;
}
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
select.hw {
  padding: 8px 10px; font-size: 13.5px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
}
button.fit {
  padding: 8px 14px; font-size: 13.5px; font-weight: 500; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
}
button.fit.on { background: var(--open-bg); color: var(--open); border-color: var(--open); font-weight: 600; }
.count { color: var(--muted); font-size: 13px; margin-left: auto; font-variant-numeric: tabular-nums; }

.tablewrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 760px; }
thead th {
  position: sticky; top: 0; background: var(--surface); z-index: 2;
  text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--muted); padding: 10px 14px;
  border-bottom: 1px solid var(--border); cursor: pointer; user-select: none; white-space: nowrap;
}
thead th:hover { color: var(--text); }
thead th.num, td.num { text-align: right; }
thead th .dir { color: var(--accent); font-size: 10px; }
tbody td { padding: 9px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: baseline; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: color-mix(in srgb, var(--accent-soft) 40%, transparent); }
.mname { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.mid { font-family: var(--mono); font-size: 11.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.badge {
  display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px;
  border-radius: 99px; letter-spacing: 0.02em;
}
.badge.open   { color: var(--open);   background: var(--open-bg); }
.badge.closed { color: var(--closed); background: var(--closed-bg); }
.tier { white-space: nowrap; font-size: 13.5px; }
.tier.t0 { color: var(--faint); }
td.num { font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.local { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
.runs  { color: var(--open); font-weight: 600; }
.nofit { color: var(--bad); }
.dim   { color: var(--faint); }

.state { padding: 64px 20px; text-align: center; color: var(--muted); }
.state .big { font-size: 16px; color: var(--text); margin-bottom: 6px; font-weight: 550; }
.retry {
  margin-top: 14px; padding: 9px 18px; font-size: 14px; font-weight: 600;
  color: #fff; background: var(--accent); border: none; border-radius: 8px; cursor: pointer;
}
.retry:hover { filter: brightness(1.06); }
@keyframes pulse { 50% { opacity: 0.45; } }
.loading { animation: pulse 1.2s ease-in-out infinite; }

.foot { margin-top: 14px; color: var(--muted); font-size: 12.5px; line-height: 1.6; }

/* ——— best-local page ——— */
.hero {
  margin: 4px 0 22px; padding: 20px 22px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--surface);
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px;
}
.hero .lead { font-size: 14px; color: var(--muted); }
.hero .verdict { font-size: 21px; font-weight: 650; letter-spacing: -0.01em; }
.hero .verdict em { font-style: normal; color: var(--accent); }
.hero .usable { font-size: 12.5px; color: var(--faint); font-family: var(--mono); }
.tiercard {
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  margin-bottom: 18px; overflow: hidden;
}
.tiercard.locked { opacity: 0.92; }
.tierhead {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px;
  padding: 14px 18px; border-bottom: 1px solid var(--border-soft);
}
.tierhead h2 { font-size: 17px; font-weight: 650; margin: 0; letter-spacing: -0.01em; }
.tierhead .gate { font-size: 12.5px; color: var(--muted); font-family: var(--mono); }
.tierhead .pill {
  font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 99px; margin-left: auto;
}
.pill.yes { color: var(--open); background: var(--open-bg); }
.pill.no  { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.tiercard table { min-width: 640px; }
.tiercard thead th { cursor: default; }
.tiercard .cloudline {
  padding: 9px 18px; font-size: 12.5px; color: var(--muted);
  border-top: 1px solid var(--border-soft);
}
.tiercard .cloudline .mono { font-family: var(--mono); }
.tiercard .none { padding: 16px 18px; color: var(--faint); font-size: 13.5px; }

@media (max-width: 640px) {
  .wrap { padding: 24px 12px 48px; }
  .count { flex-basis: 100%; margin-left: 0; }
  .topbar { flex-direction: column; }
  .navlink { margin-top: 0; }
}
