.apf-updates-page,
.apf-update-detail-page {
    min-height: 70vh;
    background:
        radial-gradient(circle at 85% 0, rgba(var(--apf-market-rgb), .10), transparent 34rem),
        #08090b;
    color: #f5f5f5;
}

.apf-updates-shell {
    width: min(1180px, calc(100% - 36px));
    margin-inline: auto;
}

.apf-updates-hero {
    padding: 70px 0 46px;
    border-bottom: 1px solid rgba(var(--apf-market-rgb), .16);
}

.apf-updates-hero .apf-updates-shell {
    max-width: 920px;
    text-align: center;
}

.apf-updates-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: var(--beam-color);
    font-size: .88rem;
    font-weight: 900;
    letter-spacing: .04em;
}

.apf-updates-kicker::before,
.apf-updates-kicker::after {
    content: "";
    width: 28px;
    height: 1px;
    background: currentColor;
    opacity: .65;
}

.apf-updates-hero h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.16;
    font-weight: 900;
}

.apf-updates-hero p {
    max-width: 760px;
    margin: 18px auto 0;
    color: #aaaeb6;
    font-size: 1rem;
    line-height: 2;
}

.apf-updates-directory {
    padding: 42px 0 76px;
}

.apf-updates-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 26px;
}

.apf-updates-toolbar > div:first-child > span {
    color: var(--beam-color);
    font-size: .82rem;
    font-weight: 900;
}

.apf-updates-toolbar h2 {
    margin: 4px 0 0;
    font-size: 1.55rem;
}

.apf-updates-sort {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px;
    border: 1px solid #272a30;
    border-radius: 14px;
    background: #101216;
}

.apf-updates-sort > span {
    padding: 0 8px;
    color: #8f949d;
    font-size: .78rem;
    font-weight: 800;
}

.apf-updates-sort a {
    padding: 9px 12px;
    border-radius: 10px;
    color: #b8bcc4;
    text-decoration: none;
    font-size: .82rem;
    font-weight: 800;
    transition: .2s ease;
}

.apf-updates-sort a:hover,
.apf-updates-sort a.is-active {
    background: rgba(var(--apf-market-rgb), .13);
    color: var(--beam-color);
}

.apf-updates-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.apf-update-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #25282e;
    border-radius: 20px;
    background: linear-gradient(180deg, #121419, #0d0f12);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .18);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.apf-update-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 2px;
    background: var(--beam-color);
    opacity: .85;
}

.apf-update-card:hover {
    transform: translateY(-4px);
    border-color: rgba(var(--apf-market-rgb), .5);
    box-shadow: 0 22px 60px rgba(0, 0, 0, .30);
}

.apf-update-card__link {
    display: flex;
    min-height: 100%;
    flex-direction: column;
    padding: 18px;
    color: inherit;
    text-decoration: none;
}

.apf-update-card__top,
.apf-update-card__firm,
.apf-update-card__footer,
.apf-update-detail__firm,
.apf-update-detail__meta,
.apf-update-detail__footer {
    display: flex;
    align-items: center;
}

.apf-update-card__top {
    justify-content: space-between;
    gap: 12px;
}

.apf-update-card__firm {
    min-width: 0;
    gap: 10px;
}

.apf-update-card__logo,
.apf-update-detail__logo {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    overflow: hidden;
    border: 1px solid #2b2e34;
    background: #080a0d;
}

.apf-update-card__logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
}

.apf-update-card__logo img,
.apf-update-detail__logo img {
    width: 78%;
    height: 78%;
    object-fit: contain;
}

.apf-update-card__firm div {
    min-width: 0;
}

.apf-update-card__firm strong,
.apf-update-card__firm small {
    display: block;
}

