:root {
  color-scheme: light;
  scrollbar-gutter: stable;
  --surround: #f1f1f1;
  --canvas: #fcfcfc;
  --paper: #fff;
  --ink: #202020;
  --muted: #696969;
  --line: #e0e0e0;
  --soft: #f4f4f4;
  --sky: lab(70.687 -23.6078 -45.9483);
  --shadow: 0 0 0 1px #0000000f, 0 1px 2px -1px #0000000f, 0 2px 4px #0000000a;
  --radius: 8px;
  --button-radius: 9999px;
  --control: 36px;
  --gutter: clamp(16px, 2.5vw, 32px);
  --gap: 14px;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 100%;
  line-height: 1.5;
  font-weight: 400;
  font-synthesis: none;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  min-height: 100svh;
}
button,
select,
input {
  font: inherit;
  color: inherit;
}
button,
select {
  cursor: pointer;
}
button {
  border: 0;
  border-radius: var(--button-radius);
  padding: 0;
  background: transparent;
}
a {
  color: inherit;
  text-decoration: none;
}
:where(a, button, select, input, summary):focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
.mast {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 18px var(--gutter) 10px;
}
.brand {
  justify-self: start;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.25;
  white-space: nowrap;
}
.switch {
  display: flex;
  gap: 2px;
  padding: 4px;
  background: var(--soft);
  border-radius: var(--button-radius);
  box-shadow: inset 0 0 0 1px #00000008;
}
.switch a {
  display: grid;
  white-space: nowrap;
  place-items: center;
  min-height: 30px;
  padding-inline: 16px;
  border-radius: var(--button-radius);
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25;
  touch-action: manipulation;
  user-select: none;
}
@media (hover: hover) and (pointer: fine) {
  .switch a:hover {
    color: var(--ink);
  }
  #open-search:hover {
    background-color: var(--line);
  }
  .search button:hover {
    background: var(--soft);
  }
}
.switch [aria-current="page"] {
  color: var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow);
}
.search input,
.options button,
.more,
.chip {
  border: 0;
  background: var(--paper);
  box-shadow: var(--shadow);
}
#open-search,
.search {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}
#open-search {
  display: grid;
  place-items: center;
  width: var(--control);
  height: var(--control);
  padding: calc((var(--control) - 34px) / 2);
  background: var(--surround) content-box;
}
#open-search,
.search button {
  touch-action: manipulation;
}
#open-search:active,
.search button:active,
.switch a:active {
  background-color: var(--line);
  color: var(--ink);
}
.search {
  display: flex;
  align-items: center;
  gap: 4px;
  width: min(100%, 270px);
}
.search input {
  flex: 1;
  min-width: 0;
  height: var(--control);
  padding-inline: 12px;
  border-radius: var(--radius);
  font-size: 0.875rem;
}
.search input::placeholder {
  color: var(--muted);
  opacity: 1;
}
.search button {
  min-height: var(--control);
  padding-inline: 10px;
  font-size: 0.875rem;
  font-weight: 500;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-inline: var(--gutter);
  min-height: 52px;
}
.media-tabs,
.options {
  display: flex;
  align-items: center;
}
.media-tabs {
  align-self: stretch;
  gap: 20px;
}
.media-tabs a {
  align-self: stretch;
  display: flex;
  align-items: center;
  position: relative;
  color: var(--muted);
  font-size: 0.875rem;
}
.media-tabs [aria-current="true"],
.media-tabs a:hover {
  color: var(--ink);
}
.media-tabs [aria-current="true"] {
  font-weight: 500;
}
.media-tabs [aria-current="true"]::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: var(--ink);
}
.options {
  gap: 8px;
}
.options button {
  display: grid;
  place-items: center;
  width: var(--control);
  height: var(--control);
  font-size: 0.875rem;
  line-height: 1.25;
}
.options button[aria-pressed="true"] {
  background: var(--soft);
  box-shadow: inset 0 0 0 1px #c5c5c5;
}
.grid-icon {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  width: 14px;
  height: 14px;
  gap: 2px;
}
.grid-icon i {
  border: 1px solid currentColor;
  border-radius: 1.25px;
}
.sort-control {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--control);
  height: var(--control);
  border-radius: var(--button-radius);
  color: var(--muted);
}
.sort-control select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  font-size: 1rem;
  touch-action: manipulation;
}
.sort-control:has(select:focus-visible) {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
.sort-control svg {
  pointer-events: none;
}
@media (hover: hover) and (pointer: fine) {
  .sort-control:hover {
    color: var(--ink);
  }
}
.sort-control:active {
  color: var(--ink);
}
.options button:hover,
.more:hover,
.chip:hover {
  background: var(--soft);
}
main {
  padding-bottom: 28px;
}
.section-head,
.section-body,
#shelf,
#content,
#message {
  margin-inline: var(--gutter);
}
#shelf {
  --shelf-row: 66px;
  --shelf-top: 20px;
  --shelf-bottom: 0px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--gap);
  padding-block: var(--shelf-top) var(--shelf-bottom);
}
#shelf[aria-busy="true"]:empty {
  min-height: calc(var(--shelf-top) + var(--shelf-row) + var(--shelf-bottom));
}
.group-placeholder,
.directory-shortcut {
  min-height: var(--shelf-row);
}
.group-placeholder::before,
.group-placeholder::after {
  content: "";
  background: var(--soft);
  border-radius: 4px;
}
.group-placeholder::before {
  width: 38px;
  height: 36px;
  transform: rotate(-6deg);
}
.group-placeholder::after {
  width: 52px;
  height: 10px;
}
.directory-shortcut {
  font-size: .875rem;
}
.group-card,
.panel {
  background: var(--paper);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.group-card {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
  padding: 12px 14px;
}
.group-card > span {
  min-width: 0;
}
.group-card strong {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.35;
}
.stack {
  position: relative;
  width: 48px;
  height: 42px;
  flex: none;
}
.stack img {
  position: absolute;
  top: 3px;
  left: 7px;
  width: 35px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--soft);
  box-shadow: var(--shadow);
  transform: translateX(2px) rotate(10deg);
}
.stack img:nth-child(2) {
  transform: rotate(2deg);
}
.stack img:last-child {
  transform: translateX(-4px) rotate(-8deg);
}
.stack:empty::before {
  content: "";
  display: block;
  width: 32px;
  height: 34px;
  margin: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
  transform: rotate(-6deg);
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding-block: 24px 12px;
}
.section-head > div {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  min-width: 0;
}
h1,
.section-head h2 {
  font-size: 1.125rem;
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: -0.025em;
  margin: 0;
  overflow-wrap: anywhere;
}
#reset,
.facet-count {
  color: var(--muted);
  font-size: 0.8125rem;
}
#title,
.facet-count {
  font-variant-numeric: tabular-nums;
}
#reset {
  white-space: nowrap;
}
#reset:hover {
  color: var(--ink);
  text-decoration: underline;
}
#content.wall {
  --cols: 4;
  --tile-width: calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols));
  position: relative;
  column-gap: var(--gap);
}
#content.wall.compact {
  --cols: 6;
}
#content.wall > .tile {
  position: absolute;
  inset-inline-start: calc(var(--column, 0) * (var(--tile-width) + var(--gap)));
  width: var(--tile-width);
}
.tile {
  padding: 3px;
  background: var(--canvas);
  border-radius: 11px;
  box-shadow: var(--shadow);
}
.tile,
.group-card {
  transition: box-shadow 150ms ease-out;
}
.tile:hover,
.group-card:hover {
  box-shadow:
    0 0 0 1px #0000001a,
    0 3px 8px #0000000d;
}
.open-card {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.frame {
  aspect-ratio: var(--ratio);
  position: relative;
  overflow: hidden;
  background: var(--soft);
}
.frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.preview-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 8px;
  color: var(--muted);
  font-size: .8125rem;
  text-align: center;
}
.media-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  border-radius: 5px;
  font-size: 0.6875rem;
  line-height: 1.5;
  padding: 1px 6px;
  color: #fff;
  background: #202020c9;
}
.excerpt {
  padding: 16px 14px 4px;
}
.byline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: .75rem;
}
.byline span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.byline > span:last-child {
  font-size: .8125rem;
  line-height: 1;
}
.excerpt p {
  margin: 0;
  font-size: clamp(1rem, 1.18vw, 1.25rem);
  line-height: 1.45;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
#message {
  padding-block: 20px;
  color: var(--muted);
}
#pagination {
  min-height: 1px;
}
#retry {
  margin: 0 var(--gutter);
}
.more {
  display: block;
  margin: 24px auto 0;
  padding: 8px 16px;
  font-size: 0.875rem;
}
.directory {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 215px), 1fr));
  gap: var(--gap);
}
#tags-heading {
  scroll-margin-block-start: var(--gutter);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
