:root {
    --bg: #0f172a;
    --bg-soft: #111c35;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --text: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --danger: #dc2626;
    --radius: 20px;
    --shadow: 0 18px 60px rgba(15, 23, 42, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background: #f1f5f9;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(12px);
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-inner {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.nav {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 14px;
    color: #dbeafe;
}

.nav a:hover {
    color: #fff;
}

.hero {
    padding: 80px 0;
    color: #fff;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, .45), transparent 35%),
        linear-gradient(135deg, #0f172a 0%, #16213f 55%, #1e293b 100%);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 32px;
    align-items: center;
}

.badge {
    display: inline-flex;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    color: #bfdbfe;
    background: rgba(255, 255, 255, 0.07);
    font-size: 13px;
}

h1 {
    margin: 16px 0 12px;
    font-size: clamp(36px, 7vw, 64px);
    line-height: 1;
    letter-spacing: -0.06em;
}

h2, h3 {
    margin-top: 0;
    letter-spacing: -0.03em;
}

.lead {
    color: var(--muted);
    font-size: 18px;
    line-height: 1.65;
}

.hero .lead {
    color: #cbd5e1;
    max-width: 660px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
}

.btn.primary {
    background: var(--primary);
    color: #fff;
}

.btn.primary:hover {
    background: var(--primary-dark);
}

.btn.secondary {
    background: #fff;
    border-color: var(--line);
    color: var(--text);
}

.btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.panel,
.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.panel {
    padding: 28px;
}

.status-panel {
    color: var(--text);
}

.check-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.check-list li::before {
    content: '✓';
    display: inline-flex;
    width: 22px;
    height: 22px;
    margin-right: 8px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #dcfce7;
    color: var(--success);
    font-weight: 800;
}

.section {
    padding: 56px 0;
}

.narrow {
    max-width: 980px;
}

.cards {
    display: grid;
    gap: 18px;
}

.cards.three {
    grid-template-columns: repeat(3, 1fr);
}

.cards.two {
    grid-template-columns: repeat(2, 1fr);
}

.card {
    padding: 24px;
}

.card p {
    color: var(--muted);
    line-height: 1.6;
}

.link-card:hover {
    border-color: #bfdbfe;
    transform: translateY(-2px);
    transition: .2s ease;
}

.tariff.featured {
    border-color: #93c5fd;
}

.price {
    font-size: 24px;
    font-weight: 800;
    color: var(--text) !important;
}

.auth-section {
    display: flex;
    justify-content: center;
}

.auth-panel {
    width: min(100%, 460px);
}

.form {
    display: grid;
    gap: 16px;
}

.form label {
    display: grid;
    gap: 8px;
    font-weight: 700;
}

input {
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0 14px;
    font-size: 15px;
}

.alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin: 16px 0;
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

th {
    background: var(--surface-soft);
    color: #334155;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

tr:last-child td {
    border-bottom: 0;
}

code {
    padding: 3px 6px;
    border-radius: 6px;
    background: #e2e8f0;
}

.code-list {
    display: grid;
    gap: 10px;
}

.page-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.pill {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.pill.success {
    background: #dcfce7;
    color: #166534;
}

.mt {
    margin-top: 20px;
}

.site-footer {
    padding: 28px 0;
    color: #64748b;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 14px;
}

@media (max-width: 820px) {
    .header-inner,
    .footer-inner,
    .page-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav {
        flex-wrap: wrap;
    }

    .hero {
        padding: 48px 0;
    }

    .hero-grid,
    .cards.three,
    .cards.two {
        grid-template-columns: 1fr;
    }
}

select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
}

select {
    min-height: 46px;
}

textarea {
    resize: vertical;
}

.alert.success {
    background: #dcfce7;
    color: #166534;
}

.pill.danger {
    background: #fee2e2;
    color: #991b1b;
}

.cards.four {
    grid-template-columns: repeat(4, 1fr);
}

.cards.five {
    grid-template-columns: repeat(5, 1fr);
}

.metric-card {
    display: grid;
    gap: 8px;
}

.metric-card span {
    color: var(--muted);
    font-size: 14px;
}

.metric-card strong {
    font-size: 34px;
    letter-spacing: -0.05em;
}

.grid-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-form .wide,
.grid-form .form-actions {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    gap: 12px;
}

.mb {
    margin-bottom: 20px;
}

.table-wrap.flat {
    box-shadow: none;
}

@media (max-width: 820px) {
    .cards.four,
    .cards.five,
    .grid-form {
        grid-template-columns: 1fr;
    }
}

.table-actions {
    white-space: nowrap;
    text-align: right;
}

.btn.small {
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
}

.btn.danger,
.btn.small.danger {
    background: #fee2e2;
    border-color: #fecaca;
    color: #991b1b;
}

.btn.danger:hover,
.btn.small.danger:hover {
    background: #fecaca;
}

button[disabled] {
    cursor: not-allowed;
    opacity: 0.55;
}

.inline-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 160px 220px auto;
    gap: 10px;
    align-items: end;
}

.inline-form input,
.inline-form select {
    min-height: 44px;
}

.mini-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.mini-form select,
.mini-form input {
    min-width: 130px;
    padding: 8px 10px;
    min-height: 38px;
    border-radius: 10px;
}

.wide-mini input {
    min-width: 190px;
}

.danger-zone {
    border-color: #fecaca;
    background: #fff7f7;
}

@media (max-width: 820px) {
    .inline-form {
        grid-template-columns: 1fr;
    }

    .mini-form {
        flex-wrap: wrap;
    }
}

select,
textarea,
input[type="file"] {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 15px;
    background: #fff;
}

textarea {
    min-height: 110px;
    resize: vertical;
    font-family: inherit;
}

.muted {
    color: var(--muted);
    line-height: 1.6;
}

.path-cell {
    max-width: 260px;
    overflow-wrap: anywhere;
}

.download-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-soft);
}

.download-box {
    border-color: #bfdbfe;
}

.download-url {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.download-url input {
    width: 100%;
    font-family: monospace;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 820px) {
    .download-action,
    .download-url {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }
}

.cards.six {
    grid-template-columns: repeat(6, 1fr);
}

.pill.warning {
    background: #fef3c7;
    color: #92400e;
}

.small-metric {
    font-size: 16px !important;
    letter-spacing: -0.02em !important;
    line-height: 1.25;
}

.compact-inline {
    grid-template-columns: minmax(260px, 1fr) auto;
}

@media (max-width: 1100px) {
    .cards.six {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 820px) {
    .cards.six,
    .compact-inline {
        grid-template-columns: 1fr;
    }
}

.auth-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
    color: var(--muted);
    font-size: 14px;
}

.auth-links a {
    color: var(--primary);
    font-weight: 700;
}

.alert.warning {
    background: #fef3c7;
    color: #92400e;
}

.badge.success {
    background: #dcfce7;
    border-color: #bbf7d0;
    color: #166534;
}

.badge.danger {
    background: #fee2e2;
    border-color: #fecaca;
    color: #991b1b;
}

.mt-small {
    margin-top: 12px;
}

.compact-form {
    max-width: 520px;
}

.full-row {
    grid-column: 1 / -1;
}

.footer-links,
.social-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.footer-links a,
.social-row a {
    color: var(--primary);
    font-weight: 800;
    text-decoration: none;
}

.hero-social {
    margin-top: 18px;
}

.empty-state {
    padding: 18px;
    border: 1px dashed var(--line);
    border-radius: 16px;
    background: var(--surface-soft);
}

.empty-state h3 {
    margin: 0 0 8px;
}

.empty-state p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.public-content {
    line-height: 1.75;
    white-space: normal;
}

.soft-separator {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, .12);
    margin: 24px 0;
}


.hidden-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 18px 0;
}

.grid-form .full-row {
    grid-column: 1 / -1;
}

/* Patch 018: public module marketplace */
.breadcrumbs {
    color: var(--muted);
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 14px;
}

.breadcrumbs a {
    color: var(--primary);
    font-weight: 800;
}

.market-category {
    display: grid;
    gap: 14px;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.module-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    min-height: 250px;
}

.module-card-visual,
.module-product-media {
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, .35), transparent 35%),
        linear-gradient(135deg, #dbeafe 0%, #eff6ff 45%, #f8fafc 100%);
    color: #1d4ed8;
    font-size: 58px;
    font-weight: 900;
    letter-spacing: -0.08em;
    overflow: hidden;
}

