/* =========================================================
   Squish — image minifier
   Design system: brand colours, components, themes
   ========================================================= */

:root{
  /* Marka */
  --brand-1:       #10b981;   /* jaśniejsza zieleń z logo */
  --brand-2:       #047857;   /* ciemniejsza zieleń z logo */
  --brand-grad:    linear-gradient(135deg, var(--brand-1), var(--brand-2));

  /* Przycisk główny trzymamy na pełnym kolorze — gradient nie dowoziłby
     kontrastu 4.5:1 dla białego tekstu na jaśniejszym końcu. */
  --btn-bg:        #047857;
  --btn-bg-hover:  #065f46;
  --btn-fg:        #ffffff;

  /* Powierzchnie */
  --bg:            #f5f7f6;
  --bg-tint-1:     rgba(16,185,129,.13);
  --bg-tint-2:     rgba(4,120,87,.07);
  --surface:       #ffffff;
  --surface-2:     #f4f7f6;
  --surface-3:     #eaefed;
  --border:        #e2e8e6;
  --border-strong: #c8d3cf;

  /* Typografia */
  --text:          #10201b;
  --text-soft:     #445049;
  --muted:         #76837c;

  /* Akcenty funkcjonalne */
  --accent:        #047857;
  --accent-hover:  #065f46;
  --accent-soft:   #e3f5ee;
  --success:       #047857;
  --success-soft:  #e3f5ee;
  --warning:       #a86a15;
  --warning-soft:  #fcf1e0;
  --danger:        #cc3a44;
  --danger-soft:   #fdecec;

  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius:    13px;
  --radius-sm: 9px;
  --shadow:    0 1px 2px rgba(10,32,27,.04), 0 10px 30px -18px rgba(10,32,27,.32);
  --shadow-lg: 0 2px 6px rgba(10,32,27,.06), 0 28px 56px -28px rgba(10,32,27,.45);
  --ring:      0 0 0 3px rgba(16,185,129,.35);
}

html[data-theme="dark"]{
  --brand-1:       #34d399;
  --brand-2:       #10b981;
  --btn-bg:        #34d399;
  --btn-bg-hover:  #6ee7b7;
  --btn-fg:        #04241c;

  --bg:            #0d1210;
  --bg-tint-1:     rgba(16,185,129,.15);
  --bg-tint-2:     rgba(52,211,153,.07);
  --surface:       #151c19;
  --surface-2:     #1a2320;
  --surface-3:     #212b27;
  --border:        #2a3733;
  --border-strong: #3a4a44;

  --text:          #eaf2ee;
  --text-soft:     #b4c2bc;
  --muted:         #83938c;

  --accent:        #34d399;
  --accent-hover:  #6ee7b7;
  --accent-soft:   #17302a;
  --success:       #34d399;
  --success-soft:  #14302a;
  --warning:       #dfae63;
  --warning-soft:  #2c2417;
  --danger:        #f2777f;
  --danger-soft:   #2e1a1d;

  --shadow:        0 1px 2px rgba(0,0,0,.35), 0 10px 30px -18px rgba(0,0,0,.85);
  --shadow-lg:     0 2px 6px rgba(0,0,0,.4), 0 28px 56px -28px rgba(0,0,0,.95);
  --ring:          0 0 0 3px rgba(52,211,153,.35);
}

*,*::before,*::after{ box-sizing:border-box; }

body{
  margin:0;
  min-height:100vh;
  font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, Helvetica, Arial, sans-serif;
  font-size:15px;
  line-height:1.55;
  color:var(--text);
  background:
    radial-gradient(920px 520px at 10% -12%, var(--bg-tint-1), transparent 60%),
    radial-gradient(780px 440px at 95% 2%, var(--bg-tint-2), transparent 58%),
    var(--bg);
  background-attachment:fixed;
  -webkit-font-smoothing:antialiased;
}

h1,h2,h3{ margin:0; line-height:1.25; letter-spacing:-.015em; }
p{ margin:0; }
ul{ margin:0; padding:0; list-style:none; }
code{ font-size:.85em; padding:1px 5px; border-radius:5px; background:var(--surface-3); }

.icon{
  width:20px; height:20px; flex:none;
  fill:none; stroke:currentColor; stroke-width:1.7;
  stroke-linecap:round; stroke-linejoin:round;
}
.icon--sm{ width:16px; height:16px; }
.icon--xl{ width:34px; height:34px; stroke-width:1.5; }

