:root {
  color-scheme: dark;
  --canvas: oklch(16% 0.012 55);
  --surface: oklch(21% 0.014 55);
  --surface-raised: oklch(25% 0.016 55);
  --paper: oklch(91% 0.022 75);
  --muted: oklch(69% 0.018 70);
  --faint: oklch(54% 0.016 70);
  --accent: oklch(65% 0.19 35);
  --accent-ink: oklch(17% 0.02 35);
  --hairline: oklch(93% 0.01 75 / 12%);
  --hairline-strong: oklch(93% 0.01 75 / 22%);
  --scrollbar-track: transparent;
  --scrollbar-thumb: oklch(36% 0.015 55);
  --scrollbar-thumb-hover: oklch(52% 0.018 55);
  --scrollbar-thumb-active: var(--accent);
  --dim-creator: oklch(76% 0.16 65);
  --dim-visual: oklch(74% 0.17 145);
  --dim-narrative: oklch(72% 0.18 315);
  --dim-space: oklch(72% 0.16 225);
  --dim-mood: oklch(72% 0.19 25);
  --radius-xs: 2px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-pill: 999px;
  --font-display: "Avenir Next Condensed", "Arial Narrow", "PingFang SC", "Noto Sans SC", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Noto Sans SC", sans-serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --canvas: oklch(97% 0.008 75);
  --surface: oklch(93% 0.012 75);
  --surface-raised: oklch(89% 0.016 70);
  --paper: oklch(20% 0.025 55);
  --muted: oklch(43% 0.025 55);
  --faint: oklch(47% 0.02 55);
  --accent: oklch(48% 0.17 35);
  --accent-ink: oklch(98% 0.008 75);
  --hairline: oklch(20% 0.025 55 / 14%);
  --hairline-strong: oklch(20% 0.025 55 / 26%);
  --scrollbar-track: transparent;
  --scrollbar-thumb: oklch(76% 0.015 70);
  --scrollbar-thumb-hover: oklch(60% 0.02 70);
  --scrollbar-thumb-active: var(--accent);
  --dim-creator: oklch(52% 0.16 65);
  --dim-visual: oklch(48% 0.17 145);
  --dim-narrative: oklch(48% 0.18 315);
  --dim-space: oklch(46% 0.16 225);
  --dim-mood: oklch(50% 0.19 25);
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* 统一 WebKit 现代滚动条外观 */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 999px;
  border: 1.5px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
  border: 1.5px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:active {
  background: var(--scrollbar-thumb-active);
  border: 1.5px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-corner {
  background: transparent;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: env(safe-area-inset-bottom);
}

button, input, select { font: inherit; }
button, a, input, select { touch-action: manipulation; }
a { color: inherit; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  left: 16px;
  top: 12px;
  transform: translateY(-160%);
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

.skip-link:focus { transform: translateY(0); }

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

.masthead {
  min-height: 88px;
  padding: 20px clamp(20px, 4vw, 64px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--hairline);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  line-height: 1;
}

.brand-mark {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand-copy { display: grid; gap: 4px; }
.brand-copy b { font: 750 15px/1 var(--font-display); letter-spacing: .18em; }
.brand-copy small { color: var(--faint); font-size: 9px; letter-spacing: .12em; }

.view-nav {
  display: flex;
  align-self: stretch;
  align-items: center;
  gap: 4px;
}

.view-nav button {
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--muted);
  font: 700 12px/1 var(--font-display);
  letter-spacing: .06em;
  cursor: pointer;
}

.view-nav button.is-active { background: var(--surface-raised); color: var(--accent); }
.masthead-actions { justify-self: end; display: flex; align-items: center; gap: 8px; }

.theme-toggle {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}
.theme-toggle-icon { color: var(--accent); font-size: 16px; line-height: 1; }
.theme-toggle:hover { border-color: var(--accent); color: var(--paper); }

.repo-link, .download-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--canvas);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition-property: transform, opacity;
  transition-duration: 160ms;
}

.repo-link:active, .download-link:active, button:active { transform: scale(.97); }

main { display: block; }

h1, h2, h3, p { margin-top: 0; }

.workspace {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  padding: 32px clamp(20px, 4vw, 64px) 72px;
}

.category-panel {
  position: sticky;
  top: 20px;
  align-self: start;
  max-height: calc(100vh - 140px);
  max-height: calc(100dvh - 140px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overscroll-behavior: contain;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--hairline-strong);
  flex-shrink: 0;
}
.panel-heading h2 { margin: 0; font: 700 17px/1 var(--font-display); }
.panel-heading span { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }

.category-filter {
  position: relative;
  display: flex;
  align-items: center;
  margin: 10px 0 8px;
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-xs);
  flex-shrink: 0;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.category-filter:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in oklch, var(--accent) 25%, transparent);
}