.apf-update-card__firm strong {
    overflow: hidden;
    color: #f7f7f7;
    font-size: .9rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.apf-update-card__firm small {
    margin-top: 3px;
    color: #858a93;
    font-size: .72rem;
}

.apf-update-card time {
    flex: 0 0 auto;
    color: #8e939d;
    font-size: .72rem;
    font-weight: 700;
}

.apf-update-card__body {
    padding: 24px 2px 20px;
}

.apf-update-card__category {
    display: inline-flex;
    padding: 6px 9px;
    border: 1px solid rgba(var(--apf-market-rgb), .25);
    border-radius: 999px;
    background: rgba(var(--apf-market-rgb), .08);
    color: var(--beam-color);
    font-size: .72rem;
    font-weight: 900;
}

.apf-update-card h3 {
    margin: 13px 0 9px;
    color: #f3f3f3;
    font-size: 1.06rem;
    line-height: 1.65;
}

.apf-update-card p {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    color: #9ea3ad;
    font-size: .86rem;
    line-height: 1.85;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.apf-update-card__footer {
    justify-content: space-between;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid #21242a;
    color: #d2d5db;
    font-size: .8rem;
    font-weight: 800;
}

.apf-update-card__footer b {
    color: var(--beam-color);
    font-size: 1.05rem;
}

.apf-updates-empty {
    padding: 54px 20px;
    border: 1px dashed #30333a;
    border-radius: 20px;
    background: #0e1014;
    text-align: center;
}

.apf-updates-empty strong {
    display: block;
    font-size: 1.1rem;
}

.apf-updates-empty p {
    margin: 8px 0 0;
    color: #91969f;
}

.apf-update-detail-page {
    padding: 36px 0 80px;
}

.apf-update-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    color: #7f848d;
    font-size: .8rem;
}

.apf-update-breadcrumbs a {
    color: #b9bdc5;
    text-decoration: none;
}

.apf-update-breadcrumbs a:hover {
    color: var(--beam-color);
}

.apf-update-detail {
    overflow: hidden;
    max-width: 900px;
    margin-inline: auto;
    border: 1px solid #292c32;
    border-radius: 24px;
    background: #0e1014;
    box-shadow: 0 28px 70px rgba(0, 0, 0, .28);
}

.apf-update-detail__header {
    padding: 32px 34px 28px;
    border-bottom: 1px solid #24272d;
    background:
        radial-gradient(circle at 95% 5%, rgba(var(--apf-market-rgb), .14), transparent 18rem),
        linear-gradient(180deg, #12151a, #0f1115);
}

.apf-update-detail__firm {
    gap: 12px;
}

.apf-update-detail__logo {
    width: 52px;
    height: 52px;
    border-radius: 14px;
}

.apf-update-detail__firm a {
    display: block;
    color: #f3f3f3;
    text-decoration: none;
    font-weight: 900;
}

.apf-update-detail__firm small {
    display: block;
    margin-top: 3px;
    color: #8d929b;
    font-size: .75rem;
}

.apf-update-detail__meta {
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 24px;
}

.apf-update-detail__meta span {
    padding: 6px 10px;
    border: 1px solid rgba(var(--apf-market-rgb), .24);
    border-radius: 999px;
    background: rgba(var(--apf-market-rgb), .08);
    color: var(--beam-color);
    font-size: .76rem;
    font-weight: 900;
}

.apf-update-detail__meta time {
    color: #90959e;
    font-size: .8rem;
    font-weight: 700;
}

.apf-update-detail h1 {
    max-width: 760px;
    margin: 18px 0 0;
    font-size: clamp(1.65rem, 4vw, 2.7rem);
    line-height: 1.45;
}

.apf-update-detail__summary {
    max-width: 760px;
    margin: 14px 0 0;
    color: #aeb2ba;
    font-size: 1rem;
    line-height: 1.9;
}

.apf-update-detail__content {
    padding: 34px;
    color: #d1d4da;
    font-size: .98rem;
    line-height: 2.15;
    overflow-wrap: anywhere;
}

.apf-update-detail__footer {
    justify-content: space-between;
    gap: 12px;
    padding: 18px 34px;
    border-top: 1px solid #24272d;
    background: #0b0d10;
}

.apf-update-detail__footer a {
    text-decoration: none;
    font-size: .84rem;
    font-weight: 900;
}

.apf-update-detail__firm-link {
    color: var(--beam-color);
}

.apf-update-detail__source {
    color: #c9cdd4;
}

/* بطاقة التحديثات داخل صفحة الشركة */
.pf-firm-updates-section {
    margin-top: 28px;
}

.pf-firm-updates-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.pf-firm-update-card {
    display: block;
    padding: 18px;
    border: 1px solid rgba(var(--apf-market-rgb), .18);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(var(--apf-market-rgb), .055), rgba(10, 11, 14, .7));
    color: inherit;
    text-decoration: none;
    transition: transform .2s ease, border-color .2s ease;
}

.pf-firm-update-card:hover {
    transform: translateY(-2px);
    border-color: rgba(var(--apf-market-rgb), .44);
}

.pf-firm-update-card__meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    color: #969ba4;
    font-size: .74rem;
}

