:root {
  --background: #ffffff;
  --surface: #ffffff;
  --surface-soft: #fafafa;
  --surface-warm: #fff8f3;
  --text: #24211f;
  --muted: #6e6964;
  --line: #e8e3df;
  --line-strong: #d8d1cb;
  --primary: #e76622;
  --primary-dark: #c94e11;
  --primary-soft: #fff0e7;
  --success: #247a4b;
  --success-soft: #edf8f1;
  --danger: #b93832;
  --danger-soft: #fff0ef;
  --shadow-sm: 0 1px 2px rgba(37, 28, 22, .05);
  --shadow-md: 0 12px 35px rgba(45, 31, 22, .08);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --max: 1180px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, select, input[type="range"] { cursor: pointer; }
button:disabled, select:disabled, input:disabled { cursor: not-allowed; }
a { color: inherit; }
img { max-width: 100%; }

.container {
  width: min(calc(100% - 40px), var(--max));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: #fff;
  transform: translateY(-160%);
  transition: transform .2s ease;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid rgba(232, 227, 223, .85);
  backdrop-filter: blur(14px);
}
.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 11px;
  background: var(--primary-soft);
  color: var(--primary);
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.2; }
.brand-copy strong { font-size: 17px; letter-spacing: -.02em; }
.brand-copy small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #4d4945;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}
.privacy-badge span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #32a765;
  box-shadow: 0 0 0 4px rgba(50, 167, 101, .12);
}

.hero {
  padding-block: 88px 72px;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr);
  align-items: center;
  gap: 74px;
}
.hero-copy { max-width: 800px; }
.pill {
  display: inline-flex;
  margin: 0 0 20px;
  padding: 8px 13px;
  border: 1px solid #ffd5bc;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(44px, 6vw, 72px);
  line-height: 1.04;
  letter-spacing: -.055em;
}
.hero h1 span { color: var(--primary); }
.hero-lead {
  max-width: 680px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.7;
}
.feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  margin-top: 30px;
}
.feature-row span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}
.feature-row b {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  font-size: 12px;
}
.hero-trust {
  display: flex;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
  box-shadow: var(--shadow-sm);
}
.trust-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 14px;
  background: var(--success-soft);
  color: var(--success);
}
.hero-trust strong { display: block; margin: 1px 0 8px; font-size: 16px; }
.hero-trust p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }

.tool-section {
  padding-block: 72px 90px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fbfaf9;
}
.section-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 28px;
}
.section-intro.compact { align-items: flex-start; }
.section-intro > p {
  max-width: 450px;
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}
.section-kicker {
  margin: 0 0 7px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.section-intro h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.1;
  letter-spacing: -.04em;
}

