:root {
  --bg: #08080c;
  --surface: #0f0f16;
  --border: #1e1e2e;
  --text: #e2e2ea;
  --muted: #6e6e8a;
  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --tag-bg: #13131f;
  --radius: 12px;
  --font: "Aptos", "Segoe UI Variable Display", "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background:
    radial-gradient(1200px 700px at 10% -20%, rgba(99, 102, 241, 0.18), transparent 55%),
    radial-gradient(1000px 600px at 95% 5%, rgba(34, 211, 238, 0.09), transparent 50%),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

header.site h1 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

header.site .lede {
  margin: 0 0 2rem;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 55ch;
}

.intro-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  margin: 0 0 2rem;
}

.intro-row .lede {
  margin: 0;
  flex: 1;
}

.intro-badge-link {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  margin-top: 0.2rem;
}

.intro-badge-link:hover {
  color: var(--accent-hover);
}

.intro-badge-link img {
  display: block;
  height: 56px;
  width: auto;
}

.theme-picker {
  display: inline-flex;
  align-items: center;
}

.theme-picker select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.48rem 2rem 0.48rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236e6e8a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  font-family: var(--font);
  min-width: 130px;
  text-align: center;
  text-align-last: center;
}

nav.sub {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  padding: 1rem 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.01);
  backdrop-filter: blur(4px);
  margin-bottom: 0;
}

label.search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 200px;
}

label.search span { color: var(--muted); font-size: 0.875rem; }

input[type="search"] {
  flex: 1;
  max-width: 320px;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="search"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.12);
}

input[type="search"]::placeholder { color: #4a4a5e; }

select.filter {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  outline: none;
  font-family: var(--font);
}

.tool-grid {
  display: flex;
  flex-direction: column;
  margin-top: 1rem;
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.15rem 1.25rem;
  margin-bottom: 0.5rem;
  border: 1px solid rgba(129, 140, 248, 0.16);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(20, 20, 32, 0.95), rgba(15, 15, 22, 0.96));
  transition: all 0.2s ease;
}

.tool-card:hover {
  border-color: rgba(129, 140, 248, 0.3);
  box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.15), 0 14px 34px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}

.tool-card h2 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.tool-card h2 a { color: var(--text); }
.tool-card h2 a:hover { color: var(--accent); }

.tool-card .summary {
  margin: 0 0 0.4rem;
  font-size: 0.9rem;
  color: #9ca3af;
  line-height: 1.5;
}

.tool-row {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.15rem 1.25rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: all 0.2s ease;
}

.tool-row:hover {
  border-color: rgba(129, 140, 248, 0.3);
  box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.08), 0 4px 24px rgba(0, 0, 0, 0.4);
  transform: translateY(-1px);
}

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

.tool-main h2 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.tool-main h2 a { color: var(--text); }
.tool-main h2 a:hover { color: var(--accent); }

.tool-main .summary {
  margin: 0 0 0.4rem;
  font-size: 0.9rem;
  color: #9ca3af;
  line-height: 1.5;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  align-items: center;
  font-size: 0.78rem;
  color: var(--muted);
}

.meta-row .author a { color: var(--muted); }
.meta-row .author a:hover { color: var(--accent); }

.badge-runtime {
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  background: var(--tag-bg);
  color: #7c7c9e;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.tool-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  min-width: 130px;
  flex-shrink: 0;
}

.cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  justify-content: flex-end;
}

.cats .cat {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  background: var(--tag-bg);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--mono);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  font-size: 0.8rem;
}

.links a {
  color: var(--accent);
  font-weight: 500;
}
.links a:hover { color: var(--accent-hover); }
.links a.secondary { color: var(--muted); font-weight: 400; }
.links a.secondary:hover { color: var(--accent); }

footer.site {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
}

footer.site p { margin: 0 0 0.5rem; }

.footer-github {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.footer-github svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}

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

