:root {
  color-scheme: light;
  --paper: #f7f6ef;
  --white: #fffefa;
  --ink: #242823;
  --muted: #565d50;
  --line: #e1e1d5;
  --yellow: #f8cc48;
  --yellow-hover: #efbf32;
  --olive: #375443;
  --soft-green: #e4efe4;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  --radius: 19px;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 280px; }
a { color: inherit; text-decoration: none; }
button, select, input { font: inherit; }
button, summary { cursor: pointer; }
button { color: inherit; }
button:disabled { opacity: .55; cursor: not-allowed; }
:focus-visible { outline: 3px solid #4b7258; outline-offset: 4px; }
section[id] { scroll-margin-top: 24px; }
h1, h2, h3, p { margin: 0; }
.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  white-space: nowrap;
  clip-path: inset(50%);
}
.skip-link {
  position: fixed;
  z-index: 10;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  transform: translateY(-130%);
  background: var(--yellow);
  border-radius: 8px;
}
.skip-link:focus { transform: translateY(0); }
.wrap { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }

.site-header { border-bottom: 1px solid var(--line); }
.header-inner {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 23px; font-weight: 750; letter-spacing: .01em; white-space: nowrap; }
.brand-accent { color: var(--olive); }
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--yellow);
  display: inline-grid;
  place-items: center;
}
.brand-mark .icon { width: 21px; height: 21px; stroke-width: 1.8; }
.footer-inner a:hover { text-decoration: underline; text-underline-offset: 4px; }

