.portal-body {
    background: #f4f6f9;
    min-height: 100vh;
    min-height: 100dvh;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    width: 100%;
    overflow-x: hidden;
}

.portal-login-body {
    background: linear-gradient(180deg, #0f172a 0%, #1e3a5f 100%);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(20px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
    width: 100%;
    overflow-x: hidden;
}

.portal-top {
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.portal-header {
    background: #1565c0;
    color: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.portal-header .brand-logo-wrap {
    width: 48px;
    height: 48px;
}

.portal-header .brand-logo,
.portal-login-brand .brand-logo {
    object-fit: contain;
    transform: none;
    background: transparent;
}

.portal-header h1 {
    font-size: 18px;
    margin: 0;
}

.portal-header-text {
    min-width: 0;
}

.portal-header-text p {
    margin: 2px 0 0;
    font-size: 12px;
    opacity: 0.92;
    line-height: 1.3;
}

.portal-content {
    padding: 16px;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.portal-login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    box-sizing: border-box;
}

.portal-login-shell {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.portal-apply-card {
    max-width: 560px;
}

.portal-login-card h1 {
    margin: 0 0 8px;
    font-size: 24px;
    color: #0f172a;
}

.portal-login-card .subtitle {
    color: #64748b;
    margin-bottom: 20px;
    line-height: 1.5;
}

.portal-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.portal-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 10px 4px;
    text-decoration: none;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    min-height: 58px;
}

.portal-nav a i {
    font-size: 18px;
}

.portal-nav a.active {
    color: #1565c0;
    border-bottom-color: #1565c0;
    background: #f8fbff;
}

.portal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.portal-stat {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.portal-stat span {
    display: block;
    color: #64748b;
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.portal-stat strong {
    font-size: 22px;
    color: #1565c0;
    line-height: 1.2;
}

.portal-stat.danger strong {
    color: #dc3545;
}

.portal-stat-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.portal-stat-link:active {
    transform: scale(0.98);
}

.portal-stat-status {
    font-size: 18px;
    line-height: 1.2;
}

.portal-alert {
    margin: 12px 16px 0;
    padding: 14px 16px;
    border-radius: 12px;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.portal-alert p {
    margin: 6px 0 10px;
    font-size: 14px;
    line-height: 1.5;
}

.portal-alert-gcash {
    font-size: 13px;
    font-weight: 600;
}

.portal-alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.portal-alert-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.portal-alert-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.portal-alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.portal-disclaimer-note {
    margin: 16px auto 0;
    max-width: 720px;
    padding: 12px 16px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    box-sizing: border-box;
}

.portal-disclaimer-note p {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    color: #64748b;
    text-align: center;
    font-style: italic;
}

.portal-section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 18px 0 10px;
}

.portal-section-title h2 {
    font-size: 18px;
    margin: 0;
}

.portal-list-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    margin-bottom: 16px;
}

.portal-list-item {
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.portal-list-item:last-child {
    border-bottom: none;
}

.portal-list-item-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 8px;
}

.portal-list-item-top strong {
    font-size: 15px;
}

.portal-meta {
    display: grid;
    gap: 6px;
    font-size: 14px;
}

.portal-meta-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.portal-meta-row span {
    color: #64748b;
}

.portal-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.portal-actions .btn {
    flex: 1;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.portal-actions-inline {
    flex-direction: row;
}

.portal-actions-inline .btn {
    flex: 1;
}

.portal-pay-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #86efac;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.portal-pay-banner strong {
    display: block;
    color: #166534;
    font-size: 16px;
}

.portal-pay-banner p {
    margin: 4px 0 0;
    color: #15803d;
    font-size: 13px;
}

.portal-pay-banner .btn {
    flex-shrink: 0;
    min-width: 110px;
}

.portal-pay-summary .portal-pay-amount {
    text-align: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.portal-pay-summary .portal-pay-amount span {
    display: block;
    color: #64748b;
    font-size: 13px;
    margin-bottom: 4px;
}

.portal-pay-summary .portal-pay-amount strong {
    font-size: 32px;
    color: #166534;
}

.portal-pay-qr-wrap {
    text-align: center;
    margin: 16px 0;
}

.portal-pay-qr {
    width: 220px;
    height: 220px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
}

.portal-pay-qr-wrap p {
    margin: 8px 0 0;
    color: #64748b;
    font-size: 13px;
}

.portal-pay-steps {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    font-size: 14px;
    color: #334155;
}

.portal-pay-steps ol {
    margin: 8px 0 0;
    padding-left: 20px;
}

.portal-pay-steps li {
    margin-bottom: 8px;
}

.portal-pay-methods {
    display: flex;
    gap: 10px;
}

.portal-pay-method {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
}

.portal-pay-method:has(input:checked) {
    border-color: #198754;
    background: #ecfdf5;
    color: #166534;
}

.portal-pay-form input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
}

.portal-nav a {
    -webkit-tap-highlight-color: transparent;
}

@media (max-width: 768px) {
    .portal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .portal-list-item {
        padding: 16px;
    }

    .portal-meta-row strong {
        text-align: right;
        word-break: break-word;
    }

    .portal-actions {
        flex-direction: column;
    }

    .portal-actions-inline {
        flex-direction: row;
    }

    .portal-pay-banner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .portal-pay-banner .btn {
        width: 100%;
    }

    .portal-actions .btn {
        width: 100%;
    }

    .card {
        padding: 16px;
    }
}

.portal-detail-grid {
    display: grid;
    gap: 12px;
}

.portal-detail-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
}

.portal-detail-row span {
    color: #64748b;
}

.portal-announcements-panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    margin-bottom: 16px;
    overflow: hidden;
}

.portal-announcements-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.portal-announcements-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #1565c0;
}

.portal-announcements-title i {
    font-size: 18px;
}

.portal-announcements-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
}

