/* StratusPhoto web — app-specific styles on top of the shared shell (shared/shell.css). */

:root { --brand: #e0662f; --pasteboard: #2b2b30; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --pasteboard: #1a1a1e; } }
:root[data-theme="dark"] { --pasteboard: #1a1a1e; }

body { background: var(--bg); }
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 100; transition: opacity .25s ease; }
.boot.done { opacity: 0; pointer-events: none; }
.boot-card { display: flex; align-items: center; gap: 12px; color: var(--fg-2); font-size: 14px; }
.boot.error .boot-card { color: var(--bad); max-width: 520px; padding: 0 24px; }

#art, #overlay { width: 100%; height: 100%; }
.sc-canvas-host { background: var(--pasteboard); }
.sc-canvas-host:focus, .sc-canvas-host:focus-visible { outline: none; }
.sc-status-undo { color: var(--fg-3); flex: 0 0 auto; }
.sp-cursor { color: var(--fg-3); font-variant-numeric: tabular-nums; min-width: 76px; }
.sp-drop { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(224, 102, 47, .12); border: 2px dashed var(--brand); pointer-events: none; z-index: 2; }
.sp-drop > div { background: var(--panel); color: var(--fg); padding: 10px 16px; border-radius: 10px; font-size: 13px; box-shadow: var(--sui-shadow); }

/* Tool options bar */
.sp-check { display: inline-flex; align-items: center; gap: 6px; color: var(--fg-2); font-size: 12px; white-space: nowrap; }
.sp-unit { color: var(--fg-3); font-size: 12px; }
.sc-hint-opts .sc-pair .sui-range { width: 84px; }

/* Foreground / background chips (leading the tool-options bar) */
.sp-chips { position: relative; width: 38px; height: 30px; flex: 0 0 auto; margin-right: 4px; }
.sp-chip { position: absolute; width: 20px; height: 20px; border-radius: 5px; border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--line-strong); cursor: pointer; overflow: hidden; }
.sp-chip.fg { left: 0; top: 0; z-index: 2; }
.sp-chip.bg { left: 11px; top: 9px; }
.sp-chip-input { opacity: 0; width: 100%; height: 100%; border: 0; padding: 0; cursor: pointer; }
.sp-chip-swap { position: absolute; left: 25px; top: -3px; width: 14px; height: 14px; border: 0; padding: 0; background: transparent; color: var(--fg-2); cursor: pointer; }
.sp-chip-swap .ic { width: 12px; height: 12px; }
.sp-chip-reset { display: none; }

