:root {
    --bg: #101214;
    --panel: #191e22;
    --panel-2: #20272d;
    --line: #344047;
    --text: #eef3f4;
    --muted: #aeb9bd;
    --cyan: #23c7d9;
    --amber: #f6ad3d;
    --green: #65d07f;
    --red: #ef6461;
    --steel: #8ba4b0;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    background:
        linear-gradient(rgba(16, 18, 20, 0.88), rgba(16, 18, 20, 0.94)),
        url("cnc-background.jpg") center / cover fixed;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.app-shell {
    width: min(1440px, 100%);
    margin: 0 auto;
    padding: 18px;
}

.topbar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto;
    align-items: center;
    gap: 16px;
    min-height: 76px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(18, 22, 25, 0.82);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
}

.brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    color: var(--text);
    text-decoration: none;
}

.brand img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    margin-right: 12px;
    border-radius: 6px;
    background: #fff;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 1rem;
}

.brand small {
    color: var(--muted);
}

.topnav,
.tabs {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
}

.nav-button,
.tab-button,
.ghost-button,
.primary-button {
    min-height: 38px;
    border-radius: 6px;
    border: 1px solid transparent;
    color: var(--text);
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.nav-button,
.tab-button {
    padding: 0 14px;
    background: transparent;
}

.nav-button.is-active,
.tab-button.is-active {
    background: #29333a;
    border-color: #48616b;
}

.ghost-button {
    padding: 0 14px;
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.04);
}

.primary-button {
    padding: 0 16px;
    border-color: rgba(35, 199, 217, 0.6);
    background: #147483;
    font-weight: 700;
}

.nav-button:hover,
.tab-button:hover,
.ghost-button:hover,
.primary-button:hover {
    transform: translateY(-1px);
}

main {
    padding-top: 18px;
}

.workspace {
    display: none;
}

.workspace.is-visible {
    display: block;
}

.hero-band {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 24px;
    min-height: 250px;
    padding: 34px;
    border-radius: 8px;
    background:
        linear-gradient(100deg, rgba(14, 18, 21, 0.76) 0%, rgba(14, 18, 21, 0.42) 58%, rgba(246, 173, 61, 0.22) 100%),
        url("cnc1.jpg") center / cover;
    box-shadow: var(--shadow);
}

.hero-copy {
    max-width: 880px;
}

.hero-copy .eyebrow {
    display: none;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--amber);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    max-width: 860px;
    margin-bottom: 0;
    font-size: clamp(2rem, 5vw, 4.2rem);
    line-height: 1.02;
}

h2 {
    margin-bottom: 0;
    font-size: 1.5rem;
}

.status-panel {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(16, 18, 20, 0.72);
    color: var(--muted);
}

.status-dot {
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--red);
}

.status-dot.is-online {
    background: var(--green);
}

.section-tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0;
    perspective: 1200px;
}

