:root {
  --bg: #f3f3f0;
  --surface: #fff;
  --surface-soft: #e9e9e4;
  --text: #171715;
  --muted: #6c6c66;
  --line: #d5d5cf;
  --line-strong: #aaa9a1;
  --red: #df3b2e;
  --blue: #2459d3;
  --green: #2f7f62;
  --yellow: #f0cf38;
  --focus: #2459d3;
  --control-border: #c4c4bd;
  --control-hover: #888880;
  --control-fill: #fbfbf9;
  --radius-sm: 4px;
  --radius-md: 8px;
  --shadow: 0 20px 60px rgb(20 20 17 / 18%);
  --header-height: 72px;
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
  letter-spacing: 0;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus), transparent 52%);
  outline-offset: 2px;
}

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

.app-shell {
  min-height: 100vh;
}

.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  align-items: center;
  min-height: var(--header-height);
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgb(243 243 240 / 94%);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: block;
  width: 34px;
  height: 34px;
  margin-right: 11px;
  border: 1px solid var(--text);
  background: var(--surface);
  overflow: hidden;
}

.brand-mark i {
  position: absolute;
  display: block;
}

.brand-mark i:nth-child(1) {
  width: 16px;
  height: 16px;
  left: 3px;
  top: 4px;
  border-radius: 50%;
  background: var(--red);
}

.brand-mark i:nth-child(2) {
  width: 17px;
  height: 17px;
  right: 2px;
  bottom: 3px;
  background: var(--blue);
  transform: rotate(18deg);
}

.brand-mark i:nth-child(3) {
  width: 26px;
  height: 2px;
  left: 4px;
  top: 20px;
  background: var(--text);
  transform: rotate(-25deg);
}

.brand b,
.brand small {
  display: block;
}

.brand b {
  font-family: Georgia, "Songti SC", serif;
  font-size: 18px;
  font-weight: 600;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.nav-item,
.output-tabs button,
.segmented button {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.primary-nav .nav-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.nav-item:hover,
.output-tabs button:hover,
.segmented button:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.nav-item.is-active,
.output-tabs button.is-active,
.segmented button.is-active {
  color: var(--surface);
  background: var(--text);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
}

.atlas-header-actions {
  display: flex;
  gap: 8px;
}

.local-edition-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid var(--text);
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--surface);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.local-edition-link:hover {
  border-color: var(--blue);
  background: var(--blue);
}

.local-edition-link svg {
  width: 16px;
  height: 16px;
}

.icon-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.header-actions .icon-button.is-active {
  border-color: var(--text);
  background: var(--text);
  color: var(--surface);
}

.icon-button svg,
.primary-button svg,
.secondary-button svg {
  width: 18px;
  height: 18px;
}

.action-count {
  position: absolute;
  right: -5px;
  top: -6px;
  display: grid;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  place-items: center;
  border: 2px solid var(--bg);
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.page-band {
  padding-right: max(32px, calc((100vw - 1500px) / 2));
  padding-left: max(32px, calc((100vw - 1500px) / 2));
}

.atlas-heading,
.dictionary-header,
.timeline-header,
.prompt-header,
.mixer-header {
  padding-top: 46px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.page-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.eyebrow,
.drawer-kicker {
  margin-bottom: 10px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin-bottom: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 36px;
  font-weight: 600;
  line-height: 1.22;
}

h2 {
  font-size: 18px;
  line-height: 1.35;
}

h3 {
  font-size: 15px;
  line-height: 1.4;
}

.result-stat {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.result-stat strong {
  color: var(--text);
  font-size: 22px;
}

.search-box {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  width: min(820px, 100%);
  min-height: 54px;
  margin-top: 28px;
  padding: 0 14px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-md);
  background: var(--control-fill);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 80%), 0 1px 2px rgb(20 20 17 / 4%);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.search-box:hover {
  border-color: var(--control-hover);
  background: var(--surface);
}

.search-box:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgb(36 89 211 / 14%);
}

.search-box svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.search-box input {
  width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0 12px;
  border: 0;
  outline: 0;
  background: transparent;
}

.search-box kbd {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
}

.quick-filters,
.active-filters,
.gene-list,
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-filters {
  margin-top: 16px;
  align-items: center;
}

.quick-filter-label {
  color: var(--muted);
  font-size: 12px;
}

.chip,
.filter-chip,
.active-filter,
.gene-chip,
.relation-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
}

button.chip:hover,
.filter-chip:hover,
.relation-chip:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.chip.is-active,
.filter-chip.is-active {
  border-color: var(--text);
  background: var(--text);
  color: var(--surface);
}

.atlas-layout {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  align-items: start;
  gap: 36px;
  padding-top: 30px;
  padding-bottom: 72px;
}

.filter-panel {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  max-height: calc(100vh - var(--header-height) - 48px);
  max-height: calc(100dvh - var(--header-height) - 48px);
  padding-right: 10px;
  overflow-y: auto;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
  scrollbar-gutter: stable;
}

.filter-heading,
.field-label-row,
.output-heading,
.drawer-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.filter-heading {
  position: sticky;
  z-index: 2;
  top: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.filter-heading h2 {
  margin: 0;
}

.text-button {
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 12px;
  font-weight: 650;
}

.text-button:disabled {
  color: var(--line-strong);
  cursor: default;
}

.filter-group {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.filter-group h3 {
  margin-bottom: 10px;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.filter-option {
  position: relative;
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  min-height: 32px;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.filter-option:hover {
  color: var(--text);
}

.filter-option input {
  position: absolute;
  left: 0;
  top: 50%;
  width: 18px;
  height: 18px;
  margin: 0;
  opacity: 0;
  transform: translateY(-50%);
}

.checkbox-mark {
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border: 1px solid var(--control-border);
  border-radius: 4px;
  background: var(--surface);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 80%);
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.checkbox-mark svg {
  width: 12px;
  height: 12px;
  color: white;
  opacity: 0;
  transform: scale(.7);
  transition: opacity 120ms ease, transform 120ms ease;
}

.filter-option:hover .checkbox-mark {
  border-color: var(--control-hover);
}

.filter-option input:checked + .checkbox-mark {
  border-color: var(--text);
  background: var(--text);
  box-shadow: 0 0 0 1px var(--text);
}

.filter-option input:checked + .checkbox-mark svg {
  opacity: 1;
  transform: scale(1);
}

.filter-option input:focus-visible + .checkbox-mark {
  outline: 3px solid color-mix(in srgb, var(--focus), transparent 52%);
  outline-offset: 2px;
}

.filter-option output {
  color: var(--line-strong);
}

.catalog-toolbar {
  display: flex;
  min-height: 42px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.active-filter {
  gap: 6px;
  min-height: 30px;
  background: var(--surface-soft);
  color: var(--text);
}

.active-filter svg {
  width: 13px;
  height: 13px;
}

.mobile-filter-button {
  display: none;
}

.style-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px 18px;
}

.style-card {
  position: relative;
  min-width: 0;
  content-visibility: auto;
  contain-intrinsic-size: auto 360px;
}

.style-card-main {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  text-decoration: none;
}

.style-card-main:hover .style-visual {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgb(20 20 17 / 12%);
}

.style-card-main:focus-visible .style-visual {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.style-visual,
.detail-visual,
.selected-style-visual,
.timeline-node-visual {
  position: relative;
  display: block;
  overflow: hidden;
  isolation: isolate;
  background-color: var(--surface-soft);
}

.has-artwork::before,
.has-artwork::after {
  display: none;
}

.has-artwork {
  background: #e8e8e3;
}

.has-artwork img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.has-artwork picture {
  display: block;
  width: 100%;
  height: 100%;
}

.artwork-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8e8e3;
  color: #7a7a72;
  font-size: 12px;
  line-height: 1;
}

.artwork-placeholder::before,
.artwork-placeholder::after {
  display: none;
}

.detail-visual.has-artwork img {
  object-position: center;
}

.style-visual {
  aspect-ratio: 4 / 3;
  width: 100%;
  border: 1px solid rgb(23 23 21 / 15%);
  border-radius: var(--radius-sm);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.style-visual::before,
.style-visual::after,
.detail-visual::before,
.detail-visual::after,
.selected-style-visual::before,
.selected-style-visual::after,
.timeline-node-visual::before,
.timeline-node-visual::after {
  position: absolute;
  content: "";
}

.art-shape {
  position: absolute;
  z-index: 2;
  display: block;
}

.card-tools {
  position: absolute;
  z-index: 5;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 5px;
  opacity: 0;
  transition: opacity 160ms ease;
}

.style-card:hover .card-tools,
.style-card:focus-within .card-tools,
.card-tools.has-active {
  opacity: 1;
}

.card-tools .icon-button {
  width: 36px;
  height: 36px;
  border-color: rgb(23 23 21 / 18%);
  box-shadow: 0 2px 8px rgb(20 20 17 / 12%);
}

.card-tools .icon-button.is-active {
  border-color: var(--text);
  background: var(--text);
  color: var(--surface);
}

.style-meta {
  display: block;
  padding-top: 12px;
}

.style-name-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.style-card-title {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 18px;
  font-weight: 700;
}

.style-name-row span,
.style-period {
  color: var(--muted);
  font-size: 11px;
}

.style-en {
  display: block;
  margin: 2px 0 8px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.style-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.style-tags span {
  padding: 3px 6px;
  border-radius: 3px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
}

.empty-state {
  padding: 100px 20px;
  text-align: center;
}

.empty-state svg {
  width: 36px;
  height: 36px;
  color: var(--line-strong);
}

.empty-state h2 {
  margin: 16px 0 24px;
}

.vocabulary-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.vocabulary-filter {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.vocabulary-filter:not(:first-child)::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--vocabulary-color);
  content: "";
}

.vocabulary-filter span {
  color: var(--line-strong);
  font-size: 10px;
}

.vocabulary-filter:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.vocabulary-filter.is-active {
  border-color: var(--text);
  background: var(--text);
  color: var(--surface);
}

.vocabulary-filter.is-active span {
  color: rgb(255 255 255 / 62%);
}

.dictionary-catalog {
  padding-top: 38px;
  padding-bottom: 72px;
}

.vocabulary-groups {
  display: flex;
  flex-direction: column;
  gap: 52px;
}

.vocabulary-group-heading {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 15px;
  border-bottom: 2px solid color-mix(in srgb, var(--vocabulary-color), white 58%);
}

.vocabulary-group-heading h2,
.vocabulary-group-heading p {
  margin-bottom: 0;
}

.vocabulary-group-heading h2 {
  font-size: 17px;
}

.vocabulary-group-heading p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.vocabulary-group-heading > span:last-child {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.vocabulary-group-icon {
  display: grid;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--vocabulary-color), white 84%);
  color: color-mix(in srgb, var(--vocabulary-color), black 12%);
  place-items: center;
}

.vocabulary-group-icon svg {
  width: 21px;
  height: 21px;
}

.vocabulary-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--surface);
  scrollbar-color: var(--line-strong) transparent;
}

.vocabulary-table-wrap:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus), transparent 52%);
  outline-offset: 2px;
}