/* =========================================================
   Nagłówek i marka
   ========================================================= */
.topbar{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  max-width:1020px; margin:0 auto;
  padding:26px 22px 12px;
}
.brand{
  display:flex; align-items:center; gap:13px;
  min-width:0; text-decoration:none; color:inherit;
  border-radius:14px;
}
.brand:focus-visible{ outline:none; box-shadow:var(--ring); }
.brand__mark{
  width:48px; height:48px; flex:none;
  border-radius:14px;
  filter:drop-shadow(0 8px 18px rgba(4,120,87,.4));
  transition:transform .25s cubic-bezier(.34,1.56,.64,1);
}
.brand:hover .brand__mark{ transform:translateY(-2px) rotate(-4deg); }
.logo{ width:100%; height:100%; display:block; }

.brand__text{ display:flex; flex-direction:column; min-width:0; }
.brand__row{ display:flex; align-items:baseline; gap:9px; flex-wrap:wrap; }
.brand__name{
  font-size:1.35rem; font-weight:700; letter-spacing:-.02em;
  background:var(--brand-grad);
  -webkit-background-clip:text; background-clip:text; color:transparent;
}
.brand__tag{
  font-size:.68rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase;
  color:var(--muted);
  padding:2px 8px; border-radius:999px;
  border:1px solid var(--border); background:var(--surface);
}
.brand__claim{ font-size:.85rem; color:var(--muted); margin-top:1px; }

.icon-btn{
  display:grid; place-items:center;
  width:42px; height:42px; flex:none;
  border:1px solid var(--border); border-radius:12px;
  background:var(--surface); color:var(--text-soft);
  cursor:pointer; transition:.16s ease;
}
.icon-btn:hover{ color:var(--accent); border-color:var(--border-strong); transform:translateY(-1px); }
.icon-btn:focus-visible{ outline:none; box-shadow:var(--ring); }
.icon--moon{ display:none; }
html[data-theme="dark"] .icon--sun{ display:none; }
html[data-theme="dark"] .icon--moon{ display:block; }

/* =========================================================
   Zakładki narzędzi
   ========================================================= */
.tabs{
  display:flex; justify-content:center; gap:4px;
  max-width:1020px; margin:6px auto 0;
  padding:4px; width:fit-content;
  background:var(--surface); border:1px solid var(--border);
  border-radius:14px; box-shadow:var(--shadow);
}
.tab{
  display:inline-flex; align-items:center; gap:8px;
  font:inherit; font-size:.9rem; font-weight:600;
  padding:9px 18px; border:0; border-radius:10px;
  background:transparent; color:var(--muted);
  cursor:pointer; transition:.15s ease;
}
.tab:hover{ color:var(--text); background:var(--surface-2); }
.tab:focus-visible{ outline:none; box-shadow:var(--ring); }
.tab.is-active{
  background:var(--accent-soft); color:var(--accent);
}
.tab.is-active .icon{ stroke-width:2; }

.view{ display:flex; flex-direction:column; gap:18px; }

/* =========================================================
   Układ
   ========================================================= */
.wrap{
  max-width:1020px; margin:0 auto;
  padding:14px 22px 44px;
  display:flex; flex-direction:column; gap:18px;
}

/* =========================================================
   Strefa upuszczania
   ========================================================= */
.dropzone{
  position:relative; overflow:hidden;
  display:flex; flex-direction:column; align-items:center; gap:9px;
  text-align:center;
  padding:40px 24px 32px;
  border:2px dashed var(--border-strong);
  border-radius:var(--radius-xl);
  background:var(--surface);
  box-shadow:var(--shadow);
  cursor:pointer;
  transition:border-color .18s ease, background-color .18s ease, transform .18s ease;
}
.dropzone::after{
  content:""; position:absolute; inset:0;
  background:var(--brand-grad); opacity:0;
  transition:opacity .18s ease; pointer-events:none;
}
.dropzone:hover{ border-color:var(--brand-1); transform:translateY(-2px); }
.dropzone:hover::after{ opacity:.035; }
.dropzone:focus-visible{ outline:none; box-shadow:var(--shadow), var(--ring); }
.dropzone.is-over{ border-color:var(--brand-1); background:var(--accent-soft); }

