/* ============================================================
   Indie Stack — design tokens
   Dark is the default. Light is opt-in via [data-theme="light"].
   ============================================================ */
:root {
  color-scheme: dark;

  --ink:      #07070a;
  --surface:  #0d0d12;
  --surface-2:#14141b;
  --surface-3:#1a1a23;
  --line:     #23232e;
  --line-2:   #35354a;

  --text:     #ededf2;
  --dim:      #8f8fa3;
  --dim-2:    #848498;

  --safe:     #6ee7a8;
  --notice:   #7cb8ff;
  --copy:     #ffb066;
  --verify:   #c9a2ff;
  --restrict: #ff7d75;

  --on-accent:  #04120b;
  --topbar:     rgba(7,7,10,.82);
  --scrim:      rgba(3,3,5,.70);
  --shadow:     rgba(0,0,0,.55);
  --vignette-a: rgba(124,184,255,.07);
  --vignette-b: rgba(110,231,168,.05);

  --radius:   14px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;

  --ink:      #f6f6f3;
  --surface:  #ffffff;
  --surface-2:#f1f1ed;
  --surface-3:#e8e8e2;
  --line:     #e3e3dc;
  --line-2:   #cbcbc2;

  --text:     #15151b;
  --dim:      #5f5f6b;
  --dim-2:    #666672;

  --safe:     #0a6b40;
  --notice:   #1a63c4;
  --copy:     #94500a;
  --verify:   #6f35c4;
  --restrict: #bd2f26;

  --on-accent:  #ffffff;
  --topbar:     rgba(246,246,243,.86);
  --scrim:      rgba(20,20,26,.32);
  --shadow:     rgba(24,24,34,.16);
  --vignette-a: rgba(26,99,196,.05);
  --vignette-b: rgba(11,125,75,.05);
}

* { box-sizing: border-box; }

/* author display rules beat the UA [hidden] rule — force it */
[hidden] { display: none !important; }

/* keyboard-only skip link */
.skip {
  position: fixed; left: 12px; top: 12px; z-index: 200;
  padding: 9px 14px; border-radius: 8px;
  background: var(--text); color: var(--ink);
  font-size: 14px; font-weight: 600; text-decoration: none;
  transform: translateY(-160%); transition: transform .15s;
}
code { font-family: var(--mono); font-size: 0.94em; }

.skip:focus { transform: translateY(0); outline: 2px solid var(--notice); outline-offset: 2px; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 80px;
}

/* faint vignette so the page doesn't read as flat */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 15% -10%, var(--vignette-a), transparent 70%),
    radial-gradient(700px 400px at 90% 0%, var(--vignette-b), transparent 70%);
  z-index: 0;
}

a { color: inherit; text-decoration: none; text-underline-offset: .18em; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--notice); outline-offset: 2px; }

/* Browser surfaces belong to the design system too. */
::selection { background: color-mix(in srgb, var(--notice) 30%, transparent); color: var(--text); }
body { caret-color: var(--safe); }
body, .modal { font-variant-numeric: tabular-nums; }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-2); border-radius: 999px;
  border: 2px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--dim-2); background-clip: content-box; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ============================================================
   Top bar
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--topbar);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar__inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 16px;
  flex-shrink: 0;
}
.brand__mark { width: 22px; height: 22px; color: var(--safe); }
.brand__thin { color: var(--dim); font-weight: 400; }

.tabs { display: flex; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 3px; }
.tab {
  border: 0; background: transparent; color: var(--dim);
  font-size: 14px; font-weight: 500; padding: 5px 12px;
  border-radius: 8px; cursor: pointer; transition: all .14s;
}
.tab:hover { color: var(--text); }
.tab.is-active { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 0 rgba(255,255,255,.04) inset; }

/* the checker lives on its own page, so it is a link, not a tab */
.tab--solo {
  display: inline-flex; align-items: center; flex-shrink: 0;
  border: 1px solid var(--line); background: transparent;
  color: var(--dim); text-decoration: none;
  transition: all .14s;
}
.tab--solo:hover { color: var(--text); border-color: var(--line-2); background: var(--surface-2); }

.search {
  flex: 1;
  max-width: 440px;
  margin-left: auto;
  position: relative;
  display: flex;
  align-items: center;
}
.search svg { position: absolute; left: 11px; width: 15px; height: 15px; color: var(--dim-2); pointer-events: none; }
.search input {
  width: 100%;
  height: 36px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  padding: 0 42px 0 34px;
  outline: none;
  transition: border-color .14s, background .14s;
}
.search input::placeholder { color: var(--dim-2); }
.search input:focus { border-color: var(--line-2); background: var(--surface-3); }
.search kbd {
  position: absolute; right: 9px;
  font-family: var(--mono); font-size: 12px; color: var(--dim-2);
  border: 1px solid var(--line); border-radius: 8px; padding: 1px 5px;
}

.themebtn {
  width: 36px; height: 36px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 8px; color: var(--dim); cursor: pointer;
  transition: all .14s;
}
.themebtn:hover { color: var(--text); border-color: var(--line-2); background: var(--surface-3); }
/* tool pages have no search field to absorb the free space */
.topbar__inner > .themebtn { margin-left: auto; }
.themebtn svg { width: 15px; height: 15px; }
.themebtn .i-sun { display: none; }
:root[data-theme="light"] .themebtn .i-sun { display: block; }
:root[data-theme="light"] .themebtn .i-moon { display: none; }

