/* ========================================================================== */
/* MODEL GUIDE — подробная карточка выбранной генеративной модели             */
/* ========================================================================== */

.mode-header-info-btn[data-model-guide] {
    position: relative;
    gap: 0.48rem;
    min-height: 36px;
    padding: 0.48rem 0.82rem;
    border: 1px solid rgba(250, 191, 60, 0.72);
    background: linear-gradient(135deg, rgba(250, 191, 60, 0.18), rgba(250, 191, 60, 0.06));
    color: var(--primary, #fabf3c);
    box-shadow: 0 0 0 1px rgba(250, 191, 60, 0.05), 0 8px 22px rgba(0, 0, 0, 0.18);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: none;
    letter-spacing: 0.02em;
    overflow: hidden;
}

.mode-header-info-btn[data-model-guide]::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.16) 46%, transparent 72%);
    transform: translateX(-130%);
    transition: transform 0.6s ease;
}

.mode-header-info-btn[data-model-guide]:hover,
.mode-header-info-btn[data-model-guide]:focus-visible {
    border-color: var(--primary, #fabf3c);
    background: var(--primary, #fabf3c);
    color: #14110a;
    box-shadow: 0 0 28px rgba(250, 191, 60, 0.24);
    transform: translateY(-1px);
}

.mode-header-info-btn[data-model-guide]:hover::after {
    transform: translateX(130%);
}

.mode-header-info-btn[data-model-guide] i,
.mode-header-info-btn[data-model-guide] span {
    position: relative;
    z-index: 1;
}

.model-guide-modal {
    --mg-accent: #fabf3c;
    --mg-accent-rgb: 250, 191, 60;
}

.model-guide-modal [hidden] {
    display: none !important;
}

.model-guide-modal .modal-dialog {
    width: min(1180px, calc(100vw - 32px));
    max-width: none;
    max-height: calc(100dvh - 32px);
    margin: 16px auto;
}

.model-guide-shell {
    position: relative;
    max-height: calc(100dvh - 32px);
    overflow: hidden;
    border: 1px solid rgba(var(--mg-accent-rgb), 0.34);
    border-radius: 24px;
    background:
        radial-gradient(circle at 86% -10%, rgba(var(--mg-accent-rgb), 0.16), transparent 32%),
        linear-gradient(150deg, #181818 0%, #101010 58%, #0c0c0c 100%);
    color: #f7f7f7;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.68), 0 0 50px rgba(var(--mg-accent-rgb), 0.08);
}

.model-guide-modal .modal-dialog-scrollable .modal-content {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--mg-accent-rgb), 0.45) transparent;
}

.model-guide-close {
    position: sticky;
    z-index: 20;
    top: 16px;
    float: right;
    align-self: flex-end;
    width: 40px;
    height: 40px;
    margin: 16px 16px -56px 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 50%;
    background: rgba(8, 8, 8, 0.76);
    color: #fff;
    backdrop-filter: blur(12px);
    transition: 0.2s ease;
}

.model-guide-close:hover,
.model-guide-close:focus-visible {
    border-color: var(--mg-accent);
    color: var(--mg-accent);
    transform: rotate(5deg) scale(1.05);
}

.model-guide-loading,
.model-guide-missing {
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    color: #aaa;
}

.model-guide-missing {
    flex-direction: column;
    text-align: center;
}

.model-guide-missing > i {
    color: var(--mg-accent);
    font-size: 2rem;
}

.model-guide-missing h3,
.model-guide-missing p {
    margin: 0;
}

.model-guide-content {
    min-height: 520px;
}

.model-guide-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    min-height: 245px;
    padding: 42px 52px 34px;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.model-guide-hero::before {
    content: '';
    position: absolute;
    inset: auto 0 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(var(--mg-accent-rgb), 0.58), transparent);
}

.model-guide-hero__copy {
    position: relative;
    z-index: 2;
    align-self: center;
}

.model-guide-eyebrow {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 13px;
    color: var(--mg-accent);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.model-guide-eyebrow__dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 10px currentColor;
}

