.shiny-input-container:not(.shiny-input-container-inline) {
    width: 100%;
}

.value-box-area {
    text-align: center;
}

/* ── Equation Results ──────────────────────────────────────────────────── */

/*
 * bslib's card uses `overflow: hidden` to clip content to rounded corners.
 * Our tooltip needs to extend above the card, so explicitly allow overflow
 * on this card and its body.
 */
.eq-results-card,
.eq-results-card > .card-body {
    overflow: visible;
}

.equation-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.eq-row {
    display: flex;
    align-items: stretch;
    gap: 0;
    width: 100%;
}

/* Cards: white, fixed 124px height, same shape for input + result */
.eq-card {
    flex: 1;
    min-width: 0;
    height: 124px;
    padding: 18px 22px 16px;
    background: #FFFFFF;
    border: 1px solid #E8E7E1;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}

.eq-card-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #AAAAAA;
    font-weight: 600;
}

.eq-card-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.eq-card-value {
    font-size: 26px;
    font-weight: 700;
    color: #1A1A1A;
    line-height: 1.1;
}

.eq-card-value.val-neutral { color: #1A1A1A; }

/* Value + pct subtitle group (tight vertical stack) */
.eq-card-primary {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Pct change subtitle — subtle tint based on direction of change */
.eq-card-pct {
    font-size: 11.5px;
    font-weight: 500;
    align-self: flex-start;
    padding: 1px 6px;
    border-radius: 4px;
}

.eq-card-pct.pct-up {
    color: #15803D;
    background: #F0FDF4;
}

.eq-card-pct.pct-down {
    color: #B91C1C;
    background: #FEF2F2;
}

/* Footer group: sig line + CI stacked with small gap */
.eq-card-footer {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.eq-card-spacer {
    /* Keeps input card height matched to result card (3 rows vs 4 rows) */
    display: block;
    min-height: 1em;
}

.eq-card-sig-line {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sig-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.sig-dot.sig-good    { background: #22C55E; }
.sig-dot.sig-neutral { background: #C8C8C0; }
.sig-dot.sig-amber   { background: #F59E0B; }

.sig-text {
    font-size: 11.5px;
    color: #6B6B6B;
}

.eq-card-ci {
    font-size: 11.5px;
    color: #AAAAAA;
}

/* Operators: plain text between cards, center-aligned, not stretched */
.eq-operator {
    flex: 0 0 auto;
    align-self: center;
    padding: 0 10px;
    font-size: 18px;
    font-weight: 300;
    color: #C8C8C0;
    user-select: none;
}

/* Info icon + tooltip */
.eq-info-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    font-size: 14px;
    line-height: 1;
}

.eq-info-icon-info {
    color: #8A8A8A;
}

/* Warning variant: amber triangle, drawn for attention */
.eq-info-icon-warning {
    color: #F59E0B;
}

.eq-tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    right: -10px;
    width: 252px;
    padding: 10px 12px;
    background: #1C1C1C;
    color: #FFFFFF;
    border-radius: 8px;
    text-align: left;
    z-index: 1000;
    transition: opacity 0.12s ease-out;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.eq-tooltip::after {
    content: "";
    position: absolute;
    right: 14px;
    border: 6px solid transparent;
}

/* Row 1 info icon: tooltip drops below the card (into the card body area) */
.eq-tooltip.tooltip-below {
    top: calc(100% + 10px);
}
.eq-tooltip.tooltip-below::after {
    bottom: 100%;
    border-bottom-color: #1C1C1C;
}

/* Row 2 info icon: tooltip rises above the card (into the gap above row 2) */
.eq-tooltip.tooltip-above {
    bottom: calc(100% + 10px);
}
.eq-tooltip.tooltip-above::after {
    top: 100%;
    border-top-color: #1C1C1C;
}

.eq-info-icon:hover .eq-tooltip,
.eq-info-icon:focus .eq-tooltip {
    visibility: visible;
    opacity: 1;
}

.eq-tooltip-header {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 4px;
    font-style: normal;
}

.eq-tooltip-body {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: #AAAAAA;
    line-height: 1.4;
    font-style: normal;
}

/* Meta row inside card_header: "Analysis results" + test type */
.eq-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.eq-test-type {
    font-size: 12px;
    font-weight: 500;
    color: #6B6B6B;
    text-transform: none;
}