.stackbtn {
  display: flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 10px 0 11px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all .14s; flex-shrink: 0;
}
.stackbtn svg { width: 15px; height: 15px; color: var(--dim); }
.stackbtn:hover { border-color: var(--line-2); background: var(--surface-3); }
.stackbtn b {
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  min-width: 18px; height: 18px; padding: 0 4px; display: grid; place-items: center;
  background: var(--line); border-radius: 999px; color: var(--dim);
  transition: background .14s, color .14s;
}
/* an empty stack keeps the slot but drops the zero, so the button doesn't grow on first add */
.stackbtn:not(.has-items) b { visibility: hidden; }
.stackbtn.has-items b { background: var(--safe); color: var(--on-accent); }
.stackbtn.has-items svg { color: var(--safe); }


/* ============================================================
   Layout
   ============================================================ */
.shell {
  position: relative; z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 20px 0;
  display: grid;
  grid-template-columns: 218px 1fr;
  gap: 32px;
  align-items: start;
}
/* grid/flex children default to min-width:auto, which lets long
   chip rows blow the whole page wider than the viewport */
.shell > *,
.main, .toolbar, .grid, .filters, .filters__group { min-width: 0; }

/* ---- filters ---- */
.filters {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  /* 8px of gutter: row backgrounds stop at the rail edge, text still lines
     up with the section labels because .fopt pulls its own padding back */
  padding: 0 0 24px 8px;
}

/* the toggle only exists once the rail becomes a card (<=900px) */
.filters__toggle { display: none; }
.filters__body { display: contents; }

/* 48 category chips are taller than a laptop viewport: let the rail scroll
   on its own instead of running past the fold. */
@media (min-width: 901px) {
  .filters {
    max-height: calc(100vh - 108px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 8px;
    margin-right: -8px;
  }
  .filters::-webkit-scrollbar { width: 8px; }
  .filters::-webkit-scrollbar-thumb {
    background: var(--line-2); border-radius: 999px;
    border: 2px solid transparent; background-clip: content-box;
  }
  .filters::-webkit-scrollbar-thumb:hover { background: var(--dim-2); background-clip: content-box; }
}
.filters__group h3 {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim-2);
}
.filters__foot { margin-top: -8px; }

/* --tint is the chip's own colour: the licence family for safety rows,
   neutral text for categories, so "on" never reads as "slightly lighter" */
.fopt {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 5px 8px;
  margin: 0 -8px;
  border: 0; background: transparent;
  border-radius: 8px;
  color: var(--dim);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  --tint: var(--text);
  transition: background .12s, color .12s, box-shadow .12s;
}
.fopt:hover { background: var(--surface-2); color: var(--text); }
.fopt.is-on {
  color: var(--text);
  background: color-mix(in srgb, var(--tint) 9%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tint) 28%, transparent);
}
.fopt.is-on:hover { background: color-mix(in srgb, var(--tint) 13%, transparent); }
.fopt.is-on .fopt__n { color: color-mix(in srgb, var(--tint) 60%, var(--dim)); }
.fopt__dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: var(--tint); }
.fopt__label { flex: 1; }
.fopt__n { font-family: var(--mono); font-size: 12px; color: var(--dim-2); }

.switch { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--dim); cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track {
  width: 30px; height: 17px; border-radius: 999px;
  background: var(--line); position: relative; transition: background .16s; flex-shrink: 0;
}
.switch__thumb {
  position: absolute; top: 2px; left: 2px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--dim); transition: transform .16s, background .16s;
}
.switch input:checked + .switch__track { background: color-mix(in srgb, var(--safe) 28%, transparent); }
.switch input:checked + .switch__track .switch__thumb { transform: translateX(13px); background: var(--safe); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--notice); outline-offset: 2px; }
.switchlist { display: grid; gap: 9px; }

/* ---- toolbar ---- */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 14px; min-height: 30px; flex-wrap: wrap;
}
.toolbar__count { margin: 0; font-family: var(--mono); font-size: 12px; color: var(--dim-2); letter-spacing: .01em; }
.toolbar__right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sortlabel { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim-2); }
.select {
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--dim); font-family: var(--sans); font-size: 12px;
  border-radius: 8px; padding: 5px 8px; cursor: pointer; outline: none;
}
.select:hover { color: var(--text); border-color: var(--line-2); }

.iconbtn {
  display: flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 9px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 8px; color: var(--dim); font-size: 12px;
  cursor: pointer; transition: all .14s; white-space: nowrap;
}
.iconbtn:hover { color: var(--text); border-color: var(--line-2); background: var(--surface-3); }
.iconbtn svg { width: 13px; height: 13px; }

/* ---- layout switch: two states, one control ---- */
.seg {
  display: inline-flex; padding: 2px; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px;
}
.seg__b {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 8px; border: 0; border-radius: 6px;
  background: transparent; color: var(--dim-2);
  font: inherit; font-size: 12px; cursor: pointer;
  transition: color .14s, background .14s;
}
.seg__b svg { width: 12px; height: 12px; }
.seg__b:hover { color: var(--text); }
.seg__b.is-on {
  background: var(--surface-3); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-2);
}

