*{box-sizing:border-box}html,body{height:100%}body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;background:#0B0F14;color:#E8EEF4}
.topbar{display:flex;align-items:center;gap:10px;justify-content:flex-start;padding:14px 18px;background:#0e131a;border-bottom:1px solid #141c26}
.topbar h1{margin:0;font-size:1.2rem;white-space:nowrap}
.pro-tag{background:#1d4ed8;padding:2px 6px;border-radius:6px;margin-left:6px}
.badges{display:flex;gap:6px;margin-left:12px}
.badge{font-size:.75rem;background:#223047;color:#bcd0e5;border:1px solid #2d3a4d;border-radius:6px;padding:2px 6px}
.theme{display:flex;align-items:center;gap:6px;margin-left:auto}
.lang{display:flex;align-items:center;gap:6px}
.container{max-width:980px;margin:20px auto;padding:0 14px}
.panel{background:#0e131a;border:1px solid #131a23;border-radius:12px;padding:16px;margin-bottom:16px;box-shadow:0 6px 24px rgba(0,0,0,.2)}
h2{margin-top:0;font-size:1.05rem}
.grid{display:grid;gap:10px}
.grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}
label{display:flex;align-items:center;gap:8px}
input[type=text],input[type=number],select,textarea{width:100%;padding:10px;border-radius:8px;border:1px solid #2a3545;background:#0b1017;color:#E8EEF4}
textarea{min-height:96px}
.actions{display:flex;gap:10px;flex-wrap:wrap;margin:8px 0}
button{border:none;padding:10px 14px;border-radius:10px;background:#1d4ed8;color:#fff;cursor:pointer}
button.secondary{background:#334155}
button.ghost{background:#223047;color:#bcd0e5}
button:hover{filter:brightness(1.05)}
#out,#ppOut{font-family:ui-monospace,Menlo,Consolas,monospace;letter-spacing:.4px;font-size:1.05rem}
.out-wrap{display:flex;gap:8px;align-items:center;width:100%}
.output-row label{min-width:90px}
.meter{height:10px;background:#0b1017;border:1px solid #223047;border-radius:10px;margin-top:8px}
.meter-bar{height:100%;width:0%;background:linear-gradient(90deg,#8b1d1d,#927c16,#2f5d3a);border-radius:10px;transition:width .3s}
.hint{color:#9fb3c8;margin-top:6px}
.diag{background:#0b1017;border:1px solid #223047;padding:10px;border-radius:8px;color:#cfe3ff;white-space:pre-wrap}
.timer{margin-left:6px;min-width:120px;display:inline-block;color:#9fb3c8}
.foot{padding:14px 18px;color:#9fb3c8;border-top:1px solid #141c26;text-align:center}
.explain{margin-top:8px;padding:10px;border:1px solid #223047;border-radius:8px;background:#0b1017;color:#cfe3ff}
.explain strong{color:#9fe3a0}
kbd{background:#1f2937;border:1px solid #374151;border-radius:4px;padding:0 4px}
.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);background:#111827;color:#e5e7eb;border:1px solid #374151;padding:10px 14px;border-radius:10px;box-shadow:0 10px 30px rgba(0,0,0,.3);opacity:0;pointer-events:none;transition:opacity .2s,transform .2s}
.toast.show{opacity:1;transform:translateX(-50%) translateY(-6px)}
:focus{outline:2px solid #1d4ed8;outline-offset:2px}
.btn-update{margin-left:8px}
@media (max-width:720px){.grid-2{grid-template-columns:1fr}.topbar{flex-wrap:wrap}.theme{margin-left:0}}
:root[data-theme="light"] body{background:#f8fafc;color:#0f172a}
:root[data-theme="light"] .panel{background:#ffffff;border-color:#e2e8f0;color:#0f172a}
:root[data-theme="light"] .topbar{background:#ffffff;border-bottom-color:#e2e8f0}
:root[data-theme="light"] input[type=text],:root[data-theme="light"] input[type=number],:root[data-theme="light"] select,:root[data-theme="light"] textarea{background:#ffffff;border-color:#cbd5e1;color:#0f172a}
:root[data-theme="light"] .diag{background:#f8fafc;border-color:#cbd5e1;color:#0f172a}
.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.intro{margin-bottom:10px}
.panel-intro{color:#9fb3c8;margin:4px 0 10px;font-size:.9rem}
.tabs{display:flex;gap:6px;margin:6px 0 14px;border-bottom:1px solid #131a23}
.tab{background:none;border:none;padding:8px 12px;border-radius:999px;cursor:pointer;font-size:.9rem;color:#9fb3c8}
.tab.active{background:#1d4ed8;color:#fff}
.tab-panel{display:none}
.tab-panel.active{display:block}
.panel-help{margin-top:8px}
