/**
 * QOO Dashboard Yield module.
 * Kept separate from core dashboard styles for independent maintenance.
 */

.qoo-yield-sidebar-label {
    margin-top: 20px;
}

.qoo-yield-panel {
    padding-bottom: 36px;
}

.qoo-yield-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: 28px 30px;
    overflow: hidden;
    border: 1px solid rgba(21, 150, 111, .17);
    border-radius: 22px;
    background:
        radial-gradient(circle at 95% 4%, rgba(21, 150, 111, .14), transparent 34%),
        linear-gradient(135deg, #ffffff, #f6fbf9);
    box-shadow: var(--qoo-shadow-soft);
}

.qoo-yield-hero::after {
    content: "";
    position: absolute;
    right: -50px;
    bottom: -70px;
    width: 210px;
    height: 210px;
    border: 1px solid rgba(21, 150, 111, .14);
    border-radius: 50%;
}

.qoo-yield-hero h2,
.qoo-yield-group__heading h3,
.qoo-yield-saved-heading h3 {
    margin: 4px 0 8px;
    color: var(--qoo-ink);
}

.qoo-yield-hero p,
.qoo-yield-group__heading p,
.qoo-yield-saved-heading p {
    max-width: 760px;
    margin: 0;
    color: var(--qoo-muted);
    line-height: 1.7;
}

.qoo-yield-hero__metrics {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(110px, 1fr));
    gap: 10px;
    min-width: 250px;
}

.qoo-yield-hero__metrics div {
    padding: 16px 18px;
    border: 1px solid rgba(21, 150, 111, .13);
    border-radius: 16px;
    background: rgba(255, 255, 255, .88);
    text-align: center;
}

.qoo-yield-hero__metrics strong {
    display: block;
    font-size: 1.7rem;
    color: var(--qoo-green-dark);
}

.qoo-yield-hero__metrics span {
    display: block;
    margin-top: 3px;
    color: var(--qoo-muted);
    font-size: .78rem;
}

.qoo-yield-source-note {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin: 16px 0 20px;
    padding: 14px 18px;
    border: 1px solid var(--qoo-line);
    border-radius: 15px;
    background: #fff;
}

.qoo-yield-source-note strong,
.qoo-yield-source-note span {
    display: block;
}

.qoo-yield-source-note strong {
    color: var(--qoo-ink-soft);
    font-size: .9rem;
}

.qoo-yield-source-note span,
.qoo-yield-source-note p {
    margin: 3px 0 0;
    color: var(--qoo-muted);
    font-size: .78rem;
    line-height: 1.55;
}

.qoo-yield-source-note p {
    max-width: 480px;
    text-align: right;
}

.qoo-yield-market-reference {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr)) minmax(180px, auto);
    gap: 10px;
    margin: -4px 0 20px;
    padding: 12px;
    border: 1px solid var(--qoo-line);
    border-radius: 15px;
    background: #fff;
}

.qoo-yield-market-reference__item {
    min-width: 0;
    padding: 10px 12px;
    border-radius: 11px;
    background: #f7faf9;
}

.qoo-yield-market-reference__item span,
.qoo-yield-market-reference__item strong,
.qoo-yield-market-reference__meta span,
.qoo-yield-market-reference__meta small,
.qoo-yield-market-reference__unavailable strong,
.qoo-yield-market-reference__unavailable span {
    display: block;
}

.qoo-yield-market-reference__item span {
    color: var(--qoo-muted);
    font-size: .68rem;
}

.qoo-yield-market-reference__item strong {
    margin-top: 2px;
    color: var(--qoo-ink-soft);
    font-size: 1rem;
}

.qoo-yield-market-reference__meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4px 8px;
    color: var(--qoo-muted);
    text-align: right;
}

.qoo-yield-market-reference__meta span {
    color: var(--qoo-ink-soft);
    font-size: .72rem;
    font-weight: 700;
}

.qoo-yield-market-reference__meta small {
    margin-top: 3px;
    font-size: .65rem;
}