.module-card-visual img,
.module-product-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.module-card-body {
    padding: 22px;
    display: grid;
    gap: 10px;
}

.module-card-body h3 {
    margin: 0;
    font-size: 24px;
}

.module-card-body p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.module-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.module-card-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-top: 6px;
}

.module-card-footer strong,
.price {
    display: block;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -0.04em;
    color: var(--text);
    margin: 0 0 4px;
}

.module-card-footer small {
    display: block;
    color: var(--muted);
}

.compact-alert {
    margin: 2px 0 0;
    padding: 8px 10px;
    font-size: 13px;
}

.module-product {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 28px;
    align-items: stretch;
}

.module-product-media {
    border-radius: 18px;
    min-height: 300px;
}

.module-product h1 {
    font-size: clamp(40px, 7vw, 72px);
}

.module-stats {
    margin-top: 22px;
}

.module-stats .card {
    box-shadow: none;
    padding: 16px;
}

.module-stats .card span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 6px;
}

.module-stats .card strong {
    font-size: 18px;
}

@media (max-width: 980px) {
    .module-grid,
    .module-product {
        grid-template-columns: 1fr;
    }

    .module-card {
        grid-template-columns: 1fr;
    }

    .module-card-visual {
        min-height: 180px;
    }
}

/* Patch 019: purchased modules cabinet */
.owned-module-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.owned-module-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
    padding: 18px;
    display: grid;
    gap: 14px;
}

.owned-module-top {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
}

.module-card-visual.compact {
    width: 92px;
    height: 92px;
    border-radius: 18px;
    font-size: 34px;
}

.owned-module-card h3 {
    margin: 8px 0 4px;
    font-size: 24px;
}

.owned-module-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.owned-module-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.owned-module-facts div {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px;
    background: var(--bg);
}

.owned-module-facts span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 5px;
}

.owned-module-facts strong {
    display: block;
    font-size: 14px;
    word-break: break-word;
}

.owned-module-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.module-changelog {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    background: var(--bg);
}

.module-changelog summary {
    cursor: pointer;
    font-weight: 800;
}

.module-changelog div {
    margin-top: 10px;
    color: var(--muted);
    line-height: 1.55;
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
}

@media (max-width: 980px) {
    .owned-module-grid,
    .owned-module-facts {
        grid-template-columns: 1fr;
    }

    .owned-module-top {
        grid-template-columns: 74px minmax(0, 1fr);
    }

    .module-card-visual.compact {
        width: 74px;
        height: 74px;
    }
}

/* Patch 021: final site polish and mobile cabinet hardening */
body {
    background:
        radial-gradient(circle at 15% 0%, rgba(37, 99, 235, .08), transparent 26%),
        radial-gradient(circle at 90% 10%, rgba(14, 165, 233, .08), transparent 24%),
        #f1f5f9;
}

.site-header {
    box-shadow: 0 10px 28px rgba(15, 23, 42, .12);
}

.nav {
    row-gap: 10px;
}

.nav a {
    padding: 8px 0;
    white-space: nowrap;
}

.cabinet-menu {
    padding: 18px;
    overflow: hidden;
}

.cabinet-menu .hero-actions {
    margin-top: 0;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

.cabinet-menu .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.license-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.license-card {
    display: grid;
    gap: 16px;
}

.license-card-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
}

.license-card h2 {
    margin: 8px 0;
    font-size: 34px;
}

.light-facts div,
.owned-module-facts.light-facts div {
    background: #f8fafc;
    color: var(--text);
}

.light-facts strong,
.owned-module-facts.light-facts strong {
    color: var(--text);
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border-radius: 999px;
    padding: 6px 10px;
    background: #e0f2fe;
    color: #075985;
    font-size: 13px;
    font-weight: 800;
}

.centered-actions {
    justify-content: center;
}

.check-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.check-card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    align-items: flex-start;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    padding: 16px;
}

.check-card.ok {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.check-card.bad {
    border-color: #fecaca;
    background: #fff7f7;
}

.check-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: #fff;
    background: var(--danger);
}

.check-card.ok .check-icon {
    background: var(--success);
}

.check-card h3 {
    margin: 0 0 6px;
}

.check-card p {
    margin: 0 0 6px;
}

.copy-line input {
    width: 100%;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    background: #f8fafc;
}

.clean-list {
    display: grid;
    gap: 10px;
    padding-left: 20px;
    color: var(--muted);
    line-height: 1.6;
}

.owned-module-facts div,
.module-changelog {
    background: #f8fafc;
    color: var(--text);
}

.owned-module-facts span,
.module-changelog div {
    color: var(--muted);
}

.owned-module-facts strong {
    color: var(--text);
}

