.heic-shell {
  max-width: 980px;
  margin: 0 auto;
}

#heicTool [hidden] {
  display: none !important;
}

.heic-upload-card,
.heic-results {
  border: 1px solid rgba(10, 5, 35, 0.08);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(10, 5, 35, 0.04);
}

.heic-upload-card {
  padding: 14px;
}

.heic-dropzone {
  padding: 42px 20px 36px;
  text-align: center;
  border: 1px dashed rgba(98, 109, 240, 0.38);
  border-radius: 16px;
  background: #f8f8fd;
  transition: border-color 180ms ease, background 180ms ease;
}

.heic-dropzone.is-dragover {
  border-color: #6e78ff;
  background: #f2f4ff;
}

.heic-dropzone:focus-visible {
  outline: none;
  border-color: #6e78ff;
  box-shadow: 0 0 0 4px rgba(110, 120, 255, 0.12);
}

.heic-dropzone-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #6e78ff;
  background: rgba(110, 120, 255, 0.12);
}

.heic-dropzone-icon svg {
  width: 24px;
  height: 24px;
}

.heic-primary-btn,
.heic-secondary-btn,
.heic-card-btn {
  appearance: none;
  border: 0;
  border-radius: 10px;
  font-family: inherit;
  font-size: inherit;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.heic-primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 22px;
  color: #fff;
  background: linear-gradient(180deg, #7783ff, #6670f2);
  box-shadow: 0 8px 18px rgba(102, 112, 242, 0.18);
}

.heic-btn-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.heic-dropzone-note,
.heic-dropzone-subnote,
.heic-toolbar-stats,
.heic-results-summary,
.heic-empty,
.heic-card-subtitle,
.heic-card-message,
.heic-setting-control p {
  color: rgba(10, 5, 35, 0.58);
}

.heic-toolbar-stats,
.heic-results-summary,
.heic-empty {
  font-size: 15px;
  line-height: 1.6;
}

.heic-toolbar-stats {
  line-height: 1.4;
}

#heicTool .tool-meta {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(10, 5, 35, 0.72);
}

.heic-card-subtitle {
  font-size: 12px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.heic-dropzone-note {
  margin: 12px auto 0;
  max-width: 620px;
}

.heic-dropzone-subnote {
  margin: 6px 0 0;
  font-size: 13px;
}

.heic-settings {
  margin-top: 14px;
  border: 1px solid rgba(10, 5, 35, 0.08);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.heic-settings summary,
.heic-settings-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.heic-settings summary::-webkit-details-marker {
  display: none;
}

.heic-settings-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: rgba(10, 5, 35, 0.54);
}

.heic-settings-chevron {
  width: 16px;
  height: 16px;
  margin-left: auto;
  flex-shrink: 0;
  color: rgba(10, 5, 35, 0.54);
  transition: transform 200ms ease;
}

details[open] .heic-settings-chevron {
  transform: rotate(180deg);
}

.heic-settings-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 14px;
  background: rgba(10, 5, 35, 0.04);
  color: rgba(10, 5, 35, 0.74);
  margin-bottom: 8px;
  border-radius: 8px;
}

.heic-settings-body {
  padding: 0 10px 10px;
}

.heic-setting-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 18px;
  border-radius: 12px;
  background: #f7f8fc;
}

.heic-setting-row + .heic-setting-row {
  margin-top: 10px;
}

.heic-setting-row label,
.heic-setting-row > span {
  font-weight: 700;
  color: var(--berry-black-60);
}

.heic-setting-control select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(10, 5, 35, 0.12);
  background: #fff;
  color: var(--berry-black-60);
  font: inherit;
}

.heic-setting-control p {
  margin: 8px 0 0;
  font-size: 13px;
}

.heic-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--berry-black-60);
}

.heic-status {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(10, 5, 35, 0.1);
  background: #f7f8fc;
  color: var(--berry-black-60);
}

