/* ── Kontra Stats All [kontra_stats_all] ─────────────────── */
.kst-wrap {
    margin: 28px 0;
    padding: 22px 26px;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 14px;
    background: #fff;
    font-family: inherit;
}

/* ── Избор: публикация / двойка тагове ─────────────────── */
.kst-picker {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 16px;
}
.kst-picker-col { width: 100%; }

.kst-picker-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #50575e;
    margin-bottom: 6px;
}
.kst-selected-hint {
    text-transform: none;
    font-weight: 400;
    letter-spacing: 0;
    color: #888;
    font-size: 11px;
}

.kst-search-box { position: relative; }
.kst-search-input {
    width: 100%;
    padding: 9px 12px;
    font-size: 13px;
    border: 1px solid #d0d3d8;
    border-radius: 8px;
    box-sizing: border-box;
}
.kst-search-input:focus { outline: none; border-color: #0d47a1; }

.kst-search-results {
    position: absolute;
    z-index: 20;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #d0d3d8;
    border-radius: 8px;
    max-height: 240px;
    overflow-y: auto;
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
}
.kst-search-row {
    padding: 9px 12px;
    font-size: 13px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f1;
}
.kst-search-row:last-child { border-bottom: none; }
.kst-search-row:hover { background: #f0f6fc; color: #0d47a1; }
.kst-search-empty {
    padding: 10px 12px;
    font-size: 12px;
    color: #888;
}

.kst-no-pairs-hint {
    font-size: 12px;
    color: #888;
    margin: 8px 0 0;
}

.kst-pair-select-box {
    display: flex;
    gap: 8px;
}
.kst-pair-select-box select.kst-pair-select {
    flex: 1;
    padding: 9px 12px;
    font-size: 13px;
    line-height: 1.5;
    height: auto;
    min-height: 40px;
    border: 1px solid #d0d3d8;
    border-radius: 8px;
    box-sizing: border-box;
}
.kst-pair-select-box select.kst-pair-select:focus { outline: none; border-color: #c62828; }

/* ── Бутони ──────────────────────────────────────────────── */
.kst-btn {
    background: #f0f0f1;
    border: 1px solid #d0d3d8;
    color: #1d2327;
    border-radius: 8px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s, opacity .15s;
    white-space: nowrap;
}
.kst-btn:hover { background: #e5e5e6; }
.kst-btn-primary {
    background: linear-gradient(135deg, #0d47a1 0%, #6d1f6f 50%, #c62828 100%);
    color: #fff;
    border: none;
}
.kst-btn-primary:hover { opacity: .92; }
.kst-btn-primary:disabled { opacity: .4; cursor: default; }

/* ── Избрани елементи (chips) ───────────────────────────── */
.kst-selected { margin: 16px 0; }
.kst-selected-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #50575e;
    margin-bottom: 8px;
}
.kst-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}
.kst-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px 5px 10px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid;
}
.kst-chip-post { background: #e8f0fc; border-color: #c5d9f5; color: #0d47a1; }
.kst-chip-pair { background: #fde8e8; border-color: #f5c5c5; color: #c62828; }
.kst-chip-icon { font-size: 11px; }
.kst-chip-remove {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    color: inherit;
    padding: 0 2px;
}
.kst-chip-remove:hover { opacity: .6; }

.kst-empty-hint {
    font-size: 12px;
    color: #888;
    font-style: italic;
    margin: 0;
}

/* ── Действия ────────────────────────────────────────────── */
.kst-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}
.kst-actions .kst-btn {
    width: 100%;
    text-align: center;
}

.kst-loading {
    font-size: 13px;
    color: #646970;
    padding: 6px 0 14px;
}

/* ── Резултати / радиална графика ───────────────────────── */
.kst-results { margin-top: 10px; }

/* Layout: графика + номерирана легенда, легендата е ВИНАГИ под
   графиката (на всякакъв размер екран) */
.kst-chart-layout {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
}

.kst-chart-host {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
}
.kst-radial-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
}
.kst-radial-svg {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.kst-radial-grid {
    fill: none;
    stroke: #c7cbd1;
    stroke-width: 1;
    stroke-dasharray: 3 4;
}
.kst-radial-center {
    fill: #c3c4c7;
}
.kst-radial-axis {
    opacity: .95;
}
.kst-radial-polygon {
    fill: rgba(109, 31, 111, .12);
    stroke: #6d1f6f;
    stroke-width: 1.5;
    stroke-linejoin: round;
}
.kst-radial-polyline {
    fill: none;
    stroke: #6d1f6f;
    stroke-width: 1.5;
    stroke-dasharray: 4 3;
}
.kst-radial-marker {
    stroke: #fff;
    stroke-width: 1.2;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.25));
}
.kst-radial-marker-empty {
    stroke-dasharray: 2 2;
}

/* Номерирани значки на осите – HTML (не SVG), фиксиран размер,
   винаги видими на графиката, на всякакъв размер екран */
.kst-radial-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.kst-radial-overlay-label {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: none;
}
.kst-radial-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1d2327;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0,0,0,.3);
    flex-shrink: 0;
}