.dropzone__icon{
  display:grid; place-items:center;
  width:68px; height:68px; margin-bottom:2px;
  border-radius:22px; color:#fff;
  background:var(--brand-grad);
  box-shadow:0 12px 26px -12px rgba(4,120,87,.75);
}
.dropzone__title{ font-size:1.24rem; font-weight:660; }
.dropzone__hint{ color:var(--muted); font-size:.9rem; }
.dropzone__promise{
  display:inline-flex; align-items:center; gap:7px;
  margin-top:10px; padding:5px 13px;
  font-size:.78rem; font-weight:560;
  color:var(--success); background:var(--success-soft);
  border-radius:999px;
}
.link{ color:var(--accent); font-weight:580; text-decoration:underline; text-underline-offset:3px; }
kbd{
  font:inherit; font-size:.76rem; padding:2px 6px;
  border:1px solid var(--border-strong); border-bottom-width:2px;
  border-radius:6px; background:var(--surface-2); color:var(--text-soft);
}

/* =========================================================
   Panel ustawień
   ========================================================= */
.panel{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-xl);
  box-shadow:var(--shadow);
  padding:22px;
}
.panel__title{ font-size:1.02rem; font-weight:660; margin-bottom:14px; }

/* Karty poziomu kompresji */
.presets{
  display:grid; gap:10px;
  grid-template-columns:repeat(auto-fit, minmax(210px, 1fr));
}
.preset{
  position:relative; overflow:hidden;
  display:flex; flex-direction:column; align-items:flex-start; gap:5px;
  padding:16px 15px 15px;
  font:inherit; text-align:left;
  border:1.5px solid var(--border); border-radius:var(--radius-lg);
  background:var(--surface-2); color:var(--text);
  cursor:pointer; transition:.16s ease;
}
.preset:hover{ border-color:var(--border-strong); transform:translateY(-2px); background:var(--surface); }
.preset:focus-visible{ outline:none; box-shadow:var(--ring); }
.preset.is-active{
  border-color:var(--brand-1); background:var(--surface);
  box-shadow:0 0 0 3px var(--accent-soft), var(--shadow);
}
.preset__icon{
  display:grid; place-items:center;
  width:38px; height:38px; margin-bottom:3px;
  border-radius:11px;
  background:var(--surface-3); color:var(--muted);
  transition:.16s ease;
}
.preset.is-active .preset__icon{ background:var(--brand-grad); color:#fff; }
.preset__title{ font-size:.95rem; font-weight:640; }
.preset__desc{ font-size:.79rem; color:var(--muted); line-height:1.45; }
.preset__badge{
  position:absolute; top:11px; right:11px;
  font-size:.63rem; font-weight:750; letter-spacing:.07em; text-transform:uppercase;
  padding:3px 8px; border-radius:999px;
  background:var(--accent-soft); color:var(--accent);
}
.preset.is-custom .preset__badge{ background:var(--surface-3); color:var(--muted); }

/* Bloki ustawień zależne od wybranego trybu */
.mode-body{ margin-top:16px; }
.dims{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.dims .input-suffix{ flex:1; min-width:110px; }
.dims .input-suffix--narrow{ flex:0 0 120px; }
.dims__x{ font-size:.95rem; font-weight:600; color:var(--muted); }

.quick{ display:flex; gap:6px; flex-wrap:wrap; }
.quick button{
  font:inherit; font-size:.8rem; font-weight:600;
  padding:7px 12px; border-radius:9px;
  border:1px solid var(--border); background:var(--surface-2); color:var(--text-soft);
  cursor:pointer; transition:.15s ease;
}
.quick button:hover{ color:var(--accent); border-color:var(--accent); background:var(--accent-soft); }
.quick button:focus-visible{ outline:none; box-shadow:var(--ring); }

/* Karty formatu docelowego */
.formats{
  display:grid; gap:10px;
  grid-template-columns:repeat(auto-fit, minmax(165px, 1fr));
}
.format{ gap:7px; }
.format__ext{
  font-size:1.15rem; font-weight:750; letter-spacing:-.01em;
  color:var(--text-soft); transition:.16s ease;
}
.format.is-active .format__ext{ color:var(--accent); }
.format:disabled{ opacity:.5; cursor:not-allowed; }
.format:disabled:hover{ transform:none; border-color:var(--border); background:var(--surface-2); }
.format__unavailable{
  font-size:.7rem; font-weight:650; color:var(--warning);
}

/* Pole wyszarzone, gdy ustawienie nie ma zastosowania */
.field.is-muted{ opacity:.5; }
.field.is-muted input{ pointer-events:none; }

/* Odnośnik udający link wewnątrz zdania */
.linkish{
  font:inherit; font-size:inherit; font-weight:620;
  padding:0; border:0; background:none; cursor:pointer;
  color:var(--accent); text-decoration:underline; text-underline-offset:3px;
}
.linkish:hover{ color:var(--accent-hover); }
.linkish:focus-visible{ outline:none; box-shadow:var(--ring); border-radius:4px; }

/* Obietnica zachowania formatu */
.keep-format{
  display:flex; align-items:center; gap:9px;
  margin-top:14px; padding:11px 14px;
  font-size:.83rem; color:var(--text-soft);
  background:var(--success-soft); border-radius:var(--radius);
}
.keep-format .icon{ color:var(--success); stroke-width:2.4; }
.keep-format b{ color:var(--text); font-weight:640; }

/* Zwijane opcje zaawansowane */
.more{ margin-top:16px; border-top:1px solid var(--border); padding-top:14px; }
.more > summary{
  display:flex; align-items:center; gap:7px;
  width:fit-content; padding:5px 11px 5px 7px;
  font-size:.85rem; font-weight:600; color:var(--text-soft);
  border-radius:9px; cursor:pointer; list-style:none;
  transition:.15s ease;
}
.more > summary::-webkit-details-marker{ display:none; }
.more > summary:hover{ background:var(--surface-2); color:var(--accent); }
.more > summary:focus-visible{ outline:none; box-shadow:var(--ring); }
.more__chevron{ transition:transform .2s ease; }
.more[open] .more__chevron{ transform:rotate(90deg); }
.more[open] > summary{ color:var(--accent); margin-bottom:6px; }

.grid{
  display:grid; gap:20px; padding-top:10px;
  grid-template-columns:repeat(auto-fit, minmax(228px, 1fr));
}
.field{ display:flex; flex-direction:column; gap:8px; min-width:0; }
.field > label{ font-size:.82rem; font-weight:620; color:var(--text-soft); }
.hint{ font-size:.78rem; color:var(--muted); line-height:1.45; }

select, input[type="number"]{
  width:100%; font:inherit; font-size:.9rem; color:var(--text);
  padding:10px 12px;
  border:1px solid var(--border); border-radius:var(--radius-sm);
  background:var(--surface-2); transition:.15s ease;
}
select{
  appearance:none; cursor:pointer; padding-right:36px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2376837c' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 11px center; background-size:15px;
}
select:hover, input[type="number"]:hover{ border-color:var(--border-strong); }
select:focus-visible, input:focus-visible, .btn:focus-visible, .segmented__btn:focus-visible{
  outline:none; border-color:var(--accent); box-shadow:var(--ring);
}
.input-suffix{ position:relative; }
.input-suffix input{ padding-right:48px; }
.input-suffix > span{
  position:absolute; right:12px; top:50%; transform:translateY(-50%);
  font-size:.82rem; font-weight:600; color:var(--muted); pointer-events:none;
}

/* Suwak */
.slider-row{ display:flex; align-items:center; gap:12px; }
.slider-value{
  min-width:46px; text-align:center;
  font-size:.84rem; font-weight:660; color:var(--accent);
  padding:4px 6px; border-radius:8px; background:var(--accent-soft);
}
input[type="range"]{
  flex:1; appearance:none; height:6px; margin:0;
  border-radius:999px; cursor:pointer;
  background:linear-gradient(90deg, var(--brand-1), var(--brand-2));
}
input[type="range"]::-webkit-slider-thumb{
  appearance:none; width:18px; height:18px; border-radius:50%;
  background:var(--surface); border:3px solid var(--brand-1);
  box-shadow:0 2px 6px rgba(10,32,27,.28); cursor:grab;
}
input[type="range"]::-moz-range-thumb{
  width:14px; height:14px; border-radius:50%;
  background:var(--surface); border:3px solid var(--brand-1); cursor:grab;
}
.slider-scale{ display:flex; justify-content:space-between; font-size:.72rem; color:var(--muted); }

/* Przełączniki */
.toggles{
  display:flex; flex-wrap:wrap; align-items:center; gap:12px 22px;
  margin-top:18px; padding-top:16px; border-top:1px solid var(--border);
}
.switch{ display:flex; align-items:center; gap:10px; cursor:pointer; }
.switch--inline{ margin-top:4px; }
.switch input{ position:absolute; opacity:0; width:0; height:0; }
.switch__track{
  position:relative; width:38px; height:22px; flex:none;
  border-radius:999px; background:var(--border-strong); transition:.18s ease;
}
.switch__track::after{
  content:""; position:absolute; top:3px; left:3px;
  width:16px; height:16px; border-radius:50%;
  background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.3); transition:.18s ease;
}
.switch input:checked + .switch__track{ background:var(--brand-1); }
.switch input:checked + .switch__track::after{ transform:translateX(16px); }
.switch input:focus-visible + .switch__track{ box-shadow:var(--ring); }
.switch__label{ font-size:.85rem; color:var(--text-soft); }

/* Segmentowany przełącznik */
.segmented{
  display:inline-grid; grid-auto-flow:column; gap:3px;
  padding:3px; border-radius:11px;
  background:var(--surface-3); border:1px solid var(--border);
}
.segmented__btn{
  font:inherit; font-size:.83rem; font-weight:580;
  padding:7px 14px; border:0; border-radius:8px;
  background:transparent; color:var(--muted); cursor:pointer; transition:.15s ease;
}
.segmented__btn:hover{ color:var(--text); }
.segmented__btn.is-active{
  background:var(--surface); color:var(--accent);
  box-shadow:0 1px 3px rgba(10,32,27,.16);
}

/* =========================================================
   Przyciski
   ========================================================= */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  font:inherit; font-size:.875rem; font-weight:620;
  padding:10px 17px; border-radius:var(--radius-sm);
  border:1px solid transparent; cursor:pointer;
  transition:.15s ease; white-space:nowrap;
}
.btn--primary{
  background:var(--btn-bg); color:var(--btn-fg);
  box-shadow:0 8px 20px -10px rgba(4,120,87,.85);
}
.btn--primary:hover:not(:disabled){ background:var(--btn-bg-hover); transform:translateY(-1px); }
.btn--ghost{ background:var(--surface-2); color:var(--text-soft); border-color:var(--border); }
.btn--ghost:hover{ color:var(--text); border-color:var(--border-strong); }
.btn--sm{ font-size:.8rem; padding:6px 12px; }
.btn:disabled{ opacity:.45; cursor:not-allowed; box-shadow:none; transform:none; }