@media (max-width: 980px) {
    .license-card-grid,
    .check-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .container {
        width: min(100% - 20px, 1120px);
    }

    .header-inner {
        min-height: auto;
        padding: 14px 0;
        gap: 10px;
    }

    .brand {
        font-size: 22px;
    }

    .nav {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        gap: 14px;
        padding-bottom: 4px;
    }

    .section {
        padding: 28px 0;
    }

    .panel,
    .card {
        border-radius: 18px;
    }

    .panel {
        padding: 18px;
    }

    h1 {
        font-size: clamp(32px, 12vw, 44px);
        letter-spacing: -0.05em;
    }

    .lead {
        font-size: 16px;
    }

    .page-head {
        gap: 12px;
    }

    .hero-actions {
        width: 100%;
    }

    .btn {
        min-height: 42px;
        padding: 0 14px;
    }

    .license-card-head,
    .module-card-footer,
    .download-action {
        flex-direction: column;
        align-items: stretch;
    }

    .license-card h2 {
        font-size: 28px;
    }

    .table-wrap {
        border-radius: 16px;
    }

    th, td {
        padding: 12px;
    }
}

/* Patch 022: premium light/dark themes, mobile burger, smoother UX */
:root {
    color-scheme: light;
    --font-main: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    --bg: #f3f7fb;
    --bg-soft: #eaf1fb;
    --page: #f6f9fd;
    --surface: rgba(255, 255, 255, .86);
    --surface-solid: #ffffff;
    --surface-soft: #f8fafc;
    --surface-muted: #eef4fb;
    --text: #0b1220;
    --heading: #07111f;
    --muted: #63728a;
    --muted-strong: #475569;
    --line: rgba(122, 139, 164, .24);
    --line-strong: rgba(100, 116, 139, .35);
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: rgba(37, 99, 235, .12);
    --accent: #7c3aed;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --radius: 22px;
    --radius-lg: 30px;
    --shadow: 0 24px 80px rgba(15, 23, 42, .12);
    --shadow-soft: 0 12px 34px rgba(15, 23, 42, .09);
    --header-bg: rgba(255, 255, 255, .72);
    --header-text: #111827;
    --header-muted: #475569;
    --glass-blur: blur(18px) saturate(135%);
    --focus-ring: 0 0 0 4px rgba(37, 99, 235, .18);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #050816;
    --bg-soft: #0b1224;
    --page: #070b18;
    --surface: rgba(15, 23, 42, .78);
    --surface-solid: #0f172a;
    --surface-soft: #111c31;
    --surface-muted: #111827;
    --text: #e6eefc;
    --heading: #ffffff;
    --muted: #a2afc3;
    --muted-strong: #cbd5e1;
    --line: rgba(148, 163, 184, .18);
    --line-strong: rgba(191, 219, 254, .26);
    --primary: #60a5fa;
    --primary-dark: #3b82f6;
    --primary-soft: rgba(96, 165, 250, .14);
    --accent: #a78bfa;
    --success: #4ade80;
    --danger: #fb7185;
    --warning: #fbbf24;
    --shadow: 0 28px 90px rgba(0, 0, 0, .42);
    --shadow-soft: 0 16px 44px rgba(0, 0, 0, .34);
    --header-bg: rgba(5, 8, 22, .78);
    --header-text: #ffffff;
    --header-muted: #cbd5e1;
    --focus-ring: 0 0 0 4px rgba(96, 165, 250, .22);
}

* {
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    color: var(--text);
    background:
        radial-gradient(circle at 12% -10%, rgba(37, 99, 235, .17), transparent 32%),
        radial-gradient(circle at 96% 5%, rgba(124, 58, 237, .13), transparent 30%),
        linear-gradient(180deg, var(--page) 0%, var(--bg) 100%);
    min-height: 100vh;
    transition: background-color .25s ease, color .25s ease;
    text-rendering: optimizeLegibility;
}

html[data-theme="dark"] body {
    background:
        radial-gradient(circle at 8% -6%, rgba(96, 165, 250, .18), transparent 34%),
        radial-gradient(circle at 96% 6%, rgba(167, 139, 250, .16), transparent 30%),
        radial-gradient(circle at 50% 120%, rgba(14, 165, 233, .10), transparent 40%),
        linear-gradient(180deg, var(--page) 0%, var(--bg) 100%);
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background-image:
        linear-gradient(rgba(148, 163, 184, .08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, .08) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: radial-gradient(circle at 50% 0%, rgba(0, 0, 0, .55), transparent 66%);
}

h1, h2, h3, h4, .brand {
    color: var(--heading);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 80;
    background: var(--header-bg);
    color: var(--header-text);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 38px rgba(15, 23, 42, .10);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.header-inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 25px;
    font-weight: 950;
    letter-spacing: -0.065em;
    color: var(--header-text);
    position: relative;
    z-index: 82;
}

.brand::before {
    content: '';
    width: 13px;
    height: 13px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 0 28px rgba(37, 99, 235, .45);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    color: var(--header-muted);
    font-weight: 750;
}

.nav a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 999px;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.nav a:hover {
    color: var(--header-text);
    background: var(--primary-soft);
    transform: translateY(-1px);
}

.header-actions {
    display: none;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 82;
}

.theme-toggle,
.menu-toggle {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    color: var(--header-text);
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.theme-toggle:hover,
.menu-toggle:hover {
    transform: translateY(-1px);
    border-color: var(--line-strong);
}

.theme-toggle {
    font-size: 18px;
}

.menu-toggle {
    flex-direction: column;
    gap: 5px;
}

.menu-toggle span {
    width: 19px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform .22s ease, opacity .22s ease;
}

body.menu-open .menu-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

body.menu-open .menu-toggle span:nth-child(2) {
    opacity: 0;
}

body.menu-open .menu-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.mobile-backdrop {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(2, 6, 23, .55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
}

body.menu-open .mobile-backdrop {
    opacity: 1;
    pointer-events: auto;
}

body.menu-open {
    overflow: hidden;
}

.hero {
    background:
        radial-gradient(circle at 15% 5%, rgba(96, 165, 250, .34), transparent 36%),
        radial-gradient(circle at 100% 0%, rgba(124, 58, 237, .28), transparent 34%),
        linear-gradient(135deg, #07111f 0%, #101b33 54%, #15274a 100%);
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    inset: auto -12% -42% 42%;
    height: 420px;
    border-radius: 999px;
    background: rgba(96, 165, 250, .14);
    filter: blur(70px);
}

.hero > .container {
    position: relative;
    z-index: 1;
}

.panel,
.card,
.table-wrap,
.owned-module-card,
.module-card,
.check-card,
.empty-state {
    background: var(--surface);
    color: var(--text);
    border-color: var(--line);
    box-shadow: var(--shadow);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease, background-color .22s ease;
}

.card:hover,
.module-card:hover,
.owned-module-card:hover,
.link-card:hover {
    transform: translateY(-4px);
    border-color: var(--line-strong);
    box-shadow: 0 30px 90px rgba(15, 23, 42, .16);
}

html[data-theme="dark"] .card:hover,
html[data-theme="dark"] .module-card:hover,
html[data-theme="dark"] .owned-module-card:hover,
html[data-theme="dark"] .link-card:hover {
    box-shadow: 0 30px 90px rgba(0, 0, 0, .52);
}

.panel,
.card {
    border-radius: var(--radius-lg);
}

.lead,
.muted,
.card p,
.module-card-body p,
.owned-module-card p,
.empty-state p,
.clean-list {
    color: var(--muted);
}

input,
select,
textarea,
input[type="file"] {
    background: var(--surface-solid);
    color: var(--text);
    border-color: var(--line);
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: var(--focus-ring);
}

input::placeholder,
textarea::placeholder {
    color: var(--muted);
}

.btn {
    border-radius: 14px;
    transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(37, 99, 235, .18);
}

.btn.primary {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    box-shadow: 0 14px 34px rgba(37, 99, 235, .28);
}

.btn.primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #6d28d9);
}

.btn.secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--line);
}

.badge,
.pill,
.chip,
code {
    border: 1px solid var(--line);
    background: var(--surface-soft);
    color: var(--muted-strong);
}

.pill.success,
.badge.success {
    background: rgba(34, 197, 94, .14);
    color: #15803d;
    border-color: rgba(34, 197, 94, .25);
}

html[data-theme="dark"] .pill.success,
html[data-theme="dark"] .badge.success {
    color: #86efac;
}

.pill.warning,
.alert.warning {
    background: rgba(245, 158, 11, .15);
    color: var(--warning);
    border-color: rgba(245, 158, 11, .24);
}

.pill.danger,
.badge.danger,
.alert.error {
    background: rgba(239, 68, 68, .13);
    color: var(--danger);
    border-color: rgba(239, 68, 68, .22);
}

.alert.success {
    background: rgba(34, 197, 94, .13);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, .22);
}

