:root {
  --ink: #242a28;
  --muted: #76807c;
  --line: #e3e7e5;
  --green: #285c47;
  --bg: #f5f6f7;
  --rust: #9b5941;
}
.review-summary,
.rejection-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 0;
  font-size: 12px;
}
.review-summary > span {
  color: var(--green);
}
.rejection-row {
  padding: 8px;
  background: #fff2ee;
  color: #9b3826;
}
.reject-candidate {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 100%;
  font-size: 11px;
}
.feedback-stats {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.feedback-stats th,
.feedback-stats td {
  text-align: left;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
}
.rejection-totals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.rejection-totals > div {
  display: flex;
  justify-content: space-between;
}
#imageModeActions,
.image-mode-heading {
  flex-wrap: wrap;
}
.image-search-mode .query-bar {
  border-bottom: 2px solid #285c47;
}
.query-bar .image-search[aria-pressed="true"] {
  background: #163d2d;
  box-shadow: inset 0 0 0 2px #80b29a;
}
.image-mode-heading,
.image-stage-actions,
#imageModeActions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.image-mode-heading {
  justify-content: space-between;
  margin-bottom: 20px;
}
.image-mode-heading h2 {
  font-size: 18px;
  margin: 0;
}
#imageInput {
  max-width: 900px;
  margin: 16px auto;
}
.upload-target {
  width: 100%;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: #f2f7f4;
  border: 1px dashed #80a491;
}
.upload-target svg {
  width: 36px;
  height: 36px;
  color: var(--green);
}
#imagePreview {
  text-align: center;
}
#stagedPreview {
  width: 100%;
  height: min(52dvh, 460px);
  padding: 0;
  border: 0;
  background: #f2f3f4;
}
#stagedImage {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.image-stage-actions {
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
}
.image-stage-actions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.image-run {
  background: var(--green);
  color: white;
}
#imageModeActions {
  justify-content: flex-end;
  margin-bottom: 8px;
}
@media (max-width: 760px) {
  #imageInput {
    margin: 8px 0;
  }
  .upload-target {
    min-height: 220px;
  }
}
#queryCaption {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
[data-mode="image"] .heading h1 {
  border-left: 3px solid var(--green);
  padding-left: 12px;
}
[data-mode="text"] .heading h1 {
  border-left: 3px solid #57768c;
  padding-left: 12px;
}
.review-panel {
  width: min(1100px, 96vw);
  max-height: 95dvh;
}
.review-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.review-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 9px;
  overflow-wrap: anywhere;
}
.review-label strong {
  font-weight: 500;
  white-space: nowrap;
}
.review-photo {
  height: 56dvh;
  overflow: auto;
  background: #f0f2f3;
  touch-action: pan-x pan-y;
  cursor: grab;
}
.review-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}
.review-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 14px 0;
}
.review-controls label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.review-controls input {
  width: 160px;
  max-width: 100%;
  accent-color: var(--green);
}
.review-confirm {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--green);
  color: white;
  white-space: nowrap;
}
.review-options {
  display: flex;
  gap: 10px;
  overflow: auto;
}
.review-options button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: var(--bg);
  font-size: 12px;
}
.review-options button.active {
  border-bottom-color: var(--green);
  background: #e7f0e9;
}
.review-options img {
  width: 42px;
  height: 55px;
  object-fit: contain;
}
.review-options span {
  overflow-wrap: anywhere;
}
.review-fields {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-size: 13px;
}
.review-fields summary {
  cursor: pointer;
}
@media (max-width: 760px) {
  .review-panel {
    width: 100vw;
    max-height: 96dvh;
  }
  .review-pair {
    gap: 8px;
  }
  .review-photo {
    height: 42dvh;
  }
  .review-label {
    font-size: 11px;
    min-height: 34px;
    flex-wrap: wrap;
    align-content: start;
  }
  .review-controls input {
    width: 115px;
  }
  .review-options {
    gap: 6px;
  }
  .review-options button {
    padding: 6px;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
    font-size: 10px;
  }
  .review-options img {
    width: 100%;
    height: 65px;
  }
  .review-controls {
    gap: 8px;
  }
}
.outfit-summary {
  display: flex;
  gap: 14px;
  margin: 0 0 24px;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}
