:root{color-scheme:light;--bg:#f3f6f5;--panel:#fff;--ink:#152925;--muted:#536963;--line:#dce6e1;--soft:#e9f3ee;--accent:#175645;--deep:#123e33;--alert:#982c29;font-family:"Inter","PingFang SC","Microsoft YaHei",system-ui,sans-serif;font-size:16px;color:var(--ink);background:var(--bg)}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0}
button,input,select{font:inherit}
button,select,label[for]{cursor:pointer}
button{color:inherit}
button:disabled{opacity:.47;cursor:default}
button:focus-visible,select:focus-visible,input:focus-visible,.picker:has(+input:focus-visible){outline:3px solid #4b967e;outline-offset:3px}
h1,h2,p{margin:0}
h1{font-size:clamp(2rem,5vw,3.15rem);font-weight:720;letter-spacing:-.055em;line-height:1.08}
h2{font-size:1.04rem;font-weight:720;line-height:1.35}
svg{width:20px;height:20px;stroke-width:1.65}
.brand{display:flex;align-items:center;gap:10px;font-size:1.13rem;font-weight:750;letter-spacing:-.035em}
.brand-mark{display:block;width:31px;height:31px;border-radius:9px;background:var(--deep);position:relative}
.brand-mark:before{content:"";position:absolute;inset:7px;border:1.5px solid #b9efda;border-radius:4px}
.brand-mark:after{content:"";position:absolute;top:15px;left:5px;right:5px;border-top:1.5px solid #d6f9e9}
.top{background:#fff;border-bottom:1px solid var(--line)}
.top-inner{max-width:1100px;margin:auto;min-height:64px;padding:0 24px;display:flex;align-items:center;justify-content:space-between}
.workspace{max-width:1100px;margin:auto;padding:36px 24px 48px}
.intro{margin:10px 0 28px;display:grid;gap:10px}
.muted{color:var(--muted);font-size:.94rem;line-height:1.6}
.layout{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(285px,1fr);gap:16px;align-items:start}
.panel{background:var(--panel);border:1px solid var(--line);border-radius:17px;padding:17px;min-width:0}
.source-panel{grid-column:1/-1}
.source-panel h2,.settings-panel h2{margin-bottom:12px}
.panel-top{display:flex;justify-content:space-between;align-items:center;min-height:33px;gap:10px;margin-bottom:12px}
.picker{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:13px;border:1px dashed #aebfb7;border-radius:12px;background:#fafcfb;padding:12px;min-height:67px}
.picker:hover{background:var(--soft)}
.picker.drag-over{background:#dcefe6;border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent)}
.picker strong,.picker small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.picker strong{font-size:.95rem}
.picker small{color:var(--muted);font-size:.73rem;margin-top:4px}
.tile-icon{display:grid;place-items:center;background:var(--soft);border-radius:9px;width:41px;height:41px;color:var(--accent)}
.arrow{color:#617b70;width:16px}
.stage{display:grid;place-items:center;min-height:280px;min-width:0;padding:14px;background:#e9efec radial-gradient(#b5c7be75 1px,transparent 1px) 0 0/16px 16px;border-radius:12px;overflow:hidden}
.empty{display:grid;justify-items:center;gap:9px;color:var(--muted);font-size:.8rem}
.empty strong{color:var(--ink);font-size:.98rem}
.paper-icon{display:grid;place-items:center;width:62px;height:70px;border-radius:12px;background:#fff;border:1px solid #d4e2db;margin-bottom:5px;box-shadow:3px 4px 0 #d2e1da}
.paper-icon svg{width:30px;height:30px;color:#39725f}
.paper{position:relative;display:grid;place-items:center;max-width:100%;box-shadow:0 4px 14px #153d2820;background:white}
canvas{display:block;max-width:100%;max-height:58vh;height:auto;width:auto;object-fit:contain}
.switch,.pager{display:flex;align-items:center;justify-content:center;gap:7px}
.pager{margin-top:10px;gap:14px;font-size:.85rem;color:var(--muted)}
.switch button,.icon-button,.quiet,.secondary{border:1px solid var(--line);border-radius:9px;background:#fff;padding:7px 11px;font-size:.84rem;min-height:37px}
.switch button[aria-pressed=true]{background:var(--soft);font-weight:700;color:var(--deep)}
.icon-button{display:grid;place-items:center;min-width:41px}
.quiet{color:var(--accent);background:transparent}
#retry{margin-top:9px}
.effect,.options,.downloads{display:grid;gap:10px;margin-top:14px}
.effect{grid-template-columns:1fr minmax(105px,auto);align-items:center;border-top:1px solid var(--line);padding-top:14px}
.options label,.downloads label{display:grid;grid-template-columns:1fr minmax(105px,auto);align-items:center;gap:10px}
.effect label,.options label,.downloads label{font-size:.83rem;font-weight:650}
.options button,.downloads .quiet{justify-self:start}
select,input[type=password],input[type=text]{min-height:42px;border:1px solid #c8d7cf;border-radius:9px;background:#fff;color:var(--ink);padding:7px 10px;min-width:0}
input[type=range]{accent-color:var(--accent);width:105px;min-height:38px}
.primary,.secondary{display:flex;align-items:center;justify-content:center;gap:8px;min-height:46px;padding:9px 15px;border-radius:10px;font-weight:680}
.primary{background:var(--accent);border:1px solid var(--accent);color:#fff}
.primary:hover:not(:disabled){background:var(--deep)}
.generate{width:100%;margin-top:16px}
.downloads{border-top:1px solid var(--line);padding-top:13px}
.secondary{color:var(--accent)}
.status,.error{margin-top:11px;font-size:.82rem;line-height:1.55;color:var(--muted)}
.error{color:var(--alert);background:#fff3f1;padding:8px 10px;border-radius:8px}
.mark{position:absolute;border:1.5px dashed #2a8066}
.move{position:absolute;inset:0;display:block;border:0;background:transparent;padding:0;width:100%;height:100%;touch-action:none;cursor:move}
.move img{display:block;width:100%;height:100%;pointer-events:none}
.resize{position:absolute;width:25px;height:25px;border-radius:50%;border:2px solid #fff;background:#267058;bottom:-12px;right:-12px;touch-action:none;cursor:nwse-resize}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.login-body{min-height:100dvh;display:grid;place-items:center;padding:20px}
.login{width:min(100%,420px);padding:28px;background:#fff;border:1px solid var(--line);border-radius:20px;box-shadow:0 11px 38px #173b2710}
.login .brand{margin-bottom:35px}
.login h1{font-size:2.2rem;margin-bottom:10px}
.login form{display:grid;gap:16px;margin-top:22px}
.login label{display:grid;gap:7px;font-weight:650;font-size:.88rem}
#pairing-action{margin-top:16px}
#pairing-link{text-decoration:none}
@media(max-width:730px){.top-inner{padding:0 16px;min-height:56px}.workspace{padding:21px 12px 34px}.intro{margin:4px 4px 18px}.layout{grid-template-columns:minmax(0,1fr);gap:11px}.source-panel{grid-column:auto}.panel{padding:13px}.stage{min-height:190px;padding:13px}canvas{max-height:47vh}.preview-panel:has(#paper[hidden]) .stage{min-height:160px}}

/* The raised keypad belongs only to the bound-phone PIN screen. */
.pin-login-body {
  display: block;
  min-height: 100svh;
  padding: 0;
  background: #e9eeea;
  color: #16302a;
  -webkit-tap-highlight-color: transparent;
}
.pin-login-body .login {
  display: grid;
  align-content: center;
  width: min(100%, 430px);
  min-height: 100svh;
  margin-inline: auto;
  padding: 30px 22px 68px;
  border: 0;
  border-radius: 0;
  background: #f6f8f5;
  box-shadow: none;
}
.pin-login-body .brand {
  margin: 0 5px 38px;
  color: #234940;
  font-size: 19px;
}
.pin-login-body .brand-mark {
  width: 34px;
  height: 34px;
  background: #164c40;
  box-shadow: inset 0 1px 0 #449081, 0 2px 0 #0f382f;
}
.pin-login-body .brand-mark::after { top: 16px; }
.pin-login-body .login h1 {
  margin: 0 5px;
  font-size: clamp(32px, 9vw, 39px);
  font-weight: 760;
  line-height: 1.18;
  letter-spacing: -.045em;
}
.pin-login-body .login .muted { margin: 10px 5px 0; color: #49635a; font-size: 15px; line-height: 1.5; }
.pin-entry { display: grid; justify-items: center; gap: 13px; margin-block: 25px 11px; }
.pin-progress { display: grid; grid-template-columns: repeat(4, 48px); gap: 9px; }
.pin-slot {
  display: grid;
  place-items: center;
  height: 48px;
  border: 1px solid #cbd8d0;
  border-radius: 11px;
  background: #e9efe9;
  box-shadow: inset 0 2px 3px #233e3020, 0 1px 0 #fff;
}
.pin-slot::after {
  content: "";
  width: 10px;
  height: 10px;
  box-sizing: content-box;
  border: 1.5px solid #879f93;
  border-radius: 50%;
  transition: background-color 120ms, transform 120ms;
}
.pin-slot.active { border-color: #78a195; }
.pin-slot.filled::after { background: #1b5b4e; border-color: #1b5b4e; transform: scale(1.18); }
.pin-entry[data-state="error"] .pin-slot.filled::after { background: #9d3832; border-color: #9d3832; }
.pin-entry[data-state="error"] .pin-slot { border-color: #d4a6a0; }
.pin-status { min-height: 20px; margin: 0; color: #49635a; font-size: 13px; font-weight: 650; line-height: 20px; text-align: center; }
.pin-entry[data-state="error"] .pin-status { color: #9b3731; }
.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 10px;
  padding: 12px 12px 17px;
  border: 1px solid #ccd9d1;
  border-radius: 22px;
  background: #dce8df;
  box-shadow: inset 0 1px 0 #f9fcf8, 0 3px 0 #c5d6ca;
}
.pin-key {
  min-height: clamp(54px, 9vh, 70px);
  padding: 0;
  border: 1px solid #b9ccc1;
  border-radius: 13px;
  background: linear-gradient(180deg, #f9fcf8 0%, #ecf3ee 75%, #e6efe8 100%);
  box-shadow: inset 0 1px 0 #fff, 0 4px 0 #8eab9a, 0 6px 7px #1e493628;
  font-size: 31px;
  font-weight: 670;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  touch-action: manipulation;
  transition: transform 90ms ease, box-shadow 90ms ease;
}
.pin-key.pin-utility { background: linear-gradient(180deg, #e6f0e8, #d4e4da); color: #305c4c; font-size: 15px; font-weight: 680; }
.pin-key.pin-backspace { font-size: 27px; }
.pin-key:active, .pin-key.pressed {
  transform: translateY(3px);
  box-shadow: inset 0 1px 3px #27533e20, 0 1px 0 #8eab9a, 0 2px 3px #1e49361f;
}
.pin-key:focus-visible { outline: 3px solid #1f6555; outline-offset: 3px; }
.pin-key:disabled { opacity: 1; cursor: default; }
@media (min-width: 600px) {
  .pin-login-body .login {
    min-height: min(760px, calc(100svh - 48px));
    margin-block: 24px;
    border: 1px solid #d1ddd5;
    border-radius: 30px;
    box-shadow: 0 14px 40px #133c2918;
  }
}
@media (max-height: 700px) {
  .pin-login-body .login { padding-block: 18px 24px; }
  .pin-login-body .brand { margin-bottom: 25px; }
  .pin-entry { margin-top: 18px; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .pin-slot::after, .pin-key { transition: none; }
}