/* =========================================================
   Wyniki
   ========================================================= */
.results{ display:flex; flex-direction:column; gap:11px; }

.summary{
  display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:16px;
  padding:17px 20px;
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-xl); box-shadow:var(--shadow);
}
.summary__main{ min-width:220px; flex:1; }
.summary__headline{ font-size:1.02rem; font-weight:660; }
.summary__headline .accent{ color:var(--success); }
.summary__detail{ font-size:.85rem; color:var(--muted); margin-top:2px; font-variant-numeric:tabular-nums; }
.summary__actions{ display:flex; gap:8px; }
.summary__storage{
  display:flex; align-items:center; gap:7px;
  margin-top:6px; font-size:.76rem; color:var(--muted);
}
.summary__storage::before{
  content:""; width:7px; height:7px; flex:none; border-radius:50%;
  background:var(--success);
}
.summary__storage.is-warn{ color:var(--warning); }
.summary__storage.is-warn::before{ background:var(--warning); }

.progress{
  height:5px; margin-top:10px; border-radius:999px;
  background:var(--surface-3); overflow:hidden;
}
.progress__fill{
  display:block; height:100%; width:0;
  border-radius:999px; background:var(--brand-grad);
  transition:width .3s ease;
}

/* Wiersz pliku */
.file{
  display:flex; align-items:center; gap:14px;
  padding:12px 14px;
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-lg); box-shadow:var(--shadow);
  animation:pop .22s ease both;
}
@keyframes pop{ from{ opacity:0; transform:translateY(6px); } to{ opacity:1; transform:none; } }
.file.is-error{ border-color:var(--danger); background:var(--danger-soft); }