.qoo-yield-market-reference__unavailable {
    grid-column: 1 / -1;
    padding: 10px 12px;
    color: var(--qoo-muted);
}

.qoo-yield-market-reference__unavailable strong {
    color: var(--qoo-ink-soft);
    font-size: .78rem;
}

.qoo-yield-market-reference__unavailable span {
    margin-top: 3px;
    font-size: .7rem;
}

.qoo-yield-view-tabs,
.qoo-yield-group-tabs {
    display: flex;
    gap: 8px;
    padding: 5px;
    border: 1px solid var(--qoo-line);
    border-radius: 16px;
    background: #fff;
}

.qoo-yield-view-tabs {
    width: fit-content;
    margin-bottom: 18px;
}

.qoo-yield-group-tabs {
    margin-bottom: 22px;
}

.qoo-yield-view-tabs button,
.qoo-yield-group-tabs button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 15px;
    border: 0;
    border-radius: 11px;
    color: var(--qoo-muted);
    background: transparent;
    cursor: pointer;
    transition: .18s ease;
}

.qoo-yield-view-tabs button:hover,
.qoo-yield-group-tabs button:hover {
    color: var(--qoo-green-dark);
    background: #f1f8f5;
}

.qoo-yield-view-tabs button.is-active,
.qoo-yield-group-tabs button.is-active {
    color: #fff;
    background: linear-gradient(135deg, var(--qoo-green), var(--qoo-green-dark));
    box-shadow: 0 8px 20px rgba(21, 150, 111, .2);
}

.qoo-yield-view-tabs button span,
.qoo-yield-group-tabs button span {
    min-width: 22px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    font-size: .72rem;
}

.qoo-yield-group__heading,
.qoo-yield-saved-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
}

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

.qoo-yield-card {
    position: relative;
    min-width: 0;
    padding: 21px;
    border: 1px solid var(--qoo-line);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(25, 38, 52, .055);
}

.qoo-yield-card--warning {
    border-color: rgba(245, 158, 11, .34);
}

.qoo-yield-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
}

.qoo-yield-card__symbol-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.qoo-yield-card h3 {
    margin: 0;
    color: var(--qoo-ink);
    font-size: 1.15rem;
    overflow-wrap: anywhere;
}

.qoo-yield-card__identity {
    margin: 5px 0 0;
    color: var(--qoo-muted);
    font-size: .82rem;
}

.qoo-yield-card__identity span {
    margin: 0 3px;
}

.qoo-yield-badge {
    display: inline-flex;
    align-items: center;
    min-height: 23px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: .69rem;
    font-weight: 700;
}

.qoo-yield-badge--featured {
    color: #9a5600;
    background: #fff3d6;
}

.qoo-yield-badge--holders {
    min-height: 21px;
    padding: 2px 7px;
    color: #31556f;
    background: #edf5fa;
    font-size: .64rem;
    font-weight: 700;
}

.qoo-yield-save {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 7px 11px;
    flex: 0 0 auto;
    border: 1px solid var(--qoo-line);
    border-radius: 11px;
    color: var(--qoo-muted);
    background: #fff;
    cursor: pointer;
}

.qoo-yield-save:hover,
.qoo-yield-save.is-saved {
    color: var(--qoo-green-dark);
    border-color: rgba(21, 150, 111, .28);
    background: #eff9f5;
}

.qoo-yield-save:disabled {
    opacity: .6;
    cursor: wait;
}

.qoo-yield-status {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 15px;
    padding: 10px 12px;
    border-radius: 11px;
    font-size: .74rem;
}

.qoo-yield-status strong {
    color: inherit;
}

.qoo-yield-status span {
    opacity: .84;
}

.qoo-yield-status--below_threshold,
.qoo-yield-status--source_incomplete,
.qoo-yield-status--stale {
    color: #8a5700;
    background: #fff5dc;
}

.qoo-yield-status--source_missing {
    color: #a1262f;
    background: #fdebed;
}

