.image-tool-main {
  width: min(1060px, calc(100% - 40px));
  margin: 0 auto;
  padding: 66px 0 110px;
}

.image-tool-hero {
  max-width: 820px;
  margin: 0 auto 48px;
  text-align: center;
}

.image-tool-hero h1 {
  margin: 22px 0 18px;
  color: var(--ink);
  font: 800 clamp(45px, 6vw, 72px)/.98 "Manrope", sans-serif;
  letter-spacing: -4px;
}

.image-tool-hero h1 em {
  color: var(--purple);
  font-style: normal;
}

.image-tool-hero > p {
  max-width: 670px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.format-pills {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}

.format-pills span {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, .66);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .6px;
}

.image-compressor-card {
  padding: 34px;
  border: 1px solid rgba(222, 225, 237, .95);
  border-radius: 26px;
  background: var(--card);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .8);
}

.compressor-heading-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.compressor-heading-row h2 {
  margin: 6px 0 0;
  font: 700 clamp(23px, 3vw, 31px)/1.15 "Manrope", sans-serif;
  letter-spacing: -1px;
}

.limit-note {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.image-dropzone {
  min-height: 225px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1.5px dashed #c6ccda;
  border-radius: 20px;
  background: rgba(247, 248, 252, .84);
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s;
}

.image-dropzone:hover,
.image-dropzone.is-dragging {
  border-color: var(--purple);
  background: #f4f1ff;
  transform: translateY(-1px);
}

.image-dropzone input { display: none; }
.image-dropzone strong { font: 700 17px/1.3 "Manrope", sans-serif; }
.image-dropzone > span:last-child { color: var(--muted); font-size: 12px; }

.dropzone-icon {
  width: 54px;
  height: 54px;
  margin-bottom: 7px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  color: var(--purple);
  background: #eee9ff;
}

.dropzone-icon svg {
  width: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.selected-images {
  margin-top: 20px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(248, 249, 252, .7);
}

.selected-images-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 13px;
  font-size: 11px;
}

.selected-images-head button {
  padding: 0;
  border: 0;
  color: #d45b47;
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
}

.selected-image-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.selected-image-item {
  min-width: 0;
  padding: 8px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 25px;
  gap: 9px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
}

.selected-image-item img {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--soft);
}

.selected-image-copy { min-width: 0; }
.selected-image-copy strong,
.selected-image-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected-image-copy strong { font-size: 10px; }
.selected-image-copy span { margin-top: 3px; color: var(--muted); font-size: 9px; }

.remove-image {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: var(--soft);
  cursor: pointer;
  font-size: 15px;
}

.image-options-grid {
  margin-top: 25px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.image-option-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.image-option-field > span {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.image-option-field output { color: var(--purple); }

.image-option-field select,
.dimension-input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--card);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.image-option-field select {
  padding: 0 13px;
  cursor: pointer;
}

.image-option-field select:focus,
.dimension-input:focus-within {
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(105, 71, 232, .09);
}

.dimension-input {
  display: flex;
  align-items: center;
}

.dimension-input input {
  min-width: 0;
  flex: 1;
  height: 100%;
  padding: 0 13px;
  border: 0;
  color: var(--ink);
  background: transparent;
  outline: none;
}

.dimension-input small {
  padding-right: 13px;
  color: var(--muted);
  font-size: 10px;
}

.quality-field input {
  width: 100%;
  accent-color: var(--purple);
}

.image-toggle-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  grid-column: 1 / -1;
}

.image-check {
  min-height: 62px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  background: rgba(248, 249, 252, .58);
}

.image-check input { accent-color: var(--purple); }
.image-check span { min-width: 0; }
.image-check strong,
.image-check small { display: block; }
.image-check strong { font-size: 11px; }
.image-check small { margin-top: 3px; color: var(--muted); font-size: 9px; }

.image-compress-button { margin-top: 24px; }
.image-compress-button:disabled { cursor: not-allowed; opacity: .56; }
.image-form-note { margin: 12px 0 0; color: var(--muted); text-align: center; font-size: 9px; }

.image-progress {
  margin-top: 17px;
}

.image-progress > div {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
}

.image-progress > div strong { font-weight: 500; }
.image-progress > span {
  height: 4px;
  display: block;
  overflow: hidden;
  border-radius: 99px;
  background: var(--line);
}