.section-tile {
    position: relative;
    min-height: 156px;
    padding: 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background:
        linear-gradient(160deg, rgba(24, 31, 35, 0.86), rgba(24, 31, 35, 0.42)),
        var(--tile-image, linear-gradient(135deg, #1b2428, #101418)) center / cover;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
    transform: rotateX(0deg) rotateY(0deg) translateZ(0);
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.section-tile:hover {
    border-color: rgba(35, 199, 217, 0.5);
    transform: rotateX(5deg) rotateY(-5deg) translateY(-3px);
}

.section-tile.is-clickable {
    cursor: pointer;
}

.subcatalog-tile,
.template-card[data-template-code] {
    cursor: pointer;
}

.section-tile span {
    display: inline-grid;
    place-items: center;
    min-width: 42px;
    height: 42px;
    padding: 0 8px;
    margin-bottom: 22px;
    border: 1px solid rgba(35, 199, 217, 0.65);
    border-radius: 6px;
    background: rgba(20, 116, 131, 0.6);
    font-weight: 900;
}

.section-tile h3 {
    margin-bottom: 8px;
    font-size: 1rem;
    line-height: 1.25;
}

.section-tile p {
    margin-bottom: 0;
    color: var(--muted);
}

.catalog-layout {
    display: grid;
    grid-template-columns: minmax(280px, 330px);
    gap: 18px;
    align-items: start;
}

.catalog-layout .repository-panel {
    display: none;
}

.subcatalog-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.auth-panel,
.repository-panel,
.profile-panel,
.admin-panel,
.techprep-panel,
.technology-panel {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(25, 30, 34, 0.9);
    box-shadow: var(--shadow);
}

.auth-panel {
    position: sticky;
    top: 18px;
    width: min(100%, 430px);
    min-width: 330px;
    padding: 16px;
}

.auth-panel .tabs {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
}

.auth-panel .tab-button {
    flex: 1 1 0;
    min-width: max-content;
    padding-inline: 10px;
}

.auth-form {
    display: none;
    margin-top: 16px;
}

.auth-form.is-visible {
    display: grid;
    gap: 12px;
}

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 0.88rem;
}

input,
select {
    width: 100%;
    min-height: 40px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    background: #101417;
}

input:focus,
select:focus {
    outline: 2px solid rgba(35, 199, 217, 0.28);
    border-color: var(--cyan);
}

.password-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: stretch;
}

.password-field input {
    min-width: 0;
}

.password-toggle {
    min-width: 86px;
    min-height: 40px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

.password-toggle:hover {
    border-color: rgba(35, 199, 217, 0.5);
}

.password-toggle.is-visible {
    border-color: rgba(246, 173, 61, 0.55);
    color: var(--amber);
}

.repository-panel,
.admin-panel,
.techprep-panel {
    padding: 18px;
}

.technology-panel {
    display: grid;
    gap: 16px;
    min-width: 0;
    padding: 18px;
}

.technology-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 24px;
    min-width: 0;
    min-height: 300px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(105deg, rgba(14, 18, 21, 0.9) 0%, rgba(14, 18, 21, 0.68) 56%, rgba(20, 116, 131, 0.32) 100%),
        url("cnc1.jpg") center / cover;
}

.technology-hero h3 {
    max-width: 880px;
    margin-bottom: 14px;
    font-size: 3rem;
    line-height: 1.05;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.technology-hero p {
    max-width: 780px;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.55;
}

.technology-mail {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    text-decoration: none;
    white-space: nowrap;
}

.technology-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.75fr) minmax(260px, 0.75fr);
    gap: 16px;
}

.technology-block {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.technology-block h3 {
    margin: 0 0 12px;
}

.technology-block p {
    margin-bottom: 12px;
    color: var(--muted);
    line-height: 1.6;
}

.technology-block p:last-child {
    margin-bottom: 0;
}

.technology-story {
    background:
        linear-gradient(160deg, rgba(32, 39, 45, 0.95), rgba(25, 30, 34, 0.88));
}

.technology-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    line-height: 1.45;
}

.technology-request-note {
    flex: 0 0 auto;
    margin: 0;
    color: var(--text);
    font-size: 1.08rem;
    font-weight: 700;
}

.technology-request-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.technology-request-mail {
    flex: 0 1 auto;
}

.technology-inline-arrow {
    position: relative;
    flex: 0 0 42px;
    width: 42px;
    height: 2px;
    border-radius: 999px;
    background: rgba(35, 199, 217, 0.85);
    animation: technologyArrowPulse 1.4s ease-in-out infinite;
}

.technology-inline-arrow::after {
    content: "";
    position: absolute;
    top: -5px;
    right: 0;
    width: 10px;
    height: 10px;
    border-top: 2px solid rgba(35, 199, 217, 0.9);
    border-right: 2px solid rgba(35, 199, 217, 0.9);
    transform: rotate(45deg);
}

.technology-panel .panel-heading h2 {
    overflow-wrap: anywhere;
    word-break: break-word;
}

@keyframes technologyArrowPulse {
    0%,
    100% {
        opacity: 0.58;
        transform: translateX(0);
    }

    50% {
        opacity: 1;
        transform: translateX(5px);
    }
}

.company-panel {
    display: grid;
    gap: 16px;
    padding: 18px;
}

.company-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr);
    gap: 16px;
}

