*{box-sizing:border-box}
html,body{margin:0;height:100%;font:15px/1.45 system-ui,-apple-system,Segoe UI,Roboto,sans-serif;color:#1f2937;background:#f3f4f6;-webkit-tap-highlight-color:transparent;overscroll-behavior:none}
button,input,select,textarea{font:inherit;color:inherit}
button{background:#fff;border:1px solid #d1d5db;border-radius:8px;padding:6px 10px;cursor:pointer;min-height:36px}
button:disabled{opacity:.4}button.pri{background:#2563eb;border-color:#2563eb;color:#fff}button.danger{color:#b91c1c;border-color:#fca5a5}button.pri.danger{background:#dc2626;color:#fff;border-color:#dc2626}
input,select,textarea{border:1px solid #d1d5db;border-radius:8px;padding:8px 10px;background:#fff;width:100%}
input[type=checkbox],input[type=radio]{width:auto}
label{display:block;margin:10px 0}label.chk{display:flex;gap:8px;align-items:center}
#app{height:100%;display:flex;flex-direction:column}
.top{display:flex;align-items:center;gap:6px;padding:6px 10px;padding-top:max(6px,env(safe-area-inset-top));background:#1f2937;color:#fff}
.top button{background:transparent;color:#fff;border-color:#4b5563;min-width:36px}.top button:disabled{opacity:.35}
.top .ttl,.top .logo{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:40vw}.sp{flex:1}
.pn{padding:6px 8px}
.sync{font-size:18px;padding:0 6px}.sync.synced{color:#4ade80}.sync.syncing{color:#fbbf24}.sync.offline,.sync.idle{color:#9ca3af}.sync.error,.sync.auth{color:#f87171}
.auth{max-width:380px;margin:8vh auto;padding:20px}.auth input{margin:6px 0}.auth .row{margin-top:10px}
.row{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0;align-items:center}.row.end{justify-content:flex-end}.row input{flex:1;min-width:120px;width:auto}
.err{color:#b91c1c}.hint{color:#6b7280;font-size:13px}.empty{color:#6b7280;text-align:center;margin:40px 0}.langs{text-align:center;margin-top:20px;color:#6b7280}
.lib,.page{padding:12px;overflow:auto;flex:1;width:100%;max-width:1000px;margin:0 auto}.page.wide{max-width:1200px}
.crumbs{margin-bottom:8px;color:#6b7280}.crumbs a{color:#2563eb;text-decoration:none}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:12px;margin-top:8px}
.card{position:relative;background:#fff;border-radius:12px;padding:10px;text-decoration:none;color:inherit;box-shadow:0 1px 3px rgba(0,0,0,.12);display:block}
.card .ico{height:84px;border-radius:8px;background:#e5e7eb;display:flex;align-items:center;justify-content:center;font-size:38px}
.card .nm{margin-top:6px;font-weight:600;word-break:break-word;font-size:14px}
.dots{position:absolute;top:6px;right:6px;border-radius:50%;min-height:30px;width:30px;padding:0;background:rgba(255,255,255,.85)}
.hit{display:block;background:#fff;border-radius:8px;padding:8px 10px;margin:6px 0;text-decoration:none;color:inherit}
.overlay{position:fixed;inset:0;background:rgba(0,0,0,.45);display:flex;align-items:flex-end;justify-content:center;z-index:50}
@media(min-width:600px){.overlay{align-items:center}}
.dlg{background:#fff;border-radius:14px 14px 0 0;padding:16px;width:100%;max-width:440px;max-height:85vh;overflow:auto}
@media(min-width:600px){.dlg{border-radius:14px}}
.dlg h3{margin:0 0 10px}.sheet button{display:block;width:100%;text-align:left;margin:4px 0;padding:10px}
.cov input{display:none}.cov span{display:inline-block;width:34px;height:34px;border-radius:8px;margin:4px;border:3px solid transparent}.cov input:checked+span{border-color:#111}
.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:max(20px,env(safe-area-inset-bottom));background:#111827;color:#fff;padding:10px 16px;border-radius:10px;z-index:99;max-width:90vw}
.badge{background:#dbeafe;color:#1d4ed8;border-radius:6px;padding:1px 6px;font-size:12px}.badge.off{background:#fee2e2;color:#b91c1c}
/* editor */
.ed{display:flex;flex-direction:column;height:100%}
.tools{background:#fff;border-bottom:1px solid #e5e7eb;padding:4px 8px}
.tl{display:flex;justify-content:safe center;gap:4px;align-items:center;overflow-x:auto;scrollbar-width:none;padding:2px 0}.tl::-webkit-scrollbar{display:none}
.tl button{flex:none;min-width:38px;padding:4px 6px;font-size:18px}.pen.on,.tl button.on{background:#dbeafe;border-color:#2563eb}
.cols{display:flex;gap:4px;align-items:center;flex:none}.col{width:26px!important;min-width:26px!important;height:26px;min-height:26px!important;border-radius:50%!important;padding:0!important;border:2px solid #d1d5db!important}.col.on{border-color:#111!important;transform:scale(1.15)}
#cpick{width:30px;height:30px;padding:0;border:none;background:none;flex:none}
.sz{display:flex;align-items:center;gap:4px;flex:none;margin:0}.sz input{width:90px;padding:0}.sz span{width:24px;font-size:12px}
.work{flex:1;display:flex;min-height:0}
.scroller{flex:1;overflow:auto;background:#9ca3af;padding:8px;-webkit-overflow-scrolling:touch}
.stage{position:relative;margin:0 auto;background:#fff;box-shadow:0 2px 8px rgba(0,0,0,.35);transform-origin:0 0}
.stage canvas{position:absolute;left:0;top:0;display:block}.c-hl{mix-blend-mode:multiply}.c-live{touch-action:none;cursor:crosshair}
.aip{width:340px;max-width:92vw;background:#fff;border-left:1px solid #e5e7eb;padding:10px;overflow:auto}
@media(max-width:700px){.aip{position:fixed;right:0;top:0;bottom:0;z-index:30;box-shadow:-4px 0 12px rgba(0,0,0,.3)}}
.aih{display:flex;justify-content:space-between;align-items:center}.aip h4{margin:12px 0 4px}
.chat{max-height:34vh;overflow:auto;border:1px solid #e5e7eb;border-radius:8px;padding:6px;margin-bottom:6px;min-height:40px}
.msg{padding:6px 8px;border-radius:8px;margin:4px 0;font-size:14px}.msg.user{background:#dbeafe;margin-left:20px}.msg.assistant{background:#f3f4f6;margin-right:20px}
/* admin */
.tabs{display:flex;gap:6px;padding:8px 12px 0;max-width:1200px;margin:0 auto;width:100%}.tabs button.on{background:#2563eb;color:#fff;border-color:#2563eb}
.stats{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:8px}
.stat{background:#fff;border-radius:10px;padding:10px;box-shadow:0 1px 2px rgba(0,0,0,.1)}.stat b{display:block;font-size:20px}.stat span{color:#6b7280;font-size:12px}
.charts{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:12px;margin-top:10px}.charts>div{background:#fff;border-radius:10px;padding:8px 10px}.charts h4{margin:0 0 6px;font-size:13px}
.bars{display:flex;align-items:flex-end;gap:3px;height:90px}.bar{flex:1;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center}.bar i{display:block;width:100%;min-height:2px;border-radius:3px 3px 0 0}.bar small{font-size:9px;color:#6b7280}
.tw{overflow:auto;background:#fff;border-radius:10px;margin:6px 0}table{border-collapse:collapse;width:100%;font-size:13px}th,td{padding:6px 8px;text-align:left;border-bottom:1px solid #eee;white-space:nowrap}th{background:#f9fafb}
.urow{display:flex;justify-content:space-between;align-items:center;background:#fff;border-radius:10px;padding:8px 12px;margin:6px 0}
.form{max-width:520px}
/* extras */
.dark .c-bg{filter:invert(.9) hue-rotate(180deg)}.dark .scroller{background:#374151}
.tray{display:flex;gap:8px;overflow-x:auto;padding:6px 8px;background:#f8fafc;border-bottom:1px solid #e5e7eb;min-height:72px;align-items:stretch}
.tray[hidden]{display:none}.ti{flex:none;display:flex;gap:6px;background:#fff;border:1px solid #e5e7eb;border-radius:8px;padding:4px;max-width:300px}
.ti img{height:60px;max-width:120px;object-fit:contain;border-radius:4px;touch-action:none;cursor:grab;background:#f3f4f6}
.tt{font-size:12px;max-width:140px;overflow:hidden;touch-action:none;cursor:grab;white-space:pre-wrap}.ta{display:flex;flex-direction:column;gap:2px}.ta button{min-height:26px;padding:0 6px;font-size:13px}
.ghost{position:fixed;transform:translate(-50%,-50%);background:#2563ebcc;color:#fff;padding:6px 10px;border-radius:8px;pointer-events:none;z-index:99;font-size:13px;max-width:200px;overflow:hidden;white-space:nowrap}
.dlg.wide{max-width:900px;width:96vw;max-height:92vh}
.pgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:10px;margin-top:8px}.th{text-align:center;cursor:pointer;border:2px solid transparent;border-radius:6px;padding:2px}.th.cur{border-color:#2563eb}
.th canvas{width:100%;height:auto;box-shadow:0 1px 4px rgba(0,0,0,.3);background:#fff}
.stk{display:grid;grid-template-columns:repeat(auto-fill,minmax(46px,1fr));gap:4px}.stk button{font-size:26px;padding:2px;min-height:46px}
.coll{border-bottom:1px solid #eee;padding-bottom:4px}.chip{padding:4px 10px}
#cols .col{flex:none}
.help{max-width:760px}.help .lead{font-size:16px;color:#374151}.help .toc{display:flex;flex-wrap:wrap;gap:6px;margin:12px 0}.help .toc a{background:#fff;border:1px solid #d1d5db;border-radius:16px;padding:4px 10px;font-size:13px;color:#1d4ed8;text-decoration:none}
.help section{background:#fff;border-radius:12px;padding:4px 16px 8px;margin:12px 0;box-shadow:0 1px 3px rgba(0,0,0,.08)}.help h2{font-size:17px;margin:12px 0 6px}.help li{margin:6px 0;line-height:1.45}
.tips{padding-left:20px;line-height:1.6}
.tl.opts,.tl.pens{flex-wrap:wrap;overflow-x:visible}
@media (max-width:640px){.tl button{min-width:34px;padding:3px 4px;font-size:17px}.tl{gap:3px}}
.toast{max-width:90vw;text-align:center}
/* study features */
.qsbox{display:flex;flex-wrap:wrap;gap:10px;margin:4px 0 14px}.qs.big{flex:1 1 150px;min-width:140px;display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:12px 14px;border-radius:14px;background:#fff;border:1px solid #d1d5db;text-align:left}
.qs.big span{font-size:26px}.qs.big b{font-size:16px}.qs.big small{color:#6b7280;font-size:12px}.qs.big.pri{background:#2563eb;color:#fff;border-color:#2563eb}.qs.big.pri small{color:#dbeafe}
.chips{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0}.chips button{border-radius:16px;padding:3px 10px;font-size:13px}.chips button.on{background:#dbeafe;border-color:#2563eb}
.dlg.tall{max-height:82vh;overflow:auto}.tocp{margin:6px 0}.tocp>button{display:block;width:100%;text-align:left}.tocp .th2{border:0;background:none;color:#475569;font-size:13px;padding:2px 16px;width:100%;text-align:left;display:block}.tg{color:#2563eb;font-size:12px}
.cardlist{max-height:46vh;overflow:auto;margin:8px 0}.crow{display:flex;gap:8px;align-items:center;padding:6px 0;border-bottom:1px solid #e5e7eb}.crow>div{flex:1}.crow input{flex:none}
.study{max-width:640px}.fc{background:#fff;border-radius:18px;box-shadow:0 2px 10px rgba(0,0,0,.12);padding:28px 22px;min-height:240px;margin:20px 0;display:flex;flex-direction:column;justify-content:center;font-size:20px;line-height:1.4;text-align:center;cursor:pointer}
.fc .a{color:#15803d}.fc hr{width:100%;border:0;border-top:1px solid #e5e7eb;margin:16px 0}.grades{display:flex;gap:8px}.grades button{flex:1;display:flex;flex-direction:column;align-items:center;padding:10px 4px;font-size:16px}.grades button small{font-size:11px;color:#6b7280}.grades .bad{color:#b91c1c}.grades .wide{padding:16px;font-size:18px}.done{text-align:center;padding:40px 10px}.big{font-size:54px}.cnt{color:#cbd5e1;font-size:14px}
.fs{position:fixed;inset:0;background:#f3f4f6;z-index:60;overflow:auto}.exin{max-width:640px;margin:0 auto;padding:16px;display:flex;flex-direction:column;gap:10px}.exh{display:flex;justify-content:space-between;align-items:center}.exq{font-size:19px;font-weight:600;margin:10px 0}.opt{text-align:left;padding:12px;font-size:16px;background:#fff}.opt.good{background:#dcfce7;border-color:#16a34a}.opt.bad{background:#fee2e2;border-color:#dc2626}.expl{background:#eff6ff;border-radius:8px;padding:8px;font-size:14px}.model{background:#fff;border-radius:10px;padding:10px}
.fprev{background:#fff;border:1px solid #e5e7eb;border-radius:8px;padding:8px;min-height:48px;overflow:auto;margin-bottom:8px}
/* ===== polish (1.2) ===== */
.ic{width:1.15em;height:1.15em;vertical-align:-.2em;flex:none}
.tl button .ic{width:20px;height:20px;vertical-align:middle}.top button .ic{width:20px;height:20px;vertical-align:middle}
button{transition:background .12s,transform .08s,border-color .12s}button:active:not(:disabled){transform:scale(.96)}
.dlg{animation:rise .18s ease-out}.overlay{animation:fade .15s}.toast{animation:fade .2s}
@keyframes rise{from{transform:translateY(24px);opacity:0}to{transform:none;opacity:1}}@keyframes fade{from{opacity:0}to{opacity:1}}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,a:focus-visible{outline:3px solid #60a5fa;outline-offset:2px}
@media (pointer:coarse){button{min-height:42px}.tl button{min-width:42px}.col{width:30px!important;min-width:30px!important;height:30px;min-height:30px!important}}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
.sync{display:inline-flex;align-items:center;gap:6px;font-size:13px;padding:2px 10px;border-radius:16px;min-height:32px}.sync .sl{white-space:nowrap}
.sync.synced{color:#4ade80}.sync.syncing .ic{animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}
@media(max-width:700px){.sync .sl{display:none}.sync{padding:2px 6px}.sync.offline .sl,.sync.error .sl{display:inline;font-size:12px}.top .ttl,.top .logo{max-width:30vw}}
.toast.act{display:flex;gap:12px;align-items:center}.toast.act button{background:transparent;color:#93c5fd;border:0;font-weight:600;min-height:0;padding:2px 6px}
.card .ico.thumb{background-size:cover;background-position:top center;border:1px solid #e5e7eb;font-size:0}
.card.dragover{outline:3px dashed #2563eb;background:#eff6ff}.card[draggable=true]{cursor:grab}
.card:hover{box-shadow:0 3px 10px rgba(0,0,0,.18)}.card{transition:box-shadow .15s}
/* dark theme */
html[data-theme=dark]{color-scheme:dark}
html[data-theme=dark] body,html[data-theme=dark] html{background:#0f172a;color:#e5e7eb}
html[data-theme=dark] body{background:#0f172a;color:#e5e7eb}
html[data-theme=dark] button,html[data-theme=dark] input,html[data-theme=dark] select,html[data-theme=dark] textarea{background:#1e293b;border-color:#334155;color:#e5e7eb}
html[data-theme=dark] button.pri,html[data-theme=dark] .qs.big.pri{background:#2563eb;border-color:#2563eb;color:#fff}
html[data-theme=dark] button.danger{color:#fca5a5;border-color:#7f1d1d}
html[data-theme=dark] .top{background:#0b1220}
html[data-theme=dark] .card,html[data-theme=dark] .dlg,html[data-theme=dark] .hit,html[data-theme=dark] .stat,html[data-theme=dark] .tw,html[data-theme=dark] .urow,html[data-theme=dark] .charts>div,html[data-theme=dark] .tools,html[data-theme=dark] .aip,html[data-theme=dark] .help section,html[data-theme=dark] .fc,html[data-theme=dark] .opt,html[data-theme=dark] .model,html[data-theme=dark] .qs.big,html[data-theme=dark] .help .toc a{background:#1e293b;color:#e5e7eb;border-color:#334155}
html[data-theme=dark] .card .ico{background:#334155}
html[data-theme=dark] .dots{background:rgba(15,23,42,.8)}
html[data-theme=dark] th{background:#0f172a}html[data-theme=dark] td,html[data-theme=dark] th,html[data-theme=dark] .crow{border-color:#334155}
html[data-theme=dark] .hint,html[data-theme=dark] .crumbs,html[data-theme=dark] .empty,html[data-theme=dark] .langs,html[data-theme=dark] .stat span,html[data-theme=dark] .qs.big small,html[data-theme=dark] .grades button small{color:#94a3b8}
html[data-theme=dark] .crumbs a,html[data-theme=dark] .help .toc a{color:#93c5fd}
html[data-theme=dark] .pen.on,html[data-theme=dark] .tl button.on,html[data-theme=dark] .chips button.on{background:#1e3a8a;border-color:#3b82f6}
html[data-theme=dark] .msg.assistant{background:#334155}html[data-theme=dark] .msg.user{background:#1e3a8a}
html[data-theme=dark] .fs{background:#0f172a}html[data-theme=dark] .opt.good{background:#14532d}html[data-theme=dark] .opt.bad{background:#7f1d1d}html[data-theme=dark] .expl{background:#1e3a8a}
html[data-theme=dark] .fprev{background:#f8fafc;color:#111}html[data-theme=dark] .fc .a{color:#4ade80}
html[data-theme=dark] .scroller{background:#0b1220}html[data-theme=dark] .qs.big.pri small{color:#dbeafe}
html[data-theme=dark] .cov input:checked+span{border-color:#fff}
.card .ico.thumb{position:relative}.card .ico .bdg{position:absolute;left:4px;top:4px;width:26px;height:26px;border-radius:7px;display:flex;align-items:center;justify-content:center;font-size:15px;box-shadow:0 1px 3px rgba(0,0,0,.3)}
.crumbs a.dragover{background:#dbeafe;border-radius:6px}
/* writing zoom + shortcuts */
.wzp{display:flex;gap:6px;padding:6px;background:var(--panel,#f1f3f6);border-top:1px solid rgba(0,0,0,.12)}
.wzp[hidden]{display:none}
.wzp canvas{flex:1;height:140px;background:#fff;border-radius:8px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.15);min-width:0}
.wzk{display:flex;flex-direction:column;gap:4px;justify-content:space-between}
.wzk button{min-width:44px;min-height:30px;border-radius:8px;border:1px solid rgba(0,0,0,.15);background:#fff;display:flex;align-items:center;justify-content:center}
.wzbox{position:absolute;border:2px solid #2f6fed;background:rgba(47,111,237,.08);pointer-events:none;border-radius:3px}
#bwz.on{background:#2f6fed;color:#fff}
table.kb td{padding:4px 8px}kbd{background:#eef;border:1px solid #ccd;border-radius:4px;padding:1px 6px;font-size:12px}
html[data-theme=dark] .wzp{background:#1c2230}html[data-theme=dark] .wzk button{background:#2a3244;color:#eee}
table.kb{width:100%;border-collapse:collapse}table.kb td:last-child{white-space:normal}table.kb td:first-child{white-space:nowrap}
/* tour */
.tour{position:fixed;inset:0;z-index:9000}
.tspot{position:fixed;border-radius:12px;box-shadow:0 0 0 9999px rgba(10,15,30,.6);transition:all .25s ease;pointer-events:none;outline:2px solid #60a5fa}
.tcard{position:fixed;background:#fff;color:#1f2937;border-radius:14px;padding:14px 16px;box-shadow:0 10px 30px rgba(0,0,0,.35);transition:top .25s,left .25s}
.tcard b{font-size:16px}.tcard p{margin:6px 0 10px;font-size:14px;line-height:1.4}
.tcard .row{display:flex;align-items:center;gap:8px}.tdots{display:flex;gap:4px}.tdots i{width:6px;height:6px;border-radius:50%;background:#cbd5e1}.tdots i.on{background:#2563eb}
html[data-theme=dark] .tcard{background:#1e2533;color:#e5e7eb}
.sync.pending{color:#60a5fa}
.lg{height:24px;width:auto;vertical-align:middle;margin-right:8px}.lg.big{display:block;height:64px;margin:0 auto 10px}
/* ===== logo, login, settings, install ===== */
.lg{height:22px;width:auto;margin:0 8px 0 0;background:#fff;padding:4px 8px;border-radius:7px;box-sizing:content-box;vertical-align:middle}
.top .logo{display:flex;align-items:center;max-width:none}.top .logo span{font-weight:600;opacity:.9}
.lg.big{display:block;height:44px;margin:0 auto 6px;background:none;padding:0;border-radius:0}
.authwrap{min-height:100%;display:flex;align-items:center;justify-content:center;padding:24px 16px;background:radial-gradient(1200px 500px at 50% -10%,rgba(95,58,138,.16),transparent),#f3f4f6;overflow:auto}
.auth{width:100%;max-width:400px;margin:0;padding:0}
.brand{text-align:center;margin-bottom:18px}.brand h1{margin:0;font-size:15px;font-weight:600;letter-spacing:.18em;text-transform:uppercase;color:#5f3a8a}.brand .tag{margin:8px 0 0;color:#6b7280;font-size:14px}
.acard{background:#fff;border-radius:18px;padding:20px;box-shadow:0 10px 30px rgba(31,41,55,.10),0 1px 3px rgba(31,41,55,.08)}
.seg{display:flex;background:#eef0f4;border-radius:10px;padding:3px;margin-bottom:14px}.seg button{flex:1;border:0;background:transparent;border-radius:8px;min-height:34px;font-weight:600;color:#6b7280}.seg button.on{background:#fff;color:#1f2937;box-shadow:0 1px 3px rgba(0,0,0,.15)}
.fld{margin:10px 0}.fld>span{display:block;font-size:13px;font-weight:600;margin-bottom:4px;color:#374151}
.inp{position:relative;display:flex;align-items:center}.inp>.ic{position:absolute;left:11px;width:18px;height:18px;color:#9ca3af;pointer-events:none}
.inp input{padding:11px 40px 11px 38px;margin:0;border-radius:10px}.inp input:focus{outline:none;border-color:#5f3a8a;box-shadow:0 0 0 3px rgba(95,58,138,.18)}
.inp .eye{position:absolute;right:4px;border:0;background:transparent;min-height:32px;min-width:32px;padding:4px;color:#9ca3af}.inp .eye.on{color:#5f3a8a}.inp .eye .ic{position:static;color:inherit}
button.wide{width:100%;margin-top:6px;min-height:44px;font-weight:600;border-radius:10px;font-size:16px}
.acard .pri{background:#5f3a8a;border-color:#5f3a8a}.acard .pri:hover{background:#4e2f74}
.err{color:#b91c1c;font-size:13px;margin:4px 0;min-height:1em}.note{background:#f3effa;color:#4e2f74;border-radius:10px;padding:10px 12px;font-size:13px;margin:0 0 10px}
.feat{list-style:none;display:flex;justify-content:center;flex-wrap:wrap;gap:6px 16px;padding:0;margin:20px 0 6px;color:#6b7280;font-size:13px}.feat li{display:flex;align-items:center;gap:6px}.feat .ic{width:16px;height:16px;color:#5f3a8a}
.langs{text-align:center;font-size:13px;margin:10px 0 0}.langs a{color:#6b7280;text-decoration:none}.langs a.on{color:#5f3a8a;font-weight:700}
/* install */
.instbtn{display:none;align-items:center;justify-content:center;gap:8px;font-weight:600;border-radius:10px}
html.can-install .instbtn{display:inline-flex}
.instbtn.authinst{width:100%;margin-top:12px;min-height:44px;background:#fff;border:1.5px solid #5f3a8a;color:#5f3a8a}
.instbtn.topinst{background:#fff;color:#1f2937;border-color:#fff;min-height:34px;padding:4px 12px;animation:pulse 2.4s ease-in-out 3}
.top button.instbtn.topinst{background:#fff;color:#4e2f74;border-color:#fff}
.instbtn.cta{background:#5f3a8a;border-color:#5f3a8a;color:#fff;min-height:44px;padding:8px 18px}
@keyframes pulse{0%,100%{box-shadow:0 0 0 0 rgba(255,255,255,.5)}50%{box-shadow:0 0 0 7px rgba(255,255,255,0)}}
@media(max-width:560px){.instbtn.topinst span{display:none}.instbtn.topinst{padding:4px 9px}.top .logo span{display:none}}
.instcard{display:none!important}html.can-install .instcard{display:flex!important}
/* settings */
.page.settings{max-width:720px;padding:16px 12px 40px}
.scard{background:#fff;border-radius:14px;padding:14px 16px;margin:0 0 14px;box-shadow:0 1px 3px rgba(31,41,55,.08),0 0 0 1px rgba(31,41,55,.04)}
.scard>h3{display:flex;align-items:center;gap:8px;margin:0 0 6px;font-size:13px;text-transform:uppercase;letter-spacing:.06em;color:#6b7280}.scard>h3 .ic{width:16px;height:16px;color:#5f3a8a}
.scard.prof{display:flex;align-items:center;gap:14px;flex-wrap:wrap}.avatar{width:52px;height:52px;border-radius:50%;background:#5f3a8a;color:#fff;font-size:22px;font-weight:700;display:flex;align-items:center;justify-content:center;flex:none}
.pinfo{flex:1;min-width:160px}.pinfo small{color:#6b7280}.meter{height:6px;border-radius:3px;background:#e5e7eb;margin:8px 0 4px;overflow:hidden}.meter i{display:block;height:100%;background:#5f3a8a;border-radius:3px}
.scard.instcard{align-items:center;gap:14px;flex-wrap:wrap;background:linear-gradient(135deg,#f3effa,#fff);border:1px solid #d9cdee}.instcard .ico{width:46px;height:46px;border-radius:12px;background:#5f3a8a;color:#fff;display:flex;align-items:center;justify-content:center}.instcard .ico .ic{width:24px;height:24px}.instcard .stxt{flex:1;min-width:180px}
.srow{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 0;border-top:1px solid #eef0f4}.scard>h3+.srow{border-top:0}
.stxt b{display:block;font-weight:600}.stxt small{display:block;color:#6b7280;font-size:12.5px;line-height:1.3}.sctl select{width:auto;min-width:130px}
.btns{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}.btns.center{justify-content:center}.btns button{display:inline-flex;align-items:center;gap:6px}
.scard input[type=password]{margin:6px 0}
.sw{position:relative;display:inline-block;width:46px;height:26px;margin:0;flex:none}.sw input{position:absolute;opacity:0;inset:0;width:100%;height:100%;margin:0;cursor:pointer;z-index:1}
.sw i{position:absolute;inset:0;background:#cbd5e1;border-radius:13px;transition:background .2s}.sw i:after{content:"";position:absolute;left:3px;top:3px;width:20px;height:20px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.3);transition:transform .2s}
.sw input:checked+i{background:#5f3a8a}.sw input:checked+i:after{transform:translateX(20px)}.sw input:focus-visible+i{outline:2px solid #60a5fa;outline-offset:2px}
.ver{text-align:center;color:#9ca3af;font-size:12px;margin:14px 0 0}
/* dark */
html[data-theme=dark] .authwrap{background:radial-gradient(1200px 500px at 50% -10%,rgba(150,110,210,.18),transparent),#0f172a}
html[data-theme=dark] .acard,html[data-theme=dark] .scard{background:#1e293b;box-shadow:0 0 0 1px #334155}
html[data-theme=dark] .seg{background:#0f172a}html[data-theme=dark] .seg button{background:transparent;border:0;color:#94a3b8}html[data-theme=dark] .seg button.on{background:#334155;color:#fff}
html[data-theme=dark] .fld>span,html[data-theme=dark] .brand h1{color:#c4b5fd}html[data-theme=dark] .note{background:#2a2145;color:#ddd6fe}
html[data-theme=dark] .lg.big{background:#fff;padding:8px 14px;border-radius:10px;box-sizing:content-box;margin-bottom:10px}
html[data-theme=dark] .scard.instcard{background:linear-gradient(135deg,#2a2145,#1e293b);border-color:#4c3b7a}
html[data-theme=dark] .srow{border-color:#334155}html[data-theme=dark] .meter{background:#334155}html[data-theme=dark] .sw i{background:#475569}
html[data-theme=dark] .instbtn.authinst{background:transparent;color:#c4b5fd;border-color:#8b6fc9}html[data-theme=dark] .feat .ic,html[data-theme=dark] .scard>h3 .ic{color:#a78bfa}
html[data-theme=dark] .langs a.on{color:#c4b5fd}html[data-theme=dark] .inp input:focus{border-color:#a78bfa}
.instbtn .ic{width:18px;height:18px;flex:none}.instbtn.cta .ic{width:20px;height:20px}
.scard.prof .pri{background:#5f3a8a;border-color:#5f3a8a}