.file__thumb{
  position:relative; width:58px; height:58px; flex:none;
  border-radius:12px; overflow:hidden; border:0; padding:0;
  background-color:var(--surface-3);
  background-image:
    linear-gradient(45deg, var(--border) 25%, transparent 25%),
    linear-gradient(-45deg, var(--border) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--border) 75%),
    linear-gradient(-45deg, transparent 75%, var(--border) 75%);
  background-size:12px 12px;
  background-position:0 0, 0 6px, 6px -6px, -6px 0;
  display:grid; place-items:center; cursor:zoom-in;
  transition:.15s ease;
}
.file__thumb:disabled{ cursor:default; }
.file__thumb:not(:disabled):hover{ transform:scale(1.05); }
.file__thumb:focus-visible{ outline:none; box-shadow:var(--ring); }
.file__thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.file__thumb.is-loading img{ opacity:.4; }
.file__zoom{
  position:absolute; inset:0; display:grid; place-items:center;
  background:rgba(8,26,21,.5); color:#fff; opacity:0; transition:.15s ease;
}
.file__thumb:not(:disabled):hover .file__zoom{ opacity:1; }

.file__body{ flex:1; min-width:0; display:flex; flex-direction:column; gap:4px; }
.file__name{ font-size:.9rem; font-weight:620; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.file__meta{
  display:flex; flex-wrap:wrap; align-items:center; gap:5px 9px;
  font-size:.8rem; color:var(--muted); font-variant-numeric:tabular-nums;
}
.file__meta .sep{ opacity:.45; }
.size-old{ text-decoration:line-through; opacity:.75; }
.size-new{ color:var(--text); font-weight:640; }
.tag{
  font-size:.67rem; font-weight:720; letter-spacing:.05em;
  padding:2px 7px; border-radius:6px;
  background:var(--surface-3); color:var(--text-soft);
}
/* Znacznik zmiany formatu: PNG → JPG */
.tag--from{
  background:transparent; color:var(--muted);
  border:1px solid var(--border);
}
.file__meta .arrow{ color:var(--muted); font-weight:750; margin:0 -3px; }

.badge{
  font-size:.75rem; font-weight:700;
  padding:3px 9px; border-radius:999px;
  background:var(--success-soft); color:var(--success);
}
.badge--neutral{ background:var(--surface-3); color:var(--muted); }
.badge--warn{ background:var(--warning-soft); color:var(--warning); }
.file__error{ font-size:.8rem; color:var(--danger); font-weight:560; }

/* Pasek oszczędności */
.bar{
  position:relative; height:4px; width:100%; max-width:230px;
  border-radius:999px; background:var(--surface-3); overflow:hidden;
}
.bar__fill{
  display:block; height:100%; border-radius:999px;
  background:var(--brand-grad);
  transition:width .35s ease;
}

.file__actions{ display:flex; align-items:center; gap:6px; flex:none; }
.act{
  display:grid; place-items:center; width:36px; height:36px;
  border:1px solid var(--border); border-radius:10px;
  background:var(--surface-2); color:var(--text-soft);
  cursor:pointer; transition:.15s ease;
}
.act:hover:not(:disabled){ color:var(--accent); border-color:var(--accent); background:var(--accent-soft); }
.act--remove:hover:not(:disabled){ color:var(--danger); border-color:var(--danger); background:var(--danger-soft); }
.act:focus-visible{ outline:none; box-shadow:var(--ring); }
.act:disabled{ opacity:.35; cursor:not-allowed; }

.spinner{
  width:16px; height:16px; border-radius:50%;
  border:2px solid var(--border-strong); border-top-color:var(--brand-1);
  animation:spin .7s linear infinite;
}
@keyframes spin{ to{ transform:rotate(360deg); } }

/* =========================================================
   Podgląd porównawczy
   ========================================================= */
.preview{
  width:min(900px, 92vw); max-height:88vh;
  padding:0; border:1px solid var(--border);
  border-radius:var(--radius-xl); background:var(--surface); color:var(--text);
  box-shadow:var(--shadow-lg);
  overflow:hidden;
}
.preview::backdrop{ background:rgba(8,20,16,.62); backdrop-filter:blur(3px); }
.preview__head{
  display:flex; align-items:flex-start; justify-content:space-between; gap:14px;
  padding:16px 18px; border-bottom:1px solid var(--border);
}
.preview__name{ font-size:.95rem; font-weight:660; }
.preview__sub{ font-size:.8rem; color:var(--muted); margin-top:2px; font-variant-numeric:tabular-nums; }
.preview__stage{
  display:grid; place-items:center;
  padding:18px; min-height:220px; max-height:58vh;
  background-color:var(--surface-2);
}
/* Szachownicę pokazujemy tylko pod obrazami z przezroczystością —
   pod krytym zdjęciem byłaby wyłącznie szumem. */
.preview__stage.is-alpha{
  background-image:
    linear-gradient(45deg, var(--surface-3) 25%, transparent 25%),
    linear-gradient(-45deg, var(--surface-3) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--surface-3) 75%),
    linear-gradient(-45deg, transparent 75%, var(--surface-3) 75%);
  background-size:18px 18px;
  background-position:0 0, 0 9px, 9px -9px, -9px 0;
}
.preview__stage img{ max-width:100%; max-height:54vh; display:block; border-radius:8px; }
.preview__foot{
  display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap;
  padding:14px 18px; border-top:1px solid var(--border);
}
.preview__tip{ font-size:.78rem; color:var(--muted); }