.model-guide-hero h2 {
    max-width: 760px;
    margin: 0 0 10px;
    color: #fff;
    font-size: clamp(2rem, 4.2vw, 4rem);
    font-weight: 800;
    line-height: 0.98;
    letter-spacing: -0.045em;
}

.model-guide-tagline {
    max-width: 760px;
    margin: 0;
    color: #b8b8b8;
    font-size: clamp(0.98rem, 1.6vw, 1.16rem);
    line-height: 1.55;
}

.model-guide-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
}

.model-guide-badges span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0.3rem 0.62rem;
    border: 1px solid rgba(var(--mg-accent-rgb), 0.28);
    border-radius: 999px;
    background: rgba(var(--mg-accent-rgb), 0.08);
    color: #e7e7e7;
    font-size: 0.74rem;
    font-weight: 700;
}

.model-guide-hero__mark {
    position: relative;
    display: grid;
    place-items: center;
}

.model-guide-hero__mark::before,
.model-guide-hero__mark::after {
    content: '';
    position: absolute;
    border: 1px solid rgba(var(--mg-accent-rgb), 0.22);
    border-radius: 50%;
}

.model-guide-hero__mark::before {
    width: 150px;
    height: 150px;
}

.model-guide-hero__mark::after {
    width: 112px;
    height: 112px;
    box-shadow: inset 0 0 35px rgba(var(--mg-accent-rgb), 0.08), 0 0 45px rgba(var(--mg-accent-rgb), 0.08);
}

.model-guide-hero__mark span {
    position: relative;
    z-index: 1;
    color: var(--mg-accent);
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: -0.08em;
    text-shadow: 0 0 28px rgba(var(--mg-accent-rgb), 0.38);
}

.model-guide-tabs {
    position: sticky;
    z-index: 10;
    top: 0;
    display: flex;
    gap: 6px;
    padding: 12px 52px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(14, 14, 14, 0.91);
    backdrop-filter: blur(16px);
}

.model-guide-tabs button {
    padding: 0.58rem 0.9rem;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #888;
    font-size: 0.8rem;
    font-weight: 800;
    transition: 0.2s ease;
}

.model-guide-tabs button:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.model-guide-tabs button.is-active {
    background: rgba(var(--mg-accent-rgb), 0.13);
    color: var(--mg-accent);
}

.model-guide-tabs button span {
    display: inline-grid;
    min-width: 19px;
    height: 19px;
    margin-left: 4px;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.65rem;
}

.model-guide-panel {
    display: none;
    padding: 30px 52px 42px;
}

.model-guide-panel.is-active {
    display: block;
    animation: modelGuideFade 0.22s ease;
}

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

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

.model-guide-main-card,
.model-guide-spec-card,
.model-guide-list-card {
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.025);
}

.model-guide-main-card h3,
.model-guide-spec-card h3,
.model-guide-list-card h3 {
    margin: 0;
    color: #f7f7f7;
    font-size: 0.96rem;
    font-weight: 800;
}

.model-guide-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 17px;
}

.model-guide-card-title > i {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 9px;
    background: rgba(var(--mg-accent-rgb), 0.12);
    color: var(--mg-accent);
    font-size: 0.78rem;
}

.model-guide-prose p {
    margin: 14px 0 0;
    color: #aaa;
    font-size: 0.88rem;
    line-height: 1.72;
}

.model-guide-prose p:first-child {
    margin-top: 16px;
}

.model-guide-specs {
    display: grid;
    gap: 0;
    margin: 0;
}

.model-guide-specs > div {
    display: grid;
    grid-template-columns: minmax(100px, 0.8fr) minmax(0, 1.2fr);
    gap: 14px;
    padding: 10px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.065);
}

.model-guide-specs > div:first-child {
    border-top: 0;
}

.model-guide-specs dt,
.model-guide-specs dd {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.45;
}

.model-guide-specs dt {
    color: #777;
}

.model-guide-specs dd {
    color: #ddd;
    font-weight: 700;
    text-align: right;
}