.outfit-original {
  width: 64px;
  height: 86px;
  padding: 0;
  border: 0;
  flex: none;
  background: var(--bg);
}
.outfit-original img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.outfit-tabs {
  display: flex;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.outfit-tab {
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: left;
  flex: 1;
  max-width: 290px;
  min-width: 0;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 6px 10px;
  background: var(--bg);
}
.outfit-tab.active {
  border-bottom-color: var(--green);
  background: #edf3ef;
}
.outfit-tab img {
  width: 46px;
  height: 64px;
  object-fit: contain;
  flex: none;
}
.outfit-tab strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
}
.outfit-tab small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 6px;
}
@media (max-width: 760px) {
  .outfit-summary {
    gap: 8px;
  }
  .outfit-original {
    width: 40px;
    height: 72px;
  }
  .outfit-tabs {
    gap: 6px;
  }
  .outfit-tab {
    gap: 5px;
    padding: 4px;
    max-width: none;
  }
  .outfit-tab img {
    width: 32px;
    height: 52px;
  }
  .outfit-tab strong {
    font-size: 12px;
  }
  .outfit-tab small {
    font-size: 10px;
  }
}
* {
  box-sizing: border-box;
  letter-spacing: 0;
}
body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font:
    14px/1.5 "Microsoft YaHei",
    Arial,
    sans-serif;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button,
