:root { --blue:#1d5fd1; --blue2:#e8f0ff; --bg:#f4f6fb; --card:#fff; --text:#15192b; --muted:#6b7185; --ok:#15a36b; --bad:#d6453d; --wait:#e0a100; --r:14px; }
* { box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html,body { margin:0; background:var(--bg); color:var(--text); font:16px/1.4 system-ui,-apple-system,"Segoe UI",Roboto,"Noto Sans Hebrew",Arial,sans-serif; }
#app { max-width:640px; margin:0 auto; min-height:100vh; padding-bottom:calc(90px + env(safe-area-inset-bottom)); }
header.top { position:sticky; top:0; z-index:5; display:flex; align-items:center; justify-content:space-between; padding:calc(10px + env(safe-area-inset-top)) 16px 10px; background:#fff; box-shadow:0 1px 0 #e3e6ef; }
.brand { display:flex; align-items:center; gap:10px; font-weight:700; font-size:20px; cursor:pointer; }
.brand img { width:32px; height:32px; border-radius:8px; }
.lang { font-size:15px; padding:6px 8px; border-radius:10px; border:1px solid #d7dbe6; background:#fff; }
main { padding:16px; display:flex; flex-direction:column; gap:12px; }
h1 { font-size:24px; margin:4px 0; } h2 { font-size:18px; margin:10px 0 0; }
.muted { color:var(--muted); } .small { font-size:13px; } .mono { font-family:ui-monospace,monospace; word-break:break-all; }
.btn { display:flex; align-items:center; justify-content:center; gap:6px; min-height:52px; padding:12px 16px; border:1px solid #d7dbe6; border-radius:var(--r); background:#fff; color:var(--text); font-size:17px; font-weight:600; text-decoration:none; cursor:pointer; }
.btn:active { transform:scale(.98); } .btn:disabled { opacity:.45; }
.btn.primary { background:var(--blue); border-color:var(--blue); color:#fff; }
.btn.huge { min-height:64px; font-size:20px; }
.btn.small { min-height:40px; padding:8px 12px; font-size:15px; }
.btn.ghost { border-color:transparent; background:transparent; }
.btn.wa { background:#25d366; border-color:#25d366; color:#fff; } .btn.tg { background:#29a9eb; border-color:#29a9eb; color:#fff; }
.row { display:flex; align-items:center; justify-content:space-between; gap:12px; } .gap { gap:8px; justify-content:flex-start; flex-wrap:wrap; } .grow { flex:1; }
.card { background:var(--card); border-radius:var(--r); padding:14px; box-shadow:0 1px 3px rgba(20,30,60,.08); display:flex; flex-direction:column; gap:10px; }
.card.ok { background:#e6f7ef; color:#0c6b45; font-weight:600; } .card.bad { background:#fdecea; color:#9b2a23; font-weight:600; }
.credits .big { font-size:26px; font-weight:800; color:var(--blue); }
.title { font-weight:700; font-size:17px; }
.badge { font-size:13px; font-weight:700; padding:4px 10px; border-radius:20px; white-space:nowrap; }
.badge.ok { background:#e6f7ef; color:var(--ok); } .badge.bad { background:#fdecea; color:var(--bad); } .badge.wait { background:#fff5d6; color:#9a6d00; }
.field { display:flex; flex-direction:column; gap:6px; font-size:14px; color:var(--muted); }
.field input, .linkbox { font-size:17px; padding:12px; border:1px solid #d7dbe6; border-radius:12px; background:#fff; color:var(--text); width:100%; }
.check { display:flex; gap:10px; align-items:center; font-size:15px; } .check input { width:22px; height:22px; }
.addbar { display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; } .addbar .btn:first-child { grid-column:1 / -1; min-height:64px; font-size:19px; }
.thumbs { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:10px; }
.thumb { position:relative; background:#fff; border-radius:12px; padding:6px; box-shadow:0 1px 3px rgba(20,30,60,.12); }
.thumb img { width:100%; aspect-ratio:3/4; object-fit:contain; background:#eef0f5; border-radius:8px; display:block; }
.thumb .num { position:absolute; top:10px; inset-inline-start:10px; background:var(--blue); color:#fff; font-weight:700; border-radius:20px; min-width:26px; height:26px; display:grid; place-items:center; font-size:14px; }
.thumb .tools { display:flex; gap:4px; margin-top:6px; } .thumb .tools button { flex:1; height:38px; border:1px solid #d7dbe6; border-radius:8px; background:#fff; font-size:16px; }
.thumb .tools button.on { background:var(--blue2); border-color:var(--blue); }
.empty { border:2px dashed #cfd5e3; border-radius:var(--r); padding:30px 16px; text-align:center; color:var(--muted); }
.footer-bar { position:fixed; bottom:0; left:0; right:0; z-index:4; display:flex; gap:10px; align-items:center; justify-content:space-between; padding:10px 16px calc(10px + env(safe-area-inset-bottom)); background:rgba(255,255,255,.96); box-shadow:0 -1px 0 #e3e6ef; max-width:640px; margin:0 auto; }
.footer-bar .btn { flex:1; }
.stage { position:relative; width:100%; background:#fff; box-shadow:0 1px 4px rgba(20,30,60,.15); border-radius:6px; overflow:hidden; user-select:none; }
.stage > img { width:100%; display:block; }
.pnum { position:absolute; bottom:6px; inset-inline-end:8px; background:rgba(0,0,0,.55); color:#fff; font-size:12px; padding:2px 8px; border-radius:10px; }
.sigfield { position:absolute; border:2px dashed var(--blue); background:rgba(29,95,209,.12); border-radius:6px; display:flex; align-items:center; justify-content:center; font-size:13px; font-weight:700; color:var(--blue); overflow:visible; }
.sigfield span { pointer-events:none; text-align:center; padding:0 4px; }
.sigfield.edit { touch-action:none; cursor:move; }
.sigfield.todo { background:rgba(255,196,0,.28); border-color:#e0a100; color:#8a5a00; animation:pulse 1.6s infinite; cursor:pointer; }
.sigfield.signed { background:transparent; border:1px solid rgba(21,163,107,.5); }
.sigfield.signed img { max-width:100%; max-height:100%; }
@keyframes pulse { 50% { box-shadow:0 0 0 5px rgba(255,196,0,.25); } }
.sigfield .x { position:absolute; top:-12px; inset-inline-end:-12px; width:26px; height:26px; border-radius:50%; border:none; background:var(--bad); color:#fff; font-size:13px; }
.sigfield .handle { position:absolute; right:-10px; bottom:-10px; width:24px; height:24px; border-radius:50%; background:var(--blue); border:3px solid #fff; cursor:nwse-resize; }
.pager { display:flex; align-items:center; justify-content:space-between; }
.minis { display:flex; gap:6px; overflow-x:auto; padding:4px 0; } .minis img { height:64px; border-radius:4px; border:2px solid transparent; } .minis img.sel { border-color:var(--blue); }
.cost { text-align:center; font-weight:700; padding:10px; border-radius:12px; background:#fff5d6; color:#7a5500; } .cost.free { background:#e6f7ef; color:#0c6b45; }
.testmode { background:#fff1c2; color:#6b4b00; border:1px dashed #d6a400; border-radius:12px; padding:10px; font-weight:700; text-align:center; }
.pack { justify-content:space-between; } .pack .price { margin-inline-start:auto; color:var(--blue); font-size:20px; } .pack .big { font-size:24px; font-weight:800; }
.overlay { position:fixed; inset:0; z-index:20; background:rgba(10,15,30,.55); display:flex; align-items:flex-end; }
.sheet { background:#fff; width:100%; max-width:640px; margin:0 auto; border-radius:20px 20px 0 0; padding:16px 16px calc(16px + env(safe-area-inset-bottom)); display:flex; flex-direction:column; gap:10px; }
.padwrap { position:relative; } .pad { width:100%; height:min(42vh,300px); border:1px solid #d7dbe6; border-radius:12px; touch-action:none; background:#fff; display:block; }
.baseline { position:absolute; left:8%; right:8%; bottom:28%; border-bottom:1.5px dashed #c3c8d6; pointer-events:none; }
.toast { position:fixed; left:50%; bottom:100px; transform:translateX(-50%); background:#15192b; color:#fff; padding:12px 18px; border-radius:12px; z-index:50; max-width:90vw; text-align:center; }
.busy { position:fixed; inset:0; z-index:40; background:rgba(255,255,255,.8); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px; font-weight:600; }
.spinner { width:42px; height:42px; border:4px solid var(--blue2); border-top-color:var(--blue); border-radius:50%; animation:spin 1s linear infinite; }
.center { display:flex; flex-direction:column; align-items:center; gap:12px; padding:60px 0; }
@keyframes spin { to { transform:rotate(360deg); } }
ul { margin:0; padding-inline-start:20px; } li { margin:4px 0; }
.powered { display:block; text-align:center; color:var(--muted); font-size:14px; padding:14px 16px 20px; text-decoration:none; }
.powered:active { color:var(--blue); }
.footer-bar { flex-wrap:wrap; } .footer-bar .cost { flex-basis:100%; padding:6px; font-size:15px; }
#app:has(.footer-bar .cost) { padding-bottom:150px; }
.sigfield span { font-size:11px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%; }