/* ---- palette trigger ---- */
.palbtn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 8px 0 9px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 8px; color: var(--dim); font: inherit; font-size: 12px;
  cursor: pointer; transition: color .14s, border-color .14s, background .14s;
  white-space: nowrap;
}
.palbtn:hover { color: var(--text); border-color: var(--line-2); background: var(--surface-3); }
.palbtn svg { width: 13px; height: 13px; }
.palbtn__kbd {
  font-family: var(--mono); font-size: 10px; line-height: 1;
  padding: 3px 4px; border-radius: 4px;
  border: 1px solid var(--line-2); color: var(--dim-2);
}

/* ---- grid ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 11px;
}

.card {
  position: relative;
  display: flex; flex-direction: column; gap: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, background .15s, transform .15s;
  overflow: hidden;
}
.card:hover { border-color: var(--line-2); background: var(--surface-2); transform: translateY(-2px); }
.card.is-in { border-color: color-mix(in srgb, var(--safe) 45%, transparent); }
.card.is-in::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--safe) 6%, transparent), transparent 60%);
  pointer-events: none;
}

.card__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.card__cat {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: .09em; text-transform: uppercase; color: var(--dim-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  padding: 2.5px 7px; border-radius: 8px; white-space: nowrap; flex-shrink: 0;
  letter-spacing: .01em;
}
.pill__dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.pill--safe     { color: var(--safe);     background: color-mix(in srgb, var(--safe) 12%, transparent); }
.pill--notice   { color: var(--notice);   background: color-mix(in srgb, var(--notice) 12%, transparent); }
.pill--copy     { color: var(--copy);     background: color-mix(in srgb, var(--copy) 12%, transparent); }
.pill--verify   { color: var(--verify);   background: color-mix(in srgb, var(--verify) 12%, transparent); }
.pill--restrict { color: var(--restrict); background: color-mix(in srgb, var(--restrict) 12%, transparent); }

.card__name {
  font-size: 16px; font-weight: 600; letter-spacing: -0.012em;
  line-height: 1.25; margin: 0 0 2px;
  display: flex; align-items: center; gap: 6px;
}

/* The whole card is the hit area for this link; the add button sits above it. */
.card__open { color: inherit; text-decoration: none; }
.card__open::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  border-radius: var(--radius);
}
.card__open:focus-visible { outline: none; }
.card__open:focus-visible::before {
  outline: 2px solid var(--notice); outline-offset: -2px;
}
.card__owner { font-family: var(--mono); font-size: 12px; color: var(--dim-2); margin: 0 0 8px; }
.card__note {
  font-size: 12px; line-height: 1.45; color: var(--dim); margin: 0 0 12px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 34.5px;
}
.card__foot {
  margin-top: auto;
  display: flex; align-items: center; gap: 10px;
  padding-top: 10px; border-top: 1px solid var(--line);
}
.card__stars { font-family: var(--mono); font-size: 12px; color: var(--dim-2); display: flex; align-items: center; gap: 4px; }
.card__stars svg { width: 10px; height: 10px; }
.card__fresh {
  font-family: var(--mono); font-size: 12px; color: var(--dim-2);
  display: flex; align-items: center; gap: 4px; white-space: nowrap;
}
.card__fresh::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.card__fresh.is-stale { color: var(--copy); }
.card__flag {
  font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--restrict); border: 1px solid color-mix(in srgb, var(--restrict) 35%, transparent);
  padding: 1px 5px; border-radius: 8px;
}
.card__add {
  margin-left: auto; position: relative; z-index: 2;
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--line); background: transparent;
  color: var(--dim-2); display: grid; place-items: center;
  cursor: pointer; transition: all .14s; flex-shrink: 0;
}
.card__add svg { width: 14px; height: 14px; }
.card__add:hover { border-color: var(--line-2); color: var(--text); background: var(--surface-3); }
/* added is a state, not a size: the index row's button fills exactly like the
   card's so "in my stack" reads the same in both views */