.company-card {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.company-intro {
    grid-row: span 2;
    background:
        linear-gradient(160deg, rgba(32, 39, 45, 0.95), rgba(25, 30, 34, 0.88));
}

.company-card h3 {
    margin: 0 0 12px;
}

.company-card p {
    margin-bottom: 12px;
    color: var(--muted);
    line-height: 1.6;
}

.company-card p:last-child {
    margin-bottom: 0;
}

.company-requisites {
    display: grid;
    grid-template-columns: minmax(150px, 0.42fr) minmax(0, 1fr);
    gap: 10px 14px;
    margin: 0;
}

.company-requisites dt {
    color: var(--muted);
}

.company-requisites dd {
    margin: 0;
    color: var(--text);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.company-requisites a {
    color: var(--accent);
    text-decoration: none;
}

.company-requisites a:hover {
    text-decoration: underline;
}

.commerce-panel {
    display: grid;
    gap: 16px;
    padding: 18px;
}

.commerce-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.8fr);
    gap: 16px;
}

.commerce-main,
.commerce-side {
    display: grid;
    gap: 16px;
    align-content: start;
}

.commerce-block {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.commerce-block h3 {
    margin: 0 0 14px;
}

.tariff-grid,
.legal-docs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.tariff-card,
.legal-doc {
    display: grid;
    gap: 10px;
    min-height: 160px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-2);
}

.tariff-card span,
.legal-doc span {
    color: var(--muted);
}

.payment-system-logos {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.payment-system-logos img {
    width: 96px;
    height: auto;
    max-height: 32px;
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
}

.legal-doc ul {
    display: grid;
    gap: 8px;
    margin: 0;
    padding-left: 18px;
    color: var(--text);
    font-size: 0.92rem;
    line-height: 1.45;
}

.legal-doc-link {
    justify-self: start;
    margin-top: auto;
}

.tariff-card h4 {
    margin: 0;
    font-size: 1.05rem;
}

.tariff-card strong {
    color: var(--amber);
    font-size: 1.25rem;
}

.seller-requisites {
    display: grid;
    grid-template-columns: minmax(110px, 0.6fr) minmax(0, 1fr);
    gap: 8px 12px;
    margin: 0;
}

.seller-requisites dt {
    color: var(--muted);
}

.seller-requisites dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.checkout-form {
    display: grid;
    gap: 12px;
}

.checkout-form textarea {
    min-height: 86px;
    resize: vertical;
}

.sms-code-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: end;
}

.sms-code-row .ghost-button {
    min-height: 40px;
    white-space: nowrap;
}

.form-hint {
    margin: -2px 0 0;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.35;
}

.form-notice {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid rgba(34, 211, 238, 0.35);
    border-radius: 8px;
    background: rgba(8, 145, 178, 0.14);
    color: var(--text);
    font-size: 0.88rem;
    line-height: 1.4;
}

.auth-form.is-disabled label,
.auth-form.is-disabled .form-hint,
.auth-form.is-disabled .consent-check {
    opacity: 0.62;
}

.consent-check {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

.consent-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-height: 0;
    padding: 0;
    margin-top: 2px;
    accent-color: var(--cyan);
}

.consent-check a {
    color: var(--cyan);
}

.register-code-debug input {
    color: var(--amber);
    font-weight: 800;
}

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

.payment-methods label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
        "radio title"
        ". text";
    column-gap: 8px;
    row-gap: 5px;
    align-items: start;
    min-height: 74px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
}

.payment-methods label:has(input:checked) {
    border-color: rgba(29, 179, 196, 0.85);
    background: rgba(29, 179, 196, 0.12);
}

.payment-methods input {
    grid-area: radio;
    width: auto;
    margin: 2px 0 0;
}

.payment-methods strong,
.payment-methods span {
    display: block;
}

.payment-methods strong {
    grid-area: title;
}

.payment-methods span {
    grid-area: text;
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.35;
}