.upload-stack { display: grid; gap: 18px; }
.drop-zone {
  position: relative;
  min-height: 270px;
  padding: 44px 24px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  border: 2px dashed #d8d1cb;
  border-radius: var(--radius-lg);
  background: #fff;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease;
}
.drop-zone:hover, .drop-zone:focus-within {
  border-color: var(--primary);
  background: #fffaf7;
  box-shadow: 0 0 0 4px rgba(231, 102, 34, .08);
}
.drop-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-2px);
}
.drop-zone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}
.upload-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin-bottom: 17px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  transition: transform .2s ease, background .2s ease;
}
.drop-zone:hover .upload-icon, .drop-zone.dragover .upload-icon { transform: translateY(-2px); background: #ffe3d2; }
.drop-zone h3 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.drop-zone p { margin: 7px 0 0; color: var(--muted); font-size: 14px; }
.drop-zone small { margin-top: 14px; color: #8b857f; font-size: 12px; }

.settings-card {
  display: grid;
  grid-template-columns: 1.05fr 1fr 1fr .85fr;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.setting-group, .saving-card { min-width: 0; padding: 22px; }
.setting-group { border-right: 1px solid var(--line); }
.setting-title {
  display: block;
  margin-bottom: 11px;
  color: #393532;
  font-size: 13px;
  font-weight: 800;
}
.split-label { display: flex; justify-content: space-between; gap: 12px; }
.split-label output { color: var(--primary-dark); }
.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 4px;
  border-radius: 10px;
  background: #f3f1ef;
}
.segment {
  min-height: 40px;
  padding: 7px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #69635e;
  font-size: 13px;
  font-weight: 800;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.segment:hover:not(:disabled) { color: var(--text); }
.segment.active {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: 0 1px 5px rgba(38, 28, 21, .12);
}
.segment:disabled { opacity: .45; }
input[type="range"] {
  width: 100%;
  margin: 8px 0 9px;
  accent-color: var(--primary);
}
select {
  width: 100%;
  min-height: 44px;
  padding: 9px 36px 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
}
.control-help {
  min-height: 34px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.saving-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(145deg, #f4fbf6, #edf8f1);
}
.saving-card > span {
  color: #4d6d59;
  font-size: 12px;
  font-weight: 800;
}
.saving-card strong {
  margin-top: 6px;
  color: var(--success);
  font-size: 25px;
  letter-spacing: -.035em;
}
.saving-card p { margin: 5px 0 0; color: #688071; font-size: 11px; }
.saving-card.is-larger { background: linear-gradient(145deg, #fff6f5, #fff0ef); }
.saving-card.is-larger > span, .saving-card.is-larger p { color: #8a514d; }

.batch-bar {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 150px 190px 190px minmax(280px, 1fr);
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.batch-bar > div:not(.batch-actions) {
  padding: 17px 19px;
  border-right: 1px solid var(--line);
}
.batch-bar span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .045em;
}
.batch-bar strong { display: block; margin-top: 5px; font-size: 18px; }
.batch-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px;
}
.button, .icon-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 800;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.button:hover:not(:disabled), .icon-button:hover:not(:disabled) { transform: translateY(-1px); }
.button.primary, .icon-button.download {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 5px 14px rgba(231, 102, 34, .2);
}
.button.primary:hover:not(:disabled), .icon-button.download:hover:not(:disabled) { background: var(--primary-dark); }
.button.secondary, .icon-button:not(.download) {
  border-color: var(--line-strong);
  background: #fff;
  color: #4e4945;
}
.button.secondary:hover:not(:disabled), .icon-button:not(.download):hover:not(:disabled) { border-color: #aaa19a; background: #faf9f8; }
.button.danger { background: var(--danger-soft); color: var(--danger); border-color: #f0c7c4; }
.button:disabled, .icon-button:disabled { opacity: .48; box-shadow: none; transform: none; }

.status {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}
.status.success { border-left-color: var(--success); background: var(--success-soft); color: #285e3e; }
.status.error { border-left-color: var(--danger); background: var(--danger-soft); color: #8a2c27; }

.results-header {
  margin-top: 42px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}
.results-header h3 { margin: 0; font-size: 21px; letter-spacing: -.025em; }
.results-header p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.empty-state {
  min-height: 190px;
  margin-top: 16px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
}
.empty-state[hidden] { display: none; }
.empty-state > span { color: #c0b8b1; }
.empty-state strong { margin-top: 12px; font-size: 15px; }
.empty-state p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.results {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.result-card {
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.result-card:hover { transform: translateY(-2px); border-color: #ddd2ca; box-shadow: var(--shadow-md); }
.preview {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background-color: #f2f2f2;
  background-image: linear-gradient(45deg, #e4e4e4 25%, transparent 25%), linear-gradient(-45deg, #e4e4e4 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e4e4e4 75%), linear-gradient(-45deg, transparent 75%, #e4e4e4 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.preview img { width: 100%; height: 100%; object-fit: contain; }
.result-copy { min-width: 0; padding: 17px 17px 12px; }
.result-copy h3 {
  margin: 0 0 11px;
  overflow: hidden;
  color: #312e2b;
  font-size: 14px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.result-meta {
  display: grid;
  gap: 7px;
  padding: 12px;
  border-radius: 9px;
  background: #f7f6f5;
  color: #5f5954;
  font-size: 12px;
}
.result-meta span:not(:first-child) { padding-top: 7px; border-top: 1px solid #e8e3df; }
.result-badge {
  display: inline-flex;
  margin-top: 11px;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 11px;
  font-weight: 800;
}
.result-badge.larger { background: var(--danger-soft); color: var(--danger); }
.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
  padding: 0 17px 17px;
}
.icon-button { width: 100%; }
.progress-card {
  grid-column: 1 / -1;
  padding: 18px;
  border: 1px solid #ffd2b8;
  border-radius: var(--radius);
  background: var(--primary-soft);
}
.progress-card progress { width: 100%; height: 8px; accent-color: var(--primary); }
.progress-card div { display: flex; justify-content: space-between; gap: 20px; margin-top: 8px; color: #79513a; font-size: 12px; }
.progress-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.info-section { padding-block: 84px 100px; }
.info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.info-grid article {
  min-height: 220px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.info-grid article > span { color: var(--primary); font-size: 12px; font-weight: 800; }
.info-grid h3 { margin: 62px 0 10px; font-size: 17px; letter-spacing: -.02em; }
.info-grid p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }

footer { border-top: 1px solid var(--line); background: #f8f7f6; }
.footer-inner {
  min-height: 136px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}
footer strong { font-size: 16px; }
footer p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.footer-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; color: var(--muted); font-size: 11px; }

:focus-visible {
  outline: 3px solid rgba(231, 102, 34, .28);
  outline-offset: 3px;
}

@media (max-width: 1040px) {
  .hero { grid-template-columns: 1fr; gap: 34px; }
  .hero-trust { max-width: 620px; }
  .settings-card { grid-template-columns: repeat(2, 1fr); }
  .setting-group:nth-child(2) { border-right: 0; }
  .setting-group:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .saving-card { border-left: 0; }
  .batch-bar { grid-template-columns: repeat(3, 1fr); }
  .batch-actions { grid-column: 1 / -1; border-top: 1px solid var(--line); }
  .results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .container { width: min(calc(100% - 28px), var(--max)); }
  .header-inner { min-height: 68px; }
  .brand-copy small, .privacy-badge { display: none; }
  .brand-icon { width: 38px; height: 38px; }
  .hero { padding-block: 60px 54px; }
  .hero h1 { font-size: clamp(40px, 12vw, 56px); }
  .feature-row { gap: 14px 22px; }
  .tool-section { padding-block: 56px 68px; }
  .section-intro { align-items: flex-start; flex-direction: column; gap: 12px; }
  .drop-zone { min-height: 240px; padding-inline: 18px; }
  .settings-card { grid-template-columns: 1fr; }
  .setting-group { border-right: 0; border-bottom: 1px solid var(--line); }
  .setting-group:nth-child(2) { border-right: 0; }
  .setting-group:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .batch-bar { grid-template-columns: 1fr 1fr; }
  .batch-bar > div:not(.batch-actions) { border-bottom: 1px solid var(--line); }
  .batch-bar > div:nth-child(2) { border-right: 0; }
  .batch-bar > div:nth-child(3) { grid-column: 1 / -1; border-right: 0; }
  .batch-actions { flex-wrap: wrap; }
  .batch-actions .button { flex: 1 1 130px; }
  .results { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .info-grid article { min-height: auto; }
  .info-grid h3 { margin-top: 36px; }
  .footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; padding-block: 32px; }
  .footer-meta { align-items: flex-start; }
}

@media (max-width: 390px) {
  .container { width: calc(100% - 22px); }
  .hero h1 { font-size: 39px; }
  .hero-trust { padding: 18px; }
  .trust-icon { width: 44px; height: 44px; }
  .batch-bar { grid-template-columns: 1fr; }
  .batch-bar > div:not(.batch-actions) { border-right: 0; }
  .batch-bar > div:nth-child(3) { grid-column: auto; }
  .result-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media (max-width: 340px) {
  .hero h1 { font-size: 35px; letter-spacing: -.05em; }
}

/* V9 accessibility contrast hardening */
.pill,
.section-kicker { color: #a73f0d; }
.feature-row > span { color: #b84c12; }
#dropHelp { color: #6d6762; }
.info-grid article > span { color: #b84c12; }
