/* Automatic try-on studio. Visual layout only: original controls and events remain. */
html.lg-shell #fashion-tryon-workspace {
  --ts-bg: #f5f6f8;
  --ts-panel: #fff;
  --ts-inspector: #fbfbfd;
  --ts-text: #252a32;
  --ts-secondary: #636c79;
  --ts-line: #e0e3e9;
  --ts-soft: #eceef2;
  --ts-blue: #0069df;
  --ts-blue-fill: #eaf2ff;
  --ts-shadow: 0 2px 6px #25354a06, 0 9px 24px #25354a04;
  display: flex; flex-direction: column; min-height: 0;
  overflow: hidden !important; background: var(--ts-bg) !important;
  color: var(--ts-text);
}
html.lg-shell.lg-dark #fashion-tryon-workspace {
  --ts-bg: #1e2229;
  --ts-panel: #292e37;
  --ts-inspector: #252a32;
  --ts-text: #edf0f6;
  --ts-secondary: #a6aebb;
  --ts-line: #3b424e;
  --ts-soft: #323944;
  --ts-blue: #78b2ff;
  --ts-blue-fill: #283f5f;
  --ts-shadow: 0 4px 18px #00000012;
}
html.lg-shell #app-view #fashion-tryon-workspace > .tryon-header {
  flex: 0 0 auto; flex-wrap: nowrap; align-items: center; gap: 14px;
  min-height: 0; padding: 22px 28px 16px !important; border: 0;
}
#fashion-tryon-workspace .tryon-title-symbol {
  display: grid; place-items: center; flex: 0 0 44px; height: 44px;
  border: 1px solid #ffffff8c; border-radius: 13px;
  color: #1674dc; background: linear-gradient(145deg,#f5faff,#dcecff);
  box-shadow: 0 3px 8px #346bb814, inset 0 1px 0 #fff;
}
#fashion-tryon-workspace .tryon-title-symbol svg { width: 29px; height: 29px; }
html.lg-dark #fashion-tryon-workspace .tryon-title-symbol { background: linear-gradient(145deg,#3b5472,#2a3d57); color: #a4ccff; border-color: #617a984f; box-shadow: inset 0 1px 0 #b4d2ff26; }
#fashion-tryon-workspace .tryon-heading-block { flex: 1 1 auto; min-width: 0; }
#fashion-tryon-workspace .tryon-heading-block > .batch-eyebrow { display: none; }
html.lg-shell #app-view #tryon-page-title { margin: 0 0 5px; font-size: 23px; line-height: 1.3; font-weight: 650; letter-spacing: -.7px; color: var(--ts-text); }
html.lg-shell #app-view #tryon-page-description { color: var(--ts-secondary); font-size: 11px; line-height: 1.65; max-width: 680px; }
#fashion-tryon-workspace .tryon-header-actions { gap: 8px; align-items: center; }
#fashion-tryon-workspace .batch-secondary-action,
#fashion-tryon-workspace .tryon-pairing-mode-button {
  min-height: 32px; padding: 7px 11px; border: 1px solid var(--ts-line);
  border-radius: 9px; background: var(--ts-panel); color: var(--ts-text);
  font-size: 11px; font-weight: 500; white-space: nowrap; box-shadow: 0 1px 2px #00000004;
}
#fashion-tryon-workspace :is(.batch-secondary-action,.tryon-pairing-mode-button):hover:not(:disabled) { background: var(--ts-blue-fill); border-color: #72a7e9; color: var(--ts-blue); }
#fashion-tryon-workspace .batch-secondary-action:disabled { opacity: .46; cursor: not-allowed; }
#fashion-tryon-workspace .tryon-studio-toolbar { flex: 0 0 auto; padding: 0 28px 18px; border-bottom: 1px solid var(--ts-line); }
#fashion-tryon-workspace .tryon-segment-control { display: grid; grid-template-columns: minmax(0,1fr); gap: 9px; }
#fashion-tryon-workspace .tryon-segment-control > span { color: var(--ts-secondary); font-size: 11px; font-weight: 550; }
#fashion-tryon-workspace .tryon-segment-control > div {
  display: flex; width: 100%; padding: 3px !important; border: 1px solid var(--ts-line) !important;
  border-radius: 10px !important; background: var(--ts-soft) !important;
}
#fashion-tryon-workspace .tryon-segment-control button {
  flex: 1 1 0; min-width: 0; min-height: 32px; padding: 7px 10px;
  font-size: 11px !important; font-weight: 550; color: var(--ts-secondary) !important;
  background: transparent !important; box-shadow: none !important; border-radius: 7px !important;
}
#fashion-tryon-workspace .tryon-segment-control button.active,
#fashion-tryon-workspace .tryon-segment-control button[aria-checked="true"] {
  color: var(--ts-text) !important; background: var(--ts-panel) !important;
  box-shadow: 0 1px 4px #0000001c, inset 0 1px 0 #ffffff18 !important;
}
#fashion-tryon-workspace .tryon-segment-control button:hover:not(:disabled) { color: var(--ts-blue) !important; }
#fashion-tryon-workspace .quality-speed-switch::before { display: none; }
#fashion-tryon-workspace #tryon-channel-control button { padding-inline: 6px; font-size: 10px !important; }
#fashion-tryon-workspace #tryon-workflow-control { display: flex; align-items: center; gap: 14px; }
#fashion-tryon-workspace #tryon-workflow-control > div { width: min(440px,100%); }
#fashion-tryon-workspace #tryon-workflow-control button { padding-inline: 18px; }
#fashion-tryon-workspace .tryon-segment-control > small { grid-column: 1; color: var(--ts-secondary); font-size: 10px; line-height: 1.65; }
#fashion-tryon-workspace .tryon-segment-control > small[data-state="error"] { color: #df6b60; }
#fashion-tryon-workspace .tryon-segment-control button.is-auto-channel::before { color: var(--ts-blue); background: var(--ts-blue-fill); border-color: var(--ts-line); animation: none; font-size: 8px; top: -18px; }
#fashion-tryon-workspace .tryon-segment-control button.is-auto-channel::after { display: none; }
#fashion-tryon-workspace .tryon-studio { display: grid; grid-template-columns: minmax(0,1fr) 274px; flex: 1 1 0; min-height: 0; overflow: hidden; }
html.lg-shell #fashion-tryon-workspace .tryon-canvas {
  display: block; min-width: 0; min-height: 0; padding: 24px 26px 36px !important;
  overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--ts-line) transparent;
}
#fashion-tryon-workspace .tryon-inspector {
  min-width: 0; min-height: 0; padding: 22px 20px 28px; overflow: auto;
  border-left: 1px solid var(--ts-line); background: var(--ts-inspector);
  scrollbar-width: thin; scrollbar-color: var(--ts-line) transparent;
}
#fashion-tryon-workspace .tryon-inspector-heading { display: flex; align-items: center; gap: 8px; margin: 0 0 28px; }
html.lg-shell #app-view #fashion-tryon-workspace .tryon-inspector-heading h3 { margin: 0; font-size: 12px; color: var(--ts-text); }
#fashion-tryon-workspace .tryon-settings-icon { color: var(--ts-secondary); font-size: 20px; line-height: 1; }
#fashion-tryon-workspace .tryon-inspector > .tryon-segment-control { margin-bottom: 24px; }
#fashion-tryon-workspace .tryon-inspector-help { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--ts-line); color: var(--ts-secondary); font-size: 11px; line-height: 1.8; }
#fashion-tryon-workspace .tryon-inspector-help strong { font-weight: 500; color: var(--ts-text); }
#fashion-tryon-workspace .tryon-inspector-help p { margin: 8px 0 0; }
/* Each workflow still toggles its original root; CSS follows that state. */
#fashion-tryon-workspace:has(#tryon-precision-grid:not(.hidden)) .tryon-gemini-prompt-card,
#fashion-tryon-workspace:not(:has(#tryon-precision-grid:not(.hidden))) :is(.tryon-precision-prompt,#tryon-precision-action-row,#tryon-precision-job-status),
#fashion-tryon-workspace:has(#tryon-precision-grid:not(.hidden)) #tryon-job-status { display: none !important; }
#fashion-tryon-workspace:has(:is(#tryon-gemini-input-grid,#tryon-precision-grid):not(.hidden)) .tryon-inspector-help { display: none; }
#fashion-tryon-workspace:not(:has(#tryon-gemini-input-grid:not(.hidden))) .tryon-gemini-prompt-card :is(.tryon-gemini-options,.tryon-gemini-provider-note,.tryon-gemini-validation) { display: none; }
html.lg-shell #fashion-tryon-workspace .tryon-card {
  min-width: 0; border: 0 !important; border-radius: 0 !important;
  padding: 0; background: transparent !important; box-shadow: none !important; color: var(--ts-text);
}
#fashion-tryon-workspace .tryon-input-grid { gap: 22px; align-items: start; min-height: 0; }
#fashion-tryon-workspace .tryon-card-heading { gap: 8px; align-items: flex-start; flex-wrap: wrap; }
#fashion-tryon-workspace .tryon-card-heading > div { gap: 8px; }
html.lg-shell #app-view #fashion-tryon-workspace h3 { color: var(--ts-text); font-size: 13px; font-weight: 600; }
#fashion-tryon-workspace .batch-step { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: var(--ts-soft); color: var(--ts-secondary); font-size: 10px; font-weight: 550; }
#fashion-tryon-workspace .batch-upload-summary { color: var(--ts-secondary); font-size: 10px; line-height: 1.6; max-width: 100%; }
#fashion-tryon-workspace .tryon-upload-card > p,
#fashion-tryon-workspace .tryon-precision-card > p,
#fashion-tryon-workspace .tryon-gemini-prompt-card > p { margin: 10px 0 14px; color: var(--ts-secondary); font-size: 11px; line-height: 1.7; }
#fashion-tryon-workspace .tryon-upload-grid {
  gap: 10px; min-height: 208px; padding: 10px; border: 1px solid var(--ts-line);
  border-radius: 16px; background: var(--ts-panel); box-shadow: var(--ts-shadow);
  grid-template-columns: repeat(auto-fill,minmax(125px,1fr)); scrollbar-width: thin;
}
#fashion-tryon-workspace .tryon-upload-grid:has(> .tryon-add-tile:only-child) { grid-template-columns: minmax(0,1fr); grid-auto-columns: auto; }
#fashion-tryon-workspace .tryon-upload-item,
#fashion-tryon-workspace .tryon-add-tile { border-radius: 11px; border-color: var(--ts-line); background: var(--ts-bg); height: 182px; min-height: 182px; }
#fashion-tryon-workspace .tryon-upload-item img { height: 100%; min-height: 0; object-fit: contain; }
#fashion-tryon-workspace .tryon-add-tile {
  display: flex; flex-direction: column; justify-content: center; gap: 0;
  border: 1px dashed var(--ts-line); color: var(--ts-text); background: transparent;
  transition: background .18s ease, border-color .18s ease;
}
#fashion-tryon-workspace .tryon-add-tile:hover { color: var(--ts-blue); border-color: var(--ts-blue); background: var(--ts-blue-fill); }
#fashion-tryon-workspace .tryon-add-tile > span { display: grid; place-items: center; width: 36px; height: 36px; margin: 0 0 14px; border-radius: 11px; color: var(--ts-blue); background: var(--ts-blue-fill); font-size: 24px; font-weight: 300; }
#fashion-tryon-workspace .tryon-add-tile strong { font-size: 12px; font-weight: 550; }
#fashion-tryon-workspace .tryon-add-tile small { margin-top: 7px; color: var(--ts-secondary); font-size: 10px; }
#fashion-tryon-workspace .tryon-upload-grid.drag-active { border-color: var(--ts-blue); background: var(--ts-blue-fill); box-shadow: 0 0 0 3px #408cff20; }
#fashion-tryon-workspace .tryon-mask-trigger { opacity: 1; transform: none; top: auto; bottom: 32px; left: 7px; right: 7px; color: #fff; background: #243346eb; font-size: 10px; backdrop-filter: blur(8px); }
#fashion-tryon-workspace .tryon-mask-trigger.has-mask { color: #fff; background: #145795ed; border-color: #c4dfff66; }
#fashion-tryon-workspace :is(.tryon-item-order,.tryon-item-remove,.tryon-item-resolution) { background: #243346d9; color: #fff; }
#fashion-tryon-workspace .tryon-item-remove:hover { background: #c73c46; }
#fashion-tryon-workspace #tryon-mask-reminder { margin-top: 12px; padding: 0; color: var(--ts-secondary); background: transparent; border: 0; text-align: left; font-size: 10px; font-weight: 400; line-height: 1.7; }
#fashion-tryon-workspace .tryon-output-card,
#fashion-tryon-workspace .tryon-precision-output { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--ts-line) !important; min-height: 220px; }
#fashion-tryon-workspace .tryon-output-card .tryon-card-heading { align-items: center; }
#fashion-tryon-workspace .batch-output-actions { flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
#fashion-tryon-workspace .tryon-output-note { color: var(--ts-secondary); font-size: 10px; }
#fashion-tryon-workspace .tryon-output-card .tryon-output-note { display: none; }
#fashion-tryon-workspace .tryon-output-grid { margin-top: 16px; min-height: 160px; border: 0; border-radius: 0; background: transparent; }
#fashion-tryon-workspace .batch-output-empty { padding: 22px 12px; color: var(--ts-secondary); }
#fashion-tryon-workspace .batch-output-empty > span {
  width: 44px; height: 44px; margin-bottom: 4px; border-radius: 14px; background: var(--ts-soft); color: var(--ts-secondary); font-size: 0;
  display: grid; place-items: center;
}
#fashion-tryon-workspace .batch-output-empty > span::before {
  content: ''; width: 24px; height: 24px; background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='1.4' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='4'/%3E%3Cpath d='m3 16 5-5 6 6 3-3 4 4'/%3E%3Ccircle cx='16' cy='8' r='1.6'/%3E%3C/g%3E%3C/svg%3E") center/contain no-repeat;
}
#fashion-tryon-workspace .batch-output-empty strong { color: var(--ts-secondary); font-size: 12px; font-weight: 500; }
#fashion-tryon-workspace .batch-output-empty p { color: var(--ts-secondary); font-size: 10px; line-height: 1.7; }
#fashion-tryon-workspace .tryon-output-grid.has-results { grid-template-columns: repeat(auto-fill,minmax(175px,1fr)); gap: 14px; padding: 0; }
#fashion-tryon-workspace .tryon-output-item { border: 1px solid var(--ts-line); border-radius: 14px; background: var(--ts-panel); box-shadow: var(--ts-shadow); }
#fashion-tryon-workspace .tryon-output-item .batch-output-preview img { background: var(--ts-panel); }
#fashion-tryon-workspace .tryon-output-caption { align-items: center; color: var(--ts-text); font-size: 11px; padding: 10px; }
#fashion-tryon-workspace .inline-image-download { color: var(--ts-blue); }
#fashion-tryon-workspace .batch-output-placeholder { min-height: 200px; border: 1px solid var(--ts-line); border-radius: 14px; background: var(--ts-panel); color: var(--ts-text); }
#fashion-tryon-workspace .batch-output-placeholder small { color: var(--ts-secondary); }
#fashion-tryon-workspace .batch-output-placeholder.is-failed { border-color: #c975754d; background: var(--ts-panel); }
#fashion-tryon-workspace .tryon-output-error { color: #d97474 !important; }
#fashion-tryon-workspace .image-generation-timing { color: var(--ts-secondary); }
#fashion-tryon-workspace .tryon-commandbar {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex: 0 0 auto;
  min-height: 76px; padding: 14px 26px; border-top: 1px solid var(--ts-line);
  background: var(--ts-inspector); box-shadow: 0 -4px 20px #14243504;
}
#fashion-tryon-workspace .tryon-command-meta { display: grid; gap: 5px; min-width: 0; }
#fashion-tryon-workspace .tryon-command-meta strong { color: var(--ts-text); font-size: 12px; font-weight: 550; }
#fashion-tryon-workspace .tryon-command-meta > span { color: var(--ts-secondary); font-size: 10px; line-height: 1.5; }
#fashion-tryon-workspace .tryon-command-meta > span[data-status="running"] { color: var(--ts-blue); }
#fashion-tryon-workspace .tryon-action-row { padding: 0; min-width: 280px; }
#fashion-tryon-workspace .tryon-start-button {
  min-height: 42px; border-radius: 12px; padding: 11px 20px; background: #087cf2;
  color: white; font-size: 12px; font-weight: 550;
  box-shadow: 0 3px 8px #087cf21f, inset 0 1px 0 #ffffff2b;
}
#fashion-tryon-workspace .tryon-start-button:hover:not(:disabled) { background: #006ae2; }
#fashion-tryon-workspace .tryon-start-button:disabled { color: var(--ts-secondary); background: var(--ts-soft); box-shadow: none; cursor: not-allowed; }
#fashion-tryon-workspace .tryon-start-button.generation-stop { color: #fff; background: #c34850; }
/* Single garment: preserve the two ordered strips and all pairing behavior. */
#fashion-tryon-workspace .tryon-gemini-input-grid { display: block; min-height: 0; }
#fashion-tryon-workspace .tryon-gemini-upload-card { display: grid; gap: 18px; }
#fashion-tryon-workspace .tryon-gemini-upload-row { gap: 12px; }
#fashion-tryon-workspace .tryon-gemini-row-heading { flex-wrap: wrap; gap: 8px; }
#fashion-tryon-workspace .tryon-gemini-row-heading strong { color: var(--ts-text); font-size: 12px; font-weight: 550; }
#fashion-tryon-workspace .tryon-gemini-row-heading small { color: var(--ts-secondary); font-size: 10px; line-height: 1.6; }
#fashion-tryon-workspace .tryon-gemini-pair-divider { color: var(--ts-secondary); font-size: 10px; }
#fashion-tryon-workspace .tryon-gemini-pair-divider::before,
#fashion-tryon-workspace .tryon-gemini-pair-divider::after { background: var(--ts-line); }
#fashion-tryon-workspace .tryon-gemini-upload-grid { grid-template-columns: none; grid-auto-columns: 145px; min-height: 164px; }
#fashion-tryon-workspace .tryon-gemini-upload-grid :is(.tryon-upload-item,.tryon-add-tile) { height: 140px; min-height: 140px; }
#fashion-tryon-workspace .tryon-gemini-upload-grid .tryon-upload-item img { height: 100%; min-height: 0; }
#fashion-tryon-workspace .tryon-upload-item.is-selected-reference { border-color: var(--ts-blue); box-shadow: 0 0 0 2px #448ffa66; }
#fashion-tryon-workspace .tryon-upload-item.is-selected-reference .tryon-single-reference-indicator { color: #fff; background: #086fdded; }
#fashion-tryon-workspace .tryon-pairing-mode-button.active { color: var(--ts-blue); background: var(--ts-blue-fill); border-color: #6fa9f07a; }
#fashion-tryon-workspace .tryon-inspector .tryon-card { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--ts-line) !important; }
#fashion-tryon-workspace .tryon-inspector .batch-step { display: none; }
#fashion-tryon-workspace textarea {
  width: 100%; min-height: 155px; flex: none; padding: 12px; border: 1px solid var(--ts-line);
  border-radius: 11px; color: var(--ts-text); background: var(--ts-panel); font-size: 12px; line-height: 1.7; box-shadow: none; resize: vertical;
}
#fashion-tryon-workspace textarea::placeholder { color: var(--ts-secondary); opacity: .8; }
#fashion-tryon-workspace .tryon-gemini-options { grid-template-columns: minmax(0,1fr); gap: 8px; margin-top: 18px; }
#fashion-tryon-workspace .tryon-gemini-options label { color: var(--ts-secondary); font-size: 11px; gap: 9px; }
#fashion-tryon-workspace select { min-height: 34px; width: 100%; color: var(--ts-text); background: var(--ts-panel); border: 1px solid var(--ts-line); box-shadow: none; font-size: 11px; }
#fashion-tryon-workspace .tryon-gemini-validation { padding: 10px 0; margin-top: 8px; border: 0; background: transparent; color: var(--ts-secondary); font-size: 10px; line-height: 1.7; }
#fashion-tryon-workspace .tryon-gemini-validation.is-ready { color: var(--ts-blue); }
#fashion-tryon-workspace .tryon-gemini-validation.is-error { color: #d06b35; }
#fashion-tryon-workspace :is(.tryon-gemini-provider-note,.tryon-precision-prompt > small) { color: var(--ts-secondary); font-size: 10px; line-height: 1.7; }
/* Precision: one source strip, then seven clearly labeled detail groups. */
#fashion-tryon-workspace .tryon-precision-grid { display: block; min-height: 0; }
#fashion-tryon-workspace .tryon-precision-top { display: grid; grid-template-columns: minmax(0,1fr); gap: 26px; }
#fashion-tryon-workspace .tryon-precision-source-grid { grid-template-columns: none; grid-auto-columns: 145px; min-height: 164px; flex: none; }
#fashion-tryon-workspace .tryon-precision-source-grid :is(.tryon-upload-item,.tryon-add-tile) { height: 140px; min-height: 140px; }
#fashion-tryon-workspace .tryon-precision-source-grid .tryon-upload-item img { height: 100%; min-height: 0; }
#fashion-tryon-workspace .tryon-precision-detail-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; overflow: visible; }
#fashion-tryon-workspace .tryon-precision-detail-slot { grid-template-rows: auto minmax(0,1fr); padding: 12px; gap: 10px; border: 1px solid var(--ts-line); border-radius: 14px; background: var(--ts-panel); }
#fashion-tryon-workspace .tryon-precision-detail-slot > header { color: var(--ts-text); font-size: 11px; }
#fashion-tryon-workspace .tryon-precision-detail-slot > header span { color: var(--ts-secondary); font-size: 10px; }
#fashion-tryon-workspace .tryon-precision-category-grid { grid-template-columns: none; grid-auto-columns: 110px; min-height: 108px; padding: 0; border: 0; border-radius: 9px; box-shadow: none; }
#fashion-tryon-workspace .tryon-precision-category-grid :is(.tryon-upload-item,.tryon-add-tile) { height: 104px; min-height: 104px; }
#fashion-tryon-workspace .tryon-precision-category-grid .tryon-upload-item img { height: 100%; min-height: 0; }
#fashion-tryon-workspace .tryon-precision-category-grid .tryon-add-tile > span { width: 26px; height: 26px; border-radius: 8px; margin-bottom: 9px; font-size: 20px; }
#fashion-tryon-workspace .tryon-precision-category-grid .tryon-add-tile strong { font-size: 10px; }
#fashion-tryon-workspace .tryon-precision-category-grid .tryon-add-tile small { font-size: 9px; }
#fashion-tryon-workspace .tryon-precision-other-grid { grid-auto-columns: 165px; }
#fashion-tryon-workspace .tryon-precision-other-grid .tryon-upload-item.has-detail-description { height: 146px; min-height: 146px; grid-template-rows: 110px 36px; }
#fashion-tryon-workspace .tryon-precision-other-grid .tryon-upload-item.has-detail-description img { height: 110px; }
#fashion-tryon-workspace .tryon-precision-detail-description { background: var(--ts-panel); color: var(--ts-secondary); border-color: var(--ts-line); font-size: 10px; }
#fashion-tryon-workspace .tryon-precision-detail-description input { background: var(--ts-bg); color: var(--ts-text); border-color: var(--ts-line); font-size: 11px; }
#fashion-tryon-workspace :is(button,textarea,select,input):focus-visible { outline: 3px solid #398aff80; outline-offset: 2px; }
/* The original canvas editor remains a modal above the app and native drag band. */
html.lg-shell #tryon-mask-modal { z-index: 12100; background: #10172380; backdrop-filter: blur(12px); }
html.lg-shell #tryon-mask-modal .tryon-mask-card { background: #f7f8fa; color: #252a32; border: 1px solid #ffffff80; border-radius: 20px; box-shadow: 0 28px 90px #0000004d; }
html.lg-shell #tryon-mask-modal :is(h2,footer label) { color: #252a32; }
html.lg-shell #tryon-mask-modal header p { color: #677180; }
html.lg-shell #tryon-mask-modal .batch-secondary-action { color: #3a4554; background: #fff; border-color: #dce1e8; border-radius: 9px; }
html.lg-shell #tryon-mask-modal #tryon-mask-save { color: #fff; background: #087cf2; }
html.lg-shell.lg-dark #tryon-mask-modal .tryon-mask-card { background: #292e37; border-color: #4a5363; }
html.lg-shell.lg-dark #tryon-mask-modal :is(h2,footer label) { color: #edf0f6; }
html.lg-shell.lg-dark #tryon-mask-modal header p { color: #b4bcc9; }
html.lg-shell.lg-dark #tryon-mask-modal :is(.batch-secondary-action,#tryon-mask-close) { background: #363e4b; color: #edf0f6; border-color: #566071; }
@media (max-width:1180px) {
  #fashion-tryon-workspace .tryon-studio { grid-template-columns: minmax(0,1fr) 244px; }
  html.lg-shell #app-view #fashion-tryon-workspace > .tryon-header { padding: 18px 20px 14px !important; }
  #fashion-tryon-workspace .tryon-title-symbol { display: none; }
  #fashion-tryon-workspace .tryon-studio-toolbar { padding: 0 20px 14px; }
  html.lg-shell #fashion-tryon-workspace .tryon-canvas { padding: 20px 18px 30px !important; }
  #fashion-tryon-workspace .tryon-inspector { padding: 20px 14px; }
  #fashion-tryon-workspace .tryon-input-grid { gap: 16px; }
  #fashion-tryon-workspace .tryon-card-heading { align-content: start; }
  #fashion-tryon-workspace .tryon-upload-grid { grid-template-columns: repeat(auto-fill,minmax(105px,1fr)); }
  #fashion-tryon-workspace :is(.tryon-gemini-upload-grid,.tryon-precision-source-grid,.tryon-precision-category-grid) { grid-template-columns: none; }
  #fashion-tryon-workspace .tryon-precision-detail-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #fashion-tryon-workspace .tryon-commandbar { padding-inline: 20px; }
}
@media (max-width:980px) {
  #fashion-tryon-workspace .tryon-studio { grid-template-columns: minmax(0,1fr) 226px; }
  #fashion-tryon-workspace .tryon-input-grid { grid-template-columns: minmax(0,1fr); gap: 22px; }
  #fashion-tryon-workspace .tryon-header-actions { flex-direction: column; align-items: stretch; }
  #fashion-tryon-workspace #tryon-workflow-control { gap: 9px; }
  #fashion-tryon-workspace #tryon-workflow-control button { padding-inline: 10px; }
}
@media (prefers-reduced-motion:reduce) { #fashion-tryon-workspace * { scroll-behavior: auto; transition: none !important; animation: none !important; } }

/* Override legacy shell-wide theme and header rules only inside this studio. */
html.lg-shell #app-view #fashion-tryon-workspace { background: var(--ts-bg) !important; }
html.lg-shell #app-view #fashion-tryon-workspace .tryon-upload-card > p { min-height: 3.4em; }
html.lg-shell #app-view #fashion-tryon-workspace .tryon-precision-detail-slot > header { padding: 0 !important; min-height: 0 !important; border: 0 !important; background: transparent !important; }
html.lg-shell #app-view #fashion-tryon-workspace .tryon-card.tryon-output-card,
html.lg-shell #app-view #fashion-tryon-workspace .tryon-card.tryon-precision-output,
html.lg-shell #app-view #fashion-tryon-workspace .tryon-inspector .tryon-card { border-top: 1px solid var(--ts-line) !important; }
html.lg-shell #app-view #fashion-tryon-workspace #tryon-gemini-pair-hint { color: var(--ts-secondary); font-size: 10px; }
html.lg-shell #fashion-tryon-workspace .lg-page-modes { background: #e7ebf0 !important; border-color: #d8dfe8 !important; }
html.lg-shell #fashion-tryon-workspace .lg-page-modes button { color: #596779 !important; }
html.lg-shell #fashion-tryon-workspace .lg-page-modes button.active { background: #fff !important; color: #243447 !important; }
html.lg-shell.lg-dark #fashion-tryon-workspace .lg-page-modes { background: #323944 !important; border-color: #424c5b !important; }
html.lg-shell.lg-dark #fashion-tryon-workspace .lg-page-modes button { color: #b5bfce !important; }
html.lg-shell.lg-dark #fashion-tryon-workspace .lg-page-modes button.active { background: #4b5769 !important; color: #fff !important; }

/* Image delivery progress remains readable while the original PNG is received. */
html.lg-shell #app-view #fashion-tryon-workspace .batch-output-placeholder {background:var(--ts-panel)!important;border-color:var(--ts-line)!important;color:var(--ts-text)}
#fashion-tryon-workspace .tryon-delivery {display:grid;justify-items:center;gap:9px;max-width:100%;padding:8px;font-size:12px;text-align:center}
#fashion-tryon-workspace .tryon-delivery strong {color:var(--ts-text);font-size:12px;line-height:1.6;font-weight:550}
#fashion-tryon-workspace .tryon-delivery small {color:var(--ts-secondary);font-size:10px}
#fashion-tryon-workspace .tryon-delivery progress {width:140px;max-width:100%;height:5px;accent-color:#007aff}

/* Keep primary controls visible without secondary instructional copy. */
#fashion-tryon-workspace :is(
  .batch-eyebrow,
  p,
  small:not(.tryon-output-error):not(#tryon-channel-status[data-state="error"]),
  .batch-upload-summary,
  #tryon-mask-reminder,
  #tryon-gemini-pair-hint,
  .tryon-gemini-pair-divider,
  .tryon-inspector-help,
  .batch-output-empty,
  .tryon-output-note:not([aria-live]),
  .tryon-precision-detail-slot > header > span,
  .tryon-item-resolution,
  .tryon-upload-item:not(.is-selected-reference) .tryon-single-reference-indicator,
  .tryon-gemini-validation:not(.is-error),
  #tryon-job-status[data-status="idle"],
  #tryon-precision-job-status[data-status="idle"]
),
#fashion-tryon-tool-flyout small,
#tryon-mask-modal :is(.batch-eyebrow, #tryon-mask-description) {
  display: none !important;
}
#fashion-tryon-workspace :is(textarea, input)::placeholder {
  color: transparent !important;
  opacity: 0 !important;
}
html.lg-shell #app-view #tryon-page-title { margin-bottom: 0; }
#fashion-tryon-workspace :is(.tryon-upload-card, .tryon-precision-card, .tryon-gemini-prompt-card) > .tryon-card-heading {
  margin-bottom: 12px;
}
#fashion-tryon-workspace :is(.tryon-gemini-validation.is-error, .tryon-output-error, #tryon-channel-status[data-state="error"]) {
  font-size: 13px;
  line-height: 1.6;
}