.vocabulary-table {
  width: 100%;
  min-width: 1580px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.vocabulary-table .term-column {
  width: 230px;
}

.vocabulary-table .mechanism-column {
  width: 330px;
}

.vocabulary-table .boundary-column {
  width: 280px;
}

.vocabulary-table .description-column {
  width: 300px;
}

.vocabulary-table th,
.vocabulary-table td {
  padding: 15px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: top;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.68;
}

.vocabulary-table tr > :last-child {
  border-right: 0;
}

.vocabulary-table tbody tr:last-child > * {
  border-bottom: 0;
}

.vocabulary-table thead th {
  position: sticky;
  z-index: 2;
  top: var(--header-height);
  background: #ededE8;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.vocabulary-table tbody tr:hover > * {
  background: #fafaf7;
}

.vocabulary-table .vocabulary-term-cell {
  position: sticky;
  z-index: 1;
  left: 0;
  background: var(--surface);
}

.vocabulary-table thead th:first-child {
  z-index: 3;
  left: 0;
}

.vocabulary-term-heading {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
}

.vocabulary-index {
  display: grid;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--vocabulary-color), white 87%);
  color: color-mix(in srgb, var(--vocabulary-color), black 14%);
  font-size: 10px;
  font-weight: 800;
  place-items: center;
}

.vocabulary-term-heading strong,
.vocabulary-term-heading span,
.vocabulary-family {
  display: block;
}

.vocabulary-term-heading strong {
  font-size: 14px;
  line-height: 1.45;
}

.vocabulary-term-heading span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.vocabulary-term-cell > p {
  margin: 14px 0 10px;
  color: #4d4d48;
}

.vocabulary-family,
.vocabulary-controls span {
  color: color-mix(in srgb, var(--vocabulary-color), black 18%);
  font-size: 9px;
  font-weight: 750;
  text-transform: uppercase;
}

.vocabulary-table td > p,
.vocabulary-description p {
  margin: 0;
}

.vocabulary-controls {
  margin-top: 12px;
  padding: 10px;
  border-left: 2px solid var(--vocabulary-color);
  background: color-mix(in srgb, var(--vocabulary-color), white 94%);
}

.vocabulary-controls span {
  display: block;
  margin-bottom: 4px;
}

