*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root, [data-theme="dark"] {
  --bg:#111318; --bg-deep:#0a0b0f; --bg-card:#16181f; --bg-input:#0e1014;
  --border:#252830; --border-focus:#6c8aff; --text:#e2e6f0; --text-dim:#6e7590;
  --accent:#7b93ff; --accent-glow:rgba(123,147,255,.12); --accent-border:rgba(123,147,255,.18);
  --green:#4ade80; --green-glow:rgba(74,222,128,.1); --green-border:rgba(74,222,128,.18);
  --red:#f87171; --red-glow:rgba(248,113,113,.1); --red-border:rgba(248,113,113,.18);
  --orange:#fb923c; --grid-line:rgba(123,147,255,.025);
  --shadow-sm:rgba(0,0,0,.4); --shadow-accent:rgba(123,147,255,.25); --shadow-green:rgba(74,222,128,.18);
  --decrypt-text:#0f2a1a; --grad-end:#4f5fff; --icon-shadow:rgba(123,147,255,.3);
  --info-border:rgba(40,44,55,.6);
}
[data-theme="light"] {
  --bg:#f0f2f7; --bg-deep:#e5e8f0; --bg-card:#ffffff; --bg-input:#f5f6fa;
  --border:#ccd1e0; --border-focus:#5570e6; --text:#1a1f33; --text-dim:#6b7494;
  --accent:#4a5fd6; --accent-glow:rgba(74,95,214,.1); --accent-border:rgba(74,95,214,.25);
  --green:#16a34a; --green-glow:rgba(22,163,74,.08); --green-border:rgba(22,163,74,.25);
  --red:#dc2626; --red-glow:rgba(220,38,38,.08); --red-border:rgba(220,38,38,.2);
  --orange:#d97706; --grid-line:rgba(74,95,214,.035);
  --shadow-sm:rgba(0,0,0,.06); --shadow-accent:rgba(74,95,214,.2); --shadow-green:rgba(22,163,74,.15);
  --decrypt-text:#fff; --grad-end:#3a4cc0; --icon-shadow:rgba(74,95,214,.25);
  --info-border:rgba(204,209,224,.6);
}

