/* Image editor styles (the command chrome lives in shared/chrome.css, shared pieces in shared/kit.css). */
#img-main { flex: 1; min-height: 0; display: flex; }

/* foreground/background colors on the bars (w.colors): a 36 × 56 column on the left bar, a compact 52 × 32 group on the top bar */
/* layout containment: the icons' line boxes never make the top bar overflow into More */
.img-colors { position: relative; flex: none; align-self: center; contain: layout; }
.cmd-left .img-colors { grid-column: 1 / -1; justify-self: center; margin-top: 2px; }
.img-chips { position: absolute; left: 0; top: 0; }
.img-chip { position: absolute; padding: 0; border: 1px solid #fff; border-radius: 4px; box-shadow: 0 0 0 1px rgba(24, 24, 27, .45); cursor: pointer; }
.img-chip-fg { z-index: 1; }
.img-chip:hover { box-shadow: 0 0 0 1px var(--prog-strong); }
.img-chip:focus-visible, .img-cbtn:focus-visible { outline: 2px solid var(--prog); outline-offset: 1px; }
.img-cbtn {
  position: absolute; display: inline-flex; align-items: center; justify-content: center; padding: 0;
  border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer;
}
.img-cbtn:hover { background: var(--hover); color: var(--text); }
.img-cbtn .material-symbols-outlined { font-size: 15px; }
.img-colors.v { width: 36px; height: 56px; }
.img-colors.v .img-chips { width: 36px; height: 36px; }
.img-colors.v .img-chip { width: 20px; height: 20px; }
.img-colors.v .img-chip-fg { left: 4px; top: 3px; }
.img-colors.v .img-chip-bg { left: 13px; top: 12px; }
.img-colors.v > .img-cbtn { top: 37px; width: 18px; height: 18px; }
.img-colors.v > .img-cbtn:nth-child(2) { left: 0; }
.img-colors.v > .img-cbtn:nth-child(3) { left: 18px; }
.img-colors.h { width: 52px; height: 32px; }
.img-colors.h .img-chips { width: 32px; height: 32px; }
.img-colors.h .img-chip { width: 17px; height: 17px; }
.img-colors.h .img-chip-fg { left: 4px; top: 4px; }
.img-colors.h .img-chip-bg { left: 12px; top: 12px; }
.img-colors.h > .img-cbtn { left: 33px; width: 18px; height: 16px; }
.img-colors.h > .img-cbtn:nth-child(2) { top: 0; }
.img-colors.h > .img-cbtn:nth-child(3) { top: 16px; }
.img-zoom { font-variant-numeric: tabular-nums; }

#img-stage { position: relative; flex: 1; min-width: 0; overflow: hidden; background: var(--desk); }
#img-view { position: absolute; inset: 0; display: block; touch-action: none; }
.img-sb { position: absolute; z-index: 4; background: color-mix(in srgb, var(--surface) 55%, transparent); }
.img-sb.h { left: 0; right: 12px; bottom: 0; height: 12px; }
.img-sb.v { top: 0; bottom: 12px; right: 0; width: 12px; }
.img-sb.h.full { right: 0; }
.img-sb.v.full { bottom: 0; }
.img-thumb { position: absolute; background: rgba(60, 64, 67, .45); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; cursor: default; }
.img-thumb:hover, .img-thumb.drag { background-color: rgba(60, 64, 67, .7); }
.img-sb.h .img-thumb { top: 0; bottom: 0; min-width: 24px; }
.img-sb.v .img-thumb { left: 0; right: 0; min-height: 24px; }
#img-text { position: absolute; z-index: 5; margin: 0; padding: 0 2px; border: 1px dashed var(--sel); background: rgba(255, 255, 255, .06); resize: none; overflow: hidden; white-space: pre; outline: none; }

/* tool settings: the first section of the right panel (rows like every property panel, shared/props.css) */
#img-tool-pane { display: flex; flex-direction: column; min-height: 0; }
#img-options { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px 12px; overflow: auto; font-size: 12.5px; }
.opt-ctl { display: flex; align-items: center; gap: 6px; min-width: 0; }
.opt-ctl input[type=range] { flex: 1; min-width: 40px; accent-color: var(--accent-strong); }
.opt-ctl .pf-select, .opt-ctl .pf-color { flex: 1; min-width: 0; }
.opt-ctl .pf-num.opt-numfield { width: 76px; flex: none; }
.opt-ctl input[type=checkbox] { margin: 0; accent-color: var(--accent-strong); flex: none; }
.opt-num {
  width: 54px; height: 28px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); padding: 0 4px; font: 12px var(--mono);
  background: var(--surface); color: var(--text); flex: none; font-variant-numeric: tabular-nums;
}
.opt-num:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.opt-unit { font-size: 11.5px; color: var(--muted); flex: none; min-width: 14px; }
.opt-seg { display: inline-flex; gap: 1px; background: var(--line-soft); border-radius: 8px; padding: 1px; flex: none; }
.opt-seg .tb-btn.active { background: var(--surface); color: var(--accent-strong); box-shadow: 0 0 0 1px var(--line); }
.opt-buttons { justify-content: flex-end; margin-top: 2px; }
.pf-note.opt-badge { padding: 6px 8px; border-radius: var(--radius-s); background: var(--warn-soft); color: var(--warn); }
.tb-btn.rot90 .material-symbols-outlined { transform: rotate(90deg); }