.payment-methods .is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.payment-methods-empty {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.payer-fields {
    display: grid;
    gap: 12px;
}

.payer-fields[hidden] {
    display: none;
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.filters {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.template-card {
    min-height: 220px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-2);
}

.template-card.is-open {
    border-color: rgba(101, 208, 127, 0.45);
}

.template-card.is-locked {
    opacity: 0.72;
}

.template-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 0.86rem;
}

.code-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 8px;
    border-radius: 6px;
    background: rgba(246, 173, 61, 0.16);
    color: var(--amber);
    font-weight: 900;
}

.template-card h3 {
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.template-card p {
    color: var(--muted);
}

.version-line {
    margin-bottom: 0;
    color: var(--amber) !important;
    font-size: 0.84rem;
    font-weight: 800;
}

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

.file-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-height: 34px;
    padding: 7px 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.18);
}

.template-open-button {
    width: 100%;
    margin-top: 14px;
}

.template-passport-panel {
    min-height: calc(100vh - 120px);
}

.template-passport-hero {
    position: relative;
    min-height: 280px;
    display: flex;
    align-items: flex-end;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(9, 13, 16, 0.84), rgba(9, 13, 16, 0.35)),
        var(--passport-image),
        linear-gradient(135deg, rgba(28, 132, 145, 0.32), rgba(246, 173, 61, 0.18));
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.passport-code {
    width: auto;
    height: auto;
    min-height: 72px;
    padding: 0 22px;
    font-size: 2.8rem;
    line-height: 1;
}

.passport-version {
    position: absolute;
    right: 24px;
    bottom: 22px;
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0 16px;
    border: 1px solid rgba(246, 173, 61, 0.54);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.42);
    color: var(--amber);
    font-size: 1.65rem;
    font-weight: 900;
}

.template-passport-hero > div {
    max-width: 760px;
}

.template-passport-hero h2 {
    margin: 14px 0 10px;
    font-size: clamp(2rem, 4vw, 4.2rem);
    line-height: 1;
}

.template-passport-hero p {
    max-width: 680px;
    color: rgba(245, 247, 250, 0.86);
    font-size: 1.02rem;
}

.passport-badges,
.passport-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.passport-badges span,
.passport-tags span {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.28);
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 800;
}

.template-passport-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
    gap: 14px;
    margin-top: 14px;
}

.template-passport-main,
.template-passport-side {
    display: grid;
    gap: 14px;
    align-content: start;
}

.passport-section {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(19, 24, 31, 0.82);
}

.passport-section h3 {
    margin-bottom: 12px;
}

.passport-description {
    min-height: 520px;
}

.passport-description > p {
    max-width: 920px;
    margin-bottom: 16px;
    font-size: 1.02rem;
}

.passport-media-block {
    display: grid;
    gap: 10px;
}

.passport-media {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
    gap: 12px;
}

.passport-media-item {
    min-width: 0;
    margin: 0;
}

.passport-media-item video,
.passport-media-item img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 1px solid rgba(35, 199, 217, 0.34);
    border-radius: 8px;
    background: #071012;
}

.passport-media-item video {
    object-fit: contain;
}

.passport-media-item img {
    object-fit: contain;
}

.passport-media-item figcaption {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.84rem;
}

.passport-media-block .passport-media-caption {
    margin: 0;
    color: var(--text);
    font-size: 1.08rem;
    font-weight: 700;
}

.help-content p,
.passport-section p {
    color: var(--muted);
}

.help-content h3,
.help-content h4 {
    margin: 14px 0 8px;
}

.help-bullet {
    position: relative;
    padding-left: 18px;
}

.help-bullet::before {
    position: absolute;
    left: 0;
    content: "•";
    color: var(--amber);
}

.passport-specs {
    display: grid;
    grid-template-columns: minmax(140px, 0.4fr) minmax(0, 1fr);
    gap: 10px 14px;
}

.passport-specs dt {
    color: var(--muted);
}

.passport-specs dd {
    margin: 0;
}

.platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.platform-card {
    display: grid;
    gap: 4px;
    min-height: 70px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.18);
}

.platform-card span,
.price-line {
    color: var(--amber);
    font-weight: 800;
}

.access-ok {
    color: #8ee59d !important;
    font-weight: 800;
}

.passport-docs {
    display: grid;
    gap: 8px;
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
}

