:root {
  color-scheme: light;
  --ink: #191814;
  --muted: #6e6a60;
  --paper: #f1eee6;
  --surface: #faf8f2;
  --line: #d7d1c4;
  --red: #a93624;
  --red-dark: #832719;
  --shadow: 0 20px 55px rgba(38, 31, 20, 0.12);
  font-family: Inter, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(rgba(25, 24, 20, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(25, 24, 20, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 74px;
  padding: 12px clamp(18px, 4vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(25, 24, 20, 0.16);
  background: rgba(241, 238, 230, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-logo { display: block; width: 152px; max-width: 100%; height: auto; }

.brand strong, .brand small { display: block; }
.brand strong { font-family: "Songti SC", STSong, serif; font-size: 20px; letter-spacing: .12em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 12px; letter-spacing: .06em; }

.topbar-right { display: flex; align-items: center; gap: clamp(18px, 3vw, 38px); }
.main-nav { display: flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--line); background: rgba(250, 248, 242, .7); }
.main-nav a { padding: 8px 12px; color: var(--muted); text-decoration: none; font-size: 13px; white-space: nowrap; }
.main-nav a:hover { color: var(--ink); }
.main-nav a.active { color: white; background: var(--ink); }
.pattern-card[id] { scroll-margin-top: 150px; }
.pattern-card[id]:focus { outline: 2px solid var(--red); outline-offset: 4px; }
.public-topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 24px; }
.public-topbar .brand { grid-column: 1; grid-row: 1; min-width: 0; }
.public-topbar .main-nav { grid-column: 1 / -1; grid-row: 2; justify-self: start; }
.public-tools { display: flex; align-items: center; justify-content: end; gap: 20px; grid-column: 2; grid-row: 1; }
.public-tools a { display: inline-flex; align-items: center; min-height: 36px; color: var(--muted); font-size: 12px; text-decoration: none; white-space: nowrap; }
.public-tools a:hover { color: var(--red); }
.public-tools a:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }
#pattern-grid .pattern-card { cursor: pointer; }
.pattern-image-link { display: grid; place-items: center; width: 100%; height: 100%; }
.pattern-title-link { color: inherit; text-decoration: none; }
.pattern-title-link:hover { color: var(--red); }
.pattern-title-link:focus-visible, .pattern-image-link:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }
@media (max-width: 650px) {
  .public-topbar { gap: 12px; }
  .public-tools { gap: 12px; }
  .public-tools a { font-size: 11px; }
}

.source-chip {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
}
.source-chip span { color: var(--muted); }

main {
  width: min(1500px, calc(100% - clamp(28px, 7vw, 104px)));
  margin: 0 auto;
  padding: 46px 0 76px;
}

.workspace-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 26px;
  border-bottom: 2px solid var(--ink);
}

.public-hero { padding-top: 10px; }
.hero-note { max-width: 650px; margin: 16px 0 0; color: var(--muted); line-height: 1.7; }

.knowledge-workbench {
  margin: 24px 0 32px;
  padding: 24px;
  border: 1px solid var(--ink);
  background: #e9e4d8;
  box-shadow: 8px 8px 0 rgba(25, 24, 20, .09);
}
.knowledge-head { display: flex; align-items: end; justify-content: space-between; gap: 28px; }
.knowledge-head h2 { margin: 0; font-family: "Songti SC", STSong, serif; font-size: 30px; letter-spacing: .06em; }
.knowledge-head p:last-child { max-width: 720px; margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.knowledge-status { display: grid; gap: 5px; text-align: right; white-space: nowrap; }
.knowledge-status strong { font-size: 15px; }
.knowledge-status span { color: var(--muted); font-size: 12px; }
.knowledge-progress { height: 8px; margin: 18px 0; overflow: hidden; background: #d6cfc1; }
.knowledge-progress i { display: block; width: 0; height: 100%; background: var(--red); transition: width .3s ease; }
.knowledge-tools { display: grid; grid-template-columns: auto minmax(340px, 1fr); gap: 18px; align-items: end; }
.knowledge-build-form { display: flex; align-items: end; gap: 9px; }
.knowledge-build-form label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.knowledge-build-form input { width: 84px; height: 42px; padding: 0 9px; border: 1px solid var(--line); background: white; }
.knowledge-search-form { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 8px; }
.knowledge-search-results { margin-top: 18px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.knowledge-search-results article { padding: 12px; border: 1px solid var(--line); background: var(--surface); }
.knowledge-search-results strong { color: var(--red); font-size: 12px; }
.knowledge-search-results p { margin: 7px 0; font-family: "Songti SC", STSong, serif; font-size: 14px; line-height: 1.55; }
.knowledge-search-results small { color: var(--muted); font-size: 11px; }

.batch-workbench {
  margin: 24px 0 4px;
  padding: 22px;
  display: grid;
  grid-template-columns: minmax(260px, .85fr) minmax(360px, 1.15fr);
  gap: 20px 32px;
  border: 1px solid var(--ink);
  background: var(--surface);
  box-shadow: 8px 8px 0 rgba(25, 24, 20, .09);
}
.batch-workbench h2, .section-heading h2 {
  margin: 0;
  font-family: "Songti SC", STSong, serif;
  font-size: 28px;
  letter-spacing: .06em;
}
.batch-workbench .eyebrow, .section-heading .eyebrow { margin-bottom: 7px; }
.batch-copy > p:last-child { margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.batch-controls { display: grid; grid-template-columns: 1fr 1fr auto auto; align-items: end; gap: 10px; }
.batch-controls label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; }
.batch-controls input {
  width: 100%;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  font-size: 15px;
}
.batch-progress { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(180px, 1fr) auto; align-items: center; gap: 15px; }
.progress-track { height: 8px; overflow: hidden; background: #e1dbcf; }
.progress-track i { display: block; width: 0; height: 100%; background: var(--red); transition: width .3s ease; }
.batch-progress-copy { display: flex; gap: 12px; align-items: baseline; white-space: nowrap; }
.batch-progress-copy strong { font-size: 14px; }
.batch-progress-copy span { color: var(--muted); font-size: 13px; }

.review-section { margin: 34px 0 22px; padding: 24px 0 28px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.section-heading { margin-bottom: 17px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.section-heading > span { color: var(--muted); font-size: 14px; }
.review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.review-card { min-width: 0; display: grid; grid-template-columns: minmax(190px, .7fr) minmax(280px, 1.3fr); border: 1px solid var(--line); background: white; }
.review-visual { position: relative; min-height: 330px; padding: 20px; display: grid; place-items: center; border-right: 1px solid var(--line); }
.review-visual img { width: 100%; height: 100%; max-height: 360px; object-fit: contain; mix-blend-mode: multiply; }
.evidence-grade { position: absolute; top: 12px; left: 12px; padding: 5px 8px; color: white; background: var(--ink); font-size: 12px; }
.grade-a { background: #2b6551; }
.grade-b { background: #59713e; }
.grade-c { background: #a56a21; }
.grade-d { background: var(--red-dark); }
.review-body { padding: 17px; }
.review-meta { margin-bottom: 13px; display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.review-meta strong { color: var(--red); font-family: Georgia, serif; }
.review-meta span { color: var(--muted); }
.review-body label { display: grid; gap: 5px; margin-bottom: 10px; color: var(--muted); font-size: 12px; }
.review-body input, .review-body textarea { width: 100%; padding: 8px 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 14px; line-height: 1.45; resize: vertical; }
.review-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.review-evidence { margin: 13px 0; padding: 11px 12px; border-left: 3px solid var(--red); background: #f0ece3; }
.review-evidence span { color: var(--red); font-size: 11px; font-weight: 800; letter-spacing: .06em; }
.review-evidence p { margin: 7px 0; font-family: "Songti SC", STSong, serif; font-size: 14px; line-height: 1.6; }
.review-evidence small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.field-evidence-list { margin: -4px 0 13px; border: 1px solid var(--line); background: var(--surface); }
.field-evidence-list summary { padding: 10px 12px; cursor: pointer; color: var(--red); font-size: 12px; font-weight: 700; }
.field-evidence-list > div { padding: 10px 12px; border-top: 1px solid var(--line); }
#editor-field-evidence-content { padding: 0; }
#editor-field-evidence-content > div { padding: 10px 12px; border-top: 1px solid var(--line); }
.field-evidence-list strong { font-size: 12px; }
.field-evidence-list p { margin: 5px 0; font-family: "Songti SC", STSong, serif; font-size: 13px; line-height: 1.55; }
.field-evidence-list small { color: var(--muted); font-size: 11px; }
.review-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.review-actions > div { display: flex; gap: 7px; }

.eyebrow {
  margin: 0 0 9px;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
}

h1 {
  margin: 0;
  font-family: "Songti SC", STSong, serif;
  font-size: clamp(38px, 5vw, 66px);
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1;
}


.toolbar {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) repeat(5, minmax(115px, auto));
  gap: 14px;
  padding: 22px 0 18px;
}

.batch-download {
  min-height: 48px;
  padding: 0 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  background: var(--ink);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
}
.batch-download:hover { background: var(--red); }

.search-box, .status-filter {
  min-height: 48px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(250, 248, 242, 0.82);
}

.search-box { gap: 10px; padding: 0 16px; }
.search-box span { color: var(--red); font-family: Georgia, serif; font-size: 26px; transform: rotate(-20deg); }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 16px; }
.search-box input::placeholder { color: #8c877d; }

.status-filter { padding-left: 16px; }
.status-filter span { color: var(--muted); font-size: 13px; white-space: nowrap; }
.status-filter select { height: 46px; padding: 0 36px 0 12px; border: 0; outline: 0; color: var(--ink); background: transparent; }
html[lang="en"] .status-filter span { flex-shrink: 0; }
html[lang="en"] .status-filter select { min-width: 0; width: auto; flex: 1; }
html[lang="en"] .toolbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.legend { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 8px; height: 8px; background: var(--red); border-radius: 50%; }

.pattern-grid {
  column-count: 3;
  column-gap: 18px;
}

.list-pagination { margin: 30px 0 0; display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.list-pagination[hidden] { display: none; }
.page-numbers { display: flex; align-items: center; justify-content: center; gap: 5px; flex-wrap: wrap; }
.list-pagination button { min-width: 42px; min-height: 42px; padding: 0 12px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); cursor: pointer; }
.list-pagination button:hover { color: var(--red); border-color: var(--red); }
.list-pagination button[aria-current="page"] { color: white; background: var(--ink); border-color: var(--ink); }
.list-pagination button:disabled { opacity: .45; cursor: default; }
.list-pagination button:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.page-numbers > span { padding: 0 5px; color: var(--muted); }

.pattern-card {
  display: inline-block;
  width: 100%;
  min-width: 0;
  margin: 0 0 18px;
  overflow: hidden;
  break-inside: avoid;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 8px 25px rgba(34, 28, 19, 0.05);
  transition: transform .2s ease, box-shadow .2s ease;
}
.pattern-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.image-stage {
  position: relative;
  min-height: 220px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 22px;
  background: white;
  border-bottom: 1px solid var(--line);
}
.image-stage::after {
  content: attr(data-id);
  position: absolute;
  top: 13px;
  left: 14px;
  color: rgba(25, 24, 20, .48);
  font: 11px/1 Georgia, serif;
  letter-spacing: .08em;
}
.image-stage img { width: 100%; height: auto; max-height: 360px; object-fit: contain; mix-blend-mode: multiply; }

.card-body { padding: 20px; }
.card-heading { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.card-heading h2 { margin: 0; font-family: "Songti SC", STSong, serif; font-size: 28px; letter-spacing: .08em; }
.page-stamp { padding: 5px 8px; color: var(--red); border: 1px solid rgba(169, 54, 36, .35); font: 12px/1 Georgia, serif; white-space: nowrap; }

.metadata { margin: 17px 0 18px; display: grid; gap: 10px; }
.metadata div { display: grid; grid-template-columns: 92px 1fr; gap: 10px; font-size: 14px; line-height: 1.55; }
.metadata dt { color: var(--muted); }
.metadata dd { margin: 0; }
.metadata .empty { color: #9b9589; }

.card-actions { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding-top: 15px; border-top: 1px solid var(--line); }
.card-actions div { display: flex; gap: 7px; }

.mini-button, .text-link, .button, .icon-button {
  border: 0;
  cursor: pointer;
  text-decoration: none;
}
.mini-button { padding: 8px 10px; color: var(--ink); background: #ebe6db; font-size: 13px; }
.mini-button:hover { background: #ded7ca; }
.mini-button.accent { color: white; background: var(--red); }
.mini-button.accent:hover { background: var(--red-dark); }
.mini-button:disabled, .button:disabled { cursor: wait; opacity: .6; }
.download-link { color: var(--muted); font-size: 13px; text-underline-offset: 4px; }
.download-link:hover { color: var(--red); }

.empty-state { padding: 80px 20px; text-align: center; border: 1px dashed var(--line); background: rgba(250, 248, 242, .55); }
.empty-state strong, .empty-state span { display: block; }
.empty-state strong { font-family: "Songti SC", STSong, serif; font-size: 24px; }
.empty-state span { margin-top: 9px; color: var(--muted); }

.editor-dialog {
  width: min(1040px, calc(100% - 28px));
  height: min(760px, calc(100vh - 28px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.editor-dialog::backdrop { background: rgba(21, 19, 15, .72); backdrop-filter: blur(3px); }
.editor-dialog form {
  height: 100%;
  margin: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.dialog-head, .dialog-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; }
.dialog-head { border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 2px 0 0; font-family: "Songti SC", STSong, serif; font-size: 25px; }
.record-id { color: var(--red); font: 12px/1 Georgia, serif; }
.icon-button { width: 38px; height: 38px; color: var(--ink); background: transparent; font-size: 30px; line-height: 1; }

.dialog-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(320px, 1.05fr);
  overflow: hidden;
}
.dialog-visual { padding: 22px; display: flex; flex-direction: column; justify-content: space-between; background: white; border-right: 1px solid var(--line); }
.dialog-visual img { width: 100%; height: 360px; object-fit: contain; }
.visual-actions { display: flex; gap: 18px; padding-top: 14px; }
.text-link { color: var(--red); background: transparent; font-size: 13px; text-underline-offset: 4px; }
.text-link:hover { text-decoration: underline; }

.form-fields { padding: 24px; overflow: auto; }
.form-fields label { display: grid; gap: 7px; margin-bottom: 17px; color: var(--muted); font-size: 13px; }
.form-fields input, .form-fields textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  outline: none;
  color: var(--ink);
  background: white;
  font-size: 15px;
  line-height: 1.5;
}
.form-fields input:focus, .form-fields textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(169, 54, 36, .1); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.evidence-box { padding: 14px 15px; border-left: 3px solid var(--red); background: #eee9de; }
.evidence-box span { color: var(--red); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.evidence-box p { margin: 8px 0; font-family: "Songti SC", STSong, serif; font-size: 15px; line-height: 1.65; }
.evidence-box small { color: var(--muted); line-height: 1.5; }

.dialog-foot { border-top: 1px solid var(--line); }
.dialog-foot > div { display: flex; gap: 8px; }
.button { min-height: 41px; padding: 0 16px; }
.button-primary { color: white; background: var(--ink); }
.button-primary:hover { background: #000; }
.button-secondary { color: white; background: var(--red); }
.button-secondary:hover { background: var(--red-dark); }
.button-ghost { color: var(--ink); background: transparent; }

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  max-width: min(360px, calc(100% - 44px));
  padding: 13px 16px;
  color: white;
  background: var(--ink);
  box-shadow: var(--shadow);
  transform: translateY(24px);
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { background: var(--red-dark); }

@media (max-width: 980px) {
  html[lang="en"] .toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .search-box { grid-column: 1 / -1; }
  .pattern-grid { column-count: 2; }
  .batch-workbench { grid-template-columns: 1fr; }
  .batch-progress { grid-column: 1; }
  .review-grid { grid-template-columns: 1fr; }
  .workspace-head { align-items: start; flex-direction: column; }
  .knowledge-tools { grid-template-columns: 1fr; }
  .knowledge-search-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dialog-layout { grid-template-columns: 1fr; }
  .dialog-visual { min-height: 360px; border-right: 0; border-bottom: 1px solid var(--line); }
  .dialog-visual img { height: 300px; }
}

@media (max-width: 650px) {
  html[lang="en"] .toolbar { grid-template-columns: 1fr; }
  .source-chip { display: none; }
  .topbar { padding-inline: 14px; }
  .topbar-right { gap: 0; }
  .main-nav a { padding-inline: 9px; }
  .brand small { display: none; }
  main { width: min(100% - 28px, 1500px); padding-top: 30px; }
  .toolbar { grid-template-columns: 1fr; }
  .batch-workbench { padding: 17px; }
  .knowledge-workbench { padding: 17px; }
  .knowledge-head { align-items: start; flex-direction: column; }
  .knowledge-status { text-align: left; white-space: normal; }
  .knowledge-build-form { display: grid; grid-template-columns: 1fr 1fr; }
  .knowledge-build-form label input { width: 100%; }
  .knowledge-build-form .button { grid-column: 1 / -1; }
  .knowledge-search-form, .knowledge-search-results { grid-template-columns: 1fr; }
  .batch-controls { grid-template-columns: 1fr 1fr; }
  .batch-controls .button { grid-column: 1 / -1; }
  .batch-progress { grid-template-columns: 1fr; }
  .batch-progress-copy { justify-content: space-between; white-space: normal; }
  .review-card { grid-template-columns: 1fr; }
  .review-visual { min-height: 250px; border-right: 0; border-bottom: 1px solid var(--line); }
  .review-field-row { grid-template-columns: 1fr; gap: 0; }
  .status-filter select { width: 100%; }
  .pattern-grid { column-count: 1; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .dialog-foot { align-items: stretch; flex-direction: column; }
  .dialog-foot > div { justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
.taxonomy-filter { margin: 20px 0; padding: 20px 24px; border: 1px solid var(--line); background: var(--surface); }
.taxonomy-filter-row { display: flex; align-items: flex-start; gap: 20px; margin: 8px 0; }
.taxonomy-filter-row > strong { flex: 0 0 70px; padding-top: 9px; font-size: 13px; font-weight: 500; color: var(--muted); }
.taxonomy-filter-row > div, .taxonomy-active, .taxonomy-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.taxonomy-filter button, .taxonomy-active button, .taxonomy-choices button { border: 1px solid var(--line); background: transparent; color: var(--ink); font: inherit; font-size: 13px; padding: 8px 12px; cursor: pointer; }
.taxonomy-filter button:hover, .taxonomy-active button:hover, .taxonomy-choices button:hover { border-color: var(--red); }
.taxonomy-filter button[aria-pressed="true"], .taxonomy-choices button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.taxonomy-filter summary { font-size: 13px; color: var(--muted); cursor: pointer; padding: 10px 0; }
.taxonomy-active { margin: 12px 0; align-items: center; font-size: 13px; }
.taxonomy-active > span, .taxonomy-active > small { color: var(--muted); }
.taxonomy-badges { margin: 12px 0; }
.taxonomy-badges span { border: 1px solid var(--line); font-size: 12px; color: var(--muted); padding: 4px 8px; }
.taxonomy-filter button:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
@media (max-width: 680px) {
  .taxonomy-filter { padding: 14px; }
  .taxonomy-filter-row { flex-direction: column; gap: 6px; }
  .taxonomy-filter-row > strong { flex: none; }
  .taxonomy-filter button { min-height: 44px; }
}

.image-stage.has-reference-designs { height: 340px; padding: 12px 12px 54px; }
.image-stage.has-reference-designs img { height: 100%; max-height: 100%; min-height: 0; object-fit: contain; }
.image-stage.showing-reference img { mix-blend-mode: normal; }
.reference-controls { position: absolute; bottom: 8px; left: 8px; right: 8px; display: flex; align-items: center; justify-content: center; gap: 8px; color: #514b43; background: rgba(255,255,255,.95); font-size: 12px; }
.reference-controls button { min-width: 32px; min-height: 36px; border: 1px solid var(--line); border-radius: 4px; background: white; color: inherit; font-size: 22px; cursor: pointer; }
.reference-controls a { font-size: 11px; color: inherit; }
.reference-controls button:focus-visible, .reference-controls a:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .pattern-card { transition: none; } }
