:root{
  --bg:#f7f4ee;
  --surface:#ffffff;
  --ink:#1b1a17;
  --muted:#79766c;
  --line:#ded9cb;
  --line-strong:#b9b3a0;
  --red:#d64526;
  --red-press:#b93a1f;
  --radius:16px;
  --radius-sm:10px;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font:16px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
}
main{max-width:640px;margin:0 auto;padding:0 24px}
header{
  display:flex;align-items:center;justify-content:space-between;
  padding:32px 0 0;
}
.brand span{font-size:20px;font-weight:800;letter-spacing:-.02em}
header .hint{font-size:13px;color:var(--muted)}

h1{font-size:44px;line-height:1.05;letter-spacing:-.03em;margin:64px 0 10px;font-weight:800}
p.lead{color:var(--muted);margin:0 0 40px;font-size:17px;max-width:44ch}

.drop{
  position:relative;
  border:1.5px dashed var(--line-strong);
  border-radius:var(--radius);
  min-height:280px;
  display:grid;place-items:center;text-align:center;
  background:var(--surface);
  transition:border-color .15s, background .15s, transform .1s;
  cursor:pointer;
}
.drop.over{border-color:var(--ink);background:#fdfdfc;transform:scale(1.003)}
.drop .inside{padding:36px 24px}
.drop .mascot{width:64px;height:64px;margin:0 auto 14px;display:block}
.drop strong{font-size:17px;font-weight:700;display:block;margin-bottom:6px}
.drop .sub{color:var(--muted);font-size:14px;margin-bottom:20px}
input[type=file]{display:none}

button{
  border:0;background:var(--ink);color:#fff;border-radius:999px;
  padding:12px 22px;font-weight:650;font-size:15px;cursor:pointer;
  font-family:inherit;
}
button:active{transform:translateY(1px)}
button.ghost{background:transparent;color:var(--ink);border:1.5px solid var(--line-strong);padding:10.5px 20px}
button.link{background:none;color:var(--muted);padding:6px 4px;font-weight:600;text-decoration:underline;text-underline-offset:3px}
button.red{background:var(--red)}
button.red:hover{background:var(--red-press)}
button:disabled{opacity:.45;cursor:default}

.privacy-line{
  display:flex;align-items:center;gap:8px;margin:-16px 0 34px;color:var(--muted);font-size:13.5px;
}
.privacy-line .local-link{
  background:none;border:0;color:var(--muted);text-decoration:underline;text-underline-offset:3px;
  font:inherit;padding:0;cursor:pointer;
}
.privacy-line .local-link:hover{color:var(--ink)}

footer{margin:60px 0 40px;color:#a6a293;font-size:12.5px;text-align:center}
footer a{color:inherit}

/* overlay + sheet */
.overlay{
  position:fixed;inset:0;background:rgba(27,26,23,.32);
  display:flex;align-items:flex-end;justify-content:center;
  opacity:0;pointer-events:none;transition:opacity .18s;
  z-index:10;
}
.overlay.show{opacity:1;pointer-events:auto}
@media (min-width:640px){
  .overlay{align-items:center}
}
.sheet{
  background:var(--surface);
  width:100%;max-width:480px;
  border-radius:20px 20px 0 0;
  padding:28px 26px 30px;
  transform:translateY(24px);
  transition:transform .2s cubic-bezier(.2,.8,.2,1);
  max-height:88vh;overflow:auto;
}
@media (min-width:640px){
  .sheet{border-radius:20px;margin-bottom:0}
}
.overlay.show .sheet{transform:translateY(0)}

.sheet-top{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:18px}
.filepill{
  display:flex;align-items:center;gap:10px;background:var(--bg);
  border:1px solid var(--line);border-radius:999px;padding:6px 14px 6px 8px;
  font-size:13.5px;font-weight:600;max-width:78%;
}
.filepill .dot{width:26px;height:26px;border-radius:50%;background:var(--ink);color:#fff;
  display:grid;place-items:center;font-size:11px;font-weight:800;flex:none}
.filepill .name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.close{background:none;border:none;color:var(--muted);font-size:20px;padding:4px 6px;cursor:pointer;line-height:1}

h2{font-size:22px;margin:6px 0 20px;letter-spacing:-.02em}

.choices{display:flex;flex-direction:column;gap:10px}
.choice{
  display:flex;align-items:center;gap:14px;text-align:left;
  border:1.5px solid var(--line);border-radius:var(--radius-sm);
  padding:16px 16px;background:var(--surface);cursor:pointer;
  transition:border-color .12s, background .12s;
}
.choice:hover{border-color:var(--ink)}
.choice .icon{width:38px;height:38px;flex:none;border-radius:10px;background:var(--bg);display:grid;place-items:center;font-size:18px}
.choice .txt strong{display:block;font-size:15.5px;margin-bottom:2px}
.choice .txt span{color:var(--muted);font-size:13.5px}

.notice{
  background:var(--bg);border:1px solid var(--line);border-radius:var(--radius-sm);
  padding:16px;margin-bottom:18px;font-size:14.5px;color:var(--ink);
}
.notice.warn{border-color:#e3b98f;background:#fbf1e6}
.notice p{margin:0 0 8px;color:var(--muted)}
.notice p:last-child{margin-bottom:0}
.notice .row{display:flex;gap:10px;margin-top:12px;flex-wrap:wrap}

.field-row{display:flex;justify-content:space-between;align-items:baseline;margin:2px 0 16px}
.field-row .cur{color:var(--muted);font-size:13.5px}
.field-row .cur b{color:var(--ink)}

.size-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:16px}
.size-btn{
  border:1.5px solid var(--line);border-radius:10px;padding:12px 8px;text-align:center;
  background:var(--surface);cursor:pointer;font-weight:700;font-size:14.5px;
}
.size-btn small{display:block;color:var(--muted);font-weight:500;font-size:12px;margin-top:2px}
.size-btn.active{border-color:var(--ink);background:var(--bg)}

.custom-size{display:flex;align-items:center;gap:8px;margin-bottom:22px}
.custom-size input{
  flex:1;border:1.5px solid var(--line);border-radius:10px;padding:10px 12px;font-size:15px;font-family:inherit;
}
.custom-size span{color:var(--muted);font-size:14px}

.fmt-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:22px}
.fmt-btn{
  border:1.5px solid var(--line);border-radius:10px;padding:14px 8px;text-align:center;
  background:var(--surface);cursor:pointer;font-weight:700;font-size:14.5px;
}
.fmt-btn.active{border-color:var(--ink);background:var(--bg)}
.fmt-btn:disabled{opacity:.35;cursor:default}

.status{display:flex;align-items:center;gap:14px;padding:8px 0 22px}
.status .mascot{width:46px;height:46px;flex:none}
.status strong{display:block;font-size:15.5px}
.status span{color:var(--muted);font-size:13.5px}
.spin{
  width:16px;height:16px;border-radius:50%;border:2px solid var(--line);
  border-top-color:var(--ink);animation:spin 0.8s linear infinite;flex:none;
}
@keyframes spin{to{transform:rotate(360deg)}}

.preview-box{
  border:1px solid var(--line);border-radius:var(--radius-sm);overflow:hidden;background:var(--bg);
  margin-bottom:16px;
}
.preview-box img{display:block;width:100%;max-height:280px;object-fit:contain;background:#efece3}
.preview-meta{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;font-size:13.5px}
.preview-meta .before{color:var(--muted)}
.preview-meta .after{font-weight:700}
.preview-meta .after.good{color:#3f7d4a}

.actions{display:flex;gap:10px;margin-top:4px}
.actions button{flex:1}

.queue{margin-top:26px;border-top:1px solid var(--line);padding-top:16px}
.qrow{display:flex;justify-content:space-between;font-size:13.5px;padding:6px 0;color:var(--muted)}
.qrow b{color:var(--ink);font-weight:600}
.qrow .st{font-weight:600}
.qrow .st.done{color:#3f7d4a}

.credit{position:fixed;bottom:14px;right:16px;font-size:11.5px;color:#b7b2a1;text-decoration:none}
.source-link{
  position:fixed;bottom:14px;left:16px;font-size:11.5px;color:#b7b2a1;text-decoration:none;
}
.source-link:hover{color:var(--muted);text-decoration:underline;text-underline-offset:2px}

@media (prefers-reduced-motion: reduce){
  .drop, .overlay, .sheet, button, .spin{transition:none;animation:none}
}