.model-guide-list-card {
    min-height: 210px;
}

.model-guide-list-card--accent {
    border-color: rgba(var(--mg-accent-rgb), 0.2);
    background: linear-gradient(145deg, rgba(var(--mg-accent-rgb), 0.07), rgba(255, 255, 255, 0.018));
}

.model-guide-list-card--warning {
    grid-column: 1 / -1;
    min-height: 0;
    border-color: rgba(255, 170, 82, 0.18);
    background: rgba(255, 150, 55, 0.035);
}

.model-guide-list-card--warning .model-guide-card-title > i {
    background: rgba(255, 156, 55, 0.1);
    color: #ffa24a;
}

.model-guide-list-card ul,
.model-guide-tips {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.model-guide-list-card li,
.model-guide-tips li {
    position: relative;
    padding-left: 18px;
    color: #aaa;
    font-size: 0.82rem;
    line-height: 1.55;
}

.model-guide-list-card li::before,
.model-guide-tips li::before {
    content: '';
    position: absolute;
    top: 0.65em;
    left: 0;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--mg-accent);
    box-shadow: 0 0 9px rgba(var(--mg-accent-rgb), 0.4);
}

.model-guide-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 22px;
}

.model-guide-section-heading span {
    color: var(--mg-accent);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.13em;
}

.model-guide-section-heading h3 {
    margin: 5px 0 0;
    color: #fff;
    font-size: 1.35rem;
}

.model-guide-section-heading p {
    max-width: 450px;
    margin: 0;
    color: #777;
    font-size: 0.78rem;
    line-height: 1.5;
    text-align: right;
}

.model-guide-examples {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.model-guide-example {
    position: relative;
    min-height: 210px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 14px;
    background: #080808;
}

.model-guide-example img,
.model-guide-example video {
    width: 100%;
    height: 100%;
    min-height: 210px;
    object-fit: cover;
}

.model-guide-example figcaption {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 34px 14px 12px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.92));
    color: #eaeaea;
    font-size: 0.75rem;
}

.model-guide-empty-examples {
    grid-column: 1 / -1;
    min-height: 270px;
    display: grid;
    place-items: center;
    padding: 32px;
    border: 1px dashed rgba(var(--mg-accent-rgb), 0.28);
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(var(--mg-accent-rgb), 0.035), transparent),
        repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255, 255, 255, 0.012) 10px, rgba(255, 255, 255, 0.012) 20px);
    color: #858585;
    text-align: center;
}

.model-guide-empty-examples i {
    display: block;
    margin-bottom: 12px;
    color: var(--mg-accent);
    font-size: 1.8rem;
}

.model-guide-empty-examples strong {
    display: block;
    margin-bottom: 6px;
    color: #d9d9d9;
}

.model-guide-empty-examples p {
    max-width: 520px;
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.6;
}

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

.model-guide-workflow {
    display: grid;
    gap: 14px;
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
    counter-reset: model-guide-step;
}

.model-guide-workflow li {
    position: relative;
    min-height: 34px;
    padding: 3px 0 0 46px;
    color: #aaa;
    font-size: 0.83rem;
    line-height: 1.55;
    counter-increment: model-guide-step;
}

.model-guide-workflow li::before {
    content: counter(model-guide-step, decimal-leading-zero);
    position: absolute;
    top: 0;
    left: 0;
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 1px solid rgba(var(--mg-accent-rgb), 0.28);
    border-radius: 9px;
    color: var(--mg-accent);
    font-size: 0.66rem;
    font-weight: 800;
}

.model-guide-tips {
    margin-top: 20px;
}

.model-guide-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 52px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.17);
}

.model-guide-footer p {
    margin: 0;
    color: #6f6f6f;
    font-size: 0.72rem;
}

.model-guide-footer p i {
    margin-right: 5px;
    color: var(--mg-accent);
}

.model-guide-footer a {
    flex: 0 0 auto;
    color: var(--mg-accent);
    font-size: 0.74rem;
    font-weight: 800;
    text-decoration: none;
}