.portal-announcements-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.portal-announcements-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    cursor: pointer;
    padding: 0;
}

.portal-announcements-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.portal-announcements-viewport {
    position: relative;
    min-height: 88px;
}

.portal-announcements-track {
    position: relative;
}

.portal-announcement-slide {
    display: none;
    padding: 14px 16px 10px;
    border-left: 4px solid #1565c0;
}

.portal-announcement-slide.is-active {
    display: block;
}

.portal-announcement-head {
    margin-bottom: 6px;
    color: #0f172a;
}

.portal-announcement-head strong {
    font-size: 15px;
    line-height: 1.35;
}

.portal-announcement-message {
    margin: 0;
    color: #475569;
    line-height: 1.45;
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.portal-announcement-meta {
    margin-top: 8px;
}

.portal-announcement-meta small {
    color: #64748b;
    font-size: 12px;
}

.portal-announcements-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px 12px;
}

.portal-announcements-dot {
    width: 8px;
    height: 8px;
    border: 0;
    border-radius: 999px;
    background: #cbd5e1;
    padding: 0;
    cursor: pointer;
}

.portal-announcements-dot.is-active {
    width: 18px;
    background: #1565c0;
}

@media (max-width: 480px) {
    .portal-grid {
        grid-template-columns: 1fr;
    }

    .portal-content {
        padding: 14px;
    }

    .portal-header {
        padding: 10px 12px;
    }

    .portal-header h1 {
        font-size: 16px;
    }

    .portal-header-text p {
        font-size: 11px;
    }

    .portal-header .brand-logo-wrap {
        width: 42px;
        height: 42px;
    }

    .portal-nav a {
        font-size: 10px;
        padding: 8px 2px;
        min-height: 54px;
    }

    .portal-nav a i {
        font-size: 17px;
    }
}

.portal-install-bar-compact {
    margin-bottom: 12px;
}

.portal-body > .portal-install-bar,
.portal-body > .portal-ios-hint {
    margin: 12px 16px 0;
    width: auto;
    max-width: none;
}

.portal-install-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 auto 14px;
    max-width: 720px;
    padding: 12px 14px;
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 12px;
    box-sizing: border-box;
}

.portal-install-bar p {
    margin: 4px 0 0;
    font-size: 12px;
    color: #475569;
}

.portal-install-bar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.portal-install-apk {
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e2e8f0;
}

.portal-install-apk ol {
    margin: 10px 0 0;
    padding-left: 18px;
    color: #334155;
    font-size: 13px;
    line-height: 1.5;
}

.portal-install-note {
    margin: 6px 0 10px;
    font-size: 13px;
    color: #64748b;
}

.portal-apk-download {
    display: inline-block;
    margin-bottom: 8px;
    text-decoration: none;
}

.portal-install-apk code {
    font-size: 12px;
    word-break: break-all;
}

.portal-install-trouble {
    margin-top: 12px;
    padding: 10px 12px;
    background: #fff7ed;
    border: 1px solid #fdba74;
    border-radius: 8px;
    font-size: 13px;
    color: #9a3412;
}

.portal-install-trouble ol {
    margin: 8px 0 0;
    padding-left: 18px;
    line-height: 1.5;
}

.btn-success {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
}

.btn-success:hover {
    background: #15803d;
    border-color: #15803d;
    color: #fff;
}

.portal-ios-hint {
    margin: 0 auto 14px;
    max-width: 720px;
    padding: 10px 14px;
    background: #fff7ed;
    border: 1px solid #fdba74;
    border-radius: 12px;
    font-size: 13px;
    color: #9a3412;
    box-sizing: border-box;
}

.portal-install-bar-pwa {
    background: #ecfdf5;
    border-color: #6ee7b7;
}

.portal-install-steps-primary {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 14px;
}

.portal-install-steps-primary .install-badge {
    display: inline-block;
    background: #dcfce7;
    color: #166534;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 8px;
}

.portal-install-apk-collapsed {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #cbd5e1;
}

.portal-apk-toggle {
    padding: 0;
    font-size: 12px;
    color: #64748b;
    text-decoration: underline;
}

.portal-install-manual {
    margin: 0 auto 14px;
    max-width: 720px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    box-sizing: border-box;
}

.portal-install-manual h3 {
    margin: 0 0 10px;
    color: #0f172a;
    font-size: 16px;
}

.portal-install-manual-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.portal-install-manual-head h3 {
    margin: 0;
}

.portal-install-close {
    border: none;
    background: #e2e8f0;
    color: #334155;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.portal-install-steps {
    margin-bottom: 12px;
}

.portal-install-steps ol {
    margin: 6px 0 0;
    padding-left: 18px;
    color: #334155;
    font-size: 13px;
    line-height: 1.5;
}

.portal-install-note {
    margin: 0;
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
}

.portal-login-body .portal-install-bar,
.portal-login-body .portal-install-manual {
    width: 100%;
    max-width: 420px;
}

@media (display-mode: standalone) {
    .portal-install-bar,
    .portal-ios-hint {
        display: none !important;
    }

    .portal-top {
        padding-top: env(safe-area-inset-top, 0px);
    }
}

.portal-password-wrap {
    position: relative;
}

.portal-password-wrap input {
    width: 100%;
    padding-right: 44px;
}

.portal-password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.portal-password-toggle:hover,
.portal-password-toggle:focus {
    background: #f1f5f9;
    color: #1565c0;
    outline: none;
}

.portal-password-toggle i {
    font-size: 18px;
    line-height: 1;
}