.heic-status.is-ok {
  border-color: rgba(22, 163, 74, 0.22);
  background: rgba(22, 163, 74, 0.08);
}

.heic-status.is-err {
  border-color: rgba(239, 68, 68, 0.22);
  background: rgba(239, 68, 68, 0.08);
}

.heic-toolbar {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.heic-toolbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.heic-secondary-btn,
.heic-card-btn {
  min-height: 34px;
  padding: 0 14px;
  font-size: 13px;
  border: 1px solid rgba(10, 5, 35, 0.12);
  background: #fff;
  color: var(--berry-black-60);
}

.heic-primary-btn[disabled],
.heic-secondary-btn[disabled],
.heic-card-btn[disabled],
.heic-card-btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.heic-results {
  margin-top: 18px;
  padding: 18px;
}

.heic-results-kicker {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6e78ff;
}

.heic-results-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.heic-results-title {
  margin: 0;
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.1;
  color: var(--berry-black-60);
}

.heic-empty {
  margin-top: 16px;
  padding: 18px;
  border-radius: 14px;
  text-align: center;
  background: #f8f8fd;
}

.heic-list {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.heic-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(10, 5, 35, 0.08);
  border-radius: 14px;
  background: #fff;
}

.heic-preview {
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(45deg, rgba(10, 5, 35, 0.03) 25%, transparent 25%, transparent 75%, rgba(10, 5, 35, 0.03) 75%),
    linear-gradient(45deg, rgba(10, 5, 35, 0.03) 25%, transparent 25%, transparent 75%, rgba(10, 5, 35, 0.03) 75%);
  background-position: 0 0, 10px 10px;
  background-size: 20px 20px;
  border: 1px solid rgba(10, 5, 35, 0.07);
}

.heic-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0;
  display: block;
}

.heic-preview-placeholder {
  padding: 12px;
  text-align: center;
  color: rgba(10, 5, 35, 0.46);
  font-weight: 700;
}

.heic-card-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.heic-card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--berry-black-60);
  word-break: break-word;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.heic-card-meta {
  margin-top: 6px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.heic-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(10, 5, 35, 0.74);
  background: rgba(10, 5, 35, 0.06);
}

.heic-pill.is-ready {
  background: rgba(110, 120, 255, 0.1);
  color: #5962d8;
}

.heic-pill.is-converting {
  background: rgba(249, 115, 22, 0.12);
  color: #c2410c;
}

.heic-pill.is-converted {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
}

.heic-pill.is-error {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.heic-card-message {
  margin-top: 6px;
  font-size: 13px;
  color: rgba(10, 5, 35, 0.58);
}

.heic-card-actions {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.heic-card-btn {
  text-decoration: none;
}

.heic-card-btn.is-primary {
  color: #fff;
  background: linear-gradient(180deg, #7783ff, #6670f2);
  border-color: transparent;
}

.heic-card-btn.is-danger {
  color: #b91c1c;
}

@media (max-width: 720px) {
  .heic-upload-card,
  .heic-results {
    padding: 12px;
  }

  .heic-dropzone {
    padding: 30px 14px;
  }

  .heic-setting-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .heic-toolbar-actions,
  .heic-card-actions {
    width: 100%;
    flex-direction: column;
  }

  .heic-secondary-btn,
  .heic-card-btn,
  .heic-primary-btn {
    width: 100%;
    justify-content: center;
  }

  .heic-card {
    grid-template-columns: 1fr;
  }

  .heic-preview {
    width: 100%;
    max-width: 160px;
    margin: 0 auto;
  }

  .heic-setting-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .heic-quality-row {
    flex-wrap: wrap;
  }

  .heic-apply-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ---- New settings UI ---- */

.heic-resize-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.heic-resize-inputs input[type="number"] {
  width: 120px;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(10, 5, 35, 0.12);
  background: #fff;
  color: var(--berry-black-60);
  font: inherit;
}

.heic-resize-sep,
.heic-input-suffix {
  color: rgba(10, 5, 35, 0.54);
  font-weight: 700;
}

.heic-quality-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.heic-quality-slider-wrap {
  flex: 1;
}

.heic-quality-slider-wrap input[type="range"] {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 4px;
  background: rgba(10, 5, 35, 0.1);
  cursor: pointer;
  margin: 0;
  border: 0;
  outline: none;
}

.heic-quality-slider-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #6e78ff;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(110, 120, 255, 0.3);
}

.heic-quality-slider-wrap input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #6e78ff;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(110, 120, 255, 0.3);
}

.heic-quality-num {
  width: 66px;
  min-height: 38px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid rgba(10, 5, 35, 0.12);
  background: #fff;
  color: var(--berry-black-60);
  font: inherit;
  font-weight: 700;
  text-align: center;
}

.heic-radio-group {
  display: flex;
  gap: 18px;
  align-items: center;
}

.heic-radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  cursor: pointer;
  color: rgba(10, 5, 35, 0.74);
}

.heic-radio-label input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: #6e78ff;
  cursor: pointer;
}