.hero { min-height: 297px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 36px 40px; }
.hero-copy { flex: 0 0 auto; max-width: 100%; }
.eyebrow { font: 700 11px/1.35 var(--mono); letter-spacing: .105em; color: #50584a; }
.eyebrow { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.eyebrow-dot { width: 9px; height: 9px; background: var(--yellow); border: 1px solid #9b7727; transform: rotate(45deg); margin-left: 2px; }
.hero h1 { font-size: clamp(46px, 6.15vw, 83px); font-weight: 800; line-height: .99; letter-spacing: -.077em; }
.hero h1 span { color: var(--olive); }
.hero-description { max-width: 465px; margin-top: 19px; font-size: clamp(15px, 1.65vw, 17px); line-height: 1.6; color: var(--muted); }
.hero-art { width: clamp(200px, 36%, 405px); height: auto; display: block; margin-right: clamp(0px, 3vw, 38px); }

.converter { background: var(--white); border: 1px solid #d6d9cb; border-radius: var(--radius); box-shadow: 0 6px 0 #eae9dc; }
.tabs { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; border-bottom: 1px solid var(--line); padding: 10px; }
.tab {
  border: 1px solid transparent;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 4px 7px;
  background: transparent;
  font-size: 14px;
  font-weight: 680;
  color: var(--muted);
  white-space: nowrap;
}
.tab .icon { width: 18px; height: 18px; }
.tab:hover { background: #f2f1e9; color: var(--ink); }
.tab[aria-pressed="true"] { background: #f9edc4; color: var(--ink); border-color: #eedba3; }
.converter-body { padding: clamp(15px, 2.4vw, 28px); }
.workspace { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); align-items: start; gap: clamp(22px, 3.1vw, 45px); }
.dropzone {
  min-height: 233px;
  border: 1.5px dashed #b7bda9;
  border-radius: 13px;
  background: #f8f8f1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 12px;
  text-align: center;
  transition: background-color .15s, border-color .15s;
}
.dropzone.is-dragging { border-color: #506d50; background: #edf3e5; }
.upload-icon { display: grid; place-items: center; width: 47px; height: 47px; color: #38523e; background: var(--soft-green); border: 1px solid #d8e4d3; border-radius: 12px; margin-bottom: 13px; }
.upload-icon .icon { width: 23px; height: 23px; }
.drop-title { font-size: 19px; font-weight: 760; letter-spacing: -.035em; }
.drop-hint { font-size: 12px; line-height: 1.5; color: var(--muted); margin-top: 5px; }
.dropzone .button { margin-top: 15px; }
.options { padding-top: 2px; }
.option-heading h3 { font-size: 20px; font-weight: 760; letter-spacing: -.035em; margin: 4px 0 10px; }
.select-wrap { position: relative; }
.select-wrap select {
  appearance: none;
  width: 100%;
  min-height: 45px;
  padding: 8px 40px 8px 12px;
  border: 1px solid #c9cebf;
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font-size: 14px;
  font-weight: 680;
}
.select-wrap .icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; width: 17px; height: 17px; }
.format-note { color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 7px; }
.image-options { margin-top: 8px; }
.image-options summary { display: inline-flex; gap: 5px; align-items: center; list-style: none; font-size: 12px; font-weight: 700; color: var(--olive); padding-block: 4px; }
summary::-webkit-details-marker { display: none; }
.image-options summary .icon { width: 14px; height: 14px; }
details[open] > summary .icon { transform: rotate(180deg); }
.advanced-fields { display: grid; gap: 9px; padding-block: 6px; }
.advanced-fields label { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--muted); }
.advanced-fields select { border: 1px solid #c9cebf; border-radius: 6px; padding: 3px; color: var(--ink); background: var(--white); }
.advanced-fields input { accent-color: #4a6c50; width: min(140px, 100%); }

.button {
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 40px;
  padding: 8px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 740;
  line-height: 1.25;
  transition: background-color .15s, border-color .15s;
}
.button .icon { width: 16px; height: 16px; }
.button-light { background: var(--white); border-color: #cdd1c2; }
.button-light:hover:not(:disabled) { background: #f0f2e8; border-color: #aab3a2; }
.button-primary {
  margin-top: 16px;
  min-height: 48px;
  width: 100%;
  background: var(--yellow);
  border-color: #d7ad34;
  font-size: 15px;
}
.button-primary:hover:not(:disabled) { background: var(--yellow-hover); }
.button-primary .icon { width: 19px; height: 19px; }
.button-primary .button-end { margin-left: auto; }
.tool-footer { border-top: 1px solid var(--line); display: flex; align-items: center; flex-wrap: wrap; gap: 12px 24px; min-height: 50px; padding: 10px clamp(15px, 2.4vw, 28px); background: #fbfbf5; border-radius: 0 0 var(--radius) var(--radius); }
.tool-footer span { display: inline-flex; align-items: center; gap: 6px; color: #435345; font-size: 12px; font-weight: 650; }
.tool-footer .icon { width: 15px; height: 15px; }
.no-script { padding: 10px 16px; }
.progress-wrap { margin-top: 14px; }
.progress-wrap progress { width: 100%; height: 10px; accent-color: #527459; }
.progress-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12px; color: var(--muted); }
.link-button { background: transparent; border: 0; color: var(--olive); text-decoration: underline; text-underline-offset: 2px; font-size: 12px; font-weight: 720; min-height: 30px; padding: 2px 3px; }
.notice { margin-top: 15px; background: #f2f4ea; border: 1px solid #dce1d4; border-radius: 8px; padding: 10px 13px; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.notice[data-kind="error"] { background: #fff1e7; border-color: #eccab4; color: #78391e; }

.queue, .results { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 15px; }
.list-heading, .results-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.list-heading h3, .results h3 { font-size: clamp(16px, 3vw, 19px); letter-spacing: -.025em; }
.file-list { padding: 0; margin: 6px 0 0; list-style: none; display: grid; gap: 6px; }
.file-row { min-width: 0; display: flex; align-items: center; gap: 9px; border: 1px solid #e5e6dc; background: #fdfdf8; border-radius: 8px; padding: 7px 9px; }
.file-row > .icon { width: 17px; height: 17px; color: #546954; }
.file-row .file-meta { min-width: 0; flex: 1 1 auto; }
.file-name { display: block; font-size: 13px; line-height: 1.3; font-weight: 710; overflow-wrap: anywhere; }
.file-note { display: block; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.file-note[data-state="error"] { color: #883d23; }
.file-note[data-state="ready"] { color: #355b3f; }
.remove-file { display: grid; place-items: center; flex: 0 0 32px; height: 32px; border-radius: 6px; border: 0; background: transparent; color: var(--muted); }
.remove-file:hover:not(:disabled) { background: #f0ede4; color: var(--ink); }
.remove-file .icon { width: 16px; height: 16px; }
.results-heading { flex-wrap: wrap; }
.results-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.button-download { background: var(--yellow); border-color: #d7ad34; }
.button-download:hover { background: var(--yellow-hover); }
.results-heading .button { min-height: 39px; }
.reward-note { margin-bottom: 10px; }

main.wrap { padding-bottom: clamp(30px, 5vw, 56px); }
.site-footer { border-top: 1px solid var(--line); background: #f0f0e6; }
.footer-inner { min-height: 72px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 15px; padding-block: 12px; color: var(--muted); font-size: 12px; }
.footer-inner .brand { color: var(--ink); font-size: 19px; }
.footer-inner .brand-mark { width: 29px; height: 29px; border-radius: 7px; }
.footer-inner .brand-mark .icon { width: 17px; height: 17px; }

@media (max-width: 900px) {
  .wrap { width: calc(100% - 44px); }
  .hero h1 { font-size: clamp(43px, 7.2vw, 66px); }
  .hero-art { margin-right: 0; }
  .tab { gap: 5px; font-size: 12px; }
  .tab .icon { width: 16px; height: 16px; }
}

@media (max-width: 675px) {
  .wrap { width: calc(100% - 32px); }
  .header-inner { min-height: 58px; }
  .hero { min-height: 0; padding-block: 30px 26px; }
  .hero h1 { font-size: clamp(38px, 8.9vw, 58px); }
  .hero-description { margin-top: 13px; }
  .hero-art { display: none; }
  .tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 7px; gap: 3px; }
  .tab { min-height: 37px; padding: 4px 3px; }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .dropzone { min-height: 184px; padding-block: 17px; }
  .upload-icon { width: 37px; height: 37px; margin-bottom: 8px; }
  .upload-icon .icon { width: 18px; height: 18px; }
  .tool-footer { gap: 7px 13px; }
  .tool-footer span { font-size: 11px; }
  .tool-footer .icon { width: 13px; height: 13px; }
}

@media (max-width: 382px) {
  .tab .icon { display: none; }
  .file-row > .icon { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