.table-wrap {
    background: var(--surface);
}

table {
    color: var(--text);
}

th {
    background: var(--surface-soft);
    color: var(--muted-strong);
}

td,
th,
hr {
    border-color: var(--line);
}

tr:hover td {
    background: rgba(37, 99, 235, .035);
}

html[data-theme="dark"] tr:hover td {
    background: rgba(96, 165, 250, .055);
}

.module-card-visual,
.module-product-media {
    background:
        radial-gradient(circle at top left, rgba(96, 165, 250, .35), transparent 36%),
        linear-gradient(135deg, rgba(37, 99, 235, .14), rgba(124, 58, 237, .10));
    color: var(--primary);
}

.module-card-body h3,
.owned-module-card h3,
.price,
.module-card-footer strong {
    color: var(--heading) !important;
}

.light-facts div,
.owned-module-facts div,
.owned-module-facts.light-facts div,
.module-changelog,
.copy-line input,
.empty-state,
.download-action,
select,
textarea,
input[type="file"] {
    background: var(--surface-soft);
    color: var(--text);
}

.owned-module-facts span,
.owned-module-facts.light-facts span,
.module-changelog div {
    color: var(--muted);
}

.owned-module-facts strong,
.owned-module-facts.light-facts strong,
.module-changelog summary {
    color: var(--heading);
}

.module-changelog,
.owned-module-facts div {
    border-color: var(--line);
}

.site-footer {
    color: var(--muted);
}

.footer-inner {
    align-items: center;
}

.footer-links a,
.social-row a,
.breadcrumbs a,
.auth-links a {
    color: var(--primary);
}

.cabinet-menu {
    position: relative;
}

.cabinet-menu .btn.secondary,
.cabinet-menu .btn {
    background: var(--surface-solid);
    color: var(--text);
}

.cabinet-menu .btn.primary {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
}

@keyframes fadeInUpPremium {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes softPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, .22); }
    50% { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
}

[data-animate] {
    opacity: 0;
    transform: translateY(14px);
}

[data-animate].is-visible {
    animation: fadeInUpPremium .55s cubic-bezier(.2, .85, .2, 1) forwards;
}

.btn.primary,
.theme-toggle {
    animation: softPulse 3.6s ease-in-out infinite;
}

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

    [data-animate] {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 1060px) {
    .header-actions {
        display: inline-flex;
    }

    .header-inner {
        min-height: 68px;
        flex-direction: row !important;
        align-items: center !important;
    }

    .nav[data-mobile-menu] {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(88vw, 380px);
        min-height: 100dvh;
        z-index: 70;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 8px;
        padding: 94px 20px 24px;
        overflow-y: auto;
        background: var(--surface-solid);
        color: var(--text);
        border-left: 1px solid var(--line);
        box-shadow: -28px 0 80px rgba(15, 23, 42, .24);
        transform: translateX(108%);
        transition: transform .26s cubic-bezier(.2, .85, .2, 1);
    }

    body.menu-open .nav[data-mobile-menu] {
        transform: translateX(0);
    }

    .nav[data-mobile-menu] a {
        min-height: 48px;
        justify-content: flex-start;
        padding: 0 16px;
        border-radius: 16px;
        background: var(--surface-soft);
        color: var(--text);
        border: 1px solid var(--line);
    }

    .nav[data-mobile-menu] a:hover {
        background: var(--primary-soft);
        color: var(--heading);
    }
}

@media (max-width: 820px) {
    .cards.three,
    .cards.two,
    .cards.four,
    .cards.five,
    .cards.six,
    .module-grid,
    .owned-module-grid,
    .license-card-grid,
    .check-grid,
    .grid-form,
    .module-product,
    .hero-grid {
        grid-template-columns: 1fr !important;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-head {
        flex-direction: column;
        align-items: stretch;
    }

    .module-card {
        grid-template-columns: 1fr;
    }

    .module-card-visual {
        min-height: 170px;
    }
}

@media (max-width: 640px) {
    .container {
        width: min(100% - 24px, 1120px);
    }

    .site-header {
        border-bottom-color: var(--line);
    }

    .brand {
        font-size: 22px;
    }

    .brand::before {
        width: 11px;
        height: 11px;
    }

    .section {
        padding: 30px 0;
    }

    .hero {
        padding: 46px 0;
    }

    h1 {
        font-size: clamp(34px, 12vw, 46px);
        line-height: .98;
    }

    h2 {
        font-size: 25px;
    }

    .panel,
    .card,
    .module-card,
    .owned-module-card {
        border-radius: 22px;
    }

    .panel,
    .card {
        padding: 20px;
    }

    .module-card-body,
    .owned-module-card {
        padding: 18px;
    }

    .hero-actions,
    .form-actions,
    .owned-module-actions,
    .module-card-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
        min-height: 46px;
    }

    .cabinet-menu {
        padding: 14px;
    }

    .cabinet-menu .hero-actions {
        flex-direction: row;
        align-items: center;
    }

    .cabinet-menu .btn {
        width: auto;
    }

    .owned-module-top {
        grid-template-columns: 68px minmax(0, 1fr);
        gap: 12px;
    }

    .module-card-visual.compact {
        width: 68px;
        height: 68px;
        border-radius: 18px;
    }

    .table-wrap {
        overflow-x: auto;
    }

    table {
        min-width: 680px;
    }

    .auth-panel {
        width: 100%;
    }
}