/* =========================================================
   Overlay przeciągania
   ========================================================= */
.drag-overlay{
  position:fixed; inset:0; z-index:50;
  display:grid; place-items:center; padding:26px;
  background:rgba(8,20,16,.6); backdrop-filter:blur(3px);
}
.drag-overlay__box{
  display:flex; flex-direction:column; align-items:center; gap:12px;
  padding:52px 64px;
  border:2px dashed rgba(255,255,255,.75); border-radius:26px;
  color:#fff; font-size:1.05rem; font-weight:620;
}

/* =========================================================
   Stopka
   ========================================================= */
.footer{
  max-width:1020px; margin:0 auto;
  padding:0 22px 46px; text-align:center;
  color:var(--muted); font-size:.83rem;
}
.footer strong{ color:var(--text-soft); }
.footer__small{ margin-top:5px; font-size:.76rem; opacity:.85; }
.footer__brand{
  display:inline-flex; align-items:center; gap:8px;
  margin-top:14px; font-size:.78rem; font-weight:560; color:var(--text-soft);
}
.footer__dot{
  width:9px; height:9px; border-radius:50%;
  background:var(--brand-grad);
}

/* =========================================================
   Responsywność
   ========================================================= */
@media (max-width:640px){
  .tabs{ width:100%; max-width:none; justify-content:stretch; }
  .tab{ flex:1; justify-content:center; padding:9px 8px; font-size:.83rem; }
  .tab .icon{ display:none; }
  .topbar{ padding-top:20px; }
  .brand__claim{ display:none; }
  .dropzone{ padding:32px 18px 26px; }
  .summary{ flex-direction:column; align-items:stretch; }
  .summary__actions .btn{ flex:1; }
  .file{ flex-wrap:wrap; }
  .file__actions{ margin-left:auto; }
  .bar{ max-width:none; }
  .preview__foot{ justify-content:center; }
  .preview__tip{ display:none; }
}

