.toolisto-image-compressor,
.toolisto-image-compressor * {
  box-sizing: border-box;
}

.toolisto-image-compressor {
  --toolisto-ic-primary: #ff7a21;
  --toolisto-ic-primary-dark: #d95700;
  --toolisto-ic-text: #172033;
  --toolisto-ic-muted: #667085;
  --toolisto-ic-border: #e4e7ec;
  --toolisto-ic-success: #0e8a5b;
  width: min(var(--theme-block-width, 100%), var(--theme-block-max-width, 100%));
  max-width: var(--theme-block-max-width, 1120px);
  min-width: 0;
  margin: 24px auto;
  color: var(--toolisto-ic-text);
  font-family: inherit;
  container-name: toolisto-image-compressor;
  container-type: inline-size;
}

.toolisto-image-compressor [hidden] {
  display: none !important;
}

.toolisto-ic__upload {
  position: relative;
  width: 100%;
  min-height: 320px;
  overflow: hidden;
  background: linear-gradient(145deg, #ffffff 0%, #ffffff 58%, #fff7f1 100%);
  border: 2px dashed #ffc49d;
  border-radius: 22px;
  box-shadow: 0 14px 38px rgba(23, 32, 51, 0.07);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.toolisto-ic__upload::before,
.toolisto-ic__upload::after {
  position: absolute;
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.toolisto-ic__upload::before {
  top: -95px;
  right: -70px;
  width: 230px;
  height: 230px;
  background: rgba(255, 122, 33, 0.09);
}

.toolisto-ic__upload::after {
  bottom: -80px;
  left: -55px;
  width: 170px;
  height: 170px;
  background: rgba(255, 174, 115, 0.1);
}

.toolisto-ic__upload.toolisto-ic--dragging,
.toolisto-ic__workspace.toolisto-ic--dragging {
  background: #fff8f2;
  border-color: var(--toolisto-ic-primary);
  transform: translateY(-2px);
}

.toolisto-ic__upload-label {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-height: 316px;
  margin: 0;
  padding: 34px 22px;
  color: var(--toolisto-ic-text);
  text-align: center;
  cursor: pointer;
}

.toolisto-ic__upload-icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin-bottom: 18px;
  color: #ffffff;
  background: linear-gradient(145deg, #ff984f, var(--toolisto-ic-primary));
  border-radius: 20px;
  box-shadow: 0 12px 24px rgba(255, 122, 33, 0.24);
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
}

.toolisto-ic__upload-label > strong {
  display: block;
  margin: 0 0 7px;
  color: var(--toolisto-ic-text);
  font-size: clamp(21px, 3vw, 27px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.toolisto-ic__upload-label > span:not(.toolisto-ic__upload-icon):not(.toolisto-ic__upload-button) {
  color: var(--toolisto-ic-muted);
  font-size: 14px;
  line-height: 1.5;
}

.toolisto-ic__upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 19px;
  padding: 10px 20px;
  color: #ffffff;
  background: var(--toolisto-ic-primary);
  border-radius: 11px;
  box-shadow: 0 8px 18px rgba(255, 122, 33, 0.22);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
}

.toolisto-ic__upload-error {
  position: relative;
  z-index: 2;
  max-width: 560px;
  margin: -50px auto 18px;
  padding: 10px 14px;
  color: #b42318;
  background: #fff0ee;
  border: 1px solid #fecdca;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

.toolisto-ic__workspace {
  min-width: 0;
  margin: 0;
  padding: clamp(19px, 3vw, 27px);
  background: #ffffff;
  border: 1px solid var(--toolisto-ic-border);
  border-radius: 20px;
  box-shadow: 0 12px 34px rgba(23, 32, 51, 0.07);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.toolisto-ic__workspace-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.toolisto-ic__eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--toolisto-ic-primary-dark);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.35;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toolisto-image-compressor .toolisto-ic__workspace h2,
.toolisto-image-compressor .toolisto-ic__item h3 {
  margin: 0;
  padding: 0;
  color: var(--toolisto-ic-text);
  font: inherit;
  font-weight: 800;
  text-transform: none;
  overflow-wrap: anywhere;
}

.toolisto-image-compressor .toolisto-ic__workspace h2 {
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.toolisto-ic__workspace-heading p {
  margin: 5px 0 0;
  color: var(--toolisto-ic-muted);
  font-size: 12px;
  line-height: 1.45;
}

.toolisto-ic__workspace-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  flex: 0 0 auto;
}

.toolisto-image-compressor .toolisto-ic__download-all,
.toolisto-image-compressor .toolisto-ic__secondary-button,
.toolisto-image-compressor .toolisto-ic__reset-button,
.toolisto-image-compressor .toolisto-ic__download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  min-height: 40px;
  margin: 0;
  padding: 8px 12px;
  color: #475467;
  background: #f7f8fa;
  border: 1px solid #dfe3e9;
  border-radius: 9px;
  box-shadow: none;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: normal;
  text-decoration: none;
  text-transform: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.toolisto-image-compressor .toolisto-ic__download-all {
  color: #ffffff;
  background: var(--toolisto-ic-primary);
  border-color: var(--toolisto-ic-primary);
  box-shadow: 0 7px 15px rgba(255, 122, 33, 0.18);
}

.toolisto-image-compressor .toolisto-ic__download-all:hover,
.toolisto-image-compressor .toolisto-ic__download-all:focus-visible {
  color: #ffffff;
  background: var(--toolisto-ic-primary-dark);
  border-color: var(--toolisto-ic-primary-dark);
}

.toolisto-image-compressor .toolisto-ic__secondary-button:hover,
.toolisto-image-compressor .toolisto-ic__secondary-button:focus-visible {
  color: var(--toolisto-ic-primary-dark);
  background: #fff4ec;
  border-color: #ffc49d;
}

.toolisto-image-compressor .toolisto-ic__reset-button:hover,
.toolisto-image-compressor .toolisto-ic__reset-button:focus-visible {
  color: #b42318;
  background: #fff0ee;
  border-color: #fecdca;
}

.toolisto-ic__list {
  display: grid;
  gap: 10px;
}

.toolisto-ic__item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  min-width: 0;
  padding: 14px;
  background: #fafbfc;
  border: 1px solid #e5e8ed;
  border-radius: 14px;
}

.toolisto-ic__item-preview {
  display: grid;
  place-items: center;
  width: 112px;
  height: 88px;
  overflow: hidden;
  background-color: #f0f1f3;
  background-image:
    linear-gradient(45deg, #e1e3e7 25%, transparent 25%),
    linear-gradient(-45deg, #e1e3e7 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e1e3e7 75%),
    linear-gradient(-45deg, transparent 75%, #e1e3e7 75%);
  background-position: 0 0, 0 7px, 7px -7px, -7px 0;
  background-size: 14px 14px;
  border: 1px solid #dfe2e7;
  border-radius: 10px;
}

.toolisto-ic__item-preview img {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: contain;
}

.toolisto-ic__item-content {
  min-width: 0;
}

.toolisto-ic__item-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.toolisto-image-compressor .toolisto-ic__item h3 {
  font-size: 15px;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.toolisto-ic__item-heading p {
  margin: 3px 0 0;
  color: var(--toolisto-ic-muted);
  font-size: 11px;
  line-height: 1.4;
}

.toolisto-ic__saving-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 27px;
  padding: 4px 9px;
  color: #067647;
  background: #ecfdf3;
  border: 1px solid #abefc6;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.25;
  white-space: nowrap;
}

.toolisto-ic__saving-badge--neutral {
  color: #475467;
  background: #f2f4f7;
  border-color: #d0d5dd;
}

.toolisto-ic__saving-badge--error {
  color: #b42318;
  background: #fff0ee;
  border-color: #fecdca;
}

.toolisto-ic__item-status {
  min-height: 16px;
  margin: 5px 0 0;
  color: var(--toolisto-ic-success);
  font-size: 10px;
  line-height: 1.4;
}

.toolisto-ic__item-status--error {
  color: #b42318;
}

.toolisto-ic__item-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 7px 0 0;
}

.toolisto-ic__item-stats > div {
  min-width: 0;
  padding: 7px 8px;
  background: #ffffff;
  border: 1px solid #eceff3;
  border-radius: 8px;
}

.toolisto-ic__item-stats dt,
.toolisto-ic__item-stats dd {
  display: block;
  margin: 0;
  padding: 0;
}

.toolisto-ic__item-stats dt {
  margin-bottom: 2px;
  color: var(--toolisto-ic-muted);
  font-size: 9px;
  font-weight: 650;
  line-height: 1.3;
}

.toolisto-ic__item-stats dd {
  color: #344054;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.toolisto-image-compressor .toolisto-ic__download {
  min-width: 116px;
  color: #ffffff;
  background: var(--toolisto-ic-primary);
  border-color: var(--toolisto-ic-primary);
  box-shadow: 0 7px 15px rgba(255, 122, 33, 0.18);
}

.toolisto-image-compressor .toolisto-ic__download:hover,
.toolisto-image-compressor .toolisto-ic__download:focus-visible {
  color: #ffffff;
  background: var(--toolisto-ic-primary-dark);
  border-color: var(--toolisto-ic-primary-dark);
}

.toolisto-image-compressor button:focus-visible,
.toolisto-ic__upload-label:focus-within {
  outline: 3px solid rgba(255, 122, 33, 0.28);
  outline-offset: 3px;
}

.toolisto-image-compressor button:active {
  transform: scale(0.985);
}

.toolisto-image-compressor button:disabled {
  opacity: 0.5;
  cursor: wait;
  transform: none;
}

.toolisto-ic__status {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--toolisto-ic-success);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.toolisto-ic__status--error {
  color: #b42318;
}

.toolisto-ic__privacy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 5px 0 0;
  padding: 0 12px;
  color: var(--toolisto-ic-muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.toolisto-ic__privacy > span {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  color: #ffffff;
  background: #12a56f;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 900;
}

@container toolisto-image-compressor (max-width: 720px) {
  .toolisto-ic__workspace-heading {
    display: block;
  }

  .toolisto-ic__workspace-actions {
    justify-content: flex-start;
    margin-top: 12px;
  }

  .toolisto-ic__item {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .toolisto-ic__item-preview {
    width: 92px;
    height: 82px;
  }

  .toolisto-image-compressor .toolisto-ic__download {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@container toolisto-image-compressor (max-width: 480px) {
  .toolisto-ic__upload {
    min-height: 280px;
    border-radius: 18px;
  }

  .toolisto-ic__upload-label {
    min-height: 276px;
    padding: 28px 18px;
  }

  .toolisto-ic__workspace {
    padding: 16px;
    border-radius: 17px;
  }

  .toolisto-ic__workspace-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolisto-image-compressor .toolisto-ic__download-all {
    grid-column: 1 / -1;
  }

  .toolisto-ic__item {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 11px;
    padding: 11px;
  }

  .toolisto-ic__item-preview {
    width: 76px;
    height: 76px;
  }

  .toolisto-ic__item-heading {
    display: block;
  }

  .toolisto-ic__saving-badge {
    margin-top: 5px;
    white-space: normal;
  }

  .toolisto-ic__item-stats {
    grid-template-columns: 1fr;
  }

  .toolisto-ic__privacy {
    align-items: flex-start;
    padding: 0 3px;
    text-align: left;
  }
}

@media (max-width: 720px) {
  .toolisto-ic__item {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .toolisto-image-compressor .toolisto-ic__download {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toolisto-image-compressor * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