.category-filter-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  color: var(--faint);
  line-height: 1;
  pointer-events: none;
}

.category-filter-icon svg {
  display: block;
}

.category-filter input {
  width: 100%;
  min-height: 32px;
  padding: 4px 26px 4px 6px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--paper);
  font-size: 12px;
}

.category-filter input::placeholder {
  color: var(--faint);
  font-size: 11px;
}

.category-filter-clear {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
  color: var(--muted);
  cursor: pointer;
}

.category-filter-clear svg {
  display: block;
}

.category-filter-clear:hover {
  color: var(--paper);
  background: var(--accent);
}

/* Dimension Filter Tabs */
.dimension-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 8px 0 12px;
  flex-shrink: 0;
}

.dimension-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 3px 8px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease;
}

.dimension-tab-btn .tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--tab-color, var(--accent));
  line-height: 1;
}

.dimension-tab-btn .tab-icon svg {
  display: block;
}

.dimension-tab-btn small {
  color: var(--faint);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
  margin-left: 1px;
}

.dimension-tab-btn:hover {
  color: var(--paper);
  border-color: var(--tab-color, var(--accent));
  background: var(--surface-raised);
}

.dimension-tab-btn.is-active {
  background: var(--tab-color, var(--accent));
  color: var(--accent-ink);
  border-color: transparent;
  font-weight: 750;
}

.dimension-tab-btn.is-active .tab-icon {
  color: var(--accent-ink);
}

.dimension-tab-btn.is-active small {
  background: color-mix(in oklch, var(--accent-ink) 22%, transparent);
  color: var(--accent-ink);
  padding: 1px 4px;
  border-radius: var(--radius-pill);
}

/* Master Category Card (All Seeds) */
.category-master-item {
  margin-bottom: 6px;
  border-radius: var(--radius-xs);
  overflow: hidden;
  border: 1px solid var(--hairline-strong);
  background: color-mix(in oklch, var(--surface-raised) 70%, transparent);
}

.category-button.is-master {
  min-height: 48px;
  border-bottom: 0;
  background: transparent;
}

.category-button.is-master .master-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  color: var(--accent);
  line-height: 1;
}

.category-button.is-master .master-badge svg {
  display: block;
}

.category-button.is-master.is-active {
  background: var(--accent);
  color: var(--accent-ink);
}

.category-button.is-master.is-active b,
.category-button.is-master.is-active em,
.category-button.is-master.is-active small,
.category-button.is-master.is-active .master-badge {
  color: var(--accent-ink);
}

/* Category Group Sections */
.category-group-section {
  display: grid;
  margin-bottom: 12px;
}

.category-group-header {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  margin: 6px 0 2px;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline-strong);
  border-radius: var(--radius-xs);
}

.group-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.group-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--dim-color, var(--accent));
  line-height: 1;
}

.group-icon svg {
  display: block;
}

.group-name {
  color: var(--paper);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .02em;
}

.group-en {
  color: var(--faint);
  font-size: 9px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.group-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  color: var(--faint);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
}

.category-group-list {
  display: grid;
}

.category-list {
  display: grid;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  padding-right: 4px;
  padding-bottom: 28px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.dimension-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dim-color, var(--accent));
  margin-right: 6px;
  vertical-align: middle;
  flex-shrink: 0;
}

.category-button {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 8px;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transition-property: transform, opacity;
  transition-duration: 160ms;
}

.category-button span { display: grid; }
.category-button b { display: flex; align-items: center; color: inherit; font-size: 14px; font-weight: 600; }
.category-button small { color: var(--faint); font-size: 10px; letter-spacing: .05em; }
.category-button em { min-width: 29px; color: var(--faint); font-size: 11px; font-style: normal; text-align: right; font-variant-numeric: tabular-nums; }
.category-button.is-active { color: var(--paper); background: var(--surface-raised); }
.category-button.is-active b, .category-button.is-active em { color: var(--accent); }

