.heic-page {
  --paper: #161513;
  --paper-2: #1f1d1a;
  --ink: #f3eee6;
  --ink-soft: #c8c0b4;
  --muted: #9a9286;
  --line: #3d3830;
  --copper: #d4894a;
  --copper-deep: #e4b07a;
  --forest: #7eb89a;
  --forest-soft: #24352c;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  background:
    radial-gradient(1100px 460px at 8% -12%, rgba(212, 137, 74, 0.12), transparent 55%),
    radial-gradient(800px 380px at 100% 0%, rgba(126, 184, 154, 0.06), transparent 48%),
    var(--paper);
  color: var(--ink);
}

.heic-page .hero {
  padding: 2.1rem 0 1.35rem;
}

.heic-page h1 {
  font-size: clamp(2.1rem, 5vw, 3.15rem);
}

.heic-page .lede {
  margin-bottom: 0.85rem;
  font-size: 1.12rem;
}

.heic-page .section {
  padding-top: 1.6rem;
  padding-bottom: 2.4rem;
}

.heic-page a {
  color: var(--copper-deep);
}

.heic-page a:hover {
  color: var(--copper);
}

.heic-page .site-header {
  background: rgba(22, 21, 19, 0.86);
}

.heic-page .site-header.is-scrolled {
  border-bottom-color: var(--line);
}

.heic-page .button-primary {
  background: #f3eee6;
  color: #161513;
}

.heic-page .button-primary:hover {
  background: #fffaf2;
  color: #161513;
}

.heic-page .button-ghost {
  color: var(--ink);
  border-color: #5c554b;
}

.heic-page .button-ghost:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.heic-page .button:disabled,
.heic-page .button[aria-disabled="true"],
.heic-page .button:disabled:hover,
.heic-page .button[aria-disabled="true"]:hover {
  background: #3a3530;
  color: #b8b0a4;
}

.heic-page .section-alt {
  background: rgba(255, 250, 242, 0.03);
}

.heic-page .site-footer {
  border-top-color: var(--line);
}

.heic-page code {
  background: #2a2722;
  color: #f3eee6;
}

.heic-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.2rem;
  align-items: start;
}

.heic-panel,
.heic-results {
  padding: 1.35rem 1.3rem 1.45rem;
}

.heic-panel .section-lede {
  max-width: none;
}

.heic-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 16.5rem;
  margin: 0 0 1.25rem;
  padding: 1.6rem 1.2rem;
  border: 1px dashed #6a6256;
  border-radius: 18px;
  background: #191714;
  color: var(--ink-soft);
  text-align: center;
  cursor: pointer;
}

.heic-drop.is-over {
  border-color: var(--copper-deep);
  background: #221e19;
}

.heic-drop input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.heic-drop-title {
  font-family: var(--serif);
  font-size: 1.55rem;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.heic-drop-copy {
  max-width: 26rem;
  font-size: 1rem;
}

.heic-field {
  margin: 0 0 1.1rem;
  border: 0;
  padding: 0;
}

.heic-field legend,
.heic-field > label {
  display: block;
  margin: 0 0 0.45rem;
  font-weight: 650;
}

.heic-quality-read {
  margin-left: 0.35rem;
  color: var(--muted);
  font-weight: 500;
  font-family: var(--mono);
  font-size: 0.92rem;
}

.heic-formats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.heic-choice {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.35rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #191714;
  cursor: pointer;
}

.heic-choice:has(input:checked) {
  border-color: var(--copper-deep);
  background: #2a231b;
}

.heic-choice input {
  margin: 0;
}

.heic-field input[type="range"] {
  display: block;
  width: 100%;
  max-width: 22rem;
  accent-color: var(--copper);
}

.heic-page .field-hint {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.heic-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0 0 0.85rem;
}

.heic-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.heic-status.is-error {
  color: #e7a08a;
}

.heic-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.heic-item {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.85rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}

.heic-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.heic-thumb {
  width: 5.5rem;
  height: 5.5rem;
  object-fit: cover;
  border-radius: 12px;
  background: #191714;
  border: 1px solid var(--line);
}

.heic-thumb.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
  padding: 0.4rem;
}

.heic-item h3 {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.heic-item p {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.heic-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.heic-item .button {
  min-height: 40px;
  padding: 0.45rem 0.85rem;
}

.heic-page .quality-hidden #quality,
.heic-page .quality-hidden .field-hint {
  opacity: 0.45;
}

@media (max-width: 900px) {
  .heic-layout {
    grid-template-columns: 1fr;
  }

  .heic-drop {
    min-height: 13rem;
  }
}
