*{box-sizing:border-box}html,body{margin:0;background:#f4f6f2;color:#111;font:18px/1.35 -apple-system,system-ui,Roboto,sans-serif;-webkit-text-size-adjust:100%}
header{position:sticky;top:0;z-index:5;display:flex;align-items:center;gap:6px;background:#2e7d32;color:#fff;padding:calc(env(safe-area-inset-top) + 6px) 8px 6px;min-height:56px}
#ttl{flex:1;font-weight:700;font-size:19px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hb{background:rgba(255,255,255,.18);color:#fff;border:0;border-radius:10px;font-size:18px;padding:10px 12px;min-height:44px}
#syncb.warn{background:#f9a825;color:#000}#syncb.err{background:#c62828}
main{padding:12px 12px 120px;max-width:720px;margin:0 auto}
.btn{display:block;width:100%;border:0;border-radius:14px;background:#2e7d32;color:#fff;font-size:20px;font-weight:600;padding:16px;margin:8px 0;min-height:58px;text-align:center;text-decoration:none}
.btn.sec{background:#fff;color:#2e7d32;border:2px solid #2e7d32}.btn.red{background:#c62828}.btn.gray{background:#757575}.btn.big{font-size:24px;min-height:72px}
.row{display:flex;gap:8px}.row>*{flex:1}
.card{background:#fff;border-radius:14px;padding:14px;margin:8px 0;box-shadow:0 1px 3px rgba(0,0,0,.12)}
.li{display:flex;align-items:center;gap:10px;background:#fff;border-radius:14px;padding:14px;margin:8px 0;box-shadow:0 1px 3px rgba(0,0,0,.12);min-height:62px}
.li .m{flex:1}.li .s{color:#666;font-size:15px}.num{font-size:26px;font-weight:800;color:#2e7d32;min-width:56px;text-align:center}
label{display:block;font-size:15px;color:#444;margin:10px 0 4px}
input,select,textarea{width:100%;font-size:20px;padding:12px;border:2px solid #bbb;border-radius:12px;background:#fff;min-height:52px}
input:focus,select:focus,textarea:focus{border-color:#2e7d32;outline:0}
.req label::after{content:" *";color:#c62828}.req input.empty{border-color:#c62828;background:#fff3f3}
.chips{display:flex;flex-wrap:wrap;gap:8px}.chip{border:2px solid #2e7d32;background:#fff;color:#2e7d32;border-radius:24px;padding:10px 16px;font-size:18px;min-height:48px}
.chip.on{background:#2e7d32;color:#fff}
.letters{display:grid;grid-template-columns:repeat(auto-fill,minmax(62px,1fr));gap:8px}
.let{background:#fff;border:2px solid #2e7d32;border-radius:12px;font-size:26px;font-weight:700;color:#2e7d32;min-height:62px}
.badge{display:inline-block;background:#f9a825;color:#000;border-radius:8px;padding:1px 7px;font-size:13px;margin-left:4px}
.badge.red{background:#c62828;color:#fff}.badge.g{background:#c8e6c9}
.hidden{display:none!important}
#toast{position:fixed;left:12px;right:12px;bottom:calc(env(safe-area-inset-bottom) + 16px);background:#222;color:#fff;padding:14px;border-radius:12px;z-index:30;text-align:center}
#sheet{position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:20;display:flex;align-items:flex-end}
#sheet .pad{background:#fff;width:100%;border-radius:18px 18px 0 0;padding:12px 12px calc(env(safe-area-inset-bottom) + 12px);max-width:720px;margin:0 auto}
.disp{font-size:34px;font-weight:700;text-align:center;padding:8px;border:2px solid #2e7d32;border-radius:12px;min-height:60px}
.keys{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:8px}.keys button{font-size:28px;min-height:60px;border-radius:12px;border:0;background:#e8f5e9}
.keys .ok{background:#2e7d32;color:#fff}
.quick{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}.quick button{flex:1 0 22%;font-size:20px;min-height:52px;border-radius:10px;border:2px solid #2e7d32;background:#fff}
.nf{background:#fff;border:2px solid #bbb;border-radius:12px;min-height:52px;font-size:22px;padding:12px;width:100%;text-align:left}
.nf.empty{color:#999}.req .nf.empty{border-color:#c62828;background:#fff3f3}
.counter{display:flex;align-items:center;gap:6px}.counter button{width:56px;height:56px;font-size:28px;border-radius:12px;border:0;background:#e8f5e9}.counter .nf{text-align:center}
#planwrap{position:relative;height:65vh;overflow:hidden;background:#ddd;border-radius:12px;touch-action:none}
#planwrap canvas{position:absolute;left:0;top:0}
.thumbs{display:flex;flex-wrap:wrap;gap:6px}.thumbs img{width:88px;height:88px;object-fit:cover;border-radius:8px}
h3{margin:16px 0 4px}.muted{color:#666;font-size:15px}
a.li{text-decoration:none;color:inherit}
.sug{margin:4px 0 8px}.sugrow{width:100%;text-align:left;border:0;margin:4px 0;min-height:58px;font-size:18px}
.grow{display:flex;gap:6px;overflow-x:auto;white-space:nowrap;padding:6px 0 8px;scrollbar-width:none;-webkit-overflow-scrolling:touch}.grow::-webkit-scrollbar{display:none}
.gchip{flex:0 0 auto;border:1.5px solid #2e7d32;background:#fff;color:#2e7d32;border-radius:18px;padding:5px 12px;font-size:15px;min-height:34px}
.gchip.on{background:#2e7d32;color:#fff}
.letters{grid-template-columns:repeat(7,1fr);gap:6px}.let{min-height:46px;font-size:21px;border-radius:10px}
.sst{background:none;border:0;color:#c8e6c9;font-size:13px;padding:4px;white-space:nowrap;max-width:42vw;overflow:hidden;text-overflow:ellipsis}
.sst.warn{color:#ffe082}.sst.err{color:#ffab91}
.th{position:relative}.thdel{position:absolute;right:2px;top:2px;width:38px;height:38px;border:0;border-radius:10px;background:rgba(0,0,0,.6);color:#fff;font-size:18px}
.thl{position:absolute;left:3px;bottom:3px;background:rgba(0,0,0,.6);color:#fff;font-size:12px;border-radius:6px;padding:1px 5px}
#verb{position:fixed;left:6px;bottom:calc(env(safe-area-inset-bottom) + 4px);z-index:25;font-size:11px;color:#333;background:rgba(255,255,255,.6);border-radius:8px;padding:2px 6px;opacity:.7;pointer-events:none}
#verb.new{background:#fb8c00;color:#fff;opacity:1;font-size:13px;padding:5px 9px;pointer-events:auto}
#planwrap,#planwrap canvas{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}
#toast{pointer-events:none}
#planwrap{height:65dvh}
#pv{position:fixed;inset:0;background:#000;z-index:40;display:flex;flex-direction:column;touch-action:none;user-select:none;-webkit-user-select:none}
#pv .pvbar{display:flex;justify-content:space-between;align-items:center;color:#fff;padding:calc(env(safe-area-inset-top) + 6px) 8px 6px;font-size:16px}
#pv .pvbar button{background:rgba(255,255,255,.15);color:#fff;border:0;border-radius:12px;font-size:24px;min-width:52px;min-height:52px;margin-left:8px}
#pvs{flex:1;overflow:hidden;display:flex;align-items:center;justify-content:center}
#pvi{max-width:100%;max-height:100%;transform-origin:center;-webkit-touch-callout:none;pointer-events:none}
#pvc{color:#ddd;text-align:center;padding:6px 8px calc(env(safe-area-inset-bottom) + 8px);font-size:14px}
.th img{cursor:zoom-in}

.pl-list{max-height:7.6em;overflow-y:auto;margin:6px 0;font-size:14px;line-height:1.5em;border:1px solid #eee;border-radius:8px;padding:2px 8px;-webkit-overflow-scrolling:touch}
.pl-r{display:flex;justify-content:space-between;gap:8px}.pl-r span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pl-r b{white-space:nowrap}
#lppop{position:fixed;z-index:30;background:#fff;border-radius:10px;box-shadow:0 4px 16px rgba(0,0,0,.35);padding:8px 10px;max-width:min(90vw,320px);min-width:160px;pointer-events:none}