.card.is-in .card__add,
.idx tbody tr.is-in .card__add { background: var(--safe); border-color: var(--safe); color: var(--on-accent); }
.card.is-in .card__add:hover,
.idx tbody tr.is-in .card__add:hover { background: color-mix(in srgb, var(--safe) 88%, #000); border-color: color-mix(in srgb, var(--safe) 88%, #000); }

/* ---- index: the same catalog as rows, for scanning and comparing ---- */
.index {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.index__scroll { position: relative; overflow-x: auto; border-radius: var(--radius); }

/* fixed layout so one long owner name can never widen the table past its
   column and push stars off screen; the name column takes the remainder */
.idx { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.idx__c-name  { width: auto; }
.idx__c-lic   { width: 160px; }
.idx__c-group { width: 140px; }
.idx__c-stars { width: 70px; }
.idx__c-fresh { width: 94px; }
.idx__c-add   { width: 46px; }
.idx th {
  text-align: left; font-weight: 500;
  padding: 9px 14px; border-bottom: 1px solid var(--line-2);
  font-family: var(--mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .09em; color: var(--dim-2); white-space: nowrap;
}
.idx__sort {
  border: 0; background: none; padding: 0; margin: 0;
  font: inherit; letter-spacing: inherit; text-transform: inherit;
  color: inherit; cursor: pointer;
}
.idx__sort::after { content: ""; display: inline-block; width: 0; }
.idx__sort:hover { color: var(--text); }
.idx th[aria-sort] .idx__sort { color: var(--text); }
.idx th[aria-sort="ascending"] .idx__sort::after { content: " ↑"; }
.idx th[aria-sort="descending"] .idx__sort::after { content: " ↓"; }

.idx td { padding: 6px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.idx tbody tr:last-child td { border-bottom: 0; }
.idx tbody tr { transition: background .12s; cursor: pointer; }
.idx tbody tr:hover { background: color-mix(in srgb, var(--text) 3.5%, transparent); }
.idx tbody tr.is-in { background: color-mix(in srgb, var(--safe) 5%, transparent); }

.idx__wrap { display: flex; align-items: baseline; gap: 9px; min-width: 0; }
.idx__open {
  display: block; min-width: 0;
  font-weight: 600; font-size: 13px; letter-spacing: -0.006em;
  color: var(--text); text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.idx__open:hover { text-decoration: underline; text-decoration-color: var(--line-2); }
/* owner rides on the same line: one row per tool is the whole point */
.idx__owner {
  min-width: 0; font-family: var(--mono); font-size: 11px;
  color: var(--dim-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.idx__flag {
  flex-shrink: 0;
  font-family: var(--mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--restrict);
  border: 1px solid color-mix(in srgb, var(--restrict) 32%, transparent);
  border-radius: 5px; padding: 1px 4px; line-height: 1.3;
}
.idx__group {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .07em; color: var(--dim); white-space: nowrap;
}
.idx__group::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--tint); flex-shrink: 0;
}
.idx__c-stars, .idx__c-fresh { text-align: right; }
.idx__c-lic .pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.idx td.idx__num {
  font-family: var(--mono); font-size: 12px; color: var(--dim);
  text-align: right; white-space: nowrap;
}
.idx td.idx__num.is-stale { color: var(--copy); }
.idx td.idx__num.is-muted { color: var(--dim-2); }
.idx td.idx__c-add { padding-right: 10px; }
.idx .card__add { width: 26px; height: 26px; border-radius: 7px; }
.idx .card__add svg { width: 12px; height: 12px; }

/* a "did you mean" that is a verb, not a label */
.ck-suggest {
  font: inherit; font-weight: 600; color: inherit;
  background: none; border: 0; padding: 0;
  border-bottom: 1px solid currentColor; cursor: pointer;
}
.ck-suggest:hover { opacity: .8; }

/* ---- empty ---- */
.empty { text-align: center; padding: 64px 20px; color: var(--dim-2); font-size: 14px; }
.empty p { margin: 0 0 10px; }
.empty__title {
  font-size: 20px; font-weight: 600; color: var(--text);
  letter-spacing: -0.02em; margin: 0 0 6px;
}
.empty__sub { color: var(--dim); max-width: 34ch; margin: 0 auto 18px; }
.empty__clear { padding: 9px 16px; font-size: 14px; }
.empty__hint { font-size: 12px; color: var(--dim-2); margin: 26px 0 10px; }
.empty__chips { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 18px; }
.empty__chip {
  border: 1px solid var(--line); background: var(--surface-2); color: var(--dim);
  font-family: var(--mono); font-size: 12px; padding: 5px 11px;
  border-radius: 999px; cursor: pointer;
}
.empty__chip:hover { color: var(--text); border-color: var(--line-2); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  /* anchors and buttons share this class; an inline anchor ignores width and
     vertical margin, which stacked the facts-rail buttons on top of each other */
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--text); font-size: 12px; font-weight: 500;
  padding: 7px 12px; border-radius: 8px; cursor: pointer;
  transition: all .14s;
}
.btn:hover { border-color: var(--line-2); background: var(--surface-3); }
.btn--ghost { background: transparent; }
.btn--danger:hover { border-color: color-mix(in srgb, var(--restrict) 40%, transparent); color: var(--restrict); }
.linkbtn {
  border: 0; background: none; color: var(--dim-2);
  font-size: 12px; cursor: pointer; padding: 0;
  text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: var(--line-2);
}
.linkbtn:hover { color: var(--text); }

/* ============================================================
   Modal
   ============================================================ */
.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: var(--scrim); backdrop-filter: blur(4px); }
.modal__card {
  position: relative;
  width: min(640px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  padding: 26px;
  box-shadow: 0 24px 70px var(--shadow);
  animation: pop .18s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } }
.modal__close {
  position: absolute; top: 14px; right: 14px;
  width: 28px; height: 28px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--dim); font-size: 12px; cursor: pointer;
  display: grid; place-items: center; transition: all .14s;
}
.modal__close:hover { color: var(--text); border-color: var(--line-2); }

.m-top { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.m-title { font-size: 24px; font-weight: 600; letter-spacing: -0.025em; margin: 0; }
.m-owner { font-family: var(--mono); font-size: 12px; color: var(--dim-2); margin: 4px 0 18px; }
.m-note { font-size: 14px; line-height: 1.62; color: var(--dim); margin: 0 0 20px; }

.m-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 18px; }
.m-cell { background: var(--surface); padding: 10px 12px; }
.m-cell dt { font-family: var(--mono); font-size: 12px; letter-spacing: .09em; text-transform: uppercase; color: var(--dim-2); margin-bottom: 3px; }
.m-cell dd { margin: 0; font-size: 14px; font-weight: 500; }

.m-ruling {
  border-radius: 8px; padding: 13px 14px; margin-bottom: 18px;
  border: 1px solid; font-size: 14px; line-height: 1.55;
}
.m-ruling strong { display: block; font-size: 12px; font-family: var(--mono); letter-spacing: .07em; text-transform: uppercase; margin-bottom: 4px; }
.m-ruling--safe     { background: color-mix(in srgb, var(--safe) 8%, transparent);     border-color: color-mix(in srgb, var(--safe) 26%, transparent);     color: color-mix(in srgb, var(--safe) 45%, var(--text)); }
.m-ruling--notice   { background: color-mix(in srgb, var(--notice) 8%, transparent);   border-color: color-mix(in srgb, var(--notice) 26%, transparent);   color: color-mix(in srgb, var(--notice) 45%, var(--text)); }
.m-ruling--copy     { background: color-mix(in srgb, var(--copy) 8%, transparent);     border-color: color-mix(in srgb, var(--copy) 26%, transparent);     color: color-mix(in srgb, var(--copy) 45%, var(--text)); }
.m-ruling--verify   { background: color-mix(in srgb, var(--verify) 8%, transparent);   border-color: color-mix(in srgb, var(--verify) 26%, transparent);   color: color-mix(in srgb, var(--verify) 45%, var(--text)); }
.m-ruling--restrict { background: color-mix(in srgb, var(--restrict) 8%, transparent); border-color: color-mix(in srgb, var(--restrict) 26%, transparent); color: color-mix(in srgb, var(--restrict) 45%, var(--text)); }

.m-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.btn--primary { background: var(--text); color: var(--ink); border-color: var(--text); font-weight: 600; }
.btn--primary:hover { background: color-mix(in srgb, var(--text) 90%, var(--ink)); border-color: transparent; }
.btn--in { background: color-mix(in srgb, var(--safe) 14%, transparent); border-color: color-mix(in srgb, var(--safe) 35%, transparent); color: var(--safe); }

/* ============================================================
   Command palette — keyboard-first jump
   ============================================================ */
.palette { position: fixed; inset: 0; z-index: 80; display: grid; place-items: start center; padding: 12vh 20px 20px; }
.palette__scrim { position: absolute; inset: 0; background: var(--scrim); backdrop-filter: blur(5px); }
.palette__card {
  position: relative;
  width: min(600px, 100%);
  max-height: min(72vh, 600px);
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  box-shadow: 0 32px 90px var(--shadow);
  overflow: hidden;
  animation: palin .16s cubic-bezier(.2,.7,.3,1);
}
@keyframes palin { from { opacity: 0; transform: translateY(-6px) scale(.995); } }

.palette__field {
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px; height: 52px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.palette__field svg { width: 15px; height: 15px; color: var(--dim-2); flex-shrink: 0; }
.palette__field input {
  flex: 1; min-width: 0; height: 100%;
  border: 0; background: none; outline: none;
  color: var(--text); font: inherit; font-size: 15px;
}
.palette__field input::placeholder { color: var(--dim-2); }
.palette__field kbd {
  font-family: var(--mono); font-size: 10px; color: var(--dim-2);
  border: 1px solid var(--line-2); border-radius: 4px; padding: 3px 5px;
}

.palette__list { overflow-y: auto; padding: 6px; flex: 1; }
.palette__group {
  font-family: var(--mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: .1em; color: var(--dim-2);
  padding: 10px 10px 5px;
}
.palette__opt {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 10px; border: 0; border-radius: 8px;
  background: none; color: var(--dim); font: inherit; text-align: left;
  cursor: pointer;
}
.palette__opt[aria-selected="true"] { background: var(--surface-3); color: var(--text); }
.palette__opt[aria-selected="true"] .palette__hint { color: var(--dim); }
.palette__glyph {
  width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--dim-2);
}
.palette__glyph svg { width: 12px; height: 12px; }
.palette__opt[aria-selected="true"] .palette__glyph { border-color: var(--line-2); color: var(--text); }
.palette__label { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette__label mark { background: none; color: var(--safe); font-weight: 600; }
.palette__hint {
  margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--dim-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46%;
}
.palette__none { padding: 26px 14px 30px; text-align: center; color: var(--dim-2); font-size: 13px; }
.palette__none b { color: var(--text); font-weight: 600; }

.palette__foot {
  display: flex; align-items: center; gap: 14px; flex-shrink: 0;
  padding: 9px 14px; border-top: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 11px; color: var(--dim-2);
}
.palette__foot kbd {
  font-family: var(--mono); font-size: 10px;
  border: 1px solid var(--line-2); border-radius: 3px;
  padding: 1px 3px; margin-right: 3px;
}
.palette__count { margin-left: auto; font-family: var(--mono); }

/* ============================================================
   Active filters — dismissible chips for whatever is on
   ============================================================ */
.afilters {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 0 14px;
}
.afilters__label {
  font-family: var(--mono); font-size: 12px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--dim-2);
}
.afilters__chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.afchip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px 4px 9px; max-width: 100%;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; color: var(--dim); font-size: 12px;
  cursor: pointer; transition: background .12s, border-color .12s, color .12s;
}
.afchip:hover { background: var(--surface-3); border-color: var(--line-2); color: var(--text); }
.afchip__dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.afchip__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 22ch; }
.afchip__x { color: var(--dim-2); }
.afchip:hover .afchip__x { color: var(--restrict); }
.afilters__clear { margin-left: 2px; }

/* ============================================================
   Stack drawer
   ============================================================ */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 50; }
.scrim[hidden] { display: none; }

.panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 60;
  width: min(400px, 100%);
  background: var(--surface);
  border-left: 1px solid var(--line-2);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform .22s cubic-bezier(.4,0,.2,1), visibility .22s;
  box-shadow: -20px 0 60px var(--shadow);
}
.panel.is-open { transform: translateX(0); visibility: visible; }

.panel__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 20px 20px 14px; border-bottom: 1px solid var(--line);
}
.panel__eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--dim-2); margin: 0 0 3px;
}
.panel__title { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin: 0; }
.panel__close {
  width: 28px; height: 28px; flex-shrink: 0; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--dim); font-size: 12px; cursor: pointer;
  display: grid; place-items: center; transition: all .14s;
}
.panel__close:hover { color: var(--text); border-color: var(--line-2); }
.panel__close:focus-visible, .modal__close:focus-visible, .pitem__x:focus-visible,
.afchip:focus-visible, .stackbtn:focus-visible {
  outline: 2px solid var(--notice); outline-offset: 2px;
}
.panel__verdict { padding: 14px 20px; border-bottom: 1px solid var(--line); }
.panel__verdict[hidden] { display: none; }
.panel__list { flex: 1; overflow-y: auto; padding: 8px 12px; }
.panel__empty {
  margin: 0; padding: 22px 8px; font-size: 14px; line-height: 1.6; color: var(--dim);
}
.panel__empty b { color: var(--text); font-weight: 600; }