/* right panels */
#img-panels, #img-left { min-height: 0; }
.panel { display: flex; flex-direction: column; min-height: 0; border-bottom: 1px solid var(--line); }
#layers-panel { flex: 1; }
.layer-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 10px 8px; }
.layer-controls select { flex: 1; min-width: 110px; height: 28px; font-size: 12px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface); }
.layer-controls label { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.layer-controls input[type=number] { width: 52px; height: 26px; border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 4px; font-size: 12px; }
.layer-controls .tb-btn { width: 28px; }
#layers-list { flex: 1; min-height: 60px; overflow-y: auto; padding: 0 6px; }
.lrow { display: flex; align-items: center; gap: 4px; min-height: 42px; border-radius: 8px; cursor: pointer; padding-right: 6px; user-select: none; }
.lrow:hover { background: var(--hover); }
.lrow.active { background: var(--prog-soft); }
.lrow:focus-visible { outline: 2px solid var(--prog); }
.lrow.dim { opacity: .55; }
.lrow[data-drop="above"] { box-shadow: inset 0 2px 0 var(--prog-strong); }
.lrow[data-drop="below"] { box-shadow: inset 0 -2px 0 var(--prog-strong); }
.lrow[data-drop="into"] { outline: 2px solid var(--prog-strong); outline-offset: -2px; }
.l-eye { width: 28px; height: 28px; }
.l-eye .material-symbols-outlined { font-size: 18px; }
.l-caret { width: 22px; height: 22px; }
.l-folder { color: var(--muted); font-size: 22px; }
.l-clip { font-size: 16px; color: var(--muted); margin-right: -2px; }
.lthumb { flex: none; border: 1px solid var(--line); border-radius: 3px; background: #fff; }
.lthumb.sel { outline: 2px solid var(--prog-strong); outline-offset: 1px; }
.mthumb { cursor: pointer; }
.mthumb.off { opacity: .4; }
.l-name { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; }
.l-type { font-size: 16px; color: var(--muted); }
.l-rename { flex: 1; min-width: 0; font: inherit; font-size: 13px; padding: 2px 4px; border: 1px solid var(--prog-strong); border-radius: 3px; }
.l-badges { display: inline-flex; align-items: center; gap: 3px; flex: none; }
.l-badge { font-size: 10px; font-weight: 600; font-style: italic; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 3px; padding: 0 3px; }
.l-lock { font-size: 15px; color: var(--muted); }
button.l-badge { background: none; cursor: pointer; font-family: inherit; line-height: 1.3; }
button.l-badge:hover { border-color: var(--prog-strong); color: var(--prog-strong); }
.l-fx.off { opacity: .45; }
.fx-ico { font: italic 600 15px Georgia, 'Times New Roman', serif; line-height: 1; }
.layer-buttons { display: flex; justify-content: flex-end; gap: 2px; padding: 6px 8px; border-top: 1px solid var(--line-soft); }


/* dialogs */
.fx-dlg { display: grid; grid-template-columns: 190px 1fr; gap: 18px; min-height: 380px; }
.fx-list { display: flex; flex-direction: column; gap: 1px; border-right: 1px solid var(--line); padding-right: 10px; }
.fx-item { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 8px; border-radius: 6px; cursor: pointer; font-size: 13px; user-select: none; }
.fx-item:hover { background: var(--hover); }
.fx-item.active { background: var(--prog-soft); color: var(--prog-strong); font-weight: 500; }
.fx-item input { margin: 0; accent-color: var(--prog-strong); }
.fx-item:first-child { margin-bottom: 6px; }
.fx-pane { min-width: 0; max-height: 60vh; overflow-y: auto; padding-right: 4px; }
.fx-title { margin: 0 0 12px; font-size: 15px; font-weight: 500; }
.fx-pane .btn { align-self: flex-start; margin-top: 4px; }
.fx-pane input[type=color] { width: 56px; height: 30px; padding: 1px 2px; }
.fx-grad { display: flex; align-items: center; gap: 8px; }
.fx-grad-bar { flex: 1; height: 22px; border-radius: 4px; border: 1px solid var(--line); }
@media (max-width: 640px) {
  .fx-dlg { grid-template-columns: 1fr; }
  .fx-list { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 8px; flex-direction: row; flex-wrap: wrap; }
}
.slider-row { display: flex; align-items: center; gap: 10px; }
.slider-row input[type=range] { flex: 1; accent-color: var(--prog-strong); }
.slider-num { width: 76px; padding: 4px 6px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.anchor-grid { display: grid; grid-template-columns: repeat(3, 26px); gap: 3px; }
.anchor { width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface); cursor: pointer; }
.anchor.on { background: var(--prog-strong); border-color: var(--prog-strong); }
.curves-wrap { display: flex; flex-direction: column; gap: 6px; }
canvas.curves { width: 100%; max-width: 360px; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 4px; cursor: crosshair; touch-action: none; }

@media (max-width: 900px) {
  .layer-controls label:nth-of-type(2) { display: none; }
}
@media (max-width: 640px) {
  #img-panels { display: none; }
}

.l-fx .material-symbols-outlined { font-size: 14px; }
