/* Shared HOME Navy Glass tokens mirror HomeNavy and HomeNavyCardSurface in SwiftUI. */
:root{--bg:#0d1627;--panel:rgba(25,39,56,.98);--panel2:#29385f;--border:rgba(255,255,255,.13);--border2:rgba(255,255,255,.17);--line:rgba(255,255,255,.13);--line2:rgba(255,255,255,.17);--text:#f5f7fc;--muted:#9aabc3;--muted2:#9aabc3;--blue:#58b5fa;--violet:#a36bff;--green:#54c8aa;--home-text:#f5f7fc;--home-muted:#9aabc3;--home-surface:#17253c;--home-control:#192738;--home-line:rgba(255,255,255,.13);--home-line-strong:rgba(255,255,255,.17);--navy-card:linear-gradient(to bottom left,rgba(41,56,95,.94),rgba(25,39,56,.98),#142032);--navy-shadow:0 5px 24px #0000002e;--navy-radius:14px}
html,body{color-scheme:dark;background:#0d1627;color:var(--text)}body{background:linear-gradient(to bottom left,#111a2e,#0d1627,#09111e);background-attachment:fixed;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,sans-serif;font-size:16px;line-height:1.45}
body .scene{background:linear-gradient(to bottom left,#111a2e,#0d1627,#09111e)}body .scene :is(.nebula,.mesh,.grain,.mouse-aura,canvas){display:none}
body .page{width:min(1520px,calc(100% - 48px));padding-top:24px}body .topbar{font-family:inherit;gap:20px;flex-wrap:wrap;border:0;padding-bottom:22px}body .brand-copy strong{font-size:30px;letter-spacing:-.04em;line-height:1.05}body .brand-copy small{font-size:13px;letter-spacing:0;color:var(--muted)}body .brand-mark{color:var(--blue);background:rgba(88,181,250,.17);border-radius:12px;font-size:24px}body .clock{font-size:24px}body .date{font-size:13px}body .top-actions{gap:12px;flex-wrap:wrap}
body .main-nav{border-radius:24px;background:rgba(25,39,56,.7);border-color:var(--border);flex-wrap:wrap}body .main-nav :is(a,summary){font-size:14px;letter-spacing:0;min-height:44px;display:flex;align-items:center;border-radius:22px}body .main-nav a.active,body .main-nav details.active>summary{background:rgba(88,181,250,.19);color:var(--text)}body .nav-submenu{background:#192738;border-radius:14px;font-size:15px}
body :is(.admin-card,.home-platform-card,.home-house-card,.home-editor-summary,.health-card,.link-card,.shopping-shell,.reminder-card,.recipe-card,.auto-rule-card,.presence-card,.system-card,.media-service-card,.smart-admin-bridge,.smart-device-card,.home-empty,.empty-state){background:var(--navy-card);border:1px solid var(--border);border-radius:var(--navy-radius);box-shadow:var(--navy-shadow)}
body :is(.home-editor,.modal-dialog,.dialog-card,.home-user-modal-dialog,.login-card){color:var(--text);background:linear-gradient(to bottom left,#202e4a,#111c2e);border:1px solid var(--border);border-radius:20px;box-shadow:0 24px 80px #0007}body dialog::backdrop{background:#040b1870;backdrop-filter:blur(12px)}body :is(.home-editor-head,.home-editor-actions,.modal-header,.modal-actions){background:rgba(23,37,60,.96);border-color:var(--border)}body .home-editor-actions{position:sticky;bottom:0;z-index:3;padding-bottom:max(16px,env(safe-area-inset-bottom))}
body :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden]),select,textarea){background:rgba(16,30,50,.75);border:1px solid var(--border);border-radius:12px;color:var(--text);font:inherit;font-size:16px;min-height:44px;padding:10px 12px;max-width:100%}body :is(input,textarea)::placeholder{color:#9aabc3}body :is(input[type=checkbox],input[type=radio],input[type=range]){accent-color:#6559f7}body :is(label,legend){color:var(--text)}
body :is(button,.home-button,.owner-button,.manage-link){font-family:inherit;font-size:15px;letter-spacing:0;border-radius:12px;min-height:44px}body :is(button,.home-button,.owner-button){background:rgba(43,59,84,.78);border-color:var(--border);color:var(--text)}body :is(button.primary,button[type=submit],.home-button.primary,.primary.full){background:#247aec;color:white;border-color:#58b5fa55}body :is(button,.home-button):disabled{opacity:.5;cursor:not-allowed}body :is(.danger,.danger-soft){color:#ff9aa9;background:rgba(238,97,139,.12)}
body :is(.tabs,.smart-admin-tabs,.auto-filter,.home-house-tabs,.recipe-tabs){gap:7px;flex-wrap:wrap}body :is(.tabs,.smart-admin-tabs,.auto-filter,.home-house-tabs,.recipe-tabs) button{border-radius:999px}body :is(.section-head h2,h2){letter-spacing:-.025em}body :is(p,.muted,.reminder-meta){line-height:1.5}body table{font-size:15px}body :is(th,td){padding:12px;overflow-wrap:anywhere}body .table-wrap{overflow:auto}
body .sidebar{background:rgba(15,25,43,.94);border-color:var(--border)}body .admin-layout{grid-template-columns:280px minmax(0,1fr)}body .admin-main{min-width:0;max-width:none}body .admin-header{flex-wrap:wrap;gap:16px}body .sidebar :is(nav a,summary){min-height:44px;font-size:15px;border-radius:12px}body .admin-brand strong{font-size:24px;letter-spacing:-.03em}body .sidebar nav a.active{background:rgba(88,181,250,.17);color:#58b5fa}
body .link-grid{align-items:stretch;grid-auto-rows:1fr}body .link-card{height:232px;min-width:0;transform:none;padding:20px}body .link-card:hover{border-color:#58b5fa66;background:linear-gradient(to bottom left,#30436a,#192738,#142032);transform:translateY(-2px)}body .link-card :is(h3,p){overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}body .link-card h3{font-size:20px;line-height:1.25;height:2.5em}body .card-copy{margin-top:15px;min-width:0}body .service-logo{width:44px;height:44px;border-radius:12px}body .card-foot{padding-top:10px}
body .recipe-cards{align-items:stretch;grid-auto-rows:1fr}body .recipe-card{min-width:0;height:100%;display:flex;flex-direction:column}body .recipe-card :is(h2,h3,p){display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;text-overflow:ellipsis}body .recipe-card h2{min-height:2.6em}body .auto-rule-card{height:260px;display:flex;flex-direction:column;min-width:0}body .auto-rule-card>strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}body .auto-rule-card>p{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden}body .auto-rule-card .auto-footer{margin-top:auto;flex-wrap:wrap}
.home-premium-editor .home-premium-features{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:16px;background:var(--navy-card);border:1px solid var(--border);border-radius:14px}.home-premium-features h3{grid-column:1/-1;margin:0 0 6px}.home-premium-editor .home-premium-plans{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.home-premium-plan{min-width:0;padding:16px;border:1px solid var(--border);border-radius:14px;background:var(--navy-card)}.home-premium-plan h3{margin:0 0 12px}.home-premium-editor .home-premium-quota{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 10px;margin:10px 0;padding-bottom:10px;border-bottom:1px solid var(--border)}.home-premium-quota>label:first-child{display:grid;grid-template-columns:minmax(0,1fr) 90px;gap:8px;align-items:center;font-size:14px}.home-premium-quota>label.toggle-line{font-size:13px;gap:6px;align-self:center}.home-premium-quota input[type=number]{width:90px;min-width:0}.home-premium-effect{grid-column:1/-1;color:var(--muted);font-size:12px}.home-premium-note{font-size:13px;color:var(--muted)}
.home-start-greeting{position:relative;overflow:hidden;padding:28px;min-height:230px;display:flex;align-items:flex-start;gap:18px;background:var(--navy-card);border:1px solid var(--border);border-radius:14px;box-shadow:var(--navy-shadow);isolation:isolate}.home-start-greeting:before{content:"";position:absolute;inset:0;background:linear-gradient(90deg,#142032c9,transparent 65%),url('/assets/images/HomeGreetingLandscape.png') center/cover no-repeat;opacity:.85;z-index:-1}.home-start-greeting h1{font-size:clamp(25px,3vw,38px);line-height:1.2;letter-spacing:-.025em;margin:0 0 10px}.home-start-greeting p{font-size:16px;color:var(--muted);margin:0;max-width:680px}.home-start-symbol{color:#f7d44b;width:42px;height:42px;flex:none;font-size:34px}.home-start-greeting-copy{min-width:0;flex:1}.home-start-greeting-date{text-align:right;flex:none;font-size:14px;color:var(--muted)}
.home-feature-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:18px 0 28px}.home-feature-card{display:flex;flex-direction:column;gap:16px;height:192px;min-width:0;padding:20px;color:var(--text);text-decoration:none;background:var(--navy-card);border:1px solid var(--border);border-radius:14px;box-shadow:var(--navy-shadow)}.home-feature-icon{width:44px;height:44px;display:grid;place-items:center;color:var(--feature-color);background:color-mix(in srgb,var(--feature-color) 17%,transparent);border-radius:11px}.home-feature-icon svg{width:27px;height:27px;fill:currentColor}.home-feature-card-copy{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 12px;margin-top:auto;min-width:0}.home-feature-card strong{font-size:21px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.home-feature-card small{color:var(--muted);font-size:15px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.home-feature-card b{grid-column:2;grid-row:1/3;align-self:center;color:var(--muted)}.home-feature-card:hover{border-color:#58b5fa77}.home-start .hero{min-height:auto;grid-template-columns:minmax(0,1fr) 340px;gap:20px;padding:8px 0 0;align-items:stretch}.home-start .health-card{border-radius:14px}.home-start .health-title{padding:16px}.home-start .health-metric{padding:14px}
.reminder-weekdays{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.reminder-weekdays label{min-height:44px;display:flex;align-items:center;gap:10px}.reminder-schedule{padding:16px;border:1px solid var(--border);border-radius:14px}.reminder-schedule>label{display:grid;gap:8px;margin-bottom:12px}
@media(max-width:1100px){body .admin-layout{grid-template-columns:240px minmax(0,1fr)}.home-start .hero{grid-template-columns:1fr}.home-feature-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.home-premium-editor .home-premium-quota{grid-template-columns:1fr}.home-premium-quota>label.toggle-line{justify-self:start}}
@media(max-width:760px){body .page{width:calc(100% - 28px);padding-top:14px}body .admin-layout{display:block}body .sidebar{position:relative;width:auto;height:auto;padding:14px}body .admin-main{padding:18px 14px}body .topbar{gap:14px}body .main-nav{width:100%;order:3}body .top-actions{margin-left:auto}body .clock-wrap{display:none}.home-premium-editor .home-premium-plans,.home-premium-editor .home-premium-features{grid-template-columns:1fr}.home-start-greeting{padding:20px;gap:12px}.home-start-greeting-date{font-size:12px}.home-feature-card{height:174px;padding:16px;gap:12px}.home-feature-card strong{font-size:18px}.home-feature-card small{font-size:14px}}
@media(max-width:380px){.home-feature-grid{gap:10px}.home-feature-card{padding:13px}.home-start-greeting-date{display:none}.home-premium-quota>label:first-child{grid-template-columns:minmax(0,1fr) 78px}}
@media(prefers-reduced-transparency:reduce){body :is(.main-nav,.sidebar,.topbar){background:#17253c}body dialog::backdrop{backdrop-filter:none}}
@media(prefers-reduced-motion:reduce){body .link-card:hover{transform:none}}
.home-admin-search{position:relative;flex:1 1 300px;max-width:540px;min-width:200px;z-index:50}.home-admin-search label{display:block}.home-admin-search input[type=search]{width:100%;padding-left:16px;border-radius:999px}.home-admin-search-results{position:absolute;top:calc(100% + 8px);right:0;left:0;max-height:min(65vh,600px);overflow:auto;padding:8px;background:linear-gradient(to bottom left,#243351,#132034);border:1px solid var(--border);border-radius:16px;box-shadow:0 18px 60px #0009}.home-admin-search-hit{display:flex;flex-direction:column;gap:3px;padding:12px;border-radius:10px;text-decoration:none;min-height:58px}.home-admin-search-hit:hover,.home-admin-search-hit.selected{background:#58b5fa26}.home-admin-search-hit strong{font-size:15px}.home-admin-search-hit small,.home-admin-search-results p{color:var(--muted);font-size:13px}.home-admin-search-target{outline:2px solid var(--blue)!important;outline-offset:5px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}body :is(.app-info .card,.auth-shell,.login-panel,.home-registration .card){background:var(--navy-card);border:1px solid var(--border);border-radius:14px}

body .home-editor{font-family:inherit}body .home-editor .toggle-line{background:rgba(25,39,56,.65);border-color:var(--border);color:var(--text);border-radius:12px}body .home-editor .home-editor-actions button.primary{background:#247aec;border-color:#58b5fa55}

body .home-start .hero:not(:has(.health-card)),body.home-start .hero:not(:has(.health-card)){grid-template-columns:1fr}body :is(.home-presence-main,.home-presence-person,.media-card,.media-empty,.media-dashboard-hero,.media-ops-summary article,.stream-card,.media-ops-panel,.history-card,.home-state-card,.presence-summary article,.person-card,.guest-card,.unknown-card,.infra-summary article,.node-card,.metric-ring-card,.container-card,.service-status-card,.smart-card,.room-card,.light-card,.scene-card-static,.dashboard-category,.smart-modal-card){background:var(--navy-card);border-color:var(--border);border-radius:14px;box-shadow:var(--navy-shadow)}body .recipe-grid:not(.recipe-compact){grid-auto-rows:1fr;align-items:stretch}body .recipe-grid:not(.recipe-compact) .recipe-card{height:100%;min-width:0}body .recipe-grid:not(.recipe-compact) .recipe-card-open{display:flex;flex-direction:column;flex:1;min-width:0;background:transparent}body .recipe-grid:not(.recipe-compact) .recipe-actions{margin-top:auto}body .recipe-grid:not(.recipe-compact) .recipe-description{height:3em;line-height:1.5}body .recipe-grid:not(.recipe-compact) .recipe-card h2{height:2.6em;line-height:1.3}body .recipe-grid:not(.recipe-compact) .recipe-badges{height:2em;overflow:hidden}body .recipe-compact .recipe-card{height:auto}

/* Existing page-specific surfaces share the SwiftUI Navy material without changing their layout. */
body :is(.system-hero,.presence-hero,.media-hero,.app-admin-hero,.presence-admin-hero,.auth-card,.permission-group-card,.user-permission-card,.permission-area-panel,.jellyfin-link-panel,.guest-admin-panel,.user-resource-panel,.presence-admin-summary article,.presence-admin-card,.presence-settings-form,.app-checklist-grid article,.app-device-card,.user-lamp-card,.push-worker-card,.loading-state,.empty-state-small,.automation-list article,.seerr-season-dialog){background:var(--navy-card);border-color:var(--border);border-radius:14px;box-shadow:var(--navy-shadow)}
body :is(.permission-group-card>header,.user-resource-panel>header,.presence-admin-card-actions,.presence-device-list,.media-ops-panel>header,.smart-toolbar,.home-user-modal-header){background:rgba(23,37,60,.96);border-color:var(--border)}
body :is(.guest-choice-list>label,.guest-hue-light-list>label,.home-auto-dialog .auto-checks label,.seerr-season-dialog label){background:rgba(25,39,56,.7);border-color:var(--border)}

body .home-auth-message{max-width:620px;margin:10vh auto;padding:24px;background:var(--navy-card);border:1px solid var(--border);border-radius:14px}body .home-auth-message a{display:inline-flex;align-items:center;min-height:44px}
body :is(.recipe-filters,.recipe-editor-section,.recipe-history-row,.permission-group,.user-rights-group,.guest-feature-groups>section,.guest-hue-group,.user-hue-group,.presence-history,.app-admin-api,.app-admin-status-grid article,.home-menu-node){background:var(--navy-card);border-color:var(--border);border-radius:14px}
body :is(.recipe-ingredient,.recipe-step-editor,.recipe-nutrition,.recipe-nutrient,.container-metrics div,.user-editor-switch,.user-editor-meta span,.mini-right-switch,.mini-right-static,.guest-admin-status,.guest-access-url,.guest-right-toggle,.presence-forgotten-row,.push-delivery-row){background:rgba(16,30,50,.75);border-color:var(--border)}
body :is(.home-user-editor-tabs,.user-rights-tabs,.guest-admin-tabs,.presence-admin-tabs,.auto-editor-tabs,.permission-savebar,.home-user-editor-actions){background:rgba(23,37,60,.96);border-color:var(--border)}body :is(.home-user-editor-tabs,.user-rights-tabs,.guest-admin-tabs,.presence-admin-tabs,.auto-editor-tabs) button{border-radius:999px}
body .home-editor.home-editor button.primary-modal{background:#247aec;border-color:#58b5fa55}
body [data-auto-list] article.auto-rule-card{background:var(--navy-card);border-color:var(--border)}
body .recipe-dialog.home-editor,body .modal[data-pa-modal] .modal-dialog{background:linear-gradient(to bottom left,#202e4a,#111c2e);color:var(--text);border-color:var(--border)}
body .recipe-dialog .home-editor-head,body .recipe-cooking-dialog>.home-editor-actions,body .reminder-form .home-editor-actions,body .modal[data-pa-modal] .modal-header,body .home-auto-dialog .auto-footer{background:rgba(23,37,60,.96);border-color:var(--border)}
body .home-editor.home-editor :is(input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea){background:rgba(16,30,50,.75);color:var(--text);border-color:var(--border)}