.developer-files .file-list {
    max-height: 420px;
    overflow: auto;
}

.file-list span {
    min-width: 0;
    overflow-wrap: anywhere;
    color: #dce7ea;
    font-size: 0.86rem;
}

.file-list a {
    color: var(--cyan);
    font-weight: 800;
    text-decoration: none;
}

.locked-text,
.empty-state {
    margin: 0;
    color: var(--muted);
}

.account-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.detvolume-workbench {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: minmax(420px, 70vh) auto;
    gap: 14px;
}

.detvolume-results {
    grid-column: 1 / -1;
}

.detvolume-pane,
.detvolume-results {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
}

.detvolume-pane {
    grid-template-rows: auto auto auto minmax(240px, 1fr);
    min-height: 0;
}

.detvolume-pane-header,
.detvolume-results-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
}

.detvolume-pane-header h3,
.detvolume-results-header h3 {
    margin-bottom: 0;
    font-size: 1.1rem;
}

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

.detvolume-pane:first-child .detvolume-fields {
    grid-template-columns: minmax(220px, 1fr);
}

.material-row {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
    min-height: 28px;
    gap: 8px;
    color: var(--muted);
    font-size: 0.86rem;
}

.material-swatch {
    width: 18px;
    height: 18px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    background: #7d9bb0;
}

.viewport-placeholder {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 260px;
    border: 1px dashed rgba(139, 164, 176, 0.38);
    border-radius: 8px;
    color: var(--muted);
    background:
        linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px),
        linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
        #0d1012;
    background-size: 32px 32px;
}

.model-viewport {
    overflow: hidden;
    padding: 0;
}

.model-viewport canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: grab;
}

.model-viewport.is-loaded {
    border-style: solid;
    border-color: rgba(35, 199, 217, 0.36);
    background: #0b1113;
}

.model-viewport.is-loaded canvas:active {
    cursor: grabbing;
}

.model-viewport.is-loaded > span {
    display: none;
}

.viewport-model-info {
    position: absolute;
    right: 10px;
    bottom: 10px;
    left: 10px;
    display: none;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(10, 14, 16, 0.78);
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.4;
    pointer-events: none;
}

.model-viewport.is-loaded .viewport-model-info {
    display: block;
}

.result-controls {
    display: grid;
    grid-template-columns: minmax(170px, 1fr) auto auto;
    gap: 8px;
    align-items: end;
}

.techprep-pricing {
    display: grid;
    grid-template-columns: repeat(2, minmax(190px, 1fr));
    gap: 8px;
    min-width: 0;
}

.techprep-price {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid rgba(246, 173, 61, 0.32);
    border-radius: 6px;
    color: var(--amber);
    background: rgba(246, 173, 61, 0.09);
    font-weight: 800;
}

.techprep-free-counter {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid rgba(35, 199, 217, 0.38);
    border-radius: 6px;
    color: var(--cyan);
    background: rgba(35, 199, 217, 0.09);
    font-weight: 800;
}

.techprep-free-counter.is-empty {
    border-color: var(--line);
    color: var(--muted);
    background: rgba(255, 255, 255, 0.035);
}

.techprep-auth-notice {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    margin: 12px 0;
    padding: 14px;
    border: 1px solid rgba(35, 199, 217, 0.38);
    border-radius: 8px;
    background: rgba(7, 16, 18, 0.78);
}

.techprep-auth-notice > div:first-child {
    display: grid;
    gap: 4px;
}

.techprep-auth-notice strong {
    color: var(--text);
}

.techprep-auth-notice span {
    color: var(--muted);
    line-height: 1.45;
}

.techprep-auth-notice-actions {
    display: flex;
    gap: 8px;
}

.techprep-progress {
    margin: 12px 0;
    padding: 14px;
    border: 1px solid rgba(35, 199, 217, 0.36);
    border-radius: 8px;
    background: rgba(7, 16, 18, 0.72);
    box-shadow: 0 0 22px rgba(35, 199, 217, 0.1);
}

.techprep-progress-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: var(--text);
    font-weight: 800;
}

