/* Shared neutral surfaces for legacy pages; map/media layouts retain their controls. */
:root,[data-theme="light"]{--vd-paper:#fff;--vd-ink:#172d49;--vd-muted:#52657d;--bg-primary:#f8fafc;--bg-secondary:#fff;--bg2:#fff;--bg3:#eef4fa;--bg4:#e5edf6;--card2:#eef4fa;--surface:#fff;--surface2:#eef4fa;--text:#172d49;--txt:#172d49;--text2:#52657d;--muted:#52657d;--dim:#52657d;--brd:#dce5ef}
[data-theme="dark"]{--vd-paper:#17283f;--vd-ink:#edf5ff;--vd-muted:#b0c1d5;--bg-primary:#101c30;--bg-secondary:#17283f;--bg2:#17283f;--bg3:#203650;--bg4:#304660;--card2:#203650;--surface:#17283f;--surface2:#203650;--text:#edf5ff;--txt:#edf5ff;--text2:#b0c1d5;--muted:#b0c1d5;--dim:#b0c1d5;--brd:#304660}
html{max-width:100%;overflow-x:clip}body{min-width:0}main,.container,.content,.main,.main-content,.page-content,.card,.panel,.section,.modal-content{min-width:0}input,textarea,select{max-width:100%}input:not([type=checkbox]):not([type=radio]):not([type=file]),textarea,select{color:var(--vd-ink);background:var(--vd-paper)}button,a{overflow-wrap:anywhere}p,li,dd,.card,.section{overflow-wrap:anywhere}pre{overflow:auto;max-width:100%;white-space:pre-wrap}table{max-width:100%}img,video,iframe{max-width:100%}dialog{overscroll-behavior:contain}button:disabled{cursor:default}.vd-bottom{padding-bottom:calc(9px + env(safe-area-inset-bottom))}.vd-bottom a{min-height:44px}button[hidden],a[hidden],[hidden]{display:none!important}
@media(max-width:680px){header:not(.vdc-header) .header-content{flex-wrap:wrap;gap:12px}header:not(.vdc-header){padding-left:16px;padding-right:16px}header .logo{min-width:0}header h1{font-size:clamp(19px,6vw,27px)}.container:not(#mainContainer){padding-left:16px!important;padding-right:16px!important;width:100%;max-width:100%}.grid{grid-template-columns:minmax(0,1fr)!important}.gallery-grid{grid-template-columns:minmax(0,1fr)!important}.tabs,.tab-buttons,.tab-nav,.filter-tabs{max-width:100%;overflow-x:auto;flex-wrap:nowrap;-webkit-overflow-scrolling:touch}.tabs>*,.tab-buttons>*,.filter-tabs>*{flex-shrink:0}.modal-content,.modal-box{max-width:calc(100vw - 24px)!important;max-height:85dvh;overflow:auto;padding:20px!important}body>footer{padding-bottom:90px}body:not(.vdc-page) .btn,body:not(.vdc-page) .back-btn{min-height:40px}.vdc-help-status .vdc-tag{margin-bottom:0}.form-row,.two-col{grid-template-columns:1fr!important}.vdc-table-scroll{max-width:100%;overflow:auto;overscroll-behavior:contain}.vdc-table-scroll table{min-width:560px}.vdc-compact-form{flex-wrap:wrap!important}.vdc-compact-form>*{min-width:0!important;max-width:100%!important}.vdc-responsive-grid{grid-template-columns:minmax(0,1fr)!important}.vdc-flex-wrap{flex-wrap:wrap!important}.vdc-mobile-fit{width:100%!important;max-width:100%!important;margin-left:0!important}.vdc-surface-fix{background:var(--vd-paper)!important;color:var(--vd-ink)!important}}
@media(max-width:680px){
.chart-grid{grid-template-columns:minmax(0,1fr)!important}.chart-container{min-width:0;max-width:100%}
.stats-row{grid-template-columns:repeat(2,minmax(0,1fr))!important}.stat-card{min-width:0}
.topbar,.topbar-right,.hdr-right{flex-wrap:wrap!important;max-width:100%;height:auto!important;gap:10px!important}
.topbar{padding:14px 16px!important}.topbar-left{min-width:0;flex-wrap:wrap}.hdr-right{justify-content:flex-start}
.search-bar{flex-wrap:wrap!important;padding:12px!important;gap:12px!important}.search-bar .search-input{flex-basis:100%;min-width:0}.search-sep{display:none}.search-bar .search-select{flex:1;min-width:0;max-width:100%}.search-bar .search-btn{width:100%;justify-content:center}
.cat-wrap{min-width:0!important;flex-wrap:wrap!important;max-width:100%}.cat-scroll{max-width:100%}.filter-chips{flex-wrap:wrap!important;max-width:100%;overflow:visible!important}
.header-top,.header-actions{flex-wrap:wrap!important;max-width:100%;min-width:0}.header-top{height:auto!important}.header-actions{gap:8px!important}
[data-vd-page="messages"] .container{display:flex!important;flex-direction:column;height:auto!important;min-height:calc(100dvh - 160px)}
[data-vd-page="messages"] .conversations{width:100%;max-height:240px;flex:none;overflow-y:auto;border-bottom:1px solid var(--border)}
[data-vd-page="messages"] .chat-area{width:100%;min-width:0;min-height:460px}
[data-vd-page="messages"] .chat-messages{min-height:240px}
[data-vd-page="poi"] #header{height:auto!important;min-height:64px;flex-wrap:wrap;gap:12px;padding:12px 16px!important}
[data-vd-page="poi"] .header-actions{width:100%;justify-content:flex-start}
[data-vd-page="poi"] #app{height:calc(100dvh - 76px)}
[data-vd-page="fewo-admin"] .layout,[data-vd-page="fewo-vermieter"] .layout,[data-vd-page="dangast-admin"] .layout{flex-direction:column!important;height:auto!important;overflow:visible!important}
[data-vd-page="fewo-admin"] .sidebar,[data-vd-page="fewo-vermieter"] .sidebar,[data-vd-page="dangast-admin"] .sidebar{width:100%!important;min-width:0!important;max-width:100%;overflow:visible}
[data-vd-page="fewo-admin"] .main,[data-vd-page="fewo-vermieter"] .main{width:100%;overflow:visible}
[data-vd-page="fewo-admin"] .page,[data-vd-page="fewo-vermieter"] .page{padding:22px 16px}
[data-vd-page="dangast-admin"] .map-area{height:500px;min-height:400px;flex:none}
[data-vd-page="dangast-admin"] .map-toolbar{position:relative;left:auto;top:auto;transform:none;flex-wrap:wrap;margin:10px;max-width:calc(100% - 20px)}
[data-vd-page="info-varel"] header nav{height:auto!important;flex-wrap:wrap;padding:10px 0;overflow:visible!important}
[data-vd-page="info-varel"] header>div>div{height:auto!important;min-height:62px}
[data-vd-page="tracking"] .ambient{max-width:100vw;pointer-events:none}
}
header .header-content{min-width:0;width:100%}.header-top{min-width:0;max-width:100%}.header-nav{min-width:0;max-width:100%}
@media(max-width:680px){header .header-content{width:100%!important;max-width:100%!important;align-items:stretch!important}.header-top{width:100%!important}.header-nav{width:100%!important}.header-actions{width:100%}.chart-grid{width:100%}.stat-card{overflow-wrap:anywhere}}
[data-vd-page="fewo-admin"] .drawer{width:min(520px,100vw)}[data-vd-page="fewo-admin"] .drawer:not(.open){visibility:hidden;pointer-events:none}
[data-vd-page="index1"] .header-nav,[data-vd-page="vor-index"] .header-nav{height:auto!important;flex-wrap:wrap!important;overflow:visible;padding:10px 0}
@media(max-width:680px){[data-vd-page="index1"] .header-nav .nav-link,[data-vd-page="vor-index"] .header-nav .nav-link{min-height:40px}}
/* Unified structural surfaces; explicit saved mode is the only theme source. */
:root[data-theme="light"]{--bg:#f8fafc;--card:#fff;--bg-primary:#f8fafc;--bg-secondary:#fff;--bg2:#fff;--bg3:#eef4fa;--bg-dark:#f8fafc;--bg-card:#fff;--text:#172d49;--text-light:#172d49;--muted:#52657d;--text-muted:#52657d;--border:#dce5ef}
:root[data-theme="dark"]{--bg:#101c30;--card:#17283f;--bg-primary:#101c30;--bg-secondary:#17283f;--bg2:#17283f;--bg3:#203650;--bg-dark:#101c30;--bg-card:#17283f;--text:#edf5ff;--text-light:#edf5ff;--muted:#b0c1d5;--text-muted:#b0c1d5;--border:#304660}
:root[data-theme="light"] .vd-theme-surface{background:#fff!important;color:#172d49!important;border-color:#dce5ef!important;box-shadow:0 3px 18px rgba(30,58,138,.05)!important}
:root[data-theme="dark"] .vd-theme-surface{background:#17283f!important;color:#edf5ff!important;border-color:#304660!important;box-shadow:none!important}
:root[data-theme="light"] body[data-vd-page="pinnwand"] .hero{background:#eef4fa!important;color:#172d49!important;border-color:#dce5ef}
:root[data-theme="light"] body[data-vd-page="pinnwand"] header,:root[data-theme="light"] body[data-vd-page="pinnwand"] footer{background:#fff!important;color:#172d49!important}
:root[data-theme="light"] body[data-vd-page="pinnwand"] .hero-title,:root[data-theme="light"] body[data-vd-page="pinnwand"] .brand-title{background:none!important;color:#1e3a8a!important;-webkit-text-fill-color:#1e3a8a!important}
:root[data-theme="light"] body[data-vd-page="pinnwand"] .hero-sub,:root[data-theme="light"] body[data-vd-page="pinnwand"] .stat-row{color:#52657d!important}
:root[data-theme="light"] body[data-vd-page="pinnwand"] .ftab,:root[data-theme="light"] body[data-vd-page="pinnwand"] .btn-back{background:#fff!important;color:#334b68!important;border:1px solid #c7d5e5!important}
:root[data-theme="light"] body[data-vd-page="pinnwand"] .ftab.active{background:#1e3a8a!important;color:#fff!important;border-color:#1e3a8a!important}
:root[data-theme="light"] body[data-vd-page="pinnwand"] .board{background:repeating-linear-gradient(0deg,transparent,transparent 28px,rgba(100,73,30,.04) 28px,rgba(100,73,30,.04) 30px),linear-gradient(120deg,#f5e6cb,#ead5b3)!important;border-color:#cbb48b!important;box-shadow:inset 0 0 35px rgba(120,85,30,.05),0 8px 24px rgba(30,58,138,.09)!important}
:root[data-theme="light"] body[data-vd-page="pinnwand"] .cork-top{background:#d8bb8c!important;border-color:#cbb48b!important}
:root[data-theme="light"] body[data-vd-page="pinnwand"] .empty-board{color:#654c2b!important}
:root[data-theme="light"] body[data-vd-page="pinnwand"] .fselect option{background:#fff;color:#172d49}
:root[data-theme="dark"] body[data-vd-page="pinnwand"] .hero{color:#edf5ff}
:root[data-theme="dark"] body[data-vd-page="pinnwand"] .hero-title{color:#edf5ff!important}
:root[data-theme="dark"] body[data-vd-page="pinnwand"] .empty-board{color:#f5e6cb!important}
:root[data-theme="dark"] body[data-vd-page="admin"]{--bg:#101c30!important;--bg2:#17283f!important;--bg3:#203650!important;--text:#edf5ff!important;--text-light:#edf5ff!important;--muted:#b0c1d5!important;--text-muted:#b0c1d5!important;--border:#304660!important;background:#101c30!important;color:#edf5ff!important}
:root[data-theme="dark"] body[data-vd-page="admin"] .topbar,:root[data-theme="dark"] body[data-vd-page="admin"] .sidebar,:root[data-theme="dark"] body[data-vd-page="admin"] .section,:root[data-theme="dark"] body[data-vd-page="admin"] .stat-box,:root[data-theme="dark"] body[data-vd-page="admin"] .chart-wrap,:root[data-theme="dark"] body[data-vd-page="admin"] .modal,:root[data-theme="dark"] body[data-vd-page="admin"] .admin-mobile-nav{background:#17283f!important;color:#edf5ff!important;border-color:#304660!important}
:root[data-theme="dark"] body[data-vd-page="admin"] .main{background:#101c30!important}
:root[data-theme="dark"] body[data-vd-page="admin"] .page-title,:root[data-theme="dark"] body[data-vd-page="admin"] .section-title,:root[data-theme="dark"] body[data-vd-page="admin"] .chart-wrap h3,:root[data-theme="dark"] body[data-vd-page="admin"] .modal-title{color:#edf5ff!important}
:root[data-theme="dark"] body[data-vd-page="admin"] .nav-item,:root[data-theme="dark"] body[data-vd-page="admin"] .sidebar-section,:root[data-theme="dark"] body[data-vd-page="admin"] .page-sub,:root[data-theme="dark"] body[data-vd-page="admin"] .stat-label,:root[data-theme="dark"] body[data-vd-page="admin"] .form-group label{color:#b0c1d5!important}
:root[data-theme="dark"] body[data-vd-page="admin"] .topbar-logo{color:#edf5ff!important;-webkit-text-fill-color:#edf5ff!important}
:root[data-theme="dark"] body[data-vd-page="admin"] #badge-grid>div,:root[data-theme="dark"] body[data-vd-page="admin"] .list-item,:root[data-theme="dark"] body[data-vd-page="admin"] input,:root[data-theme="dark"] body[data-vd-page="admin"] select,:root[data-theme="dark"] body[data-vd-page="admin"] textarea{background:#203650!important;color:#edf5ff!important;border-color:#49607a!important}
