.smart-image-flow {
  --si-accent: #c85a24;
  --si-accent-strong: #963f18;
  --si-ink: #20262e;
  --si-muted: #68727e;
  --si-line: #d9dee4;
  --si-soft: #f5f6f7;
  --si-success: #26734d;
  --si-warning: #a45112;
  --si-danger: #b23b31;
  width: min(100%, 1040px);
  margin: 0 auto;
  color: var(--si-ink);
}
.smart-image-flow *, .smart-image-flow *::before, .smart-image-flow *::after { box-sizing: border-box; }
.smart-image-flow button, .smart-image-flow input, .smart-image-flow select, .smart-image-flow textarea { font: inherit; letter-spacing: 0; }
.smart-image-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 4px 0 18px; border-bottom: 1px solid var(--si-line); }
.smart-image-head > div:first-child { min-width: 0; }
.smart-image-head span { color: var(--si-accent-strong); font-size: 12px; font-weight: 850; }
.smart-image-head h2 { margin: 5px 0 4px; font-size: 22px; line-height: 1.25; letter-spacing: 0; }
.smart-image-head p { margin: 0; color: var(--si-muted); font-size: 13px; line-height: 1.6; }
.smart-image-mobile-progress { display: none; }
.smart-image-progress { position: sticky; z-index: 8; top: 0; display: grid; grid-template-columns: repeat(var(--smart-image-step-count, 3), minmax(0, 1fr)); margin: 0; padding: 13px 0; border-bottom: 1px solid var(--si-line); background: #fff; list-style: none; }
.smart-image-progress li { position: relative; display: grid; justify-items: center; gap: 5px; min-width: 0; color: #8a929b; font-size: 11px; font-weight: 750; text-align: center; }
.smart-image-progress li[hidden] { display: none; }
.smart-image-progress li::before { position: absolute; z-index: -1; top: 15px; right: 50%; left: -50%; height: 1px; background: var(--si-line); content: ""; }
.smart-image-progress li:first-child::before { display: none; }
.smart-image-progress li b { display: grid; place-items: center; width: 31px; height: 31px; border: 1px solid var(--si-line); border-radius: 50%; background: #fff; color: inherit; font-size: 11px; }
.smart-image-progress li.is-active { color: var(--si-ink); }
.smart-image-progress li.is-active b { border-color: var(--si-ink); background: var(--si-ink); color: #fff; }
.smart-image-progress li.is-complete { color: var(--si-success); }
.smart-image-progress li.is-complete b { border-color: var(--si-success); background: var(--si-success); color: transparent; }
.smart-image-progress li.is-complete b::after { color: #fff; content: "✓"; font-size: 14px; }
.smart-image-progress li.is-warning { color: var(--si-warning); }
.smart-image-progress li.is-warning b { border-color: var(--si-warning); color: transparent; }
.smart-image-progress li.is-warning b::after { color: var(--si-warning); content: "!"; font-size: 14px; }
.smart-image-stage { min-height: 460px; }
.smart-image-step { padding: 26px 0 10px; }
.smart-image-step[hidden] { display: none; }
.smart-image-step:focus { outline: none; }
.smart-image-step-head { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 13px; align-items: center; margin-bottom: 21px; }
.smart-image-step-head > b { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--si-line); border-radius: 6px; color: var(--si-accent-strong); font-size: 12px; }
.smart-image-step-head h3 { margin: 0 0 3px; font-size: 18px; line-height: 1.3; letter-spacing: 0; }
.smart-image-step-head h3 small { color: var(--si-muted); font-size: 11px; font-weight: 650; }
.smart-image-step-head p { margin: 0; color: var(--si-muted); font-size: 12px; line-height: 1.55; }
.smart-image-category-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.smart-image-category-grid button, .smart-image-preset-grid button { position: relative; overflow: hidden; padding: 0; border: 1px solid var(--si-line); border-radius: 7px; background: #fff; color: inherit; text-align: left; cursor: pointer; }
.smart-image-category-grid button:hover, .smart-image-preset-grid button:hover { border-color: #b8c0c8; }
.smart-image-category-grid button:focus-visible, .smart-image-preset-grid button:focus-visible, .smart-image-flow button:focus-visible, .smart-image-flow input:focus-visible, .smart-image-flow select:focus-visible, .smart-image-flow textarea:focus-visible, .smart-image-flow summary:focus-visible { outline: 3px solid rgba(200, 90, 36, .24); outline-offset: 2px; }
.smart-image-category-grid button.is-selected, .smart-image-preset-grid button.is-selected { border-color: var(--si-accent); box-shadow: inset 0 0 0 1px var(--si-accent); }
.smart-image-category-grid img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 1px solid var(--si-line); }
.smart-image-category-grid button > span, .smart-image-preset-media > span { position: absolute; top: 8px; right: 8px; padding: 3px 6px; border-radius: 4px; background: rgba(32, 38, 46, .86); color: #fff; font-size: 9px; font-weight: 800; }
.smart-image-preset-media > span { top: auto; right: 6px; bottom: 6px; left: 6px; line-height: 1.35; text-align: center; }
.smart-image-category-grid strong, .smart-image-category-grid small { display: block; margin: 0 12px; }
.smart-image-category-grid strong { margin-top: 11px; font-size: 14px; }
.smart-image-category-grid small { min-height: 55px; margin-top: 5px; color: var(--si-muted); font-size: 11px; line-height: 1.55; }
.smart-image-inline-error { min-height: 20px; margin: 12px 0 0; color: var(--si-danger); font-size: 12px; line-height: 1.55; }
.smart-image-inline-error:empty { min-height: 0; margin-top: 0; }
.smart-image-limits { display: flex; flex-wrap: wrap; gap: 7px 12px; margin: -6px 0 14px; color: var(--si-muted); font-size: 10px; }
.smart-image-limits span::before { margin-right: 5px; color: var(--si-success); content: "✓"; }
.smart-image-upload-area { margin-top: 22px; }
.smart-image-mode-area { margin-top: 4px; }
.smart-image-mode-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.smart-image-mode-switch button { display: grid; min-height: 68px; align-content: center; justify-items: start; gap: 4px; padding: 11px 13px; text-align: left; }
.smart-image-mode-switch button strong { color: inherit; font-size: 12px; }
.smart-image-mode-switch button small { color: var(--si-muted); font-size: 10px; font-weight: 500; line-height: 1.45; }
.smart-image-mode-switch button.is-selected { border-color: var(--si-accent); background: #fff8f3; color: var(--si-accent-strong); box-shadow: inset 0 0 0 1px var(--si-accent); }
.smart-image-mode-switch button.is-selected small { color: #7b4b35; }
.smart-image-mode-switch button[hidden] { display: none; }
.smart-image-text-area { display: grid; gap: 7px; margin-top: 12px; padding: 14px; border: 1px solid var(--si-line); border-radius: 7px; background: var(--si-soft); }
.smart-image-text-area[hidden] { display: none; }
.smart-image-text-area label { display: grid; gap: 7px; color: var(--si-ink); font-size: 11px; font-weight: 800; }
.smart-image-text-area label em { margin-left: 5px; color: var(--si-danger); font-size: 9px; font-style: normal; }
.smart-image-text-area textarea { min-height: 118px; background: #fff; line-height: 1.65; }
.smart-image-text-area > div { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; color: var(--si-muted); font-size: 10px; line-height: 1.45; }
.smart-image-text-area > div span { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.smart-image-subhead { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin: 22px 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--si-line); }
.smart-image-subhead strong { font-size: 13px; }
.smart-image-subhead span { color: var(--si-muted); font-size: 10px; text-align: right; }
.smart-image-role-list { display: grid; gap: 10px; }
.smart-image-role { display: grid; grid-template-columns: minmax(190px, .75fr) minmax(0, 2fr); gap: 14px; align-items: stretch; padding: 13px 0; border-bottom: 1px solid var(--si-line); }
.smart-image-role-info { display: grid; align-content: center; gap: 4px; }
.smart-image-role-info strong { font-size: 13px; }
.smart-image-role-info strong em { margin-left: 6px; color: var(--si-danger); font-size: 10px; font-style: normal; }
.smart-image-role-info small { color: var(--si-muted); font-size: 10px; line-height: 1.5; }
.smart-image-role-drop { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 10px; min-width: 0; }
.smart-image-role-drop > label { display: grid; place-items: center; min-height: 92px; padding: 10px; border: 1px dashed #b9c1ca; border-radius: 6px; background: var(--si-soft); color: #4e5863; font-size: 11px; font-weight: 800; text-align: center; cursor: pointer; }
.smart-image-role-drop > label:hover { border-color: var(--si-accent); color: var(--si-accent-strong); }
.smart-image-role-drop > label input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.smart-image-anchor-role { align-items: center; padding: 10px 0 14px; }
.smart-image-anchor-card { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-width: 0; padding: 8px; border: 1px solid rgba(38, 115, 77, .35); border-radius: 6px; background: #f3f8f5; }
.smart-image-anchor-card img { display: block; width: 76px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; }
.smart-image-anchor-card > div { display: grid; min-width: 0; gap: 3px; }
.smart-image-anchor-card strong, .smart-image-anchor-card small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.smart-image-anchor-card strong { font-size: 11px; }
.smart-image-anchor-card small { color: var(--si-muted); font-size: 9px; }
.smart-image-anchor-card button { min-height: 34px; padding: 0 10px; font-size: 10px; }
.smart-image-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; min-width: 0; }
.smart-image-file { position: relative; min-width: 0; border: 1px solid var(--si-line); border-radius: 6px; background: #fff; }
.smart-image-file img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 5px 5px 0 0; }
.smart-image-file > button { position: absolute; top: 5px; right: 5px; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: rgba(32,38,46,.86); color: #fff; cursor: pointer; }
.smart-image-file strong, .smart-image-file small { display: block; overflow: hidden; margin: 6px 7px 0; text-overflow: ellipsis; white-space: nowrap; }
.smart-image-file strong { font-size: 10px; }
.smart-image-file small { margin-bottom: 6px; color: var(--si-muted); font-size: 9px; }
.smart-image-file input { width: calc(100% - 12px); min-height: 32px; margin: 0 6px 6px; padding: 5px 7px; border: 1px solid var(--si-line); border-radius: 4px; font-size: 10px; }
.smart-image-primary-badge { position: absolute; top: 6px; left: 6px; padding: 3px 5px; border-radius: 4px; background: var(--si-accent); color: #fff; font-size: 9px; font-weight: 850; }
.smart-image-preserve { display: grid; gap: 10px; margin-top: 18px; padding: 16px 0 2px; }
.smart-image-preserve-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.smart-image-preserve-heading > div { display: grid; gap: 3px; }
.smart-image-preserve-heading strong { color: var(--si-text); font-size: 13px; line-height: 1.45; }
.smart-image-preserve-heading small, .smart-image-preserve-heading > span { color: var(--si-muted); font-size: 10px; line-height: 1.45; }
.smart-image-preserve-heading > span { flex: 0 0 auto; padding-top: 2px; font-weight: 800; }
.smart-image-preserve-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 7px; }
.smart-image-preserve-grid label { display: flex; align-items: center; gap: 7px; min-width: 0; min-height: 42px; padding: 0 9px; border: 1px solid var(--si-line); border-radius: 5px; background: #fff; color: #3d4752; font-size: 10px; font-weight: 800; line-height: 1.35; cursor: pointer; }
.smart-image-preserve-grid label:hover { border-color: #b8c0c8; }
.smart-image-preserve-grid label:has(input:checked) { border-color: rgba(200, 90, 36, .5); background: #fff9f5; color: var(--si-accent-strong); }
.smart-image-preserve-grid input[type="checkbox"] { appearance: auto; flex: 0 0 16px; width: 16px; height: 16px; min-height: 16px; margin: 0; padding: 0; border: 0; border-radius: 3px; accent-color: var(--si-accent); box-shadow: none; }
.smart-image-preserve-grid span { min-width: 0; overflow-wrap: anywhere; }
.smart-image-preserve-note { display: grid; grid-template-columns: minmax(140px, .4fr) minmax(0, 2fr); align-items: center; gap: 10px; margin-top: 2px; color: #3c4651; font-size: 11px; font-weight: 800; }
.smart-image-preserve-note small { color: var(--si-muted); font-weight: 500; }
.smart-image-preserve-note input { width: 100%; min-height: 38px; }
.smart-image-analysis-choice { display: grid; grid-template-columns: minmax(240px, 1fr) auto; gap: 12px 18px; align-items: end; padding: 18px; border: 1px solid var(--si-line); border-radius: 7px; background: var(--si-soft); }
.smart-image-analysis-choice label { display: grid; gap: 7px; font-size: 11px; font-weight: 800; }
.smart-image-analysis-choice > div { display: flex; gap: 8px; }
.smart-image-analysis-choice > small { grid-column: 1 / -1; color: var(--si-muted); font-size: 10px; }
.smart-image-flow select, .smart-image-flow input, .smart-image-flow textarea { width: 100%; min-width: 0; border: 1px solid #cdd3da; border-radius: 6px; background: #fff; color: var(--si-ink); }
.smart-image-flow select, .smart-image-flow input { min-height: 42px; padding: 0 10px; }
.smart-image-flow textarea { min-height: 82px; padding: 10px; resize: vertical; }
.smart-image-flow button { min-height: 40px; padding: 0 14px; border: 1px solid #cbd1d8; border-radius: 6px; background: #fff; color: #303944; font-weight: 800; cursor: pointer; }
.smart-image-flow button.primary { border-color: var(--si-accent); background: var(--si-accent); color: #fff; }
.smart-image-flow button.primary:hover { border-color: var(--si-accent-strong); background: var(--si-accent-strong); }
.smart-image-flow button.text-button { border-color: transparent; background: transparent; color: var(--si-muted); }
.smart-image-flow button:disabled { cursor: not-allowed; opacity: .48; }
.smart-image-insight { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(0, 1.5fr); gap: 16px; padding: 14px 16px; border: 1px solid #cad9d2; border-left: 4px solid var(--si-success); border-radius: 6px; background: #f3f8f5; }
.smart-image-insight > div { display: grid; align-content: start; gap: 4px; }
.smart-image-insight strong { font-size: 12px; }
.smart-image-insight span { color: var(--si-muted); font-size: 10px; line-height: 1.5; }
.smart-image-insight ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.smart-image-insight li { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 7px; color: #4b5560; font-size: 10px; line-height: 1.45; }
.smart-image-insight li b { color: var(--si-success); }
.smart-image-analysis-result { margin-top: 16px; }
.smart-image-analysis-summary { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: 12px; }
.smart-image-analysis-summary span { color: var(--si-success); }
.smart-image-analysis-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.smart-image-analysis-group { padding: 13px; border-left: 3px solid #aeb7c0; background: var(--si-soft); }
.smart-image-analysis-group[data-kind="facts"] { border-color: var(--si-success); }
.smart-image-analysis-group[data-kind="suggestions"] { border-color: #457798; }
.smart-image-analysis-group[data-kind="missing"] { border-color: var(--si-warning); }
.smart-image-analysis-group[data-kind="risks"] { border-color: var(--si-danger); }
.smart-image-analysis-group strong { font-size: 12px; }
.smart-image-analysis-group ul { display: grid; gap: 7px; margin: 9px 0 0; padding: 0; list-style: none; }
.smart-image-analysis-group li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; color: #4b5560; font-size: 11px; line-height: 1.45; }
.smart-image-analysis-group li.is-rejected { opacity: .45; text-decoration: line-through; }
.smart-image-analysis-group li button { min-height: 28px; padding: 0 7px; border-color: transparent; background: transparent; font-size: 10px; }
.smart-image-preset-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.smart-image-flow[data-smart-image-category="ecommerce"] .smart-image-preset-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.smart-image-preset-media { position: relative; }
.smart-image-preset-media img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 1px solid var(--si-line); }
.smart-image-preset-copy { display: grid; gap: 6px; padding: 11px 12px 13px; }
.smart-image-preset-copy > span { color: var(--si-accent-strong); font-size: 9px; font-weight: 850; }
.smart-image-preset-copy strong { font-size: 13px; }
.smart-image-preset-copy small { min-height: 33px; color: var(--si-muted); font-size: 10px; line-height: 1.55; }
.smart-image-preset-copy .smart-image-preset-meta { min-height: 0; padding-top: 6px; border-top: 1px solid var(--si-line); font-size: 9px; }
.smart-image-preset-copy em { color: var(--si-warning); font-size: 10px; font-style: normal; line-height: 1.45; }
.smart-image-preset-grid button:disabled { filter: grayscale(.45); }
.smart-image-preset-grid button.is-partial { border-color: #d6a47e; box-shadow: inset 0 0 0 1px #d6a47e; }
.smart-image-task-preview { margin-top: 14px; padding: 14px 0; border-top: 1px solid var(--si-line); border-bottom: 1px solid var(--si-line); }
.smart-image-output-group + .smart-image-output-group { margin-top: 16px; }
.smart-image-output-group > header { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; color: var(--si-muted); font-size: 10px; }
.smart-image-output-group > header strong { color: var(--si-ink); font-size: 12px; }
.smart-image-output-group > div { display: grid; gap: 7px; }
.smart-image-output-row { display: grid; grid-template-columns: minmax(260px, 1.4fr) minmax(180px, 1fr) 86px 76px 82px; gap: 8px; align-items: center; min-width: 0; padding: 9px; border: 1px solid var(--si-line); border-radius: 6px; background: #fff; }
.smart-image-output-row.is-selected { border-color: rgba(200, 90, 36, .55); background: #fffaf7; }
.smart-image-output-row.has-warning { border-style: dashed; }
.smart-image-output-row > label:not(.smart-image-output-check) { display: grid; gap: 3px; min-width: 0; color: var(--si-muted); font-size: 9px; font-weight: 750; }
.smart-image-output-row select { min-height: 36px; padding: 0 7px; font-size: 10px; }
.smart-image-output-row > output { color: var(--si-accent-strong); font-size: 10px; font-weight: 850; text-align: right; }
.smart-image-output-row > p { grid-column: 2 / -1; margin: -2px 0 0; color: var(--si-warning); font-size: 9px; line-height: 1.4; }
.smart-image-output-check { display: grid; grid-template-columns: 17px minmax(0, 1fr) auto; gap: 8px; align-items: center; min-width: 0; cursor: pointer; }
.smart-image-output-check input { appearance: auto; width: 17px; height: 17px; min-height: 17px; margin: 0; accent-color: var(--si-accent); }
.smart-image-output-check > span { display: grid; gap: 2px; min-width: 0; }
.smart-image-output-check strong { font-size: 11px; }
.smart-image-output-check small { overflow: hidden; color: var(--si-muted); font-size: 9px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.smart-image-output-check em { padding: 3px 5px; border-radius: 4px; background: #e9f5ee; color: var(--si-success); font-size: 8px; font-style: normal; font-weight: 850; white-space: nowrap; }
.smart-image-product-note { display: grid; gap: 4px; margin-bottom: 16px; padding: 12px 14px; border-left: 3px solid var(--si-success); background: #f3f8f5; }
.smart-image-product-note strong { color: var(--si-success); font-size: 11px; }
.smart-image-product-note span { color: var(--si-muted); font-size: 10px; line-height: 1.55; }
.smart-image-product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.smart-image-product-grid label { display: grid; gap: 6px; min-width: 0; color: #3c4651; font-size: 11px; font-weight: 800; }
.smart-image-product-grid label small { color: var(--si-muted); font-weight: 500; }
.smart-image-product-grid .full { grid-column: 1 / -1; }
.smart-image-brief-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.smart-image-brief-grid label { display: grid; gap: 6px; min-width: 0; color: #3c4651; font-size: 11px; font-weight: 800; }
.smart-image-brief-grid label small { color: var(--si-muted); font-weight: 500; }
.smart-image-brief-grid .full { grid-column: 1 / -1; }
.smart-image-advanced { margin-top: 14px; border-top: 1px solid var(--si-line); border-bottom: 1px solid var(--si-line); }
.smart-image-advanced summary { min-height: 44px; padding: 14px 2px; color: #3e4752; font-size: 11px; font-weight: 850; cursor: pointer; }
.smart-image-advanced[open] { padding-bottom: 14px; }
.smart-image-review { display: grid; gap: 9px; }
.smart-image-review-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 9px 0; border-bottom: 1px solid var(--si-line); }
.smart-image-review-row span { color: var(--si-muted); font-size: 10px; }
.smart-image-review-row strong { font-size: 11px; line-height: 1.5; }
.smart-image-review-row em { color: var(--si-accent-strong); font-size: 10px; font-style: normal; font-weight: 850; }
.smart-image-cost-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); margin-top: 15px; border: 1px solid var(--si-line); border-radius: 7px; }
.smart-image-cost-summary div { display: grid; gap: 4px; padding: 12px; border-right: 1px solid var(--si-line); }
.smart-image-cost-summary div:last-child { border-right: 0; }
.smart-image-cost-summary span { color: var(--si-muted); font-size: 9px; }
.smart-image-cost-summary strong { font-size: 13px; overflow-wrap: anywhere; }
.smart-image-balance-action { display: inline-flex; min-height: 40px; align-items: center; margin-top: 10px; color: var(--si-accent-strong); font-size: 11px; font-weight: 850; }
.smart-image-balance-action[hidden] { display: none; }
.smart-image-model-extras { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.smart-image-model-extras:empty { display: none; }
.smart-image-model-extras label { display: grid; gap: 6px; }
.smart-image-model-extras .smart-image-extra-toggle { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.smart-image-model-extras .smart-image-extra-toggle input { width: 18px; min-height: 18px; }
.smart-image-actions { position: sticky; z-index: 7; bottom: 0; display: flex; justify-content: flex-end; gap: 9px; margin-top: 15px; padding: 12px 0; border-top: 1px solid var(--si-line); background: #fff; }
.smart-image-actions button { min-height: 46px; }
.smart-image-actions .primary { min-width: 240px; }
.smart-image-delivery-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.smart-image-delivery-toolbar label { margin-right: auto; font-size: 11px; font-weight: 750; }
.smart-image-delivery-toolbar label input { width: 16px; min-height: 16px; vertical-align: middle; }
.smart-image-delivery-toolbar select { width: auto; max-width: 180px; }
.smart-image-result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.smart-image-result { overflow: hidden; border: 1px solid var(--si-line); border-radius: 7px; background: #fff; }
.smart-image-result.is-selected { border-color: var(--si-success); box-shadow: inset 0 0 0 1px var(--si-success); }
.smart-image-result-media { position: relative; display: grid; place-items: center; aspect-ratio: 1 / 1; overflow: hidden; background: #eef1f3; }
.smart-image-result-media img { width: 100%; height: 100%; object-fit: cover; }
.smart-image-result-placeholder { display: grid; justify-items: center; gap: 9px; padding: 18px; color: var(--si-muted); font-size: 11px; text-align: center; }
.smart-image-spinner { width: 24px; height: 24px; border: 2px solid #cbd2d8; border-top-color: var(--si-accent); border-radius: 50%; animation: smart-image-spin .8s linear infinite; }
@keyframes smart-image-spin { to { transform: rotate(360deg); } }
.smart-image-result-body { display: grid; gap: 8px; padding: 11px; }
.smart-image-result-title { display: flex; justify-content: space-between; gap: 8px; }
.smart-image-result-title > div { min-width: 0; }
.smart-image-result-title strong, .smart-image-result-title small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.smart-image-result-title strong { font-size: 12px; }
.smart-image-result-title small { margin-top: 3px; color: var(--si-muted); font-size: 9px; }
.smart-image-state { flex: 0 0 auto; color: var(--si-muted); font-size: 9px; font-weight: 850; }
.smart-image-state.is-good { color: var(--si-success); }
.smart-image-state.is-warning { color: var(--si-warning); }
.smart-image-state.is-error { color: var(--si-danger); }
.smart-image-result-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.smart-image-result-tags span { padding: 3px 6px; border: 1px solid var(--si-line); border-radius: 4px; color: #58626e; font-size: 9px; }
.smart-image-result-error { margin: 0; color: var(--si-danger); font-size: 10px; line-height: 1.45; }
.smart-image-result-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.smart-image-result-actions button, .smart-image-result-actions a { display: grid; place-items: center; min-height: 34px; padding: 0 7px; border: 1px solid var(--si-line); border-radius: 5px; background: #fff; color: #35404a; font-size: 9px; font-weight: 800; text-decoration: none; }
.smart-image-result-actions .is-primary { border-color: var(--si-success); color: var(--si-success); }
.smart-image-dialog { position: fixed; width: min(92vw, 920px); max-width: none; max-height: 90vh; padding: 38px 14px 14px; border: 1px solid #69737d; border-radius: 8px; background: #171b20; }
.smart-image-dialog::backdrop { background: rgba(16,20,24,.7); }
.smart-image-dialog > button { position: absolute; top: 5px; right: 6px; width: 32px; min-height: 32px; padding: 0; border-color: transparent; background: transparent; color: #fff; font-size: 22px; }
.smart-image-dialog > img { display: block; max-width: 100%; max-height: calc(90vh - 55px); margin: 0 auto; object-fit: contain; }
.smart-image-compare-dialog > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.smart-image-compare-dialog figure { margin: 0; color: #fff; }
.smart-image-compare-dialog img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; background: #0f1215; }
.smart-image-compare-dialog figcaption { padding: 7px 0; font-size: 11px; }
.smart-image-refine { position: fixed; z-index: 50; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); padding: 18px; border-left: 1px solid var(--si-line); background: #fff; box-shadow: -12px 0 36px rgba(22,28,34,.18); }
.smart-image-refine[hidden] { display: none; }
.smart-image-refine header { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 18px; padding-bottom: 13px; border-bottom: 1px solid var(--si-line); }
.smart-image-refine header strong, .smart-image-refine header small { display: block; }
.smart-image-refine header small { margin-top: 4px; color: var(--si-muted); font-size: 10px; }
.smart-image-refine header button { width: 34px; min-height: 34px; padding: 0; font-size: 19px; }
.smart-image-refine-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.smart-image-refine-options button.is-selected { border-color: var(--si-accent); color: var(--si-accent-strong); }
.smart-image-refine label { display: grid; gap: 7px; margin-top: 15px; font-size: 11px; font-weight: 800; }
.smart-image-refine p { color: var(--si-muted); font-size: 10px; line-height: 1.55; }
.smart-image-refine > .primary { width: 100%; min-height: 46px; }

html[data-theme="dark"] .smart-image-flow {
  --si-ink: #eef2f5;
  --si-muted: #abb4bd;
  --si-line: #46505a;
  --si-soft: #252c33;
}
html[data-theme="dark"] .smart-image-progress, html[data-theme="dark"] .smart-image-actions, html[data-theme="dark"] .smart-image-category-grid button, html[data-theme="dark"] .smart-image-preset-grid button, html[data-theme="dark"] .smart-image-file, html[data-theme="dark"] .smart-image-result, html[data-theme="dark"] .smart-image-refine { background: #1e252c; }
html[data-theme="dark"] .smart-image-mode-switch button.is-selected, html[data-theme="dark"] .smart-image-text-area textarea { background: #252d35; }
html[data-theme="dark"] .smart-image-mode-switch button.is-selected small { color: #d7a185; }
html[data-theme="dark"] .smart-image-text-area { background: #171d23; }
html[data-theme="dark"] .smart-image-anchor-card { background: #182720; }
html[data-theme="dark"] .smart-image-flow select, html[data-theme="dark"] .smart-image-flow input, html[data-theme="dark"] .smart-image-flow textarea, html[data-theme="dark"] .smart-image-flow button { border-color: #4b5661; background: #252d35; color: #eef2f5; }
html[data-theme="dark"] .smart-image-role-drop > label { background: #252d35; color: #c6cdd4; }
html[data-theme="dark"] .smart-image-insight, html[data-theme="dark"] .smart-image-product-note { border-color: #466354; background: #213129; }
html[data-theme="dark"] .smart-image-output-row { background: #1e252c; }
html[data-theme="dark"] .smart-image-output-row.is-selected { background: #302820; }
html[data-theme="dark"] .smart-image-preserve-grid label { border-color: #4b5661; background: #252d35; color: #d9e0e6; }
html[data-theme="dark"] .smart-image-preserve-grid label:has(input:checked) { border-color: #a95a35; background: #302820; color: #f2b28f; }
html[data-theme="dark"] .smart-image-result-media { background: #161c22; }

@media (max-width: 900px) {
  .smart-image-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .smart-image-preset-grid, .smart-image-result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .smart-image-flow[data-smart-image-category="ecommerce"] .smart-image-preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .smart-image-progress { grid-template-columns: repeat(var(--smart-image-step-count, 3), minmax(105px, 1fr)); }
  .smart-image-output-row { grid-template-columns: minmax(220px, 1.4fr) minmax(160px, 1fr) 78px 72px; }
  .smart-image-output-row > output { grid-column: 4; }
  .smart-image-output-row > p { grid-column: 2 / -1; }
  .smart-image-cost-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .smart-image-preserve-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .smart-image-head { padding-bottom: 12px; }
  .smart-image-head h2 { font-size: 18px; }
  .smart-image-head p { font-size: 11px; }
  .smart-image-mobile-progress { display: grid; flex: 0 0 132px; gap: 6px; }
  .smart-image-mobile-progress strong { font-size: 10px; line-height: 1.35; }
  .smart-image-mobile-progress > span { display: block; height: 4px; overflow: hidden; border-radius: 2px; background: var(--si-line); }
  .smart-image-mobile-progress i { display: block; width: 33.33%; height: 100%; background: var(--si-accent); transition: width .2s ease; }
  .smart-image-progress { position: relative; top: auto; grid-template-columns: repeat(var(--smart-image-step-count, 3), minmax(0, 1fr)); margin-right: -12px; margin-left: -12px; padding: 11px 12px; }
  .smart-image-progress li { grid-template-columns: 25px minmax(0, 1fr); justify-items: start; align-items: center; gap: 6px; text-align: left; }
  .smart-image-progress li b { width: 25px; height: 25px; }
  .smart-image-progress li::before { display: none; }
  .smart-image-stage { min-height: 420px; }
  .smart-image-step { padding-top: 20px; }
  .smart-image-step-head { grid-template-columns: 38px minmax(0, 1fr); }
  .smart-image-step-head > b { width: 38px; height: 38px; }
  .smart-image-step-head h3 { font-size: 16px; }
  .smart-image-category-grid, .smart-image-preset-grid, .smart-image-result-grid, .smart-image-analysis-groups, .smart-image-product-grid, .smart-image-brief-grid, .smart-image-model-extras { grid-template-columns: minmax(0, 1fr); }
  .smart-image-flow[data-smart-image-category="ecommerce"] .smart-image-preset-grid { grid-template-columns: minmax(0, 1fr); }
  .smart-image-insight { grid-template-columns: minmax(0, 1fr); }
  .smart-image-output-row { grid-template-columns: minmax(0, 1fr) minmax(125px, .8fr) 74px; }
  .smart-image-output-row > label:nth-of-type(4) { grid-column: 2; }
  .smart-image-output-row > output { grid-column: 3; grid-row: 2; }
  .smart-image-output-row > p { grid-column: 1 / -1; }
  .smart-image-category-grid small, .smart-image-preset-copy small { min-height: 0; padding-bottom: 12px; }
  .smart-image-role { grid-template-columns: minmax(0, 1fr); }
  .smart-image-role-drop { grid-template-columns: 105px minmax(0, 1fr); }
  .smart-image-preserve-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .smart-image-preserve-note { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .smart-image-analysis-choice { grid-template-columns: minmax(0, 1fr); padding: 13px; }
  .smart-image-analysis-choice > div { display: grid; }
  .smart-image-brief-grid .full { grid-column: auto; }
  .smart-image-product-grid .full { grid-column: auto; }
  .smart-image-review-row { grid-template-columns: 105px minmax(0, 1fr); }
  .smart-image-review-row em { grid-column: 2; }
  .smart-image-delivery-toolbar label { width: 100%; }
  .smart-image-delivery-toolbar select, .smart-image-delivery-toolbar button { flex: 1 1 calc(50% - 4px); width: auto; min-width: 0; }
  .smart-image-actions { margin-right: -12px; margin-left: -12px; padding: 10px 12px; }
  .smart-image-actions button { min-height: 44px; }
  .smart-image-actions .primary { flex: 1; min-width: 0; }
  .smart-image-compare-dialog > div { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
  .smart-image-head { align-items: start; }
  .smart-image-head > div:first-child span, .smart-image-head > div:first-child p { display: none; }
  .smart-image-head h2 { margin-top: 1px; }
  .smart-image-mobile-progress { flex-basis: 128px; }
  .smart-image-role-drop { grid-template-columns: minmax(0, 1fr); }
  .smart-image-anchor-card { grid-template-columns: 64px minmax(0, 1fr); }
  .smart-image-anchor-card img { width: 64px; }
  .smart-image-anchor-card button { grid-column: 1 / -1; }
  .smart-image-mode-switch { grid-template-columns: minmax(0, 1fr); }
  .smart-image-role-drop > label { min-height: 66px; }
  .smart-image-output-row { grid-template-columns: minmax(0, 1fr) 74px; }
  .smart-image-output-check { grid-column: 1 / -1; }
  .smart-image-output-row > label:nth-of-type(2) { grid-column: 1 / -1; }
  .smart-image-output-row > label:nth-of-type(3), .smart-image-output-row > label:nth-of-type(4) { grid-column: auto; }
  .smart-image-output-row > output { grid-column: 2; grid-row: 3; }
  .smart-image-cost-summary { grid-template-columns: minmax(0, 1fr); }
  .smart-image-cost-summary div { border-right: 0; border-bottom: 1px solid var(--si-line); }
  .smart-image-cost-summary div:last-child { border-bottom: 0; }
}