/* Patch 023: desktop theme switcher + vertical WordPress-like cabinet sidebar */
.header-actions {
    display: inline-flex;
}

.theme-toggle {
    width: auto;
    min-width: 112px;
    padding: 0 14px;
    gap: 8px;
    border-radius: 999px;
    background: var(--surface-solid);
    color: var(--header-text);
}

.theme-toggle-icon {
    display: inline-flex;
    width: 22px;
    align-items: center;
    justify-content: center;
}

.theme-toggle-text {
    font-size: 13px;
    font-weight: 850;
    letter-spacing: -0.01em;
}

.menu-toggle {
    display: none;
}

@media (min-width: 981px) {
    .section.narrow:has(.cabinet-menu) {
        max-width: 1180px;
    }

    .section.narrow:has(.cabinet-menu)::after {
        content: '';
        display: block;
        clear: both;
    }

    .section.narrow > .cabinet-menu {
        position: sticky;
        top: 96px;
        float: left;
        width: 278px;
        margin: 0 28px 24px 0;
        padding: 16px;
        border-radius: 28px;
        overflow: visible;
    }

    .section.narrow > .cabinet-menu h2 {
        margin: 0 0 12px;
        font-size: 18px;
    }

    .section.narrow > .cabinet-menu .hero-actions {
        margin: 0;
        padding: 0;
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        overflow: visible;
    }

    .section.narrow > .cabinet-menu .btn,
    .section.narrow > .cabinet-menu .btn.secondary,
    .section.narrow > .cabinet-menu .btn.primary {
        width: 100%;
        min-height: 46px;
        justify-content: flex-start;
        text-align: left;
        padding: 0 14px;
        border-radius: 16px;
        box-shadow: none;
    }

    .section.narrow > .cabinet-menu .btn::before {
        content: '';
        width: 8px;
        height: 8px;
        margin-right: 10px;
        border-radius: 999px;
        background: currentColor;
        opacity: .35;
        flex: 0 0 auto;
    }

    .section.narrow > .cabinet-menu .btn.primary::before {
        opacity: 1;
        background: #fff;
        box-shadow: 0 0 0 4px rgba(255, 255, 255, .18);
    }

    .section.narrow > .cabinet-menu ~ .alert,
    .section.narrow > .cabinet-menu ~ .cards,
    .section.narrow > .cabinet-menu ~ .panel,
    .section.narrow > .cabinet-menu ~ .table-wrap,
    .section.narrow > .cabinet-menu ~ .owned-module-grid,
    .section.narrow > .cabinet-menu ~ .license-card-grid,
    .section.narrow > .cabinet-menu ~ .empty-state {
        margin-left: 306px;
    }

    .section.narrow > .cabinet-menu ~ .cards.two,
    .section.narrow > .cabinet-menu ~ .cards.three,
    .section.narrow > .cabinet-menu ~ .cards.four,
    .section.narrow > .cabinet-menu ~ .owned-module-grid,
    .section.narrow > .cabinet-menu ~ .license-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .section.narrow > .cabinet-menu ~ .cards.four .metric-card strong {
        font-size: 28px;
    }
}

@media (max-width: 1060px) {
    .header-actions {
        display: inline-flex;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .theme-toggle {
        min-width: 44px;
        width: 44px;
        padding: 0;
        border-radius: 14px;
    }

    .theme-toggle-text {
        display: none;
    }
}

@media (max-width: 980px) {
    .section.narrow > .cabinet-menu {
        position: static;
        float: none;
        width: 100%;
        margin: 0 0 20px;
        overflow: visible;
    }

    .section.narrow > .cabinet-menu .hero-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin: 0;
        padding: 0;
        overflow: visible;
    }

    .section.narrow > .cabinet-menu .btn,
    .section.narrow > .cabinet-menu .btn.secondary,
    .section.narrow > .cabinet-menu .btn.primary {
        width: 100%;
        justify-content: flex-start;
        white-space: normal;
    }
}

@media (max-width: 560px) {
    .section.narrow > .cabinet-menu .hero-actions {
        grid-template-columns: 1fr;
    }
}

/* Patch 024: SEO/admin polish, safer light hero contrast, WordPress-like admin workspace */
.hero h1,
.hero h2,
.hero h3,
.hero .hero-title,
.hero .hero-heading {
    color: #ffffff !important;
    text-shadow: 0 18px 58px rgba(0, 0, 0, .34);
}

.hero .badge {
    color: #eaf2ff;
    background: rgba(255, 255, 255, .14);
    border-color: rgba(255, 255, 255, .24);
}

.hero .btn.secondary {
    background: rgba(255, 255, 255, .92);
    color: #0b1220;
    border-color: rgba(255, 255, 255, .42);
}

.admin-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 6% 0%, rgba(37, 99, 235, .12), transparent 30%),
        radial-gradient(circle at 92% 0%, rgba(124, 58, 237, .10), transparent 28%),
        linear-gradient(180deg, var(--page) 0%, var(--bg) 100%);
}

.admin-header {
    z-index: 95;
}

.admin-header .container,
.admin-header-inner {
    width: min(100% - 28px, 1480px);
}