.techprep-progress-top strong {
    color: var(--cyan);
    font-size: 0.95rem;
}

.techprep-progress-track {
    overflow: hidden;
    height: 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.techprep-progress-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--cyan), var(--amber));
    transition: width 420ms ease;
}

.metric-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
}

.metric-card {
    min-height: 210px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-2);
}

.metric-card-time {
    display: grid;
    align-content: center;
    justify-items: center;
    text-align: center;
}

.metric-card span {
    display: block;
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
}

.metric-card strong {
    display: block;
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: clamp(3.2rem, 8vw, 7rem);
    line-height: 0.95;
}

.model-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.model-strip span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
}

.techprep-result-actions {
    display: flex;
    justify-content: flex-end;
}

.techprep-pdf-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    width: fit-content;
    padding: 7px 12px;
}

.techprep-history-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.backplot-panel {
    display: grid;
    gap: 14px;
}

.backplot-workbench {
    display: grid;
    grid-template-columns: minmax(340px, 0.9fr) minmax(0, 1.35fr);
    gap: 14px;
    height: min(760px, calc(100vh - 150px));
    min-height: 560px;
}

.backplot-code-pane,
.backplot-view-pane {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
}

.backplot-code-pane {
    display: grid;
    grid-template-rows: auto minmax(320px, 1fr);
    gap: 10px;
}

.backplot-toolbar,
.backplot-viewbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

#backplotProgram {
    width: 100%;
    min-height: 0;
    overflow: auto;
    resize: none;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: #dce7ea;
    background: #0d1012;
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 0.92rem;
    line-height: 1.45;
}

.backplot-lines {
    position: relative;
    display: block;
    min-height: 0;
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.16);
}

.backplot-lines:focus {
    outline: 2px solid rgba(35, 199, 217, 0.28);
    border-color: var(--cyan);
}

.backplot-lines-space {
    position: relative;
    min-height: 100%;
}

.backplot-line {
    position: absolute;
    right: 6px;
    left: 6px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    padding: 4px 6px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--muted);
    background: transparent;
    text-align: left;
}

.backplot-line:hover,
.backplot-line.is-current {
    border-color: rgba(35, 199, 217, 0.42);
    background: rgba(35, 199, 217, 0.08);
}

.backplot-line span {
    color: var(--steel);
    font-size: 0.78rem;
    text-align: right;
}

.backplot-line code {
    min-width: 0;
    overflow: hidden;
    color: #dce7ea;
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 0.82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.backplot-line em {
    color: var(--amber);
    font-style: normal;
    font-weight: 800;
}

.backplot-view-pane {
    display: grid;
    grid-template-rows: auto minmax(360px, 1fr);
    gap: 10px;
}

.backplot-stats {
    min-width: 220px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.view-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.view-buttons .ghost-button {
    min-height: 32px;
    padding: 0 9px;
    font-size: 0.82rem;
}

.backplot-viewport {
    position: relative;
    min-height: 360px;
    overflow: hidden;
    border: 1px solid rgba(35, 199, 217, 0.28);
    border-radius: 8px;
    background: #0b1113;
}

.backplot-viewport canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: grab;
}

.backplot-viewport canvas:active {
    cursor: grabbing;
}

.backplot-legend {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: calc(100% - 20px);
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(10, 14, 16, 0.78);
    color: var(--muted);
    font-size: 0.8rem;
}

.backplot-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.backplot-legend i {
    width: 18px;
    height: 3px;
    border-radius: 999px;
}

.legend-rapid {
    background: var(--red);
}

.legend-feed {
    background: var(--amber);
}

.legend-current {
    background: var(--cyan);
}

.profile-panel {
    min-height: 220px;
    padding: 18px;
}

dl {
    display: grid;
    grid-template-columns: minmax(120px, 0.55fr) minmax(0, 1fr);
    gap: 10px 14px;
    margin: 0;
}

dt {
    color: var(--muted);
}

dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-weight: 800;
}

.topup-form {
    display: grid;
    gap: 12px;
}

.balance-summary {
    display: grid;
    gap: 10px;
    align-content: start;
}

