.heic-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.85fr);
  gap: 28px;
  align-items: start;
  padding-top: 24px;
  padding-bottom: 40px;
}

.heic-card,
.heic-side,
.heic-result {
  border: 1px solid rgba(43, 43, 40, 0.1);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(43, 43, 40, 0.08);
}

.heic-card { padding: clamp(22px, 4vw, 38px); }
.heic-side { padding: 26px; }

.heic-dropzone {
  display: grid;
  min-height: 220px;
  place-items: center;
  margin-top: 24px;
  padding: 28px;
  border: 1.5px dashed rgba(111, 131, 72, 0.55);
  border-radius: 20px;
  background: rgba(143, 165, 99, 0.08);
  cursor: pointer;
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.heic-dropzone[data-dragging="true"] {
  border-color: #6f8348;
  background: rgba(143, 165, 99, 0.16);
  transform: translateY(-2px);
}

.heic-dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.heic-dropzone-copy { display: grid; justify-items: center; gap: 8px; }
.heic-dropzone-copy strong { font-size: clamp(1.15rem, 2vw, 1.35rem); color: #2b2b28; }
.heic-dropzone-copy span,
.heic-dropzone-copy small { color: #66665f; }

.heic-file-icon {
  display: grid;
  width: 60px;
  height: 68px;
  place-items: center;
  border-radius: 14px;
  background: #6f8348;
  color: #fff !important;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.heic-summary,
.heic-status {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #faf8f3;
  color: #5f5f59;
  overflow-wrap: anywhere;
}

.heic-status[data-state="error"] { background: #fff0ed; color: #8d342a; }
.heic-status[data-state="working"] { background: #fff8e5; color: #785c12; }
.heic-status[data-state="ready"],
.heic-status[data-state="success"] { background: #eef4e5; color: #4d622c; }

.heic-quality { margin: 24px 0 0; padding: 0; border: 0; }
.heic-quality legend { margin-bottom: 12px; font-weight: 750; color: #2b2b28; }
.heic-quality-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.heic-quality label { position: relative; display: block; cursor: pointer; }
.heic-quality input { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.heic-quality span {
  display: grid;
  min-height: 86px;
  align-content: center;
  gap: 4px;
  padding: 14px;
  border: 1px solid rgba(43, 43, 40, 0.14);
  border-radius: 14px;
  background: #fff;
}
.heic-quality small { color: #74746d; }
.heic-quality input:checked + span { border-color: #6f8348; background: #f2f6eb; box-shadow: inset 0 0 0 1px #6f8348; }

.heic-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin-top: 20px; }
.heic-action,
.heic-download,
.heic-reset {
  min-height: 50px;
  border-radius: 14px;
  font: inherit;
  font-weight: 750;
}
.heic-action,
.heic-download { border: 0; background: #6f8348; color: #fff; }
.heic-action { padding: 0 20px; cursor: pointer; }
.heic-action:disabled { cursor: not-allowed; opacity: 0.45; }
.heic-reset { padding: 0 18px; border: 1px solid rgba(43, 43, 40, 0.18); background: #fff; color: #2b2b28; cursor: pointer; }
.heic-download { display: inline-flex; align-items: center; justify-content: center; margin-top: 14px; padding: 0 20px; text-decoration: none; }
.heic-download[hidden] { display: none; }

.heic-result { margin-top: 24px; padding: 22px; }
.heic-result[hidden] { display: none; }
.heic-result-preview { display: grid; place-items: center; min-height: 220px; overflow: hidden; border-radius: 16px; background: #efeee9; }
.heic-result-preview img { display: block; max-width: 100%; max-height: 520px; object-fit: contain; }
.heic-result h3 { margin: 18px 0 6px; }
.heic-result p { margin: 0; color: #62625d; }

.heic-side ol { display: grid; gap: 16px; margin: 20px 0 0; padding: 0; list-style: none; counter-reset: heic-step; }
.heic-side li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; counter-increment: heic-step; }
.heic-side li::before { content: counter(heic-step); display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: #d4a23a; color: #2b2b28; font-weight: 800; }
.heic-privacy { margin-top: 22px; padding: 18px; border-radius: 16px; background: #f2f6eb; }
.heic-privacy h3 { margin: 0 0 8px; }
.heic-privacy p { margin: 0; }

.heic-source-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.heic-source-grid .section-block { height: 100%; }
.heic-license-note { margin-top: 16px; padding: 18px; border-left: 4px solid #d4a23a; border-radius: 0 14px 14px 0; background: #fff9e9; }

.heic-card :focus-visible,
.heic-side :focus-visible,
.heic-source-grid a:focus-visible {
  outline: 3px solid rgba(212, 162, 58, 0.7);
  outline-offset: 3px;
}

@media (max-width: 720px) {
  .heic-shell,
  .heic-source-grid { grid-template-columns: 1fr; }
  .heic-shell { gap: 18px; padding-top: 14px; }
  .heic-card,
  .heic-side { border-radius: 18px; }
  .heic-dropzone { min-height: 190px; padding: 22px 16px; }
  .heic-quality-grid { grid-template-columns: 1fr; }
  .heic-quality span { min-height: 68px; }
  .heic-actions { grid-template-columns: 1fr; }
  .heic-action,
  .heic-reset,
  .heic-download { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .heic-dropzone { transition: none; }
}