.admin-shell {
    width: min(100% - 28px, 1480px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 288px minmax(0, 1fr);
    gap: 26px;
    align-items: start;
    padding: 28px 0 54px;
}

.admin-sidebar {
    position: sticky;
    top: 104px;
    z-index: 30;
    min-height: calc(100dvh - 132px);
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 30px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.admin-sidebar-title {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.admin-side-nav {
    display: grid;
    gap: 7px;
}

.admin-side-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 16px;
    color: var(--muted-strong);
    font-size: 14px;
    font-weight: 800;
    transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}

.admin-side-nav a::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: currentColor;
    opacity: .28;
    flex: 0 0 auto;
}

.admin-side-nav a:hover {
    color: var(--heading);
    background: var(--primary-soft);
    border-color: var(--line);
    transform: translateX(2px);
}

.admin-main {
    min-width: 0;
}

.admin-main .container,
.admin-main .section.narrow {
    width: 100%;
    max-width: none;
    margin: 0;
}

.admin-main .section {
    padding-top: 0;
}

.admin-main .page-head {
    margin-bottom: 22px;
}

.admin-main h1 {
    font-size: clamp(36px, 5vw, 58px);
}

.admin-main .cards.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-main .cards.four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-main .cards.five,
.admin-main .cards.six {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-main .panel,
.admin-main .card,
.admin-main .table-wrap {
    border-radius: 24px;
}

.admin-main .table-wrap {
    box-shadow: var(--shadow-soft);
}

.admin-main th {
    position: sticky;
    top: 77px;
    z-index: 2;
}

.seo-settings-block {
    margin-top: 8px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.seo-settings-block h3 {
    margin-bottom: 6px;
}

.seo-preview {
    display: grid;
    gap: 7px;
    padding: 18px;
    box-shadow: none;
    background: var(--surface-soft);
}

.seo-preview small {
    color: var(--muted);
    font-weight: 800;
}

.seo-preview strong {
    color: #1a0dab;
    font-size: 18px;
    line-height: 1.25;
}

html[data-theme="dark"] .seo-preview strong {
    color: #8ab4f8;
}

.seo-preview span {
    color: var(--muted-strong);
    line-height: 1.55;
}

@media (max-width: 1180px) {
    .admin-shell {
        grid-template-columns: 248px minmax(0, 1fr);
        gap: 18px;
    }

    .admin-main .cards.four,
    .admin-main .cards.five,
    .admin-main .cards.six {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1060px) {
    .admin-shell {
        display: block;
        width: min(100% - 24px, 1120px);
        padding-top: 18px;
    }

    .admin-sidebar[data-mobile-menu] {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: auto;
        width: min(88vw, 390px);
        min-height: 100dvh;
        z-index: 70;
        overflow-y: auto;
        border-radius: 0;
        border-top: 0;
        border-right: 0;
        border-bottom: 0;
        transform: translateX(108%);
        transition: transform .26s cubic-bezier(.2, .85, .2, 1);
        padding: 94px 18px 24px;
        background: var(--surface-solid);
        box-shadow: -28px 0 80px rgba(15, 23, 42, .24);
    }

    body.menu-open .admin-sidebar[data-mobile-menu] {
        transform: translateX(0);
    }

    .admin-sidebar-title {
        display: none;
    }

    .admin-main .section {
        padding-top: 18px;
    }
}

@media (max-width: 760px) {
    .admin-main .cards.three,
    .admin-main .cards.four,
    .admin-main .cards.five,
    .admin-main .cards.six {
        grid-template-columns: 1fr;
    }

    .admin-main th {
        position: static;
    }

    .admin-main .page-head .btn {
        width: 100%;
    }
}

/* Patch 025: product-ready homepage, clearer light status card, SEO/sales content blocks */
.product-hero .hero-copy h1 {
    max-width: 760px;
}

.hero .status-panel,
.hero .product-status-card {
    background: rgba(255, 255, 255, .90);
    color: #0b1220;
    border-color: rgba(255, 255, 255, .55);
    box-shadow: 0 34px 90px rgba(2, 6, 23, .22);
}

html[data-theme="dark"] .hero .status-panel,
html[data-theme="dark"] .hero .product-status-card {
    background: rgba(15, 23, 42, .78);
    color: var(--text);
    border-color: rgba(148, 163, 184, .22);
}

.hero .status-panel h2,
.hero .product-status-card h2 {
    color: #0b1220 !important;
    text-shadow: none;
    margin-bottom: 16px;
}

html[data-theme="dark"] .hero .status-panel h2,
html[data-theme="dark"] .hero .product-status-card h2 {
    color: #ffffff !important;
}

.panel-kicker {
    display: inline-flex;
    margin-bottom: 12px;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(37, 99, 235, .10);
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .06em;
}

html[data-theme="dark"] .panel-kicker {
    color: #bfdbfe;
    background: rgba(96, 165, 250, .14);
}

.premium-check-list li {
    color: #1f2937;
    line-height: 1.45;
}

html[data-theme="dark"] .premium-check-list li {
    color: var(--text);
}

.product-section {
    padding-top: 72px;
    padding-bottom: 18px;
}

.section-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.section-head.centered {
    max-width: 850px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    justify-content: center;
}

.section-head h2 {
    margin: 14px 0 8px;
    font-size: clamp(30px, 5vw, 48px);
    line-height: 1.05;
}

.screenshot-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.screenshot-card {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 30px;
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.screenshot-frame {
    min-height: 235px;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--line);
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, .22), transparent 38%),
        linear-gradient(135deg, var(--surface-soft), var(--surface-muted));
}

.screenshot-frame img {
    width: 100%;
    height: 100%;
    min-height: 235px;
    object-fit: cover;
    display: block;
}

.screenshot-placeholder {
    min-height: 235px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: var(--heading);
}

.screenshot-placeholder span {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    font-weight: 950;
    box-shadow: 0 16px 40px rgba(37, 99, 235, .25);
}

.screenshot-placeholder strong {
    font-size: 26px;
    line-height: 1.05;
}

.screenshot-card h3 {
    margin: 18px 0 8px;
    font-size: 22px;
}

.screenshot-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.62;
}

.feature-grid .feature-card {
    min-height: 245px;
}

.feature-icon {
    width: 44px;
    height: 44px;
    margin-bottom: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    color: #fff;
    background: linear-gradient(135deg, #16a34a, #2563eb);
    font-weight: 950;
    box-shadow: 0 16px 38px rgba(37, 99, 235, .20);
}

.launch-flow-panel {
    overflow: hidden;
    position: relative;
}

.launch-flow-panel::after {
    content: '';
    position: absolute;
    inset: auto -12% -45% 40%;
    height: 300px;
    border-radius: 999px;
    background: rgba(37, 99, 235, .12);
    filter: blur(60px);
    pointer-events: none;
}

.flow-steps {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.flow-steps div {
    display: grid;
    gap: 12px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface-soft);
}

.flow-steps b {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
}

.flow-steps span {
    color: var(--muted-strong);
    font-weight: 800;
    line-height: 1.4;
}

.admin-main .grid-form label.full-row input,
.admin-main .grid-form label.full-row textarea {
    width: 100%;
}

@media (max-width: 980px) {
    .screenshot-grid,
    .flow-steps {
        grid-template-columns: 1fr;
    }

    .section-head,
    .section-head.centered {
        display: block;
        text-align: left;
    }

    .product-section {
        padding-top: 44px;
    }
}

@media (max-width: 640px) {
    .screenshot-frame,
    .screenshot-frame img,
    .screenshot-placeholder {
        min-height: 190px;
    }

    .screenshot-placeholder strong {
        font-size: 22px;
    }

    .feature-grid .feature-card {
        min-height: auto;
    }
}

/* Patch 026: homepage block polish, social icons, preview visibility, security-ready UI */
.product-hero {
    min-height: auto;
    padding: clamp(56px, 8vw, 100px) 0 clamp(58px, 8vw, 92px);
}

.product-hero .hero-grid {
    gap: clamp(28px, 5vw, 64px);
}

.product-hero .hero-copy {
    max-width: 720px;
}

.product-hero .hero-copy h1 {
    font-size: clamp(42px, 5.8vw, 76px);
    line-height: .96;
    letter-spacing: -.07em;
}

.product-hero .hero-copy .lead {
    max-width: 650px;
    font-size: clamp(17px, 1.5vw, 20px);
}

.product-status-card {
    position: relative;
    overflow: hidden;
    min-height: 300px;
}

.product-status-card::before {
    content: '';
    position: absolute;
    inset: -40% -30% auto auto;
    width: 280px;
    height: 280px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(37, 99, 235, .20), transparent 68%);
    pointer-events: none;
}

.product-status-card > * {
    position: relative;
    z-index: 1;
}

html[data-theme="light"] .product-status-card,
html:not([data-theme="dark"]) .product-status-card {
    background: rgba(255, 255, 255, .82);
    color: #0f172a;
    border: 1px solid rgba(255, 255, 255, .62);
}

html[data-theme="light"] .product-status-card .panel-kicker,
html:not([data-theme="dark"]) .product-status-card .panel-kicker {
    background: #dbeafe;
    color: #1d4ed8;
}

html[data-theme="light"] .product-status-card .premium-check-list li,
html:not([data-theme="dark"]) .product-status-card .premium-check-list li {
    color: #263244;
}

.product-section {
    padding-top: clamp(54px, 7vw, 86px);
    padding-bottom: clamp(38px, 5vw, 68px);
}

.product-section-tight {
    padding-top: clamp(56px, 7vw, 88px);
    padding-bottom: clamp(28px, 4vw, 42px);
}

.home-intro-head {
    padding: clamp(26px, 4vw, 42px);
    border: 1px solid var(--line);
    border-radius: 34px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.home-intro-head h2 {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.home-intro-head .lead {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.product-preview-section {
    padding-top: clamp(36px, 5vw, 58px);
}

.home-screenshot-grid {
    align-items: stretch;
}

.screenshot-card {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.screenshot-card h3,
.screenshot-card p {
    padding-left: 6px;
    padding-right: 6px;
}

.screenshot-frame {
    min-height: 230px;
    position: relative;
}

.screenshot-placeholder {
    min-height: 230px;
    position: relative;
    isolation: isolate;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, .08), rgba(124, 58, 237, .10)),
        var(--surface-soft);
}

.screenshot-placeholder::before {
    content: '';
    position: absolute;
    inset: 16px;
    z-index: -1;
    border: 1px dashed rgba(100, 116, 139, .32);
    border-radius: 18px;
}

html[data-theme="dark"] .screenshot-placeholder::before {
    border-color: rgba(203, 213, 225, .18);
}

.screenshot-placeholder strong {
    max-width: 260px;
}

.product-benefits-section {
    padding-top: clamp(42px, 6vw, 72px);
}

.feature-card {
    position: relative;
    overflow: hidden;
}

.feature-card::after {
    content: '';
    position: absolute;
    inset: auto -45px -55px auto;
    width: 150px;
    height: 150px;
    border-radius: 999px;
    background: rgba(37, 99, 235, .08);
    pointer-events: none;
}

.social-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.social-button,
.footer-social-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-weight: 900;
    transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.social-button:hover,
.footer-social-link:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
    box-shadow: 0 14px 34px rgba(15, 23, 42, .14);
}

.social-button-icon,
.footer-social-link svg {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.social-button svg,
.footer-social-link svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.social-button.vk {
    background: rgba(37, 99, 235, .18);
    color: #dbeafe;
}

.social-button.telegram {
    background: rgba(14, 165, 233, .18);
    color: #e0f2fe;
}

html[data-theme="light"] .site-footer .footer-social-link,
html:not([data-theme="dark"]) .site-footer .footer-social-link {
    background: #ffffff;
    color: var(--primary);
}

.site-footer .footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
    justify-content: center;
}

.site-footer .footer-social-link {
    min-height: 34px;
    padding: 0 11px;
    font-size: 13px;
}

.site-footer .footer-social-link svg {
    width: 17px;
    height: 17px;
}

.admin-body .admin-main {
    padding-bottom: 40px;
}

.admin-side-nav a {
    min-width: 0;
}

.admin-main .panel,
.admin-main .card,
.admin-main .table-wrap {
    background: var(--surface-solid);
}

html[data-theme="dark"] .admin-main .panel,
html[data-theme="dark"] .admin-main .card,
html[data-theme="dark"] .admin-main .table-wrap {
    background: rgba(15, 23, 42, .82);
}

@media (max-width: 980px) {
    .product-hero {
        padding-top: 44px;
    }

    .product-hero .hero-grid {
        grid-template-columns: 1fr;
    }

    .product-status-card {
        min-height: auto;
    }

    .home-intro-head {
        text-align: left;
    }

    .home-screenshot-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .product-hero .hero-copy h1 {
        font-size: clamp(38px, 13vw, 54px);
    }

    .hero-actions .btn {
        width: 100%;
    }

    .social-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .social-button {
        justify-content: center;
    }

    .screenshot-frame,
    .screenshot-placeholder {
        min-height: 205px;
    }

    .section-head h2,
    .home-intro-head h2 {
        font-size: clamp(30px, 10vw, 42px);
    }
}

@media (max-width: 420px) {
    .social-buttons {
        grid-template-columns: 1fr;
    }
}

/* Patch 027: only homepage problematic blocks + internal support chat */
.home-intro-head {
    display: grid;
    grid-template-columns: minmax(260px, .9fr) minmax(280px, 1.1fr);
    gap: clamp(22px, 4vw, 56px);
    align-items: center;
    text-align: left;
    max-width: 1060px;
    margin-left: auto;
    margin-right: auto;
}

.home-intro-head .badge {
    grid-column: 1 / -1;
    justify-self: start;
    margin-bottom: -4px;
}

.home-intro-head h2 {
    max-width: 560px;
    margin: 0;
    font-size: clamp(34px, 4.2vw, 58px);
    line-height: 1.03;
    letter-spacing: -.055em;
    text-wrap: balance;
}

.home-intro-head .lead {
    max-width: 560px;
    margin: 0;
    font-size: clamp(17px, 1.45vw, 20px);
    line-height: 1.75;
}

.product-benefits-section .section-head.centered {
    max-width: 1060px;
    display: grid;
    grid-template-columns: minmax(280px, .95fr) minmax(280px, 1.05fr);
    gap: clamp(20px, 4vw, 54px);
    align-items: center;
    text-align: left;
}

.product-benefits-section .section-head.centered .badge {
    grid-column: 1 / -1;
    justify-self: start;
    margin-bottom: -4px;
}

.product-benefits-section .section-head.centered h2 {
    margin: 0;
    max-width: 560px;
    font-size: clamp(32px, 4vw, 54px);
    line-height: 1.04;
    letter-spacing: -.05em;
    text-wrap: balance;
}

.product-benefits-section .section-head.centered .lead {
    margin: 0;
    max-width: 560px;
    font-size: clamp(17px, 1.4vw, 20px);
    line-height: 1.75;
}

.support-layout {
    align-items: start;
}

.support-thread-list {
    display: grid;
    gap: 12px;
}

.support-thread-item {
    display: grid;
    gap: 8px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface-soft);
    color: var(--text);
    text-decoration: none;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.support-thread-item:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-soft);
}

