:root {
  --ink: #172019;
  --muted: #667068;
  --cream: #f4f1e8;
  --paper: #fbfaf5;
  --line: #d9d7ce;
  --acid: #c9f35b;
  --acid-dark: #94bd27;
  --forest: #254732;
  --rust: #b95636;
  --shadow: 0 24px 70px rgba(37, 48, 39, 0.12);
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--cream);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }
button, label, .drop-zone { -webkit-tap-highlight-color: transparent; }

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(2px);
  opacity: .45;
  pointer-events: none;
}

.ambient-one {
  width: 38rem;
  height: 38rem;
  top: -22rem;
  right: -10rem;
  background: radial-gradient(circle, rgba(201, 243, 91, .65), transparent 68%);
}

.ambient-two {
  width: 30rem;
  height: 30rem;
  bottom: 6rem;
  left: -19rem;
  background: radial-gradient(circle, rgba(185, 86, 54, .19), transparent 68%);
}

.shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
  border-bottom: 1px solid rgba(23, 32, 25, .14);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 15px;
  letter-spacing: -.02em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px 8px 8px 2px;
  background: var(--ink);
  color: var(--acid);
  font-family: Georgia, serif;
  font-size: 22px;
  font-style: italic;
}

.brand strong { font-weight: 760; }

.privacy-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.privacy-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #55a26e;
  box-shadow: 0 0 0 4px rgba(85, 162, 110, .14);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 400px);
  align-items: end;
  gap: 60px;
  padding: 82px 0 58px;
}

.eyebrow, .step {
  margin: 0 0 13px;
  color: var(--rust);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
}

.hero h1 {
  grid-column: 1;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(62px, 9vw, 116px);
  font-weight: 400;
  letter-spacing: -.075em;
  line-height: .78;
}

.hero h1 span {
  color: var(--forest);
  font-style: italic;
}

.intro {
  grid-column: 2;
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.workspace {
  padding: clamp(28px, 5vw, 58px);
  border: 1px solid rgba(23, 32, 25, .12);
  border-radius: 4px 4px 28px 4px;
  background: rgba(251, 250, 245, .96);
  box-shadow: var(--shadow);
}

.workspace-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 24px;
}

h2 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 400;
  letter-spacing: -.035em;
}

.engine-status {
  max-width: 360px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: right;
}