/* Keep image-content choices immediately after the workflow choices. */
#fashion-tryon-workspace .tryon-studio-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
}
#fashion-tryon-workspace .tryon-studio-toolbar #tryon-workflow-control {
  flex: 0 1 506px;
  min-width: 0;
}
#fashion-tryon-workspace .tryon-studio-toolbar #tryon-workflow-control > span { white-space: nowrap; }
#fashion-tryon-workspace .tryon-studio-toolbar #tryon-workflow-control > div {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}
html.lg-shell #fashion-tryon-workspace .tryon-studio-toolbar > .lg-page-modes {
  flex: 0 0 auto;
  margin: 0 !important;
  padding: 3px;
}
#fashion-tryon-workspace .tryon-studio-toolbar button { white-space: nowrap; }
#fashion-tryon-workspace .tryon-studio-toolbar .lg-page-modes button { min-height: 32px; }
@media (max-width:760px) {
  #fashion-tryon-workspace .tryon-studio-toolbar { gap: 8px; }
  #fashion-tryon-workspace #tryon-workflow-control button { padding-inline: 6px; }
  #fashion-tryon-workspace .tryon-studio-toolbar .lg-page-modes button { padding-inline: 8px; }
}

/* Hide the selected section captions while retaining dynamic label nodes. */
#fashion-tryon-workspace #tryon-chatgpt-input-grid > .tryon-upload-card > .tryon-card-heading,
#fashion-tryon-workspace #tryon-output-card > .tryon-card-heading > div:first-child {
  display: none !important;
}
#fashion-tryon-workspace #tryon-output-card > .tryon-card-heading {
  justify-content: flex-end;
}

