/* Unified Library and remaining portal surfaces. Scoped to signed-in views. */
#dashboardSection .portal-library [hidden] { display:none!important; }
.portal-library-views { display:flex; gap:6px; padding:5px; margin-bottom:22px; width:fit-content; max-width:100%; background:var(--portal-surface); border:1px solid var(--portal-border); border-radius:10px; }
.portal-library-views button { background:none; color:var(--portal-muted); border:1px solid transparent; padding:11px 18px; border-radius:7px; font-size:13px; min-height:44px; }
.portal-library-views button[aria-pressed="true"] { background:var(--portal-cyan-soft); border-color:#2f6263; color:var(--portal-cyan); }
.portal-library-card-footer { flex-wrap:wrap; }
.portal-library-store-link { display:inline-block; margin:18px 0 0; color:var(--portal-cyan); font-size:13px; }
.portal-library-ftp-section { scroll-margin:50px; }
.portal-library-ftp-heading { display:flex; justify-content:space-between; align-items:center; gap:15px; margin-bottom:12px; }
.portal-library-ftp-heading h3 { margin:0; font-size:18px; }
.portal-library-ftp-account { background:var(--portal-bg); border:1px solid var(--portal-border); border-radius:12px; padding:20px; margin:16px 0; min-width:0; }
.portal-library-ftp-account h4 { font-size:16px; color:var(--portal-text); overflow-wrap:anywhere; margin:0 0 8px; }
.portal-library-ftp-meta { color:var(--portal-muted); font-size:12px; line-height:1.6; overflow-wrap:anywhere; }
.portal-library-ftp-warning { border:1px solid #78633d; background:#30291d; color:#f3d69e; padding:13px 15px; border-radius:8px; font-size:13px; line-height:1.6; margin:14px 0; }
.portal-library-credential { display:grid; grid-template-columns:80px minmax(0,1fr) auto; gap:12px; align-items:start; padding:12px 0; border-bottom:1px solid var(--portal-border); }
.portal-library-credential > span { color:var(--portal-muted); font-size:12px; }
.portal-library-credential code { color:var(--portal-text); font-size:13px; font-family:ui-monospace,Consolas,monospace; overflow-wrap:anywhere; white-space:pre-wrap; }
.portal-library-credential-actions { display:flex; gap:12px; }
.portal-library-credential-actions button { font-size:12px!important; }
.portal-library-ftp-account .portal-library-detail-methods { margin-top:18px; }
.portal-library-danger { background:#34202c; color:#ffb4bc; border-color:#6f4051; }
.portal-library-ftp-create { border-top:1px solid var(--portal-border); margin-top:24px; padding-top:22px; }
.portal-library-ftp-create > h4 { font-size:16px; margin:0 0 12px; }
.portal-library-ftp-create p { line-height:1.65; font-size:13px; color:var(--portal-muted); }
.portal-library-ftp-confirm { border:1px solid var(--portal-border); border-radius:10px; padding:18px; margin:14px 0; background:var(--portal-surface); }
.portal-library-ftp-confirm p { margin-bottom:10px; }
.portal-library-ftp-confirm .portal-library-ftp-status { margin-top:14px; color:var(--portal-text); }
.portal-library-accounts { max-width:1000px; }

/* Replace legacy inline light backgrounds without altering layout, hidden flags or status semantics. */
#dashboardSection .portal-experience-pane :is(.retroho-status-card,.retroho-account-info,.retroho-credentials,.retroho-credentials-box,.credentials-section,.torrent-rec-card,.torrent-rec-item,.support-ticket-card,.support-discord-card,.support-info-card,.settings-card,.order-card) {
    background:var(--portal-surface)!important; color:var(--portal-text)!important; border-color:var(--portal-border)!important; box-shadow:none!important;
}
#dashboardSection .portal-experience-pane :is(.retroho-status-info,.retroho-status-info h4,.torrent-rec-title,.torrent-rec-item-title,.support-discord-card h3,.support-ticket-header h3,.support-info-item strong,.ftp-detail-value,.ftp-detail-label) { color:var(--portal-text)!important; }
#dashboardSection .portal-experience-pane :is(.retroho-status-info p,.torrent-rec-subtitle,.torrent-rec-content p,.torrent-rec-content li,.support-discord-card p,.support-ticket-header p,.support-info-item p,.account-info-details,.settings-card p) { color:var(--portal-muted)!important; }
#dashboardSection .portal-experience-pane :is(.retroho-status-icon,.torrent-rec-icon,.torrent-section-icon,.support-ticket-icon,.discord-icon) { background:var(--portal-cyan-soft)!important; color:var(--portal-cyan)!important; border-radius:12px; box-shadow:none; }
#dashboardSection .portal-experience-pane :is(.torrent-rec-header,.torrent-section-header,.support-ticket-header) { background:transparent!important; border-color:var(--portal-border)!important; }
#dashboardSection .portal-experience-pane :is(.torrent-rec-item-icon,.stat-icon) { background:var(--portal-violet-soft)!important; color:var(--portal-violet)!important; box-shadow:none; }
#dashboardSection .portal-experience-pane :is(.torrent-card,.torrent-card.provisioned,.torrent-card-header,.torrent-card .torrent-info,.torrent-card .torrent-status) { background:var(--portal-surface)!important; border-color:var(--portal-border)!important; }
#dashboardSection .portal-experience-pane .torrent-card.provisioned { border-color:#3e6854!important; }
#dashboardSection .portal-experience-pane :is(.torrent-badge,.product-badge,.order-status,.order-card-status) { background:var(--portal-violet-soft); color:#d5c4f5; border:1px solid #56446e; }
#dashboardSection .portal-experience-pane :is(.order-status.complete,.order-card-status.complete,.torrent-badge.provisioned,.status-badge.success) { background:#16372f; color:#9de2c2; border-color:#366654; }
#dashboardSection .portal-experience-pane :is(.order-status.processing,.order-card-status.processing) { background:#18323f; color:#a2dbe9; border-color:#386071; }
#dashboardSection .portal-experience-pane :is(.order-status.canceled,.order-card-status.canceled,.order-status.closed,.order-card-status.closed) { background:#3b2430; color:#ffb4bc; border-color:#744251; }
#dashboardSection #ordersTab .stat-card { background:var(--portal-surface); border:1px solid var(--portal-border); box-shadow:none; }
#dashboardSection #ordersTab .data-table { width:100%; table-layout:fixed; }
#dashboardSection #ordersTab .data-table :is(th,td) { overflow-wrap:anywhere; }
#dashboardSection #ordersTab .data-table th:nth-child(1) { width:20%; }
#dashboardSection #ordersTab .data-table th:nth-child(2) { width:15%; }
#dashboardSection #ordersTab .data-table th:nth-child(3) { width:15%; }
#dashboardSection #ordersTab .data-table :is(th,td):last-child { width:50%; }
#dashboardSection #ordersTab .data-table tr[style*="#fef2f2"], #dashboardSection #ordersTab .order-card.expired { background:#2d202b!important; }
#dashboardSection #ordersTab .data-table tr[style*="#eff6ff"], #dashboardSection #ordersTab .order-card.extended { background:#172b3c!important; }
#dashboardSection #ordersTab .order-expired-badge { background:#4b2935!important; color:#ffced4!important; }
#dashboardSection #ordersTab .order-card-badge { box-shadow:none; }
#dashboardSection #accountSettingsTab .settings-header { text-align:left!important; display:block; }
#dashboardSection #accountSettingsTab .settings-header > div { display:none!important; }
#dashboardSection #accountSettingsTab .settings-card-header > div:first-child { background:var(--portal-violet-soft)!important; color:var(--portal-violet)!important; }
#dashboardSection #accountSettingsTab .settings-card-header > div:first-child i { color:var(--portal-violet)!important; }
#dashboardSection #accountSettingsTab .settings-card { padding:24px!important; }
#dashboardSection #accountSettingsTab .account-info-details > div { gap:15px; flex-wrap:wrap; }
#dashboardSection #accountSettingsTab #accountEmailDisplay { overflow-wrap:anywhere; min-width:0; }
#dashboardSection #accountSettingsTab .btn-register-passkey { background:var(--portal-cyan)!important; color:#082529!important; box-shadow:none; }
#dashboardSection #supportTab .support-container { max-width:1100px; margin:0; }
#dashboardSection #supportTab .support-discord-card { padding:26px; }
#dashboardSection #supportTab .discord-button { background:var(--portal-violet-soft); color:#d8c7fa; border:1px solid #604c80; box-shadow:none; border-radius:8px; }
#dashboardSection #supportTab .support-ticket-card { padding:26px; }
#dashboardSection #supportTab .support-ticket-header { padding:0 0 22px; }
#dashboardSection #supportTab .support-ticket-form { padding:0; }
#dashboardSection #supportTab .support-info-card { background:var(--portal-bg)!important; }
#dashboardSection #supportTab :is(.ticket-success-message,.btn-new-ticket) { background:#15392f; color:#b1ead2; border-color:#386b57; }
#dashboardSection .portal-experience-pane :is(button,a).btn-primary { background:var(--portal-cyan)!important; color:#082529!important; }
#dashboardSection .portal-experience-pane :is(button,a).btn-secondary { background:var(--portal-raised)!important; color:var(--portal-text)!important; border:1px solid var(--portal-border); }
#dashboardSection .portal-experience-pane :is(.btn-success,.btn-provisioned) { background:#173b30!important; color:#ade7ca!important; border:1px solid #386f56; }
#dashboardSection .portal-experience-pane :is(.btn-danger,.btn-outline-danger) { color:#ffb4bc!important; background:#3b2430!important; border-color:#744251!important; }
#dashboardSection .portal-experience-pane :is([style*="color: #6b7280"],[style*="color: #888"],[style*="color: #aaa"],[style*="color: #666"],[style*="color: #9ca3af"],[style*="color: #64748b"],[style*="color: #475569"]) { color:var(--portal-muted)!important; }
#dashboardSection .portal-experience-pane :is([style*="color: #1f2937"],[style*="color: #374151"],[style*="color: #111827"],[style*="color: #333"]) { color:var(--portal-text)!important; }
#dashboardSection .portal-experience-pane :is([style*="background: #f8f9fa"],[style*="background: #f3f4f6"],[style*="background: #f9fafb"],[style*="background: #fff;"],[style*="background: white"],[style*="background: #ffffff"]) { background:var(--portal-raised)!important; color:var(--portal-text)!important; border-color:var(--portal-border)!important; }
#dashboardSection .portal-experience-pane :is([style*="background: #e0f2fe"],[style*="background: #eff6ff"],[style*="background: #f0f9ff"]) { background:#19313e!important; color:#b7deed!important; border-color:#3b6171!important; }
#dashboardSection .portal-experience-pane :is([style*="background: #fef3c7"],[style*="background: #fffbeb"]) { background:#332b1d!important; color:#f3d69e!important; border-color:#78633d!important; }
#dashboardSection .portal-experience-pane :is([style*="color: #92400e"],[style*="color: #78350f"],[style*="color: #b45309"]) { color:#f3d69e!important; }
#dashboardSection .portal-experience-pane :is([style*="color: #065f46"],[style*="color: #047857"],[style*="color: #059669"]) { color:#a3e3c3!important; }
#dashboardSection .portal-experience-pane :is([style*="color: #4f46e5"],[style*="color: #3b82f6"],[style*="color: #0284c7"]) { color:var(--portal-cyan)!important; }
body.portal-redesign :is(#createFTPModal,#guideModal,#attachmentsModal,#changelogModal,#switchServerDialog,#updatePasswordModal) :is(.modal-content,.modal-header,.modal-body,.modal-footer) { background:var(--portal-surface); color:var(--portal-text); border-color:var(--portal-border); }
body.portal-redesign :is(#createFTPModal,#guideModal,#attachmentsModal,#changelogModal,#switchServerDialog,#updatePasswordModal) :is(.text-secondary,p,label) { color:var(--portal-muted); }
body.portal-redesign :is(#createFTPModal,#guideModal,#attachmentsModal,#changelogModal,#switchServerDialog,#updatePasswordModal) .btn-secondary { color:var(--portal-text); background:var(--portal-raised); }
@media(max-width:760px) {
    #dashboardSection #ordersTab .stats-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    #dashboardSection #supportTab :is(.support-ticket-card,.support-discord-card) { padding:20px; }
    #dashboardSection #accountSettingsTab .settings-card { padding:18px!important; }
    #dashboardSection .portal-experience-pane :is(.support-ticket-header,.discord-content,.retroho-status-card) { flex-wrap:wrap; }
    #dashboardSection .portal-experience-pane :is(.support-info-card,.torrent-rec-content) { grid-template-columns:1fr; }
    #dashboardSection .portal-experience-pane .retroho-status-actions { width:100%; flex-wrap:wrap; }
}
@media(max-width:480px) {
    .portal-library-views { width:100%; }
    .portal-library-views button { flex:1; padding:10px; }
    .portal-library-credential { grid-template-columns:70px minmax(0,1fr); }
    .portal-library-credential-actions { grid-column:2; }
    .portal-library-ftp-account { padding:15px; }
    .portal-library-ftp-confirm { padding:14px; }
    .portal-library-ftp-confirm button { white-space:normal; }
}

/* Visual acceptance corrections for runtime-rendered legacy markup. */
#dashboardSection #accountSettingsTab .settings-header h2 { color:var(--portal-text)!important; font-size:clamp(25px,2.8vw,34px); font-weight:650; letter-spacing:-.75px; }
#dashboardSection .announcement-banner { background:var(--portal-surface); color:var(--portal-text); border:1px solid var(--portal-border); box-shadow:none; }
#dashboardSection .announcement-banner.info { background:#142b3c; color:#b5dcf1; border-left:3px solid #6daed3; }
#dashboardSection .announcement-banner.warning, #dashboardSection .announcement-banner.maintenance { background:#322a1d; color:#f3d69e; border-left:3px solid #cfa357; }
#dashboardSection .announcement-banner.error { background:#35222c; color:#ffc3cd; border-left:3px solid #cd788e; }
#dashboardSection .announcement-banner.success { background:#173329; color:#a8e5c6; border-left:3px solid #6eb695; }
#dashboardSection .announcement-banner :is(.announcement-title,.announcement-message,.announcement-icon,.announcement-dismiss) { color:inherit; }
#dashboardSection .announcement-banner a { color:inherit; text-decoration:underline; }
#dashboardSection #torrentsTab .retroho-password-row { background:var(--portal-bg)!important; border-color:#3c6758!important; }
#dashboardSection #torrentsTab .retroho-password-row code { background:var(--portal-raised)!important; color:var(--portal-text)!important; overflow-wrap:anywhere; max-width:100%; }
#dashboardSection #torrentsTab .retroho-password-row button { width:auto; min-width:44px; min-height:36px; height:auto; padding:7px 10px!important; background:var(--portal-raised)!important; color:var(--portal-text)!important; border-color:var(--portal-border)!important; }
#dashboardSection #torrentsTab :is(.retroho-status-actions,.torrent-actions,.torrent-links) { background:transparent; border-color:var(--portal-border); }
#dashboardSection #torrentsTab :is(.access-granted-badge,.torrent-access-granted) { background:#17372d; color:#a8e5c6; border-color:#386751; }
#dashboardSection #torrentsTab :is(.torrent-link,.btn-torrent) { background:var(--portal-cyan-soft); color:var(--portal-cyan); border:1px solid #3e6465; box-shadow:none; }
#dashboardSection #torrentsTab .torrent-links-label { color:var(--portal-muted); }

#dashboardSection #torrentsTab .torrent-image.no-image { background:var(--portal-violet-soft)!important; color:var(--portal-violet)!important; }
#dashboardSection #ordersTab .data-table tr[style*="#fef2f2"] { opacity:1!important; }
@media(max-width:760px) {
    #dashboardSection #torrentsTab .retroho-status-card { flex-direction:column; align-items:stretch; }
    #dashboardSection #torrentsTab .retroho-status-icon { width:44px; height:44px; flex:0 0 44px; align-self:flex-start; }
    #dashboardSection #torrentsTab .retroho-status-info { width:100%; min-width:0; }
}

#dashboardSection #accountSettingsTab button[onclick="logout()"] { background:#3b2430!important; color:#ffbdc6!important; border-color:#744251!important; }

/* Account operations stay inside the active product and use actual service evidence. */
.portal-library-operation,.portal-library-account-action:not(:empty){padding:18px;margin:16px 0;border:1px solid #385568;border-radius:10px;background:#142536;color:#edf3ff;min-width:0;}
.portal-library-operation.is-complete{border-color:#3f705c;background:#142d29;}
.portal-library-operation h4,.portal-library-account-action h4{margin:0 0 10px;color:#edf3ff;}
.portal-library-operation-steps{padding-left:21px;font-size:12px;line-height:1.8;color:#9eafc7;}
.portal-library-operation-steps .is-current{color:#f1d49c;}.portal-library-operation-steps .is-done,.portal-library-ftp-success{color:#9ee1bf;}
.portal-library-account-action p{margin:10px 0;line-height:1.6;overflow-wrap:anywhere;}
.portal-library-server-options{display:grid;gap:8px;margin:16px 0;max-height:240px;overflow:auto;}
.portal-library-server-option{display:flex;align-items:center;gap:12px;padding:12px;border:1px solid #3b5068;border-radius:7px;background:#0d1828;color:#edf3ff;cursor:pointer;}
.portal-library-server-option input{accent-color:#69e1de;width:17px;height:17px;flex:0 0 17px;}
.portal-library-account-action button{margin:6px 10px 0 0;min-height:42px;}
@media(max-width:600px){.portal-library-account-action{padding:13px;}.portal-library-operation{padding:14px;}.portal-library-account-action .portal-library-method{width:100%;margin-right:0;}}

.portal-library-ftp-heading{flex-wrap:wrap;gap:10px 16px}.portal-library-ftp-heading h3{margin:0;line-height:1.4}.portal-library-ftp-heading button{flex-shrink:0}

/* The Library's UsenetShare action lands on its exact published SKU, using
   the existing retro shell rather than an unstyled legacy list or direct import. */
#dashboardSection .usenet-product-selection-status {
    margin:0 0 18px;padding:13px 17px;border:1px solid #356978;
    border-radius:10px;background:#132c39;color:#d4f6f4;
    font-size:13px;line-height:1.6;overflow-wrap:anywhere;
}
#dashboardSection .usenet-product-selection-status[hidden]{display:none!important}
#dashboardSection .portal-experience-pane .public-share-card.usenet-product-selection-target {
    border-color:var(--portal-cyan,#69e1de)!important;
    box-shadow:0 0 0 2px #69e1de5c,0 16px 38px #0004;
}
#dashboardSection .portal-experience-pane .public-share-card.usenet-product-selection-target:focus-visible {
    outline:3px solid var(--portal-cyan,#69e1de);outline-offset:4px;
}