a,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  min-height: 36px;
  padding: 7px 12px;
}
button:hover {
  background: #f0f4f2;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
a {
  color: inherit;
  text-decoration: none;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #3f8166;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.6;
  flex: none;
}
.icon {
  width: 36px;
  height: 36px;
  flex: none;
  padding: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
}
.text-button {
  border: 0;
  padding: 4px 8px;
  background: transparent;
  font-size: 12px;
  min-height: 32px;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 200px;
  background: var(--bg);
  border-right: 1px solid var(--line);
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.brand {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.4;
}
.brand span {
  display: block;
  font-size: 9px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 6px;
}
.new-query {
  display: flex;
  gap: 10px;
  align-items: center;
  background: transparent;
  border-color: #cdd6d1;
}
nav {
  display: grid;
  gap: 4px;
}
nav button {
  border: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  text-align: left;
}
nav button.active {
  color: var(--green);
  background: #e7eeea;
}
nav button span {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}
.side-label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}
#recent {
  display: grid;
  gap: 4px;
  overflow: auto;
}
#recent button {
  border: 0;
  background: transparent;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  padding: 6px;
}
footer {
  margin-top: auto;
  display: grid;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
}
footer a {
  display: flex;
  align-items: center;
  gap: 10px;
}
#libraryStatus {
  font-size: 10px;
}
main {
  margin-left: 200px;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
header {
  height: 68px;
  flex: none;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  gap: 12px;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  min-width: 0;
  color: var(--muted);
}
.breadcrumb strong {
  font-weight: 400;
  color: var(--ink);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 400px;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
}
.workspace {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 26px 32px 32px;
  scrollbar-gutter: stable;
}
.heading {
  display: flex;
  gap: 14px;
  align-items: baseline;
  flex-wrap: wrap;
}
h1 {
  font-size: 23px;
  font-weight: 600;
  margin: 0;
}
#count {
  font-size: 12px;
  color: var(--muted);
}
.conditions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 22px;
  flex-wrap: wrap;
}
select {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 4px;
  padding: 7px 26px 7px 9px;
  max-width: 100%;
  font-size: 12px;
}
#sort {
  margin-left: auto;
}
#chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chip {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 5px;
  background: #eef3f0;
  border: 0;
  min-height: 30px;
}
.chip svg {
  width: 13px;
  height: 13px;
}
#notice {
  color: var(--rust);
  font-size: 13px;
  margin-bottom: 12px;
}
#notice:empty {
  display: none;
}
#answer {
  padding: 10px 0 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px 10px;
}
.product {
  container-type: inline-size;
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.photo {
  position: relative;
  aspect-ratio: 3/4;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f5;
  overflow: hidden;
}
.photo > button {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #b43c24;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 7px;
  border: 1px solid #ffffffb3;
  box-shadow: 0 1px 4px #29160d40;
  border-radius: 3px;
  pointer-events: none;
}
.product-body {
  padding: 9px 8px;
}
.prelaunch-metrics {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  min-width: 0;
  font-size: 10px;
  line-height: 20px;
  margin: 7px 0 0;
  color: #555e59;
}
.prelaunch-metrics > span {
  display: block;
  min-width: 0;
}
.prelaunch-metrics .batch-quantity {
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
  font-weight: 600;
}
.prelaunch-metrics .order-date {
  flex: none;
  font-variant-numeric: tabular-nums;
}
.prelaunch-metrics .production-state {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #8c432b;
  text-align: right;
}
.prelaunch-metrics .metric-label {
  display: none;
  font-weight: 400;
  color: var(--muted);
}
@container (min-width:150px) {
  .prelaunch-metrics {
    font-size: 10px;
    gap: 6px;
  }
  .prelaunch-metrics .metric-label {
    display: inline;
  }
}
@container (max-width:110px) {
  .product-body {
    padding-left: 5px;
    padding-right: 5px;
  }
  .prelaunch-metrics {
    gap: 3px;
    font-size: 9px;
  }
  .badge {
    top: 5px;
    left: 5px;
  }
}
.sku-price {
  display: flex;
  align-items: baseline;
  gap: 5px;
  justify-content: space-between;
}
.sku {
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 0;
  min-height: 22px;
  display: block;
  border: 0;
  text-align: left;
}
.price {
  font-size: 11px;
  white-space: nowrap;
}
.metrics {
  display: flex;
  justify-content: space-between;
  gap: 3px;
  font-size: 10px;
  margin: 7px 0;
  color: var(--muted);
}
.metrics b {
  display: block;
  font-weight: 500;
  color: var(--ink);
  font-size: 11px;
  overflow-wrap: anywhere;
}
.product-tools {
  display: none;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #eef0ef;
  padding-top: 4px;
}
.product-tools .icon {
  width: 27px;
  height: 28px;
  min-height: 28px;
  padding: 5px;
}
.product-tools svg {
  width: 15px;
  height: 15px;
}
.selected {
  color: var(--green);
  background: #e7f0eb;
}
.confirm {
  width: 100%;
  font-size: 12px;
  color: var(--green);
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  min-height: 38px;
}
.confirmed {
  background: #e4eee7;
}
.comparison {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
  gap: 24px;
}
.section-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}
.reference-photo {
  aspect-ratio: 3/4;
  width: 100%;
  background: #f3f4f5;
  border: 0;
  padding: 0;
  overflow: hidden;
}
.reference-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.candidates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.candidates .sku {
  font-size: 14px;
}
.candidates .price {
  font-size: 13px;
}
.candidates .product-body {
  padding: 12px;
}
.candidates .metrics {
  font-size: 11px;
}
.candidates .metrics b {
  font-size: 13px;
}
.feedback-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  flex-wrap: wrap;
  font-size: 12px;
}
.similar-toggle {
  margin: 18px 0;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.similar-toggle button {
  border: 0;
  display: flex;
  gap: 8px;
  align-items: center;
  padding-left: 0;
}
.empty {
  padding: 70px 10px;
  text-align: center;
  color: var(--muted);
}
.composer-dock {
  flex: none;
  padding: 10px 32px max(18px, env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid var(--line);
}
.continuation {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 7px;
  min-width: 0;
}
.spacer {
  flex: 1;
}
#composer {
  border: 1px solid #cdd6d1;
  border-radius: 6px;
  padding: 10px 12px 7px;
  box-shadow: 0 3px 12px #1c392008;
}
textarea {
  display: block;
  width: 100%;
  resize: none;
  border: 0;
  background: transparent;
  outline: 0 !important;
  font-size: 14px;
  line-height: 1.65;
  padding: 1px 4px;
  max-height: 130px;
}
textarea::placeholder {
  color: #959e99;
}
.composer-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
}
.send {
  background: var(--green);
  color: #fff;
}
.send:hover {
  background: #214c3b;
}
#attachment {
  display: flex;
  gap: 7px;
  align-items: center;
  margin-bottom: 8px;
}
#attachment img {
  width: 42px;
  height: 48px;
  object-fit: contain;
  background: #f2f3f4;
}
#attachment button {
  border: 0;
  padding: 2px 5px;
  font-size: 12px;
}
#attachment span {
  font-size: 11px;
  color: var(--muted);
}
dialog {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  width: min(760px, 94vw);
  max-height: 90dvh;
  overflow: auto;
}
dialog::backdrop {
  background: #18251f66;
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}
h2 {
  font-size: 18px;
  margin: 0;
}
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.detail-layout img {
  width: 100%;
  max-height: 470px;
  object-fit: contain;
  background: #f4f5f6;
}
.detail-rows > div {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.detail-rows span {
  color: var(--muted);
  display: block;
}
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.detail-actions a {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.history-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}
.history-row button {
  text-align: left;
  border: 0;
  overflow-wrap: anywhere;
}
.history-row small {
  color: var(--muted);
  white-space: nowrap;
}
.filter-form {
  display: grid;
  gap: 18px;
}
.filter-form label {
  display: grid;
  gap: 6px;
}
.filter-form input[type="number"] {
  width: 100%;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.filter-form .check {
  display: flex;
  align-items: center;
  gap: 8px;
}
.filter-form button {
  background: var(--green);
  color: #fff;
}
.compare-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
#panel .grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
#viewer {
  width: min(1100px, 98vw);
  overflow: hidden;
}
#imageStage {
  height: 65dvh;
  overflow: hidden;
  position: relative;
  background: #f3f4f5;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
#zoomImage {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
  transform-origin: center;
}
#cropRect {
  position: absolute;
  border: 2px solid var(--green);
  background: #3f88632a;
  pointer-events: none;
}
#cropTools {
  padding-top: 12px;
  display: flex;
  gap: 8px;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #263b31;
  color: #fff;
  padding: 11px 18px;
  border-radius: 5px;
  z-index: 100;
  max-width: 90vw;
}
.mobile-only {
  display: none;
}
#more {
  text-align: center;
  padding-top: 18px;
}
main {
  height: min(100dvh, var(--visual-height, 100dvh));
}
.comparison {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.comparison > section:last-child {
  grid-column: span 3;
}
.product-tools .icon {
  flex: 1;
  min-width: 0;
  max-width: 27px;
  padding: 4px;
}
@media (min-width: 1600px) {
  .comparison {
    max-width: 1400px;
  }
  .workspace {
    padding-top: 32px;
  }
}
@media (max-width: 1200px) {
  .sidebar {
    width: 176px;
    padding: 24px 14px;
  }
  main {
    margin-left: 176px;
  }
  .workspace {
    padding: 24px;
  }
  header {
    padding: 0 24px;
  }
  .composer-dock {
    padding-left: 24px;
    padding-right: 24px;
  }
  .grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .comparison {
    gap: 14px;
  }
  .candidates {
    gap: 8px;
  }
  .candidates .sku {
    font-size: 12px;
  }
  .candidates .product-body {
    padding: 8px;
  }
}
@media (max-width: 760px) {
  .sidebar {
    display: none;
  }
  main {
    margin-left: 0;
  }
  header {
    height: 52px;
    padding: 0 14px;
  }
  .mobile-only {
    display: inline-flex;
  }
  .breadcrumb {
    gap: 8px;
  }
  .breadcrumb strong {
    max-width: 135px;
  }
  .workspace {
    padding: 19px 14px 26px;
    scrollbar-gutter: auto;
  }
  h1 {
    font-size: 20px;
  }
  .conditions {
    gap: 5px;
    margin: 12px 0 18px;
  }
  #chips {
    order: 4;
    width: 100%;
  }
  #sort {
    font-size: 11px;
    max-width: 144px;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 10px;
  }
  .sku {
    font-size: 12px;
  }
  .metrics {
    font-size: 11px;
  }
  .metrics b {
    font-size: 12px;
  }
  .comparison {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
  }
  .candidates {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 10px;
  }
  .candidates > .product {
    flex: 0 0 100%;
    scroll-snap-align: start;
  }
  .candidates .sku {
    font-size: 12px;
  }
  .candidates .price {
    font-size: 11px;
  }
  .candidates .metrics {
    font-size: 10px;
  }
  .section-label {
    font-size: 11px;
  }
  .composer-dock {
    padding: 6px 12px max(10px, env(safe-area-inset-bottom));
  }
  .continuation {
    gap: 3px;
    flex-wrap: wrap;
  }
  .continuation .text-button {
    font-size: 10px;
    padding: 3px 4px;
    min-height: 24px;
  }
  .continuation #contextLabel {
    max-width: 95px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  textarea {
    font-size: 16px;
  }
  #composer {
    padding: 8px;
  }
  .detail-layout {
    grid-template-columns: 1fr;
  }
  .detail-layout img {
    max-height: 38dvh;
  }
  dialog {
    max-height: 90dvh;
    padding: 16px;
    width: 100vw;
    margin: auto 0 0;
    border-radius: 6px 6px 0 0;
  }
  #panel .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .compare-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #viewer {
    width: 100vw;
    max-height: 100dvh;
    height: 100dvh;
    margin: 0;
    border-radius: 0;
  }
  #imageStage {
    height: 75dvh;
  }
  .dialog-head h2 {
    font-size: 16px;
  }
  .dialog-head .toolbar {
    gap: 0;
  }
  .dialog-head .icon {
    width: 32px;
    padding: 6px;
  }
  .history-row small {
    font-size: 10px;
  }
}
@media (max-width: 760px) {
  .comparison > section:last-child {
    grid-column: auto;
  }
  #toast {
    bottom: auto;
    top: 58px;
  }
  .candidates .product-tools .icon {
    min-height: 32px;
    max-width: 32px;
  }
}
#panel.review-panel {
  max-width: 96vw;
}
.review-zoom {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}
.review-zoom input {
  min-width: 0;
  width: 100%;
  accent-color: var(--green);
}
.review-controls {
  justify-content: flex-end;
}
@media (max-width: 760px) {
  #panel.review-panel {
    width: 100vw;
    max-width: 100vw;
  }
}

