/* Quiet Neighbor Portal — based on the supplied warm dashboard reference. */
body.qn-open{overflow:hidden}
/* Keep the shared Login above the full-screen Portal, including its inline z-index. */
body.qn-open #authModal{z-index:2700!important}
#nsQuietNeighborPortal{position:fixed;inset:0;z-index:2600;overflow:auto;overscroll-behavior:contain;background:#fffcf8;color:#1a1d23;font:400 14px/1.6 Prompt,"Noto Sans Thai",system-ui,sans-serif;-webkit-font-smoothing:antialiased}
#nsQuietNeighborPortal *{box-sizing:border-box}
#nsQuietNeighborPortal button,#nsQuietNeighborPortal input{font:inherit}
#nsQuietNeighborPortal button{cursor:pointer}
#nsQuietNeighborPortal a{color:inherit;text-decoration:none}
#nsQuietNeighborPortal .qn-shell{max-width:1440px;min-height:100%;margin:0 auto;padding:0 28px 32px}
#nsQuietNeighborPortal .qn-topbar{height:78px;display:flex;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid #f3e8dd}
#nsQuietNeighborPortal .qn-brand{display:flex;align-items:center;gap:11px}
#nsQuietNeighborPortal .qn-brand>span:last-child{display:flex;flex-direction:column;line-height:1.2}
#nsQuietNeighborPortal .qn-brand b{font-size:16px;font-weight:700;letter-spacing:-.02em}
#nsQuietNeighborPortal .qn-brand small{font-size:11px;color:#9a8170;margin-top:4px}
#nsQuietNeighborPortal .qn-logo{width:38px;height:38px;display:grid;place-items:center;border-radius:13px;background:#1a1d23;color:#fff;font-weight:700;font-size:17px}
#nsQuietNeighborPortal .qn-top-actions{display:flex;align-items:center;gap:14px}
#nsQuietNeighborPortal .qn-user-label{font-size:12px;color:#6b7280;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#nsQuietNeighborPortal .qn-layout{display:grid;grid-template-columns:230px minmax(0,1fr);gap:28px;padding-top:26px}
#nsQuietNeighborPortal .qn-sidebar{position:sticky;top:20px;align-self:start;padding:10px 0}
#nsQuietNeighborPortal .qn-sidebar-title{font-size:10px;letter-spacing:.16em;color:#9ca3af;font-weight:700;margin:0 0 14px 12px}
#nsQuietNeighborPortal .qn-sidebar nav{display:grid;gap:6px}
#nsQuietNeighborPortal .qn-nav-item{width:100%;display:grid;grid-template-columns:34px minmax(0,1fr);grid-template-rows:auto auto;align-items:center;column-gap:10px;text-align:left;padding:11px 12px;border:1px solid transparent;border-radius:13px;background:transparent;color:#6b7280}
#nsQuietNeighborPortal .qn-nav-item:hover{background:#fff7ed;color:#1a1d23}
#nsQuietNeighborPortal .qn-nav-item.is-active{background:#1a1d23;color:#fff;border-color:#1a1d23;box-shadow:0 8px 20px rgba(26,29,35,.12)}
#nsQuietNeighborPortal .qn-nav-icon{grid-row:1/3;width:32px;height:32px;display:grid;place-items:center;border-radius:10px;background:rgba(255,107,53,.1);color:#ff6b35;font-size:16px}
#nsQuietNeighborPortal .qn-nav-item.is-active .qn-nav-icon{background:rgba(255,255,255,.1);color:#ffb07d}
#nsQuietNeighborPortal .qn-nav-label{font-size:13px;font-weight:600}
#nsQuietNeighborPortal .qn-nav-item small{font-size:10px;color:#9ca3af}
#nsQuietNeighborPortal .qn-nav-item.is-active small{color:rgba(255,255,255,.62)}
#nsQuietNeighborPortal .qn-sidebar-foot{margin:30px 8px 0;padding:15px;border:1px solid #f3e8dd;border-radius:15px;background:#fff}
#nsQuietNeighborPortal .qn-sidebar-foot span,#nsQuietNeighborPortal .qn-sidebar-foot small{display:block}
#nsQuietNeighborPortal .qn-sidebar-foot span{font-size:12px;font-weight:600}
#nsQuietNeighborPortal .qn-sidebar-foot small{font-size:10px;color:#9ca3af;margin-top:5px}
#nsQuietNeighborPortal .qn-main{min-width:0;padding-bottom:36px}
#nsQuietNeighborPortal .qn-page-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin:4px 0 22px}
#nsQuietNeighborPortal .qn-eyebrow{font-size:10px;letter-spacing:.16em;color:#ff6b35;font-weight:700}
#nsQuietNeighborPortal h1{font-size:25px;line-height:1.25;margin:5px 0 4px;font-weight:700;letter-spacing:-.03em}
#nsQuietNeighborPortal .qn-page-heading p{font-size:12px;color:#6b7280;margin:0}
#nsQuietNeighborPortal .qn-button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:39px;padding:8px 15px;border-radius:999px;border:1px solid transparent;font-size:12px;font-weight:600;transition:background .15s,border-color .15s}
#nsQuietNeighborPortal .qn-button:disabled{opacity:.55;cursor:wait}
#nsQuietNeighborPortal .qn-button-primary{background:#1a1d23;color:#fff;border-color:#1a1d23}
#nsQuietNeighborPortal .qn-button-primary:hover{background:#343944}
#nsQuietNeighborPortal .qn-button-light{background:#fff;color:#1a1d23;border-color:#f3e8dd}
#nsQuietNeighborPortal .qn-button-light:hover{background:#fff7ed}
#nsQuietNeighborPortal .qn-welcome{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:23px 26px;border-radius:21px;background:linear-gradient(120deg,#1a1d23,#2b2f3a);color:#fff;margin-bottom:16px}
#nsQuietNeighborPortal .qn-welcome small{font-size:11px;color:rgba(255,255,255,.62)}
#nsQuietNeighborPortal .qn-welcome h2{font-size:21px;margin:3px 0;font-weight:600}
#nsQuietNeighborPortal .qn-welcome p{font-size:12px;color:rgba(255,255,255,.7);margin:0}
#nsQuietNeighborPortal .qn-welcome-mark{width:46px;height:46px;display:grid;place-items:center;border:1px solid rgba(255,255,255,.2);border-radius:16px;color:#ff9a5c;font-size:22px;font-weight:700}
#nsQuietNeighborPortal .qn-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px;margin-bottom:16px}
#nsQuietNeighborPortal .qn-stat{padding:16px 17px;background:#fff;border:1px solid #f3e8dd;border-radius:17px}
#nsQuietNeighborPortal .qn-stat-top{display:flex;align-items:center;justify-content:space-between;color:#6b7280;font-size:11px}
#nsQuietNeighborPortal .qn-stat-top i{font-style:normal;color:#ff6b35;font-size:16px}
#nsQuietNeighborPortal .qn-stat strong{display:block;font-size:25px;line-height:1.2;margin:9px 0 4px;font-weight:700}
#nsQuietNeighborPortal .qn-stat small{font-size:10px;color:#9ca3af}
#nsQuietNeighborPortal .qn-grid-two{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px;margin-bottom:15px}
#nsQuietNeighborPortal .qn-panel{background:#fff;border:1px solid #f3e8dd;border-radius:19px;padding:19px;min-width:0;margin-bottom:15px}
#nsQuietNeighborPortal .qn-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:15px}
#nsQuietNeighborPortal .qn-panel-head h2{font-size:14px;font-weight:700;margin:0}
#nsQuietNeighborPortal .qn-panel-head p{font-size:10px;color:#9ca3af;margin:3px 0 0}
#nsQuietNeighborPortal .qn-text-button{border:0;background:transparent;color:#b46b34;font-size:11px;font-weight:600;padding:5px}
#nsQuietNeighborPortal .qn-text-button:hover{text-decoration:underline}
#nsQuietNeighborPortal .qn-danger-text{color:#c9473e}
#nsQuietNeighborPortal .qn-empty{display:flex;flex-direction:column;align-items:center;text-align:center;padding:25px 14px}
#nsQuietNeighborPortal .qn-empty-icon{width:44px;height:44px;border-radius:15px;display:grid;place-items:center;background:#fff7ed;color:#ff6b35;font-size:21px;margin-bottom:10px}
#nsQuietNeighborPortal .qn-empty h3{font-size:13px;margin:0 0 4px;font-weight:700}
#nsQuietNeighborPortal .qn-empty p{font-size:11px;color:#9ca3af;max-width:420px;margin:0}
#nsQuietNeighborPortal .qn-device-list,#nsQuietNeighborPortal .qn-event-list,#nsQuietNeighborPortal .qn-activity-list{display:grid;gap:9px}
#nsQuietNeighborPortal .qn-device-card{border:1px solid #f3e8dd;border-radius:14px;padding:13px;background:#fffcf8}
#nsQuietNeighborPortal .qn-device-head{display:flex;justify-content:space-between;gap:10px}
#nsQuietNeighborPortal .qn-device-head small{font-size:9px;letter-spacing:.12em;color:#9ca3af}
#nsQuietNeighborPortal .qn-device-head h3{font-size:13px;margin:3px 0 0;font-weight:700}
#nsQuietNeighborPortal .qn-device-head p{font-size:10px;color:#9ca3af;margin:1px 0}
#nsQuietNeighborPortal .qn-status{display:inline-flex;align-items:center;white-space:nowrap;border-radius:999px;padding:4px 9px;font-size:9px;border:1px solid #f3e8dd;background:#fff;color:#6b7280;height:max-content}
#nsQuietNeighborPortal .qn-status.is-online{color:#047857;border-color:#d1fae5;background:#ecfdf5}
#nsQuietNeighborPortal .qn-status.is-muted{color:#8a6a4b;background:#fff7ed;border-color:#f3e8dd}
#nsQuietNeighborPortal .qn-device-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-top:13px}
#nsQuietNeighborPortal .qn-device-metrics>div{padding:8px;background:#fff;border-radius:9px}
#nsQuietNeighborPortal .qn-device-metrics small,#nsQuietNeighborPortal .qn-device-metrics b{display:block}
#nsQuietNeighborPortal .qn-device-metrics small{font-size:9px;color:#9ca3af}
#nsQuietNeighborPortal .qn-device-metrics b{font-size:11px;margin-top:3px}
#nsQuietNeighborPortal .qn-device-foot{font-size:9px;color:#9ca3af;margin-top:10px}
#nsQuietNeighborPortal .qn-event-row{display:flex;align-items:center;gap:9px;padding:11px 0;border-bottom:1px solid #f7f1e9;min-width:0}
#nsQuietNeighborPortal .qn-event-row:last-child{border-bottom:0}
#nsQuietNeighborPortal .qn-level{width:8px;height:8px;flex:0 0 8px;border-radius:50%;background:#9ca3af}
#nsQuietNeighborPortal .qn-level-warning{background:#d99a1f}
#nsQuietNeighborPortal .qn-level-danger{background:#c9473e}
#nsQuietNeighborPortal .qn-event-main{flex:1;min-width:0}
#nsQuietNeighborPortal .qn-event-main b,#nsQuietNeighborPortal .qn-event-main small{display:block}
#nsQuietNeighborPortal .qn-event-main b{font-size:11px}
#nsQuietNeighborPortal .qn-event-main small{font-size:9px;color:#9ca3af;margin-top:2px}
#nsQuietNeighborPortal .qn-event-row .qn-text-button{flex:0 0 auto}
#nsQuietNeighborPortal .qn-activity-row{display:flex;align-items:flex-start;gap:14px;padding:10px 0;border-bottom:1px solid #f7f1e9}
#nsQuietNeighborPortal .qn-activity-row:last-child{border-bottom:0}
#nsQuietNeighborPortal .qn-activity-row time{width:150px;flex:0 0 150px;font-size:10px;color:#9ca3af}
#nsQuietNeighborPortal .qn-activity-row b,#nsQuietNeighborPortal .qn-activity-row small{display:block}
#nsQuietNeighborPortal .qn-activity-row b{font-size:11px}
#nsQuietNeighborPortal .qn-activity-row small{font-size:10px;color:#6b7280;margin-top:2px}
#nsQuietNeighborPortal .qn-filter-row{display:flex;gap:8px;overflow-x:auto;padding-bottom:10px;margin-bottom:6px}
#nsQuietNeighborPortal .qn-filter{white-space:nowrap;border:1px solid #f3e8dd;border-radius:999px;background:#fff;padding:7px 14px;font-size:11px;color:#6b7280}
#nsQuietNeighborPortal .qn-filter.is-active{background:#1a1d23;color:#fff;border-color:#1a1d23}
#nsQuietNeighborPortal .qn-contact-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
#nsQuietNeighborPortal .qn-contact-card{border:1px solid #f3e8dd;border-radius:18px;background:#fff;padding:17px;min-width:0}
#nsQuietNeighborPortal .qn-contact-top{display:flex;justify-content:space-between;font-size:10px;color:#9ca3af}
#nsQuietNeighborPortal .qn-contact-dot{color:#ff6b35}
#nsQuietNeighborPortal .qn-contact-person{display:flex;align-items:center;gap:10px;margin:16px 0 10px}
#nsQuietNeighborPortal .qn-avatar{width:38px;height:38px;display:grid;place-items:center;border-radius:13px;background:#1a1d23;color:#fff;font-size:14px;font-weight:700}
#nsQuietNeighborPortal .qn-contact-person h3{font-size:13px;margin:0;font-weight:700}
#nsQuietNeighborPortal .qn-contact-person p{font-size:10px;color:#9ca3af;margin:2px 0 0}
#nsQuietNeighborPortal .qn-phone{display:inline-block;font-size:13px;font-weight:600;margin:4px 0 12px}
#nsQuietNeighborPortal .qn-contact-channels{display:flex;gap:7px;flex-wrap:wrap}
#nsQuietNeighborPortal .qn-contact-channels span{border:1px solid #f3e8dd;border-radius:999px;padding:4px 8px;font-size:9px;color:#6b7280}
#nsQuietNeighborPortal .qn-contact-actions{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:15px;padding-top:12px;border-top:1px solid #f7f1e9}
#nsQuietNeighborPortal .qn-settings-panel{max-width:850px}
#nsQuietNeighborPortal .qn-form-section{padding:4px 0 20px;margin-bottom:17px;border-bottom:1px solid #f7f1e9}
#nsQuietNeighborPortal .qn-form-section h2{font-size:14px;margin:0 0 14px}
#nsQuietNeighborPortal .qn-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
#nsQuietNeighborPortal label{display:block;font-size:11px;font-weight:600;color:#51463a}
#nsQuietNeighborPortal input:not([type=checkbox]):not([type=range]){display:block;width:100%;min-width:0;margin-top:6px;padding:11px 12px;border:1px solid #f3e8dd;border-radius:11px;background:#fffcf8;color:#1a1d23;font-size:13px;outline-offset:2px}
#nsQuietNeighborPortal .qn-range-label{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:14px 0 6px}
#nsQuietNeighborPortal .qn-range-label b{font-size:11px;color:#ff6b35}
#nsQuietNeighborPortal .qn-range{width:100%;accent-color:#ff6b35}
#nsQuietNeighborPortal .qn-range-scale{display:flex;justify-content:space-between;color:#9ca3af;font-size:9px}
#nsQuietNeighborPortal .qn-toggle-row{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:11px 0;border-bottom:1px solid #f7f1e9}
#nsQuietNeighborPortal .qn-toggle-row:last-child{border-bottom:0}
#nsQuietNeighborPortal .qn-toggle-row b,#nsQuietNeighborPortal .qn-toggle-row small{display:block}
#nsQuietNeighborPortal .qn-toggle-row small{font-size:10px;color:#9ca3af;font-weight:400;margin-top:2px}
#nsQuietNeighborPortal input[type=checkbox]{width:18px;height:18px;accent-color:#1a1d23;flex:0 0 auto}
#nsQuietNeighborPortal .qn-form-actions{display:flex;gap:9px;flex-wrap:wrap;margin-top:18px}
#nsQuietNeighborPortal .qn-info-note{display:flex;gap:12px;padding:13px 15px;border:1px solid #f3e8dd;border-radius:13px;background:#fff7ed;margin:12px 0}
#nsQuietNeighborPortal .qn-info-note b{flex:0 0 auto;font-size:11px}
#nsQuietNeighborPortal .qn-info-note span{font-size:10px;color:#6b7280}
#nsQuietNeighborPortal .qn-center{text-align:center;margin-top:10px}
#nsQuietNeighborPortal .qn-notice{padding:10px 13px;border-radius:12px;margin:0 0 15px;background:#ecfdf5;color:#047857;border:1px solid #d1fae5;font-size:11px}
#nsQuietNeighborPortal .qn-notice.is-error{background:#fff1f0;color:#b42318;border-color:#fecdca}
#nsQuietNeighborPortal .qn-modal-backdrop{position:fixed;inset:0;z-index:20;display:flex;align-items:center;justify-content:center;padding:16px;background:rgba(0,0,0,.35);backdrop-filter:blur(4px)}
#nsQuietNeighborPortal .qn-modal{width:min(100%,480px);max-height:90vh;overflow:auto;padding:22px;border-radius:20px;background:#fff;border:1px solid #f3e8dd;box-shadow:0 20px 60px rgba(0,0,0,.2)}
#nsQuietNeighborPortal .qn-modal-head{display:flex;justify-content:space-between;align-items:flex-start;gap:15px;margin-bottom:17px}
#nsQuietNeighborPortal .qn-modal-head small{font-size:9px;letter-spacing:.15em;color:#ff6b35}
#nsQuietNeighborPortal .qn-modal-head h2{font-size:18px;margin:4px 0 0}
#nsQuietNeighborPortal .qn-modal label{margin:12px 0}
#nsQuietNeighborPortal .qn-close{width:32px;height:32px;border-radius:50%;border:1px solid #f3e8dd;background:#fffcf8;font-size:18px}
#nsQuietNeighborPortal .qn-check-grid{display:flex;gap:18px;margin:15px 0}
#nsQuietNeighborPortal .qn-check-grid label{display:flex;align-items:center;gap:7px;margin:0;font-weight:400}
#nsQuietNeighborPortal .qn-modal-note{font-size:10px;color:#9ca3af;margin:0}
#nsQuietNeighborPortal .qn-detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
#nsQuietNeighborPortal .qn-detail-grid>div{padding:11px;border-radius:11px;background:#fffcf8;border:1px solid #f3e8dd}
#nsQuietNeighborPortal .qn-detail-grid small,#nsQuietNeighborPortal .qn-detail-grid b{display:block}
#nsQuietNeighborPortal .qn-detail-grid small{font-size:9px;color:#9ca3af}
#nsQuietNeighborPortal .qn-detail-grid b{font-size:11px;margin-top:3px}
#nsQuietNeighborPortal .qn-detail-copy{font-size:12px;color:#6b7280;line-height:1.7;margin:16px 0}
#nsQuietNeighborPortal .qn-footer{display:flex;justify-content:space-between;gap:12px;border-top:1px solid #f3e8dd;padding:17px 0 5px;color:#9ca3af;font-size:10px}
#nsQuietNeighborPortal .qn-auth-wait{min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:24px}
#nsQuietNeighborPortal .qn-auth-wait .qn-logo{width:50px;height:50px;margin-bottom:14px}
#nsQuietNeighborPortal .qn-auth-wait h1{font-size:24px}
#nsQuietNeighborPortal .qn-auth-wait p{color:#6b7280;font-size:12px;max-width:360px;margin:8px 0 15px}
#nsQuietNeighborPortal .qn-mobile-nav{display:none}
@media(max-width:980px){#nsQuietNeighborPortal .qn-shell{padding:0 18px 25px}#nsQuietNeighborPortal .qn-layout{grid-template-columns:190px minmax(0,1fr);gap:18px}#nsQuietNeighborPortal .qn-contact-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){
 #nsQuietNeighborPortal .qn-shell{padding:0 12px 84px}
 #nsQuietNeighborPortal .qn-topbar{height:65px}
 #nsQuietNeighborPortal .qn-user-label{display:none}
 #nsQuietNeighborPortal .qn-layout{display:block;padding-top:18px}
 #nsQuietNeighborPortal .qn-sidebar{display:none}
 #nsQuietNeighborPortal .qn-main{padding-bottom:10px}
 #nsQuietNeighborPortal .qn-page-heading{align-items:flex-start;flex-direction:column;margin-bottom:15px}
 #nsQuietNeighborPortal .qn-page-heading .qn-button{align-self:flex-start}
 #nsQuietNeighborPortal h1{font-size:22px}
 #nsQuietNeighborPortal .qn-welcome{padding:18px;border-radius:17px}
 #nsQuietNeighborPortal .qn-stats{grid-template-columns:1fr;gap:9px}
 #nsQuietNeighborPortal .qn-stat{padding:13px 15px}
 #nsQuietNeighborPortal .qn-stat strong{font-size:21px}
 #nsQuietNeighborPortal .qn-grid-two{grid-template-columns:1fr;gap:10px}
 #nsQuietNeighborPortal .qn-panel{padding:15px;border-radius:16px}
 #nsQuietNeighborPortal .qn-device-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
 #nsQuietNeighborPortal .qn-contact-grid{grid-template-columns:1fr}
 #nsQuietNeighborPortal .qn-form-grid{grid-template-columns:1fr}
 #nsQuietNeighborPortal .qn-activity-row{gap:9px}
 #nsQuietNeighborPortal .qn-activity-row time{width:100px;flex-basis:100px;font-size:9px}
 #nsQuietNeighborPortal .qn-event-row{flex-wrap:wrap}
 #nsQuietNeighborPortal .qn-event-row .qn-event-main{min-width:calc(100% - 30px)}
 #nsQuietNeighborPortal .qn-mobile-nav{position:fixed;z-index:10;left:0;right:0;bottom:0;display:flex;gap:2px;justify-content:space-around;padding:7px 5px calc(7px + env(safe-area-inset-bottom));background:rgba(255,255,255,.94);border-top:1px solid #f3e8dd;backdrop-filter:blur(14px)}
 #nsQuietNeighborPortal .qn-mobile-item{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:0;padding:5px 2px;border:0;border-radius:10px;background:transparent;color:#9ca3af}
 #nsQuietNeighborPortal .qn-mobile-item.is-active{background:#fff7ed;color:#1a1d23}
 #nsQuietNeighborPortal .qn-mobile-item .qn-nav-icon{width:auto;height:auto;background:transparent;color:inherit;font-size:16px}
 #nsQuietNeighborPortal .qn-mobile-item .qn-nav-label{font-size:9px;white-space:nowrap;font-weight:600}
 #nsQuietNeighborPortal .qn-footer{padding-bottom:6px}
}
@media(prefers-reduced-motion:reduce){#nsQuietNeighborPortal *{scroll-behavior:auto!important;transition:none!important}}

/* The Portal launch action sits below, never over, the existing WOW card. */
#messagesArea .ns-quiet-portal-launch{margin:12px 0 22px;padding:16px 18px;border:1px solid #f3e8dd;border-radius:16px;background:#fffaf4}
#messagesArea .ns-quiet-portal-launch p{margin:0 0 10px;color:#6b7280;font-size:12px;line-height:1.7}
#messagesArea .ns-quiet-portal-launch button{min-height:42px}
@media(max-width:767px){#messagesArea .ns-quiet-portal-launch{padding:13px;border-radius:13px}}