@media (max-width: 640px) {
  .intro-row { flex-direction: column; gap: 1rem; }
  .intro-badge-link img { height: auto; max-width: 100%; }
  .tool-row { flex-direction: column; gap: 0.75rem; }
  .tool-side { align-items: flex-start; }
  .cats { justify-content: flex-start; }
  .detail-nav { align-items: flex-start; }
  .detail-badge-link { align-items: flex-start; flex-direction: column; }
  .detail-badge-link img { height: auto; max-width: 100%; }
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
}

.site-logo img {
  display: block;
  width: 50px;
  height: 50px;
  object-fit: contain;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.28));
}

.site-logo-wordmark {
  display: block;
  font-size: clamp(1.15rem, 2.8vw, 1.55rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--text);
  white-space: nowrap;
}

.detail-page .tool-card.detail-card {
  margin-bottom: 2rem;
}

.detail-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem 1rem;
  margin: 0 0 1rem;
}

.detail-back {
  font-size: 0.92rem;
  color: var(--muted);
}

.detail-back:hover {
  color: var(--accent);
}

.detail-badge-link {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.detail-badge-link:hover {
  border-color: rgba(129, 140, 248, 0.32);
  background: rgba(129, 140, 248, 0.05);
}

.detail-badge-link img {
  display: block;
  height: 56px;
  width: auto;
}

.detail-badge-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.detail-title {
  font-size: clamp(1.55rem, 3.4vw, 2.05rem);
  line-height: 1.25;
  margin: 0 0 0.4rem;
}

.detail-categories {
  margin: 0 0 0.7rem;
}

.detail-categories span {
  background: linear-gradient(135deg, rgba(129, 140, 248, 0.2), rgba(34, 211, 238, 0.14));
  border: 1px solid rgba(129, 140, 248, 0.24);
  color: #dbe7ff;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.38rem 0.62rem;
}

.detail-card .tags {
  gap: 0.55rem;
}

.detail-card .tags span {
  border-radius: 999px;
  padding: 0.45rem 0.72rem;
  background: rgba(19, 19, 31, 0.92);
  border: 1px solid rgba(129, 140, 248, 0.18);
  color: #c9d2e7;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.detail-subtitle {
  margin: 1.1rem 0 0.45rem;
  font-size: 0.98rem;
}

.detail-refs {
  margin: 0;
  padding-left: 1.2rem;
}

.site-logo svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.site-logo h1 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

/* Tool action buttons */
.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  line-height: 1.3;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--accent);
  color: #08080c;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #08080c;
}

.btn-secondary {
  background: var(--tag-bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
  color: var(--text);
}

.btn-small svg {
  width: 14px;
  height: 14px;
}

.scroll-sentinel {
  height: 1px;
}

/* Light theme overrides. Generated from css/themes/light.css. */
html[data-theme="light"] {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --surface-hover: #f1f3f5;
  --border: #e9ecef;
  --text: #1a1d23;
  --muted: #6c757d;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --tag-bg: #f1f3f5;
  --radius: 12px;
  --font: "Aptos", "Segoe UI Variable Display", "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
}

html[data-theme="light"] *, html[data-theme="light"] *::before, html[data-theme="light"] *::after { box-sizing: border-box; }

html[data-theme="light"] { scroll-behavior: smooth; }

html[data-theme="light"] body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background:
    radial-gradient(1200px 700px at 10% -20%, rgba(79, 70, 229, 0.12), transparent 56%),
    radial-gradient(1000px 650px at 95% 5%, rgba(14, 116, 144, 0.08), transparent 50%),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

html[data-theme="light"] a { color: var(--accent); text-decoration: none; }

html[data-theme="light"] a:hover { color: var(--accent-hover); }

html[data-theme="light"] .wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

html[data-theme="light"] .header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

html[data-theme="light"] header.site h1 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

html[data-theme="light"] header.site .lede {
  margin: 0 0 2rem;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 55ch;
}

html[data-theme="light"] .intro-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  margin: 0 0 2rem;
}

html[data-theme="light"] .intro-row .lede {
  margin: 0;
  flex: 1;
}

html[data-theme="light"] .intro-badge-link {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  margin-top: 0.2rem;
}

