﻿.bills-page-heading {
    align-items: center;
}

.bills-heading-summary {
    display: grid;
    grid-template-columns: auto auto 1px auto auto;
    align-items: center;
    gap: 8px;
    padding: 12px 15px;
    border: 1px solid var(--bw-border);
    border-radius: 14px;
    background: var(--bw-surface-soft);
    color: var(--bw-text-muted);
    font-size: 0.67rem;
    white-space: nowrap;
}

    .bills-heading-summary strong {
        color: var(--bw-text);
        font-size: 0.82rem;
    }

.summary-divider {
    width: 1px;
    height: 18px;
    margin: 0 5px;
    background: var(--bw-border);
}

.bill-filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.bill-filter {
    min-height: 36px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--bw-border);
    border-radius: 11px;
    background: var(--bw-surface-soft);
    color: var(--bw-text-muted);
    font-size: 0.7rem;
    font-weight: 680;
    cursor: pointer;
    transition: color 150ms ease, background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

    .bill-filter:hover {
        color: var(--bw-text);
        border-color: var(--bw-border-strong);
        transform: translateY(-1px);
    }

    .bill-filter.active {
        border-color: rgba(83, 108, 242, 0.28);
        background: rgba(83, 108, 242, 0.12);
        color: #8ba0ff;
    }

    .bill-filter span {
        min-width: 19px;
        padding: 2px 5px;
        border-radius: 999px;
        background: rgba(100, 120, 170, 0.09);
        text-align: center;
        font-size: 0.58rem;
    }

.bill-card-grid {
    display: grid;
    grid-template-columns: repeat( 3, minmax(0, 1fr));
    gap: 15px;
}

.bill-card {
    min-height: 260px;
    padding: 21px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--bw-border);
    border-radius: 20px;
    background: var(--bw-surface-soft);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.07);
    color: inherit;
    text-decoration: none;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

    .bill-card:hover {
        color: inherit;
        transform: translateY(-3px);
        border-color: var(--bw-border-strong);
        background: var(--bw-surface-hover);
        box-shadow: 0 20px 55px rgba(0, 0, 0, 0.11);
    }

.bill-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
}

.bill-provider {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
}

.bill-provider-avatar,
.detail-provider-avatar {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    background: rgba(80, 105, 240, 0.12);
    color: #879aff;
    font-weight: 800;
}

.bill-provider-avatar {
    width: 39px;
    height: 39px;
    border-radius: 12px;
    font-size: 0.75rem;
}

.bill-provider h2 {
    overflow: hidden;
    margin: 0;
    color: var(--bw-text);
    font-size: 0.84rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bill-provider > div:last-child {
    min-width: 0;
}

.bill-provider span {
    display: block;
    margin-top: 3px;
    color: var(--bw-text-subtle);
    font-size: 0.62rem;
}

.watching-state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--bw-text-muted);
    font-size: 0.6rem;
    font-weight: 700;
}

    .watching-state > span {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: #38b878;
        box-shadow: 0 0 0 4px rgba(56, 184, 120, 0.09);
    }

.bill-current {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
}

    .bill-current span {
        color: var(--bw-text-subtle);
        font-size: 0.62rem;
    }

    .bill-current strong {
        margin-top: 4px;
        color: var(--bw-text);
        font-size: 1.75rem;
        line-height: 1;
        letter-spacing: -0.055em;
    }

.bill-change-panel {
    margin-top: 20px;
    padding: 12px 13px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    border-radius: 13px;
}

    .bill-change-panel > div {
        display: flex;
        flex-direction: column;
    }

    .bill-change-panel span {
        color: var(--bw-text-muted);
        font-size: 0.58rem;
    }

    .bill-change-panel strong {
        margin-top: 3px;
        font-size: 0.73rem;
    }

    .bill-change-panel.increase {
        background: rgba(222, 81, 72, 0.08);
    }

        .bill-change-panel.increase strong {
            color: #e2746c;
        }

    .bill-change-panel.decrease {
        background: rgba(55, 179, 116, 0.08);
    }

        .bill-change-panel.decrease strong {
            color: #48b77d;
        }

    .bill-change-panel.steady {
        background: rgba(100, 120, 170, 0.07);
    }

        .bill-change-panel.steady strong {
            color: var(--bw-text-secondary);
        }

.bill-history-state {
    margin-top: 20px;
    padding: 12px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border-radius: 12px;
    background: rgba(100, 120, 170, 0.055);
    color: var(--bw-text-muted);
    font-size: 0.63rem;
    line-height: 1.5;
}

.history-dot {
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    margin-top: 4px;
    border-radius: 50%;
    background: #7484d7;
}

.bill-card-footer {
    margin-top: auto;
    padding-top: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #8297ff;
    font-size: 0.65rem;
    font-weight: 700;
}

.filtered-empty {
    padding: 35px;
    border: 1px dashed var(--bw-border);
    border-radius: 17px;
    color: var(--bw-text-muted);
    text-align: center;
    font-size: 0.75rem;
}