.qoo-yield-status--active {
    color: #08734f;
    background: #e8f7f1;
}

.qoo-yield-card__metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.qoo-yield-metric {
    min-width: 0;
    padding: 13px 14px;
    border: 1px solid #edf0f3;
    border-radius: 13px;
    background: #fafbfc;
}

.qoo-yield-metric--primary {
    background: linear-gradient(135deg, #f1faf6, #f9fcfb);
    border-color: rgba(21, 150, 111, .17);
}

.qoo-yield-metric span,
.qoo-yield-metric strong {
    display: block;
}

.qoo-yield-metric span {
    color: var(--qoo-muted);
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.qoo-yield-metric strong {
    margin-top: 4px;
    color: var(--qoo-ink);
    font-size: 1.05rem;
}

.qoo-yield-metric--primary strong {
    color: var(--qoo-green-dark);
    font-size: 1.28rem;
}

.qoo-yield-note {
    margin-top: 14px;
    padding: 12px 14px;
    border-left: 3px solid var(--qoo-green);
    border-radius: 10px;
    background: #f5faf8;
}

.qoo-yield-note--risk {
    border-left-color: var(--qoo-orange);
    background: #fff9ed;
}

.qoo-yield-note strong {
    color: var(--qoo-ink-soft);
    font-size: .78rem;
}

.qoo-yield-note p {
    margin: 4px 0 0;
    color: var(--qoo-muted);
    font-size: .78rem;
    line-height: 1.55;
}

.qoo-yield-calculator {
    margin-top: 15px;
    padding: 14px;
    border: 1px solid #e8ecef;
    border-radius: 15px;
    background: #f8fafb;
}

.qoo-yield-calculator__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.qoo-yield-calculator__head label {
    color: var(--qoo-ink-soft);
    font-size: .8rem;
    font-weight: 700;
}

.qoo-yield-amount-wrap {
    display: flex;
    align-items: center;
    min-width: 120px;
    padding: 0 10px;
    border: 1px solid #dce2e6;
    border-radius: 10px;
    background: #fff;
}

.qoo-yield-amount-wrap span {
    color: var(--qoo-muted);
}

.qoo-yield-amount-wrap input {
    width: 90px;
    height: 36px;
    padding: 0 5px;
    border: 0;
    outline: 0;
    color: var(--qoo-ink);
    background: transparent;
    text-align: right;
}

.qoo-yield-calculator__results {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 11px;
}

.qoo-yield-calculator__results div {
    padding: 9px 10px;
    border-radius: 10px;
    background: #fff;
}

.qoo-yield-calculator__results span,
.qoo-yield-calculator__results strong {
    display: block;
}

.qoo-yield-calculator__results span {
    color: var(--qoo-muted);
    font-size: .69rem;
}

.qoo-yield-calculator__results strong {
    margin-top: 2px;
    color: var(--qoo-green-dark);
    font-size: .92rem;
}

.qoo-yield-calculator__results small {
    display: block;
    margin-top: 2px;
    color: var(--qoo-muted);
    font-size: .62rem;
    line-height: 1.35;
}

.qoo-yield-calculator__results .qoo-yield-calculator__borrow strong {
    color: var(--qoo-red-dark);
}

.qoo-yield-calculator > p {
    margin: 9px 0 0;
    color: var(--qoo-muted);
    font-size: .68rem;
    line-height: 1.5;
}

.qoo-yield-card__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.qoo-yield-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--qoo-line);
    border-radius: 10px;
    color: var(--qoo-ink-soft);
    background: #fff;
    text-decoration: none !important;
    font-size: .78rem;
    font-weight: 700;
}

.qoo-yield-link:hover {
    color: var(--qoo-green-dark);
    border-color: rgba(21, 150, 111, .28);
}

.qoo-yield-link--primary {
    color: #fff;
    border-color: var(--qoo-green-dark);
    background: var(--qoo-green-dark);
}

.qoo-yield-link--primary:hover {
    color: #fff;
    background: var(--qoo-green);
}