/* Layers */
.sp-layers li { min-height: 40px; gap: 6px; padding: 3px 6px 3px 2px; }
.sp-layers li.is-hidden .sp-lname { color: var(--fg-3); }
.sp-layers li[data-drop="above"] { box-shadow: inset 0 2px 0 var(--accent); }
.sp-layers li[data-drop="below"] { box-shadow: inset 0 -2px 0 var(--accent); }
.sp-layers li[data-drop="into"] { outline: 2px solid var(--accent); outline-offset: -2px; }
.sp-eye { flex: 0 0 auto; }
.sp-indent { flex: 0 0 auto; }
.sp-thumb { width: 38px; height: 28px; flex: 0 0 auto; border-radius: 4px; box-shadow: 0 0 0 1px var(--line-strong);
  background: repeating-conic-gradient(#d9d9de 0 25%, #fff 0 50%) 0 0 / 8px 8px; }
.sp-thumb-icon { display: inline-flex; align-items: center; justify-content: center; gap: 0; background: var(--card); color: var(--fg-2); box-shadow: none; }
.sp-mask { cursor: pointer; background: #000; }
.sp-mask.is-target { box-shadow: 0 0 0 2px var(--accent); }
.sp-mask.off { opacity: .45; }
.sp-twisty { width: 14px; height: 14px; border: 0; padding: 0; background: transparent; color: var(--fg-3); display: inline-flex; cursor: pointer; }
.sp-twisty .ic { width: 12px; height: 12px; transition: transform .12s ease; }
.sp-twisty.open .ic { transform: rotate(90deg); }
.sp-kind { color: var(--fg-3); display: inline-flex; }
.sp-clip { color: var(--fg-3); display: inline-flex; }
.sp-fx { font-style: italic; font-family: Georgia, serif; color: var(--fg-2); font-size: 13px; }
.sp-badge { font-size: 9.5px; font-weight: 700; color: var(--fg-2); border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 3px; }
.sp-blend { flex: 0 0 auto; }
.sp-rename { flex: 1; min-width: 0; height: 26px; }
.sp-layer-foot { display: flex; justify-content: space-between; padding: 8px 2px 4px; border-top: 1px solid var(--line); margin-top: 8px; position: sticky; bottom: 0; background: var(--panel); }

/* Properties */
.sp-prop-head { display: flex; align-items: center; gap: 8px; margin: 12px 4px 0; font-size: 13px; }
.sp-prop-head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-badge { font-size: 11px; font-weight: 600; color: var(--accent); background: var(--active); border-radius: 5px; padding: 1px 7px; }
.sp-ro { color: var(--fg-2); font-variant-numeric: tabular-nums; font-size: 12px; }
.sp-slider-row { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 8px; min-height: 32px; font-size: 12px; color: var(--fg-2); }
.sp-slider-row .sc-pair { width: 100%; }
.sp-slider-row .sc-pair .sui-range { flex: 1; min-width: 0; }
.sp-fx-row { display: flex; align-items: center; gap: 10px; min-height: 36px; border-bottom: 1px solid var(--line); }
.sp-fx-name { flex: 1; display: flex; align-items: center; justify-content: space-between; border: 0; background: transparent; color: var(--fg); font-size: 12.5px; text-align: left; padding: 0; cursor: pointer; }
.sp-fx-name:disabled { color: var(--fg-3); cursor: default; }
.sp-fx-body { padding: 4px 0 8px; border-bottom: 1px solid var(--line); }
.sp-sf { padding: 6px 0; border-bottom: 1px solid var(--line); }
.sp-sf.off { opacity: .55; }
.sp-sf-head { display: flex; align-items: center; gap: 10px; min-height: 32px; }
.sp-sf-head b { flex: 1; font-size: 12.5px; font-weight: 600; }

/* Adjustments */
.sp-adj-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.sp-adj-grid button { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 9px 2px; border: 0; border-radius: 10px; background: var(--card); color: var(--fg); font-size: 10.5px; cursor: pointer; min-width: 0; line-height: 1.2; text-align: center; }
.sp-adj-grid button:hover { background: var(--active); color: var(--accent); }
.sp-adj-grid .ic { width: 20px; height: 20px; }
.sp-filter-item { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 32px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--fg); font-size: 12.5px; text-align: left; padding: 0; cursor: pointer; }
.sp-filter-item:last-child { border-bottom: 0; }
.sp-filter-item:hover { color: var(--accent); }
.sp-filter-cat { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--fg-3); padding: 10px 0 2px; }
.sp-filter-cat:first-child { padding-top: 4px; }
.sp-xf-buttons { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; padding: 8px 0; }
.sp-xf-buttons .sui-btn { padding: 0 6px; white-space: nowrap; }
.sp-ro { white-space: nowrap; }

/* Brush */
.sp-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.sp-presets button { display: flex; align-items: center; gap: 8px; border: 0; border-radius: 8px; background: var(--card); color: var(--fg); font-size: 11.5px; padding: 6px 8px; text-align: left; cursor: pointer; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sp-presets button.is-active { background: var(--active); color: var(--accent); }
.sp-dab { width: 14px; height: 14px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.sp-dab.soft { background: radial-gradient(circle, currentColor 0, transparent 70%); }

/* History, channels */
.sp-history li.is-future { color: var(--fg-3); }
.sp-histo { width: 100%; height: 110px; display: block; border-radius: 6px; background: var(--card); }
.sp-chan { display: inline-block; width: 46px; height: 12px; border-radius: 3px; }

/* Dialogs */
.sp-dlg-params { display: flex; flex-direction: column; gap: 10px; min-width: min(360px, 80vw); }
.sp-dlg-params > label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--fg-2); }
.sp-dlg-params .sc-pair .sui-range { flex: 1; }

/* Phone */
.sp-opts-card .sc-pair { width: 100%; }
.sp-opts-card .sc-pair .sui-range { flex: 1; width: auto; }
.sp-opts-card .sc-row-ctl { flex: 1; justify-content: flex-end; }
.sp-opts-card .sc-block { padding: 8px 0; }
.sp-opts-card .sc-block > select.sui-input { width: 100% !important; }
.sp-insp-backdrop { z-index: 55; }
@media (max-width: 780px) {
  .sc-status-undo, .sp-cursor { display: none; }
  .sc-hintbar .sc-hint { display: none; }
  .sc-hintbar > b { flex: 1; }
  .sp-layers li { min-height: 50px; }
  .sp-thumb { width: 44px; height: 32px; }
  .sp-slider-row { grid-template-columns: 96px minmax(0, 1fr); min-height: 44px; font-size: 14px; }
  .sp-presets button { font-size: 13px; padding: 10px; }
  .sc-hintbar .sc-finish { order: 3; }
}

/* Range tracks: a visible track with the value filled in the accent (StratusUI's --sui-pct, set by app.js). */
.sui-range { background: linear-gradient(to right, var(--accent) var(--sui-pct, 0%), var(--line-strong) var(--sui-pct, 0%)); }
.sui-range::-webkit-slider-thumb { width: 16px; height: 16px; background: #fff; border: 0; box-shadow: 0 0 0 0.5px rgba(0,0,0,.18), 0 1px 3px rgba(0,0,0,.3); }
.sui-range::-moz-range-thumb { width: 16px; height: 16px; background: #fff; border: 0; box-shadow: 0 0 0 0.5px rgba(0,0,0,.18), 0 1px 3px rgba(0,0,0,.3); }

/* Twenty-two raster tools: tighten the strip on shorter windows so every tool stays in view. */
@media (min-width: 781px) and (max-height: 880px) {
  .sc-toolstrip { gap: 0; padding: 4px 0; }
  .sc-tool { height: 30px; }
  .sc-strip-sep { margin: 3px 0; }
}