.recipes { display: grid; gap: 8px; padding: 0 8px 16px; }
.recipe {
  display: block; width: 100%; text-align: left; cursor: pointer;
  padding: 11px 12px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); font: inherit;
  transition: border-color .14s, background .14s;
}
.recipe:hover { border-color: var(--line-2); background: var(--surface-3); }
.recipe__top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.recipe__name { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.recipe__n { font-family: var(--mono); font-size: 12px; color: var(--dim-2); white-space: nowrap; }
.recipe__note { display: block; font-size: 12px; line-height: 1.5; color: var(--dim); margin-top: 2px; }
.recipe__verdict {
  display: inline-block; margin-top: 7px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .07em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px; border: 1px solid;
}
.recipe__verdict--ok   { color: var(--safe);     border-color: color-mix(in srgb, var(--safe) 35%, transparent);     background: color-mix(in srgb, var(--safe) 9%, transparent); }
.recipe__verdict--warn { color: var(--copy);     border-color: color-mix(in srgb, var(--copy) 35%, transparent);     background: color-mix(in srgb, var(--copy) 9%, transparent); }
.recipe__verdict--stop { color: var(--restrict); border-color: color-mix(in srgb, var(--restrict) 35%, transparent); background: color-mix(in srgb, var(--restrict) 9%, transparent); }
.recipe__verdict--idle { color: var(--dim-2); border-color: var(--line); background: var(--surface-3); }
.panel__foot {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  padding: 14px 20px 20px; border-top: 1px solid var(--line);
}
.panel__foot[hidden] { display: none; }
.panel__foot .btn { font-size: 12px; padding: 8px 6px; white-space: nowrap; }
/* Notices is the artifact people actually commit, so it gets the full row */
.panel__foot #copyNotices {
  grid-column: 1 / -1;
  background: var(--surface-2); border-color: var(--line-2);
  color: var(--text); font-weight: 500;
}
.panel__foot #copyNotices:hover { background: var(--surface-3); }