.qoo-yield-ref-code {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-left: auto;
    padding: 8px 11px;
    border: 1px solid rgba(21, 150, 111, .18);
    border-radius: 10px;
    background: rgba(21, 150, 111, .055);
    color: var(--qoo-ink-soft);
    font-size: .76rem;
    line-height: 1.4;
    white-space: nowrap;
}

.qoo-yield-ref-code strong {
    color: var(--qoo-green-dark);
    font-size: .82rem;
    letter-spacing: .02em;
    user-select: all;
}

.qoo-yield-empty {
    padding: 34px 24px;
    border: 1px dashed #d8dee3;
    border-radius: 18px;
    background: #fff;
    text-align: center;
}

.qoo-yield-empty strong {
    color: var(--qoo-ink-soft);
}

.qoo-yield-empty p {
    margin: 6px 0 0;
    color: var(--qoo-muted);
    font-size: .82rem;
}

@media (max-width: 980px) {
    .qoo-yield-hero,
    .qoo-yield-source-note {
        align-items: flex-start;
        flex-direction: column;
    }

    .qoo-yield-source-note p {
        text-align: left;
    }

    .qoo-yield-hero__metrics {
        width: 100%;
    }

    .qoo-yield-market-reference {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .qoo-yield-market-reference__meta {
        grid-column: 1 / -1;
        align-items: flex-start;
        text-align: left;
    }

    .qoo-yield-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .qoo-yield-hero {
        padding: 22px 20px;
    }

    .qoo-yield-view-tabs,
    .qoo-yield-group-tabs {
        width: 100%;
        overflow-x: auto;
    }

    .qoo-yield-view-tabs button,
    .qoo-yield-group-tabs button {
        flex: 0 0 auto;
    }

    .qoo-yield-card {
        padding: 17px;
    }

    .qoo-yield-card__head,
    .qoo-yield-calculator__head,
    .qoo-yield-status {
        align-items: flex-start;
        flex-direction: column;
    }

    .qoo-yield-save {
        align-self: stretch;
        justify-content: center;
    }

    .qoo-yield-amount-wrap {
        width: 100%;
    }

    .qoo-yield-amount-wrap input {
        width: 100%;
    }

    .qoo-yield-market-reference {
        grid-template-columns: 1fr;
    }

    .qoo-yield-market-reference__meta {
        grid-column: auto;
    }
}

.qoo-yield-conditions {
    margin-top: 15px;
    border: 1px solid var(--qoo-line);
    border-radius: 13px;
    background: #fbfcfc;
}

.qoo-yield-conditions summary {
    padding: 11px 13px;
    color: var(--qoo-ink-soft);
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
}

.qoo-yield-conditions__body {
    padding: 0 13px 13px;
}

.qoo-yield-contract {
    padding: 10px 11px;
    border-radius: 10px;
    background: #f2f7f5;
}

.qoo-yield-contract span,
.qoo-yield-contract code {
    display: block;
}

.qoo-yield-contract span {
    margin-bottom: 5px;
    color: var(--qoo-muted);
    font-size: .69rem;
}

.qoo-yield-contract code {
    color: var(--qoo-ink-soft);
    background: transparent;
    font-size: .7rem;
    overflow-wrap: anywhere;
    white-space: normal;
}

.qoo-yield-condition-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.qoo-yield-condition-item {
    padding: 9px 10px;
    border: 1px solid var(--qoo-line);
    border-radius: 10px;
    background: #fff;
}

.qoo-yield-condition-item > span {
    display: block;
    color: var(--qoo-muted);
    font-size: .68rem;
}

.qoo-yield-condition-item p {
    margin: 6px 0 0;
    color: var(--qoo-ink-soft);
    font-size: .72rem;
    line-height: 1.5;
}

.qoo-yield-condition-status {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: .67rem;
}

.qoo-yield-condition-status--yes {
    color: #08734f;
    background: #e8f7f1;
}

.qoo-yield-condition-status--no {
    color: #8f2630;
    background: #fdebed;
}

.qoo-yield-condition-status--unknown {
    color: #735a22;
    background: #fff5dc;
}

@media (max-width: 680px) {
    .qoo-yield-condition-list {
        grid-template-columns: 1fr;
    }
}

.qoo-yield-peg-alert {
    display: grid;
    gap: 4px;
    margin-top: 13px;
    padding: 11px 12px;
    border: 1px solid #f0a5a7;
    border-radius: 12px;
    background: #fff1f1;
}

.qoo-yield-peg-alert strong {
    color: #9d272b;
    font-size: .76rem;
}

.qoo-yield-peg-alert > span {
    color: #754348;
    font-size: .72rem;
    line-height: 1.55;
}

/* v0.14.58: platform-level due-diligence popup. */
.qoo-yield-platform-link {
    display: inline;
    margin: 0;
    padding: 0;
    border: 0;
    color: inherit;
    background: transparent;
    font: inherit;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
    cursor: pointer;
}

.qoo-yield-platform-link:hover,
.qoo-yield-platform-link:focus-visible {
    color: #08795f;
    outline: none;
}

.qoo-yield-platform-source {
    display: none !important;
}

/* v0.14.59: popup is appended under <body>, so re-declare dashboard color tokens here. */
.qoo-yield-platform-modal {
    --qoo-ink: #162132;
    --qoo-ink-soft: #344156;
    --qoo-muted: #6f7b8d;
    --qoo-line: #d9e0e8;
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: grid;
    place-items: center;
    padding: 24px;
    color: var(--qoo-ink);
}

.qoo-yield-platform-modal[hidden] {
    display: none !important;
}

.qoo-yield-platform-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 25, 36, .58);
    backdrop-filter: blur(2px);
}

