:root {
    --bg: #f7f8fa;
    --surface: #ffffff;
    --surface-soft: #fafbfc;
    --text: #111827;
    --muted: #6b7280;
    --faint: #9ca3af;
    --line: #e5e7eb;
    --line-strong: #d1d5db;
    --brand: #4f46e5;
    --brand-dark: #4338ca;
    --brand-soft: #eef2ff;
    --green: #059669;
    --green-soft: #ecfdf5;
    --red: #dc2626;
    --red-soft: #fef2f2;
    --amber: #d97706;
    --amber-soft: #fffbeb;
    --blue: #2563eb;
    --radius-sm: 9px;
    --radius: 14px;
    --radius-lg: 22px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .035);
    --shadow: 0 16px 48px rgba(15, 23, 42, .08), 0 2px 8px rgba(15, 23, 42, .04);
    --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--text); background: var(--bg); font-family: var(--font); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
code, .mono { font-family: var(--mono); }
.container { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 750; letter-spacing: -.02em; }
.brand img { flex: none; }
.eyebrow { color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border: 1px solid transparent; border-radius: 11px; background: transparent; font-weight: 700; line-height: 1.2; cursor: pointer; transition: border-color .16s, background .16s, color .16s, transform .16s, box-shadow .16s; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid rgba(79, 70, 229, .22); outline-offset: 2px; }
.button-primary { color: #fff; background: var(--brand); box-shadow: 0 6px 18px rgba(79, 70, 229, .18); }
.button-primary:hover { background: var(--brand-dark); }
.button-secondary { border-color: var(--line); background: var(--surface); color: #374151; }
.button-secondary:hover { border-color: var(--line-strong); background: #f9fafb; }
.button-quiet { color: var(--muted); }
.button-quiet:hover { color: var(--text); background: #f3f4f6; }
.button-danger { border-color: #fecaca; color: var(--red); background: var(--red-soft); }
.button-danger:hover { border-color: #fca5a5; background: #fee2e2; }
.button-large { min-height: 50px; padding-inline: 23px; border-radius: 13px; }
.button-small { min-height: 34px; padding: 6px 11px; border-radius: 8px; font-size: 13px; }
.button-full { width: 100%; }
.button-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

input, select, textarea {
    width: 100%; min-height: 44px; padding: 10px 13px; border: 1px solid var(--line);
    border-radius: 10px; background: var(--surface); transition: border .16s, box-shadow .16s;
}
textarea { resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .1); outline: none; }
input[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 3px rgba(220, 38, 38, .08); }
label { display: grid; gap: 7px; color: #374151; font-size: 13px; font-weight: 700; }
label em { color: var(--red); font-style: normal; }
.field-help { margin: 7px 0 0; color: var(--muted); font-size: 12px; font-weight: 450; }
.field-error { margin: 7px 0 0; color: var(--red); font-size: 13px; font-weight: 650; }
.alert { margin-bottom: 18px; padding: 12px 15px; border: 1px solid; border-radius: 11px; font-weight: 620; }
.alert-danger { color: #991b1b; border-color: #fecaca; background: var(--red-soft); }
.alert-success { color: #065f46; border-color: #a7f3d0; background: var(--green-soft); }
.status { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; background: #f3f4f6; color: #4b5563; font-size: 10px; font-weight: 800; letter-spacing: .05em; }
.status-success, .status-success.status, .status-success { color: #047857; background: var(--green-soft); }
.status-failed, .status-failed.status, .status-failed { color: #b91c1c; background: var(--red-soft); }
.status-running, .status-warning { color: #b45309; background: var(--amber-soft); }
.verified { color: var(--green); font-size: 12px; font-weight: 750; }
.toast { position: fixed; z-index: 1000; left: 50%; bottom: 28px; padding: 10px 15px; border-radius: 999px; color: #fff; background: #111827; box-shadow: var(--shadow); font-weight: 700; opacity: 0; transform: translate(-50%, 15px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.danger { background: var(--red); }

/* Public website */
.public-body { background: var(--bg); }
.public-nav { position: sticky; z-index: 50; top: 0; border-bottom: 1px solid rgba(229, 231, 235, .85); background: rgba(247, 248, 250, .88); backdrop-filter: blur(16px); }
.nav-inner { display: flex; height: 72px; align-items: center; justify-content: space-between; }
.public-links { display: flex; align-items: center; gap: 28px; color: #4b5563; font-size: 14px; font-weight: 650; }
.public-links > a:hover { color: var(--text); }
.language-switch { display: flex; align-items: center; gap: 8px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 12px; }
.language-switch i { width: 1px; height: 12px; background: var(--line); }
.language-switch a { color: var(--faint); }
.language-switch a.active { color: var(--brand); font-weight: 800; }
.public-menu-button { display: none; width: 40px; height: 40px; padding: 9px; border: 0; background: transparent; }
.public-menu-button span { display: block; width: 22px; height: 2px; margin: 4px 0; border-radius: 2px; background: var(--text); }
.hero { padding: 88px 0 42px; text-align: center; }
.privacy-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid #d1fae5; border-radius: 999px; color: #047857; background: rgba(236, 253, 245, .8); font-size: 12px; font-weight: 750; }
.privacy-dot { width: 7px; height: 7px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 4px rgba(16, 185, 129, .12); }
.hero h1 { max-width: 840px; margin: 25px auto 18px; font-size: clamp(36px, 5vw, 60px); line-height: 1.08; letter-spacing: -.055em; }
.hero p { max-width: 700px; margin: 0 auto; color: var(--muted); font-size: clamp(16px, 2vw, 19px); }
.generator-wrap { max-width: 850px; padding-bottom: 100px; scroll-margin-top: 100px; }
.generator-card { padding: 34px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 29px; }
.card-heading h2 { margin: 4px 0 0; font-size: 25px; letter-spacing: -.035em; }
.local-status { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border-radius: 8px; color: var(--muted); background: #f9fafb; font-size: 11px; font-weight: 650; }
.local-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.label-row label { display: block; font-size: 13px; }
.input-actions { display: flex; gap: 13px; }
.text-button { padding: 0; border: 0; color: var(--brand); background: transparent; font-size: 12px; font-weight: 750; cursor: pointer; }
.secret-input-wrap { position: relative; }
.secret-input-wrap input { min-height: 57px; padding-left: 46px; padding-right: 16px; border-radius: 13px; font-family: var(--mono); font-size: 15px; letter-spacing: .02em; }
.field-icon { position: absolute; z-index: 1; top: 18px; left: 17px; width: 14px; height: 18px; border: 2px solid #9ca3af; border-radius: 4px; }
.field-icon::before { position: absolute; top: -9px; left: 1px; width: 8px; height: 9px; border: 2px solid #9ca3af; border-bottom: 0; border-radius: 7px 7px 0 0; content: ""; }
.advanced { margin-top: 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.advanced summary { display: flex; padding: 16px 1px; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 750; cursor: pointer; list-style: none; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary span { width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .18s; }
.advanced[open] summary span { transform: rotate(225deg); }
.option-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; padding: 0 0 18px; }
.generator-actions { display: flex; gap: 10px; margin-top: 22px; }
.button-spark { width: 14px; height: 14px; border: 2px solid currentColor; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--brand); }
.otp-result { margin-top: 30px; padding: 27px; border: 1px solid #c7d2fe; border-radius: 18px; background: linear-gradient(145deg, #f9faff, #eef2ff); text-align: center; }
.result-topline { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; font-weight: 650; }
.result-topline span:last-child { overflow: hidden; max-width: 60%; text-overflow: ellipsis; white-space: nowrap; }
.otp-code { display: block; width: 100%; padding: 21px 0 14px; border: 0; color: var(--text); background: transparent; font-family: var(--mono); font-size: clamp(41px, 8vw, 65px); font-weight: 750; letter-spacing: .08em; line-height: 1; cursor: pointer; }
.countdown-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px; color: var(--muted); font-size: 12px; }
.progress-track, .vault-progress { overflow: hidden; height: 5px; border-radius: 99px; background: #dbe0f7; }
.progress-track span, .vault-progress span { display: block; width: 100%; height: 100%; border-radius: inherit; background: var(--brand); transition: width .25s linear; }
.result-actions { display: flex; justify-content: center; gap: 9px; margin-top: 21px; }
.local-scan { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 22px; padding: 17px; border: 1px dashed var(--line-strong); border-radius: 13px; background: #fafafa; }
.local-scan div { display: grid; gap: 2px; }
.local-scan span { color: var(--muted); font-size: 12px; }
.file-button { position: relative; flex: none; overflow: hidden; }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.privacy-proof { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 18px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.privacy-proof span { color: var(--green); }
.info-section { padding: 95px 0; scroll-margin-top: 80px; }
.section-heading { max-width: 650px; margin-bottom: 35px; }
.section-heading.centered { margin-inline: auto; text-align: center; }
.section-heading h2 { margin: 8px 0 12px; font-size: clamp(28px, 4vw, 42px); line-height: 1.16; letter-spacing: -.045em; }
.section-heading p { margin: 0; color: var(--muted); font-size: 16px; }
.info-grid.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.info-card { padding: 27px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: var(--shadow-sm); }
.info-card > span { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; border-radius: 10px; color: var(--brand); background: var(--brand-soft); font-size: 11px; font-weight: 850; }
.info-card h3 { margin: 19px 0 8px; font-size: 18px; }
.info-card p { margin: 0; color: var(--muted); }
.privacy-section { padding: 100px 0; background: #111827; color: #fff; scroll-margin-top: 72px; }
.privacy-layout { display: grid; grid-template-columns: 1.08fr .92fr; align-items: center; gap: 80px; }
.privacy-section .section-heading { margin: 0; }
.privacy-section .section-heading p { color: #9ca3af; }
.privacy-section .eyebrow { color: #a5b4fc; }
.privacy-list { display: grid; gap: 13px; }
.privacy-list > div { display: flex; align-items: center; gap: 15px; padding: 18px; border: 1px solid #2c3443; border-radius: 14px; background: #171f2d; }
.privacy-list i { display: inline-flex; width: 34px; height: 34px; flex: none; align-items: center; justify-content: center; border-radius: 50%; color: #c7d2fe; background: #293145; font-style: normal; font-weight: 800; }
.privacy-list span { display: grid; gap: 3px; }
.privacy-list small { color: #9ca3af; }
.platform-cloud { display: flex; max-width: 800px; margin: 30px auto 0; flex-wrap: wrap; justify-content: center; gap: 11px; }
.platform-cloud span { padding: 11px 18px; border: 1px solid var(--line); border-radius: 999px; background: #fff; box-shadow: var(--shadow-sm); font-weight: 700; }
.faq-section { padding: 70px 0 110px; }
.faq-list { max-width: 800px; margin: 0 auto; border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary { display: flex; padding: 22px 1px; align-items: center; justify-content: space-between; font-size: 16px; font-weight: 750; cursor: pointer; list-style: none; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary span { position: relative; width: 16px; height: 16px; }
.faq-list summary span::before, .faq-list summary span::after { position: absolute; top: 7px; left: 2px; width: 12px; height: 2px; background: var(--muted); content: ""; }
.faq-list summary span::after { transform: rotate(90deg); transition: transform .18s; }
.faq-list details[open] summary span::after { transform: rotate(0); }
.faq-list p { max-width: 700px; margin: -6px 0 22px; color: var(--muted); }
.public-footer { border-top: 1px solid var(--line); background: #fff; }
.public-footer .container { display: flex; min-height: 100px; align-items: center; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 12px; }
.public-footer .brand { color: var(--text); font-size: 14px; }
.qr-dialog, .admin-dialog { width: min(460px, calc(100% - 30px)); padding: 28px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.qr-dialog::backdrop, .admin-dialog::backdrop { background: rgba(15, 23, 42, .55); backdrop-filter: blur(3px); }
.dialog-close { position: absolute; top: 13px; right: 15px; width: 34px; height: 34px; border: 0; border-radius: 50%; color: var(--muted); background: #f3f4f6; font-size: 20px; cursor: pointer; }
.qr-dialog h2, .admin-dialog h2 { margin: 7px 0; letter-spacing: -.03em; }
.qr-dialog p, .admin-dialog p { color: var(--muted); }
.qr-dialog canvas { display: block; max-width: 100%; height: auto; margin: 18px auto; border: 1px solid var(--line); border-radius: 14px; }

/* Authentication */
.auth-body { display: grid; min-height: 100vh; place-items: center; padding: 32px 20px; background: radial-gradient(circle at 50% 0, #eef2ff 0, var(--bg) 38%); }
.auth-shell { width: min(430px, 100%); }
.auth-brand { display: flex; justify-content: center; margin-bottom: 24px; font-size: 18px; }
.auth-card { padding: 32px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: var(--shadow); }
.auth-heading { margin-bottom: 25px; text-align: center; }
.auth-heading h1 { margin: 7px 0; font-size: 27px; letter-spacing: -.035em; }
.auth-heading p { margin: 0; color: var(--muted); }
.stack-form { display: grid; gap: 16px; }
.install-notice { display: grid; gap: 3px; margin-bottom: 20px; padding: 13px; border: 1px solid #fde68a; border-radius: 11px; color: #92400e; background: var(--amber-soft); font-size: 12px; }
.install-notice code { display: inline-block; margin-top: 2px; }
.auth-security-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 19px; color: var(--muted); font-size: 11px; text-align: center; }
.auth-security-note span { color: var(--green); }
.auth-back { display: block; margin-top: 20px; color: var(--muted); font-size: 13px; text-align: center; }
.auth-back:hover { color: var(--brand); }
.mfa-input { height: 60px; font-family: var(--mono); font-size: 27px; font-weight: 750; letter-spacing: .25em; text-align: center; }

/* Admin shell */
.admin-body { min-height: 100vh; background: #f6f7f9; }
.admin-shell { display: flex; min-height: 100vh; }
.sidebar { position: fixed; z-index: 100; top: 0; bottom: 0; left: 0; display: flex; width: 252px; flex-direction: column; border-right: 1px solid var(--line); background: #fff; }
.sidebar-brand { display: flex; height: 78px; padding: 0 20px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.sidebar-brand .brand span { display: grid; }
.sidebar-brand .brand strong { font-size: 15px; }
.sidebar-brand .brand small { color: var(--muted); font-size: 10px; font-weight: 550; letter-spacing: .02em; }
.sidebar-close { display: none; }
.sidebar-nav { display: grid; gap: 4px; padding: 17px 13px; }
.sidebar-nav a { display: flex; height: 43px; padding: 0 12px; align-items: center; gap: 11px; border-radius: 9px; color: #4b5563; font-size: 13px; font-weight: 670; }
.sidebar-nav a:hover { color: var(--text); background: #f7f7f9; }
.sidebar-nav a.active { color: var(--brand); background: var(--brand-soft); }
.nav-icon { position: relative; display: inline-block; width: 18px; height: 18px; flex: none; opacity: .8; }
.nav-icon::before, .nav-icon::after { position: absolute; content: ""; }
.nav-icon-grid { border: 1.8px solid currentColor; border-radius: 4px; box-shadow: inset 6px 0 0 -5px currentColor, inset -6px 0 0 -5px currentColor, inset 0 6px 0 -5px currentColor, inset 0 -6px 0 -5px currentColor; }
.nav-icon-key::before { top: 1px; left: 0; width: 8px; height: 8px; border: 1.8px solid currentColor; border-radius: 50%; }
.nav-icon-key::after { top: 9px; left: 8px; width: 10px; height: 2px; background: currentColor; transform: rotate(45deg); box-shadow: 4px -3px 0 -1px currentColor; }
.nav-icon-plus::before { top: 8px; left: 2px; width: 14px; height: 2px; background: currentColor; }
.nav-icon-plus::after { top: 2px; left: 8px; width: 2px; height: 14px; background: currentColor; }
.nav-icon-upload::before { left: 3px; bottom: 1px; width: 12px; height: 6px; border: 1.8px solid currentColor; border-top: 0; border-radius: 0 0 3px 3px; }
.nav-icon-upload::after { top: 1px; left: 5px; width: 8px; height: 8px; border-top: 2px solid currentColor; border-left: 2px solid currentColor; transform: rotate(45deg); }
.nav-icon-tag::before { inset: 2px 1px 2px 3px; border: 1.8px solid currentColor; border-radius: 3px 8px 8px 3px; transform: rotate(-8deg); }
.nav-icon-tag::after { top: 7px; left: 6px; width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.nav-icon-cloud::before { top: 6px; left: 1px; width: 15px; height: 8px; border: 1.8px solid currentColor; border-radius: 8px; }
.nav-icon-cloud::after { top: 2px; left: 6px; width: 7px; height: 7px; border: 1.8px solid currentColor; border-bottom: 0; border-radius: 50% 50% 0 0; background: inherit; }
.nav-icon-list::before { top: 3px; left: 5px; width: 12px; height: 2px; background: currentColor; box-shadow: 0 5px 0 currentColor, 0 10px 0 currentColor; }
.nav-icon-list::after { top: 3px; left: 0; width: 2px; height: 2px; background: currentColor; box-shadow: 0 5px 0 currentColor, 0 10px 0 currentColor; }
.nav-icon-shield::before { top: 1px; left: 2px; width: 14px; height: 16px; border: 1.8px solid currentColor; border-radius: 8px 8px 10px 10px; clip-path: polygon(50% 0, 100% 18%, 88% 76%, 50% 100%, 12% 76%, 0 18%); }
.nav-icon-settings::before { inset: 2px; border: 2px dashed currentColor; border-radius: 50%; }
.nav-icon-settings::after { top: 6px; left: 6px; width: 6px; height: 6px; border: 1.8px solid currentColor; border-radius: 50%; }
.sidebar-footer { margin-top: auto; padding: 16px; border-top: 1px solid var(--line); }
.admin-identity { display: flex; align-items: center; gap: 10px; }
.avatar { display: inline-flex; width: 34px; height: 34px; flex: none; align-items: center; justify-content: center; border-radius: 10px; color: var(--brand); background: var(--brand-soft); font-weight: 800; }
.admin-identity > span:last-child { display: grid; min-width: 0; }
.admin-identity strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.admin-identity small { color: var(--muted); font-size: 10px; }
.sidebar-logout { width: 100%; margin-top: 10px; padding: 7px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 12px; cursor: pointer; }
.sidebar-logout:hover { color: var(--red); background: var(--red-soft); }
.sidebar-overlay { display: none; }
.admin-main { width: calc(100% - 252px); min-width: 0; margin-left: 252px; }
.admin-topbar { display: flex; height: 65px; padding: 0 30px; align-items: center; gap: 13px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .9); backdrop-filter: blur(12px); }
.admin-topbar > div { display: none; }
.admin-topbar > a { margin-left: auto; }
.menu-button { display: none; }
.icon-button { align-items: center; justify-content: center; border: 0; border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer; }
.admin-content { width: min(1280px, calc(100% - 56px)); margin: 0 auto; padding: 38px 0 70px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.page-heading h1 { margin: 5px 0 3px; font-size: 30px; line-height: 1.2; letter-spacing: -.04em; }
.page-heading p { margin: 0; color: var(--muted); }
.panel { margin-bottom: 20px; padding: 24px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow-sm); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.panel-heading h2 { margin: 0 0 2px; font-size: 17px; letter-spacing: -.02em; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.panel-heading > a { color: var(--brand); font-size: 12px; font-weight: 700; }

/* Dashboard */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 20px; }
.stat-card { display: flex; min-height: 124px; padding: 20px; align-items: center; gap: 15px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); }
.stat-icon { display: inline-flex; width: 42px; height: 42px; flex: none; align-items: center; justify-content: center; border-radius: 12px; font-weight: 800; }
.stat-icon.purple { color: #6d28d9; background: #f5f3ff; }
.stat-icon.blue { color: #1d4ed8; background: #eff6ff; }
.stat-icon.green { color: #047857; background: var(--green-soft); }
.stat-icon.amber { color: #b45309; background: var(--amber-soft); }
.stat-card div { display: grid; }
.stat-card small { color: var(--muted); font-size: 11px; }
.stat-card strong { font-size: 27px; line-height: 1.25; letter-spacing: -.04em; }
.stat-card em { color: var(--faint); font-size: 10px; font-style: normal; }
.dashboard-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 20px; }
.simple-list { display: grid; }
.simple-list a { display: flex; padding: 11px 0; align-items: center; gap: 11px; border-top: 1px solid #f1f2f4; }
.simple-list a:first-child { border-top: 0; }
.service-mark { display: inline-flex; width: 36px; height: 36px; flex: none; align-items: center; justify-content: center; border-radius: 10px; color: var(--brand); background: var(--brand-soft); font-size: 13px; font-weight: 800; }
.simple-list a > span:nth-child(2) { display: grid; min-width: 0; }
.simple-list strong { font-size: 13px; }
.simple-list small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.simple-list time { margin-left: auto; color: var(--faint); font-size: 10px; }
.backup-health { display: flex; min-height: 76px; padding: 16px; align-items: center; gap: 13px; border-radius: 12px; background: #f9fafb; }
.health-orb { width: 13px; height: 13px; flex: none; border: 3px solid #fff; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px rgba(217, 119, 6, .13); }
.success .health-orb { background: var(--green); box-shadow: 0 0 0 3px rgba(5, 150, 105, .13); }
.danger .health-orb { background: var(--red); box-shadow: 0 0 0 3px rgba(220, 38, 38, .13); }
.backup-health div { display: grid; }
.backup-health small { color: var(--muted); font-size: 11px; }
.mini-details { display: grid; gap: 8px; margin: 15px 0 0; }
.mini-details div { display: flex; gap: 14px; justify-content: space-between; }
.mini-details dt { color: var(--muted); font-size: 11px; }
.mini-details dd { overflow: hidden; max-width: 62%; margin: 0; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.audit-mini { display: grid; }
.audit-mini > div { display: grid; grid-template-columns: auto 1fr 150px 80px; padding: 10px 0; align-items: center; gap: 10px; border-top: 1px solid #f1f2f4; font-size: 12px; }
.audit-mini > div:first-child { border-top: 0; }
.audit-mini small, .audit-mini time { color: var(--muted); }
.audit-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.audit-dot.success { background: var(--green); }

/* Vault */
.filter-bar { display: grid; grid-template-columns: minmax(240px, 1fr) 150px 140px 130px auto auto; gap: 9px; margin-bottom: 16px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.filter-bar input, .filter-bar select { min-height: 39px; font-size: 12px; }
.search-field { position: relative; }
.search-field span::before { position: absolute; z-index: 1; top: 12px; left: 13px; width: 10px; height: 10px; border: 1.7px solid var(--muted); border-radius: 50%; content: ""; }
.search-field span::after { position: absolute; z-index: 1; top: 23px; left: 24px; width: 6px; height: 1.7px; background: var(--muted); transform: rotate(45deg); content: ""; }
.search-field input { padding-left: 36px; }
.checkbox-filter { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.checkbox-filter input { width: auto; min-height: 0; }
.batch-bar { display: flex; margin-bottom: 14px; padding: 10px 13px; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.batch-bar label { display: flex; margin-right: 6px; align-items: center; gap: 6px; }
.batch-bar input[type="checkbox"] { width: 15px; min-height: 15px; }
.batch-bar select, .batch-bar input[type="text"] { width: auto; min-height: 34px; padding: 5px 9px; font-size: 12px; }
.vault-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.vault-card { position: relative; min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow-sm); transition: transform .16s, box-shadow .16s, border-color .16s; }
.vault-card:hover { border-color: #d7d9df; box-shadow: 0 10px 28px rgba(15, 23, 42, .07); transform: translateY(-1px); }
.vault-card-top { position: relative; display: flex; align-items: center; gap: 10px; }
.vault-card-top > input { width: 15px; min-height: 15px; flex: none; }
.vault-title { display: grid; min-width: 0; }
.vault-title strong, .vault-title small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vault-title strong { font-size: 13px; }
.vault-title small { color: var(--muted); font-size: 11px; }
.favorite { color: #f59e0b; font-size: 11px; }
.more-button { width: 30px; height: 30px; margin-left: auto; border: 0; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; }
.more-button:hover { background: #f3f4f6; }
.card-menu { position: absolute; z-index: 5; top: 35px; right: 0; display: none; width: 130px; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
.menu-open .card-menu { display: grid; }
.card-menu a, .card-menu button { display: block; width: 100%; padding: 7px 9px; border: 0; border-radius: 6px; background: transparent; font-size: 12px; text-align: left; cursor: pointer; }
.card-menu a:hover, .card-menu button:hover { background: #f3f4f6; }
.card-menu form { margin: 0; }
.card-menu .danger-text { color: var(--red); }
.vault-code { display: block; width: 100%; margin: 19px 0 12px; padding: 0; border: 0; background: transparent; font-family: var(--mono); font-size: 29px; font-weight: 750; letter-spacing: .055em; text-align: left; cursor: pointer; }
.vault-progress { height: 4px; background: #edeff4; }
.vault-meta { display: flex; margin-top: 7px; justify-content: space-between; color: var(--muted); font-size: 10px; }
.vault-meta button, .secret-row button { padding: 0; border: 0; color: var(--brand); background: transparent; font-size: inherit; font-weight: 700; cursor: pointer; }
.secret-row { display: flex; margin-top: 15px; padding-top: 13px; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid #f0f1f3; color: var(--muted); font-size: 10px; }
.secret-mask { overflow: hidden; max-width: 72%; text-overflow: ellipsis; white-space: nowrap; }
.secret-mask.revealed { color: var(--text); user-select: all; }
.tag-row { display: flex; margin-top: 12px; flex-wrap: wrap; gap: 5px; }
.tag-row span { padding: 3px 7px; border-radius: 999px; color: #596174; background: #f3f4f6; font-size: 9px; font-weight: 700; }
.empty-state { display: grid; min-height: 300px; place-items: center; align-content: center; gap: 5px; text-align: center; }
.empty-state.compact { min-height: 220px; }
.empty-state h2, .empty-state strong { margin: 4px 0 0; }
.empty-state p { margin: 0 0 13px; color: var(--muted); }
.empty-icon, .empty-state > span { color: #c7cbd3; font-size: 35px; }
.admin-dialog { text-align: left; }
.dialog-card { display: grid; gap: 15px; }
.dialog-card h2, .dialog-card p { margin: 0; }
.admin-dialog .button-row { justify-content: flex-end; }

/* Forms, backups, tables */
.edit-form { max-width: 960px; }
.form-section { padding: 6px 0 27px; border-bottom: 1px solid var(--line); }
.form-section + .form-section { padding-top: 27px; }
.form-section:last-of-type { border-bottom: 0; }
.form-section-heading { display: flex; margin-bottom: 19px; align-items: flex-start; gap: 12px; }
.form-section-heading > span { display: inline-flex; width: 29px; height: 29px; flex: none; align-items: center; justify-content: center; border-radius: 9px; color: var(--brand); background: var(--brand-soft); font-size: 10px; font-weight: 850; }
.form-section-heading h2 { margin: 0; font-size: 16px; }
.form-section-heading p { margin: 1px 0 0; color: var(--muted); font-size: 11px; }
.form-grid { display: grid; gap: 15px; margin-bottom: 15px; }
.form-grid.two { grid-template-columns: repeat(2, 1fr); }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.password-input { position: relative; }
.password-input input { padding-right: 62px; font-family: var(--mono); }
.password-input button { position: absolute; top: 9px; right: 10px; padding: 4px 7px; border: 0; color: var(--brand); background: transparent; font-size: 11px; font-weight: 700; cursor: pointer; }
.switch-row { display: flex; margin-top: 15px; grid-template-columns: auto auto 1fr; align-items: center; gap: 10px; cursor: pointer; }
.switch-row > input { position: absolute; width: 1px; min-height: 1px; opacity: 0; }
.switch { position: relative; width: 38px; height: 22px; flex: none; border-radius: 999px; background: #d1d5db; transition: background .18s; }
.switch::after { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18); content: ""; transition: transform .18s; }
.switch-row input:checked + .switch { background: var(--brand); }
.switch-row input:checked + .switch::after { transform: translateX(16px); }
.switch-row > span:last-child { display: grid; }
.switch-row small { color: var(--muted); font-size: 11px; font-weight: 450; }
.form-footer { display: flex; padding-top: 23px; justify-content: flex-end; gap: 10px; }
.security-callout { display: flex; margin-bottom: 20px; padding: 14px; align-items: flex-start; gap: 11px; border: 1px solid #fde68a; border-radius: 11px; color: #78350f; background: var(--amber-soft); }
.security-callout.subtle { margin: 20px 0 0; border-color: #dbeafe; color: #1e3a8a; background: #eff6ff; }
.security-callout > span { display: inline-flex; width: 23px; height: 23px; flex: none; align-items: center; justify-content: center; border-radius: 50%; color: #fff; background: var(--amber); font-weight: 850; }
.security-callout.subtle > span { background: var(--blue); }
.security-callout div { display: grid; gap: 2px; }
.security-callout p { margin: 0; font-size: 11px; }
.import-panel { max-width: 900px; }
.import-panel textarea { margin-top: 7px; font-size: 12px; line-height: 1.7; }
.settings-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.backup-overview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 20px; }
.backup-state-card { display: flex; min-height: 85px; padding: 18px; align-items: center; gap: 13px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.backup-state-card > div { display: grid; }
.backup-state-card small { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.backup-state-card strong { font-size: 14px; }
.cloud-symbol, .lock-symbol { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: 11px; color: var(--brand); background: var(--brand-soft); }
.panel-actions { margin-top: 17px; padding-top: 17px; border-top: 1px solid var(--line); }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; text-align: left; }
.data-table th { padding: 10px 11px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 12px 11px; border-bottom: 1px solid #f0f1f3; vertical-align: top; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table .mono { font-size: 10px; }
.table-error { display: block; max-width: 190px; margin-top: 4px; color: var(--red); }
.ua-cell { overflow: hidden; max-width: 260px; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.empty-line { padding: 25px !important; color: var(--muted); text-align: center; }
.pagination { display: flex; margin-top: 15px; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 12px; }
.asset-note { display: flex; padding: 14px; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.asset-note img { width: 38px; }
.asset-note span { display: grid; }
.asset-note small { color: var(--muted); }
.asset-note code { color: var(--brand); }
.brand-upload-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; margin-bottom: 15px; }
.brand-upload-grid input[type="file"] { padding: 8px; font-size: 11px; }
.remove-asset { display: flex; margin-top: 3px; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 550; }
.remove-asset input { width: 14px; min-height: 14px; }
.mfa-setup { display: grid; margin-bottom: 18px; place-items: center; gap: 10px; }
.mfa-setup canvas { max-width: 220px; border: 1px solid var(--line); border-radius: 13px; }
.mfa-setup div { display: grid; gap: 4px; text-align: center; }
.mfa-setup small { color: var(--muted); }
.mfa-setup code { padding: 7px 10px; border-radius: 7px; background: #f3f4f6; font-size: 12px; word-break: break-all; }
.session-list { display: grid; }
.session-list > div { display: grid; grid-template-columns: auto 1fr auto; padding: 13px 0; align-items: center; gap: 12px; border-bottom: 1px solid #f0f1f3; }
.session-device { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; border-radius: 9px; color: var(--muted); background: #f3f4f6; }
.session-list div > span:nth-child(2) { display: grid; min-width: 0; }
.session-list strong { font-size: 12px; }
.session-list strong em { margin-left: 5px; padding: 2px 5px; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 8px; font-style: normal; }
.session-list small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.session-list time { color: var(--faint); font-size: 10px; }
.inline-confirm-form { display: flex; margin-top: 18px; padding-top: 18px; align-items: end; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); }
.inline-confirm-form label { width: min(300px, 100%); }
.tag-management { display: grid; }
.tag-management > div { display: flex; padding: 12px 0; align-items: center; gap: 9px; border-bottom: 1px solid #f0f1f3; }
.tag-management > div:last-child { border-bottom: 0; }
.tag-management form:first-child { display: grid; width: 100%; grid-template-columns: auto minmax(160px, 1fr) auto auto; align-items: center; gap: 10px; }
.tag-management input { min-height: 38px; }
.tag-management small { color: var(--muted); white-space: nowrap; }
.tag-symbol { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: 8px; color: var(--brand); background: var(--brand-soft); font-weight: 800; }
.danger-text { color: var(--red) !important; }

/* Error */
.error-body { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: var(--bg); }
.error-card { width: min(520px, 100%); padding: 40px; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.error-card .brand { justify-content: center; }
.error-code { margin: 28px 0 0; color: var(--brand); font-family: var(--mono); font-size: 56px; font-weight: 800; line-height: 1; }
.error-card h1 { margin: 12px 0 5px; letter-spacing: -.035em; }
.error-card > p:not(.error-code) { color: var(--muted); }
.error-card .button-row { justify-content: center; margin-top: 24px; }

@media (max-width: 1100px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .vault-grid { grid-template-columns: repeat(2, 1fr); }
    .filter-bar { grid-template-columns: 1fr 1fr 1fr; }
    .search-field { grid-column: span 2; }
    .settings-columns { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
    .container { width: min(100% - 28px, 720px); }
    .public-menu-button { display: block; }
    .public-links { position: absolute; top: 63px; right: 14px; display: none; width: 210px; padding: 12px; align-items: stretch; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow); }
    .public-links.open { display: flex; }
    .public-links > a { padding: 9px 10px; }
    .language-switch { margin-top: 7px; justify-content: center; }
    .hero { padding-top: 64px; }
    .generator-card { padding: 24px; }
    .option-grid { grid-template-columns: repeat(2, 1fr); }
    .info-grid.three { grid-template-columns: 1fr; }
    .privacy-layout { grid-template-columns: 1fr; gap: 40px; }
    .public-footer .container { padding: 22px 0; flex-direction: column; justify-content: center; text-align: center; }

    .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
    .sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-overlay { position: fixed; z-index: 90; inset: 0; background: rgba(15, 23, 42, .42); }
    .sidebar-open .sidebar-overlay { display: block; }
    .sidebar-close { display: inline-flex; width: 34px; height: 34px; font-size: 20px; }
    .admin-main { width: 100%; margin-left: 0; }
    .admin-topbar { padding: 0 18px; }
    .admin-topbar > div { display: grid; }
    .admin-topbar > div strong { font-size: 12px; }
    .admin-topbar > div span { color: var(--muted); font-size: 9px; }
    .menu-button { display: inline-flex; width: 36px; height: 36px; flex-direction: column; }
    .menu-button span { width: 17px; height: 2px; margin: 2px 0; background: var(--text); }
    .admin-content { width: calc(100% - 28px); padding-top: 25px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .backup-overview { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
    .hero { padding-bottom: 32px; }
    .hero h1 { font-size: 37px; }
    .generator-card { padding: 20px 17px; border-radius: 18px; }
    .card-heading { display: grid; }
    .local-status { width: fit-content; }
    .option-grid { grid-template-columns: 1fr; }
    .generator-actions { display: grid; grid-template-columns: 1fr auto; }
    .otp-result { padding: 22px 14px; }
    .otp-code { font-size: 42px; letter-spacing: .035em; }
    .result-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .result-actions .button:first-child { grid-column: span 2; }
    .local-scan { align-items: stretch; flex-direction: column; }
    .privacy-section, .info-section { padding: 75px 0; }
    .faq-section { padding-bottom: 80px; }

    .page-heading { align-items: stretch; flex-direction: column; }
    .page-heading > .button-row, .page-heading > form { align-self: stretch; }
    .page-heading .button { flex: 1; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
    .stat-card { min-height: 108px; padding: 14px; gap: 9px; }
    .stat-icon { width: 34px; height: 34px; }
    .stat-card strong { font-size: 22px; }
    .vault-grid { grid-template-columns: 1fr; }
    .filter-bar { grid-template-columns: 1fr 1fr; }
    .search-field { grid-column: span 2; }
    .batch-bar { align-items: stretch; flex-wrap: wrap; }
    .batch-bar .button { flex: 1; }
    .form-grid.two, .form-grid.three { grid-template-columns: 1fr; }
    .brand-upload-grid { grid-template-columns: 1fr; }
    .panel { padding: 18px; }
    .audit-mini > div { grid-template-columns: auto 1fr auto; }
    .audit-mini small { display: none; }
    .inline-confirm-form { align-items: stretch; flex-direction: column; }
    .inline-confirm-form label { width: 100%; }
    .tag-management > div { align-items: stretch; flex-direction: column; }
    .tag-management form:first-child { grid-template-columns: auto 1fr; }
    .tag-management form:first-child small, .tag-management form:first-child button { grid-column: 2; }
    .auth-card { padding: 25px 20px; }
}

@media (max-width: 400px) {
    .stats-grid { grid-template-columns: 1fr; }
    .otp-code { font-size: 35px; }
    .filter-bar { grid-template-columns: 1fr; }
    .search-field { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
