/* ── HAR Analyzer ────────────────────────────────────────────────────── */
.tool-icon--har { background: linear-gradient(135deg, var(--accent), var(--cyan)); }

/* Drop zone */
.har-dropzone {
    border: 2px dashed var(--border2);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    transition: border-color .2s, background .2s;
    cursor: pointer;
    margin-top: 1.5rem;
}
.har-dropzone.drag-over {
    border-color: var(--accent);
    background: rgba(91,138,248,.06);
}
.har-dropzone__icon {
    font-size: 2.5rem;
    margin-bottom: .75rem;
}
.har-dropzone__text {
    color: var(--muted);
    margin-bottom: 1rem;
}
.har-dropzone__btn {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}
.har-dropzone__privacy {
    font-size: var(--fs-xs);
    color: var(--muted);
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
}

/* Summary cards */
.har-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}
.har-stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    text-align: center;
}
.har-stat__value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    font-family: var(--mono);
}
.har-stat__label {
    font-size: var(--fs-xs);
    color: var(--muted);
    margin-top: .3rem;
}

/* Resource type breakdown */
.har-types {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: .75rem;
    margin-bottom: 2rem;
}
.har-type {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
}
.har-type__count {
    font-size: 1.2rem;
    font-weight: 700;
    font-family: var(--mono);
}
.har-type__label {
    font-size: .75rem;
    color: var(--muted);
    margin-top: .25rem;
}
.har-type__size {
    font-size: .75rem;
    color: var(--muted2);
}

/* Waterfall */
.har-waterfall {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    overflow-x: auto;
    margin-bottom: 2rem;
}
.har-waterfall__title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}
.har-wf-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .35rem 0;
    border-bottom: 1px solid var(--border);
    font-size: .78rem;
}
.har-wf-row:last-child { border-bottom: none; }
.har-wf-name {
    width: 280px;
    min-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
    font-family: var(--mono);
    font-size: .72rem;
}
.har-wf-status {
    width: 40px;
    text-align: center;
    font-weight: 600;
    font-family: var(--mono);
}
.har-wf-status.s2xx { color: var(--green); }
.har-wf-status.s3xx { color: var(--yellow); }
.har-wf-status.s4xx { color: var(--red); }
.har-wf-status.s5xx { color: var(--red); }
.har-wf-bar-wrap {
    flex: 1;
    height: 16px;
    position: relative;
    background: var(--surface2);
    border-radius: 3px;
    overflow: hidden;
}
.har-wf-bar {
    position: absolute;
    top: 0;
    height: 100%;
    border-radius: 3px;
    min-width: 2px;
}
.har-wf-bar.phase-dns     { background: var(--cyan); }
.har-wf-bar.phase-connect { background: var(--green); }
.har-wf-bar.phase-ssl     { background: #7c60f5; }
.har-wf-bar.phase-wait    { background: var(--yellow); }
.har-wf-bar.phase-receive { background: var(--accent); }
.har-wf-bar.phase-blocked { background: var(--muted); }
.har-wf-time {
    width: 70px;
    text-align: right;
    font-family: var(--mono);
    color: var(--muted2);
    font-size: .72rem;
}

/* Waterfall legend */
.har-wf-legend {
    display: flex;
    gap: 1rem;
    margin-top: .75rem;
    flex-wrap: wrap;
}
.har-wf-legend__item {
    display: flex;
    align-items: center;
    gap: .3rem;
    font-size: .72rem;
    color: var(--muted);
}
.har-wf-legend__dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

/* Errors block */
.har-errors {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 2rem;
}
.har-errors__title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--red);
}
.har-err-row {
    display: flex;
    gap: .75rem;
    padding: .4rem 0;
    border-bottom: 1px solid var(--border);
    font-size: .78rem;
    align-items: center;
}
.har-err-row:last-child { border-bottom: none; }

/* Top heaviest/slowest */
.har-top {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 2rem;
}
.har-top__title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .har-summary { grid-template-columns: repeat(2, 1fr); }
    .har-wf-name { width: 160px; min-width: 160px; }
    .har-dropzone { padding: 2rem 1rem; }
}
@media (max-width: 480px) {
    .har-summary { grid-template-columns: 1fr 1fr; }
}