.bill-card-skeleton,
.detail-heading-skeleton,
.detail-panel-skeleton {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--bw-border);
    background: var(--bw-surface-soft);
}

.bill-card-skeleton {
    height: 260px;
    border-radius: 20px;
}

    .bill-card-skeleton::after,
    .detail-heading-skeleton::after,
    .detail-panel-skeleton::after {
        content: "";
        position: absolute;
        inset: 0;
        transform: translateX(-100%);
        background: linear-gradient( 90deg, transparent, rgba(130, 150, 200, 0.07), transparent);
        animation: billwatch-detail-shimmer 1.5s infinite;
    }

@keyframes billwatch-detail-shimmer {
    100% {
        transform: translateX(100%);
    }
}


/* Detail */

.detail-back {
    width: fit-content;
    color: var(--bw-text-muted);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 680;
}

    .detail-back:hover {
        color: var(--bw-text);
    }

.bill-detail-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    padding-bottom: 8px;
}

.bill-detail-provider {
    display: flex;
    align-items: center;
    gap: 16px;
}

.detail-provider-avatar {
    width: 58px;
    height: 58px;
    border-radius: 17px;
    font-size: 1rem;
}

.bill-detail-provider h1 {
    margin: 5px 0 8px;
    color: var(--bw-text);
    font-size: clamp( 2rem, 5vw, 3.1rem);
    line-height: 0.98;
    letter-spacing: -0.06em;
}

.detail-status-line {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--bw-text-subtle);
    font-size: 0.63rem;
}

.current-bill-amount {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

    .current-bill-amount > span {
        color: var(--bw-text-subtle);
        font-size: 0.63rem;
    }

    .current-bill-amount > strong {
        margin-top: 4px;
        color: var(--bw-text);
        font-size: clamp( 2rem, 5vw, 3.15rem);
        line-height: 1;
        letter-spacing: -0.065em;
    }

.detail-amount-difference {
    margin-top: 7px;
    font-size: 0.65rem;
}

    .detail-amount-difference.increase {
        color: #e2746c;
    }

    .detail-amount-difference.decrease {
        color: #48b77d;
    }

    .detail-amount-difference.steady {
        color: var(--bw-text-muted);
    }

.detected-change-card {
    padding: 24px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 30px;
    border: 1px solid var(--bw-border);
    border-radius: 21px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.07);
}

    .detected-change-card.increase {
        background: linear-gradient( 145deg, rgba(196, 72, 65, 0.10), var(--bw-surface-soft));
    }

    .detected-change-card.decrease {
        background: linear-gradient( 145deg, rgba(47, 164, 102, 0.10), var(--bw-surface-soft));
    }

    .detected-change-card.steady {
        background: var(--bw-surface-soft);
    }

.change-eyebrow {
    margin-bottom: 13px;
    color: var(--bw-text-muted);
    text-transform: uppercase;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.09em;
}

.detected-change-values {
    display: flex;
    align-items: center;
    gap: 20px;
}

    .detected-change-values > div {
        display: flex;
        flex-direction: column;
    }

    .detected-change-values span {
        color: var(--bw-text-muted);
        font-size: 0.61rem;
    }

    .detected-change-values strong {
        margin-top: 3px;
        color: var(--bw-text);
        font-size: 1.45rem;
        letter-spacing: -0.045em;
    }

.detail-arrow {
    color: var(--bw-text-subtle) !important;
    font-size: 1.1rem !important;
}

.change-impact-stack {
    min-width: 210px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

    .change-impact-stack > div {
        padding: 12px;
        display: flex;
        flex-direction: column;
        border: 1px solid var(--bw-border);
        border-radius: 12px;
        background: rgba(10, 15, 27, 0.08);
    }

    .change-impact-stack span {
        color: var(--bw-text-muted);
        font-size: 0.57rem;
    }

    .change-impact-stack strong {
        margin-top: 3px;
        color: var(--bw-text);
        font-size: 0.78rem;
    }

.detail-panel {
    padding: 24px;
    border: 1px solid var(--bw-border);
    border-radius: 20px;
    background: var(--bw-surface-soft);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.06);
}

.explanation-panel {
    display: block;
}