html,body{background:var(--bg-deep);background-color:var(--bg-deep);color:var(--text);font-family:system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;min-height:100vh;overflow-x:hidden;transition:background .4s,color .4s}
html[data-theme="dark"],html[data-theme="dark"] body{background-color:#0a0b0f}
html[data-theme="light"],html[data-theme="light"] body{background-color:#e5e8f0}

body::before{content:'';position:fixed;inset:0;background-image:linear-gradient(var(--grid-line) 1px,transparent 1px),linear-gradient(90deg,var(--grid-line) 1px,transparent 1px);background-size:40px 40px;pointer-events:none;z-index:0}

.mono{font-family:ui-monospace,'SF Mono',SFMono-Regular,Menlo,Consolas,monospace}

.app{position:relative;z-index:1;max-width:720px;margin:0 auto;padding:2rem 1.25rem 4rem}

.top-bar{display:flex;align-items:center;justify-content:center;gap:.5rem;margin-bottom:1.5rem;flex-wrap:wrap}
.switcher{display:flex;align-items:center;gap:2px;background:var(--bg-card);border:1px solid var(--border);border-radius:10px;padding:3px;transition:background .35s,border-color .35s}
.sw-btn{display:flex;align-items:center;justify-content:center;gap:.35rem;padding:.4rem .75rem;border:none;border-radius:8px;background:transparent;color:var(--text-dim);font-size:.7rem;font-weight:500;cursor:pointer;transition:all .25s;white-space:nowrap}
.sw-btn:hover{color:var(--text)}
.sw-btn.active{background:var(--bg);color:var(--text);box-shadow:0 1px 4px var(--shadow-sm)}
.sw-btn svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

.header{text-align:center;margin-bottom:2rem}
.header-icon{display:inline-flex;align-items:center;justify-content:center;width:56px;height:56px;border-radius:16px;background:linear-gradient(135deg,var(--accent),var(--grad-end));margin-bottom:1rem;box-shadow:0 8px 32px var(--icon-shadow);transition:background .35s,box-shadow .35s}
.header-icon svg{width:28px;height:28px;stroke:#fff;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.header h1{font-size:1.5rem;font-weight:600;letter-spacing:-.02em;margin-bottom:.35rem}
.header p{color:var(--text-dim);font-size:.9rem;line-height:1.5;transition:color .35s}
.spec-badge{display:inline-flex;align-items:center;gap:.4rem;margin-top:.75rem;padding:.3rem .75rem;border-radius:999px;background:var(--accent-glow);border:1px solid var(--accent-border);font-size:.7rem;color:var(--accent);letter-spacing:.04em;transition:background .35s,border-color .35s,color .35s}
.spec-badge .dot{width:6px;height:6px;border-radius:50%;background:var(--green);animation:pulse 2s ease-in-out infinite}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.4}}

.tabs{display:flex;background:var(--bg-card);border-radius:12px;padding:4px;margin-bottom:1.75rem;border:1px solid var(--border);transition:background .35s,border-color .35s}
.tab{flex:1;padding:.65rem 1rem;border:none;background:transparent;color:var(--text-dim);font-family:inherit;font-size:.88rem;font-weight:500;border-radius:9px;cursor:pointer;transition:all .25s;display:flex;align-items:center;justify-content:center;gap:.5rem}
.tab.active{background:var(--bg);color:var(--text);box-shadow:0 2px 8px var(--shadow-sm)}
.tab svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

.page{display:none;animation:fadeIn .3s ease}
.page.active{display:block}
@keyframes fadeIn{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}

.field{margin-bottom:1.25rem}
.field label{display:block;font-size:.78rem;font-weight:500;color:var(--text-dim);margin-bottom:.4rem;text-transform:uppercase;letter-spacing:.06em;transition:color .35s}
.pw-wrap{position:relative}
.pw-wrap input{padding-right:3rem}
.toggle-vis{position:absolute;right:.75rem;top:50%;transform:translateY(-50%);background:none;border:none;color:var(--text-dim);cursor:pointer;padding:4px;display:flex;transition:color .2s}
.toggle-vis:hover{color:var(--text)}
.toggle-vis svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
input[type="password"],input[type="text"],textarea{width:100%;padding:.75rem 1rem;background:var(--bg-input);border:1px solid var(--border);border-radius:10px;color:var(--text);font-size:.88rem;transition:border-color .2s,box-shadow .2s,background .35s,color .35s;outline:none}
input:focus,textarea:focus{border-color:var(--border-focus);box-shadow:0 0 0 3px var(--accent-glow)}
textarea{resize:vertical;min-height:130px;line-height:1.6}
.output-area{background:var(--bg-deep);border:1px dashed var(--border)}

.str-bar{height:3px;border-radius:2px;background:var(--border);margin-top:.5rem;overflow:hidden;transition:background .35s}
.str-fill{height:100%;border-radius:2px;transition:width .3s,background .3s;width:0}
.str-label{font-size:.7rem;margin-top:.3rem;color:var(--text-dim)}

.action-btn{width:100%;padding:.85rem 1.5rem;border:none;border-radius:10px;font-family:inherit;font-size:.95rem;font-weight:600;cursor:pointer;transition:all .25s;display:flex;align-items:center;justify-content:center;gap:.5rem;margin-bottom:1rem}
.action-btn:disabled{opacity:.6;cursor:not-allowed;transform:none!important}
.action-btn svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.btn-enc{background:linear-gradient(135deg,var(--accent),var(--grad-end));color:#fff;box-shadow:0 4px 20px var(--shadow-accent)}
.btn-enc:hover:not(:disabled){box-shadow:0 6px 28px var(--shadow-accent);transform:translateY(-1px)}
.btn-dec{background:linear-gradient(135deg,var(--green),#22c55e);color:var(--decrypt-text);box-shadow:0 4px 20px var(--shadow-green)}
.btn-dec:hover:not(:disabled){box-shadow:0 6px 28px var(--shadow-green);transform:translateY(-1px)}

.btn-row{display:flex;gap:.5rem;margin-bottom:1rem}
.btn-row .action-btn{margin-bottom:0}

.clear-btn{width:100%;padding:.65rem 1rem;border:1px solid var(--border);border-radius:10px;background:var(--bg-card);color:var(--text-dim);font-family:inherit;font-size:.85rem;font-weight:500;cursor:pointer;transition:all .2s;display:flex;align-items:center;justify-content:center;gap:.5rem}
.clear-btn:hover{border-color:var(--red);color:var(--red)}
.clear-btn svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

.copy-btn{width:100%;padding:.65rem 1rem;border:1px solid var(--border);border-radius:10px;background:var(--bg-card);color:var(--text-dim);font-family:inherit;font-size:.85rem;font-weight:500;cursor:pointer;transition:all .2s;display:flex;align-items:center;justify-content:center;gap:.5rem}
.copy-btn:hover{border-color:var(--accent);color:var(--text)}
.copy-btn.copied{border-color:var(--green);color:var(--green)}
.copy-btn svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

.status{text-align:center;padding:.6rem 1rem;border-radius:8px;font-size:.82rem;margin-bottom:1rem;display:none;animation:fadeIn .3s ease}
.status.success{display:block;background:var(--green-glow);color:var(--green);border:1px solid var(--green-border)}
.status.error{display:block;background:var(--red-glow);color:var(--red);border:1px solid var(--red-border)}

.drop-zone{position:relative;border:2px dashed var(--border);border-radius:12px;padding:2.5rem 1.5rem;text-align:center;cursor:pointer;transition:border-color .3s,background .3s;margin-bottom:.75rem;background:var(--bg-input)}
.drop-zone:hover,.drop-zone.dragover{border-color:var(--accent);background:var(--accent-glow)}
.drop-zone input[type="file"]{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
.dz-icon{display:flex;align-items:center;justify-content:center;margin:0 auto .75rem;width:48px;height:48px;border-radius:12px;background:var(--accent-glow);border:1px solid var(--accent-border);transition:background .3s}
.dz-icon svg{width:22px;height:22px;stroke:var(--accent);fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.dz-title{font-size:.95rem;font-weight:500;margin-bottom:.3rem}
.dz-sub{font-size:.78rem;color:var(--text-dim)}

.file-note{display:flex;align-items:flex-start;gap:.5rem;padding:.65rem .85rem;margin-bottom:1.25rem;border-radius:9px;background:var(--accent-glow);border:1px solid var(--accent-border);font-size:.76rem;line-height:1.5;color:var(--text-dim);transition:background .35s,border-color .35s,color .35s}
.file-note svg{width:16px;height:16px;flex-shrink:0;margin-top:1px;stroke:var(--accent);fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

.file-info{display:none;padding:.75rem 1rem;background:var(--bg-card);border:1px solid var(--border);border-radius:10px;margin-bottom:1.25rem;align-items:center;gap:.75rem;transition:background .35s,border-color .35s}
.file-info.visible{display:flex}
.fi-icon{width:40px;height:40px;border-radius:10px;background:var(--accent-glow);border:1px solid var(--accent-border);display:flex;align-items:center;justify-content:center;flex-shrink:0}
.fi-icon svg{width:18px;height:18px;stroke:var(--accent);fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.fi-details{flex:1;min-width:0}
.fi-name{font-size:.82rem;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fi-size{font-size:.7rem;color:var(--text-dim);margin-top:.1rem}
.fi-remove{background:none;border:none;color:var(--text-dim);cursor:pointer;padding:4px;display:flex;transition:color .2s}
.fi-remove:hover{color:var(--red)}
.fi-remove svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

.prog-wrap{display:none;margin-bottom:1.25rem}
.prog-wrap.visible{display:block}
.prog-bar{height:6px;border-radius:3px;background:var(--border);overflow:hidden}
.prog-fill{height:100%;border-radius:3px;background:linear-gradient(90deg,var(--accent),var(--grad-end));transition:width .3s;width:0}
.prog-label{font-size:.7rem;color:var(--text-dim);margin-top:.4rem;text-align:center}

.info-panel{margin-top:2rem;padding:1.25rem;background:var(--bg-card);border-radius:12px;border:1px solid var(--border);transition:background .35s,border-color .35s}
.info-panel h3{font-size:.78rem;font-weight:600;color:var(--accent);text-transform:uppercase;letter-spacing:.06em;margin-bottom:.75rem;transition:color .35s}
.info-grid{display:grid;grid-template-columns:1fr 1fr;gap:.6rem}
.info-item{padding:.5rem .75rem;background:var(--bg-input);border-radius:8px;border:1px solid var(--info-border);transition:background .35s,border-color .35s}
.info-item .il{font-size:.65rem;color:var(--text-dim);text-transform:uppercase;letter-spacing:.05em;transition:color .35s}
.info-item .iv{font-size:.82rem;font-weight:500;margin-top:.15rem}

.spinner{display:inline-block;width:18px;height:18px;border:2px solid transparent;border-top-color:currentColor;border-radius:50%;animation:spin .6s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

@media(max-width:500px){.info-grid{grid-template-columns:1fr}.header h1{font-size:1.25rem}.sw-btn .lbl{display:none}.btn-row{flex-direction:column}}
