/* Alert affordability insight card — rendered by alert-insight.js from the
   /api/alert-insight entity. Themed entirely through --aw-* tokens (tokens.css
   owns light/dark). The funding-plan panel inside an option reuses the
   .affordability-plan styles in flight-table.css. */

.alert-insight-card {
    border: 1px solid var(--aw-hairline);
    border-radius: var(--aw-radius);
    background: var(--aw-elevated);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 640px;
}

.alert-insight-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--aw-hairline);
}

.alert-insight-route {
    margin: 0;
    font-weight: 650;
    color: var(--aw-ink);
    font-size: 0.98rem;
}

.alert-insight-alerted {
    margin: 0;
    color: var(--aw-ink-dim);
    font-size: 0.82rem;
}

/* Recommendation banner — the headline "book the cheaper way" line. */
.alert-insight-rec {
    margin: 0;
    padding: 9px 12px;
    border-radius: var(--aw-radius-sm);
    background: var(--aw-accent-tint);
    border-left: 3px solid var(--aw-accent);
    color: var(--aw-ink);
    font-size: 0.9rem;
    font-weight: 600;
}

.alert-insight-rec.needs-verify {
    /* An estimate-backed pick: same weight, but the border cues "not confirmed". */
    border-left-style: dashed;
}

.alert-insight-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.alert-insight-option {
    border: 1px solid var(--aw-hairline);
    border-left: 3px solid var(--aw-hairline-strong);
    border-radius: var(--aw-radius-sm);
    padding: 9px 11px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.alert-insight-option.is-reachable {
    border-left-color: var(--aw-good);
}

.alert-insight-option.is-out-of-reach {
    opacity: 0.72;
}

.alert-insight-option-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
}

.alert-insight-miles {
    font-weight: 700;
    color: var(--aw-ink);
    font-variant-numeric: tabular-nums;
}

.alert-insight-program {
    color: var(--aw-ink);
    font-size: 0.92rem;
}

/* When the program is a booking link (award/cash-table idiom). */
a.alert-insight-program {
    color: var(--aw-accent);
    text-decoration: none;
}

a.alert-insight-program:hover {
    text-decoration: underline;
}

a.alert-insight-program:focus-visible {
    outline: 2px solid var(--aw-accent);
    outline-offset: 2px;
    border-radius: 2px;
}

.alert-insight-taxes {
    margin-left: auto;
    color: var(--aw-ink-dim);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.alert-insight-unknown {
    font-style: italic;
    color: var(--aw-muted);
}

/* Confidence badge — Confirmed reads positive, Estimate stays neutral (never
   alarming, never over-claiming). */
.alert-insight-badge {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: var(--aw-radius-pill);
    line-height: 1.5;
}

.alert-insight-badge.is-confirmed {
    background: var(--aw-good-dim);
    color: var(--aw-good);
}

.alert-insight-badge.is-estimate {
    background: var(--aw-accent-tint);
    color: var(--aw-muted);
}

.alert-insight-verdict {
    margin: 0;
    color: var(--aw-ink-dim);
    font-size: 0.84rem;
}

/* Paste-an-alert panel (alert-paste.js), shown in the Alerts view. */
.alert-paste {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* width + auto side margins: without them this max-width-capped item
       resolves to flex-start in the stretch flex column (.alerts-view) and
       pins LEFT while .alerts-view-title and .alerts-view-body center their
       640px boxes with margin auto — the misalignment the owner flagged. */
    width: 100%;
    max-width: 640px;
    margin: 0 auto 16px;
}

.alert-paste-label {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--aw-ink);
}

.alert-paste-input {
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    min-height: 88px;
    padding: 10px 12px;
    border: 1px solid var(--aw-hairline-strong);
    border-radius: var(--aw-radius-sm);
    background: var(--aw-elevated);
    color: var(--aw-ink);
    font-family: var(--aw-font-sans, sans-serif);
    font-size: 0.88rem;
    line-height: 1.5;
}

.alert-paste-input:focus-visible {
    outline: 2px solid var(--aw-accent);
    outline-offset: 1px;
    border-color: var(--aw-accent);
}

.alert-paste-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-paste-btn {
    padding: 8px 16px;
    border: 0;
    border-radius: var(--aw-radius-pill);
    background: var(--aw-accent);
    color: var(--aw-on-accent);
    font-size: 0.88rem;
    font-weight: 650;
    cursor: pointer;
}

.alert-paste-btn:hover {
    background: var(--aw-accent-btn-hover, var(--aw-accent));
}

/* Secondary action (Check my inbox): outline variant, quieter than Analyze. */
.alert-paste-btn.is-secondary {
    background: transparent;
    color: var(--aw-accent);
    box-shadow: inset 0 0 0 1px var(--aw-accent);
}

.alert-paste-btn.is-secondary:hover {
    background: var(--aw-accent-soft, rgba(0, 0, 0, 0.04));
}

.alert-paste-btn:focus-visible {
    outline: 2px solid var(--aw-accent);
    outline-offset: 2px;
}

/* "Email me if affordable" — explicit per-use consent alongside the actions. */
.alert-paste-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--aw-ink-dim);
    cursor: pointer;
    user-select: none;
}

.alert-paste-check input {
    accent-color: var(--aw-accent);
    cursor: pointer;
}

.alert-paste-status {
    font-size: 0.82rem;
    color: var(--aw-ink-dim);
}

.alert-paste-status.is-warn {
    color: var(--aw-bad);
}

.alert-paste-status.is-ok {
    color: var(--aw-good);
}

.alert-paste-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 4px;
}