.results-panel { min-width: 0; }
.toolbar { position: sticky; top: 0; z-index: 10; margin: -10px 0 28px; padding: 10px 0 12px; background: var(--canvas); border-bottom: 1px solid var(--hairline); }
.search-box { height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: var(--surface); border-radius: var(--radius-sm); box-shadow: inset 0 0 0 1px var(--hairline); }
.search-box > span { display: inline-flex; align-items: center; justify-content: center; color: var(--accent); line-height: 1; }
.search-box > span svg { display: block; }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--paper); font-size: 13px; }
.search-box input::placeholder { color: var(--faint); }
kbd { border: 1px solid var(--hairline-strong); border-radius: var(--radius-xs); color: var(--faint); padding: 0 7px; font: 11px/22px var(--font-body); }

.toolbar-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.select-wrap { flex: 1; }
.select-wrap select {
  width: 100%;
  min-height: 42px;
  padding: 0 34px 0 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--paper);
  box-shadow: inset 0 0 0 1px var(--hairline);
}

.language-toggle { display: flex; padding: 3px; background: var(--surface); border-radius: var(--radius-sm); box-shadow: inset 0 0 0 1px var(--hairline); }
.language-toggle button { min-width: 48px; min-height: 36px; border: 0; border-radius: 3px; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; }
.language-toggle button.is-active { background: var(--paper); color: var(--canvas); font-weight: 700; }
.toolbar-row .download-link { min-height: 42px; }

.result-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 4px;
}
.result-heading-title { display: grid; gap: 2px; }
.result-heading-title h2 { margin: 0; font: 650 clamp(30px, 3vw, 44px)/1 var(--font-display); }
.active-category-subtitle { color: var(--accent); font: 700 12px/1.3 var(--font-display); letter-spacing: .08em; }
.result-sub { margin: 2px 0 0; color: var(--faint); font-size: 11px; line-height: 1.4; }
.result-sub span { color: var(--muted); }
.result-sub strong { color: var(--paper); font-variant-numeric: tabular-nums; }

.library-batch-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.quick-select-group, .quick-copy-group {
  display: flex;
  align-items: center;
  gap: 5px;
}
.batch-btn {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: all 120ms ease;
}
.batch-btn span { font-variant-numeric: tabular-nums; }
.batch-btn:hover {
  color: var(--paper);
  border-color: var(--accent);
  background: var(--surface-raised);
}
.batch-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
}
.batch-btn.quiet {
  border-color: transparent;
  color: var(--faint);
}
.batch-btn.quiet:hover {
  color: var(--paper);
  border-color: var(--hairline-strong);
}
.batch-btn.highlight {
  border-color: color-mix(in oklch, var(--accent) 70%, transparent);
  color: var(--paper);
  background: color-mix(in oklch, var(--accent) 12%, var(--surface));
  font-weight: 700;
}
.batch-btn.highlight:hover {
  background: var(--accent);
  color: var(--accent-ink);
}

.status { padding: 28px 0; color: var(--muted); border-top: 1px solid var(--hairline); }
.seed-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.seed-item {
  min-width: 0;
  aspect-ratio: 1;
}

.seed-tile {
  width: 100%;
  height: 100%;
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--paper);
  text-align: left;
  position: relative;
  transition: transform 150ms ease, border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}
.seed-tile.is-staged {
  border-color: color-mix(in oklch, var(--accent) 60%, transparent);
  background: color-mix(in oklch, var(--accent) 8%, var(--surface));
  box-shadow: 0 0 0 1px var(--accent);
}
.seed-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.rank { color: var(--accent); font: 750 11px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.seed-category { min-width: 0; display: inline-flex; align-items: center; overflow-wrap: anywhere; color: var(--faint); font: 700 9px/1.2 var(--font-display); letter-spacing: .08em; text-align: right; }
.seed-name { min-width: 0; align-self: center; display: grid; gap: 5px; cursor: pointer; }
.seed-name strong { overflow-wrap: anywhere; font: 650 19px/1.15 var(--font-display); }
.seed-name > span { overflow-wrap: anywhere; color: var(--muted); font-size: 11px; line-height: 1.25; }
.seed-tile.has-long-name .seed-name strong { font-size: 16px; line-height: 1.12; }
.seed-tile.has-long-name .seed-name > span { font-size: 10px; line-height: 1.18; }
.seed-tile.language-en .seed-name { align-self: start; padding-top: 8px; }
.seed-tile.language-en .seed-name > span { color: var(--paper); font: 650 17px/1.16 var(--font-display); letter-spacing: -.01em; }
.seed-tile.language-en.has-long-name .seed-name > span { font-size: 14px; line-height: 1.12; }
.seed-tile.language-en .seed-category { max-width: 72%; font-size: 8px; line-height: 1.12; }

.seed-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--hairline);
}
.seed-copy-btn, .seed-stage-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--faint);
  font: 700 9px/1 var(--font-display);
  letter-spacing: .06em;
  cursor: pointer;
  transition: all 120ms ease;
}
.seed-copy-btn:hover {
  color: var(--paper);
  border-color: var(--accent);
  background: var(--surface-raised);
}
.seed-stage-btn:hover {
  color: var(--paper);
  border-color: var(--paper);
}
.seed-stage-btn.is-staged {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
}