.image-progress > span::after {
  content: "";
  width: 45%;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--purple), #a48bf6);
  animation: image-progress 1.1s ease-in-out infinite alternate;
}

@keyframes image-progress { to { transform: translateX(122%); } }

.image-result {
  margin-top: 24px;
  padding: 19px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 15px;
  align-items: center;
  border: 1px solid #b9dec8;
  border-radius: 16px;
  background: #f1fbf5;
}

.result-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #247a49;
  background: #dcefe4;
}

.result-icon svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.result-copy { min-width: 0; }
.result-copy h3 { margin: 4px 0 3px; font: 700 15px/1.25 "Manrope", sans-serif; }
.result-copy p:last-child { margin: 0; color: #4d715c; font-size: 10px; }

.result-download {
  padding: 11px 16px;
  border-radius: 10px;
  color: #fff;
  background: #278c55;
  font-size: 11px;
  font-weight: 800;
}

.image-guide-section,
.image-faq-section {
  padding-top: 100px;
}

.section-heading { max-width: 660px; margin-bottom: 31px; }
.section-heading h2,
.image-faq-section h2 {
  margin: 8px 0 0;
  font: 700 clamp(29px, 4vw, 42px)/1.13 "Manrope", sans-serif;
  letter-spacing: -1.7px;
}

.image-guide-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.image-guide-grid article {
  min-height: 220px;
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .7);
}

.image-guide-grid article > strong { color: var(--purple); font-size: 10px; letter-spacing: 1px; }
.image-guide-grid h3 { margin: 62px 0 9px; font: 700 16px/1.3 "Manrope", sans-serif; }
.image-guide-grid p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }

.image-faq-section {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 65px;
  align-items: start;
}

html[data-theme="dark"] .format-pills span,
html[data-theme="dark"] .image-guide-grid article {
  background: rgba(27, 30, 41, .8);
  border-color: #303544;
}

html[data-theme="dark"] .image-compressor-card {
  border-color: #303544;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .04);
}

html[data-theme="dark"] .image-dropzone,
html[data-theme="dark"] .selected-images,
html[data-theme="dark"] .image-check {
  background: #1b1e29;
  border-color: #333847;
}

html[data-theme="dark"] .image-dropzone:hover,
html[data-theme="dark"] .image-dropzone.is-dragging { background: #242038; border-color: var(--purple); }
html[data-theme="dark"] .dropzone-icon { background: #2b2545; }
html[data-theme="dark"] .selected-image-item,
html[data-theme="dark"] .image-option-field select,
html[data-theme="dark"] .dimension-input { color: var(--ink); background: #1b1e29; border-color: #333847; }
html[data-theme="dark"] .image-option-field select { color-scheme: dark; }
html[data-theme="dark"] .image-result { background: #17271e; border-color: #315e43; }
html[data-theme="dark"] .result-copy p:last-child { color: #9ac4a9; }

@media (max-width: 760px) {
  .image-tool-main { width: calc(100% - 28px); padding-top: 48px; }
  .image-tool-hero h1 { letter-spacing: -3px; }
  .image-compressor-card { padding: 23px 18px; border-radius: 21px; }
  .compressor-heading-row { align-items: flex-start; flex-direction: column; gap: 9px; }
  .selected-image-list,
  .image-options-grid,
  .image-guide-grid,
  .image-faq-section { grid-template-columns: 1fr; }
  .image-toggle-group { grid-template-columns: 1fr; }
  .image-dropzone { min-height: 190px; padding: 23px 16px; text-align: center; }
  .image-result { grid-template-columns: 42px minmax(0, 1fr); }
  .result-download { grid-column: 1 / -1; text-align: center; }
  .image-guide-section, .image-faq-section { padding-top: 76px; }
  .image-faq-section { gap: 28px; }
  .image-guide-grid article { min-height: 180px; }
  .image-guide-grid h3 { margin-top: 40px; }
}

@media (max-width: 430px) {
  .image-tool-main { width: calc(100% - 20px); }
  .image-tool-hero h1 { font-size: 42px; letter-spacing: -2.7px; }
  .image-tool-hero > p { font-size: 13px; }
  .selected-image-list { grid-template-columns: 1fr; }
  .limit-note { white-space: normal; }
}
