.qi-tool {
    max-width: 1500px;
    margin-inline: auto;
}

.qi-public-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 1.25rem;
    background: linear-gradient(135deg, rgba(75, 47, 31, 0.96), rgba(35, 83, 71, 0.94));
    box-shadow: var(--daisy-shadow);
}

.qi-public-header .daisy-brand:hover,
.qi-public-header .daisy-brand:focus {
    color: #fff;
}

.qi-hero {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.qi-building-table th,
.qi-building-table td,
.qi-results-table th,
.qi-results-table td {
    white-space: nowrap;
}

.qi-building-table td {
    min-width: 8.5rem;
}

.qi-building-table td:nth-child(4) {
    min-width: 10rem;
}

.qi-building-name,
.qi-building-table th small {
    display: block;
}

.qi-building-table th small {
    color: var(--daisy-muted);
    font-size: 0.75rem;
    font-weight: 500;
}

.qi-alloy-badge.is-required {
    color: #fff;
    background: var(--daisy-copper);
}

.qi-alloy-badge.is-free {
    color: var(--daisy-olive);
    background: rgba(35, 83, 71, 0.12);
}

.qi-exact-switch {
    min-width: 9rem;
}

.qi-summary {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    height: 100%;
    padding: 1.35rem 1.5rem;
    border: 1px solid var(--daisy-border);
    border-radius: 1.35rem;
    background: rgba(255, 248, 239, 0.8);
}

.qi-summary.is-best {
    color: #fff;
    border-color: rgba(35, 83, 71, 0.35);
    background: linear-gradient(135deg, #235347, #337667);
}

.qi-summary.is-alloy-free {
    border-color: rgba(35, 83, 71, 0.28);
    background: linear-gradient(145deg, rgba(230, 243, 236, 0.95), rgba(255, 248, 239, 0.9));
}

.qi-summary small {
    color: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.72;
}

.qi-summary strong {
    font-family: 'Bree Serif', serif;
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    line-height: 1.1;
}

.qi-summary span {
    color: inherit;
    opacity: 0.72;
}

.qi-results-scroll {
    max-height: 66vh;
}

.qi-results-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8eee0;
    box-shadow: 0 1px 0 var(--daisy-border);
}

.qi-results-table tbody tr:first-child td {
    background: rgba(35, 83, 71, 0.1);
    font-weight: 700;
}

.qi-result-gain {
    color: var(--daisy-olive) !important;
    font-weight: 700;
}

@media (max-width: 767.98px) {
    .qi-public-header {
        align-items: flex-start;
    }

    .qi-public-header .daisy-brand small {
        display: none;
    }

    .qi-hero {
        grid-template-columns: 1fr;
    }

    .qi-hero .hero-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