.change-description {
    max-width: 800px;
    margin: 8px 0 22px;
    color: var(--bw-text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
}

.confidence-pill {
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 0.6rem;
    font-weight: 750;
}

    .confidence-pill.confirmed {
        background: rgba(52, 179, 115, 0.11);
        color: #4fbd83;
    }

    .confidence-pill.inferred {
        background: rgba(226, 166, 60, 0.11);
        color: #d6a44e;
    }

    .confidence-pill.unknown {
        background: rgba(100, 120, 170, 0.09);
        color: var(--bw-text-muted);
    }

.evidence-metadata {
    padding-top: 17px;
    display: grid;
    grid-template-columns: repeat( 3, minmax(0, 1fr));
    gap: 14px;
    border-top: 1px solid var(--bw-border);
}

    .evidence-metadata > div {
        display: flex;
        flex-direction: column;
    }

    .evidence-metadata span {
        color: var(--bw-text-subtle);
        font-size: 0.58rem;
    }

    .evidence-metadata strong {
        margin-top: 4px;
        color: var(--bw-text-secondary);
        font-size: 0.69rem;
    }

.no-explanation-panel {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.no-change-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: rgba(94, 117, 230, 0.1);
    color: #8297ff;
    font-weight: 800;
}

.no-explanation-panel h2 {
    margin: 5px 0 7px;
    color: var(--bw-text);
    font-size: 1rem;
}

.no-explanation-panel p {
    max-width: 680px;
    margin: 0;
    color: var(--bw-text-muted);
    font-size: 0.73rem;
    line-height: 1.6;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat( 2, minmax(0, 1fr));
    gap: 17px;
}

.panel-count {
    min-width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: rgba(100, 120, 170, 0.08);
    color: var(--bw-text-muted);
    font-size: 0.62rem;
    font-weight: 750;
}

.detail-empty {
    min-height: 170px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--bw-text-muted);
    text-align: center;
}

    .detail-empty strong {
        color: var(--bw-text-secondary);
        font-size: 0.76rem;
    }

    .detail-empty span {
        max-width: 350px;
        margin-top: 7px;
        font-size: 0.66rem;
        line-height: 1.55;
    }

.statement-list,
.change-history-list {
    display: grid;
}

.statement-row {
    min-height: 68px;
    padding: 10px 2px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    border-top: 1px solid var(--bw-border);
}

.statement-date-icon {
    width: 42px;
    height: 42px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: rgba(82, 108, 240, 0.09);
}

    .statement-date-icon span {
        color: #8498ff;
        font-size: 0.5rem;
        font-weight: 800;
    }

    .statement-date-icon strong {
        margin-top: 1px;
        color: var(--bw-text-secondary);
        font-size: 0.72rem;
    }

.statement-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

    .statement-info strong {
        color: var(--bw-text-secondary);
        font-size: 0.71rem;
    }

    .statement-info span {
        overflow: hidden;
        margin-top: 3px;
        color: var(--bw-text-subtle);
        font-size: 0.58rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.statement-amount {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

    .statement-amount strong {
        color: var(--bw-text);
        font-size: 0.74rem;
    }

    .statement-amount span {
        margin-top: 3px;
        color: var(--bw-text-subtle);
        font-size: 0.52rem;
    }

.change-history-row {
    min-height: 90px;
    padding: 13px 2px;
    display: grid;
    grid-template-columns: 4px minmax(0, 1fr);
    gap: 12px;
    border-top: 1px solid var(--bw-border);
}

.change-history-indicator {
    width: 4px;
    border-radius: 99px;
}

    .change-history-indicator.increase {
        background: #d8665f;
    }

    .change-history-indicator.decrease {
        background: #42ad76;
    }

    .change-history-indicator.steady {
        background: #69768b;
    }

.change-history-copy {
    min-width: 0;
}

.change-history-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

    .change-history-heading strong {
        color: var(--bw-text-secondary);
        font-size: 0.7rem;
    }

    .change-history-heading span {
        color: var(--bw-text-subtle);
        font-size: 0.55rem;
    }

.change-history-copy p {
    margin: 5px 0 8px;
    color: var(--bw-text-muted);
    font-size: 0.64rem;
    line-height: 1.5;
}

.change-history-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

    .change-history-meta span {
        padding: 4px 7px;
        border-radius: 7px;
        background: rgba(100, 120, 170, 0.065);
        color: var(--bw-text-muted);
        font-size: 0.54rem;
    }

.detail-loading {
    display: grid;
    gap: 18px;
}

.detail-heading-skeleton {
    height: 130px;
    border-radius: 20px;
}

.detail-panel-skeleton {
    height: 350px;
    border-radius: 20px;
}

@media (max-width: 1050px) {
    .bill-card-grid {
        grid-template-columns: repeat( 2, minmax(0, 1fr));
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .bills-page-heading,
    .bill-detail-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .bills-heading-summary {
        width: 100%;
        box-sizing: border-box;
        justify-content: start;
    }

    .current-bill-amount {
        align-items: flex-start;
    }

    .detected-change-card {
        grid-template-columns: 1fr;
    }

    .change-impact-stack {
        min-width: 0;
    }

    .evidence-metadata {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .bill-card-grid {
        grid-template-columns: 1fr;
    }

    .bill-card {
        min-height: 245px;
    }

    .bill-filter-bar {
        display: grid;
        grid-template-columns: repeat( 2, 1fr);
    }

    .bill-filter {
        justify-content: space-between;
    }

    .bill-detail-provider {
        align-items: flex-start;
    }

    .detail-provider-avatar {
        width: 48px;
        height: 48px;
        border-radius: 14px;
    }

    .detected-change-values {
        gap: 11px;
    }

        .detected-change-values strong {
            font-size: 1.15rem;
        }

    .change-impact-stack {
        grid-template-columns: 1fr;
    }

    .statement-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .statement-amount {
        grid-column: 2;
        align-items: flex-start;
        margin-top: -7px;
    }

    .change-history-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }
}