.load-more { width: 100%; min-height: 54px; margin-top: 18px; border: 1px solid var(--hairline-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--paper); cursor: pointer; }
.load-more span { color: var(--accent); font-variant-numeric: tabular-nums; }

.methodology { display: grid; grid-template-columns: .5fr 1fr 1fr; gap: clamp(24px, 5vw, 72px); padding: 56px clamp(20px, 4vw, 64px); background: var(--surface); border-top: 1px solid var(--hairline); }
.methodology h2 { max-width: 12ch; margin: 0; font: 650 clamp(36px, 5vw, 68px)/.98 var(--font-display); text-wrap: balance; }
.methodology > p { max-width: 64ch; margin: 0; color: var(--muted); text-wrap: pretty; }
.source-links { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.source-links a { min-height: 40px; display: inline-flex; align-items: center; padding: 5px 10px; border: 1px solid var(--hairline-strong); border-radius: var(--radius-pill); color: var(--muted); font-size: 11px; text-decoration: none; }

footer { min-height: 120px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 30px clamp(20px, 4vw, 64px); color: var(--faint); font-size: 12px; }
footer p { margin: 0; }
footer div { display: flex; gap: 20px; }

.toast { position: fixed; z-index: 50; right: 20px; bottom: 20px; max-width: calc(100vw - 40px); padding: 10px 14px; border-radius: var(--radius-sm); background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 700; opacity: 0; transform: translateY(10px); pointer-events: none; transition-property: opacity, transform; transition-duration: 180ms; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

.app-view[hidden] { display: none !important; }

.combiner-view {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: clamp(32px, 5vw, 74px);
  padding: 24px clamp(20px, 4vw, 64px) 72px;
}

.combo-category-panel {
  position: sticky;
  top: 20px;
  align-self: start;
  max-height: calc(100vh - 132px);
  max-height: calc(100dvh - 132px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overscroll-behavior: contain;
}

.combo-stage { min-width: 0; }
.combo-intro { padding: 2px 0 16px; border-bottom: 1px solid var(--hairline-strong); }
.combo-intro h1 {
  max-width: none;
  margin-bottom: 12px;
  font: 650 clamp(42px, 3.8vw, 56px)/.94 var(--font-display);
  letter-spacing: -.025em;
  white-space: nowrap;
}
.combo-intro > p:last-child { max-width: 58ch; margin: 0; color: var(--muted); font-size: 14px; }

.combo-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  padding: 18px 0 14px;
}

.combo-source {
  min-width: 0;
  position: relative;
  padding: 12px 14px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-xs);
  background: var(--surface);
  transition: opacity 160ms ease, border-color 160ms ease;
}

.combo-source.is-disabled { opacity: .34; pointer-events: none; }
.combo-source:focus-within { z-index: 30; }
.source-heading, .source-heading > div, .pin-summary { display: flex; align-items: center; }
.source-heading { justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.source-heading > div { gap: 8px; }
.source-heading b { color: var(--accent); font: 750 14px/1 var(--font-display); }
.source-heading span { color: var(--faint); font-size: 10px; }

.category-picker { position: relative; }
.picker-trigger {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 13px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  background: var(--canvas);
  color: var(--paper);
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease;
}
.picker-trigger:hover { border-color: var(--accent); }
.picker-trigger:disabled { cursor: not-allowed; opacity: 0.5; }
.picker-trigger[aria-expanded="true"] { border-color: var(--accent); }
.picker-current { min-width: 0; display: grid; gap: 3px; }
.picker-current strong { overflow-wrap: anywhere; font-size: 13px; line-height: 1.1; }
.picker-current span { overflow-wrap: anywhere; color: var(--muted); font-size: 10px; line-height: 1.15; }
.picker-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: var(--accent);
  line-height: 1;
  transition: transform 150ms ease;
}
.picker-caret svg {
  display: block;
}
.picker-trigger[aria-expanded="true"] .picker-caret {
  transform: rotate(180deg);
}
.picker-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  left: 0;
  width: min(560px, calc(100vw - 40px));
  padding: 10px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
}
.picker-toolbar { display: grid; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--hairline); }
.picker-toolbar > label { display: block; }
.picker-toolbar input {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-xs);
  outline: 0;
  background: var(--canvas);
  color: var(--paper);
}
.picker-toolbar input::placeholder { color: var(--faint); }
.picker-toolbar input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in oklch, var(--accent) 35%, transparent); }
.picker-sort { display: flex; flex-wrap: wrap; gap: 5px; }
.picker-sort button {
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}
.picker-sort button.is-active { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.picker-options {
  max-height: 310px;
  margin-top: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.picker-group-section {
  display: grid;
}
.picker-group-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  margin: 6px 0 2px;
  background: var(--surface-raised);
  border-bottom: 1px solid var(--hairline-strong);
  border-radius: var(--radius-xs);
  color: var(--paper);
  font-size: 11px;
  font-weight: 700;
}
.picker-group-header small {
  color: var(--faint);
  font-size: 9px;
  font-weight: 400;
  text-transform: uppercase;
  margin-left: 4px;
}
.picker-group-count {
  font-size: 9px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.picker-option {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 8px;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}
.picker-option > span { min-width: 0; display: grid; gap: 3px; }
.picker-option b, .picker-option small { overflow-wrap: anywhere; }
.picker-option b { color: var(--paper); font-size: 12px; line-height: 1.1; }
.picker-option small { color: var(--faint); font-size: 9px; line-height: 1.1; }
.picker-option em { flex: 0 0 auto; color: var(--faint); font-size: 9px; font-style: normal; }
.picker-option.is-selected { background: color-mix(in oklch, var(--accent) 10%, transparent); }
.picker-option.is-selected b, .picker-option.is-selected em { color: var(--accent); }
.picker-option:hover { background: var(--surface); }
.picker-option:focus-visible, .picker-sort button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.combo-select-wrap { display: block; }
.combo-select-wrap select {
  width: 100%;
  min-height: 44px;
  padding: 0 38px 0 13px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  background: var(--canvas);
  color: var(--paper);
}

.pin-summary { justify-content: space-between; gap: 12px; margin-top: 12px; }
.pin-summary > span { color: var(--faint); font-size: 10px; text-align: right; }
.pin-toggle {
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}
.pin-toggle strong { color: var(--accent); font-variant-numeric: tabular-nums; }

.pin-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pin-chips:empty { display: none; }
.pin-chips button, .favorite-chip {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid color-mix(in oklch, var(--accent) 55%, transparent);
  border-radius: var(--radius-xs);
  background: color-mix(in oklch, var(--accent) 9%, var(--canvas));
  color: var(--paper);
  font-size: 10px;
  line-height: 1.25;
}
.pin-chips button { cursor: pointer; }
.pin-chips button span { color: var(--accent); font-size: 9px; }

.pin-panel { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--hairline); }
.pin-panel label { display: block; }
.pin-panel input {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-xs);
  background: var(--canvas);
  color: var(--paper);
  outline: 0;
}
.pin-options {
  max-height: 250px;
  margin-top: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.pin-option {
  width: 100%;
  min-height: 47px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 8px;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}
.pin-option > span { min-width: 0; display: grid; }
.pin-option b { overflow-wrap: anywhere; color: var(--paper); font-size: 11px; }
.pin-option small { overflow-wrap: anywhere; color: var(--faint); font-size: 9px; }
.pin-option em { flex: 0 0 auto; color: var(--faint); font-size: 9px; font-style: normal; }
.pin-option.is-pinned { background: var(--surface-raised); }
.pin-option.is-pinned em { color: var(--accent); }

.combo-actionbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 14px 0 14px;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.mode-toggle, .language-toggle { white-space: nowrap; }
.mode-toggle { display: flex; padding: 3px; border: 1px solid var(--hairline); border-radius: var(--radius-sm); }
.mode-toggle button { min-height: 34px; padding: 0 12px; border: 0; border-radius: 3px; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; }
.mode-toggle button.is-active { background: var(--paper); color: var(--canvas); font-weight: 700; }
.combination-math { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin: 0; color: var(--muted); white-space: nowrap; }
.combination-math span, .combination-math strong { color: var(--paper); font: 750 24px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.combination-math strong { color: var(--accent); }
.combination-math i { color: var(--faint); font-style: normal; }
.combination-math small { color: var(--faint); font-size: 9px; }
.combination-math.is-single #math-b, .combination-math.is-single #math-b + i { display: none; }
.primary-action {
  min-height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.primary-action.is-active-pulse {
  transform: scale(0.96);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.combo-hints {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 6px 12px;
  margin: 6px 0 10px;
  background: color-mix(in oklch, var(--surface) 50%, transparent);
  border: 1px dashed var(--hairline);
  border-radius: var(--radius-xs);
  color: var(--faint);
  font-size: 11px;
}
.hint-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.hint-item kbd {
  background: var(--surface-raised);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-xs);
  padding: 0 5px;
  font: 600 10px/18px var(--font-body);
  color: var(--paper);
}

.combo-results-section { padding-top: 14px; }
.combo-section-heading, .favorites-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.combo-section-heading > div:first-child { display: flex; align-items: baseline; gap: 10px; }
.combo-section-heading h2, .favorites-heading h2, .batch-panel h2 { margin: 0; font: 700 20px/1 var(--font-display); }
.combo-section-heading span { color: var(--faint); font-size: 10px; }
.result-actions, .favorites-heading > div { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 7px; }
.result-actions button, .favorites-heading button, .batch-panel button {
  min-height: 36px;
  padding: 5px 10px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
  transition: all 120ms ease;
}

.format-toggle {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-xs);
  gap: 2px;
}
.format-toggle button {
  min-height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}
.format-toggle button.is-active {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

@keyframes comboRowSlideIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.combo-results { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--hairline); }
.combo-row {
  min-height: 72px;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 6px 0;
  border-bottom: 1px solid var(--hairline);
  animation: comboRowSlideIn 180ms ease-out both;
  transition: background-color 200ms ease, border-color 200ms ease;
}
.combo-row.is-copied-pulse {
  background: color-mix(in oklch, var(--accent) 15%, transparent);
  border-color: var(--hairline-strong);
}
.combo-rank { color: var(--accent); font: 800 24px/1 var(--font-display); font-variant-numeric: tabular-nums; cursor: help; }
.combo-equation { min-width: 0; display: flex; align-items: center; gap: 16px; }
.combo-term { min-width: 0; flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.combo-term-main { display: grid; gap: 2px; }
.combo-term-main strong { color: var(--paper); font: 650 17px/1.15 var(--font-display); overflow-wrap: anywhere; }
.combo-term-main > span { color: var(--muted); font-size: 10px; line-height: 1.25; overflow-wrap: anywhere; }
.combo-equation.language-en .combo-term-main > span { color: var(--paper); font: 650 17px/1.15 var(--font-display); }
.combo-term-meta { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.combo-term-meta small { color: var(--faint); font: 700 8px/1 var(--font-display); letter-spacing: .08em; text-transform: uppercase; }
.direct-pin-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--faint);
  font-size: 9px;
  cursor: pointer;
  line-height: 1;
  transition: all 120ms ease;
}
.direct-pin-btn .pin-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.direct-pin-btn .pin-icon svg {
  display: block;
}
.direct-pin-btn:hover {
  border-color: var(--accent);
  color: var(--paper);
  background: var(--surface-raised);
}
.direct-pin-btn.is-pinned {
  border-color: var(--accent);
  background: color-mix(in oklch, var(--accent) 15%, transparent);
  color: var(--accent);
  font-weight: 700;
}
.combo-plus { flex: 0 0 auto; color: var(--accent); font: 650 22px/1 var(--font-display); }
.combo-row-actions { display: flex; align-items: center; gap: 6px; }
.combo-row-actions button {
  min-height: 34px;
  padding: 4px 9px;
  border: 0;
  border-left: 1px solid var(--hairline);
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}
.combo-row-actions button[aria-pressed="true"] { color: var(--accent); }

.batch-panel {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto auto auto;
  align-items: end;
  gap: 10px;
  margin-top: 26px;
  padding: 18px;
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
}
.batch-panel p:last-child { margin: 7px 0 0; color: var(--faint); font-size: 10px; }
.batch-panel label { display: grid; gap: 6px; color: var(--faint); font-size: 9px; }
.batch-panel select { min-height: 36px; padding: 0 30px 0 10px; border: 1px solid var(--hairline-strong); border-radius: var(--radius-xs); background: var(--canvas); color: var(--paper); }
.batch-panel button:first-of-type { border-color: var(--accent); color: var(--paper); }

.favorites-panel { margin-top: 26px; padding: 18px; border: 1px solid var(--hairline); }
.favorites-heading { align-items: center; }
.favorites-heading h2 span { color: var(--accent); font-variant-numeric: tabular-nums; }
.favorites-heading .quiet-action { border-color: transparent; color: var(--faint); }
.favorite-list { display: flex; flex-wrap: wrap; gap: 7px; padding-top: 12px; border-top: 1px solid var(--hairline); }
.favorite-list > p { margin: 0; color: var(--faint); font-size: 11px; }
.favorite-chip { max-width: 100%; }
.favorite-chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.favorite-chip button { padding: 0; border: 0; background: transparent; color: var(--accent); font-size: 9px; cursor: pointer; }
.empty-note { padding: 24px 8px; color: var(--faint); font-size: 11px; }

/* Staging Basket Floating Bar */
.staging-basket {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  width: min(840px, calc(100vw - 32px));
  background: var(--surface-raised);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--hairline);
  padding: 10px 14px;
  animation: basketSlideUp 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes basketSlideUp {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.staging-basket-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.staging-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}
.staging-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.staging-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  flex: 1;
  min-width: 0;
  padding: 2px 0;
  scrollbar-width: none;
}
.staging-chips::-webkit-scrollbar {
  display: none;
}
.staged-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  background: var(--surface);
  border: 1px solid color-mix(in oklch, var(--accent) 45%, transparent);
  border-radius: var(--radius-xs);
  color: var(--paper);
  font-size: 10.5px;
  white-space: nowrap;
}
.staged-chip button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.staged-chip button:hover {
  color: var(--accent);
}
.staging-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.staging-primary {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  transition: opacity 140ms ease, transform 140ms ease;
}
.staging-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}
.staging-lines-btn {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid color-mix(in oklch, var(--accent) 55%, transparent);
  border-radius: var(--radius-sm);
  background: color-mix(in oklch, var(--accent) 15%, transparent);
  color: var(--paper);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 140ms ease;
}
.staging-lines-btn:hover {
  background: var(--accent);
  color: var(--accent-ink);
  transform: translateY(-1px);
}
.staging-clear {
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  cursor: pointer;
}
.staging-clear:hover {
  color: var(--paper);
  border-color: var(--paper);
}

