:root {
  --ink: #213b32; --muted: #58685f; --paper: #fafbf7; --surface: #f0f4ec;
  --line: #d4ddcf; --green: #315940; --accent: #e2edb8; --error: #a82e27;
  font-family: "Avenir Next", Avenir, "Segoe UI", "Noto Sans", sans-serif;
  color: var(--ink); background: var(--paper); font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; border-top: 4px solid var(--green); }
a { color: inherit; }
button, input { font: inherit; }
button, .primary { cursor: pointer; touch-action: manipulation; }
button, .primary, summary { -webkit-tap-highlight-color: transparent; }
button { background: transparent; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); padding: 10px 16px; min-height: 44px; }
button:hover { background: var(--surface); border-color: #9fad97; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 3px solid #457549; outline-offset: 4px; }
.primary { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 13px 26px; background: var(--green); color: #fafbf7; border: 1px solid var(--green); border-radius: 5px; font-weight: 650; text-decoration: none; text-align: center; line-height: 1.35; }
.primary:hover { background: #24432f; border-color: #24432f; }
header, main, footer { width: min(100% - 48px, 880px); margin-inline: auto; }
header { display: flex; align-items: center; justify-content: space-between; min-height: 88px; border-bottom: 1px solid var(--line); gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 1.55rem; font-weight: 750; letter-spacing: -.065em; }
.brand svg { width: 26px; height: 26px; fill: none; stroke: var(--green); stroke-width: 2.5; stroke-linejoin: round; }
.language { position: relative; font-size: .88rem; }
.language summary { cursor: pointer; display: flex; align-items: center; gap: 12px; min-height: 44px; list-style: none; }
.language summary::-webkit-details-marker { display: none; }
.language nav { position: absolute; right: 0; top: 46px; z-index: 2; width: 160px; padding: 5px; background: var(--paper); border: 1px solid var(--line); border-radius: 5px; }
.language a { display: flex; align-items: center; min-height: 44px; padding: 9px 12px; text-decoration: none; }
.language a:hover, .language a[aria-current] { background: var(--surface); }
.intro { text-align: center; padding-top: clamp(40px, 7vw, 66px); }
h1 { margin: 0; font-size: clamp(2rem, 5.7vw, 3.65rem); font-weight: 650; line-height: 1.16; letter-spacing: -.055em; text-wrap: balance; overflow-wrap: anywhere; }
:lang(ko) h1, :lang(ja) h1 { letter-spacing: -.045em; word-break: keep-all; overflow-wrap: anywhere; }
.subtitle { color: var(--muted); font-size: 1.06rem; margin: 16px 0 36px; line-height: 1.6; text-wrap: balance; }
.drop-zone { border: 1.5px dashed #9eae96; background: var(--surface); border-radius: 9px; padding: 32px 20px 27px; text-align: center; transition: background .18s ease-out; }
.drop-zone.dragging { background: var(--accent); border-color: var(--green); }
.drop-zone > svg { width: 54px; height: 54px; stroke: #647e55; stroke-width: 2; fill: none; }
.drop-zone h2 { margin: 12px 0 20px; font-size: 1.17rem; font-weight: 550; line-height: 1.45; }
.formats { font-size: .81rem; color: var(--muted); margin: 18px 0 0; line-height: 1.6; }
.privacy { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: .82rem; margin: 21px 0 0; line-height: 1.5; }
.privacy svg { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.file-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding: 0 0 16px; margin-bottom: 24px; }
#filename { font-weight: 600; margin: 0; overflow-wrap: anywhere; flex: 1 1 180px; min-width: 0; }
.file-actions { display: flex; gap: 4px 12px; flex-wrap: wrap; }
.file-actions button { border: 0; text-decoration: underline; text-underline-offset: 3px; font-size: .83rem; padding: 5px 0; }
.file-actions button:hover { background: transparent; color: #133f20; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
figure { margin: 0; min-width: 0; }
.preview { background: #e9ede5; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 5px; height: 240px; overflow: hidden; }
.preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
figcaption { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; padding: 12px 0; font-size: .9rem; }
figcaption strong { font-weight: 650; font-variant-numeric: tabular-nums; }
figcaption small { grid-column: 1 / -1; color: var(--muted); font-size: .8rem; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.target-label { font-weight: 650; display: block; font-size: .95rem; margin-bottom: 10px; }
.target-input { display: flex; align-items: center; border: 1px solid #8a9b81; border-radius: 5px; overflow: hidden; background: var(--paper); }
.target-input:focus-within { outline: 3px solid #457549; outline-offset: 3px; }
.target-input input { width: 100%; min-width: 0; font-size: 1.8rem; font-weight: 550; padding: 10px 14px; border: 0; outline: none; color: var(--ink); background: transparent; }
.target-input span { padding-right: 16px; color: var(--muted); }
.hint { font-size: .78rem; color: var(--muted); line-height: 1.6; margin: 9px 0 0; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 17px 0 23px; }
.presets button { padding: 8px 13px; font-size: .83rem; min-height: 40px; }
.presets button[aria-pressed=true] { border-color: var(--green); background: #e5eed9; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .84rem; line-height: 1.6; cursor: pointer; padding-block: 8px; }
.check input { flex: 0 0 17px; width: 17px; height: 17px; margin: 3px 0 0; accent-color: var(--green); }
.output-note { font-size: .78rem; line-height: 1.6; color: var(--muted); margin: 9px 0 18px; }
#compress { width: 100%; }
#error { color: var(--error); background: #fff0e9; border: 1px solid #e6bdb0; padding: 14px 18px; border-radius: 5px; line-height: 1.6; margin: 20px 0; }
.status-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: .87rem; }
#status { line-height: 1.55; }
#status:empty { margin: 0; }
#result { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; margin-top: 24px; padding-top: 30px; border-top: 1px solid var(--line); }
.result-details { min-width: 0; }
.savings { display: inline-block; background: var(--accent); padding: 5px 10px; font-size: .84rem; font-weight: 650; margin: 0 0 14px; }
.savings:empty { display: none; }
.result-details h2 { font-size: 1.4rem; line-height: 1.35; margin: 0 0 9px; letter-spacing: -.03em; }
#result-message { margin: 0 0 18px; color: var(--muted); line-height: 1.6; font-size: .88rem; }
.notice { color: #75451f; background: #f8efda; padding: 12px 14px; border-radius: 4px; font-size: .83rem; line-height: 1.6; }
#download { width: 100%; margin-top: 4px; }
.help { border-top: 1px solid var(--line); margin: 56px auto 0; padding: 30px 0 40px; }
.help h2 { font-size: 1.25rem; font-weight: 600; letter-spacing: -.025em; margin: 0 0 12px; }
.help > p { color: var(--muted); line-height: 1.7; font-size: .9rem; max-width: 620px; margin: 0 0 24px; }
.help details { border-top: 1px solid var(--line); padding: 0; font-size: .87rem; }
.help summary { cursor: pointer; min-height: 50px; padding: 16px 0; font-weight: 550; }
.help details p { line-height: 1.7; color: var(--muted); margin: 0 0 20px; max-width: 680px; }
footer { border-top: 1px solid var(--line); font-size: .76rem; padding: 22px 0 32px; color: var(--muted); line-height: 1.6; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 16px; top: -100px; background: var(--ink); color: var(--paper); padding: 12px; z-index: 5; }
.skip:focus { top: 8px; }
@media (max-width: 600px) {
  header, main, footer { width: calc(100% - 32px); }
  header { min-height: 72px; }
  .intro { padding-top: 38px; }
  .subtitle { font-size: .96rem; margin: 13px 0 29px; }
  .drop-zone { padding: 28px 16px 25px; }
  .workspace, #result { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .original .preview { height: 180px; }
  .file-heading { gap: 0; }
  .file-actions { width: 100%; margin-top: 5px; }
  .help { margin-top: 40px; }
  .help h2 { font-size: 1.17rem; }
  .result-details { padding-bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

.guide { border-top: 1px solid var(--line); padding: 30px 0 48px; line-height: 1.75; font-size: .92rem; }
.guide h2 { font-size: 1.3rem; line-height: 1.4; margin: 30px 0 12px; }
.guide h2:first-child { margin-top: 0; }
.guide h3 { font-size: 1.02rem; line-height: 1.5; margin-top: 24px; }
.guide p, .guide li { max-width: 720px; color: var(--muted); }
.guide li { margin-block: 10px; padding-left: 4px; }
.guide ol, .guide ul { padding-left: 23px; }
.example-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(190px,100%),1fr)); gap: 16px; }
.example { border: 1px solid var(--line); padding: 16px; border-radius: 5px; min-width: 0; }
.example h3 { margin-top: 0; }
.document { padding: 36px 0 56px; line-height: 1.8; overflow-wrap: anywhere; }
.document h1 { margin: 24px 0; font-size: clamp(2rem,5vw,3rem); }
.document h2 { font-size: 1.3rem; margin: 30px 0 12px; line-height: 1.5; }
.document p { max-width: 720px; color: var(--muted); }
.support-email { font-weight: 600; overflow-wrap: anywhere; }
footer nav { display: flex; flex-wrap: wrap; gap: 4px 22px; }
footer nav a { display: inline-flex; align-items: center; min-height: 44px; }
@media (max-width: 360px) { .brand { font-size: 1.35rem; gap: 7px; } header { gap: 10px; } }