.support-thread-title {
    color: var(--heading);
    font-size: 17px;
    font-weight: 950;
}

.support-chat-panel {
    display: grid;
    gap: 18px;
}

.support-chat-list {
    display: grid;
    gap: 14px;
}

.support-message {
    max-width: 82%;
    padding: 15px 16px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--surface-soft);
    box-shadow: var(--shadow-soft);
}

.support-message.client {
    margin-left: auto;
    background: linear-gradient(135deg, rgba(37, 99, 235, .16), rgba(124, 58, 237, .14));
}

.support-message.staff {
    margin-right: auto;
    background: linear-gradient(135deg, rgba(16, 185, 129, .12), rgba(37, 99, 235, .10));
}

.support-message.bot,
.support-message.bot-message {
    margin-right: auto;
    background: linear-gradient(135deg, rgba(250, 204, 21, .14), rgba(37, 99, 235, .08));
}

.support-message-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
}

.support-message-meta strong {
    color: var(--heading);
}

.support-message-body {
    color: var(--text);
    line-height: 1.65;
    word-break: break-word;
}

.support-reply-form {
    margin-top: 4px;
}

.support-admin-layout {
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, .8fr);
    align-items: start;
}

.support-side-panel {
    position: sticky;
    top: 92px;
}

.support-bot-note {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface-soft);
}