/* Fixed two-row query controls; results own the remaining viewport. */
.query-bar {
  flex: none;
  padding: 8px 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.query-bar #composer {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 4px 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.query-bar #prompt {
  flex: 1;
  min-width: 40px;
  width: auto;
  height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: auto;
}
.query-bar .image-search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: none;
  height: 36px;
  background: var(--green);
  color: #fff;
  border-color: var(--green);
  white-space: nowrap;
}
.query-bar .icon {
  flex: none;
  width: 32px;
  height: 32px;
}
.query-bar .conditions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  height: 42px;
  margin: 0;
  overflow-x: auto;
}
.query-bar .heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 6px 0 0;
  flex: none;
  min-width: 0;
}
.query-bar h1 {
  font-size: 14px;
  line-height: 22px;
  margin: 0;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.query-bar #count {
  font-size: 11px;
  white-space: nowrap;
}
.query-bar select {
  height: 30px;
  padding-top: 3px;
  padding-bottom: 3px;
  flex: none;
  font-size: 12px;
}
.query-bar #chips {
  display: flex;
  flex: none;
  gap: 4px;
  width: auto;
  order: 0;
}
.query-bar #sort {
  margin-left: auto;
}
.query-bar #attachment {
  flex: none;
  gap: 2px;
  margin: 0;
}
.query-bar #attachment img {
  width: 30px;
  height: 34px;
}
.query-bar #attachment span {
  display: none;
}
.workspace {
  padding: 16px 20px 24px;
  min-height: 0;
}
#notice:empty {
  display: none;
}
.sidebar-collapsed .sidebar {
  display: none;
}
.sidebar-collapsed main {
  margin-left: 0;
}
.garment-group {
  min-width: 0;
}
.garment-group h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  margin: 0 0 12px;
}
.garment-group h2 span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}
@media (min-width: 761px) {
  .comparison {
    grid-template-columns: repeat(
      calc(var(--candidate-count, 3) + 1),
      minmax(0, 1fr)
    );
  }
  .comparison > section:last-child {
    grid-column: span var(--candidate-count, 3);
  }
  .comparison .candidates {
    grid-template-columns: repeat(var(--candidate-count, 3), minmax(0, 1fr));
  }
  .garment-group .photo,
  .garment-group .reference-photo {
    max-height: 340px;
  }
  #results > .outfit-summary {
    padding-bottom: 10px;
  }
  #results > .outfit-summary .outfit-original {
    width: 34px;
    height: 48px;
  }
  #results > .outfit-summary .outfit-tab {
    padding: 4px 10px;
    min-width: 120px;
  }
  #results > .outfit-summary .outfit-tab img {
    display: none;
  }
  .grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
  #results:has(.garment-group) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 24px;
  }
  #results > .outfit-summary {
    grid-column: 1 / -1;
    margin: 0;
  }
  .garment-group .comparison {
    gap: 10px;
    margin-top: 0;
  }
  .garment-group .candidates {
    gap: 8px;
  }
  .garment-group .grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .garment-group .product-body {
    padding: 6px;
  }
  .garment-group .sku-price {
    flex-wrap: wrap;
  }
  .garment-group .sku {
    font-size: 11px;
  }
  .garment-group .confirm {
    font-size: 11px;
    padding: 6px 2px;
  }
}
@media (max-width: 760px) {
  .query-bar {
    padding: 6px 8px;
  }
  .query-bar #composer {
    gap: 4px;
  }
  .query-bar .image-search {
    padding: 4px 7px;
    gap: 4px;
    font-size: 12px;
  }
  .query-bar .image-search svg {
    width: 16px;
  }
  #imageModeActions {
    gap: 4px;
    flex-wrap: nowrap;
  }
  #imageModeActions .text-button {
    padding: 4px 3px;
    font-size: 11px;
    white-space: nowrap;
  }
  #imageModeActions svg {
    width: 14px;
    height: 14px;
  }
  .query-bar #composer > [data-action="new"] {
    display: none;
  }
  .query-bar #prompt {
    font-size: 16px;
    padding: 5px;
  }
  .query-bar .conditions {
    gap: 5px;
  }
  .query-bar .heading {
    max-width: 115px;
    gap: 4px;
  }
  .query-bar h1 {
    max-width: 64px;
    font-size: 12px;
  }
  .query-bar #count {
    font-size: 10px;
  }
  .query-bar #sort {
    margin-left: 0;
    max-width: 105px;
  }
  .query-bar #attachment {
    position: relative;
  }
  .query-bar #attachment img {
    width: 24px;
  }
  .query-bar #attachment button {
    padding: 0;
    min-width: 18px;
  }
  .workspace {
    padding: 12px 10px 20px;
  }
  .garment-group:not(.active) {
    display: none;
  }
  .garment-group h2 {
    display: none;
  }
  body.sidebar-mobile-open .sidebar {
    display: flex;
    top: 100px;
    bottom: 0;
    width: 220px;
    height: auto;
    z-index: 20;
    box-shadow: 8px 0 24px #0002;
  }
}
