.page-hero { padding: 20px 0; background: linear-gradient(to bottom, var(--bg-subtle), var(--bg)); border-bottom: 1px solid var(--line); }

.builder-form {
    display: flex; flex-direction: column; gap: 12px;
    margin-bottom: 24px; background: var(--surf); padding: 16px;
    border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--sh-card);
}
.builder-row {
    display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end;
}
.builder-row .filter-item { flex: 1 1 160px; min-width: 140px; }
.builder-row .filter-group { flex: 1 1 220px; min-width: 200px; }

.filter-item { display: flex; flex-direction: column; gap: 6px; }
.filter-item label,
.filter-group .fg-label {
    font-size: 11px; color: var(--tx-dim); text-transform: uppercase;
    font-weight: 600; letter-spacing: .04em;
}
.filter-item input,
.filter-item select,
.filter-group input {
    background: var(--bg);
    border: 1px solid var(--line);
    color: var(--tx);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 14px;
    width: 100%;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
    height: 38px;
    box-sizing: border-box;
}
.filter-item input:focus,
.filter-item select:focus,
.filter-group input:focus {
    border-color: var(--ac);
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }

.filter-group {
    display: flex; flex-direction: column; gap: 6px;
    background: transparent; padding: 0;
    border: none; border-radius: 0;
}
.filter-group .fg-outer-label {
    font-size: 11px; color: var(--tx-dim); text-transform: uppercase;
    font-weight: 600; letter-spacing: .04em;
    display: flex; align-items: center; gap: 4px;
}
.filter-group .fg-inputs { display: flex; gap: 6px; }
.filter-group input { min-width: 0; }

.hint-icon {
    font-size: 11px;
    color: var(--tx-dim);
    cursor: help;
    border-bottom: 1px dashed var(--tx-dim);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    line-height: 1;
    border-radius: 50%;
    background: var(--bg-subtle);
    position: relative;
    user-select: none;
}
.hint-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 20, 25, .95);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    padding: 8px 12px;
    border-radius: 6px;
    white-space: normal;
    max-width: 260px;
    min-width: 180px;
    text-align: left;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .15s ease, visibility .15s ease;
    z-index: 100;
    text-transform: none;
    letter-spacing: 0;
}
.hint-icon::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(15, 20, 25, .95);
    opacity: 0;
    visibility: hidden;
    transition: opacity .15s ease, visibility .15s ease;
    z-index: 100;
}
.hint-icon:hover::after,
.hint-icon:hover::before {
    opacity: 1;
    visibility: visible;
}

.btn-submit-wrap { flex: 0 0 auto; }

.table-custom { width: 100%; border-collapse: collapse; font-size: 13px; text-align: center; }
.table-custom th, .table-custom td { padding: 10px 8px; border-bottom: 1px solid var(--line-subtle); }
.table-custom th { background: var(--bg-subtle); color: var(--tx-muted); font-size: 12px; font-weight: 600; }
.table-custom tr:hover td { background: var(--bg-subtle); }

.result-panel {
    background: var(--surf); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 16px; box-shadow: var(--sh-card);
}
.result-panel h3 { font-size: 15px; font-weight: 700; margin: 0 0 12px; }
.result-split { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }
@media (max-width: 992px) { .result-split { grid-template-columns: 1fr; } }

.metric-box { display: flex; justify-content: space-between; padding: 8px 0; font-size: 13px; border-bottom: 1px dashed var(--line-subtle); gap: 12px; }
.metric-box:last-child { border-bottom: none; }
.metric-box .mlabel { color: var(--tx-muted); }
.metric-box .mvalue { font-family: 'JetBrains Mono', monospace; font-weight: 700; }

/* График банка */
.bank-chart-wrap {
    background: linear-gradient(135deg, var(--surf) 0%, var(--bg-subtle) 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius); padding: 16px;
    box-shadow: var(--sh-card); margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}
.bank-chart-wrap::before {
    content: '';
    position: absolute; top: -60px; right: -60px;
    width: 200px; height: 200px; border-radius: 50%;
    background: radial-gradient(circle, rgba(59,130,246,.12) 0%, transparent 70%);
    pointer-events: none;
}
.bank-chart-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 10px; gap: 12px; flex-wrap: wrap;
    position: relative; z-index: 1;
}
.bank-chart-head h2 {
    font-size: 15px; font-weight: 700; margin: 0; color: var(--tx);
    display: flex; align-items: center; gap: 8px;
}
.bank-chart-head h2 i { color: var(--ac); }
.bank-chart-head .bank-badge {
    font-size: 12px; font-family: 'JetBrains Mono', monospace;
    padding: 4px 10px; border-radius: 6px; font-weight: 700;
}
.bank-chart-head .bank-badge.positive { background: rgba(16,185,129,.12); color: #10b981; }
.bank-chart-head .bank-badge.negative { background: rgba(239,68,68,.12); color: #ef4444; }
.bank-chart-legend {
    display: flex; gap: 16px; flex-wrap: wrap;
    font-size: 11px; color: var(--tx-muted); margin-top: 10px;
    position: relative; z-index: 1;
}
.bank-chart-legend .legend-item { display: flex; align-items: center; gap: 6px; }
.bank-chart-legend .legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.bank-chart-legend .legend-dot.line { background: #3b82f6; }
.bank-chart-legend .legend-dot.positive { background: #10b981; }
.bank-chart-legend .legend-dot.negative { background: #ef4444; }
.bank-chart-legend .legend-dot.dashed { background: transparent; border: 1px dashed #94a3b8; }

.result-panel .table-custom a[href*="/team.php"],
.result-panel .table-custom a[href*="/tourney.php"] {
    transition: color .15s ease;
    color: var(--tx);
    text-decoration: none;
}
.result-panel .table-custom a[href*="/team.php"]:hover,
.result-panel .table-custom a[href*="/tourney.php"]:hover {
    color: var(--ac) !important;
}

.result-panel .table-custom a[href*="/tiraj.php"] {
    transition: color .15s ease;
}
.result-panel .table-custom a[href*="/tiraj.php"]:hover {
    color: #1d4ed8 !important;
}

@media (max-width: 768px) {
    .builder-form { padding: 12px; }
    .builder-row { flex-direction: column; align-items: stretch; }
    .builder-row .filter-item,
    .builder-row .filter-group,
    .builder-row .btn-submit-wrap { flex: 1 1 auto; width: 100%; }
    .result-split .table-custom { min-width: 900px; }
    .result-split .tbl-scroll-x { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
    .result-split .table-custom th,
    .result-split .table-custom td { padding: 8px 10px; font-size: 12px; white-space: nowrap; }
    .result-split .table-custom td a { white-space: nowrap; }
}