:root {
    --wzs-navy: #0b1833;
    --wzs-blue: #1456a0;
    --wzs-blue-2: #2878c8;
    --wzs-bg: #f4f7fb;
    --wzs-card: #ffffff;
    --wzs-text: #1b2b3d;
    --wzs-muted: #60748a;
    --wzs-line: #dce5ef;
    --wzs-radius: 18px;
}

.wzs-app { color: var(--wzs-text); font-family: inherit; }
.wzs-app *, .wzs-app *::before, .wzs-app *::after { box-sizing: border-box; }
.wzs-hero {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 32px;
    align-items: center;
    padding: 36px;
    margin: 0 0 22px;
    border-radius: 24px;
    color: #fff;
    background: linear-gradient(135deg, #071225 0%, #0d2e58 62%, #1456a0 100%);
    box-shadow: 0 18px 48px rgba(11, 24, 51, .15);
}
.wzs-kicker { display: inline-block; margin-bottom: 10px; font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; opacity: .78; }
.wzs-hero h2 { margin: 0 0 12px; color: #fff; font-size: clamp(27px, 3vw, 44px); line-height: 1.08; }
.wzs-hero p { max-width: 850px; margin: 0; color: rgba(255,255,255,.82); font-size: 17px; line-height: 1.6; }
.wzs-hero-badge { min-width: 170px; padding: 22px; border: 1px solid rgba(255,255,255,.2); border-radius: 18px; background: rgba(255,255,255,.08); text-align: center; font-size: 24px; }
.wzs-hero-badge strong { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; opacity: .85; }

.wzs-toolbar { display: grid; grid-template-columns: 1fr minmax(260px, 360px); gap: 14px; margin-bottom: 20px; }
.wzs-search, .wzs-category-select, .wzs-export-lang, .wzs-captcha-input {
    width: 100%; min-height: 52px; padding: 0 16px; border: 1px solid var(--wzs-line); border-radius: 14px; background: #fff; color: var(--wzs-text); font-size: 15px; outline: none;
}
.wzs-search:focus, .wzs-category-select:focus, .wzs-export-lang:focus, .wzs-captcha-input:focus { border-color: var(--wzs-blue-2); box-shadow: 0 0 0 3px rgba(40,120,200,.12); }

.wzs-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 22px; align-items: start; }
.wzs-sidebar { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 7px; padding: 12px; border: 1px solid var(--wzs-line); border-radius: var(--wzs-radius); background: #fff; max-height: calc(100vh - 48px); overflow: auto; }
.wzs-category { width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; color: #3e5369; font: inherit; font-size: 13px; line-height: 1.35; text-align: left; cursor: pointer; }
.wzs-category:hover { background: #f2f6fb; color: var(--wzs-navy); }
.wzs-category.is-active { background: var(--wzs-navy); color: #fff; font-weight: 700; }
.wzs-count { margin: 0 0 12px; color: var(--wzs-muted); font-size: 13px; font-weight: 700; }
.wzs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.wzs-card { min-width: 0; padding: 22px; border: 1px solid var(--wzs-line); border-radius: var(--wzs-radius); background: var(--wzs-card); box-shadow: 0 8px 28px rgba(21, 55, 92, .06); cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.wzs-card:hover, .wzs-card:focus { transform: translateY(-2px); border-color: #aac8e6; box-shadow: 0 14px 38px rgba(21, 55, 92, .12); outline: none; }
.wzs-card-category { color: var(--wzs-blue); font-size: 11px; font-weight: 800; line-height: 1.35; text-transform: uppercase; letter-spacing: .05em; }
.wzs-card h3 { margin: 8px 0 10px; color: var(--wzs-navy); font-size: 19px; line-height: 1.25; }
.wzs-card-formula { min-height: 76px; display: flex; align-items: center; justify-content: center; overflow-x: auto; padding: 9px 4px; background: #f8fbff; border-radius: 12px; font-size: 17px; }
.wzs-card-formula mjx-container { max-width: 100%; overflow-x: auto; overflow-y: hidden; }
.wzs-card p { margin: 12px 0; color: var(--wzs-muted); font-size: 13px; line-height: 1.55; }
.wzs-card-more { color: var(--wzs-blue); font-size: 12px; font-weight: 800; }
.wzs-empty { padding: 50px 24px; border: 1px dashed #b9c9da; border-radius: 16px; color: var(--wzs-muted); text-align: center; background: #fff; }

.wzs-modal[hidden], .wzs-captcha-modal[hidden] { display: none !important; }
.wzs-modal, .wzs-captcha-modal { position: fixed; inset: 0; z-index: 999999; display: grid; place-items: center; padding: 24px; }
.wzs-modal-backdrop { position: absolute; inset: 0; background: rgba(2, 9, 19, .72); backdrop-filter: blur(5px); }
.wzs-modal-dialog, .wzs-captcha-dialog { position: relative; z-index: 2; width: min(940px, 100%); max-height: 90vh; overflow: auto; padding: 34px; border-radius: 24px; background: #fff; box-shadow: 0 30px 90px rgba(0,0,0,.28); }
.wzs-captcha-dialog { width: min(520px, 100%); }
.wzs-modal-close { position: absolute; top: 16px; right: 18px; width: 42px; height: 42px; border: 0; border-radius: 50%; background: #eef3f8; color: var(--wzs-navy); font-size: 28px; line-height: 1; cursor: pointer; }
.wzs-modal-category { padding-right: 54px; color: var(--wzs-blue); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.wzs-modal-dialog h3, .wzs-captcha-dialog h3 { margin: 8px 50px 8px 0; color: var(--wzs-navy); font-size: clamp(25px, 4vw, 38px); line-height: 1.15; }
.wzs-modal-description, .wzs-captcha-text { color: var(--wzs-muted); font-size: 15px; line-height: 1.55; }
.wzs-formula-stage { display: grid; place-items: center; min-height: 210px; margin: 24px 0; padding: 30px 24px; overflow-x: auto; border: 1px solid var(--wzs-line); border-radius: 18px; background: #f8fbff; }
.wzs-formula-render { min-width: min-content; font-size: clamp(20px, 3vw, 30px); }
.wzs-meta-row { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 18px; }
.wzs-export-language-wrap { display: inline-flex; flex-direction: column; gap: 6px; font-weight: 700; color: var(--wzs-navy); }
.wzs-meta-label { font-size: 13px; }
.wzs-symbols { margin: 0 0 20px; }
.wzs-symbols h4 { margin: 0 0 9px; color: var(--wzs-navy); }
.wzs-symbols dl { display: grid; grid-template-columns: minmax(60px, auto) 1fr; gap: 6px 14px; margin: 0; }
.wzs-symbols dt { font-weight: 800; color: var(--wzs-navy); }
.wzs-symbols dd { margin: 0; color: var(--wzs-muted); }
.wzs-source-box { display: grid; gap: 10px; margin-top: 10px; padding: 18px; border: 1px solid var(--wzs-line); border-radius: 16px; background: #fbfdff; }
.wzs-source-block { color: var(--wzs-muted); font-size: 14px; line-height: 1.5; }
.wzs-source-block strong { color: var(--wzs-navy); }
.wzs-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.wzs-btn { min-height: 48px; padding: 0 18px; border: 0; border-radius: 12px; font: inherit; font-weight: 800; cursor: pointer; }
.wzs-btn-primary { background: var(--wzs-blue); color: #fff; }
.wzs-btn-primary:hover { background: #0f467f; }
.wzs-btn-secondary { background: #edf3f9; color: var(--wzs-navy); }
.wzs-btn:disabled { opacity: .6; cursor: progress; }
.wzs-source-preview { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--wzs-line); color: #5d7186; font-size: 12px; }
html.wzs-modal-open { overflow: hidden; }

.wzs-captcha-question { display: inline-flex; align-items: center; justify-content: center; min-height: 70px; margin: 16px 0 12px; padding: 14px 18px; border-radius: 16px; background: #f5f9ff; color: var(--wzs-navy); font-size: 28px; font-weight: 800; }
.wzs-captcha-error { margin: 10px 0 0; color: #b42318; font-weight: 700; }

@media (max-width: 980px) {
    .wzs-layout { grid-template-columns: 1fr; }
    .wzs-sidebar { position: static; max-height: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .wzs-hero { grid-template-columns: 1fr; padding: 26px; }
    .wzs-hero-badge { display: none; }
    .wzs-toolbar { grid-template-columns: 1fr; }
    .wzs-grid { grid-template-columns: 1fr; }
    .wzs-sidebar { display: none; }
    .wzs-modal, .wzs-captcha-modal { padding: 10px; }
    .wzs-modal-dialog, .wzs-captcha-dialog { padding: 26px 18px; border-radius: 18px; }
    .wzs-formula-stage { min-height: 160px; padding: 20px 12px; }
    .wzs-symbols dl { grid-template-columns: 1fr; }
    .wzs-symbols dd { margin-bottom: 8px; }
    .wzs-actions { flex-direction: column; }
    .wzs-btn { width: 100%; }
}
