/* Victoria V31 — dark mode hardening + mobile navigation + logo treatment + responsive feed */
:root{
  --v31-bg:var(--vx-bg,#f6fbfa);--v31-surface:var(--vx-surface,#fff);--v31-surface2:var(--vx-surface-2,#eef6f5);
  --v31-text:var(--vx-text,#102527);--v31-muted:var(--vx-muted,#708783);--v31-line:var(--vx-line,#dce9e7);
}
html[data-vx-theme="dark"]{
  --v31-bg:#050708;--v31-surface:#0c1012;--v31-surface2:#13191b;--v31-text:#f3f7f6;--v31-muted:#9aadaa;--v31-line:#283638;
}
/* Catch legacy inline white surfaces that escaped V29. Do not target media elements. */
html[data-vx-theme="dark"] [style*="background:white"],
html[data-vx-theme="dark"] [style*="background: white"],
html[data-vx-theme="dark"] [style*="background:#fff"],
html[data-vx-theme="dark"] [style*="background: #fff"],
html[data-vx-theme="dark"] [style*="background:#ffffff"],
html[data-vx-theme="dark"] [style*="background: #ffffff"],
html[data-vx-theme="dark"] [style*="background-color:white"],
html[data-vx-theme="dark"] [style*="background-color: white"],
html[data-vx-theme="dark"] [style*="background-color:#fff"],
html[data-vx-theme="dark"] [style*="background-color: #fff"],
html[data-vx-theme="dark"] [style*="background-color:#ffffff"],
html[data-vx-theme="dark"] [style*="background-color: #ffffff"],
html[data-vx-theme="dark"] [style*="background:rgb(255,255,255)"],
html[data-vx-theme="dark"] [style*="background: rgb(255, 255, 255)"]{
  background:var(--v31-surface)!important;color:var(--v31-text)!important;border-color:var(--v31-line)!important;
}
html[data-vx-theme="dark"] [style*="background:rgba(255,255,255,.96)"],
html[data-vx-theme="dark"] [style*="background: rgba(255,255,255,.96)"]{
  background:var(--v31-surface)!important;color:var(--v31-text)!important;
}
/* Common profile/admin legacy blocks */
html[data-vx-theme="dark"] .v5-profile-hero,
html[data-vx-theme="dark"] .v5-profile-section,
html[data-vx-theme="dark"] .v5-stat,
html[data-vx-theme="dark"] .v5-stat-grid > *,
html[data-vx-theme="dark"] .v5-activity,
html[data-vx-theme="dark"] .v5-role-card,
html[data-vx-theme="dark"] .v5-auth-grid > *,
html[data-vx-theme="dark"] .v5-toolbar,
html[data-vx-theme="dark"] .v5-fin-card{
  border-color:var(--v31-line)!important;
}
/* Keep explicit dark/photo areas dark and their white typography readable. */
html[data-vx-theme="dark"] .vx22-event-panel,
html[data-vx-theme="dark"] .vx22-calendar-hero-main,
html[data-vx-theme="dark"] .vx22-prefs-hero,
html[data-vx-theme="dark"] .v5-profile-hero{color:#fff}
/* Mobile header: use the horizontal space instead of leaving a blank area. */
.v31-mobile-actions{display:flex;align-items:center;justify-content:flex-end;gap:5px;margin-left:auto;min-width:0}
.v31-mobile-action{position:relative;display:grid;place-items:center;width:38px;height:38px;border-radius:12px;text-decoration:none;color:var(--vx-text-2)!important;background:var(--vx-surface-2);border:1px solid var(--vx-line);flex:0 0 auto}
.v31-mobile-action i{font-size:.94rem}.v31-mobile-action:hover{color:var(--vx-text)!important;background:var(--vx-surface)}
.v31-mobile-action-badge{position:absolute;right:-3px;top:-4px;min-width:16px;height:16px;padding:0 4px;border-radius:99px;background:#e84f67;color:#fff;font-size:9px;display:grid;place-items:center;font-weight:900;border:2px solid var(--vx-surface)}
.v31-mobile-profile img{width:24px;height:24px;border-radius:50%;object-fit:cover}.v31-mobile-profile{overflow:hidden}
.v31-logo-wrap{display:grid;place-items:center;width:46px;height:46px;border-radius:14px;background:#171b1d;border:1px solid rgba(255,255,255,.10);box-shadow:0 6px 18px rgba(0,0,0,.12);overflow:hidden}
.v31-logo-wrap img{width:38px;height:38px;object-fit:contain;display:block}
.v5-desktop-header .v31-logo-wrap{width:52px;height:52px;border-radius:15px}.v5-desktop-header .v31-logo-wrap img{width:43px;height:43px}
.v5-mobile-header .v5-brand{gap:9px;flex:0 0 auto}.v5-mobile-header .v11-brand-label strong{font-size:1rem}.v5-mobile-header .v11-brand-label small{font-size:.64rem}
/* Rich feed V31 */
.v31-feed-tools{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:14px;align-items:center;padding:12px 14px;border:1px solid var(--vx-line);background:var(--vx-surface);border-radius:20px}
.v31-feed-search{display:flex;align-items:center;gap:9px;min-width:0;background:var(--vx-surface-2);border:1px solid var(--vx-line);border-radius:14px;padding:0 13px}
.v31-feed-search input{width:100%;min-width:0;border:0;outline:0;background:transparent;color:var(--vx-text);padding:11px 0}.v31-feed-search input::placeholder{color:var(--vx-muted)}
.v31-feed-shortcuts{display:flex;gap:7px;overflow:auto;padding-bottom:2px}.v31-feed-shortcuts a{white-space:nowrap;border:1px solid var(--vx-line);background:var(--vx-surface-2);color:var(--vx-text);border-radius:12px;padding:9px 11px;text-decoration:none;font-size:.78rem;font-weight:800}
.v31-feed-stat-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.v31-feed-stat{padding:16px;border-radius:18px;border:1px solid var(--vx-line);background:var(--vx-surface);display:flex;gap:12px;align-items:center}.v31-feed-stat .icon{width:42px;height:42px;border-radius:13px;display:grid;place-items:center;background:var(--vx-surface-2);color:var(--vx-accent-dark);flex:0 0 auto}.v31-feed-stat strong{display:block;font-size:1.25rem;line-height:1}.v31-feed-stat span{display:block;color:var(--vx-muted);font-size:.72rem;margin-top:4px}
.v31-feed-section-title{display:flex;justify-content:space-between;align-items:end;gap:14px;margin-bottom:13px}.v31-feed-section-title h2{margin:0;font-size:1.18rem;font-weight:900}.v31-feed-section-title p{margin:3px 0 0;color:var(--vx-muted);font-size:.82rem}
.v31-topic-rail{display:flex;gap:9px;overflow:auto;padding:2px 2px 8px}.v31-topic{min-width:118px;padding:14px;border:1px solid var(--vx-line);border-radius:18px;background:var(--vx-surface);text-decoration:none;color:var(--vx-text)!important}.v31-topic i{font-size:1.05rem;color:var(--vx-accent-dark);margin-bottom:9px}.v31-topic b{display:block;font-size:.82rem}.v31-topic small{color:var(--vx-muted);font-size:.7rem}
.v31-feature-grid{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(260px,.6fr);gap:16px}.v31-feature-main{position:relative;min-height:300px;border-radius:24px;overflow:hidden;background:#071113;color:#fff}.v31-feature-main img{width:100%;height:100%;object-fit:cover;display:block;opacity:.76}.v31-feature-main:after{content:"";position:absolute;inset:0;background:linear-gradient(0deg,rgba(0,0,0,.82),rgba(0,0,0,.08) 75%)}.v31-feature-copy{position:absolute;z-index:2;left:22px;right:22px;bottom:20px}.v31-feature-copy h2{font-size:clamp(1.35rem,3vw,2.2rem);font-weight:950;margin:6px 0}.v31-feature-copy p{color:#d8e6e3;margin:0 0 12px;max-width:680px}.v31-feature-side{display:grid;gap:10px}.v31-mini-card{display:flex;gap:11px;align-items:center;padding:12px;border-radius:18px;border:1px solid var(--vx-line);background:var(--vx-surface);color:var(--vx-text);text-decoration:none}.v31-mini-card img{width:56px;height:64px;border-radius:13px;object-fit:cover;flex:0 0 auto}.v31-mini-card strong{font-size:.82rem;display:block}.v31-mini-card small{display:block;color:var(--vx-muted);margin-top:3px}
.v31-feed-composer{display:flex;gap:12px;align-items:center;padding:14px;border:1px solid var(--vx-line);background:var(--vx-surface);border-radius:20px}.v31-feed-composer .avatar{width:42px;height:42px;border-radius:50%;object-fit:cover;flex:0 0 auto}.v31-feed-composer .fake-input{flex:1;background:var(--vx-surface-2);border:1px solid var(--vx-line);border-radius:14px;color:var(--vx-muted);padding:11px 13px;text-decoration:none;font-size:.82rem}.v31-feed-composer .actions{display:flex;gap:7px}.v31-feed-composer .actions a{width:40px;height:40px;display:grid;place-items:center;border-radius:12px;background:var(--vx-surface-2);color:var(--vx-text)!important;text-decoration:none}
@media(max-width:900px){.v31-feed-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.v31-feature-grid{grid-template-columns:1fr}}
@media(max-width:767px){
  .v31-mobile-actions{gap:4px}.v31-mobile-action{width:35px;height:35px;border-radius:10px}.v31-mobile-action:nth-child(n+5){display:none}
  .v31-logo-wrap{width:42px;height:42px;border-radius:12px}.v31-logo-wrap img{width:35px;height:35px}
  .v5-mobile-header{padding-left:10px!important;padding-right:10px!important}.v5-mobile-header .v11-brand-label{display:none}
  .v31-feed-tools{grid-template-columns:1fr}.v31-feed-stat-grid{gap:8px}.v31-feed-stat{padding:12px}.v31-feed-stat .icon{width:36px;height:36px}.v31-feed-stat strong{font-size:1.05rem}.v31-feed-stat span{font-size:.66rem}
  .v31-feature-main{min-height:360px}.v31-feature-copy{left:16px;right:16px;bottom:16px}.v31-feed-composer .actions a{width:35px;height:35px}.v31-feed-composer .actions a:nth-child(n+2){display:none}
}
@media(max-width:390px){.v31-mobile-action{width:33px;height:33px}.v31-mobile-actions{gap:3px}.v5-mobile-header .v5-brand{gap:5px}.v31-logo-wrap{width:40px;height:40px}.v31-logo-wrap img{width:33px;height:33px}.v31-feed-stat-grid{grid-template-columns:1fr 1fr}.v31-feed-stat{gap:8px;padding:10px}.v31-feed-stat .icon{width:32px;height:32px;font-size:.8rem}}
/* Additional dark-mode normalization for legacy components that hard-code light UI. */
html[data-vx-theme="dark"] .v11-live-toolbar select,
html[data-vx-theme="dark"] .v11-radar-toolbar select,
html[data-vx-theme="dark"] .v11-results-tools select,
html[data-vx-theme="dark"] .v11-search-toolbar select,
html[data-vx-theme="dark"] .v11-toolbar select{background:var(--v31-surface)!important;color:var(--v31-text)!important;border-color:var(--v31-line)!important}
html[data-vx-theme="dark"] .vx22-theme-choice,
html[data-vx-theme="dark"] .vx22-performance-options button{background:var(--v31-surface)!important;color:var(--v31-text)!important;border-color:var(--v31-line)!important}
html[data-vx-theme="dark"] .vx22-theme-choice:hover,
html[data-vx-theme="dark"] .vx22-performance-options button:hover,
html[data-vx-theme="dark"] .vx22-theme-choice.is-active,
html[data-vx-theme="dark"] .vx22-performance-options button.is-active{background:var(--v31-surface2)!important;color:var(--v31-text)!important}
html[data-vx-theme="dark"] .v5-list-card,
html[data-vx-theme="dark"] .v5-carousel,
html[data-vx-theme="dark"] .v5-app-card,
html[data-vx-theme="dark"] .v5-fin-card,
html[data-vx-theme="dark"] .v5-candidate-admin-card,
html[data-vx-theme="dark"] .v5-empty,
html[data-vx-theme="dark"] .v5-role-card,
html[data-vx-theme="dark"] .v5-auth-form,
html[data-vx-theme="dark"] .vx-sponsor-card{background:var(--v31-surface)!important;color:var(--v31-text)!important;border-color:var(--v31-line)!important}
html[data-vx-theme="dark"] .v5-list-body h3,
html[data-vx-theme="dark"] .v5-app-body h3,
html[data-vx-theme="dark"] .v5-fin-card h3,
html[data-vx-theme="dark"] .v5-candidate-admin-card h3,
html[data-vx-theme="dark"] .v5-empty h3{color:var(--v31-text)!important}
html[data-vx-theme="dark"] .v5-candidate-admin-photo span{background:rgba(12,16,18,.92)!important;color:var(--v31-text)!important;border:1px solid var(--v31-line)}
html[data-vx-theme="dark"] .v5-status.ok{background:rgba(61,194,151,.14)!important;color:#8ce8c7!important;border-color:rgba(61,194,151,.28)!important}
html[data-vx-theme="dark"] .v5-status.wait{background:rgba(244,190,71,.14)!important;color:#f4d58b!important;border-color:rgba(244,190,71,.25)!important}
html[data-vx-theme="dark"] .v5-status.no{background:rgba(235,98,88,.14)!important;color:#ffaaa3!important;border-color:rgba(235,98,88,.25)!important}
@media(max-width:767px){.v31-mobile-action:nth-child(n+7){display:none}}
