.advanced-analysis {
    margin-bottom: 26px;
}

.advanced-analysis > h2 {
    font-size: 20px;
    margin-bottom: 10px;
}

/* Quiet Luxury: чипсы, индикатор ожидания, золотая кнопка, прогресс. */
.chat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 10px;
    max-height: 120px;
    opacity: 1;
    overflow: hidden;
    transition: opacity 0.32s ease, max-height 0.32s ease, margin 0.32s ease;
}

.chat-chips.is-hidden {
    opacity: 0;
    max-height: 0;
    margin: 0;
    pointer-events: none;
}

.chat-chip {
    padding: 8px 14px;
    background: #11161d;
    color: #94a3b8;
    border: 1px solid #232b36;
    border-radius: 999px;
    font: 14px system-ui, sans-serif;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.chat-chip:hover {
    border-color: #94a3b8;
    background: #161c25;
}

.message-pending .message-content {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #9aa3ae;
}

.pending-dots {
    display: inline-flex;
    gap: 4px;
}

.pending-dots i {
    width: 7px;
    height: 7px;
    background: #94a3b8;
    border-radius: 50%;
    animation: pending-pulse 1.2s ease-in-out infinite;
}

.pending-dots i:nth-child(2) { animation-delay: 0.2s; }
.pending-dots i:nth-child(3) { animation-delay: 0.4s; }

@keyframes pending-pulse {
    0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}

.gold-button {
    margin-top: 12px;
    padding: 13px 24px;
    background: #f4f4f5;
    color: #0b0f14;
    border: 0;
    border-radius: 10px;
    font: 600 16px system-ui, sans-serif;
    cursor: pointer;
}

.gold-button:disabled {
    opacity: 0.6;
    cursor: wait;
}

.passport-progress-bar {
    height: 6px;
    margin-top: 10px;
    background: #232b36;
    border-radius: 999px;
    overflow: hidden;
}

.passport-progress-bar span {
    display: block;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, #4b5563, #94a3b8);
    border-radius: 999px;
    animation: passport-slide 1.6s ease-in-out infinite;
}

@keyframes passport-slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(260%); }
}

@media (prefers-reduced-motion: reduce) {
    .pending-dots i,
    .passport-progress-bar span {
        animation: none;
    }
}

.advanced-description {
    color: var(--muted, #a6afbf);
    font-size: 12px;
    line-height: 1.7;
}

.advanced-section {
    scroll-margin-top: 20px;
}

.advanced-section > summary {
    font-size: 14px;
}

.advanced-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.advanced-form > .check,
.advanced-form > button,
.advanced-form > .advanced-meta {
    grid-column: 1 / -1;
}

.advanced-form > button {
    justify-self: start;
}

.advanced-field {
    display: grid;
    gap: 8px;
}

.advanced-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
}

.advanced-actions select {
    width: auto;
    min-width: 220px;
    max-width: 100%;
}

.advanced-output {
    margin-top: 18px;
    overflow-wrap: anywhere;
}

.advanced-output:empty {
    display: none;
}

.advanced-meta {
    color: #94a5bf;
    font-size: 11px;
    line-height: 1.7;
}

.advanced-error {
    border: 1px solid #79434d;
    border-radius: 10px;
    padding: 13px 15px;
    background: #281a22;
    color: #ffc0c8;
    font-size: 13px;
}

.registry-record {
    margin: 12px 0;
    padding: 16px;
    border: 1px solid #2f3d53;
    border-radius: 12px;
    background: #111925;
}

.registry-record > p {
    margin: 10px 0 0;
    font-size: 13px;
    line-height: 1.75;
}

.registry-record h3 {
    margin: 0 0 12px;
    font-size: 16px;
}

.registry-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
}

.registry-heading > strong {
    color: #d7e4fb;
    font-size: 12px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.registry-status {
    display: inline-block;
    padding: 4px 8px;
    border: 1px solid #40516b;
    border-radius: 999px;
    color: #bacbe5;
    background: #182438;
    font-size: 10px;
    line-height: 1.4;
}

.status-matched {
    color: #b4e1cd;
    border-color: #3b6656;
    background: #152a23;
}

.status-needs_context {
    color: #e1cda8;
    border-color: #6b5b3f;
    background: #2a241b;
}

.status-unsupported,
.status-unknown {
    color: #c4bfd7;
    background: #242032;
    border-color: #534964;
}

.record-technical {
    margin-top: 12px;
    padding: 10px 0 0;
}

.record-technical summary {
    font-size: 11px;
    color: #91a2bc;
}

.record-technical pre {
    font-size: 10px;
}

.advanced-counts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    max-width: 420px;
    margin: 16px 0;
}

.advanced-count {
    min-height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    border: 1px solid #34435e;
    border-radius: 10px;
    padding: 10px 13px;
    background: #172235;
}

.advanced-count span {
    color: #93a5c0;
    font-size: 10px;
}

.advanced-count strong {
    color: #dbe7ff;
    font-size: 21px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.advanced-pair {
    margin: 8px 0;
    color: #b5c4da;
    font-size: 13px;
}

.advanced-pair strong {
    color: #e0e9f8;
    font-weight: 600;
}

@media (max-width: 650px) {
    .advanced-form {
        grid-template-columns: 1fr;
    }

    .advanced-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .advanced-actions select,
    .advanced-actions button {
        width: 100%;
    }

    .registry-record {
        padding: 13px;
    }
}

.paid-welcome {
    box-shadow: 0 0 0 2px rgba(140, 180, 255, .55);
    transition: box-shadow .6s ease;
}

.tool-result .human-block {
    border: 1px solid #2f3d53;
}

@media print {
    .advanced-analysis {
        display: none !important;
    }
}