.analysis-filter-card {
    margin-bottom: 18px;
    padding: 22px;
}

.analysis-filters {
    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 1fr)) auto;
    gap: 14px;
    align-items: end;
}

.analysis-filters .filter-field {
    min-width: 0;
}

.analysis-filters .filter-field label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
}

.analysis-filters input,
.analysis-filters select {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--border-color-strong);
    border-radius: 10px;
    background: var(--bg-input);
    color: var(--text-primary);
    font: inherit;
}

.analysis-filters input:focus,
.analysis-filters select:focus {
    border-color: var(--accent-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.14);
}

.analysis-filters input:disabled {
    cursor: not-allowed;
    opacity: 0.68;
}

.analysis-submit {
    min-height: 46px;
    align-self: end;
    padding: 11px 24px;
}

.analysis-submit:disabled {
    cursor: wait;
    opacity: 0.7;
}

.analysis-filter-note {
    margin-top: 12px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.45;
}

.analysis-empty-state {
    padding: 54px 20px;
    text-align: center;
}

.analysis-empty-state .icon {
    margin-bottom: 12px;
    font-size: 44px;
}

.analysis-empty-state h2 {
    margin-bottom: 8px;
    font-size: 21px;
}

.analysis-empty-state p {
    color: var(--text-secondary);
    font-size: 15px;
}

.analysis-period-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(130px, 1fr));
    margin-bottom: 18px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-card);
    box-shadow: 0 8px 24px var(--shadow-color);
}

.analysis-period-strip > div {
    min-width: 0;
    padding: 16px;
    border-right: 1px solid var(--border-color);
    text-align: center;
}

.analysis-period-strip > div:last-child {
    border-right: 0;
}

.analysis-period-strip span,
.analysis-period-strip strong {
    display: block;
}

.analysis-period-strip span {
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 13px;
}

.analysis-period-strip strong {
    overflow-wrap: anywhere;
    font-size: 17px;
}

.analysis-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.analysis-metric-card {
    position: relative;
    min-width: 0;
    padding: 19px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-card);
    box-shadow: 0 8px 24px var(--shadow-color);
}

.analysis-metric-card::before {
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary));
    content: '';
}

.analysis-metric-card-head {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 13px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
}

.analysis-metric-main {
    display: block;
    overflow-wrap: anywhere;
    font-size: clamp(22px, 2vw, 30px);
    line-height: 1.15;
}

.analysis-metric-main-label {
    display: block;
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 12px;
}

.analysis-metric-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 17px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

.analysis-metric-details span,
.analysis-metric-details strong {
    display: block;
}

.analysis-metric-details span {
    margin-bottom: 4px;
    color: var(--text-secondary);
    font-size: 12px;
}

.analysis-metric-details strong {
    overflow-wrap: anywhere;
    font-size: 14px;
}

.analysis-variation {
    display: inline-flex;
    min-width: 70px;
    padding: 5px 8px;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.analysis-variation.positive {
    background: rgba(0, 184, 148, 0.14);
    color: #00a984;
}

.analysis-variation.negative {
    background: rgba(214, 48, 49, 0.14);
    color: #e25555;
}

.analysis-variation.neutral {
    background: var(--th-bg);
    color: var(--text-secondary);
}

.analysis-table-card {
    margin-bottom: 18px;
    padding: 0;
    overflow: hidden;
}

.analysis-card-header {
    padding: 20px 22px;
    border-bottom: 1px solid var(--border-color);
}

.analysis-card-header h3 {
    margin-bottom: 5px;
}

.analysis-card-header p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.4;
}

.analysis-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

.analysis-table th,
.analysis-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    text-align: right;
    vertical-align: middle;
    font-size: 14px;
}

.analysis-table thead th {
    background: var(--th-bg);
    color: var(--text-secondary);
    font-weight: 700;
    white-space: nowrap;
}

.analysis-table th:first-child,
.analysis-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 170px;
    background: var(--bg-secondary);
    text-align: left;
}

.analysis-table thead th:first-child {
    z-index: 2;
    background: var(--th-bg);
}

.analysis-table tbody tr:last-child th,
.analysis-table tbody tr:last-child td {
    border-bottom: 0;
}

.analysis-table tbody tr:hover th,
.analysis-table tbody tr:hover td {
    background: var(--row-hover);
}

.analysis-breakdown-table {
    min-width: 1120px;
}

.analysis-breakdown-table thead th span {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    font-weight: 500;
}

.analysis-breakdown-table td strong,
.analysis-breakdown-table td .analysis-share {
    display: block;
}

.analysis-breakdown-table td .analysis-share {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 12px;
}

.analysis-entity-platform {
    display: block;
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 400;
}

.analysis-no-data {
    padding: 35px !important;
    color: var(--text-secondary);
    text-align: center !important;
}

@media (max-width: 1200px) {
    .analysis-filters {
        grid-template-columns: repeat(3, minmax(180px, 1fr));
    }

    .analysis-submit {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 900px) {
    .analysis-metrics-grid {
        grid-template-columns: repeat(2, minmax(210px, 1fr));
    }

    .analysis-period-strip {
        grid-template-columns: repeat(3, minmax(130px, 1fr));
    }

    .analysis-period-strip > div {
        border-bottom: 1px solid var(--border-color);
    }
}

@media (max-width: 768px) {
    .analysis-filter-card {
        padding: 16px;
    }

    .analysis-filters,
    .analysis-metrics-grid,
    .analysis-period-strip {
        grid-template-columns: 1fr;
    }

    .analysis-period-strip > div {
        display: flex;
        gap: 14px;
        align-items: center;
        justify-content: space-between;
        border-right: 0;
        text-align: left;
    }

    .analysis-period-strip > div:last-child {
        border-bottom: 0;
    }

    .analysis-period-strip span {
        margin-bottom: 0;
        font-size: 14px;
    }

    .analysis-period-strip strong {
        text-align: right;
    }

    .analysis-metric-card {
        padding: 17px;
    }

    .analysis-card-header {
        padding: 17px;
    }

    .analysis-table th,
    .analysis-table td {
        padding: 12px;
    }
}

@media (max-width: 420px) {
    .analysis-metric-details {
        grid-template-columns: 1fr;
    }
}
