/* Tokens are Coder's dark theme values (site/src/index.css), so the panel
   sits next to a Coder deployment without looking like a different product.
   Fonts name Geist first and fall back to the system stack: the machines
   this runs on are often offline, and a webfont request that hangs would
   delay first paint for no benefit. */
:root {
  --surface-primary: hsl(240 10% 4%);
  --surface-secondary: hsl(240 6% 10%);
  --surface-tertiary: hsl(240 4% 16%);
  --surface-quaternary: hsl(240 5% 26%);
  --content-primary: hsl(0 0% 100%);
  --content-secondary: hsl(240 5% 65%);
  --content-disabled: hsl(240 5% 40%);
  --content-link: hsl(213 94% 68%);
  --content-success: hsl(142 71% 45%);
  --content-warning: hsl(31 97% 72%);
  --content-destructive: hsl(0 91% 71%);
  --border-default: hsl(240 4% 16%);
  --border-secondary: hsl(240 5% 26%);
  --radius: 0.5rem;

  --font-sans: "Geist", "Geist Variable", system-ui, -apple-system, sans-serif;
  --font-mono:
    "Geist Mono", "Geist Mono Variable", ui-monospace, "SF Mono",
    "Cascadia Mono", Menlo, monospace;

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--surface-primary);
  color: var(--content-primary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- chrome ---------- */

.bar {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.875rem 1.5rem;
  border-bottom: 1px solid var(--border-default);
  background: var(--surface-primary);
  position: sticky;
  top: 0;
  z-index: 10;
}

.wordmark {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.bar-host {
  color: var(--content-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.bar-build {
  margin-left: auto;
  color: var(--content-disabled);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
}

/* Author styles beat the UA stylesheet, so any rule setting `display` on an
   element silently defeats the `hidden` attribute on it. That happened here:
   `main { display: flex }` left a hidden panel fully visible. Restating it
   once, with enough force to win, means `hidden` can be trusted everywhere. */
[hidden] {
  display: none !important;
}

main {
  max-width: 64rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

/* Two columns need more room than one, and only this page has two. */
main.discover {
  max-width: 76rem;
  gap: 1.5rem;
}

/* ---------- the hero ---------- */

.phase {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--content-secondary);
}

/* One dot, colour-coded, so the state reads before any text does. */
.phase::before {
  content: "";
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.5rem;
  border-radius: 50%;
  background: currentColor;
  vertical-align: baseline;
}

.phase[data-state="serving"] {
  color: var(--content-success);
}
.phase[data-state="loading"] {
  color: var(--content-link);
}
.phase[data-state="failing"] {
  color: var(--content-destructive);
}
.phase[data-state="stopped"],
.phase[data-state="idle"] {
  color: var(--content-secondary);
}

/* A load takes minutes. The pulse is the only thing on the page that says
   "still working" without needing to be read. */
.phase[data-state="loading"]::before {
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
}

.model {
  margin: 0.5rem 0 0;
  font-family: var(--font-mono);
  font-size: clamp(1.25rem, 3.5vw, 1.875rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.profile-line,
.detail {
  margin: 0.5rem 0 0;
  color: var(--content-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

/* ---------- the memory rail ---------- */
/* The machine's whole memory pool, drawn to scale. This is the constraint
   the tool exists to manage: one model at a time because one model is what
   fits. During a load you can watch it fill. */

.rail {
  margin-top: 1.5rem;
}

.rail-track {
  position: relative;
  height: 2.5rem;
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius);
  background: var(--surface-secondary);
  overflow: hidden;
}

.rail-used {
  height: 100%;
  width: 0;
  background: linear-gradient(
    90deg,
    hsl(213 94% 68% / 0.35),
    hsl(213 94% 68% / 0.6)
  );
  border-right: 2px solid var(--content-link);
  transition: width 600ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* The budget is a limit, not a quantity, so it is a line rather than a
   fill: crossing it is what matters. */
.rail-budget {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px dashed var(--content-warning);
  padding-left: 0.375rem;
  display: flex;
  align-items: center;
  pointer-events: none;
}

.rail-budget span {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--content-warning);
}

.rail-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
  margin: 0.75rem 0 0;
}

.rail-legend div {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.rail-legend dt {
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--content-disabled);
}

.rail-legend dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

/* ---------- notices ---------- */

.failure,
.notice {
  margin-top: 1rem;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--border-default);
  border-left: 2px solid var(--content-warning);
  border-radius: var(--radius);
  background: var(--surface-secondary);
  color: var(--content-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.failure {
  border-left-color: var(--content-destructive);
  color: var(--content-destructive);
}

.notice-error {
  border-left-color: var(--content-destructive);
  color: var(--content-destructive);
}

/* A record of decisions, not a problem. Blue rather than amber or red, and
   set in the body face: these are sentences to read once, where the rest of
   the notices are terse machine facts. */
.notice-note {
  position: relative;
  border-left-color: var(--content-link);
  font-family: var(--font-sans);
  padding-right: 2.25rem;
  /* .notice sets pre-wrap for the machine text the other variants carry as a
     single text node. This one has child elements, so that would render the
     source's own indentation as blank lines. */
  white-space: normal;
}

.notice-title {
  margin: 0 0 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--content-primary);
}

.notice-list {
  margin: 0;
  padding-left: 1.125rem;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.notice-list li + li {
  margin-top: 0.375rem;
}

.notice-dismiss {
  position: absolute;
  top: 0.375rem;
  right: 0.5rem;
  appearance: none;
  border: none;
  background: none;
  color: var(--content-secondary);
  font-size: 1.125rem;
  line-height: 1;
  padding: 0.25rem 0.375rem;
  border-radius: var(--radius);
  cursor: pointer;
}

.notice-dismiss:hover {
  color: var(--content-primary);
  background: var(--surface-tertiary);
}

.notice-dismiss:focus-visible {
  outline: 2px solid var(--content-link);
  outline-offset: 1px;
}

/* ---------- buttons ---------- */

.now-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.btn {
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.4375rem 0.875rem;
  border: 1px solid var(--border-secondary);
  border-radius: calc(var(--radius) - 2px);
  background: var(--surface-tertiary);
  color: var(--content-primary);
  cursor: pointer;
  transition:
    background 120ms ease,
    border-color 120ms ease;
}

.btn:hover:not(:disabled) {
  background: var(--surface-quaternary);
  border-color: var(--content-disabled);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-quiet {
  background: transparent;
  color: var(--content-secondary);
}

.btn:focus-visible,
.log:focus-visible,
input:focus-visible {
  outline: 2px solid var(--content-link);
  outline-offset: 2px;
}

/* ---------- sections ---------- */

.section-title {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin: 0 0 0.875rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--content-secondary);
}

.count {
  color: var(--content-disabled);
  font-family: var(--font-mono);
  letter-spacing: 0;
}

.follow {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--content-disabled);
  cursor: pointer;
}

/* ---------- model list ---------- */

.models {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  overflow: hidden;
}

.models li {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1rem;
  background: var(--surface-secondary);
}

.models li + li {
  border-top: 1px solid var(--border-default);
}

.models li[data-active="true"] {
  background: var(--surface-tertiary);
}

.m-main {
  min-width: 0;
  flex: 1;
}

.m-name {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}

.m-meta {
  margin-top: 0.1875rem;
  color: var(--content-disabled);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
}

.tag {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--content-success);
}

/* ---------- log ---------- */

.log {
  margin: 0;
  padding: 1rem;
  height: 22rem;
  overflow: auto;
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  background: var(--surface-secondary);
  color: var(--content-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.empty {
  padding: 1.25rem 1rem;
  color: var(--content-disabled);
  font-size: 0.8125rem;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 34rem) {
  main {
    padding: 1.5rem 1rem 3rem;
  }

  .rail-legend {
    gap: 1.25rem;
  }
}

/* ---------- nav ---------- */

/* Links, not a control. These load new documents, so anything that looks like
   a switch promises a transition the browser will not make. */
.tabs {
  align-self: baseline;
  display: flex;
  gap: 1rem;
  margin-left: 0.75rem;
}

.tab {
  color: var(--content-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-decoration: none;
  white-space: nowrap;
  padding-bottom: 0.125rem;
  border-bottom: 1px solid transparent;
}

.tab:hover {
  color: var(--content-primary);
}

.tab[aria-current="page"] {
  color: var(--content-primary);
  border-bottom-color: var(--border-secondary);
}

.tab:focus-visible {
  outline: 2px solid var(--content-link);
  outline-offset: 2px;
}

.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;
}

/* ---------- discover ---------- */

.page-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.page-sub {
  margin: 0.375rem 0 0;
  color: var(--content-secondary);
  font-size: 0.8125rem;
}

.discover-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 22rem);
  gap: 2rem;
  align-items: start;
}

@media (max-width: 60rem) {
  .discover-cols {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- search ---------- */

.search {
  display: flex;
  gap: 0.5rem;
}

.search-input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius);
  background: var(--surface-secondary);
  color: var(--content-primary);
  font: inherit;
}

.search-input::placeholder {
  color: var(--content-disabled);
}

.search-input:focus-visible {
  outline: 2px solid var(--content-link);
  outline-offset: -1px;
  border-color: transparent;
}

.results-note {
  margin: 0.75rem 0 0;
  color: var(--content-secondary);
  font-size: 0.75rem;
}

.hits {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}

.hit {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 1rem;
  width: 100%;
  text-align: left;
  appearance: none;
  border: none;
  border-bottom: 1px solid var(--border-default);
  background: none;
  color: inherit;
  font: inherit;
  padding: 0.75rem 0.75rem;
  border-radius: var(--radius) var(--radius) 0 0;
  cursor: pointer;
}

.hit:hover {
  background: var(--surface-secondary);
}

/* The selected row stays marked while its detail is on screen, so the two
   columns visibly refer to each other. */
.hit[aria-current] {
  background: var(--surface-secondary);
  box-shadow: inset 2px 0 0 var(--content-link);
}

.hit:focus-visible {
  outline: 2px solid var(--content-link);
  outline-offset: -2px;
}

.hit-id {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hit-quant {
  grid-column: 2;
  grid-row: 1;
  color: var(--content-warning);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  white-space: nowrap;
}

.hit-meta {
  grid-column: 1;
  color: var(--content-secondary);
  font-size: 0.75rem;
}

/* ---------- detail ---------- */

/* Sticky so the verdict stays put while the results list scrolls past it. */
.col-detail {
  position: sticky;
  top: 5rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  background: var(--surface-secondary);
  padding: 1.25rem;
}

@media (max-width: 60rem) {
  .col-detail {
    position: static;
  }
}

.detail-empty {
  color: var(--content-secondary);
  font-size: 0.8125rem;
}

.detail-empty p {
  margin: 0;
}

.detail-empty-sub {
  margin-top: 0.5rem !important;
  color: var(--content-disabled);
  font-size: 0.75rem;
}

.detail-title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  word-break: break-all;
}

.detail-link {
  display: inline-block;
  margin-top: 0.25rem;
  color: var(--content-link);
  font-size: 0.75rem;
  text-decoration: none;
}

.detail-link:hover {
  text-decoration: underline;
}

.detail-loading {
  color: var(--content-secondary);
  font-size: 0.8125rem;
}

/* The verdict is why this column exists -- whether the machine can run the
   thing -- so it is stated in words and colour above the numbers behind it. */
.verdict {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 1rem 0;
  padding: 0.75rem 0.875rem;
  border-radius: var(--radius);
  border-left: 3px solid var(--content-secondary);
  background: var(--surface-primary);
  font-size: 0.8125rem;
}

.verdict strong {
  font-size: 0.9375rem;
}

.verdict span {
  color: var(--content-secondary);
}

/* A second line under the verdict, quieter than the reason above it: it
   qualifies the answer rather than giving it. */
.verdict-context {
  padding-top: 0.25rem;
  border-top: 1px solid var(--border-default);
  font-size: 0.8125rem;
}

.verdict[data-fit="yes"] {
  border-left-color: var(--content-success);
}

.verdict[data-fit="yes"] strong {
  color: var(--content-success);
}

.verdict[data-fit="no"] {
  border-left-color: var(--content-destructive);
}

.verdict[data-fit="no"] strong {
  color: var(--content-destructive);
}

.verdict[data-fit="unknown"] {
  border-left-color: var(--content-warning);
}

.verdict[data-fit="unknown"] strong {
  color: var(--content-warning);
}

.facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.375rem 1rem;
  margin: 0 0 1rem;
  font-size: 0.8125rem;
}

.facts dt {
  color: var(--content-secondary);
}

.facts dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  word-break: break-word;
}

.detail-actions {
  margin-top: 1rem;
}

.detail-note {
  margin: 0.5rem 0 0;
  color: var(--content-secondary);
  font-size: 0.75rem;
}

.notice-warn {
  border-color: var(--content-warning);
  color: var(--content-warning);
}

/* ---------- model row remove ---------- */

.m-remove {
  appearance: none;
  border: 1px solid transparent;
  background: none;
  color: var(--content-disabled);
  font: inherit;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  cursor: pointer;
}

.m-remove:hover:not(:disabled) {
  color: var(--content-destructive);
  border-color: var(--border-secondary);
}

.m-remove:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---------- quant list ---------- */

.quants {
  margin: 0 0 1rem;
}

.quants-title {
  margin: 0 0 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--content-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.quant-select {
  width: 100%;
  padding: 0.375rem 0.5rem;
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius);
  background: var(--surface-primary);
  color: var(--content-primary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.quant-select:focus-visible {
  outline: 2px solid var(--content-link);
  outline-offset: -1px;
}

.quant-select option:disabled {
  color: var(--content-disabled);
}

.quants-note {
  margin: 0.375rem 0 0;
  color: var(--content-disabled);
  font-size: 0.6875rem;
}

/* ---------- gguf offer ---------- */

.gguf {
  margin-top: 1rem;
  padding: 0.875rem;
  border: 1px solid var(--content-warning);
  border-radius: var(--radius);
  background: var(--surface-primary);
}

.gguf-lead {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  color: var(--content-warning);
}

.gguf-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.gguf-status {
  flex: 1 1 100%;
  font-size: 0.75rem;
  color: var(--content-secondary);
}

.gguf-caveats {
  margin: 0.75rem 0 0;
  padding-left: 1.125rem;
  font-size: 0.75rem;
  color: var(--content-secondary);
}

.gguf-caveats li + li {
  margin-top: 0.25rem;
}

.gguf-manual {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--content-secondary);
}

.gguf-manual summary {
  cursor: pointer;
}

/* Wraps rather than scrolls: a venv path is long, this column is narrow, and
   a command you have to drag sideways to read is one you cannot copy. */
.gguf-cmd {
  display: block;
  margin-top: 0.5rem;
  padding: 0.375rem 0.5rem;
  border-radius: 0.25rem;
  background: var(--surface-tertiary);
  color: var(--content-primary);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

/* Tail of a failed build. Bounded, because pip is verbose and the useful
   part is at the end. */
.gguf-log {
  margin: 0.75rem 0 0;
  padding: 0.5rem;
  max-height: 10rem;
  overflow: auto;
  border-radius: 0.25rem;
  background: var(--surface-tertiary);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.docs {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr) 13rem;
  gap: 2.5rem;
  max-width: 84rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  align-items: start;
}

/* The docs grid is the page's whole layout, so main's own max-width and
   column rules would fight it; inside the grid, main is one column. */
main.docs-main {
  display: block;
  max-width: 46rem;
  margin: 0;
  padding: 0;
  gap: 0;
}

.docs-side-title,
.docs-toc-title {
  margin: 0 0 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--content-secondary);
}

/* The manifest nav and the heading list are maps, so they stay put while
   the page scrolls, and scroll on their own when they outgrow the screen. */
.docs-side,
.docs-toc {
  position: sticky;
  top: 4.25rem;
  max-height: calc(100vh - 5.25rem);
  overflow-y: auto;
}

/* Every level of the sidebar is a .docs-nav list, the root included, so the
   reset applies to the class itself and indentation starts one level in. */
.docs-nav {
  font-size: 0.8125rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.docs-nav .docs-nav {
  margin-top: 0.125rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--border-default);
}

.docs-nav a {
  display: block;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  color: var(--content-secondary);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.docs-nav a:hover {
  color: var(--content-primary);
  background: var(--surface-secondary);
}

.docs-nav a[aria-current="page"] {
  color: var(--content-link);
  background: var(--surface-secondary);
}

.docs-nav a:focus-visible {
  outline: 2px solid var(--content-link);
  outline-offset: -1px;
}

/* ---------- docs content ---------- */

.docs-content {
  font-size: 0.9375rem;
  line-height: 1.65;
}

.docs-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.docs-description {
  margin: 0.375rem 0 0;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-default);
  color: var(--content-secondary);
  font-size: 0.875rem;
}

.docs-content h2,
.docs-content h3 {
  margin: 2rem 0 0.5rem;
  font-weight: 600;
  line-height: 1.3;
  /* Anchors land below the sticky bar instead of underneath it. */
  scroll-margin-top: 4.25rem;
}

.docs-content h2 {
  font-size: 1.125rem;
}

.docs-content h3 {
  font-size: 1rem;
}

.docs-content p {
  margin: 0.75rem 0;
}

.docs-content ul,
.docs-content ol {
  margin: 0.75rem 0;
  padding-left: 1.5rem;
}

.docs-content li {
  margin: 0.25rem 0;
}

.docs-content li > ul,
.docs-content li > ol {
  margin: 0.25rem 0;
}

.docs-content a {
  color: var(--content-link);
}

.docs-content code {
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  background: var(--surface-tertiary);
  color: var(--content-primary);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}

.docs-content pre {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  background: var(--surface-secondary);
  overflow-x: auto;
}

.docs-content pre code {
  padding: 0;
  background: none;
  font-size: 0.75rem;
  line-height: 1.6;
  overflow-wrap: normal;
}

.docs-content blockquote {
  margin: 1rem 0;
  padding: 0 0 0 0.875rem;
  border-left: 2px solid var(--border-secondary);
  color: var(--content-secondary);
}

.docs-content table {
  width: 100%;
  margin: 1rem 0;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.docs-content th,
.docs-content td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-default);
  text-align: left;
  vertical-align: top;
}

.docs-content th {
  background: var(--surface-secondary);
  color: var(--content-secondary);
  font-weight: 600;
}

/* Callouts, from the [!NOTE] syntax. The left border and the title carry
   the severity; the body text stays quiet. */
.markdown-alert {
  margin: 1rem 0;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--border-default);
  border-left: 2px solid var(--content-link);
  border-radius: var(--radius);
  background: var(--surface-secondary);
  font-size: 0.8125rem;
}

.markdown-alert > :first-child {
  margin-top: 0;
}

.markdown-alert > :last-child {
  margin-bottom: 0;
}

.markdown-alert-title {
  margin: 0 0 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.markdown-alert-note {
  border-left-color: var(--content-link);
}
.markdown-alert-note > .markdown-alert-title {
  color: var(--content-link);
}

.markdown-alert-tip {
  border-left-color: var(--content-success);
}
.markdown-alert-tip > .markdown-alert-title {
  color: var(--content-success);
}

.markdown-alert-important {
  border-left-color: hsl(262 83% 78%);
}
.markdown-alert-important > .markdown-alert-title {
  color: hsl(262 83% 78%);
}

.markdown-alert-warning {
  border-left-color: var(--content-warning);
}
.markdown-alert-warning > .markdown-alert-title {
  color: var(--content-warning);
}

.markdown-alert-caution {
  border-left-color: var(--content-destructive);
}
.markdown-alert-caution > .markdown-alert-title {
  color: var(--content-destructive);
}

/* ---------- docs toc + prevnext ---------- */

.docs-toc {
  font-size: 0.75rem;
}

.docs-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.docs-toc li {
  padding: 0.1875rem 0;
}

.docs-toc-h3 {
  padding-left: 0.875rem;
}

.docs-toc a {
  color: var(--content-disabled);
  text-decoration: none;
}

.docs-toc a:hover {
  color: var(--content-primary);
}

.docs-prevnext {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-default);
}

.docs-prevnext a {
  color: var(--content-link);
  font-size: 0.8125rem;
  text-decoration: none;
}

.docs-prevnext a:hover {
  text-decoration: underline;
}

.docs-source {
  margin: 1rem 0 0;
  font-size: 0.75rem;
}

.docs-source a {
  color: var(--content-secondary);
}

/* The public docs site makes the wordmark a link home; it should still read
   as the wordmark. */
a.wordmark {
  color: inherit;
  text-decoration: none;
}

/* On a narrow screen the nav flows above the content, and the heading
   list — a convenience, not a map — gets out of the way. */
@media (max-width: 60rem) {
  .docs {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }

  .docs-toc {
    display: none;
  }

  .docs-side,
  .docs-toc {
    position: static;
    max-height: none;
  }
}

/* ---------- spinner ---------- */

.detail-loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Measuring a model reaches the Hub several times and can ask vLLM what it
   supports, which imports torch. That is seconds, sometimes tens of them, and
   a line of static text through it reads as a page that has stopped. */
.spinner {
  flex: none;
  width: 0.875rem;
  height: 0.875rem;
  border: 2px solid var(--surface-quaternary);
  border-top-color: var(--content-link);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Respect a system setting that exists because motion makes some people ill;
   a pulse still says "working" without rotating. */
@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: pulse 1.4s ease-in-out infinite;
    border-top-color: var(--surface-quaternary);
    background: var(--content-link);
  }
  @keyframes pulse {
    50% {
      opacity: 0.35;
    }
  }
}

/* The button says what it is doing, so it needs the same treatment. */
.btn .spinner {
  width: 0.75rem;
  height: 0.75rem;
  border-width: 2px;
  margin-right: 0.375rem;
  vertical-align: -1px;
  display: inline-block;
}