.pf-firm-update-card__meta span:first-child {
    color: var(--beam-color);
    font-weight: 900;
}

.pf-firm-update-card h3 {
    margin: 10px 0 7px;
    color: #f2f2f2;
    font-size: 1rem;
    line-height: 1.6;
}

.pf-firm-update-card p {
    margin: 0;
    color: #a4a8b0;
    font-size: .82rem;
    line-height: 1.8;
}

@media (max-width: 900px) {
    .apf-updates-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .apf-updates-shell {
        width: min(100% - 24px, 1180px);
    }

    /* ضغط بطاقة التحديث على الهاتف بدون المساس بنسخة الكمبيوتر */
    .apf-update-card__link {
        padding: 13px 14px;
    }

    .apf-update-card__top {
        gap: 9px;
    }

    .apf-update-card__firm {
        gap: 8px;
    }

    .apf-update-card__logo {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .apf-update-card__firm strong {
        font-size: .84rem;
    }

    .apf-update-card__firm small,
    .apf-update-card time {
        font-size: .67rem;
    }

    .apf-update-card__body {
        padding: 14px 1px 12px;
    }

    .apf-update-card__category {
        padding: 5px 8px;
        font-size: .67rem;
    }

    .apf-update-card h3 {
        display: -webkit-box;
        overflow: hidden;
        margin: 9px 0 6px;
        font-size: .96rem;
        line-height: 1.5;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .apf-update-card p {
        font-size: .79rem;
        line-height: 1.65;
        -webkit-line-clamp: 2;
    }

    .apf-update-card__footer {
        padding-top: 10px;
        font-size: .75rem;
    }

    .apf-updates-hero {
        padding: 48px 0 34px;
    }

    .apf-updates-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .apf-updates-sort {
        width: 100%;
    }

    .apf-updates-sort a {
        flex: 1;
        text-align: center;
    }

    .apf-updates-sort > span {
        display: none;
    }

    .apf-updates-grid,
    .pf-firm-updates-list {
        grid-template-columns: 1fr;
    }

    .apf-update-detail-page {
        padding-top: 22px;
    }

    .apf-update-detail__header,
    .apf-update-detail__content,
    .apf-update-detail__footer {
        padding-right: 20px;
        padding-left: 20px;
    }

    .apf-update-detail__footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

.firm-v31 .pf-v31-section-link {
    display: inline-flex;
    min-height: 38px;
    padding: 8px 13px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(var(--apf-market-rgb), .26);
    border-radius: 11px;
    background: rgba(var(--apf-market-rgb), .075);
    color: var(--beam-color);
    font-size: .76rem;
    font-weight: 900;
    text-decoration: none;
}

.firm-v31 .pf-v31-section-link:hover {
    border-color: rgba(var(--apf-market-rgb), .48);
    background: rgba(var(--apf-market-rgb), .12);
}

@media (max-width: 680px) {
    .firm-v31 .pf-firm-updates-section .pf-v31-section-head {
        align-items: flex-start;
        flex-direction: column;
    }
}
