/* Spice Rack — hand written, no build step. Light and dark theme follow the system setting. */
/* Palette: soft white and light black neutrals, with crimson (from the Spice logo) as accent. The theme follows the
   system setting until the visitor picks one with the header switch (public/theme.js sets data-theme on <html>). */
:root {
  --bg: #f5f5f3;
  --surface: #fbfbfa;
  --surface-2: #eeeeeb;
  --border: #e1e1dc;
  --text: #1f1f1f;
  --muted: #6a6a65;
  --accent: #c01a2e;
  --accent-strong: #a10f22;
  --accent-soft: #fbeaec;
  --accent-2: #4a56a6;
  --accent-2-soft: #ececf6;
  --on-accent: #fff;
  --ok: #17784a;
  --ok-soft: #e1f2e8;
  --warn: #8f5f00;
  --warn-soft: #f9eed3;
  --danger: #b3261e;
  --code-bg: #ecece8;
  --chart: #c01a2e;
  --chart-grid: #e4e4df;
  --glass: rgba(245, 245, 243, .8);
  --shadow: 0 1px 2px rgba(20, 20, 20, .05), 0 6px 20px rgba(20, 20, 20, .05);
  --shadow-hover: 0 2px 4px rgba(20, 20, 20, .06), 0 12px 28px rgba(20, 20, 20, .1);
  color-scheme: light;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
:root[data-theme="dark"] {
  --bg: #1d1d20;
  --surface: #252528;
  --surface-2: #2d2d31;
  --border: #3a3a3f;
  --text: #ececee;
  --muted: #a1a1a8;
  --accent: #ff5468;
  --accent-strong: #ff7a8a;
  --accent-soft: #3a2328;
  --accent-2: #a3acf2;
  --accent-2-soft: #2c2d42;
  --on-accent: #1a0509;
  --ok: #55c785;
  --ok-soft: #1f3329;
  --warn: #f0bb4a;
  --warn-soft: #373018;
  --danger: #ff8a80;
  --code-bg: #2d2d31;
  --chart: #ff5468;
  --chart-grid: #35353a;
  --glass: rgba(29, 29, 32, .8);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .2);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, .35), 0 12px 28px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --bg: #1d1d20;
  --surface: #252528;
  --surface-2: #2d2d31;
  --border: #3a3a3f;
  --text: #ececee;
  --muted: #a1a1a8;
  --accent: #ff5468;
  --accent-strong: #ff7a8a;
  --accent-soft: #3a2328;
  --accent-2: #a3acf2;
  --accent-2-soft: #2c2d42;
  --on-accent: #1a0509;
  --ok: #55c785;
  --ok-soft: #1f3329;
  --warn: #f0bb4a;
  --warn-soft: #373018;
  --danger: #ff8a80;
  --code-bg: #2d2d31;
  --chart: #ff5468;
  --chart-grid: #35353a;
  --glass: rgba(29, 29, 32, .8);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .2);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, .35), 0 12px 28px rgba(0, 0, 0, .35);
  color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.55; font-size: 16px; }