.heic-settings-footer {
  display: flex;
  justify-content: flex-end;
  padding: 14px 18px 8px;
  border-top: 1px solid rgba(10, 5, 35, 0.06);
  margin-top: 6px;
}

.heic-apply-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 20px;
  border-radius: 10px;
  border: 0;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(180deg, #7783ff, #6670f2);
  box-shadow: 0 8px 18px rgba(102, 112, 242, 0.18);
  cursor: pointer;
}

.heic-apply-btn:hover {
  background: linear-gradient(180deg, #8893ff, #7783ff);
}

/* ---- Content article (matches other tool pages) ---- */

.content-card {
  margin-top: 60px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  font-family: var(--fonts--body, Heebo, Arial, sans-serif);
}

.content-card h2 {
  margin: 0 0 12px;
  color: #2D2A26;
  font-size: 30px;
  line-height: 1.25;
  font-weight: 700;
  font-family: var(--fonts--display, Heebo, Arial, sans-serif);
}

.content-card h3 {
  margin: 18px 0 8px;
  color: #2D2A26;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 600;
  font-family: var(--fonts--display, Heebo, Arial, sans-serif);
}

.content-card p {
  margin: 0 0 12px;
  color: #2D2A26;
  font-size: 16px;
  line-height: 1.55;
  font-weight: 400;
}

.content-card ol,
.content-card ul {
  margin: 0 0 12px;
  padding-left: 26px;
  list-style-position: outside;
  color: #2D2A26;
  line-height: 1.55;
}

.content-card ul {
  list-style: disc;
}

.content-card ol {
  list-style: decimal;
}

.content-card li {
  margin: 0 0 8px;
  color: #2D2A26;
  font-size: 16px;
  line-height: 1.55;
  font-weight: 400;
  display: list-item;
  padding-left: 6px;
}

/* ---- Transparent color picker ---- */

.heic-color-row {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid rgba(10, 5, 35, 0.12);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  max-width: 280px;
}

.heic-color-hex {
  flex: 1;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--berry-black-60);
  font: inherit;
  font-weight: 600;
  outline: none;
  min-width: 0;
}

.heic-color-swatch-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 42px;
  border-left: 1px solid rgba(10, 5, 35, 0.1);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.heic-color-swatch-label input[type="color"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
}

.heic-color-swatch {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid rgba(10, 5, 35, 0.12);
  background-image:
    linear-gradient(45deg, #ccc 25%, transparent 25%),
    linear-gradient(-45deg, #ccc 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ccc 75%),
    linear-gradient(-45deg, transparent 75%, #ccc 75%);
  background-size: 8px 8px;
  background-position: 0 0, 0 4px, 4px -4px, -4px 0;
  position: relative;
  pointer-events: none;
}

.heic-color-swatch::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 3px;
  background: inherit;
  background-image: none;
}