/* Remove paired-upload captions while keeping the pairing control visible. */
#fashion-tryon-workspace .tryon-inspector-heading,
#fashion-tryon-workspace #tryon-gemini-input-grid > .tryon-gemini-upload-card > .tryon-card-heading,
#fashion-tryon-workspace #tryon-gemini-input-grid .tryon-gemini-row-heading > div:first-child,
#fashion-tryon-workspace #tryon-gemini-input-grid .tryon-gemini-upload-row:has(> #tryon-gemini-source-grid) > .tryon-gemini-row-heading {
  display: none !important;
}
#fashion-tryon-workspace #tryon-gemini-input-grid .tryon-gemini-row-heading {
  justify-content: flex-end;
}

/* Per-region clear controls sit inside the upload panel's top-right corner. */
#fashion-tryon-workspace #tryon-chatgpt-input-grid .tryon-upload-region { position: relative; }
#fashion-tryon-workspace #tryon-chatgpt-input-grid .tryon-upload-region > .tryon-upload-grid { padding-top: 42px; }
#fashion-tryon-workspace .tryon-region-clear {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 1;
  min-height: 26px;
  padding: 4px 10px;
  border: 1px solid var(--ts-line);
  border-radius: 7px;
  background: var(--ts-panel);
  color: var(--ts-secondary);
  font-size: 11px;
  line-height: 16px;
  cursor: pointer;
}
#fashion-tryon-workspace .tryon-region-clear:hover:not(:disabled) {
  background: var(--ts-blue-fill);
  color: var(--ts-blue);
  border-color: var(--ts-blue);
}
#fashion-tryon-workspace .tryon-region-clear:disabled { opacity: .45; cursor: default; }

/* Put the workspace clear action after both selectors, with no title row. */
#fashion-tryon-workspace .tryon-studio-toolbar { padding: 12px 20px; }
#fashion-tryon-workspace #tryon-clear-all { margin-left: auto; flex: 0 0 auto; }
#fashion-tryon-workspace #tryon-clear-all[hidden] { display: none !important; }