img, svg { max-width: 100%; }
main { flex: 1 0 auto; }
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
code, pre { font-family: var(--mono); font-size: .9em; }
code { background: var(--code-bg); padding: .1em .35em; border-radius: 5px; }
pre { background: var(--code-bg); padding: 1em; border-radius: 8px; overflow-x: auto; margin: 0 0 1em; }
pre code { background: none; padding: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.accent { color: var(--accent); }
.center-text { text-align: center; }
.spacer { flex: 1; }
.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; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--accent-strong); color: var(--on-accent); padding: .5em 1em; border-radius: 6px; z-index: 10; }
.skip-link:focus { left: 8px; text-decoration: none; }
.icon { width: 1.05em; height: 1.05em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.15em; flex: none; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.container.narrow { max-width: 760px; }
.section { padding-top: 32px; padding-bottom: 48px; }

/* Header */
.site-header { background: var(--glass); -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.header-inner { display: flex; align-items: center; gap: 20px; min-height: 60px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.15rem; letter-spacing: -.02em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; object-fit: contain; }
.header-search { flex: 1 1 220px; max-width: 360px; display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid transparent; border-radius: 999px; padding: 0 14px; color: var(--muted); }
.header-search:focus-within { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
.header-search input[type="search"] { flex: 1; border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--text); font: inherit; padding: 8px 0; min-width: 0; outline: none; }
.header-search input[type="search"]:focus { border: 0; box-shadow: none; }
.header-search input::placeholder { color: var(--muted); opacity: .8; }
.main-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.nav-link { color: var(--text); padding: 6px 12px; border-radius: 8px; font-weight: 500; }
.nav-link:hover { background: var(--surface-2); text-decoration: none; }
.nav-link.active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.user-menu { display: inline-flex; align-items: center; gap: 8px; margin-left: 6px; }
.user-login { font-weight: 600; font-size: .9rem; }
.avatar { border-radius: 50%; vertical-align: middle; background: var(--surface-2); }
.inline-form { display: inline-flex; margin: 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-ghost { background: transparent; }
.btn-small { padding: 5px 11px; font-size: .875rem; }
.btn-block { display: flex; width: 100%; }
.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: var(--surface); border-color: var(--danger); }

/* Notices */
.notice { margin: 16px 0 0; padding: 12px 16px; border-radius: var(--radius); border: 1px solid; display: flex; align-items: flex-start; gap: 12px; }
.notice p { flex: 1; margin: 0; }
.notice ul { margin: 0; padding-left: 1.2em; }
.dismiss { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: inherit; opacity: .7; cursor: pointer; transition: opacity .15s, background-color .15s; }
.dismiss:hover { opacity: 1; background: rgba(128, 128, 128, .18); }
.dismiss[hidden] { display: none; }
.notice-ok { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.notice-err { background: var(--accent-soft); border-color: var(--danger); color: var(--danger); }

/* Hero */
.hero { background: radial-gradient(900px 380px at 85% -10%, var(--accent-soft), transparent 70%), radial-gradient(800px 380px at 10% 0%, var(--accent-2-soft), transparent 70%), var(--bg); border-bottom: 1px solid var(--border); }
/* On the front page the hero takes up all free height, so the lists and the call to action sit right above the footer */
main:has(> .hero) { display: flex; flex-direction: column; }
main:has(> .hero) > .hero { flex: 1 0 auto; display: flex; flex-direction: column; justify-content: center; }
.hero-inner { padding-top: 56px; padding-bottom: 48px; text-align: center; }
.hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.4rem); margin-bottom: .3em; letter-spacing: -.035em; font-weight: 800; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 640px; }
.hero .lead { margin: 0 auto 1.5em; }
.hero-search { display: flex; gap: 8px; max-width: 560px; margin: 0 auto 20px; }
.hero-search input { flex: 1; min-width: 0; font: inherit; padding: 13px 18px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.hero-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.hero-stats { list-style: none; display: flex; justify-content: center; gap: 28px; padding: 0; margin: 0 0 20px; color: var(--muted); flex-wrap: wrap; }
.hero-stats strong { color: var(--text); font-size: 1.1rem; }
.hero-tags { justify-content: center; }

/* Tags and badges */
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 .75em; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-size: .8rem; }
a.tag:hover { border-color: var(--accent); text-decoration: none; }
.tag-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
a.tag { background: var(--accent-2-soft); border-color: transparent; color: var(--accent-2); }
a.tag.tag-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
.tag-count { color: var(--muted); font-size: .75rem; margin-left: 2px; }
.badge { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.version { font-family: var(--mono); font-size: .8rem; color: var(--muted); font-weight: 500; }
.version.big { font-size: 1rem; background: var(--surface-2); padding: 2px 10px; border-radius: 999px; border: 1px solid var(--border); }

/* Cards and lists */
.card-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.card:hover { border-color: var(--accent); box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.card-head h3 { margin: 0 0 4px; font-size: 1.1rem; }
.card-head a { color: var(--text); }
.card-desc { color: var(--muted); margin: 0 0 10px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: .85rem; }
.stat { display: inline-flex; align-items: center; gap: 5px; }
.columns-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.columns-2 { display: grid; grid-template-columns: 3fr 2fr; gap: 20px; align-items: start; }
.mini-list { list-style: none; padding: 0; margin: 0 0 12px; }
.mini-list li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.mini-list a { display: contents; color: var(--text); }
.mini-list a:hover { text-decoration: none; }
.mini-name { font-weight: 600; color: var(--accent-strong); grid-column: 1; }
.mini-desc { color: var(--muted); font-size: .875rem; grid-column: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-metric { grid-column: 2; grid-row: 1; color: var(--muted); font-size: .8rem; white-space: nowrap; }
.cta { background: linear-gradient(120deg, var(--accent-2-soft), var(--accent-soft)); border-top: 1px solid var(--border); }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 32px; padding-bottom: 32px; flex-wrap: wrap; }
.cta h2 { margin-bottom: .2em; }
.cta p { margin: 0; }
.plain-list { list-style: none; padding: 0; margin: 0 0 1em; }
.plain-list li { padding: 4px 0; }
.plain-list a > .icon { margin-right: .55em; }

/* Page titles */
.page-title { background: var(--surface); border-bottom: 1px solid var(--border); padding: 24px 0 18px; }
.page-title h1 { margin-bottom: .15em; }
.page-title p { margin: 0; }
.title-flex { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.subnav { display: flex; gap: 4px; padding-top: 14px; padding-bottom: 0; }
.subnav a { padding: 6px 14px; border-radius: 8px; color: var(--text); font-weight: 500; }
.subnav a.active { background: var(--accent-soft); color: var(--accent-strong); }
.subnav a:hover { text-decoration: none; background: var(--surface-2); }

/* Search */
.search-layout { display: grid; grid-template-columns: 260px 1fr; gap: 28px; padding-top: 24px; padding-bottom: 48px; align-items: start; }
.filters h2 { font-size: .95rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: 1.4em; }
.filter-form label, .field label { display: block; font-weight: 600; font-size: .875rem; margin: 0 0 4px; }
.filter-form input, .filter-form select { width: 100%; margin-bottom: 12px; }
input[type="text"], input[type="search"], select, textarea { font: inherit; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); width: 100%; }
input[readonly] { background: var(--surface-2); color: var(--muted); }
/* Select: rounded, custom chevron, smooth hover/focus. Browsers with customizable selects (appearance: base-select) also get a styled, animated dropdown; the rest keep their native list. */
select { -webkit-appearance: none; appearance: none; cursor: pointer; border-radius: 10px; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%238a8a90' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1.5 1.5L6 6l4.5-4.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; background-size: 12px 8px; transition: border-color .15s, box-shadow .2s, background-color .15s; }
select:hover { border-color: var(--accent); }
@supports (appearance: base-select) {
  select, ::picker(select) { appearance: base-select; }
  select { background-image: none; padding-right: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  select::picker-icon { content: ""; width: 7px; height: 7px; margin-right: 3px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-2px) rotate(45deg); transition: transform .25s ease, border-color .15s; }
  select:open::picker-icon { transform: translateY(2px) rotate(-135deg); border-color: var(--accent); }
  ::picker(select) { margin-top: 6px; padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-hover); opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top; transition: opacity .18s ease, transform .18s ease, overlay .18s allow-discrete, display .18s allow-discrete; }
  ::picker(select):popover-open { opacity: 1; transform: none; }
  @starting-style { ::picker(select):popover-open { opacity: 0; transform: translateY(-6px) scale(.98); } }
  select option { padding: 8px 10px; border-radius: 8px; color: var(--text); transition: background-color .12s; }
  select option:hover, select option:focus-visible { background: var(--surface-2); outline: none; }
  select option:checked { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
  select option::checkmark { display: none; }
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 24px; }
.empty { text-align: center; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 32px 16px; }
.toolbar { display: flex; gap: 8px; margin-bottom: 16px; max-width: 520px; }

/* Package page */
.package-header { background: var(--surface); border-bottom: 1px solid var(--border); padding-top: 28px; }
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.title-row h1 { margin: 0; word-break: break-word; }
.package-header .lead { margin: .2em 0 .8em; }
.tabs { display: flex; gap: 4px; margin-top: 12px; overflow-x: auto; }
.tab { padding: 10px 16px; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--accent-strong); border-bottom-color: var(--accent); }
.tab-badge { margin-left: 6px; font-size: .75rem; background: var(--surface-2); padding: 1px 7px; border-radius: 999px; }
.package-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; padding-top: 24px; padding-bottom: 48px; align-items: start; }
.sidebar { display: grid; gap: 16px; }
.side-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.side-block h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .8em; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; word-break: break-word; }
.code { margin: 0 0 12px; font-size: .85rem; }
.readme { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 28px; overflow-x: auto; }

/* Rendered markdown (README, changelog) */
.markdown-body { overflow-wrap: anywhere; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body > :last-child { margin-bottom: 0; }
.markdown-body h1, .markdown-body h2 { padding-bottom: .3em; border-bottom: 1px solid var(--border); margin-top: 1.6em; }
.markdown-body h3, .markdown-body h4 { margin-top: 1.4em; }
.markdown-body img { max-width: 100%; height: auto; }
.markdown-body table { border-collapse: collapse; display: block; overflow-x: auto; margin: 0 0 1em; }
.markdown-body th, .markdown-body td { border: 1px solid var(--border); padding: 6px 12px; }
.markdown-body blockquote { margin: 0 0 1em; padding: 0 1em; border-left: 4px solid var(--border); color: var(--muted); }
.markdown-body pre { background: var(--code-bg); }
.markdown-body .anchor { float: left; margin-left: -20px; padding-right: 4px; opacity: 0; }
.markdown-body h1:hover .anchor, .markdown-body h2:hover .anchor, .markdown-body h3:hover .anchor { opacity: .6; }
.markdown-body .octicon { display: inline-block; width: 16px; height: 16px; fill: currentColor; vertical-align: text-bottom; }
.markdown-body hr { border: 0; border-top: 1px solid var(--border); margin: 1.5em 0; }
.markdown-body ul.contains-task-list { list-style: none; padding-left: 1.2em; }
.markdown-body .highlight pre { margin-bottom: 1em; }

/* Versions */
.versions { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.version-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.version-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.version-head h3 { margin: 0; font-family: var(--mono); }
.version-title { font-weight: 600; margin: 8px 0 0; }
.changelog { margin-top: 10px; }
.changelog summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.changelog .markdown-body, .changelog pre { margin-top: 10px; }

/* Dependencies */
.dep-tree { list-style: none; margin: 0; padding-left: 0; }
.dep-tree .dep-tree { padding-left: 22px; border-left: 1px dashed var(--border); margin-left: 6px; }
.dep-tree li { padding: 4px 0; }
.dep-tree summary { cursor: pointer; }
.dep-tree .dep-leaf { padding-left: 20px; }
.dep-name { font-weight: 600; }
.dep-constraint { font-size: .8rem; }

/* Panels, tiles, tables */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.panel > :last-child { margin-bottom: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; }
.tile-value { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; color: var(--accent); }
.tile-label { color: var(--muted); font-size: .85rem; }
.chart { margin: 0; }
.chart figcaption { font-weight: 600; margin-bottom: 8px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 10px; font-family: var(--font); }
.chart .bar { fill: var(--chart); }
.chart .bar:hover { opacity: .75; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; white-space: nowrap; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { white-space: nowrap; display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 0; }
.table tr:last-child td { border-bottom: 0; }
.bar-cell { width: 25%; min-width: 80px; }
.inline-bar { display: block; height: 8px; border-radius: 4px; background: var(--accent); min-width: 2px; }

/* Forms */
.form .field { margin-bottom: 16px; }
.hint { margin: 4px 0 0; color: var(--muted); font-size: .85rem; }
.req { color: var(--danger); }
.form-actions { display: flex; gap: 10px; margin-top: 8px; }
.danger-zone { border-color: var(--danger); }
.danger-zone h2 { color: var(--danger); }

/* Prose / docs */
.prose h2 { margin-top: 1.6em; }
.steps { padding-left: 0; list-style: none; counter-reset: step; }
.steps > li { counter-increment: step; position: relative; padding-left: 48px; margin-bottom: 20px; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 700; display: grid; place-items: center; }
.steps h2 { margin-bottom: .2em; font-size: 1.1rem; }
.error-code { font-size: 4rem; font-weight: 800; color: var(--accent); margin: 0; line-height: 1; }

/* Footer */
.site-footer { flex-shrink: 0; border-top: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: .9rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; padding-top: 22px; padding-bottom: 22px; flex-wrap: wrap; align-items: center; }
.footer-inner .brand-mark { width: 16px; height: 16px; vertical-align: -3px; }
.footer-links { display: flex; gap: 18px; }

@media (max-width: 860px) {
  .columns-3, .columns-2 { grid-template-columns: 1fr; }
  .search-layout, .package-layout { grid-template-columns: 1fr; }
  .header-search { order: 3; max-width: none; flex-basis: 100%; }
  .main-nav { margin-left: 0; }
  .readme { padding: 16px; }
  .user-login { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .card, .tag { transition: border-color .15s, background-color .15s, box-shadow .2s, transform .2s, filter .15s; }
}
/* The logo's navy half vanishes on a dark background, so it sits on a light chip. */
:root[data-theme="dark"] .brand-mark { background: #f4f4f1; padding: 3px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-mark { background: #f4f4f1; padding: 3px; }
}
.theme-toggle { display: inline-grid; place-items: center; width: 34px; padding: 0; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
/* Buttons in the header share one height */
.main-nav .btn-small, .theme-toggle { height: 34px; }
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle .icon { width: 1.2em; height: 1.2em; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}
