/* ChatYoshi photo editor. Neutral greys around the picture so colours are judged fairly. */
html.ie-open, html.ie-open body { overflow: hidden; }
.ie { position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; background: #1e1e1f; color: #e8e6e3;
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; outline: none; }
.ie button, .ie input, .ie select { font: inherit; color: inherit; }
.ie-top { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #2a2a2b; border-bottom: 1px solid #3a3a3c; flex-wrap: nowrap; min-height: 52px; }
.ie-titles { min-width: 0; flex: 1 1 auto; overflow: hidden; }
.ie-title { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ie-sub { font-size: 12px; color: #a9a6a2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ie-group { display: flex; align-items: center; gap: 4px; flex: none; }
.ie-btn { background: #3a3a3c; border: 1px solid #4a4a4d; border-radius: 8px; padding: 6px 10px; cursor: pointer; line-height: 1.2; min-height: 32px; }
.ie-btn:hover:not(:disabled) { background: #46464a; }
.ie-btn:disabled { opacity: .45; cursor: default; }
.ie-btn.on { background: #D19A5E; border-color: #D19A5E; color: #1b1712; }
.ie-btn:focus-visible, .ie-tab:focus-visible, .ie input:focus-visible, .ie select:focus-visible { outline: 2px solid #f0b56f; outline-offset: 1px; }
.ie-primary { background: #D19A5E; border-color: #D19A5E; color: #1b1712; font-weight: 650; }
.ie-primary:hover:not(:disabled) { background: #e0ac72; }
.ie-cancel { background: transparent; }
.ie-seg .ie-btn { border-radius: 0; margin: 0 -1px 0 0; }
.ie-seg .ie-btn:first-child { border-radius: 8px 0 0 8px; }
.ie-seg .ie-btn:last-child { border-radius: 0 8px 8px 0; }
.ie-zlbl { min-width: 52px; text-align: center; font-variant-numeric: tabular-nums; font-size: 13px; color: #cfccc8; }
.ie-main { flex: 1; display: flex; min-height: 0; }
.ie-stage { position: relative; flex: 1; overflow: hidden; touch-action: none; cursor: grab;
  background-color: #2b2b2c; background-image: linear-gradient(45deg, #3a3a3b 25%, transparent 25%), linear-gradient(-45deg, #3a3a3b 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #3a3a3b 75%), linear-gradient(-45deg, transparent 75%, #3a3a3b 75%);
  background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; }
.ie-stage.ie-grabbing { cursor: grabbing; }
.ie-stage.ie-painting, .ie-stage.ie-cropping { cursor: crosshair; }
.ie-view { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.ie-view::before { content: ""; position: absolute; inset: 0; background-color: #fff; background-image: linear-gradient(45deg, #cfcfcf 25%, transparent 25%), linear-gradient(-45deg, #cfcfcf 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #cfcfcf 75%), linear-gradient(-45deg, transparent 75%, #cfcfcf 75%);
  background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 8px 30px rgba(0,0,0,.45); }
.ie-img { position: absolute; display: block; max-width: none; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.ie-before { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.ie-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ie-split { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.5); pointer-events: none; }
.ie-split-knob { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 30px; height: 30px; border-radius: 50%; background: #fff; color: #222; display: grid; place-items: center; font-size: 16px; box-shadow: 0 2px 8px rgba(0,0,0,.5); }
.ie-hud { position: absolute; left: 10px; bottom: 10px; padding: 3px 8px; border-radius: 6px; background: rgba(0,0,0,.6); font-size: 12px; pointer-events: none; font-variant-numeric: tabular-nums; }
.ie-rendering { position: absolute; right: 10px; top: 10px; padding: 3px 8px; border-radius: 6px; background: rgba(0,0,0,.6); font-size: 12px; pointer-events: none; }
.ie-busy { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: min(440px, 86%); padding: 18px; border-radius: 12px; background: rgba(28,28,30,.96); box-shadow: 0 10px 40px rgba(0,0,0,.5); display: grid; gap: 12px; z-index: 3; }
.ie-busy.ie-err { border: 1px solid #b54848; }
.ie-busy-bar { height: 6px; border-radius: 3px; background: #3a3a3c; overflow: hidden; }
.ie-busy-fill { height: 100%; background: #D19A5E; transition: width .2s; }
.ie-indet .ie-busy-fill { animation: ie-ind 1.2s ease-in-out infinite; }
@keyframes ie-ind { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
.ie-busy .ie-btn { justify-self: end; }
.ie-resizer { width: 6px; cursor: col-resize; background: #2a2a2b; border-left: 1px solid #3a3a3c; flex: none; }
.ie-resizer:hover { background: #4a4a4d; }
.ie-panel { width: 360px; flex: none; display: flex; flex-direction: column; background: #262627; min-height: 0; }
.ie-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; border-bottom: 1px solid #3a3a3c; }
.ie-tab { background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 6px 9px; cursor: pointer; color: #cfccc8; }
.ie-tab:hover { background: #333335; }
.ie-tab.on { background: #3a3a3c; border-color: #55555a; color: #fff; }
.ie-body { overflow: auto; padding: 12px 14px 24px; flex: 1; }
.ie-body h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: #bdb9b4; margin: 18px 0 6px; display: block; }
.ie-body h3 + .ie-badge { margin: 0 0 6px; }
.ie-body h3:first-child { margin-top: 4px; }
.ie-row { display: grid; grid-template-columns: 112px 1fr auto; align-items: center; gap: 8px; margin: 6px 0; }
.ie-row .ie-lbl { font-size: 13px; color: #d6d3cf; }
.ie-row input[type=checkbox] { justify-self: start; width: 18px; height: 18px; accent-color: #D19A5E; }
.ie-range { width: 100%; accent-color: #D19A5E; }
.ie-num { width: 72px; background: #1d1d1e; border: 1px solid #47474b; border-radius: 6px; padding: 4px 6px; text-align: right; font-variant-numeric: tabular-nums; }
.ie-grid4 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.ie-grid4 .ie-row { grid-template-columns: auto 1fr; }
.ie-grid4 .ie-num { width: 100%; }
.ie input[type=color] { width: 44px; height: 30px; border: 1px solid #47474b; border-radius: 6px; background: #1d1d1e; padding: 2px; }
.ie-select { background: #1d1d1e; border: 1px solid #47474b; border-radius: 6px; padding: 5px 6px; }
.ie-btnrow { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.ie-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.ie-chip { padding: 4px 9px; min-height: 28px; border-radius: 14px; }
.ie-note { font-size: 12.5px; color: #aaa6a1; margin: 8px 0; }
.ie-warnnote { color: #f0c27a; }
.ie-badge { display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 10px; vertical-align: middle; }
.ie-exact { background: #263b2c; color: #9fdcae; }
.ie-ai { background: #3b2a45; color: #d9b4f0; }
.ie-ok { background: #263b2c; color: #9fdcae; }
.ie-warn { background: #4a3a1c; color: #f0c27a; }
.ie-bad { background: #4a2222; color: #f3a3a3; }
.ie-kv { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid #333335; align-items: center; }
.ie-kv span { color: #aaa6a1; }
.ie-tips { padding-left: 18px; margin: 6px 0; font-size: 13px; color: #d6d3cf; }
.ie-tips li { margin: 4px 0; }
.ie-swrow { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.ie-swwrap { display: grid; justify-items: center; gap: 2px; width: 62px; }
.ie-swwrap code { font-size: 11px; color: #d6d3cf; }
.ie-swwrap small { font-size: 10.5px; color: #9a968f; text-align: center; }
.ie-sw { width: 44px; height: 44px; border-radius: 8px; border: 1px solid rgba(255,255,255,.25); cursor: pointer; }
.ie-role { border-radius: 10px; padding: 12px; margin: 10px 0 4px; border: 1px solid rgba(255,255,255,.12); }
.ie-role-h { font-size: 20px; font-weight: 750; }
.ie-role-p { font-size: 14px; margin: 4px 0 8px; }
.ie-role-btn { display: inline-block; padding: 5px 12px; border-radius: 8px; font-weight: 650; font-size: 13px; }
.ie-harm { margin: 10px 0; }
.ie-grad { height: 26px; border-radius: 6px; margin: 8px 0 2px; border: 1px solid rgba(255,255,255,.15); }
.ie-grad-naive { height: 12px; opacity: .9; }
.ie-color small { display: block; font-size: 11px; color: #9a968f; word-break: break-all; }
.ie-warnrow { display: flex; gap: 6px; align-items: center; font-size: 12.5px; margin: 4px 0; color: #f0c27a; }
.ie-mini { width: 16px; height: 16px; border-radius: 4px; border: 1px solid rgba(255,255,255,.3); flex: none; }
.ie-ckout { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ie-ksample { padding: 8px 12px; border-radius: 8px; font-weight: 600; }
.ie-dialog { position: absolute; inset: 0; background: rgba(0,0,0,.5); display: grid; place-items: center; z-index: 5; }
.ie-dbox { background: #2a2a2b; border: 1px solid #45454a; border-radius: 12px; padding: 18px; width: min(460px, 92vw); box-shadow: 0 12px 40px rgba(0,0,0,.5); }
.ie-opt { display: flex; gap: 10px; align-items: flex-start; padding: 8px; border-radius: 8px; cursor: pointer; }
.ie-opt:hover { background: #333335; }
.ie-opt span { display: grid; }
.ie-opt small { color: #aaa6a1; font-size: 12px; }
.ie-opt input { accent-color: #D19A5E; margin-top: 3px; }
@media (max-width: 820px) {
  /* phone: row 1 = Cancel · title · Export/Use, row 2 = history · compare · Fit/100% (pinch zooms) */
  .ie-top { flex-wrap: wrap; gap: 6px 4px; padding: 6px 8px; min-height: 0; }
  .ie-cancel { order: 0; }
  .ie-titles { order: 1; flex: 1 1 0; }
  .ie-actions { order: 2; }
  .ie-top::after { content: ""; order: 3; flex-basis: 100%; height: 0; }
  .ie-top > .ie-group:not(.ie-actions) { order: 4; }
  .ie-top > .ie-seg { margin: 0 auto; }
  .ie-zstep, .ie-fullbtn { display: none; }
  .ie-top .ie-btn { padding: 5px 8px; min-height: 34px; }
  .ie-main { flex-direction: column; }
  .ie-resizer { display: none; }
  .ie-panel { width: auto !important; height: 42vh; border-top: 1px solid #3a3a3c; }
  .ie-tabs { flex-wrap: nowrap; overflow-x: auto; }
  .ie-tab { white-space: nowrap; }
  .ie-row { grid-template-columns: 96px 1fr 64px; }
  .ie-btn { min-height: 36px; }
}
.ie [hidden] { display: none !important; }
.ie-img.ie-det { image-rendering: pixelated; }
.ie-list { display: grid; gap: 4px; }
@media (max-width: 400px) {
  .ie-top .ie-btn { padding: 4px 6px; font-size: 13px; }
  .ie-top > .ie-seg { margin: 0; }
  .ie-top { gap: 6px 2px; padding: 6px 4px; }
  .ie-top .ie-seg .ie-btn { padding: 4px 5px; }
}