.vocabulary-description p + p {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.vocabulary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.vocabulary-card {
  display: flex;
  min-width: 0;
  min-height: 152px;
  flex-direction: column;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.vocabulary-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 8px 22px rgb(20 20 17 / 7%);
  transform: translateY(-1px);
}

.vocabulary-card:focus-visible {
  outline-offset: 2px;
}

.vocabulary-card-heading {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
}

.vocabulary-card-heading strong,
.vocabulary-card-heading > span:last-child > span,
.vocabulary-definition {
  display: block;
}

.vocabulary-card-heading strong {
  font-size: 15px;
  line-height: 1.4;
}

.vocabulary-card-heading > span:last-child > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.vocabulary-definition {
  margin-top: 15px;
  color: #4d4d48;
  font-size: 12px;
  line-height: 1.65;
}

.vocabulary-empty {
  padding-top: 72px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  gap: 8px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
}

.primary-button {
  border: 1px solid var(--text);
  background: var(--text);
  color: var(--surface);
}

.primary-button:hover {
  background: #33332f;
}

.primary-button:disabled {
  border-color: var(--line);
  background: var(--line);
  color: var(--muted);
  cursor: default;
}

.secondary-button {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

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

/* Original style specimens. They demonstrate visual grammar and are not historical artworks. */
.art-ink {
  background:
    radial-gradient(ellipse at 38% 62%, rgb(30 30 28 / 88%) 0 3%, transparent 4%),
    radial-gradient(ellipse at 48% 58%, rgb(30 30 28 / 62%) 0 6%, transparent 7%),
    radial-gradient(ellipse at 60% 53%, rgb(30 30 28 / 28%) 0 10%, transparent 11%),
    linear-gradient(104deg, transparent 40%, rgb(35 35 32 / 70%) 41% 43%, transparent 44%),
    #ddd9cd;
}

.art-ink::before {
  width: 8%;
  height: 45%;
  left: 72%;
  top: 18%;
  border-radius: 50%;
  background: #222220;
  transform: rotate(-28deg);
  filter: blur(1px);
}

.art-ink::after {
  width: 11%;
  height: 11%;
  right: 9%;
  bottom: 11%;
  background: #a14b37;
}

.art-islamic {
  background-color: #155c6d;
  background-image:
    conic-gradient(from 45deg at 25% 25%, transparent 0 12.5%, #d6a84c 0 25%, transparent 0 50%, #d6a84c 0 62.5%, transparent 0 100%),
    conic-gradient(from 45deg at 75% 75%, transparent 0 12.5%, #9f3f35 0 25%, transparent 0 50%, #9f3f35 0 62.5%, transparent 0 100%);
  background-size: 52px 52px;
}

.art-islamic::before {
  inset: 11%;
  border: 6px double rgb(255 255 255 / 72%);
  transform: rotate(45deg);
}

.art-renaissance {
  background: radial-gradient(circle at 50% 34%, #d9bd83 0 7%, transparent 7.5%), linear-gradient(135deg, #294861 0 46%, #9a4f37 46% 72%, #c5a568 72%);
}

.art-renaissance::before {
  width: 32%;
  height: 46%;
  left: 34%;
  bottom: 14%;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: #292821;
  box-shadow: 0 0 0 7px rgb(255 255 255 / 13%);
}

.art-renaissance::after {
  width: 70%;
  height: 1px;
  left: 15%;
  top: 50%;
  background: rgb(255 255 255 / 45%);
}

.art-baroque {
  background: radial-gradient(circle at 38% 35%, #e4bd64 0 8%, #8d382c 22%, #25191a 48%, #111 78%);
}

.art-baroque::before {
  width: 70%;
  height: 130%;
  left: 34%;
  top: -22%;
  border: 17px solid rgb(196 155 75 / 62%);
  border-radius: 50%;
  transform: rotate(28deg);
}

.art-baroque::after {
  width: 50%;
  height: 12%;
  left: 9%;
  bottom: 19%;
  background: #842822;
  transform: rotate(-18deg);
  box-shadow: 18px -23px 0 rgb(255 255 255 / 12%);
}

.art-ukiyo {
  background: radial-gradient(circle at 72% 22%, #d6533c 0 10%, transparent 10.5%), linear-gradient(#e8d8b8 0 66%, #a9c3c5 66%);
}

.art-ukiyo::before {
  width: 83%;
  height: 65%;
  left: -16%;
  bottom: -26%;
  border: 12px solid #1b4b6c;
  border-radius: 50%;
  box-shadow: 15px -15px 0 -8px #e8d8b8, 30px -29px 0 -14px #1b4b6c, 43px -40px 0 -20px #e8d8b8, 57px -51px 0 -26px #1b4b6c;
  transform: rotate(-11deg);
}

.art-ukiyo::after {
  width: 50%;
  height: 42%;
  right: -18%;
  bottom: 5%;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: #446b73;
}

.art-impressionism {
  background:
    repeating-linear-gradient(165deg, transparent 0 8px, rgb(255 255 255 / 20%) 9px 12px),
    linear-gradient(155deg, #80a8c9 0 28%, #d4d1a0 28% 38%, #709671 38% 61%, #c79c65 61% 100%);
}

.art-impressionism::before {
  width: 120%;
  height: 34%;
  left: -10%;
  bottom: 9%;
  background: repeating-linear-gradient(173deg, #6d7b9e 0 8px, #a2b27e 8px 15px, #d4b86c 15px 22px, #8199a4 22px 30px);
  filter: blur(2px);
  opacity: .78;
}

.art-impressionism::after {
  width: 8%;
  height: 22%;
  left: 58%;
  top: 43%;
  border-radius: 50% 50% 10% 10%;
  background: #343a4a;
  filter: blur(1px);
}

.art-nouveau {
  background: #e1c98c;
}

.art-nouveau::before {
  width: 70%;
  height: 112%;
  left: 14%;
  top: -22%;
  border: 8px double #5f7550;
  border-radius: 48% 52% 44% 56%;
  transform: rotate(11deg);
  box-shadow: inset 0 0 0 12px rgb(185 108 73 / 62%);
}

.art-nouveau::after {
  width: 18%;
  height: 76%;
  right: 17%;
  bottom: -22%;
  border: 7px solid #684833;
  border-left-color: transparent;
  border-radius: 50%;
  transform: rotate(-34deg);
}

.art-constructivism {
  background: linear-gradient(126deg, #e7dfca 0 43%, #df2e24 43% 63%, #171715 63% 76%, #e7dfca 76%);
}

.art-constructivism::before {
  width: 43%;
  height: 43%;
  right: 10%;
  top: 9%;
  border: 12px solid #171715;
  border-radius: 50%;
}

.art-constructivism::after {
  width: 58%;
  height: 8%;
  left: 3%;
  bottom: 21%;
  background: #171715;
  transform: rotate(-24deg);
  box-shadow: 0 15px 0 #df2e24;
}

.art-bauhaus {
  background: #ecebe5;
}

.art-bauhaus::before {
  width: 42%;
  height: 58%;
  left: 9%;
  top: 21%;
  background: #2459a9;
  box-shadow: 111px -31px 0 -10px #efbd2f;
}

.art-bauhaus::after {
  width: 34%;
  aspect-ratio: 1;
  right: 12%;
  bottom: 11%;
  border-radius: 50%;
  background: #d93a2f;
  box-shadow: -76px -57px 0 -24px #171715;
}

.art-surrealism {
  background: linear-gradient(#799fbf 0 56%, #cfb17b 56% 100%);
}

.art-surrealism::before {
  width: 34%;
  height: 50%;
  left: 33%;
  top: 12%;
  border-radius: 50% 50% 43% 57%;
  background: #e3c95f;
  transform: rotate(22deg) skew(-9deg);
  box-shadow: 32px 35px 18px rgb(27 35 44 / 22%);
}

.art-surrealism::after {
  width: 14%;
  height: 20%;
  right: 18%;
  bottom: 15%;
  background: #9e514a;
  transform: rotate(45deg);
}

.art-swiss {
  background-color: #f2f2ef;
  background-image: linear-gradient(90deg, rgb(23 23 21 / 8%) 1px, transparent 1px), linear-gradient(rgb(23 23 21 / 8%) 1px, transparent 1px);
  background-size: 25% 25%;
}

.art-swiss::before {
  width: 37%;
  aspect-ratio: 1;
  left: 10%;
  bottom: 12%;
  border-radius: 50%;
  background: #e04435;
}

.art-swiss::after {
  width: 38%;
  height: 52%;
  right: 9%;
  top: 14%;
  border-top: 13px solid #171715;
  border-bottom: 5px solid #171715;
  background: repeating-linear-gradient(#171715 0 4px, transparent 4px 14px);
}

.art-pop {
  background-color: #f2d43d;
  background-image: radial-gradient(#d42c25 1.8px, transparent 2px);
  background-size: 11px 11px;
}

.art-pop::before {
  width: 58%;
  height: 58%;
  left: 21%;
  top: 20%;
  border: 9px solid #171715;
  border-radius: 50%;
  background: #f5f2e8;
  box-shadow: 12px 11px 0 #1f65c1;
}

.art-pop::after {
  width: 54%;
  height: 19%;
  left: 23%;
  top: 41%;
  background: #f13b2d;
  clip-path: polygon(0 35%, 22% 0, 40% 28%, 61% 0, 100% 35%, 86% 100%, 59% 74%, 32% 100%, 12% 73%);
}

.art-memphis {
  background-color: #f1e9df;
  background-image: radial-gradient(#171715 1.5px, transparent 1.5px);
  background-position: 0 0;
  background-size: 16px 16px;
}

.art-memphis::before {
  width: 41%;
  height: 33%;
  left: 10%;
  top: 12%;
  background: #ec4c81;
  transform: rotate(-9deg);
  box-shadow: 105px 59px 0 #28a99a;
}

.art-memphis::after {
  width: 48%;
  height: 18%;
  right: 6%;
  bottom: 14%;
  border: 7px solid #171715;
  border-top: 0;
  border-radius: 0 0 50% 50%;
  transform: rotate(12deg);
  box-shadow: -109px -18px 0 -4px #f2cc34;
}

.art-brutalism {
  border-color: #171715;
  background-color: #f0ef3d;
  background-image: linear-gradient(90deg, #171715 2px, transparent 2px), linear-gradient(#171715 2px, transparent 2px);
  background-size: 25% 33.333%;
}

.art-brutalism::before {
  width: 56%;
  height: 30%;
  left: 7%;
  top: 13%;
  border: 6px solid #171715;
  background: #f7f7f4;
  box-shadow: 9px 9px 0 #171715;
}

.art-brutalism::after {
  width: 31%;
  height: 39%;
  right: 7%;
  bottom: 9%;
  border: 6px solid #171715;
  background: #df3b2e;
}

.art-y2k {
  background: linear-gradient(135deg, #eaf3f2 0, #8fd3db 32%, #b9c7d6 52%, #c8ee52 100%);
}

.art-y2k::before {
  width: 54%;
  height: 55%;
  left: 23%;
  top: 20%;
  border: 5px solid rgb(255 255 255 / 72%);
  border-radius: 47% 53% 62% 38%;
  background: linear-gradient(145deg, #f7f7f4 5%, #71889c 44%, #ffffff 58%, #8aa0b1 78%);
  box-shadow: inset -14px -11px 20px rgb(44 60 77 / 35%), 14px 16px 30px rgb(41 79 94 / 25%);
  transform: rotate(-16deg);
}

.art-y2k::after {
  width: 86%;
  height: 50%;
  left: 7%;
  top: 25%;
  border: 4px solid rgb(255 255 255 / 70%);
  border-radius: 50%;
  transform: rotate(18deg);
}

.timeline-header {
  padding-bottom: 38px;
}

.timeline-legend {
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-size: 11px;
}

.timeline-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
}

.legend-line {
  width: 20px;
  height: 1px;
  background: var(--line-strong);
}

.legend-axis {
  width: 1px;
  height: 14px;
  background: var(--line-strong);
}

.timeline-explorer {
  padding-top: 24px;
  padding-bottom: 42px;
}

.timeline-toolbar {
  display: flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  gap: 8px;
  margin-bottom: 18px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: 0 5px 18px rgb(20 20 17 / 7%);
}

.timeline-toolbar .icon-button {
  width: 36px;
  height: 36px;
}

.timeline-toolbar input[type="range"] {
  width: clamp(110px, 16vw, 210px);
  height: 20px;
  appearance: none;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--text) 0 var(--range-progress, 0%), var(--surface-soft) var(--range-progress, 0%) 100%);
  cursor: pointer;
}

.timeline-toolbar input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  appearance: none;
  border: 4px solid var(--surface);
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 0 1px var(--text), 0 2px 6px rgb(20 20 17 / 18%);
}

.timeline-toolbar input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 4px solid var(--surface);
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 0 1px var(--text), 0 2px 6px rgb(20 20 17 / 18%);
}

.timeline-toolbar input[type="range"]::-moz-range-track {
  height: 20px;
  border-radius: 10px;
  background: transparent;
}

.timeline-toolbar output {
  min-width: 44px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.timeline-toolbar .secondary-button {
  min-height: 36px;
}

.timeline-viewport {
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: var(--radius-sm);
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  background: color-mix(in srgb, var(--bg), white 28%);
  cursor: grab;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
  touch-action: pan-y pinch-zoom;
}

.timeline-viewport:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus), transparent 52%);
  outline-offset: 2px;
}

.timeline-viewport.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.timeline-explorer {
  --timeline-region-width: 168px;
}

.timeline-canvas {
  position: relative;
  width: calc(var(--timeline-region-width) + var(--timeline-track-width, 2400px));
  min-width: 100%;
}

.timeline-lanes {
  position: relative;
  z-index: 2;
  width: calc(var(--timeline-region-width) + var(--timeline-track-width, 2400px));
}

.timeline-sticky-axis {
  position: sticky;
  z-index: 20;
  top: var(--header-height);
  display: grid;
  grid-template-columns: var(--timeline-region-width) minmax(0, 1fr);
  width: 100%;
  height: 64px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: rgb(243 243 240 / 97%);
  box-shadow: 0 8px 16px rgb(20 20 17 / 5%);
  backdrop-filter: blur(14px);
}

.timeline-axis-corner {
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border-right: 1px solid var(--line-strong);
  background: var(--surface-soft);
}

.timeline-axis-window {
  min-width: 0;
  overflow: hidden;
}

.timeline-axis-corner span {
  color: var(--muted);
  font-size: 9px;
}

.timeline-axis-corner strong {
  margin-top: 3px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 13px;
}

.timeline-axis {
  position: relative;
  width: var(--timeline-track-width, 2400px);
  height: 64px;
  overflow: hidden;
  will-change: transform;
}

.timeline-era {
  position: absolute;
  top: 0;
  display: flex;
  align-items: center;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border-right: 1px solid var(--line);
  background: rgb(255 255 255 / 42%);
  overflow: hidden;
  white-space: nowrap;
}

.timeline-era:nth-child(even) {
  background: rgb(222 222 216 / 34%);
}

.timeline-era strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
}

.timeline-era small {
  margin-left: 6px;
  color: var(--muted);
  font-size: 8px;
}

.axis-label {
  position: absolute;
  bottom: 8px;
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transform: translateX(-50%);
}

.timeline-grid {
  position: absolute;
  z-index: 1;
  top: 0;
  bottom: 0;
  left: var(--timeline-region-width);
  width: var(--timeline-track-width, 2400px);
  pointer-events: none;
}

.timeline-lane {
  display: grid;
  grid-template-columns: var(--timeline-region-width) var(--timeline-track-width, 2400px);
  min-height: var(--lane-height, 104px);
  border-bottom: 1px solid var(--line);
}

.timeline-lane:nth-child(even) .lane-track {
  background: rgb(255 255 255 / 23%);
}

.lane-label {
  position: sticky;
  z-index: 7;
  left: 0;
  display: flex;
  justify-content: flex-start;
  flex-direction: column;
  align-self: stretch;
  padding: 22px 14px;
  border-right: 1px solid var(--line);
  background: rgb(243 243 240 / 94%);
  box-shadow: 10px 0 18px rgb(20 20 17 / 5%);
}

.lane-label strong {
  font-family: Georgia, "Songti SC", serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.lane-label span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.lane-track {
  position: relative;
  width: var(--timeline-track-width, 2400px);
}

.lane-track::before {
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: 16px;
  left: 0;
  height: 1px;
  background: var(--line-strong);
  content: "";
}

.timeline-marker {
  position: absolute;
  z-index: 4;
  bottom: 12px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 1px var(--red);
  transform: translateX(-50%);
}

.timeline-node {
  position: absolute;
  z-index: 2;
  top: var(--node-top);
  width: 116px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  transform: translateX(-50%);
}

.timeline-node::after {
  position: absolute;
  z-index: -1;
  top: 82px;
  left: 50%;
  width: 1px;
  height: var(--connector-height, 12px);
  background: var(--line-strong);
  content: "";
  pointer-events: none;
}

.timeline-node-visual {
  width: 56px;
  height: 56px;
  margin: 0 auto 8px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.timeline-node-visual.artwork-placeholder {
  padding: 4px;
  font-size: 8px;
  line-height: 1.2;
  text-align: center;
}

.timeline-node:hover .timeline-node-visual,
.timeline-node:focus-visible .timeline-node-visual {
  border-color: var(--text);
  box-shadow: 0 7px 16px rgb(20 20 17 / 16%);
  transform: translateY(-3px);
}

.timeline-node:focus-visible {
  outline: 0;
}

.timeline-node strong,
.timeline-node small {
  display: block;
  text-align: center;
}

.timeline-node strong {
  font-size: 11px;
  line-height: 1.35;
}

.timeline-node small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.timeline-note {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 22px;
  padding-bottom: 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.timeline-note > span {
  margin-right: 8px;
}

.timeline-note svg {
  width: 15px;
  height: 15px;
}

.relation-chip {
  min-height: 30px;
  color: var(--text);
}

.prompt-layout {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(420px, 1.1fr);
  gap: 56px;
  padding-top: 38px;
  padding-bottom: 72px;
}

.prompt-config {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.field-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field-group > label,
.field-group legend,
.field-label-row label {
  display: block;
  margin-bottom: 9px;
  font-size: 12px;
  font-weight: 700;
}

.field-label-row label {
  margin-bottom: 0;
}

.field-label-row {
  min-height: 30px;
  margin-bottom: 8px;
}

.field-label-row span {
  color: var(--muted);
  font-size: 11px;
}

.field-group input:not([type="color"]),
.field-group select {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--control-border);
  border-radius: 6px;
  background: var(--control-fill);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 85%), 0 1px 2px rgb(20 20 17 / 4%);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.field-group input:not([type="color"]):hover,
.field-group select:hover {
  border-color: var(--control-hover);
  background: var(--surface);
}

.field-group input:not([type="color"]):focus,
.field-group select:focus {
  border-color: var(--focus);
  outline: 0;
  background: var(--surface);
  box-shadow: 0 0 0 3px rgb(36 89 211 / 13%);
}

.select-control {
  position: relative;
  display: block;
}

.select-control select {
  appearance: none;
  padding-right: 38px;
  cursor: pointer;
}

.select-control > svg {
  position: absolute;
  right: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.prompt-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.control-field {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.control-field > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.control-field.has-value > span:first-child {
  color: var(--blue);
}

.control-field.has-value select {
  border-color: color-mix(in srgb, var(--blue), white 54%);
  background: color-mix(in srgb, var(--blue), white 96%);
}

.control-field select {
  min-width: 0;
  font-size: 13px;
}

.segmented,
.output-tabs {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  box-shadow: inset 0 1px 2px rgb(20 20 17 / 5%);
}

.segmented button,
.output-tabs button {
  border-radius: 5px;
}

.segmented button.is-active,
.output-tabs button.is-active {
  box-shadow: 0 2px 7px rgb(20 20 17 / 18%);
}

.selected-style {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 84px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.selected-style-visual {
  width: 92px;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 3px;
}

.selected-style strong,
.selected-style small {
  display: block;
}

.selected-style small {
  margin-top: 4px;
  color: var(--muted);
}

.gene-groups {
  display: grid;
  gap: 16px;
}

.gene-group {
  min-width: 0;
}

.gene-group + .gene-group {
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.gene-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.gene-group-heading strong {
  font-size: 11px;
}

.gene-group-heading span {
  color: var(--muted);
  font-size: 10px;
}

.gene-chip {
  gap: 8px;
  max-width: 100%;
  min-height: 40px;
  padding: 5px 10px 5px 7px;
  border-radius: 6px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, opacity 140ms ease;
}

.gene-group-core .gene-chip.is-active {
  border-color: color-mix(in srgb, var(--red), white 46%);
  background: color-mix(in srgb, var(--red), white 96%);
}

.gene-group-adjustable .gene-chip.is-active {
  border-color: color-mix(in srgb, var(--green), white 48%);
  background: color-mix(in srgb, var(--green), white 96%);
}

.gene-chip.is-inactive {
  border-style: dashed;
  background: transparent;
  color: var(--muted);
  opacity: .68;
}

.gene-chip:hover {
  border-color: var(--control-hover);
  opacity: 1;
}

.gene-toggle-icon {
  display: grid;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted);
  place-items: center;
}

.gene-group-core .gene-chip.is-active .gene-toggle-icon {
  background: var(--red);
  color: white;
}

.gene-group-adjustable .gene-chip.is-active .gene-toggle-icon {
  background: var(--green);
  color: white;
}

.gene-toggle-icon svg {
  width: 12px;
  height: 12px;
}

.gene-chip-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.gene-chip-copy strong {
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.gene-chip-copy small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.3;
}

.control-placeholder {
  color: var(--muted);
  font-size: 12px;
}

.palette-picker {
  display: flex;
  gap: 10px;
}

.palette-swatch {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 3px solid var(--bg);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line-strong);
  transition: box-shadow 140ms ease, transform 140ms ease;
}

.palette-swatch:hover,
.custom-color-picker:hover {
  transform: translateY(-2px);
}

.palette-swatch.is-active {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text), 0 4px 10px rgb(20 20 17 / 18%);
}

.custom-color-picker {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  overflow: hidden;
  place-items: center;
  border: 3px solid var(--bg);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line-strong);
  cursor: pointer;
  transition: box-shadow 140ms ease, transform 140ms ease;
}

.custom-color-picker.is-active {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text), 0 4px 10px rgb(20 20 17 / 18%);
}

.custom-color-picker input {
  position: absolute;
  inset: -6px;
  width: 56px;
  min-height: 56px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}

.custom-color-picker input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.custom-color-picker input::-webkit-color-swatch {
  border: 0;
}

.custom-color-picker input::-moz-color-swatch {
  border: 0;
}

.custom-color-picker svg {
  position: relative;
  z-index: 1;
  width: 16px;
  height: 16px;
  color: white;
  filter: drop-shadow(0 1px 2px rgb(0 0 0 / 65%));
  pointer-events: none;
}

.prompt-output {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  align-self: start;
  padding-left: 32px;
  border-left: 1px solid var(--line);
}

.output-heading {
  margin-bottom: 14px;
}

.prompt-output textarea {
  width: 100%;
  height: 330px;
  padding: 22px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #1d1d1a;
  color: #f5f5ef;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  line-height: 1.75;
}

.prompt-anatomy {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.anatomy-token {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
}

.anatomy-token i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.output-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.generate-image-button .generate-loading-icon {
  display: none;
}

.generate-image-button.is-generating .generate-image-icon {
  display: none;
}

.generate-image-button.is-generating .generate-loading-icon {
  display: block;
  animation: image-spin 900ms linear infinite;
}

.image-result {
  margin-top: 30px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.image-result-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.image-result-heading .eyebrow {
  margin-bottom: 5px;
}

.image-result-heading h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.image-stage {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 320px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #e7e7e1;
}

.image-stage img {
  display: block;
  width: 100%;
  max-height: 640px;
  object-fit: contain;
}

.image-stage-state {
  display: grid;
  max-width: 360px;
  padding: 36px;
  place-items: center;
  text-align: center;
}

.image-stage-state svg {
  width: 28px;
  height: 28px;
  margin-bottom: 16px;
  color: var(--blue);
}

.image-stage[data-state="loading"] .image-stage-state svg {
  animation: image-spin 900ms linear infinite;
}

.image-stage[data-state="error"] .image-stage-state svg {
  display: none;
}

.image-stage-state strong,
.image-stage-state span {
  display: block;
}

.image-stage-state strong {
  font-size: 14px;
}

.image-stage-state span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.image-result-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

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

.saved-indicator {
  padding: 6px 9px;
  border-radius: 3px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
}

.saved-indicator.is-warning {
  background: color-mix(in srgb, var(--yellow), white 60%);
  color: #5f5000;
}

.output-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mixer-entry-button {
  min-height: 42px;
  padding-inline: 13px;
  white-space: nowrap;
}

.mixer-layout {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(440px, 1.05fr);
  gap: 56px;
  padding-top: 38px;
  padding-bottom: 72px;
}

.mixer-config {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 24px;
}

.mix-role {
  padding: 20px 0 22px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
}

.mix-role-heading {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  margin-bottom: 18px;
}

.mix-role-heading > div strong,
.mix-role-heading > div small {
  display: block;
}

.mix-role-heading > div strong {
  font-size: 13px;
}

.mix-role-heading > div small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.mix-role-index {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--text);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
}

.mix-role-accent .mix-role-index {
  border-color: var(--green);
  background: var(--green);
  color: white;
}

.mix-role .field-group {
  margin-bottom: 13px;
}

.style-combobox {
  position: relative;
}

.style-combobox > input {
  padding-right: 46px !important;
}

.style-combobox-toggle {
  position: absolute;
  z-index: 2;
  right: 1px;
  top: 1px;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 0;
  border-left: 1px solid transparent;
  border-radius: 0 5px 5px 0;
  background: transparent;
  color: var(--muted);
}

.style-combobox-toggle:hover {
  border-left-color: var(--line);
  background: var(--surface-soft);
  color: var(--text);
}

.style-combobox-toggle svg {
  width: 17px;
  height: 17px;
  transition: transform 150ms ease;
}

.style-combobox.is-open .style-combobox-toggle svg {
  transform: rotate(180deg);
}

.style-combobox-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  max-height: 320px;
  padding: 5px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 16px 34px rgb(20 20 17 / 16%);
}

.style-combobox-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  width: 100%;
  min-height: 48px;
  gap: 10px;
  padding: 7px 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.style-combobox-option:hover,
.style-combobox-option.is-active {
  background: var(--surface-soft);
}

.style-combobox-option.is-selected {
  color: var(--blue);
}

.style-combobox-option strong,
.style-combobox-option small {
  display: block;
  overflow-wrap: anywhere;
}

.style-combobox-option strong {
  font-size: 12px;
  font-weight: 700;
}

.style-combobox-option small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.style-combobox-option > svg {
  width: 15px;
  height: 15px;
}

.style-combobox-empty {
  padding: 18px 12px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.mix-style-preview {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 90px;
  gap: 14px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.mix-style-visual {
  display: block;
  width: 100px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 3px;
  background-color: var(--surface-soft);
}

.mix-style-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mix-style-copy {
  min-width: 0;
}

.mix-style-copy strong,
.mix-style-copy small,
.mix-style-copy span {
  display: block;
  overflow-wrap: anywhere;
}

.mix-style-copy strong {
  font-size: 14px;
}

.mix-style-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.mix-style-copy span {
  margin-top: 9px;
  color: var(--blue);
  font-size: 9px;
  font-weight: 700;
}

.mix-role-badge {
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  font-size: 9px;
}

.mix-bridge {
  display: grid;
  grid-template-columns: 1fr 28px 1fr;
  align-items: center;
  gap: 9px;
  margin: -12px 0;
  color: var(--muted);
}

.mix-bridge span {
  height: 1px;
  background: var(--line);
}

.mix-bridge svg {
  width: 16px;
  height: 16px;
  justify-self: center;
}

.mix-strength-field {
  margin-top: 18px;
  margin-bottom: 0 !important;
}

.mix-dimensions-field {
  padding-top: 2px;
}

.mix-dimension-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mix-dimension {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 18px;
  align-items: center;
  min-width: 0;
  min-height: 58px;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--control-fill);
  color: var(--muted);
  text-align: left;
}

.mix-dimension:hover {
  border-color: var(--control-hover);
  background: var(--surface);
}

.mix-dimension.is-active {
  border-color: color-mix(in srgb, var(--dimension-color), white 42%);
  background: color-mix(in srgb, var(--dimension-color), white 95%);
  color: var(--text);
}

.mix-dimension > svg:first-child {
  width: 30px;
  height: 30px;
  padding: 7px;
  border-radius: 50%;
  background: var(--surface-soft);
}

.mix-dimension.is-active > svg:first-child {
  background: var(--dimension-color);
  color: white;
}

.mix-dimension > svg:last-child {
  width: 15px;
  height: 15px;
}

.mix-dimension strong,
.mix-dimension small {
  display: block;
}

.mix-dimension strong {
  font-size: 11px;
}

.mix-dimension small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.mix-check {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.mix-check.is-safe {
  border-color: color-mix(in srgb, var(--green), white 55%);
  background: color-mix(in srgb, var(--green), white 95%);
}

.mix-check.has-warning {
  border-color: color-mix(in srgb, var(--yellow), #7b6900 22%);
  background: color-mix(in srgb, var(--yellow), white 86%);
}

.mix-check > svg {
  width: 30px;
  height: 30px;
  padding: 6px;
  border-radius: 50%;
  background: var(--surface);
}

.mix-check strong,
.mix-check span {
  display: block;
}

.mix-check strong {
  margin-bottom: 3px;
  font-size: 11px;
}

.mix-check span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.mixer-output textarea {
  height: 430px;
}

.mix-structure {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.mix-structure-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.mix-structure-heading h2 {
  margin: 0;
  font-size: 12px;
}

.mix-structure-heading span {
  color: var(--muted);
  font-size: 9px;
}

.mix-structure-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding-top: 12px;
}

.mix-structure-row + .mix-structure-row {
  margin-top: 12px;
  border-top: 1px solid var(--line);
}

.mix-structure-key {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--text);
  color: white;
  font-size: 9px;
  font-weight: 800;
}

.mix-structure-key.is-accent {
  background: var(--green);
}

.mix-structure-row strong,
.mix-structure-row small {
  display: block;
}

.mix-structure-row strong {
  font-size: 11px;
}

.mix-structure-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.drawer-layer,
.mobile-filter-sheet {
  position: fixed;
  z-index: 80;
  inset: 0;
}

.drawer-backdrop,
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(20 20 18 / 46%);
  backdrop-filter: blur(3px);
}

.detail-drawer,
.sheet-panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  overflow-y: auto;
  background: var(--bg);
  box-shadow: var(--shadow);
}

.detail-drawer {
  width: min(720px, 92vw);
}

.detail-drawer.is-vocabulary-detail {
  width: min(860px, 94vw);
}

.sheet-panel {
  width: min(420px, 92vw);
}

#mobileFilterGroups {
  padding: 8px 22px 24px;
}

.sheet-apply {
  width: calc(100% - 44px);
  margin: 0 22px 22px;
}

.drawer-topbar {
  position: sticky;
  z-index: 5;
  top: 0;
  min-height: 64px;
  padding: 10px 22px;
  border-bottom: 1px solid var(--line);
  background: rgb(243 243 240 / 95%);
  backdrop-filter: blur(14px);
}

.drawer-topbar h2,
.drawer-topbar .drawer-kicker {
  margin: 0;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 26px;
  padding: 28px 28px 32px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.vocabulary-detail-hero {
  padding: 32px 34px 34px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.vocabulary-detail-heading {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

.vocabulary-detail-index {
  display: grid;
  width: 58px;
  height: 58px;
  border: 1px solid color-mix(in srgb, var(--vocabulary-color), white 46%);
  background: color-mix(in srgb, var(--vocabulary-color), white 90%);
  color: color-mix(in srgb, var(--vocabulary-color), black 15%);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  font-weight: 800;
  place-items: center;
}

.vocabulary-detail-hero h2 {
  margin: 9px 0 3px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 34px;
  line-height: 1.18;
}

.vocabulary-detail-en {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.vocabulary-detail-summary {
  max-width: 620px;
  margin: 24px 0 0 76px;
  font-size: 15px;
  line-height: 1.75;
}

.vocabulary-detail-body {
  padding: 0 34px 54px;
}

.vocabulary-standard-block {
  margin: 0 -34px;
  padding: 30px 34px 32px;
  border-bottom: 1px solid var(--line);
  background: #171715;
  color: #fff;
}

.vocabulary-standard-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.vocabulary-standard-label span {
  color: color-mix(in srgb, var(--vocabulary-color), white 35%);
  font-size: 11px;
  font-weight: 750;
}

.vocabulary-standard-label small {
  color: rgb(255 255 255 / 46%);
  font-size: 9px;
  font-weight: 700;
}

.vocabulary-standard-zh,
.vocabulary-standard-en {
  margin: 0;
  overflow-wrap: anywhere;
}

.vocabulary-standard-zh {
  max-width: 720px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.7;
}

.vocabulary-standard-en {
  max-width: 720px;
  margin-top: 17px;
  padding-top: 15px;
  border-top: 1px solid rgb(255 255 255 / 16%);
  color: rgb(255 255 255 / 68%);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.7;
}

.vocabulary-causal-section {
  padding: 32px 0 34px;
}

.vocabulary-causal-section > h3 {
  margin: 0 0 20px;
  font-size: 12px;
}

.vocabulary-causal-chain {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.vocabulary-causal-chain article {
  min-width: 0;
  padding: 0 22px;
}

.vocabulary-causal-chain article:first-child {
  padding-left: 0;
}

.vocabulary-causal-chain article + article {
  border-left: 1px solid var(--line);
}

.vocabulary-causal-chain article > span {
  display: block;
  margin-bottom: 13px;
  color: color-mix(in srgb, var(--vocabulary-color), black 10%);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 800;
}

.vocabulary-causal-chain h4 {
  margin: 0 0 10px;
  font-size: 12px;
}

.vocabulary-causal-chain p,
.vocabulary-detail-notes p {
  margin: 0;
  overflow-wrap: anywhere;
  color: #4d4d48;
  font-size: 14px;
  line-height: 1.72;
}

.vocabulary-detail-notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 0 -34px;
  background: var(--line);
}

.vocabulary-detail-notes section {
  min-width: 0;
  padding: 26px 34px 30px;
  background: var(--surface);
}

.vocabulary-detail-notes section > span {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.vocabulary-control-band p {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
}

.detail-title h2 {
  margin: 8px 0 2px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 30px;
}

.detail-title .detail-en {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.detail-summary {
  margin: 20px 0 12px;
  font-size: 16px;
  line-height: 1.75;
}

.detail-recognition {
  margin: 0;
  padding-left: 12px;
  border-left: 3px solid var(--red);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.detail-visual {
  aspect-ratio: 4 / 5;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}

.detail-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin-top: 22px;
}

.detail-actions .primary-button,
.detail-actions .secondary-button {
  flex: 0 0 auto;
  padding-inline: 12px;
  text-decoration: none;
  white-space: nowrap;
}

.detail-actions .icon-button {
  flex: 0 0 42px;
}

.detail-actions .icon-button.is-active {
  border-color: var(--text);
  background: var(--text);
  color: var(--surface);
}

.detail-action-label-short {
  display: none;
}

@media (max-width: 760px) {
  .detail-hero {
    grid-template-columns: 1fr;
  }

  .detail-visual {
    grid-row: 1;
    aspect-ratio: 16 / 10;
  }
}

.detail-body {
  padding: 30px 28px 52px;
}

.detail-section {
  padding: 0 0 30px;
}

.detail-section + .detail-section {
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.detail-section h3 {
  margin-bottom: 16px;
  font-size: 12px;
  text-transform: uppercase;
}

.gene-table,
.compare-table {
  width: 100%;
  border-collapse: collapse;
}

.gene-table th,
.gene-table td,
.compare-table th,
.compare-table td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 12px;
  line-height: 1.6;
}

.gene-table th {
  width: 86px;
  color: var(--muted);
  font-weight: 500;
}

.lineage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.lineage-grid span,
.lineage-grid strong {
  display: block;
}

.detail-source-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.detail-source-list a {
  color: var(--blue);
  text-underline-offset: 3px;
}

.lineage-grid span {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.lineage-grid strong {
  font-size: 13px;
  line-height: 1.6;
}

.detail-prompt {
  padding: 16px;
  border-left: 3px solid var(--blue);
  background: var(--surface);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.7;
}

.compare-dock {
  position: fixed;
  z-index: 50;
  right: 24px;
  bottom: 24px;
  left: 50%;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  width: min(720px, calc(100vw - 32px));
  min-height: 68px;
  gap: 10px;
  padding: 10px 12px 10px 18px;
  border: 1px solid var(--text);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}

.compare-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.compare-item {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
  padding: 5px 8px;
  border-radius: 3px;
  background: var(--surface-soft);
  font-size: 11px;
}

.compare-item i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.compare-placeholder {
  color: var(--muted);
  font-size: 12px;
}

.compare-dialog {
  width: min(1000px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 1px solid var(--text);
  border-radius: var(--radius-md);
  background: var(--bg);
  box-shadow: var(--shadow);
}

.compare-dialog::backdrop {
  background: rgb(20 20 18 / 50%);
  backdrop-filter: blur(4px);
}

.compare-dialog .drawer-topbar {
  position: sticky;
}

#compareContent {
  padding: 28px;
}

.compare-head {
  display: grid;
  grid-template-columns: 130px 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.compare-style-head {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.compare-style-head .style-visual {
  width: 86px;
}

.compare-style-head h3 {
  margin: 0 0 3px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 18px;
}

.compare-style-head small {
  color: var(--muted);
}

.compare-table th:first-child {
  width: 130px;
  color: var(--muted);
  font-weight: 600;
}

.compare-table td {
  width: calc((100% - 130px) / 2);
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  min-height: 70px;
  align-items: center;
  gap: 24px;
  padding: 0 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.style-directory {
  padding-top: 0;
  padding-bottom: 48px;
}

.style-directory details {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.style-directory summary {
  padding: 18px 0;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.style-directory-links {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px 18px;
  padding: 0 0 22px;
}

.style-directory-links a {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  text-decoration: none;
}

.style-directory-links a:hover {
  color: var(--red);
}

.footer-note {
  text-align: center;
}

.footer-feedback {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 7px;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  transition: color 160ms ease;
}

.footer-feedback:hover {
  color: var(--red);
}

.footer-feedback svg {
  width: 14px;
  height: 14px;
  stroke-width: 1.8;
}

.toast {
  position: fixed;
  z-index: 120;
  left: 50%;
  bottom: 26px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--surface);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.view[aria-busy="true"]::after {
  position: fixed;
  z-index: 80;
  top: var(--header-height);
  left: 0;
  width: 42%;
  height: 2px;
  background: var(--accent);
  content: "";
  transform-origin: left;
  animation: module-loading 900ms ease-in-out infinite alternate;
}

@keyframes module-loading {
  from { transform: translateX(-100%); }
  to { transform: translateX(240%); }
}

@media (prefers-reduced-motion: reduce) {
  .view[aria-busy="true"]::after {
    width: 100%;
    animation: none;
  }
}

[hidden] {
  display: none !important;
}

body.has-layer {
  overflow: hidden;
}

@media (max-width: 1180px) {
  .style-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vocabulary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .prompt-layout {
    gap: 32px;
  }

  .mixer-layout {
    gap: 32px;
  }
}

@media (max-width: 900px) {
  :root {
    --header-height: 64px;
  }

  .site-header {
    grid-template-columns: auto 1fr auto;
    padding: 0 20px;
  }

  .brand small {
    display: none;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .primary-nav {
    justify-self: center;
  }

  .nav-item {
    padding: 0 8px;
    font-size: 12px;
  }

  .page-band {
    padding-right: 20px;
    padding-left: 20px;
  }

  .atlas-layout {
    display: block;
  }

  .filter-panel {
    display: none;
  }

  .mobile-filter-button {
    display: inline-flex;
    flex: none;
  }

  .sheet-apply {
    position: sticky;
    bottom: 16px;
  }

  .prompt-layout {
    grid-template-columns: 1fr;
  }

  .mixer-layout {
    grid-template-columns: 1fr;
  }

  .prompt-output,
  .mixer-output {
    position: static;
    padding: 30px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 680px) {
  :root {
    --header-height: 104px;
  }

  .timeline-toolbar {
    gap: 5px;
    padding: 5px;
  }

  .timeline-toolbar input[type="range"] {
    width: 84px;
  }

  .timeline-toolbar .secondary-button {
    padding: 0 9px;
  }

  .timeline-toolbar output {
    min-width: 38px;
  }

  .timeline-explorer {
    --timeline-region-width: 128px;
  }

  .lane-label {
    padding: 18px 10px;
  }

  .lane-label strong {
    font-size: 12px;
  }

  .timeline-era small {
    display: none;
  }
  .site-header {
    grid-template-columns: 1fr auto;
    min-height: 104px;
    align-content: center;
    gap: 9px 12px;
  }

  .primary-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
  }

  .nav-item {
    flex: 1;
  }

  .header-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .local-edition-link {
    min-height: 38px;
    padding: 0 10px;
    font-size: 11px;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .atlas-heading,
  .dictionary-header,
  .timeline-header,
  .prompt-header,
  .mixer-header {
    padding-top: 32px;
    padding-bottom: 24px;
  }

  .page-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  h1 {
    font-size: 29px;
  }

  .search-box {
    margin-top: 22px;
  }

  .vocabulary-filters {
    flex-wrap: nowrap;
    margin-right: -20px;
    padding-right: 20px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .vocabulary-filters::-webkit-scrollbar {
    display: none;
  }

  .vocabulary-filter {
    flex: none;
  }

  .vocabulary-grid {
    grid-template-columns: 1fr;
  }

  .vocabulary-group-heading {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .vocabulary-group-heading > span:last-child {
    display: none;
  }

  .vocabulary-table-wrap {
    overflow: visible;
    border-right: 0;
    border-left: 0;
  }

  .vocabulary-table,
  .vocabulary-table tbody,
  .vocabulary-table tr,
  .vocabulary-table th,
  .vocabulary-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .vocabulary-table colgroup,
  .vocabulary-table thead {
    display: none;
  }

  .vocabulary-table tbody tr {
    border-bottom: 10px solid var(--bg);
  }

  .vocabulary-table tbody tr:last-child {
    border-bottom: 0;
  }

  .vocabulary-table th,
  .vocabulary-table td {
    padding: 14px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
  }

  .vocabulary-table tbody tr:hover > * {
    background: var(--surface);
  }

  .vocabulary-table .vocabulary-term-cell {
    position: static;
    padding-top: 16px;
  }

  .vocabulary-table th::before,
  .vocabulary-table td::before {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    content: attr(data-label);
    font-size: 9px;
    font-weight: 750;
    text-transform: uppercase;
  }

  .vocabulary-controls {
    margin-top: 10px;
  }

  .search-box kbd {
    display: none;
  }

  .style-grid {
    gap: 20px 10px;
  }

  .style-directory-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .style-name-row {
    display: block;
  }

  .style-card-title {
    font-size: 16px;
  }

  .style-period {
    display: block;
    margin-top: 2px;
  }

  .style-tags span:nth-child(n + 3) {
    display: none;
  }

  .card-tools {
    top: 5px;
    right: 5px;
    opacity: 1;
  }

  .card-tools .icon-button {
    width: 34px;
    height: 34px;
  }

  .detail-drawer {
    width: 100%;
    overflow-x: hidden;
  }

  .detail-drawer.is-vocabulary-detail {
    width: 100%;
  }

  .detail-hero {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    padding: 20px;
  }

  .detail-title,
  .detail-visual {
    min-width: 0;
    width: 100%;
  }

  .detail-visual {
    grid-row: 1;
    aspect-ratio: 16 / 10;
  }

  .detail-actions {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .9fr) minmax(0, .9fr) 42px;
    width: 100%;
    max-width: 100%;
  }

  .detail-actions .primary-button,
  .detail-actions .secondary-button {
    width: 100%;
    min-width: 0;
    gap: 6px;
    padding-inline: 8px;
  }

  .detail-action-label-full {
    display: none;
  }

  .detail-action-label-short {
    display: inline;
  }

  .detail-body {
    width: 100%;
    padding: 26px 20px 44px;
  }

  .vocabulary-detail-hero {
    padding: 24px 20px 26px;
  }

  .vocabulary-detail-heading {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 14px;
  }

  .vocabulary-detail-index {
    width: 46px;
    height: 46px;
  }

  .vocabulary-detail-hero h2 {
    font-size: 29px;
  }

  .vocabulary-detail-summary {
    margin-left: 0;
  }

  .vocabulary-detail-body {
    padding: 0 20px 40px;
  }

  .vocabulary-standard-block {
    margin: 0 -20px;
    padding: 24px 20px 26px;
  }

  .vocabulary-standard-label {
    display: block;
  }

  .vocabulary-standard-label small {
    display: block;
    margin-top: 3px;
  }

  .vocabulary-standard-zh {
    font-size: 18px;
  }

  .vocabulary-causal-chain {
    grid-template-columns: 1fr;
  }

  .vocabulary-causal-chain article,
  .vocabulary-causal-chain article:first-child {
    padding: 18px 0;
  }

  .vocabulary-causal-chain article:first-child {
    padding-top: 0;
  }

  .vocabulary-causal-chain article + article {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .vocabulary-detail-notes {
    grid-template-columns: 1fr;
    margin: 0 -20px;
  }

  .vocabulary-detail-notes section {
    padding: 23px 20px 26px;
  }

  .detail-section {
    min-width: 0;
  }

  .gene-table {
    table-layout: fixed;
  }

  .gene-table th,
  .gene-table td {
    overflow-wrap: anywhere;
  }

  .lineage-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .selected-style {
    grid-template-columns: 72px minmax(0, 1fr) auto;
  }

  .selected-style-visual {
    width: 72px;
  }

  .prompt-output textarea {
    height: 290px;
  }

  .mixer-output textarea {
    height: 360px;
  }

  .output-heading {
    align-items: flex-start;
  }

  .output-tabs button {
    padding: 0 10px;
  }

  .mix-style-preview {
    grid-template-columns: 78px minmax(0, 1fr) auto;
  }

  .mix-style-visual {
    width: 78px;
  }

  .compare-dock {
    right: auto;
    bottom: 10px;
    grid-template-columns: 1fr auto;
  }

  .compare-dock > .icon-button {
    display: none;
  }

  .compare-summary .compare-item:nth-child(2) {
    display: none;
  }

  .compare-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  #compareContent {
    overflow-x: auto;
    padding: 20px;
  }

  .compare-head,
  .compare-table {
    min-width: 720px;
  }

  .site-footer {
    align-items: flex-start;
    grid-template-columns: 1fr;
    justify-content: center;
    gap: 6px;
    padding: 18px 20px;
  }

  .footer-note {
    text-align: left;
  }

  .footer-feedback {
    justify-self: start;
    margin-top: 4px;
  }
}

@media (max-width: 420px) {
  .local-edition-link {
    padding-inline: 8px;
  }

  .local-edition-link svg {
    display: none;
  }

  .prompt-output .output-heading {
    flex-wrap: wrap;
  }

  .output-heading-actions {
    margin-left: auto;
  }

  .style-grid {
    grid-template-columns: 1fr;
  }

  .style-name-row {
    display: flex;
  }

  .style-period {
    display: inline;
    margin: 0;
  }

  .style-tags span:nth-child(n) {
    display: inline-block;
  }

  .quick-filters {
    flex-wrap: nowrap;
    padding-bottom: 4px;
    overflow-x: auto;
  }

  .chip,
  .filter-chip,
  .quick-filter-label {
    flex: none;
  }

  .selected-style {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .selected-style .icon-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .prompt-control-grid {
    grid-template-columns: 1fr;
  }

  .mix-dimension-list {
    grid-template-columns: 1fr;
  }

  .mix-style-preview {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .mix-style-visual {
    width: 68px;
  }

  .mix-role-badge {
    grid-column: 1 / -1;
    width: fit-content;
  }

  .output-actions {
    flex-direction: column;
  }
}

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