/* One presentation for Classic/Developer confirmation on App and Desktop. */
html body :is(#upgradeModal,#downgradeModal).hub-mode-dialog{position:fixed;inset:0;margin:auto;width:min(440px,calc(100vw - 28px));max-width:440px;height:fit-content;max-height:calc(100dvh - 24px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));padding:0;border:1px solid #edd5f0;border-radius:26px;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;background:#fffaff;color:#30113f;box-sizing:border-box;box-shadow:0 24px 80px #35184935;backdrop-filter:none!important;font-family:'Plus Jakarta Sans',sans-serif;line-height:1.5;scrollbar-width:thin;scrollbar-color:#e3c4ec transparent}
.hub-mode-dialog:not([open]){display:none!important}.hub-mode-dialog[open]{animation:hub-mode-enter .23s cubic-bezier(.2,.8,.2,1)}
.hub-mode-dialog::backdrop{background:#29183664;backdrop-filter:blur(5px)}
.hub-mode-dialog .hub-mode-card{position:relative;padding:17px 22px 20px;background:radial-gradient(ellipse at 50% 0,#fce4f575,transparent 48%),#fffaff;min-width:0}
.hub-mode-close{position:absolute;right:10px;top:10px;display:grid;place-items:center;width:38px;height:38px;border:0;border-radius:50%;background:transparent;color:#7e648e;font:400 29px/1 sans-serif;cursor:pointer;z-index:1}
.hub-mode-close:hover{background:#f2e4fa}.hub-mode-header{text-align:center;margin:0 0 13px}.hub-mode-crown{display:block;margin:-5px auto -2px;width:72px;height:68px;object-fit:contain;filter:drop-shadow(0 4px 7px #a7759b20)}
.hub-mode-to-classic .hub-mode-crown{filter:hue-rotate(245deg) saturate(.7) drop-shadow(0 4px 7px #a7759b20)}
.hub-mode-dialog .hub-mode-header h2{margin:0;font-size:23px;letter-spacing:-.7px;line-height:1.35;font-weight:850;color:#32103e;outline:none}
.hub-mode-chip{display:inline-block;border:1px solid #d28ae3;border-radius:20px;background:#fff;padding:2px 16px;margin-top:7px;color:#ad00d8;font-size:12px;font-weight:800;line-height:1.5}
.hub-mode-comparison{display:grid;grid-template-columns:minmax(0,1fr) 25px minmax(0,1fr);gap:9px;align-items:center;margin-bottom:13px}.hub-mode-rate{min-width:0;padding:11px 7px 10px;border-radius:16px;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;line-height:1.4}
.hub-mode-rate.is-current{background:linear-gradient(125deg,#fff0e8,#ffe5ec);color:#8c2346}.hub-mode-rate.is-next{background:linear-gradient(125deg,#f7e8ff,#ecd6fc);color:#40115a}.hub-mode-rate small{font-size:10px;font-weight:800;letter-spacing:.45px}.hub-mode-rate strong{font-size:41px;font-weight:850;line-height:1.15;letter-spacing:-1.8px;margin:5px 0 2px}.hub-mode-rate>span{font-size:13px;font-weight:700}.hub-mode-arrow{font-size:29px;text-align:center;color:#c476ca;font-weight:500}
.hub-mode-classic-rates{grid-template-columns:repeat(2,minmax(0,1fr));gap:0;border:1px solid #ead0f8;border-radius:16px;background:linear-gradient(120deg,#f9eaff,#f1e2fe);padding:7px 0;margin-top:15px}.hub-mode-classic-rates .hub-mode-rate{padding:6px 8px}.hub-mode-classic-rates .hub-mode-rate+ .hub-mode-rate{border-left:1px solid #e0c2ef;border-radius:0}.hub-mode-classic-rates strong{font-size:40px;margin-top:0}.hub-mode-classic-rates .hub-mode-rate>span{font-size:13px;color:#735286;font-weight:650}
.hub-mode-benefits{list-style:none;margin:10px 0;padding:0;display:grid;gap:6px}.hub-mode-benefits li{display:flex;align-items:flex-start;gap:10px;color:#45204e;font-size:13px;font-weight:650;line-height:1.65}.hub-mode-check{display:grid;place-items:center;flex:none;margin-top:1px;width:21px;height:21px;border-radius:50%;background:linear-gradient(135deg,#c73aaa,#a83aca);color:#fff}.hub-mode-check svg{width:15px;height:15px}
.hub-mode-note{display:flex;gap:9px;align-items:flex-start;color:#82718c;margin:9px 0 0;padding-top:9px;border-top:1px solid #eeddf4}.hub-mode-note>span{flex:none;display:flex;margin-top:2px}.hub-mode-note svg{width:18px;height:18px}.hub-mode-note strong{font-size:12px;line-height:1.5;font-weight:650;display:block;color:#766280}.hub-mode-note small{display:block;font-size:10px;line-height:1.6;font-weight:500}
.hub-mode-warning{display:flex;align-items:flex-start;gap:10px;border:1px solid #f7b69b;border-radius:13px;padding:11px;background:linear-gradient(120deg,#fff1e6,#ffe7e6);color:#9e2d19;margin:12px 0}.hub-mode-warning-icon{display:grid;place-items:center;flex:none;width:28px;height:28px;border-radius:50%;background:linear-gradient(135deg,#ffb338,#f47804);color:#fff;font-size:22px;font-weight:800;line-height:1;margin-top:1px}.hub-mode-warning strong{font-size:13px;line-height:1.6;font-weight:850}.hub-mode-warning p{font-size:12px;line-height:1.65;margin:3px 0 0;font-weight:650}
.hub-mode-details{margin:10px 0 11px;border-block:1px solid #eeddf4}.hub-mode-details>summary{display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:40px;padding:8px 0;list-style:none;box-sizing:border-box;color:#9900bc;font-size:13px;font-weight:800;cursor:pointer}.hub-mode-details>summary::-webkit-details-marker{display:none}.hub-mode-details>summary>svg{width:17px;height:17px;flex:none;transition:transform .18s}.hub-mode-details[open]>summary>svg{transform:rotate(180deg)}
.hub-mode-details-content{font-size:12px;line-height:1.8;padding:1px 0 12px;color:#75627f}.hub-mode-details-content p{margin:0 0 10px}.hub-mode-details-content p:last-child{margin-bottom:0}.hub-mode-details-content :is(table,article,section){font-size:inherit;max-width:100%}.hub-mode-details-content .hub-public-tiers{overflow-x:auto}.hub-mode-comparison-link{color:#9e159d;text-decoration:underline;text-underline-offset:3px;font-weight:750;display:inline-flex;min-height:36px;align-items:center}
.hub-mode-form{margin:0}.hub-mode-auth-label{display:block;font-size:12px;font-weight:750;line-height:1.6;margin:0 0 5px;color:#4c285a}.hub-mode-auth-field{position:relative;display:flex;align-items:center;gap:9px;min-height:46px;border:1px solid #dfcaeb;border-radius:12px;background:#fff;box-sizing:border-box;padding:0 11px}.hub-mode-auth-field:focus-within{border-color:#ca48cf;box-shadow:0 0 0 3px #eac9f466}.hub-mode-auth-icon{display:flex;flex:none;color:#8f739e}.hub-mode-auth-icon svg{width:19px;height:19px}.hub-mode-auth-field input{min-width:0;flex:1;width:100%;padding:10px 0;border:0;outline:0;box-shadow:none;background:transparent;color:#382046;font:500 16px/1.5 'Plus Jakarta Sans',sans-serif;border-radius:0;box-sizing:border-box}.hub-mode-auth-field input::placeholder{color:#aa94b5}.hub-mode-auth-field input[inputmode=numeric]{letter-spacing:3px}.hub-mode-auth-field input[inputmode=numeric]::placeholder{letter-spacing:0;font-size:14px}
.hub-mode-reveal{display:grid;place-items:center;flex:none;width:34px;height:38px;border:0;border-radius:8px;background:transparent;color:#80638f;cursor:pointer;padding:7px}.hub-mode-reveal svg{width:20px;height:20px}.hub-mode-actions{display:grid;grid-template-columns:minmax(0,.95fr) minmax(0,1.2fr);gap:10px;margin:13px 0 0}.hub-mode-actions button{box-sizing:border-box;min-height:45px;border-radius:12px;padding:10px 6px;display:flex;align-items:center;justify-content:center;font:800 13px/1.4 'Plus Jakarta Sans',sans-serif;cursor:pointer}.hub-mode-cancel{border:1px solid #c65cda;background:#fff;color:#9c0dc1}.hub-mode-submit{border:1px solid transparent;background:linear-gradient(105deg,#ed04ad,#a713ec);box-shadow:0 4px 9px #c13fc11d;color:#fff}.hub-mode-actions button:disabled{opacity:.65;cursor:wait}
.hub-mode-dialog :is(button,summary,a):focus-visible{outline:3px solid #ae57dc;outline-offset:3px}.hub-mode-dialog .hub-mode-header h2:focus-visible{outline:none}
@keyframes hub-mode-enter{from{opacity:0;translate:0 12px;scale:.98}to{opacity:1;translate:0 0;scale:1}}
@media(max-width:359px),(max-height:680px){.hub-mode-dialog .hub-mode-card{padding:13px 16px 16px}.hub-mode-header{margin-bottom:10px}.hub-mode-crown{width:54px;height:48px}.hub-mode-dialog .hub-mode-header h2{font-size:20px}.hub-mode-rate{padding-block:8px}.hub-mode-rate strong{font-size:35px;margin-top:2px}.hub-mode-rate>span{font-size:12px}.hub-mode-comparison{margin-bottom:9px}.hub-mode-benefits{gap:4px;margin:8px 0}.hub-mode-benefits li{font-size:12px}.hub-mode-note{margin-top:7px;padding-top:7px}.hub-mode-details{margin-block:8px}.hub-mode-details>summary{min-height:36px;padding-block:7px;font-size:12px}.hub-mode-warning{margin-block:9px;padding:9px}.hub-mode-actions{margin-top:10px;gap:8px}.hub-mode-actions button{font-size:12px;min-height:44px}}
@media(prefers-reduced-motion:reduce){.hub-mode-dialog[open]{animation:none}.hub-mode-details>summary>svg{transition:none}}
@media(forced-colors:active){.hub-mode-dialog .hub-mode-card,.hub-mode-comparison,.hub-mode-rate,.hub-mode-warning{background:Canvas;color:CanvasText}.hub-mode-submit{background:ButtonFace;color:ButtonText;border:1px solid ButtonText}.hub-mode-check{background:Canvas;color:CanvasText;outline:1px solid CanvasText}.hub-mode-close{color:ButtonText}}

body:has(dialog.hub-mode-dialog[open]){overflow:hidden}

/* The existing shared dot loader must paint in the native dialog's top layer. */
.hub-mode-dialog .hub-page-loader.hub-mode-wait{position:fixed;inset:calc(94px + env(safe-area-inset-top,0px)) auto auto 50%;margin:0;transform:translateX(-50%);z-index:5;color:#493054;max-width:calc(100vw - 32px)}
.ha-page .hub-mode-result{display:flex;gap:8px;align-items:center;margin:0 0 12px;padding:10px 12px;border:1px solid #e7c5ef;border-radius:13px;background:#fbf0ff;color:#85339d;font-size:13px;font-weight:750;line-height:1.6}.hub-mode-result>span{display:grid;place-items:center;border-radius:50%;width:22px;height:22px;background:#bb34bc;color:#fff;flex:none}.ha-page .ha-membership.is-mode-celebrating{animation:hub-mode-card-glow .8s ease-in-out 3}.hub-mode-confetti{position:fixed;inset:0;width:100%;height:100%;z-index:85;pointer-events:none!important}
@keyframes hub-mode-card-glow{50%{box-shadow:0 0 0 3px #ebaff163,0 0 30px #d747c82b}}
@media(prefers-reduced-motion:reduce){.ha-page .ha-membership.is-mode-celebrating{animation:none}}