.model-guide-footer a:hover {
    text-decoration: underline;
}

.model-guide-footer a i {
    margin-left: 4px;
    font-size: 0.66rem;
}

html[data-theme="light"] .model-guide-shell {
    background:
        radial-gradient(circle at 86% -10%, rgba(var(--mg-accent-rgb), 0.17), transparent 32%),
        linear-gradient(150deg, #ffffff 0%, #f6f6f4 70%, #efefec 100%);
    color: #171717;
    box-shadow: 0 28px 80px rgba(34, 31, 24, 0.28);
}

html[data-theme="light"] .model-guide-close {
    border-color: rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.8);
    color: #1b1b1b;
}

html[data-theme="light"] .model-guide-hero h2,
html[data-theme="light"] .model-guide-main-card h3,
html[data-theme="light"] .model-guide-spec-card h3,
html[data-theme="light"] .model-guide-list-card h3,
html[data-theme="light"] .model-guide-section-heading h3 {
    color: #171717;
}

html[data-theme="light"] .model-guide-tagline,
html[data-theme="light"] .model-guide-prose p,
html[data-theme="light"] .model-guide-list-card li,
html[data-theme="light"] .model-guide-tips li,
html[data-theme="light"] .model-guide-workflow li {
    color: #5f5f5f;
}

html[data-theme="light"] .model-guide-tabs {
    border-color: rgba(0, 0, 0, 0.08);
    background: rgba(249, 249, 247, 0.92);
}

html[data-theme="light"] .model-guide-tabs button:hover {
    color: #171717;
    background: rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .model-guide-main-card,
html[data-theme="light"] .model-guide-spec-card,
html[data-theme="light"] .model-guide-list-card {
    border-color: rgba(0, 0, 0, 0.09);
    background: rgba(255, 255, 255, 0.66);
}

html[data-theme="light"] .model-guide-specs > div {
    border-color: rgba(0, 0, 0, 0.07);
}

html[data-theme="light"] .model-guide-specs dd,
html[data-theme="light"] .model-guide-badges span,
html[data-theme="light"] .model-guide-empty-examples strong {
    color: #292929;
}

html[data-theme="light"] .model-guide-footer {
    border-color: rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.025);
}

@media (max-width: 820px) {
    .model-guide-modal .modal-dialog {
        width: min(100% - 16px, 1180px);
        max-height: calc(100dvh - 16px);
        margin: 8px auto;
    }

    .model-guide-shell {
        max-height: calc(100dvh - 16px);
        border-radius: 18px;
    }

    .model-guide-hero {
        grid-template-columns: 1fr;
        min-height: 0;
        padding: 38px 24px 28px;
    }

    .model-guide-hero__mark {
        display: none;
    }

    .model-guide-tabs {
        padding: 10px 18px;
        overflow-x: auto;
    }

    .model-guide-tabs button {
        flex: 0 0 auto;
    }

    .model-guide-panel {
        padding: 22px 18px 30px;
    }

    .model-guide-layout,
    .model-guide-howto-grid {
        grid-template-columns: 1fr;
    }

    .model-guide-list-card--warning {
        grid-column: auto;
    }

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

    .model-guide-section-heading,
    .model-guide-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .model-guide-section-heading p {
        text-align: left;
    }

    .model-guide-footer {
        padding: 17px 20px;
    }
}

@media (max-width: 520px) {
    .mode-header-info-btn[data-model-guide] {
        min-height: 32px;
        padding: 0.38rem 0.62rem;
        font-size: 0.7rem;
    }

    .model-guide-hero h2 {
        padding-right: 32px;
        font-size: 2rem;
    }

    .model-guide-examples {
        grid-template-columns: 1fr;
    }

    .model-guide-main-card,
    .model-guide-spec-card,
    .model-guide-list-card {
        padding: 19px;
    }

    .model-guide-specs > div {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .model-guide-specs dd {
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    .model-guide-panel.is-active,
    .mode-header-info-btn[data-model-guide]::after {
        animation: none;
        transition: none;
    }
}
