/* Inline home/theme pair: no new toolbar, padding row, fixed overlay, or placeholder. */
[data-return-home][hidden]{display:none!important}
body .tq-home-theme{display:inline-flex;align-items:center;justify-content:flex-end;gap:6px;flex:0 0 auto;flex-wrap:nowrap;max-width:100%;vertical-align:middle;white-space:nowrap}
body .tq-home-link{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;min-height:36px;padding:7px 12px;border:.5px solid rgba(0,0,0,.1);border-radius:999px;background:rgba(255,255,255,.66);color:#1c1c1e;-webkit-backdrop-filter:blur(18px) saturate(180%);backdrop-filter:blur(18px) saturate(180%);transition:background .15s,transform .15s;font:600 13px/1.25 -apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;white-space:nowrap;text-decoration:none;touch-action:manipulation;flex:0 0 auto}
body .tq-home-link:hover{background:rgba(255,255,255,.95);transform:translateY(-1px)}
body .tq-home-link:focus-visible{outline:2px solid #367c68;outline-offset:2px}
body .tq-home-link.is-dark{background:rgba(255,255,255,.08);color:#f2f4f8;border-color:rgba(255,255,255,.16)}
body .tq-home-link.is-dark:hover{background:rgba(255,255,255,.16)}
body .tq-home-link.is-dark:focus-visible{outline-color:#e7d0a0}
body .tq-home-theme>button{box-sizing:border-box;flex:0 0 auto;white-space:nowrap;border-radius:999px;border:.5px solid rgba(0,0,0,.1);background:rgba(255,255,255,.66);-webkit-backdrop-filter:blur(18px) saturate(180%);backdrop-filter:blur(18px) saturate(180%);transition:background .15s,transform .15s}
body .tq-home-theme>button:hover{background:rgba(255,255,255,.95);transform:translateY(-1px)}
body .tq-home-theme:has(.is-dark)>button{background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.16)}
body .tq-home-theme:has(.is-dark)>button:hover{background:rgba(255,255,255,.16)}
/* Optional Navbar slot keeps the pair at the real top-right, outside the collapsed phone menu. */
.image2-workflow-shell>.ui-navbar>.tq-home-theme{order:3;margin-left:auto}
.image2-workflow-shell>.ui-navbar>.ui-navbar-actions{order:2}
@media(max-width:600px){
 /* Keep the existing admin appbar on one line; primary pair stays visible, other actions remain swipe-accessible. */
 .admin-mode .topbar.admin-appbar{display:flex!important;flex-wrap:nowrap!important;height:auto!important;min-height:52px!important;gap:8px!important}
 .admin-mode .topbar.admin-appbar>.hero{flex:0 1 auto;width:auto!important;min-width:0}
 .admin-mode .topbar.admin-appbar .admin-appbar-actions{flex:1 1 0!important;min-width:0;overflow-x:auto!important;overflow-y:hidden;scrollbar-width:none}
 .admin-mode .topbar.admin-appbar .admin-appbar-actions::-webkit-scrollbar{display:none}
 .admin-mode .admin-appbar-actions>.tq-home-theme{order:-1}

 .image2-workflow-shell>.ui-navbar>.ui-navbar-brand{min-width:0;flex:1 1 0}
 .image2-workflow-shell>.ui-navbar>.tq-home-theme{order:1;margin-left:auto}
 .image2-workflow-shell>.ui-navbar>.mobile-workspace-menu{order:2}
 .image2-workflow-shell>.ui-navbar>.ui-navbar-actions{order:3}
 /* Qimen keeps its existing 52px row; remaining actions are swipe-accessible. */
 .navbar:has(.tq-home-theme){grid-template-columns:auto minmax(0,1fr) auto;column-gap:8px;height:52px;min-height:52px;padding-top:4px;padding-bottom:4px}
 .navbar:has(.tq-home-theme) .nav-actions{justify-content:flex-start;flex-wrap:nowrap;max-width:160px;gap:6px;overflow-x:auto;scrollbar-width:none}
 .navbar:has(.tq-home-theme) .nav-actions::-webkit-scrollbar{display:none}
 .navbar:has(.tq-home-theme) [data-system-switcher]{flex:0 0 auto;min-width:0;max-width:none}
 .navbar:has(.tq-home-theme) [data-system-switcher] .ss-row{flex-wrap:nowrap}

 body .tq-home-link{min-height:44px;padding:9px 10px;font-size:13px}
}
@media print{[data-return-home]{display:none!important}}

@media(prefers-reduced-motion:reduce){body .tq-home-link,body .tq-home-theme>button{transition:none;transform:none}}