.pill.info {
    background: rgba(14, 165, 233, .14);
    color: #0284c7;
}

.pill.muted {
    background: rgba(100, 116, 139, .14);
    color: var(--muted-strong);
}

.compact-empty {
    padding: 22px;
    min-height: auto;
}

@media (max-width: 980px) {
    .home-intro-head,
    .product-benefits-section .section-head.centered,
    .support-admin-layout {
        grid-template-columns: 1fr;
    }

    .support-side-panel {
        position: static;
    }
}

@media (max-width: 640px) {
    .home-intro-head,
    .product-benefits-section .section-head.centered {
        padding: 22px;
        border-radius: 28px;
    }

    .home-intro-head h2,
    .product-benefits-section .section-head.centered h2 {
        font-size: clamp(30px, 9vw, 42px);
    }

    .support-message {
        max-width: 100%;
    }
}

/* Patch 028: contact support entry and final positioning block fix */
.home-position-section {
    padding-top: clamp(56px, 7vw, 96px);
    padding-bottom: clamp(46px, 6vw, 84px);
}

.home-position-card {
    display: grid;
    grid-template-columns: minmax(280px, .9fr) minmax(320px, 1.1fr);
    gap: clamp(28px, 5vw, 76px);
    align-items: center;
    width: min(100%, 1120px);
    margin: 0 auto;
    padding: clamp(30px, 5vw, 62px);
    border: 1px solid var(--line);
    border-radius: clamp(28px, 4vw, 46px);
    background:
        radial-gradient(circle at 18% 12%, rgba(124, 58, 237, .08), transparent 34%),
        linear-gradient(135deg, var(--surface), var(--surface-soft));
    box-shadow: var(--shadow-soft);
}

.home-position-main {
    display: grid;
    gap: 18px;
    align-content: center;
}

.home-position-main .badge {
    justify-self: start;
}

.home-position-main h2 {
    margin: 0;
    max-width: 560px;
    font-size: clamp(34px, 4.1vw, 58px);
    line-height: 1.02;
    letter-spacing: -.055em;
    text-wrap: balance;
}

.home-position-copy {
    display: grid;
    gap: 22px;
    align-content: center;
    max-width: 580px;
}

.home-position-copy p {
    margin: 0;
    color: var(--muted-strong);
    font-size: clamp(17px, 1.35vw, 20px);
    line-height: 1.75;
}

.position-points {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.position-points span {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--heading);
    font-weight: 850;
    font-size: 13px;
}

.contact-side-panel {
    align-content: start;
}

.support-in-contact {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background:
        radial-gradient(circle at 0 0, rgba(37, 99, 235, .12), transparent 36%),
        var(--surface-soft);
}

.support-in-contact-icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(37, 99, 235, .15), rgba(124, 58, 237, .16));
    font-size: 24px;
}

.support-in-contact h3 {
    margin: 0 0 8px;
    color: var(--heading);
    font-size: 20px;
}

.support-in-contact p {
    margin: 0 0 14px;
    color: var(--muted-strong);
    line-height: 1.65;
}

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.contact-methods {
    display: grid;
    gap: 10px;
}

.contact-method {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface-soft);
    color: var(--heading);
    text-decoration: none;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.contact-method:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-soft);
}

.contact-method > span {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: rgba(37, 99, 235, .12);
    color: #2563eb;
    font-weight: 950;
    flex: 0 0 auto;
}

.contact-method svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.contact-method.vk > span {
    background: rgba(0, 119, 255, .13);
    color: #0077ff;
}

.contact-method.telegram > span {
    background: rgba(34, 158, 217, .14);
    color: #229ed9;
}

@media (max-width: 980px) {
    .home-position-card {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .home-position-copy {
        max-width: none;
    }
}

@media (max-width: 640px) {
    .home-position-card {
        padding: 24px;
    }

    .home-position-main h2 {
        font-size: clamp(30px, 9vw, 42px);
    }

    .support-in-contact {
        grid-template-columns: 1fr;
    }
}

/* Patch 030: admin table header overlap fix */
.admin-main .table-wrap {
    position: relative;
    overflow-x: auto;
    overflow-y: visible;
}

.admin-main table {
    border-collapse: separate;
    border-spacing: 0;
}

.admin-main thead th,
.admin-main th {
    position: static !important;
    top: auto !important;
    z-index: auto !important;
    white-space: nowrap;
    vertical-align: middle;
    background: var(--surface-soft);
}

.admin-main thead tr th:first-child {
    border-top-left-radius: 18px;
}

.admin-main thead tr th:last-child {
    border-top-right-radius: 18px;
}

.admin-main tbody tr:first-child td {
    border-top: 1px solid var(--line);
}

.admin-main .table-wrap table input,
.admin-main .table-wrap table select,
.admin-main .table-wrap table textarea {
    min-height: 40px;
}

.admin-main .table-wrap table textarea {
    display: block;
    min-height: 44px;
}

.admin-main .table-wrap table td {
    vertical-align: middle;
}

@media (max-width: 760px) {
    .admin-main thead th,
    .admin-main th {
        position: static !important;
        top: auto !important;
    }
}
