/* Image Optimizer: only the layout. Colors, type and every piece come from the FileFortress kit (ff-kit/). */
[hidden] { display: none !important; }
.app { padding: 14px 16px 24px; }
.app-top { display: flex; align-items: center; gap: 12px; padding: 4px 4px 12px; }
.app-logo { width: 28px; height: 28px; color: var(--ff-brand); flex: none; }
.app-top p { margin: 2px 0 0; }
/* the pictures | before / after | format and size. Narrower: both setting columns on the right; phones: one column */
.app-grid { display: grid; gap: 14px; align-items: start; grid-template-columns: minmax(270px, 320px) minmax(0, 1fr) minmax(270px, 320px);
  grid-template-areas: "left main right"; }
.app-left { grid-area: left; } .app-main { grid-area: main; } .app-right { grid-area: right; }
@media (max-width: 1180px) { .app-grid { grid-template-columns: minmax(0, 1fr) minmax(270px, 330px); grid-template-areas: "main left" "main right"; } }
@media (max-width: 860px) { .app-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "left" "right"; } }
.app-col-title { margin: 0; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.app-col-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.app-col-head:not(:first-child) { margin-top: 6px; }
.app-col-head .app-col-title { margin: 0; }
.app-reset { display: inline-flex; align-items: center; gap: 5px; padding: 3px 6px; border: 0; border-radius: 7px; background: none; color: inherit;
  font: 600 11.5px/1 var(--ff-font); opacity: .75; cursor: pointer; }
.app-reset .ff-icon { width: 13px; height: 13px; }
.app-reset:hover:not(:disabled) { opacity: 1; background: rgba(255, 255, 255, .07); }
.app-reset:disabled { opacity: .3; cursor: default; }
.app-sub { display: grid; gap: 10px; padding: 2px 0 4px 14px; border-left: 2px solid var(--ff-line); margin-top: -6px; }
.app-help { margin-top: 4px; }
.app-foot { margin: 0; text-align: center; }

/* adding pictures, and the list */
.app-drop { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 12px 14px; text-align: left; min-height: 0; }
.app-drop > .ff-icon { position: static; flex: none; }
.app-drop-text { display: grid; gap: 2px; min-width: 0; }
.app-empty { margin: 0; }
.app-list { display: grid; gap: 4px; }
.app-item { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 10px; border: 1px solid var(--ff-line);
  background: rgba(255, 255, 255, .03); cursor: pointer; min-width: 0; }
.app-item:hover { background: rgba(255, 255, 255, .06); }
.app-item.is-on { border-color: var(--ff-brand); background: rgba(255, 255, 255, .07); }
.app-item img { width: 40px; height: 40px; object-fit: contain; flex: none; border-radius: 6px;
  background: repeating-conic-gradient(#2a2430 0 25%, #1d1822 0 50%) 0 0 / 10px 10px; }
.app-item-text { display: grid; gap: 1px; min-width: 0; flex: 1; }
.app-item-text > b { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-item-text > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-item-text .is-good { color: #4ade80; } .app-item-text .is-bad { color: #f87171; }
.app-item-btn { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border: 0; border-radius: 7px; background: none; color: inherit; opacity: .65; cursor: pointer; }
.app-item-btn:hover:not(:disabled) { opacity: 1; background: rgba(255, 255, 255, .08); }
.app-item-btn:disabled { opacity: .2; cursor: default; }
.app-item-btn .ff-icon { width: 14px; height: 14px; }

/* before / after */
.app-view-bar { flex-wrap: nowrap; gap: 8px; min-height: 22px; }
.app-view-bar > .ff-small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-view-bar > .ff-btn { flex: none; }
.app-stage { position: relative; height: min(70vh, 760px); min-height: 280px; border-radius: var(--ff-radius); border: 1px solid var(--ff-line); overflow: hidden;
  background: repeating-conic-gradient(#26212c 0 25%, #1b1720 0 50%) 0 0 / 20px 20px; }
.app-view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.app-view.is-panning { cursor: grabbing !important; }
.app-busy { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 7px 12px;
  border-radius: 99px; background: rgba(10, 6, 14, .82); border: 1px solid var(--ff-line); font-size: 12.5px; white-space: nowrap; }
.app-busy.is-error { border-color: #f87171; }
.app-busy.is-error .app-spin { display: none; }
.app-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .25); border-top-color: var(--ff-brand); animation: app-spin .8s linear infinite; }
@keyframes app-spin { to { transform: rotate(360deg); } }
.app-drop-over { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 8px; background: rgba(10, 6, 14, .72);
  border: 2px dashed var(--ff-brand); border-radius: inherit; font-size: 15px; pointer-events: none; }
.app-drop-over .ff-icon { width: 32px; height: 32px; color: var(--ff-brand); }
.app-toast { margin: 0; }

/* format and size */
.app-formats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.app-formats button { height: 34px; border-radius: 9px; border: 1px solid var(--ff-line); background: rgba(255, 255, 255, .03); color: inherit;
  font: 600 12.5px/1 var(--ff-font); cursor: pointer; }
.app-formats button:hover { background: rgba(255, 255, 255, .07); }
.app-formats button.is-on { border-color: var(--ff-brand); box-shadow: inset 0 0 0 1px var(--ff-brand); background: rgba(255, 255, 255, .08); }
.app-format-note { margin-top: -4px; }
.app-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.app-presets button { padding: 4px 8px; border-radius: 7px; border: 1px solid var(--ff-line); background: rgba(255, 255, 255, .03); color: inherit; font: 600 11.5px/1 var(--ff-font); cursor: pointer; }
.app-presets button:hover { background: rgba(255, 255, 255, .08); }

/* slider labels: the name on the left, the value on the right, on one line */
.ff-field > .ff-label:has(> b[data-out]) { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; white-space: nowrap; }
.ff-label > b[data-out] { font-variant-numeric: tabular-nums; }
/* a slider's number can be clicked to type a value (js/value-edit.js) */
.ff-label b.ff-value { cursor: text; border-radius: 4px; padding: 0 2px; margin: 0 -2px; }
.ff-label b.ff-value:hover { background: rgba(255, 255, 255, .08); box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .35); }
.ff-value-edit { width: 6ch; height: 20px; padding: 0 4px; border: 1px solid var(--ff-brand); border-radius: 5px; background: rgba(0, 0, 0, .35);
  color: inherit; font: inherit; text-align: right; -moz-appearance: textfield; }
.ff-value-edit::-webkit-outer-spin-button, .ff-value-edit::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ff-value-edit:focus { outline: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, .12); }

/* Wide windows: one panel (a divider between its parts) that fits the window: no page scrolling. The before / after view
   takes the height that's left; a column that's still too tall (a long picture list) scrolls inside itself. */
@media (min-width: 1181px) {
  html, body { height: 100%; overflow: hidden; }
  .app { height: 100vh; box-sizing: border-box; display: flex; flex-direction: column; padding: 10px 16px 12px; }
  .app-top { flex: none; padding: 0 4px 8px; }
  .app-grid { flex: 1; min-height: 0; gap: 0; align-items: stretch; border: 1px solid var(--ff-card-border, var(--ff-line));
    border-radius: var(--ff-card-radius, var(--ff-radius)); background: var(--ff-card-bg, var(--ff-panel)); overflow: hidden; }
  .app-grid > .ff-card { border: 0; border-radius: 0; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .app-grid > .app-left { border-right: 1px solid var(--ff-line); }
  .app-grid > .app-right { border-left: 1px solid var(--ff-line); }
  .app-side { min-height: 0; max-height: 100%; overflow-y: auto; gap: 10px; scrollbar-width: thin; }
  .app-side .ff-hint { display: none; }
  .app-main { min-height: 0; display: flex; flex-direction: column; gap: 10px; }
  .app-stage { flex: 1; height: auto; min-height: 200px; }
}