.pitem { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 8px; }
.pitem:hover { background: var(--surface-2); }
.pitem__dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.pitem__text { flex: 1; min-width: 0; }
.pitem__name {
  display: block; font-size: 14px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pitem__name:hover { text-decoration: underline; text-underline-offset: 2px; }
.pitem__lic {
  display: block; font-family: var(--mono); font-size: 12px; color: var(--dim-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pitem__x {
  border: 0; background: none; color: var(--dim-2); cursor: pointer;
  font-size: 12px; line-height: 1; padding: 6px; border-radius: 8px; flex-shrink: 0;
}
.pitem__x:hover { color: var(--restrict); background: var(--surface-3); }

.verdict { border-radius: 8px; padding: 11px 13px; border: 1px solid; }
.verdict__label { font-family: var(--mono); font-size: 12px; letter-spacing: .09em; text-transform: uppercase; margin-bottom: 4px; }
.verdict p { margin: 0; font-size: 12px; line-height: 1.55; }
.verdict--ok    { background: color-mix(in srgb, var(--safe) 8%, transparent);     border-color: color-mix(in srgb, var(--safe) 26%, transparent);     color: color-mix(in srgb, var(--safe) 42%, var(--text)); }
.verdict--ok    .verdict__label { color: var(--safe); }
.verdict--warn  { background: color-mix(in srgb, var(--copy) 8%, transparent);     border-color: color-mix(in srgb, var(--copy) 26%, transparent);     color: color-mix(in srgb, var(--copy) 42%, var(--text)); }
.verdict--warn  .verdict__label { color: var(--copy); }
.verdict--stop  { background: color-mix(in srgb, var(--restrict) 8%, transparent); border-color: color-mix(in srgb, var(--restrict) 26%, transparent); color: color-mix(in srgb, var(--restrict) 42%, var(--text)); }
.verdict--stop  .verdict__label { color: var(--restrict); }
.verdict--idle  { background: var(--surface-2); border-color: var(--line); color: var(--dim); }
.verdict--idle  .verdict__label { color: var(--dim-2); }

/* ============================================================
   Guide
   ============================================================ */
.guide {
  position: relative; z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}
.guide h1 { font-size: 30px; letter-spacing: -0.03em; line-height: 1.15; margin: 0 0 12px; font-weight: 600; }
.guide .lede { font-size: 16px; color: var(--dim); line-height: 1.6; margin: 0 0 36px; max-width: 60ch; }
.guide h2 {
  font-size: 12px; font-family: var(--mono); font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; color: var(--dim-2);
  margin: 40px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.guide h3 { font-size: 16px; font-weight: 600; margin: 24px 0 8px; letter-spacing: -0.01em; }
.guide p { font-size: 16px; line-height: 1.65; color: var(--dim); margin: 0 0 14px; max-width: 62ch; }
.guide code { font-family: var(--mono); font-size: 0.85em; background: var(--surface-2); padding: 1.5px 5px; border-radius: 8px; color: var(--text); }
.guide ul { margin: 0 0 14px; padding-left: 18px; }
.guide li { font-size: 16px; line-height: 1.65; color: var(--dim); margin-bottom: 8px; max-width: 60ch; }
.guide strong { color: var(--text); font-weight: 600; }

.gtable__wrap { overflow-x: auto; margin: 0 0 20px; }
.gtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.gtable th {
  text-align: left; font-family: var(--mono); font-size: 12px; letter-spacing: .09em;
  text-transform: uppercase; color: var(--dim-2); font-weight: 500;
  padding: 8px 10px; border-bottom: 1px solid var(--line-2);
}
.gtable td { padding: 9px 10px; border-bottom: 1px solid var(--line); color: var(--dim); vertical-align: top; }
.gtable tr:last-child td { border-bottom: 0; }
.gtable td:first-child { color: var(--text); font-weight: 500; white-space: nowrap; }
.gtable code { font-size: 12px; }

/* a rule-bounded note, not a box: the 2px side tab was decoration.
   Colour stays reserved for licence family, so emphasis is weight + rules. */
.callout {
  border: 0;
  border-top: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line);
  background: none; border-radius: 0;
  padding: 14px 0 15px; margin: 0 0 22px;
  font-size: 14px; line-height: 1.62; color: var(--dim);
}
.callout strong { color: var(--text); font-weight: 600; }

.models { display: grid; gap: 10px; margin-bottom: 20px; }
.model {
  display: grid; grid-template-columns: 26px 1fr; gap: 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 13px 15px;
}
.model__n { font-family: var(--mono); font-size: 12px; color: var(--dim-2); padding-top: 1px; }
.model h4 { margin: 0 0 3px; font-size: 14px; font-weight: 600; }
.model p { margin: 0; font-size: 14px; color: var(--dim); line-height: 1.5; }
.model__meta { font-family: var(--mono); font-size: 12px; color: var(--dim-2); margin-top: 5px; }

/* ============================================================
   Footer + toast
   ============================================================ */
.sitefoot {
  position: relative; z-index: 1;
  max-width: 1440px; margin: 0 auto;
  padding: 26px 20px 40px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 12px; color: var(--dim-2);
}
.sitefoot b { color: var(--dim); font-weight: 500; }
.sitefoot a { color: var(--dim); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 2px; }
.sitefoot a:hover { color: var(--text); text-decoration-color: currentColor; }

.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 90;
  transform: translate(-50%, 14px);
  background: var(--text); color: var(--ink);
  font-size: 14px; font-weight: 500;
  padding: 9px 15px; border-radius: 8px;
  box-shadow: 0 10px 30px var(--shadow);
  opacity: 0; pointer-events: none;
  transition: opacity .18s, transform .18s;
  max-width: calc(100vw - 32px); text-align: center;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; gap: 18px; padding-top: 16px; }
  /* the rail becomes a card whose header collapses it */
  .filters {
    position: static; display: block;
    padding: 0; background: var(--surface); border: 1px solid var(--line);
    border-radius: 14px;
  }
  .filters__toggle {
    display: flex; align-items: center; gap: 8px; width: 100%;
    padding: 13px 15px; border: 0; background: none; border-radius: 14px;
    color: var(--text); font: inherit; font-size: 14px; font-weight: 600;
    text-align: left; cursor: pointer;
  }
  .filters__toggle svg {
    width: 15px; height: 15px; margin-left: auto; color: var(--dim);
    transition: transform .18s, color .18s;
  }
  .filters__toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
  .filters__toggle-n {
    font-family: var(--mono); font-size: 12px; font-weight: 500;
    min-width: 19px; padding: 1px 6px; text-align: center;
    border-radius: 999px; background: var(--surface-3); color: var(--dim);
  }
  .filters__toggle.has-active .filters__toggle-n {
    background: color-mix(in srgb, var(--safe) 20%, transparent); color: var(--safe);
  }
  .filters__body {
    display: grid; gap: 18px; padding: 16px 15px 18px;
    border-top: 1px solid var(--line);
  }
  .filters__group { min-width: 0; }
  .filters__group h3 { margin-bottom: 8px; }
  .filters__foot { display: none; }

  /* both chip rows wrap — nothing hides behind a horizontal scroll */
  #safetyFilters, #catFilters { display: flex; flex-wrap: wrap; gap: 6px; }
  .fopt {
    margin: 0; padding: 6px 11px; white-space: nowrap;
    border: 1px solid var(--line); border-radius: 999px;
    background: var(--surface-2); flex: 0 0 auto; width: auto; font-size: 12px;
  }
  .fopt.is-on {
    border-color: color-mix(in srgb, var(--tint) 38%, transparent);
    background: color-mix(in srgb, var(--tint) 11%, transparent);
    box-shadow: none;
  }
  .fopt__n { display: none; }
  .catmore { margin-top: 9px; font-size: 12px; }

  .grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .search { max-width: none; }

  /* the dense index keeps its name, licence, verdict and add button; the two
     numeric columns are the first thing to go when width runs out */
  .idx__c-stars, .idx__c-fresh, .idx td.idx__num { display: none; }
}

/* the tool name outranks its owner: below this width the owner would eat the
   name column, so it goes (it is still in the row tooltip and on the page) */
@media (max-width: 1200px) {
  .idx__owner { display: none; }
}
@media (max-width: 1100px) and (min-width: 901px) {
  .idx__c-fresh, .idx td.idx__c-fresh { display: none; }
}

@media (max-width: 640px) {
  .topbar__inner { height: auto; padding: 10px 14px; flex-wrap: wrap; gap: 10px; }
  /* the wordmark would force a third row once Checker is in the bar:
     keep the mark (still a labelled home link), drop the word */
  .brand__text { display: none; }
  .tab { padding: 5px 9px; font-size: 12px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  /* on the catalogue the stack button takes the free space; on tool pages,
     where there is no stack button, the theme toggle holds the right edge */
  .stackbtn + .themebtn { margin-left: 0; }
  .stackbtn { margin-left: auto; }
  .themebtn { width: 36px; height: 36px; }
  .stackbtn {
    position: relative; width: 36px; height: 36px; padding: 0; justify-content: center;
  }
  .stackbtn span { display: none; }
  .stackbtn b {
    position: absolute; top: -5px; right: -5px;
    min-width: 15px; height: 15px; font-size: 12px; padding: 0 3px;
  }
  .shell { padding: 16px 16px 0; }
  .modal__card { padding: 20px; border-radius: 14px; }
  .m-grid { grid-template-columns: 1fr; }
  .guide h1 { font-size: 24px; }
  .iconbtn span { display: none; }
  .iconbtn { width: 32px; padding: 0; justify-content: center; }

  /* compact toolbar: icons carry the meaning, labels would force a third row */
  .seg__b span, .palbtn__label, .palbtn__kbd { display: none; }
  .seg__b { padding: 0 7px; }
  .palbtn { width: 32px; padding: 0; justify-content: center; }
  .sortlabel { display: none; }
  .idx th, .idx td { padding: 7px 10px; }
  /* phones: the pill already carries the safety colour, so the verdict column
     goes and the name keeps a usable width */
  .idx__c-group { display: none; }
  .idx__c-lic { width: 120px; }
  .idx__open { white-space: normal; overflow: visible; line-height: 1.3; }
  .idx__wrap { align-items: center; gap: 6px; }
  .idx td { padding-top: 9px; padding-bottom: 9px; }
  .idx td.idx__c-add { padding-right: 8px; }

  .palette { padding: 8vh 10px 10px; }
  .palette__card { max-height: 78vh; }
  .palette__hint { display: none; }
}

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

/* ---- safety mix bar (sidebar summary) ---- */
.mixbar {
  display: flex; height: 6px; margin: 12px 0 8px;
  border-radius: 999px; overflow: hidden; background: var(--surface-3);
}
.mixbar__seg { height: 100%; transition: flex-grow .2s; }
.mixbar__cap {
  font-family: var(--mono); font-size: 12px; color: var(--dim-2);
  margin: 0 0 4px; display: flex; justify-content: space-between; gap: 8px;
}
.mixbar__cap b { color: var(--dim); font-weight: 600; }

@media (pointer: coarse) {
  .card__add { width: 40px; height: 40px; }
  .card__add svg { width: 16px; height: 16px; }
}

@media (pointer: coarse) {
  .pitem__x { padding: 9px; }
  .afchip { padding: 7px 10px; }
}
