.portal-header {
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--phbs-border);
    position: sticky;
    top: 0;
    z-index: 20;
}

.portal-header__inner {
    align-items: center;
    display: flex;
    justify-content: space-between;
    min-height: 76px;
}

.portal-brand__logo {
    display: block;
    height: auto;
    width: clamp(11rem, 15vw, 13rem);
}

.portal-brand__product {
    border-left: 1px solid #d8dde4;
    color: #5f6c7c;
    font-size: 0.72rem;
    font-weight: 680;
    letter-spacing: 0.04em;
    line-height: 1.3;
    padding-left: 0.8rem;
    white-space: nowrap;
}

.portal-nav {
    align-items: center;
    display: flex;
    gap: 0.5rem;
}

.portal-nav a,
.portal-nav button {
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: var(--phbs-muted);
    font-size: 0.88rem;
    padding: 0.6rem 0.82rem;
    text-decoration: none;
}

.portal-nav a[aria-current="page"] {
    color: var(--phbs-navy);
    font-weight: 700;
}

.portal-nav .portal-nav__login {
    background: var(--phbs-wine);
    color: #fff;
    margin-left: 0.35rem;
    padding-inline: 1rem;
}

.portal-main {
    min-height: calc(100vh - 152px);
}

.portal-intro {
    background: #f7f8fa;
    border-bottom: 1px solid #e8ebef;
    padding: 2.5rem 0 2.2rem;
}

.portal-intro__inner {
    align-items: flex-end;
    display: flex;
    justify-content: space-between;
}

.portal-intro h1 {
    color: var(--phbs-navy);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 760;
    letter-spacing: -0.04em;
    margin: 0.38rem 0 0.35rem;
}

.portal-content {
    padding: 2.35rem 0 4rem;
}

.portal-toolbar {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.8rem;
}

.portal-toolbar h2 {
    color: var(--phbs-navy);
    font-size: 1.45rem;
    font-weight: 740;
    margin: 0 0 0.25rem;
}

.portal-toolbar p {
    color: var(--phbs-muted);
    font-size: 0.85rem;
    margin: 0;
}

.portal-search input {
    background: #fff;
    border: 1px solid #d8dde4;
    border-radius: 10px;
    color: var(--phbs-navy);
    font-size: 0.88rem;
    min-width: 240px;
    outline: 0;
    padding: 0.72rem 0.9rem;
}

.portal-search input:focus {
    border-color: rgba(152, 22, 55, 0.62);
    box-shadow: 0 0 0 3px rgba(152, 22, 55, 0.09);
}

.application-group + .application-group {
    border-top: 1px solid #ebedf0;
    margin-top: 2.1rem;
    padding-top: 2rem;
}

.application-group h3 {
    color: #556171;
    font-size: 0.82rem;
    font-weight: 720;
    letter-spacing: 0.06em;
    margin: 0 0 0.9rem;
}

