.relationship-card {
    display: grid;
    gap: 14px;
    margin-top: 16px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 14px 30px rgba(24, 50, 58, 0.08);
}

.relationship-top,
.relationship-meta,
.relationship-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.relationship-kicker {
    margin: 0 0 2px;
    color: var(--teal-deep);
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
}

.relationship-top h2 {
    margin: 0;
    font-size: 1.05rem;
}

.relationship-level {
    display: grid;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    color: var(--control-contrast);
    background: var(--violet);
    text-align: center;
    place-content: center;
}

.relationship-level span {
    font-size: 0.58rem;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
}

.relationship-level strong {
    font-size: 1rem;
    line-height: 1.15;
}

.relationship-meter {
    overflow: hidden;
    height: 8px;
    border-radius: 999px;
    background: var(--surface-muted);
}

.relationship-meter > span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--teal), var(--coral));
    transition: width 180ms ease;
}

.relationship-meta {
    color: var(--ink-soft);
    font-size: 0.72rem;
    font-weight: 750;
}

.relationship-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: 8px;
}

.relationship-stats span {
    min-width: 0;
    padding: 10px 8px;
    color: var(--ink-soft);
    font-size: 0.68rem;
    text-align: center;
}

.relationship-stats span + span {
    border-left: 1px solid var(--line);
}

.relationship-stats strong {
    display: block;
    color: var(--ink);
    font-size: 0.95rem;
}

.relationship-milestones {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
}

.relationship-milestones span {
    padding: 6px 4px;
    border-radius: 6px;
    color: var(--ink-soft);
    background: var(--surface-muted);
    font-size: 0.58rem;
    font-weight: 800;
    text-align: center;
}

.relationship-milestones span.is-unlocked {
    color: var(--teal-ink);
    background: var(--teal-soft);
}

.relationship-gift-button {
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid color-mix(in srgb, var(--coral) 54%, var(--line));
    border-radius: 7px;
    color: var(--danger-ink);
    background: var(--danger-soft);
    font: inherit;
    font-size: 0.76rem;
    font-weight: 850;
    cursor: pointer;
}

.relationship-gift-button:hover {
    border-color: var(--coral);
    background: var(--danger-soft-strong);
}

.relationship-actions > span {
    min-width: 0;
    overflow: hidden;
    color: var(--ink-soft);
    font-size: 0.7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.relationship-unlocks,
.relationship-history {
    color: var(--ink-soft);
    font-size: 0.74rem;
}

.relationship-unlocks:empty,
.relationship-history:empty {
    display: none;
}

.rel-unlock-list,
.rel-history-list {
    display: grid;
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.rel-unlock-list li,
.rel-history-list li {
    padding: 8px 10px;
    border-radius: 6px;
    background: var(--surface-muted);
}

.rel-history-empty {
    margin: 0;
}

.relationship-unlocks,
.relationship-history {
    display: grid;
    gap: 0;
}

.rel-unlock {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    grid-template-areas:
        "level title"
        "level note";
    align-items: center;
    gap: 2px 9px;
    min-width: 0;
    padding: 9px 0;
    border-top: 1px solid var(--line);
}

.rel-unlock:first-child {
    border-top: 0;
}

.rel-unlock > span {
    grid-area: level;
    display: grid;
    width: 38px;
    height: 34px;
    border-radius: 6px;
    color: var(--ink-soft);
    background: var(--surface-muted);
    font-size: 0.62rem;
    font-weight: 900;
    place-items: center;
}

.rel-unlock > strong {
    grid-area: title;
    min-width: 0;
    color: var(--ink);
    font-size: 0.76rem;
    line-height: 1.25;
}

.rel-unlock > small {
    grid-area: note;
    min-width: 0;
    color: var(--ink-soft);
    font-size: 0.68rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.rel-unlock.is-unlocked > span {
    color: var(--control-contrast);
    background: var(--teal-deep);
}

.relationship-history h3 {
    margin: 8px 0 2px;
    font-size: 0.82rem;
}

.rel-history-item {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 9px 0;
    border-top: 1px solid var(--line);
}

.rel-history-item > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.rel-history-item strong {
    color: var(--ink);
    font-size: 0.74rem;
}

.rel-history-item small {
    flex: 0 0 auto;
    color: var(--ink-soft);
    font-size: 0.64rem;
}

.rel-history-item p {
    margin: 0;
    color: var(--ink-soft);
    line-height: 1.45;
}

.vgf-modal-open {
    overflow: hidden;
}

.vgf-modal-overlay {
    position: fixed;
    z-index: 120;
    inset: 0;
    display: grid;
    overflow-y: auto;
    padding: 24px;
    background: rgba(15, 27, 32, 0.62);
    place-items: center;
}

.vgf-modal {
    width: min(760px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 24px 70px rgba(15, 27, 32, 0.3);
}

.vgf-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.vgf-modal-head h2 {
    margin: 0;
    font-size: 1.25rem;
}

.vgf-modal-head button {
    display: grid;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--ink);
    background: var(--surface-muted);
    cursor: pointer;
    place-items: center;
}

.vgf-modal-head svg {
    width: 18px;
    height: 18px;
}

.vgf-modal-copy {
    margin: 10px 0 18px;
    color: var(--ink-soft);
}

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

.vgf-gift-option {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: var(--surface-soft);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.vgf-gift-option:hover {
    border-color: var(--teal);
    background: var(--teal-soft);
}

.vgf-gift-icon {
    display: grid;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--teal-soft) 38%, var(--surface));
    place-items: center;
}

.vgf-gift-icon img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.vgf-gift-copy {
    display: grid;
    min-width: 0;
}

.vgf-gift-copy strong {
    font-size: 0.85rem;
}

.vgf-gift-copy small {
    overflow: hidden;
    color: var(--ink-soft);
    font-size: 0.68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vgf-gift-meta {
    display: grid;
    justify-items: end;
    gap: 2px;
    font-size: 0.64rem;
}

.vgf-gift-meta i {
    color: var(--danger-ink);
    font-style: normal;
}

.vgf-gift-meta b {
    color: var(--teal-deep);
}

.vgf-gift-meta em {
    color: var(--ink-soft);
    font-style: normal;
}

.vgf-gift-response {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 4px 14px;
    align-items: center;
}

.vgf-gift-response > .vgf-gift-icon {
    grid-row: span 2;
    width: 54px;
    height: 54px;
}

.vgf-gift-response > .vgf-gift-icon img {
    width: 34px;
    height: 34px;
}

.vgf-gift-response strong {
    font-size: 1.05rem;
}

.vgf-gift-response p {
    grid-column: 1 / -1;
    margin: 14px 0;
    color: var(--ink-soft);
}

.vgf-gift-result {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 7px;
    background: var(--teal-soft);
}

.vgf-gift-result small {
    color: var(--teal-ink);
}

.vgf-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.vgf-modal-fine {
    margin: 14px 0 0;
    color: var(--ink-soft);
    font-size: 0.68rem;
}

@media (max-width: 680px) {
    .relationship-milestones {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .vgf-modal-overlay {
        align-items: end;
        padding: 12px;
    }

    .vgf-modal {
        max-height: calc(100vh - 24px);
        padding: 18px;
    }

    .vgf-gift-grid {
        grid-template-columns: 1fr;
    }

    .vgf-gift-option {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .vgf-gift-meta {
        grid-column: 2;
        grid-auto-flow: column;
        justify-content: start;
    }
}