.balance-summary strong {
    color: var(--text);
    font-size: 1.9rem;
    line-height: 1.1;
}

.balance-summary span {
    color: var(--muted);
    font-size: 0.92rem;
}

.balance-summary .primary-button {
    justify-self: start;
}

.payment-instructions {
    display: grid;
    gap: 10px;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid rgba(29, 179, 196, 0.45);
    border-radius: 8px;
    background: rgba(29, 179, 196, 0.08);
}

.payment-instructions[hidden] {
    display: none;
}

.payment-instructions strong {
    color: var(--text);
}

.payment-instructions dl {
    grid-template-columns: minmax(96px, 0.45fr) minmax(0, 1fr);
    gap: 6px 10px;
}

.payment-instructions p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.payment-qr-wrap {
    display: grid;
    justify-items: start;
    gap: 10px;
}

.payment-qr {
    width: min(220px, 100%);
    aspect-ratio: 1;
    padding: 10px;
    border: 1px solid rgba(233, 238, 240, 0.2);
    border-radius: 8px;
    background: #fff;
    object-fit: contain;
}

.payment-qr-placeholder {
    max-width: 340px;
    padding: 14px;
    border: 1px dashed rgba(29, 179, 196, 0.55);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(10, 15, 18, 0.46);
    line-height: 1.45;
}

.payment-qr-link {
    width: fit-content;
}

pre {
    min-height: 140px;
    margin: 0;
    padding: 14px;
    overflow: auto;
    border-radius: 6px;
    color: #dce7ea;
    background: #0d1012;
    white-space: pre-wrap;
}

.admin-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
}

.config-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.config-strip span,
.ghost-link {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
    text-decoration: none;
}

.admin-stack {
    display: grid;
    gap: 16px;
}

.admin-block {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
}

.admin-block h3 {
    margin-bottom: 12px;
    font-size: 1rem;
}

.admin-activity {
    min-height: 320px;
}

.admin-activity-tabs {
    display: flex;
    gap: 4px;
    margin: -2px -2px 14px;
    padding: 2px 2px 10px;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
}

.admin-activity-tab {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--muted);
    background: transparent;
    font: inherit;
    transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.admin-activity-tab:hover,
.admin-activity-tab:focus-visible {
    color: var(--text);
    border-color: var(--line);
}

.admin-activity-tab.is-active {
    color: var(--text);
    border-color: #48616b;
    background: #29333a;
}

.admin-activity-panel[hidden] {
    display: none;
}

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

.users-table {
    width: 100%;
    min-width: 1040px;
    border-collapse: collapse;
}

.users-table th,
.users-table td {
    padding: 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.users-table th {
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.users-table small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.notifications {
    display: grid;
    align-content: start;
    gap: 10px;
}

.compact-list,
.role-requests {
    display: grid;
    align-content: start;
    gap: 8px;
}

.compact-item {
    display: grid;
    gap: 4px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.16);
}

.compact-item strong {
    color: var(--text);
    font-size: 0.92rem;
}

.compact-item span {
    color: var(--muted);
    font-size: 0.84rem;
    overflow-wrap: anywhere;
}

.compact-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 3px;
}

.techprep-real-time-form {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) auto;
    gap: 8px;
    align-items: end;
}

.techprep-real-time-form label {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: 0.78rem;
}

.techprep-real-time-form input {
    width: 100%;
    min-width: 0;
    padding: 7px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    color: #17202a;
}

.techprep-real-time-form .ghost-button {
    min-height: 34px;
    padding: 7px 10px;
}

.techprep-calibration-form {
    display: flex;
    justify-content: flex-start;
    margin-top: 4px;
}

.techprep-calibration-form .ghost-button {
    min-height: 34px;
    padding: 7px 10px;
}

.admin-sms-form {
    display: grid;
    gap: 8px;
    margin-bottom: 10px;
}

.admin-sms-form textarea {
    min-height: 74px;
}

.admin-sms-form .ghost-button {
    justify-self: start;
}

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.version-form {
    display: grid;
    grid-template-columns: 80px 100px 1fr 150px 1.4fr auto;
    gap: 8px;
    margin-bottom: 12px;
}