.application-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.application-card {
    align-items: center;
    background: #fff;
    border: 1px solid #e1e5ea;
    border-radius: 13px;
    color: inherit;
    display: flex;
    gap: 0.85rem;
    min-height: 86px;
    padding: 0.9rem;
    text-decoration: none;
    transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.application-card:hover {
    border-color: #c8cfd8;
    box-shadow: 0 8px 20px rgba(20, 31, 48, 0.08);
    color: inherit;
    transform: translateY(-1px);
}

.application-card:focus-visible {
    border-color: var(--phbs-wine);
    box-shadow: 0 0 0 3px rgba(152, 22, 55, 0.12);
    outline: 0;
}

.application-card__icon {
    align-items: center;
    background: #f5f6f8;
    border-radius: 11px;
    display: inline-flex;
    flex: 0 0 54px;
    height: 54px;
    justify-content: center;
    overflow: hidden;
}

.application-card__icon img {
    display: block;
    height: 45px;
    object-fit: contain;
    width: 45px;
}

.application-card__copy {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

.application-card__copy strong {
    color: var(--phbs-navy);
    font-size: 0.94rem;
    font-weight: 720;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.application-card__copy small {
    color: #7a8492;
    font-size: 0.73rem;
    line-height: 1.35;
    margin-top: 0.2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.application-card__arrow {
    color: #a6adb6;
    font-size: 1rem;
}

.portal-feedback {
    background: #f7f8fa;
    border: 1px solid #e1e5ea;
    border-radius: 10px;
    color: var(--phbs-muted);
    margin: 1rem 0 0;
    padding: 0.85rem 1rem;
}

.portal-footer {
    border-top: 1px solid var(--phbs-border);
    color: var(--phbs-muted);
    font-size: 0.76rem;
    padding: 1.25rem 0;
}

.portal-footer .phbs-container {
    display: flex;
    justify-content: space-between;
}

@media (max-width: 1050px) {
    .application-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 780px) {
    .application-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .portal-intro__inner,
    .portal-toolbar { align-items: flex-start; flex-direction: column; gap: 1rem; }
    .portal-search,
    .portal-search input { width: 100%; }
}

@media (max-width: 520px) {
    .portal-header__inner { min-height: 68px; }
    .portal-brand__logo { width: 9.5rem; }
    .portal-brand__product,
    .portal-nav a,
    .portal-nav > button:not(.portal-nav__login) { display: none; }
    .portal-intro { padding: 1.8rem 0 1.6rem; }
    .portal-content { padding-top: 1.6rem; }
    .application-grid { grid-template-columns: 1fr; }
    .portal-footer .phbs-container { flex-direction: column; gap: 0.3rem; }
}
.portal-nav__user {
    align-items: center;
    display: inline-flex;
    gap: 0.55rem;
}

.portal-nav__user[hidden] {
    display: none;
}

.portal-nav__user strong {
    color: var(--phbs-navy);
    font-size: 0.78rem;
    font-weight: 700;
}

.portal-nav__user button {
    background: transparent;
    border: 0;
    color: var(--phbs-wine);
    font-size: 0.72rem;
    padding: 0;
}

.account-security-dialog {
    background: #fff;
    border: 0;
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(18, 34, 52, 0.22);
    color: var(--phbs-navy);
    max-height: min(86vh, 760px);
    max-width: min(92vw, 560px);
    overflow: auto;
    padding: 0;
    width: 100%;
}

.account-security-dialog::backdrop {
    background: rgba(13, 30, 47, 0.48);
}

.account-security-dialog__header {
    align-items: center;
    border-bottom: 1px solid #e7eaee;
    display: flex;
    justify-content: space-between;
    padding: 1.15rem 1.35rem;
}

.account-security-dialog__header h2 {
    font-size: 1.25rem;
    font-weight: 760;
    margin: 0;
}

.account-security-dialog__header button {
    background: transparent;
    border: 0;
    color: #6d7885;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0.2rem;
}

.account-security-summary {
    background: #f7f8fa;
    border-radius: 12px;
    margin: 1.2rem 1.35rem 0;
    padding: 0.55rem 1rem;
}

.account-security-summary p {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin: 0;
    padding: 0.55rem 0;
}

.account-security-summary p + p {
    border-top: 1px solid #e4e8ed;
}

.account-security-summary span {
    color: var(--phbs-muted);
    font-size: 0.82rem;
}

.account-security-summary strong {
    font-size: 0.88rem;
}

.account-security-section {
    margin: 0 1.35rem;
    padding: 1.3rem 0;
}

.account-security-section + .account-security-section {
    border-top: 1px solid #e7eaee;
}

.account-security-section h3 {
    font-size: 1rem;
    font-weight: 740;
    margin: 0 0 1rem;
}

.account-security-form {
    display: grid;
    gap: 0.55rem;
}

.account-security-form div {
    display: grid;
    gap: 0.55rem;
}

.account-security-form label {
    color: #536071;
    font-size: 0.78rem;
    font-weight: 650;
}

.account-security-form input {
    border: 1px solid #d8dde4;
    border-radius: 9px;
    color: var(--phbs-navy);
    font-size: 0.9rem;
    outline: 0;
    padding: 0.72rem 0.82rem;
}

.account-security-form input:focus {
    border-color: rgba(152, 22, 55, 0.62);
    box-shadow: 0 0 0 3px rgba(152, 22, 55, 0.09);
}

.account-security-primary {
    background: var(--phbs-navy);
    border: 0;
    border-radius: 9px;
    color: #fff;
    font-size: 0.86rem;
    font-weight: 700;
    margin-top: 0.35rem;
    padding: 0.72rem 1rem;
}

.account-security-primary:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.account-security-code-form {
    margin-top: 0.8rem;
}

.account-security-message {
    background: #f7f8fa;
    border: 1px solid #e0e5ea;
    border-radius: 9px;
    color: #596575;
    font-size: 0.8rem;
    margin: 0.8rem 0 0;
    padding: 0.7rem 0.8rem;
}

@media (max-width: 520px) {
    .portal-nav__user strong { display: none; }
    .account-security-dialog { border-radius: 14px; max-height: 92vh; max-width: calc(100vw - 1.2rem); }
}