#connect {
  max-inline-size: 38rem;
}
.section-description,
.connect-command p,
.copy-status {
  margin: 0 0 var(--gap);
  color: var(--muted);
  font-size: .875rem;
}
.connect-server {
  padding: 12px 16px 16px;
  color: var(--paper);
  background: var(--ink);
}
.connect-server-top,
.connect-prompt {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--gap);
}
.connect-server-top {
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.connect-server h2 {
  margin: 0;
  font-size: .875rem;
  font-weight: 500;
}
#connect code {
  display: block;
  overflow-wrap: anywhere;
  font: .875rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.icon-definitions {
  position: absolute;
}
.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  gap: 6px;
  min-height: var(--control);
  min-width: var(--control);
  padding-inline: 10px;
  touch-action: manipulation;
  user-select: none;
  color: var(--ink);
  background: var(--paper);
  font-size: .875rem;
}
.copy-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.connect-server .copy-button:focus-visible {
  outline-color: var(--paper);
}
.copy-check,
[data-copied] .copy-glyph {
  display: none;
}
[data-copied] .copy-check {
  display: inline;
}
.connect-codex {
  margin-top: var(--gap);
}
.connect-codex summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--control);
  padding: 8px 14px;
  border-radius: inherit;
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  touch-action: manipulation;
  list-style: none;
}
.connect-codex summary::-webkit-details-marker {
  display: none;
}
.connect-codex summary::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-inline-end: 3px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.connect-codex[open] summary::after {
  transform: rotate(225deg);
}
.connect-command {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}
.connect-command code {
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--soft);
}
.connect-command .copy-button {
  margin-top: 8px;
  box-shadow: var(--shadow);
}
.connect-prompt {
  padding: 10px 8px 10px 14px;
  font-size: .9375rem;
}
.copy-status:not(.visually-hidden):not(:empty) {
  margin: 8px 0;
}
.connect-codex .copy-status {
  padding-inline: 14px;
}
@media (hover: hover) and (pointer: fine) {
  .copy-button:hover,
  .connect-codex summary:hover {
    background: var(--soft);
  }
}
.copy-button:active,
.connect-codex summary:active {
  background: var(--line);
}
.tag-directory,
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 0.8125rem;
  line-height: 1.4;
}
.chip i {
  color: var(--muted);
  font-style: normal;
}
@media (min-width: 1750px) {
  #content.wall {
    --cols: 5;
  }
  #content.wall.compact {
    --cols: 7;
  }
}
@media (max-width: 1100px) {
  #shelf {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  #shelf .group-card:nth-child(n + 5) {
    display: none;
  }
  #content.wall {
    --cols: 3;
  }
  #content.wall.compact {
    --cols: 4;
  }
}
@media (max-width: 740px), (pointer: coarse) and (max-width: 960px) and (max-height: 520px) {
  :root {
    --gap: 10px;
    --gutter: 16px;
    --control: 44px;
    --nav-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    --nav-clearance: calc(var(--nav-bottom) + var(--control) + 4px + var(--gutter));
    scroll-padding-bottom: var(--nav-clearance);
  }
  .library {
    padding-inline: env(safe-area-inset-left, 0px) env(safe-area-inset-right, 0px);
  }
  main {
    padding-bottom: var(--nav-clearance);
  }
  .mast {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: calc(8px + env(safe-area-inset-top, 0px)) var(--gutter) 4px;
  }
  .mast:has(.search:not([hidden])) .brand {
    display: none;
  }
  .switch {
    position: fixed;
    z-index: 2;
    left: calc(var(--gutter) + env(safe-area-inset-left, 0px));
    right: calc(var(--gutter) + env(safe-area-inset-right, 0px));
    bottom: var(--nav-bottom);
    width: max-content;
    max-width: calc(100% - 2 * var(--gutter) - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
    margin-inline: auto;
    padding: 2px 4px;
    background: #f6f6f6;
    box-shadow: inset 0 0 0 1px #0000000e, 0 2px 6px #0000000c, 0 6px 18px #00000012;
  }
  @supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .switch {
      background: rgb(252 252 252 / 72%);
      -webkit-backdrop-filter: blur(18px) saturate(1.25);
      backdrop-filter: blur(18px) saturate(1.25);
    }
  }
  .switch a {
    min-height: var(--control);
    padding-inline: clamp(10px, 3.6vw, 16px);
    border-block: 3px solid transparent;
    color: #424242;
    font-size: .8125rem;
    white-space: normal;
    text-align: center;
  }
  .switch [aria-current="page"] {
    background: var(--ink) padding-box;
    color: var(--paper);
    box-shadow: none;
  }
  #open-search {
    grid-column: 2;
  }
  .search {
    grid-column: 1 / -1;
    width: 100%;
    gap: 8px;
  }
  .search input {
    font-size: 1rem;
  }
  .toolbar {
    min-height: 48px;
    gap: 8px;
  }
  .media-tabs {
    gap: 14px;
  }
  .options button {
    display: none;
  }
  #shelf {
    --shelf-row: 62px;
    --shelf-top: 16px;
    --shelf-bottom: 3px;
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    margin-inline: 0;
    padding-inline: var(--gutter);
  }
  #shelf .group-card:nth-child(n) {
    display: flex;
  }
  #shelf .group-card {
    flex: 0 0 auto;
  }
  .group-card {
    padding: 10px 12px;
  }
  .stack {
    width: 40px;
  }
  .section-head {
    padding-block: 18px 10px;
  }
  #content.wall,
  #content.wall.compact {
    --cols: 2;
  }
  .byline {
    padding: 6px 8px;
  }
  .excerpt {
    padding: 12px 10px 4px;
  }
  .directory {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 145px), 1fr));
  }
}
@media (max-width: 360px) {
  :root {
    --gutter: 12px;
  }
  .media-tabs {
    gap: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