.import-export {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
}

textarea {
    width: 100%;
    min-height: 92px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    background: #101417;
    resize: vertical;
    font: inherit;
}

.notification {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
}

.notification time {
    display: block;
    margin-bottom: 6px;
    color: var(--amber);
    font-size: 0.78rem;
}

.notification p {
    margin-bottom: 0;
    color: var(--muted);
}

.toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 10;
    max-width: min(420px, calc(100vw - 36px));
    padding: 12px 14px;
    border: 1px solid rgba(35, 199, 217, 0.45);
    border-radius: 8px;
    background: #11181b;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.analytics-consent {
    position: fixed;
    right: 18px;
    bottom: 18px;
    left: 18px;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    width: min(760px, calc(100vw - 36px));
    margin: 0 auto;
    padding: 16px;
    border: 1px solid rgba(35, 199, 217, 0.45);
    border-radius: 8px;
    background: #11181b;
    box-shadow: var(--shadow);
}

.analytics-consent strong {
    display: block;
    margin-bottom: 5px;
}

.analytics-consent p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.analytics-consent a {
    color: var(--accent);
}

.analytics-consent-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.analytics-settings-button {
    position: fixed;
    bottom: 14px;
    left: 14px;
    z-index: 12;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--muted);
    background: #11181b;
    cursor: pointer;
    font: inherit;
    font-size: 0.78rem;
}

.analytics-settings-button:hover,
.analytics-settings-button:focus-visible {
    border-color: var(--accent);
    color: var(--text);
}

[hidden] {
    display: none !important;
}

@media (max-width: 1100px) {
    .section-tiles,
    .account-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .catalog-layout,
    .admin-layout,
    .version-form,
    .import-export,
    .detvolume-workbench,
    .techprep-history-grid,
    .backplot-workbench,
    .commerce-layout,
    .company-layout,
    .technology-hero,
    .technology-layout,
    .template-passport-layout,
    .passport-media {
        grid-template-columns: 1fr;
    }

    .detvolume-workbench {
        grid-template-rows: auto;
    }

    .detvolume-results {
        grid-column: 1;
    }

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

    .techprep-pricing {
        grid-column: 1 / -1;
    }

    .auth-panel {
        position: static;
        width: 100%;
        min-width: 0;
    }

    .backplot-workbench {
        height: auto;
        min-height: 0;
    }

    .backplot-code-pane {
        height: 680px;
        min-height: 680px;
    }

    .backplot-view-pane {
        height: 520px;
        min-height: 520px;
    }
}

@media (max-width: 760px) {
    .app-shell {
        padding: 10px;
    }

    .topbar,
    .hero-band,
    .technology-hero {
        grid-template-columns: 1fr;
    }

    .topnav {
        justify-content: stretch;
        width: 100%;
        overflow-x: auto;
    }

    .analytics-consent {
        align-items: stretch;
        flex-direction: column;
        gap: 14px;
    }

    .analytics-consent-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .nav-button {
        flex: 1 0 auto;
    }

    .hero-band {
        min-height: 300px;
        padding: 22px;
    }

    .technology-hero {
        min-height: 360px;
        padding: 22px;
    }

    .technology-hero h3 {
        font-size: 1.45rem;
        line-height: 1.16;
    }

    .technology-panel .panel-heading h2 {
        font-size: 1.18rem;
    }

    .company-requisites {
        grid-template-columns: 1fr;
    }

    .section-tiles,
    .account-grid,
    .filters,
    .detvolume-fields,
    .result-controls,
    .metric-grid,
    .tariff-grid,
    .legal-docs,
    .payment-methods,
    .seller-requisites,
    .passport-specs {
        grid-template-columns: 1fr;
    }

    .techprep-pricing,
    .techprep-auth-notice {
        grid-template-columns: 1fr;
    }

    .techprep-auth-notice-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .template-passport-hero {
        min-height: 240px;
        padding: 20px;
    }

    .panel-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .backplot-viewbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .view-buttons {
        justify-content: flex-start;
    }

    dl {
        grid-template-columns: 1fr;
    }
}
