:root {
  --bg: #0b0b0b;
  --ink: #f3efe6;
  --muted: rgba(243, 239, 230, 0.55);
  --faint: rgba(243, 239, 230, 0.12);
  --line: rgba(243, 239, 230, 0.14);
  --accent: #c9b896;
  --accent-2: #8ea4c8;
  --good: #9bb89a;
  --paper: #f2eee4;
  --menu: #141414;
  --mono: "IBM Plex Mono", "SF Mono", ui-monospace, monospace;
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  letter-spacing: 0;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.view-home { min-height: 100vh; }

.top {
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 11, 11, 0.92);
  backdrop-filter: blur(10px);
}
.top__inner {
  max-width: 78rem;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.top__brand { display: flex; align-items: center; gap: 0.75rem; }
.top__mark {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
}
.top__rule { width: 2.5rem; height: 1px; background: var(--line); }
.top__tag { color: var(--muted); font-size: 0.78rem; }
.top__nav { display: flex; gap: 1.1rem; font-size: 0.82rem; }
.top__nav a { color: var(--muted); text-decoration: none; }
.top__nav a:hover { color: var(--ink); }

.catalog {
  max-width: 78rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 1rem;
}
.catalog__head h1 {
  margin: 0 0 0.5rem;
  font-size: 1.7rem;
  font-weight: 400;
  line-height: 1.2;
}
.lede {
  margin: 0 0 1.1rem;
  color: var(--muted);
  max-width: 40rem;
  line-height: 1.5;
}

.filters { display: flex; flex-direction: column; gap: 0.65rem; margin-bottom: 1.75rem; }
.filter-row { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.filter-row__k {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  min-width: 5.5rem;
}
.chip {
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
}
.chip:hover { color: var(--ink); border-color: rgba(243, 239, 230, 0.35); }
.chip.is-active {
  color: var(--ink);
  border-color: var(--chip-color, var(--ink));
  color: var(--chip-color, var(--ink));
  background: rgba(243, 239, 230, 0.06);
}

.board { display: flex; flex-direction: column; gap: 1.75rem; }
.model-block { min-width: 0; }
.model-block__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.4rem;
}
.model-block__head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
}
.model-block__meta { color: var(--muted); font-size: 0.78rem; font-family: var(--mono); }
.tile-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 0.55rem;
}
.tile {
  display: grid;
  gap: 0.2rem;
  text-align: left;
  padding: 0.75rem 0.8rem;
  border: 1px solid var(--line);
  min-height: 6.4rem;
  text-decoration: none;
  color: inherit;
  background: transparent;
}
.tile:hover { border-color: rgba(243, 239, 230, 0.4); }
.tile__harness { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.tile__preset { font-size: 1rem; }
.tile__stat { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }
.tile.is-miss { opacity: 0.45; }

.block { max-width: 78rem; margin: 0 auto; padding: 2rem 1.25rem 3rem; }
.block--flush { padding-bottom: 4rem; }
.block__head h2 { margin: 0 0 0.35rem; font-size: 1.05rem; font-weight: 500; }
.block__head p { margin: 0; color: var(--muted); }
.block__head--row {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 0.9rem;
}
.sort-hint { color: var(--muted); font-size: 0.75rem; }

.table-shell { overflow-x: auto; }
.matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.matrix th, .matrix td {
  text-align: left;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.matrix th {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}
.matrix th.sortable { cursor: pointer; }
.matrix tbody tr { cursor: pointer; }
.matrix tbody tr:hover { background: rgba(243, 239, 230, 0.04); }
.mono { font-family: var(--mono); font-size: 0.8rem; }
.muted { color: var(--muted); }
.badge {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--good);
}
.badge--miss { color: var(--muted); }
.row-open { color: var(--muted); font-size: 0.78rem; }

.foot {
  max-width: 78rem;
  margin: 0 auto;
  padding: 1rem 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.view-detail {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100vh;
  height: 100dvh;
  max-width: 100%;
  min-width: 0;
}
.view-detail[hidden] { display: none !important; }

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem 1rem;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--line);
  background: #0d0d0d;
  width: 100%;
  max-width: 100%;
}
.bar__left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.9rem;
  min-width: 0;
  flex: 1 1 18rem;
}
.home-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  white-space: nowrap;
}
.home-link:hover { color: var(--ink); }
.brand { display: flex; flex-direction: column; gap: 0.05rem; min-width: 0; }
.mark {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
}
.sub {
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 18rem;
}
.bar__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.85rem;
  min-width: 0;
  flex: 1 1 12rem;
}
.stat { display: inline-flex; align-items: baseline; gap: 0.28rem; font-size: 0.78rem; }
.stat__k {
  color: var(--muted);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.stat__v { font-family: var(--mono); font-size: 0.74rem; }
.metric-note { color: var(--muted); font-size: 0.68rem; }

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.5rem 0.65rem;
  flex: 1 1 12rem;
  min-width: 0;
  max-width: 100%;
}
.menu {
  position: relative;
  min-width: 0;
  flex: 1 1 8rem;
}
.menu__lab {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.menu__btn {
  width: 100%;
  text-align: left;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--line);
  background: #121212;
  color: var(--ink);
  font-size: 0.84rem;
}
.menu__btn:hover, .menu__btn:focus { border-color: var(--accent); outline: none; }
.menu__list {
  position: absolute;
  z-index: 40;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background: var(--menu);
  border: 1px solid var(--line);
  max-height: 16rem;
  overflow: auto;
  padding: 0.2rem 0;
}
.menu__list[hidden] { display: none; }
.menu__opt {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.4rem 0.55rem;
  color: var(--ink);
  background: transparent;
  font-size: 0.84rem;
}
.menu__opt:hover, .menu__opt.is-active { background: rgba(243, 239, 230, 0.08); }
.ghost {
  align-self: end;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  padding: 0.35rem 0.1rem;
}
.ghost:hover { color: var(--ink); }
.ghost[aria-disabled="true"] { opacity: 0.35; pointer-events: none; }

.stage { position: relative; min-height: 0; background: #050505; min-width: 0; }
.stage iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  border: 0;
  background: var(--paper);
}
.stage iframe.is-hidden { visibility: hidden; position: absolute; inset: 0; }
.empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 0.5rem;
  padding: 2rem;
  text-align: center;
}
.empty[hidden] { display: none; }
.empty-title { margin: 0; font-size: 1.2rem; }
.empty-body { margin: 0; color: var(--muted); }
.empty-path { color: var(--accent); font-size: 0.85rem; }

@media (max-width: 720px) {
  .top__nav { display: none; }
  .catalog__head h1 { font-size: 1.35rem; }
  .tile-row { grid-template-columns: 1fr 1fr; }
  .bar__stats { flex-basis: 100%; }
}