.qoo-yield-platform-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(760px, calc(100vw - 48px));
    max-height: min(760px, calc(100vh - 48px));
    overflow: auto;
    border: 1px solid var(--qoo-line);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(20, 35, 45, .24);
}

.qoo-yield-platform-modal__head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 22px 15px;
    border-bottom: 1px solid var(--qoo-line);
    background: #fff;
}

.qoo-yield-platform-modal__head h3 {
    margin: 0;
    color: var(--qoo-ink);
    font-size: 1.12rem;
}

.qoo-yield-platform-modal__close {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    border: 1px solid var(--qoo-line);
    border-radius: 10px;
    color: var(--qoo-ink-soft);
    background: #fff;
    font-size: 1.2rem;
    cursor: pointer;
}

.qoo-yield-platform-modal__body {
    padding: 18px 22px 22px;
}

.qoo-yield-platform-popup__intro {
    margin-bottom: 12px;
    color: var(--qoo-muted);
    font-size: .78rem;
    line-height: 1.6;
}

.qoo-yield-platform-modal .qoo-yield-condition-list {
    margin-top: 0;
    gap: 10px;
}

.qoo-yield-platform-modal .qoo-yield-condition-item {
    border-color: #d7dfe8;
    background: #f8fafc;
    box-shadow: 0 1px 2px rgba(22, 33, 50, .03);
}

.qoo-yield-platform-modal .qoo-yield-condition-item > span {
    color: #66758b;
}

.qoo-yield-platform-modal .qoo-yield-condition-item p {
    color: #344156;
}

.qoo-yield-pool-note__text {
    margin: 10px 1px 0;
    color: var(--qoo-ink-soft);
    font-size: .76rem;
    line-height: 1.65;
}

body.qoo-yield-modal-open {
    overflow: hidden;
}

@media (max-width: 680px) {
    .qoo-yield-platform-modal {
        align-items: end;
        padding: 10px;
    }

    .qoo-yield-platform-modal__dialog {
        width: 100%;
        max-height: calc(100vh - 20px);
        border-radius: 18px 18px 12px 12px;
    }

    .qoo-yield-platform-modal__head,
    .qoo-yield-platform-modal__body {
        padding-left: 15px;
        padding-right: 15px;
    }
}