html[data-theme="light"] .intro-badge-link:hover {
  color: var(--accent-hover);
}

html[data-theme="light"] .intro-badge-link img {
  display: block;
  height: 56px;
  width: auto;
}

html[data-theme="light"] .theme-picker {
  display: inline-flex;
  align-items: center;
}

html[data-theme="light"] .theme-picker select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.48rem 2rem 0.48rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236c757d' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  font-family: var(--font);
  min-width: 130px;
  text-align: center;
  text-align-last: center;
}

html[data-theme="light"] nav.sub {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  padding: 1rem 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(4px);
  margin-bottom: 0;
}

html[data-theme="light"] label.search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 200px;
}

html[data-theme="light"] label.search span { color: var(--muted); font-size: 0.875rem; }

html[data-theme="light"] input[type="search"] {
  flex: 1;
  max-width: 320px;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

html[data-theme="light"] input[type="search"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

html[data-theme="light"] input[type="search"]::placeholder { color: #adb5bd; }

html[data-theme="light"] select.filter {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  outline: none;
  font-family: var(--font);
}

html[data-theme="light"] .tool-grid {
  display: flex;
  flex-direction: column;
  margin-top: 1rem;
}

html[data-theme="light"] .tool-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.15rem 1.25rem;
  margin-bottom: 0.5rem;
  border: 1px solid rgba(79, 70, 229, 0.16);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 255, 0.96));
  transition: all 0.2s ease;
}

html[data-theme="light"] .tool-card:hover {
  border-color: rgba(79, 70, 229, 0.25);
  box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.12), 0 12px 28px rgba(42, 54, 112, 0.09);
  transform: translateY(-2px);
}

html[data-theme="light"] .tool-card h2 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 600;
}

html[data-theme="light"] .tool-card h2 a { color: var(--text); }

html[data-theme="light"] .tool-card h2 a:hover { color: var(--accent); }

html[data-theme="light"] .tool-card .summary {
  margin: 0 0 0.4rem;
  font-size: 0.9rem;
  color: #495057;
  line-height: 1.5;
}

html[data-theme="light"] .tool-row {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.15rem 1.25rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: all 0.2s ease;
}

html[data-theme="light"] .tool-row:hover {
  border-color: rgba(79, 70, 229, 0.25);
  box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.06), 0 4px 24px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

html[data-theme="light"] .tool-main { flex: 1; min-width: 0; }

html[data-theme="light"] .tool-main h2 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 600;
}

html[data-theme="light"] .tool-main h2 a { color: var(--text); }

html[data-theme="light"] .tool-main h2 a:hover { color: var(--accent); }

html[data-theme="light"] .tool-main .summary {
  margin: 0 0 0.4rem;
  font-size: 0.9rem;
  color: #495057;
  line-height: 1.5;
}

html[data-theme="light"] .meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  align-items: center;
  font-size: 0.78rem;
  color: var(--muted);
}

html[data-theme="light"] .meta-row .author a { color: var(--muted); }

html[data-theme="light"] .meta-row .author a:hover { color: var(--accent); }

html[data-theme="light"] .badge-runtime {
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  background: var(--tag-bg);
  color: #6c757d;
  border: 1px solid var(--border);
  border-radius: 4px;
}

html[data-theme="light"] .tool-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  min-width: 130px;
  flex-shrink: 0;
}

html[data-theme="light"] .cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  justify-content: flex-end;
}

html[data-theme="light"] .cats .cat {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  background: var(--tag-bg);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--mono);
}

html[data-theme="light"] .links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  font-size: 0.8rem;
}

html[data-theme="light"] .links a {
  color: var(--accent);
  font-weight: 500;
}

html[data-theme="light"] .links a:hover { color: var(--accent-hover); }

html[data-theme="light"] .links a.secondary { color: var(--muted); font-weight: 400; }

html[data-theme="light"] .links a.secondary:hover { color: var(--accent); }

html[data-theme="light"] footer.site {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
}