.not-found { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.not-found main { width: min(760px, 100%); }
.not-found h1 { margin-bottom: 40px; font: 650 clamp(72px, 14vw, 180px)/.82 var(--font-display); }

.back-to-top {
  position: fixed;
  z-index: 45;
  right: 24px;
  bottom: 24px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .28);
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease, border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top-icon {
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

@media (hover: hover) {
  .repo-link:hover, .download-link:hover { opacity: .82; transform: translateY(-2px); }
  .category-button:hover { transform: translateX(3px); color: var(--paper); }
  .seed-tile:hover { transform: translateY(-2px); border-color: var(--accent); background: var(--surface-raised); }
  .source-links a:hover { color: var(--paper); border-color: var(--accent); }
  .view-nav button:hover, .text-button:hover, .pin-toggle:hover, .result-actions button:hover, .favorites-heading button:hover, .batch-panel button:hover { color: var(--paper); border-color: var(--accent); }
  .pin-option:hover { background: var(--surface-raised); }
  .combo-row-actions button:hover { color: var(--paper); }
}

@media (max-width: 820px) {
  .masthead { min-height: 72px; grid-template-columns: 1fr auto; padding: 14px 20px; }
  .brand-mark { font-size: 32px; }
  .view-nav { grid-column: 1 / -1; grid-row: 2; margin: 8px -20px -14px; padding: 7px 20px; border-top: 1px solid var(--hairline); }
  .view-nav button { flex: 1; }
  .masthead-actions { gap: 5px; }
  .theme-toggle { min-width: 42px; padding-inline: 10px; }
  .theme-toggle-label { display: none; }
  .repo-link { min-width: 42px; padding-inline: 11px; font-size: 0; }
  .repo-link span { font-size: 18px; }
  .workspace { display: block; padding: 22px 20px 56px; }
  .category-panel, .combo-category-panel { position: static; max-height: none; margin-bottom: 20px; display: block; overflow: visible; }
  .panel-heading { padding-bottom: 12px; }
  .category-filter { margin: 8px 0 10px; }
  .dimension-tabs {
    flex-wrap: nowrap;
    margin: 0 -20px 10px;
    padding: 2px 20px 6px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .dimension-tabs::-webkit-scrollbar { display: none; }
  .dimension-tab-btn { flex-shrink: 0; min-height: 28px; padding: 3px 10px; font-size: 11px; }
  .category-master-item { flex-shrink: 0; margin-bottom: 0; display: inline-flex; border: 0; background: transparent; }
  .category-button.is-master { min-height: 42px; padding: 6px 14px; border: 1px solid var(--hairline); border-radius: var(--radius-pill); }
  .category-group-section { display: flex; flex-direction: column; flex-shrink: 0; }
  .category-group-header { position: static; padding: 0 4px 6px; background: transparent; border-bottom: 0; }
  .category-group-list { display: flex; gap: 8px; }
  .category-list, .combo-category-panel .category-list {
    display: flex;
    gap: 8px;
    margin: 0 -20px;
    padding: 6px 20px 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(to right, transparent, black 16px, black calc(100% - 16px), transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 16px, black calc(100% - 16px), transparent);
  }
  .category-list::-webkit-scrollbar, .combo-category-panel .category-list::-webkit-scrollbar { display: none; }
  .category-button, .combo-category-panel .category-button { width: auto; min-width: max-content; min-height: 42px; gap: 10px; padding: 6px 12px; border: 1px solid var(--hairline); border-radius: var(--radius-pill); scroll-snap-align: start; }
  .category-button small, .combo-category-panel .category-button small { display: none; }
  .category-button.is-active, .combo-category-panel .category-button.is-active { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
  .category-button.is-active b, .category-button.is-active em, .combo-category-panel .category-button.is-active b, .combo-category-panel .category-button.is-active em { color: var(--accent-ink); }
  .toolbar { margin: 0 -20px 24px; padding: 10px 20px 12px; }
  .toolbar-row { flex-wrap: wrap; }
  .select-wrap { min-width: 120px; }
  .toolbar-row .download-link { flex: 1; justify-content: center; }
  .result-heading { flex-direction: column; align-items: stretch; gap: 14px; }
  .result-heading h2 { font-size: 36px; }
  .library-batch-bar { width: 100%; justify-content: space-between; }
  .methodology { grid-template-columns: 1fr; padding: 64px 20px; }
  .methodology h2 { max-width: 11ch; }
  .source-links { grid-column: auto; }
  footer { align-items: flex-start; }
  .combiner-view { display: block; padding: 22px 20px 56px; }
  .combo-intro h1 { font-size: 48px; white-space: normal; }
  .combo-actionbar { grid-template-columns: 1fr; align-items: stretch; }
  .mode-toggle button { flex: 1; }
  .combination-math { justify-content: flex-start; }
  .primary-action { width: 100%; }
  .batch-panel { grid-template-columns: 1fr 1fr; }
  .batch-panel > div { grid-column: 1 / -1; }
  .back-to-top { right: 16px; bottom: 16px; height: 36px; padding: 0 12px; font-size: 11px; }
}

@media (max-width: 420px) {
  .stats { gap: 18px; }
  .toolbar-row { align-items: stretch; }
  .select-wrap { width: 100%; flex-basis: 100%; }
  .language-toggle { flex: 1; }
  .language-toggle button { flex: 1; min-width: 0; }
  .result-heading { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
  .library-batch-bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .quick-select-group, .quick-copy-group { width: 100%; }
  .batch-btn { flex: 1; text-align: center; }
  .seed-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .seed-tile { padding: 11px; }
  .seed-name strong { font-size: 17px; }
  footer { display: grid; }
  .combo-controls { grid-template-columns: 1fr; }
  .combo-intro h1 { font-size: 42px; }
  .combo-section-heading, .favorites-heading { align-items: flex-start; }
  .combo-section-heading { display: grid; }
  .result-actions, .favorites-heading > div { justify-content: flex-start; }
  .combo-row { grid-template-columns: 38px minmax(0, 1fr); gap: 9px; padding: 12px 0; }
  .combo-rank { font-size: 19px; align-self: start; padding-top: 4px; }
  .combo-equation { display: grid; gap: 5px; }
  .combo-plus { display: none; }
  .combo-term { padding: 5px 0; border-bottom: 1px solid var(--hairline); }
  .combo-term:last-of-type { border-bottom: 0; }
  .combo-row-actions { grid-column: 2; justify-content: flex-start; }
  .combo-row-actions button:first-child { border-left: 0; padding-left: 0; }
  .batch-panel { grid-template-columns: 1fr; }
  .batch-panel > div { grid-column: auto; }
  .batch-panel button { width: 100%; }
  .favorites-heading { display: grid; }
  .favorite-chip { width: 100%; justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