.engine-status.ready { color: #3c7650; }
.engine-status.partial { color: #a35f2b; }

.drop-zone {
  display: grid;
  min-height: 250px;
  place-items: center;
  align-content: center;
  padding: 32px;
  border: 1.5px dashed #a8aea7;
  border-radius: 3px 3px 18px 3px;
  background:
    linear-gradient(rgba(251, 250, 245, .75), rgba(251, 250, 245, .75)),
    repeating-linear-gradient(45deg, transparent 0 14px, rgba(37, 71, 50, .035) 14px 15px);
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s;
}

.drop-zone:hover, .drop-zone:focus-visible, .drop-zone.dragging {
  border-color: var(--forest);
  background: rgba(201, 243, 91, .07);
  outline: none;
  transform: translateY(-2px);
}

.upload-icon {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 16px;
  place-items: center;
  border-radius: 50% 50% 50% 12px;
  background: var(--acid);
  color: var(--ink);
  font-size: 27px;
  font-weight: 350;
}

.drop-title {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 25px;
}

.drop-copy {
  margin: 6px 0 19px;
  color: var(--muted);
  font-size: 14px;
}

.drop-copy span {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.drop-limit {
  margin: 0;
  color: #90968f;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
}

.file-card {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 92px;
  padding: 16px 18px;
  border: 1px solid #c7ccc4;
  border-radius: 3px 3px 15px 3px;
  background: #f5f6ee;
}

.file-icon {
  display: grid;
  width: 52px;
  height: 60px;
  place-items: end center;
  padding-bottom: 10px;
  border-radius: 4px 4px 9px 4px;
  background: var(--rust);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
}

.file-meta {
  display: grid;
  min-width: 0;
  gap: 6px;
  flex: 1;
}

.file-meta strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta span { color: var(--muted); font-size: 12px; }

.icon-button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 24px;
}

.icon-button:hover { background: #e6e8df; color: var(--ink); }

.mode-section {
  margin: 42px 0 30px;
  padding: 0;
  border: 0;
}

.mode-section legend { width: 100%; margin-bottom: 18px; padding: 0; }
.legend-title { display: block; font-family: Georgia, serif; font-size: 25px; }

.modes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.mode-card {
  position: relative;
  display: flex;
  min-height: 142px;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 3px 3px 13px 3px;
  background: var(--paper);
  cursor: pointer;
  transition: border-color .16s, background .16s, transform .16s;
}

.mode-card:hover { border-color: #92998f; transform: translateY(-2px); }
.mode-card:has(input:focus-visible) { outline: 2px solid var(--forest); outline-offset: 2px; }
.mode-card:has(input:checked) { border-color: var(--forest); background: #f0f5e9; }
.mode-card input { position: absolute; opacity: 0; pointer-events: none; }

.mode-auto {
  grid-column: span 4;
  min-height: 96px;
  padding-right: 48px;
}

.mode-check {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 18px;
  height: 18px;
  border: 1px solid #a9afa8;
  border-radius: 50%;
}

.mode-card input:checked + .mode-check {
  border: 5px solid var(--forest);
  background: var(--acid);
}

.mode-name {
  margin: 2px 0 11px;
  font-size: 14px;
  font-weight: 760;
}

.mode-name em {
  margin-left: 8px;
  padding: 4px 7px;
  border-radius: 99px;
  background: var(--acid);
  font-size: 9px;
  font-style: normal;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.mode-desc { color: var(--muted); font-size: 12px; line-height: 1.55; }

.target-section {
  margin: 0 0 30px;
  padding: 0;
  border: 0;
}

.target-section legend { width: 100%; margin-bottom: 18px; padding: 0; }

.target-section .legend-title em {
  margin-left: 8px;
  padding: 4px 7px;
  border-radius: 99px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  letter-spacing: .07em;
  text-transform: uppercase;
  vertical-align: middle;
}

.target-row {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 20px;
  align-items: center;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 3px 3px 13px 3px;
  background: var(--paper);
}

.target-label {
  display: block;
  margin-bottom: 9px;
  font-size: 14px;
  font-weight: 760;
}

.target-input {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}

.target-input input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

.target-input input:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 1px;
}

.target-help {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.primary-button, .download-button {
  display: flex;
  width: 100%;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border: 0;
  border-radius: 3px 3px 14px 3px;
  background: var(--ink);
  color: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
  transition: transform .16s, background .16s;
}

.primary-button:hover:not(:disabled), .download-button:hover {
  background: var(--forest);
  transform: translateY(-2px);
}

.primary-button:disabled { cursor: not-allowed; opacity: .38; }

.progress-panel, .result-panel, .error-panel {
  margin-top: 24px;
  padding: 24px;
  border-radius: 3px 3px 16px 3px;
}

.progress-panel { background: #eef0e8; }
.progress-copy { display: flex; justify-content: space-between; gap: 20px; font-size: 13px; }
.progress-copy span { color: var(--muted); font-variant-numeric: tabular-nums; }

.progress-track {
  height: 8px;
  margin: 16px 0 12px;
  overflow: hidden;
  border-radius: 99px;
  background: #d5d9d0;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--forest), var(--acid-dark));
  transition: width .35s ease;
}

.progress-panel p { margin: 0; color: var(--muted); font-size: 11px; }

.result-panel {
  display: flex;
  gap: 22px;
  border: 1px solid #b8c8b8;
  background: #edf4e8;
}

.result-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--forest);
  color: var(--acid);
  font-size: 20px;
}

.result-body { min-width: 0; flex: 1; }
.result-body h3 { margin: 0 0 22px; font-family: Georgia, serif; font-size: 28px; font-weight: 400; }

.result-stats {
  display: grid;
  grid-template-columns: 1fr auto 1fr 1.2fr;
  align-items: center;
  gap: 18px;
  padding: 18px 0;
  border-top: 1px solid #cbd6c8;
  border-bottom: 1px solid #cbd6c8;
}

.result-stats div:not(.stat-arrow) { display: grid; gap: 5px; }
.result-stats span { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.result-stats strong { font-family: Georgia, serif; font-size: 22px; font-weight: 400; }
.result-stats .saving strong { color: #377247; }
.stat-arrow { color: #89928a; }
.result-method { margin: 16px 0; color: var(--muted); font-size: 12px; }

.warning {
  padding: 12px 14px;
  border-left: 3px solid #d89139;
  background: #fff5df;
  color: #81521e;
  font-size: 12px;
  line-height: 1.5;
}

.download-button { margin-top: 18px; background: var(--forest); }
.error-panel { border: 1px solid #e1b9ad; background: #fff0eb; color: #8a3824; font-size: 13px; line-height: 1.55; }
.hidden { display: none !important; }

.trust-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  padding: 50px 12px;
}

.trust-row > div { display: flex; gap: 15px; }
.trust-row > div > span { color: var(--rust); font-family: Georgia, serif; font-style: italic; }
.trust-row p { display: grid; gap: 5px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.trust-row strong { color: var(--ink); font-size: 13px; }

footer {
  display: flex;
  justify-content: space-between;
  padding: 24px 0 38px;
  border-top: 1px solid rgba(23, 32, 25, .14);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

@media (max-width: 760px) {
  .shell { width: min(100% - 24px, 680px); }
  .topbar { min-height: 72px; }
  .privacy-pill { font-size: 0; }
  .privacy-pill::after { content: "Local"; font-size: 10px; }
  .hero { grid-template-columns: 1fr; gap: 28px; padding: 58px 0 40px; }
  .hero h1, .intro { grid-column: 1; }
  .hero h1 { font-size: clamp(58px, 18vw, 86px); }
  .intro { font-size: 15px; }
  .workspace { padding: 24px 18px; }
  .workspace-head { display: block; }
  .engine-status { margin-top: 12px; text-align: left; }
  .drop-zone { min-height: 220px; }
  .modes { grid-template-columns: 1fr 1fr; }
  .mode-auto { grid-column: span 2; }
  .result-stats { grid-template-columns: 1fr 1fr; }
  .stat-arrow { display: none; }
  .trust-row { grid-template-columns: 1fr; padding: 38px 6px; }
}

@media (max-width: 460px) {
  .modes { grid-template-columns: 1fr; }
  .mode-auto { grid-column: auto; min-height: 142px; }
  .target-row { grid-template-columns: 1fr; align-items: start; }
  .result-panel { display: block; }
  .result-mark { margin-bottom: 18px; }
  footer { display: grid; gap: 8px; }
}

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