:root {
  --ink: #17211d;
  --muted: #627068;
  --paper: #f6f3ed;
  --card: #fffdf8;
  --line: #d9ddd6;
  --green: #1f6b4f;
  --green-dark: #174c3a;
  --mint: #d8efe3;
  --coral: #f26f52;
  --danger: #a83232;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 12% 4%, #fff9eb 0, transparent 28rem), var(--paper); }
button, input, select { font: inherit; }
button, label.primary { -webkit-tap-highlight-color: transparent; }
.topbar { height: 64px; max-width: 1180px; margin: auto; padding: 0 26px; display: flex; align-items: center; justify-content: space-between; }
.working-name { color: var(--ink); text-decoration: none; font-weight: 760; letter-spacing: -.02em; }
.working-name span { margin-left: 8px; color: var(--muted); font-weight: 500; font-size: 12px; }
.language, .secondary, .icon-button, .text-button { border: 0; background: transparent; color: var(--green-dark); font-weight: 700; cursor: pointer; }
.language { border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px; background: rgba(255,255,255,.55); }
.shell { width: min(1120px, calc(100% - 40px)); margin: 42px auto 80px; }
.hero { max-width: 860px; }
.eyebrow, .section-kicker { color: var(--green); font-weight: 800; letter-spacing: .14em; font-size: 12px; margin: 0 0 12px; }
h1 { margin: 0; max-width: 850px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(42px, 6vw, 76px); line-height: .98; letter-spacing: -.04em; font-weight: 700; }
.lede { max-width: 720px; margin: 22px 0 0; font-size: clamp(18px, 2vw, 22px); line-height: 1.55; color: var(--muted); }
.steps { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-top: 1px solid var(--line); }
.steps li > span { flex: 0 0 28px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--mint); color: var(--green-dark); font-weight: 800; }
.steps strong, .steps small { display: block; }
.steps small { color: var(--muted); margin-top: 5px; line-height: 1.4; }
.upload-panel { margin-top: 54px; border: 1px solid var(--line); background: rgba(255,253,248,.88); border-radius: 24px; padding: 28px; display: flex; justify-content: space-between; align-items: center; gap: 24px; box-shadow: 0 22px 60px rgba(36,52,45,.08); }
.upload-panel h2, .workspace h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.025em; }
.upload-panel p:not(.section-kicker) { margin: 9px 0 0; color: var(--muted); }
.upload-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.primary { display: inline-flex; justify-content: center; align-items: center; border: 0; padding: 14px 20px; min-height: 50px; border-radius: 13px; background: var(--coral); color: #fff; font-weight: 800; cursor: pointer; box-shadow: 0 5px 0 #b84c36; }
.primary:hover { filter: brightness(.98); transform: translateY(1px); box-shadow: 0 4px 0 #b84c36; }
.primary:disabled { cursor: wait; opacity: .6; box-shadow: none; }
.secondary { padding: 12px 6px; text-decoration: underline; text-underline-offset: 4px; }
.workspace { margin-top: 48px; }
.workspace-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 20px; }
.file-facts { color: var(--muted); margin: 9px 0 0; overflow-wrap: anywhere; }
.file-nav { display: grid; grid-template-columns: 42px minmax(190px, 300px) 42px; gap: 8px; align-items: center; }
.file-nav select, .icon-button { height: 42px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); }
.icon-button:disabled { opacity: .35; cursor: default; }
.ratio-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.ratio-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; min-width: 0; }
.ratio-heading { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 12px; }
.ratio-heading h3 { margin: 0; font-size: 18px; }
.crop-size { color: var(--muted); font-size: 13px; }
.ratio-card canvas { width: 100%; height: auto; display: block; background: #e9ece8; border-radius: 11px; }
.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.controls label { min-width: 0; }
.controls label span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; margin-bottom: 7px; }
input[type="range"] { width: 100%; accent-color: var(--green); }
.quality { margin: 11px 0 0; min-height: 21px; color: var(--green-dark); font-size: 14px; font-weight: 700; }
.download-panel { margin-top: 22px; display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 24px; border-radius: 18px; background: var(--green-dark); color: white; }
.download-panel p { color: #c9dfd5; margin: 7px 0 0; max-width: 690px; line-height: 1.5; }
.download-panel .primary { flex: 0 0 auto; }
.progress { margin-top: 16px; background: #e5e9e5; border-radius: 999px; overflow: hidden; position: relative; height: 42px; }
.progress span { display: block; height: 100%; width: 0; background: var(--mint); transition: width .2s ease; }
.progress p { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; font-weight: 750; color: var(--green-dark); }
.message { margin: 16px 0 0; border-radius: 12px; padding: 12px 14px; background: var(--mint); color: var(--green-dark); }
.message.error { background: #fee9e6; color: var(--danger); }
.text-button { margin-top: 18px; padding: 4px 0; text-decoration: underline; text-underline-offset: 4px; }
.print-guide { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line); max-width: 820px; }
.print-guide h2 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(26px, 4vw, 34px); margin: 0 0 24px; }
.print-guide dt { font-weight: 800; margin-top: 22px; }
.print-guide dd { margin: 8px 0 0; color: var(--muted); line-height: 1.7; overflow-wrap: anywhere; }
footer { padding: 0 20px 34px; color: var(--muted); text-align: center; font-size: 13px; }
[hidden] { display: none !important; }
@media (max-width: 760px) {
  .topbar { padding: 0 16px; }
  .working-name span { display: none; }
  .shell { width: min(100% - 28px, 600px); margin-top: 24px; }
  h1 { font-size: clamp(38px, 12vw, 58px); }
  .steps { grid-template-columns: 1fr; gap: 0; margin-top: 26px; }
  .upload-panel, .workspace-head, .download-panel { align-items: stretch; flex-direction: column; }
  .upload-actions { justify-content: stretch; flex-direction: column; align-items: stretch; }
  .upload-actions .primary { width: 100%; }
  .ratio-grid { grid-template-columns: 1fr; }
  .file-nav { grid-template-columns: 42px minmax(0, 1fr) 42px; width: 100%; }
  .download-panel .primary { width: 100%; }
}
@media (max-width: 420px) {
  .language { padding: 8px 10px; }
  .upload-panel { padding: 20px; }
  .controls { grid-template-columns: 1fr; gap: 8px; }
}
