.ijpsc-related-research,
.ijpsc-citation-generator {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    margin: 24px 0;
    border: 1px solid #cbd8e2;
    border-top: 3px solid #0b456c;
    background: #fff;
    color: #172536;
    font-family: inherit;
}

.ijpsc-related-research *,
.ijpsc-citation-generator * {
    box-sizing: border-box;
}

.ijpsc-tools__kicker {
    margin: 0 0 5px;
    color: #0b456c;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    line-height: 1.4;
    text-transform: uppercase;
}

.ijpsc-related-research {
    padding: 18px;
}

.ijpsc-related-research__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #d8e0e7;
}

.ijpsc-related-research__header h2,
.ijpsc-citation-generator__heading h3 {
    margin: 0;
    color: #123a5a;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 500;
    line-height: 1.15;
}

.ijpsc-related-research__header h2 {
    font-size: clamp(24px, 2vw, 31px);
}

.ijpsc-related-research__header p {
    max-width: 780px;
    margin: 7px 0 0;
    color: #4e5e6c;
    font-size: 14px;
    line-height: 1.55;
}

.ijpsc-tools__atlas-link,
.ijpsc-tools__text-link {
    color: #0b5d91 !important;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ijpsc-tools__atlas-link {
    flex: 0 0 auto;
    margin-top: 5px;
    font-size: 13px;
    white-space: nowrap;
}

.ijpsc-tools__doi-link {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-size: 12px;
    line-height: 1.35;
}

.ijpsc-related-research__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.ijpsc-related-card {
    display: flex;
    min-width: 0;
    min-height: 205px;
    flex-direction: column;
    padding: 14px;
    border: 1px solid #d5e0e8;
    border-top: 4px solid #9db5c5;
    background: #fff;
}

.ijpsc-related-card__meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px 12px;
    margin-bottom: 9px;
    color: #47657c;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.ijpsc-related-card h3 {
    margin: 0 0 8px;
    color: #102f49;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 17px;
    font-weight: 500;
    line-height: 1.28;
}

.ijpsc-related-card h3 a {
    color: inherit !important;
    text-decoration: none;
}

.ijpsc-related-card h3 a:hover,
.ijpsc-related-card h3 a:focus {
    color: #0b5d91 !important;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ijpsc-related-card__authors,
.ijpsc-related-card__reason,
.ijpsc-related-card__doi {
    margin: 0 0 8px;
    color: #465866;
    font-size: 12px;
    line-height: 1.45;
}

.ijpsc-related-card__reason {
    color: #526a7c;
}

.ijpsc-related-card__doi {
    margin-top: -2px;
    margin-bottom: 10px;
}

.ijpsc-related-card__reason strong {
    color: #203f57;
}

.ijpsc-related-card__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    padding-top: 8px;
}

.ijpsc-tools__button {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border: 1px solid #0b456c;
    border-radius: 2px;
    background: #0b456c;
    color: #fff !important;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none !important;
    cursor: pointer;
}

.ijpsc-tools__button:hover,
.ijpsc-tools__button:focus {
    border-color: #083450;
    background: #083450;
    color: #fff !important;
}

.ijpsc-tools__button--secondary {
    background: #fff;
    color: #0b456c !important;
}

.ijpsc-tools__button--secondary:hover,
.ijpsc-tools__button--secondary:focus {
    background: #edf4f8;
    color: #083450 !important;
}

.ijpsc-related-research__note {
    margin: 13px 0 0;
    color: #63727d;
    font-size: 11px;
    line-height: 1.45;
}

.ijpsc-citation-generator {
    padding: 15px 16px;
    background: #f8fafc;
}

.ijpsc-citation-generator__heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 11px;
    border-bottom: 1px solid #d6e0e7;
}

.ijpsc-citation-generator__heading h3 {
    font-size: 23px;
}

.ijpsc-citation-generator__doi {
    flex: 0 1 auto;
    max-width: 48%;
    padding: 6px 9px;
    border: 1px solid #c7d5df;
    background: #fff;
    color: #0b456c !important;
    font-size: 11px;
    font-weight: 700;
    overflow-wrap: anywhere;
    text-decoration: none !important;
}

.ijpsc-citation-generator__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0 9px;
}

.ijpsc-citation-generator__tab {
    min-height: 32px;
    padding: 6px 11px;
    border: 1px solid #c7d5df;
    border-radius: 2px;
    background: #fff;
    color: #24455d;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.ijpsc-citation-generator__tab:hover,
.ijpsc-citation-generator__tab:focus,
.ijpsc-citation-generator__tab.is-active {
    border-color: #0b456c;
    background: #0b456c;
    color: #fff;
}

.ijpsc-citation-generator__content {
    min-height: 78px;
    padding: 12px;
    border: 1px solid #d7e1e8;
    background: #fff;
}

.ijpsc-citation-generator__panel[hidden] {
    display: none !important;
}

.ijpsc-citation-generator__panel p,
.ijpsc-citation-generator__panel pre {
    margin: 0;
}

.ijpsc-citation-generator__panel p {
    color: #263c4c;
    font-size: 13px;
    line-height: 1.6;
}

.ijpsc-citation-generator__panel pre {
    max-height: 230px;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.ijpsc-citation-generator__panel code {
    color: #22394a;
    font-size: 12px;
    line-height: 1.5;
}

.ijpsc-citation-generator__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.ijpsc-citation-generator__status {
    min-width: 90px;
    color: #2c6549;
    font-size: 12px;
    font-weight: 700;
}

@media (max-width: 980px) {
    .ijpsc-related-research__grid {
        grid-template-columns: 1fr;
    }

    .ijpsc-related-card {
        min-height: 0;
    }
}

@media (max-width: 640px) {
    .ijpsc-related-research,
    .ijpsc-citation-generator {
        padding: 13px;
    }

    .ijpsc-related-research__header,
    .ijpsc-citation-generator__heading {
        display: block;
    }

    .ijpsc-tools__atlas-link {
        display: inline-block;
        margin-top: 10px;
    }

    .ijpsc-citation-generator__doi {
        display: inline-block;
        max-width: 100%;
        margin-top: 9px;
    }

    .ijpsc-citation-generator__actions .ijpsc-tools__button {
        width: 100%;
    }
}

/* Keep Citation Generator and Related Research visually grouped. */
.ijpsc-research-tools-stack {
    width: 100%;
    max-width: none;
    margin: 24px 0;
}

.ijpsc-research-tools-stack > .ijpsc-citation-generator,
.ijpsc-research-tools-stack > .ijpsc-related-research {
    margin-left: 0;
    margin-right: 0;
}

.ijpsc-research-tools-stack > .ijpsc-citation-generator {
    margin-top: 0;
    margin-bottom: 12px;
}

.ijpsc-research-tools-stack > .ijpsc-related-research {
    margin-top: 0;
    margin-bottom: 0;
}