@media (prefers-reduced-motion:reduce){
  *{ animation-duration:.01ms !important; transition-duration:.01ms !important; }
}

/* Elementy z [hidden] mają własne display — wymuszamy ukrycie */
[hidden]{ display:none !important; }

/* =========================================================
   Porównanie obok siebie
   ========================================================= */
.preview.is-split{ width:min(1140px, 94vw); }

.compare{
  display:grid; grid-template-columns:1fr 1fr;
  gap:14px; width:100%; align-items:start;
}
.compare__pane{
  margin:0; min-width:0;
  display:flex; flex-direction:column; align-items:center; gap:9px;
}
.compare__pane img{
  max-width:100%; max-height:46vh;
  display:block; border-radius:9px;
}
.compare__pane figcaption{
  display:flex; flex-wrap:wrap; align-items:center; justify-content:center;
  gap:7px; padding:5px 12px;
  font-size:.76rem; color:var(--text-soft);
  font-variant-numeric:tabular-nums;
  background:var(--surface); border:1px solid var(--border);
  border-radius:999px;
}
.compare__label{
  font-size:.66rem; font-weight:750; letter-spacing:.06em; text-transform:uppercase;
  color:var(--muted);
}
.compare__label--good{ color:var(--success); }

@media (max-width:640px){
  .compare{ grid-template-columns:1fr; }
  .compare__pane img{ max-height:28vh; }
}