.kst-radial-pct-label {
    position: absolute;
    transform: translate(-50%, -50%);
    font-size: 9px;
    font-weight: 600;
    color: #c7cbd1;
    background: rgba(255,255,255,.85);
    padding: 0 3px;
    border-radius: 4px;
    line-height: 1.3;
    pointer-events: none;
    white-space: nowrap;
}

/* Легенда – винаги видима, под графиката, номерирана в съответствие
   с номерата на значките върху графиката */
.kst-radial-legend {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 460px;
}
.kst-radial-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 2px;
    border-bottom: 1px solid #f0f0f1;
}
.kst-radial-legend-item:last-child { border-bottom: none; }
.kst-radial-legend-num {
    /* стилът идва от .kst-radial-badge; тук само подравняваме в реда */
    margin-top: 0;
}
.kst-radial-legend-swatch {
    flex-shrink: 0;
    width: 20px;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, #0d47a1, #888888, #c62828);
}
.kst-radial-legend-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.kst-radial-legend-title {
    font-size: 13px;
    font-weight: 700;
    color: #1d2327;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.kst-radial-legend-title a { color: inherit; text-decoration: none; }
.kst-radial-legend-title a:hover { color: #0d47a1; }
.kst-radial-legend-tags {
    font-size: 12px;
    color: #646970;
}
.kst-radial-legend-tag-a { color: #0d47a1; font-weight: 600; }
.kst-radial-legend-tag-b { color: #c62828; font-weight: 600; }

.kst-chart-caption {
    font-size: 12px;
    color: #646970;
    font-style: italic;
    text-align: center;
    margin: 10px 0 18px;
}

.kst-details {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}
.kst-detail-card {
    border: 1px solid #e2e4e7;
    border-left: 4px solid #888;
    border-radius: 8px;
    padding: 10px 14px;
    background: #fafafa;
}
.kst-detail-title {
    font-size: 13px;
    font-weight: 700;
    color: #1d2327;
    margin-bottom: 4px;
}
.kst-detail-title a { color: inherit; text-decoration: none; }
.kst-detail-title a:hover { color: #0d47a1; }
.kst-detail-badge {
    font-weight: 500;
    font-size: 11px;
    color: #646970;
}
.kst-detail-meta {
    font-size: 12px;
    color: #646970;
}
.kst-detail-avg { font-weight: 700; }
.kst-detail-avg-empty { font-style: italic; font-weight: 400; }

.kst-no-data {
    font-size: 13px;
    color: #888;
    font-style: italic;
}

/* ── Гост (немотиден в системата) ───────────────────────── */
.kst-wrap-guest {
    text-align: center;
    padding: 26px;
}
.kst-guest-msg {
    margin: 0;
    font-size: 13px;
    color: #50575e;
}
.kst-guest-msg a {
    color: #2271b1;
    font-weight: 600;
    margin-left: 4px;
}