html[data-theme="light"] footer.site p { margin: 0 0 0.5rem; }

html[data-theme="light"] .empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}

html[data-theme="light"] .sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); border: 0;
}

@media (max-width: 640px) {
html[data-theme="light"] .intro-row { flex-direction: column; gap: 1rem; }

html[data-theme="light"] .intro-badge-link img { height: auto; max-width: 100%; }

html[data-theme="light"] .tool-row { flex-direction: column; gap: 0.75rem; }

html[data-theme="light"] .tool-side { align-items: flex-start; }

html[data-theme="light"] .cats { justify-content: flex-start; }

html[data-theme="light"] .detail-nav { align-items: flex-start; }

html[data-theme="light"] .detail-badge-link { align-items: flex-start; flex-direction: column; }

html[data-theme="light"] .detail-badge-link img { height: auto; max-width: 100%; }
}

html[data-theme="light"] /* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
}

html[data-theme="light"] .site-logo img {
  display: block;
  width: 50px;
  height: 50px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(79, 70, 229, 0.12));
}

html[data-theme="light"] .site-logo-wordmark {
  display: block;
  font-size: clamp(1.15rem, 2.8vw, 1.55rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--text);
  white-space: nowrap;
}

html[data-theme="light"] .detail-page .tool-card.detail-card {
  margin-bottom: 2rem;
}

html[data-theme="light"] .detail-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem 1rem;
  margin: 0 0 1rem;
}

html[data-theme="light"] .detail-back {
  font-size: 0.92rem;
  color: var(--muted);
}

html[data-theme="light"] .detail-back:hover {
  color: var(--accent);
}

html[data-theme="light"] .detail-badge-link {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
}

html[data-theme="light"] .detail-badge-link:hover {
  border-color: rgba(79, 70, 229, 0.28);
  background: rgba(79, 70, 229, 0.05);
}

html[data-theme="light"] .detail-badge-link img {
  display: block;
  height: 56px;
  width: auto;
}

html[data-theme="light"] .detail-badge-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.01em;
}

html[data-theme="light"] .detail-title {
  font-size: clamp(1.55rem, 3.4vw, 2.05rem);
  line-height: 1.25;
  margin: 0 0 0.4rem;
}

html[data-theme="light"] .detail-categories {
  margin: 0 0 0.7rem;
}

html[data-theme="light"] .detail-categories span {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(14, 116, 144, 0.08));
  border: 1px solid rgba(79, 70, 229, 0.16);
  color: #334155;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.38rem 0.62rem;
}

html[data-theme="light"] .detail-card .tags {
  gap: 0.55rem;
}

html[data-theme="light"] .detail-card .tags span {
  border-radius: 999px;
  padding: 0.45rem 0.72rem;
  background: rgba(241, 243, 245, 0.96);
  border: 1px solid rgba(79, 70, 229, 0.12);
  color: #475569;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

html[data-theme="light"] .detail-subtitle {
  margin: 1.1rem 0 0.45rem;
  font-size: 0.98rem;
}

html[data-theme="light"] .detail-refs {
  margin: 0;
  padding-left: 1.2rem;
}

html[data-theme="light"] .site-logo svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

html[data-theme="light"] .site-logo h1 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

html[data-theme="light"] /* Tool action buttons */
.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

html[data-theme="light"] .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  line-height: 1.3;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

html[data-theme="light"] .btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

html[data-theme="light"] .btn-primary {
  background: var(--accent);
  color: #ffffff;
}

html[data-theme="light"] .btn-primary:hover {
  background: var(--accent-hover);
  color: #ffffff;
}

html[data-theme="light"] .btn-secondary {
  background: var(--tag-bg);
  color: var(--text);
  border: 1px solid var(--border);
}

html[data-theme="light"] .btn-secondary:hover {
  background: var(--surface-hover);
  color: var(--text);
}

html[data-theme="light"] .btn-small svg {
  width: 14px;
  height: 14px;
}

html[data-theme="light"] .scroll-sentinel {
  height: 1px;
}
